@ours.network/messenger-server 1.0.16 → 1.0.18

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 (133) hide show
  1. package/README.md +44 -0
  2. package/dist/chunks/{chunk-XTLMQC4C.js → chunk-PRK6P4OX.js} +1 -1
  3. package/dist/chunks/{server-E57EQNMC.js → server-JWHXNVMM.js} +1493 -1139
  4. package/dist/cli.js +4 -3
  5. package/dist/web/assets/{abnfDiagram-N423BO3Z-zYLPcj1g.js → abnfDiagram-N423BO3Z-CaNAt0IP.js} +2 -2
  6. package/dist/web/assets/{abnfDiagram-N423BO3Z-zYLPcj1g.js.map → abnfDiagram-N423BO3Z-CaNAt0IP.js.map} +1 -1
  7. package/dist/web/assets/{arc-BFMe4chQ.js → arc-ri02Lqr2.js} +2 -2
  8. package/dist/web/assets/{arc-BFMe4chQ.js.map → arc-ri02Lqr2.js.map} +1 -1
  9. package/dist/web/assets/{architectureDiagram-T3A2C74G-BKelkZKH.js → architectureDiagram-T3A2C74G-BcWe26Zl.js} +2 -2
  10. package/dist/web/assets/{architectureDiagram-T3A2C74G-BKelkZKH.js.map → architectureDiagram-T3A2C74G-BcWe26Zl.js.map} +1 -1
  11. package/dist/web/assets/{blockDiagram-VBNYF7ZC-CHED2d6n.js → blockDiagram-VBNYF7ZC-B9XdY5wU.js} +2 -2
  12. package/dist/web/assets/{blockDiagram-VBNYF7ZC-CHED2d6n.js.map → blockDiagram-VBNYF7ZC-B9XdY5wU.js.map} +1 -1
  13. package/dist/web/assets/{browser-C90Z8xCa.js → browser-PbepkUqh.js} +2 -2
  14. package/dist/web/assets/{browser-C90Z8xCa.js.map → browser-PbepkUqh.js.map} +1 -1
  15. package/dist/web/assets/{c4Diagram-5PPSVZJV-BM9MTPjg.js → c4Diagram-5PPSVZJV-BOhZdiso.js} +2 -2
  16. package/dist/web/assets/{c4Diagram-5PPSVZJV-BM9MTPjg.js.map → c4Diagram-5PPSVZJV-BOhZdiso.js.map} +1 -1
  17. package/dist/web/assets/channel-B-t5DHUk.js +2 -0
  18. package/dist/web/assets/{channel-CNo4GWLb.js.map → channel-B-t5DHUk.js.map} +1 -1
  19. package/dist/web/assets/{chunk-2GRJ4B5K-C4iVGbxx.js → chunk-2GRJ4B5K-BmDtDHkM.js} +2 -2
  20. package/dist/web/assets/{chunk-2GRJ4B5K-C4iVGbxx.js.map → chunk-2GRJ4B5K-BmDtDHkM.js.map} +1 -1
  21. package/dist/web/assets/{chunk-2Q5K7J3B-Dve8Pse2.js → chunk-2Q5K7J3B-BO2yESYY.js} +2 -2
  22. package/dist/web/assets/{chunk-2Q5K7J3B-Dve8Pse2.js.map → chunk-2Q5K7J3B-BO2yESYY.js.map} +1 -1
  23. package/dist/web/assets/{chunk-5RXB4S5H-C2oB-qjN.js → chunk-5RXB4S5H-kiRAsZwd.js} +2 -2
  24. package/dist/web/assets/{chunk-5RXB4S5H-C2oB-qjN.js.map → chunk-5RXB4S5H-kiRAsZwd.js.map} +1 -1
  25. package/dist/web/assets/{chunk-5VM5RSS4-DWcZ1FCf.js → chunk-5VM5RSS4-xV0NOwF4.js} +2 -2
  26. package/dist/web/assets/{chunk-5VM5RSS4-DWcZ1FCf.js.map → chunk-5VM5RSS4-xV0NOwF4.js.map} +1 -1
  27. package/dist/web/assets/{chunk-6Q2QTUOP-DiQ5-a8V.js → chunk-6Q2QTUOP-8NePja9o.js} +2 -2
  28. package/dist/web/assets/{chunk-6Q2QTUOP-DiQ5-a8V.js.map → chunk-6Q2QTUOP-8NePja9o.js.map} +1 -1
  29. package/dist/web/assets/{chunk-GF5L2VYU-CFdwjOhW.js → chunk-GF5L2VYU-CUJFN94c.js} +2 -2
  30. package/dist/web/assets/{chunk-GF5L2VYU-CFdwjOhW.js.map → chunk-GF5L2VYU-CUJFN94c.js.map} +1 -1
  31. package/dist/web/assets/{chunk-JWPE2WC7-Bw73DQVt.js → chunk-JWPE2WC7-CmSXGXsn.js} +2 -2
  32. package/dist/web/assets/{chunk-JWPE2WC7-Bw73DQVt.js.map → chunk-JWPE2WC7-CmSXGXsn.js.map} +1 -1
  33. package/dist/web/assets/{chunk-KBJHAD2P-DjRu5gDe.js → chunk-KBJHAD2P-BwZFX8JQ.js} +2 -2
  34. package/dist/web/assets/{chunk-KBJHAD2P-DjRu5gDe.js.map → chunk-KBJHAD2P-BwZFX8JQ.js.map} +1 -1
  35. package/dist/web/assets/{chunk-RYQCIY6F-DH_lQJgv.js → chunk-RYQCIY6F-Dc_jHsY9.js} +2 -2
  36. package/dist/web/assets/{chunk-RYQCIY6F-DH_lQJgv.js.map → chunk-RYQCIY6F-Dc_jHsY9.js.map} +1 -1
  37. package/dist/web/assets/{chunk-XXDRQBXY-D-sQ51mo.js → chunk-XXDRQBXY-BSpU2O2R.js} +2 -2
  38. package/dist/web/assets/{chunk-XXDRQBXY-D-sQ51mo.js.map → chunk-XXDRQBXY-BSpU2O2R.js.map} +1 -1
  39. package/dist/web/assets/classDiagram-JCYQIIEL-GYNSwMqh.js +2 -0
  40. package/dist/web/assets/{classDiagram-JCYQIIEL-n1b9u-Rf.js.map → classDiagram-JCYQIIEL-GYNSwMqh.js.map} +1 -1
  41. package/dist/web/assets/classDiagram-v2-OCEON4UE-GYNSwMqh.js +2 -0
  42. package/dist/web/assets/{classDiagram-v2-OCEON4UE-n1b9u-Rf.js.map → classDiagram-v2-OCEON4UE-GYNSwMqh.js.map} +1 -1
  43. package/dist/web/assets/{cose-bilkent-JH36ORCC-DqKiC30z.js → cose-bilkent-JH36ORCC-D-4EPeBC.js} +2 -2
  44. package/dist/web/assets/{cose-bilkent-JH36ORCC-DqKiC30z.js.map → cose-bilkent-JH36ORCC-D-4EPeBC.js.map} +1 -1
  45. package/dist/web/assets/{cynefin-VYW2F7L2-NdwQRwjo.js → cynefin-VYW2F7L2-DghzfVZI.js} +2 -2
  46. package/dist/web/assets/{cynefin-VYW2F7L2-NdwQRwjo.js.map → cynefin-VYW2F7L2-DghzfVZI.js.map} +1 -1
  47. package/dist/web/assets/{cynefinDiagram-MW4NZA55-BQAM0nx5.js → cynefinDiagram-MW4NZA55-BHcay-r_.js} +2 -2
  48. package/dist/web/assets/{cynefinDiagram-MW4NZA55-BQAM0nx5.js.map → cynefinDiagram-MW4NZA55-BHcay-r_.js.map} +1 -1
  49. package/dist/web/assets/{dagre-VZM6K2ZE-BakUuCWI.js → dagre-VZM6K2ZE-Des0F0T2.js} +2 -2
  50. package/dist/web/assets/{dagre-VZM6K2ZE-BakUuCWI.js.map → dagre-VZM6K2ZE-Des0F0T2.js.map} +1 -1
  51. package/dist/web/assets/{diagram-7IWD3JNH-DqlokNoJ.js → diagram-7IWD3JNH-CyIsW9-s.js} +2 -2
  52. package/dist/web/assets/{diagram-7IWD3JNH-DqlokNoJ.js.map → diagram-7IWD3JNH-CyIsW9-s.js.map} +1 -1
  53. package/dist/web/assets/{diagram-B4RE2ZJO-CxfL2Ohr.js → diagram-B4RE2ZJO-CPfT5zo4.js} +2 -2
  54. package/dist/web/assets/{diagram-B4RE2ZJO-CxfL2Ohr.js.map → diagram-B4RE2ZJO-CPfT5zo4.js.map} +1 -1
  55. package/dist/web/assets/{diagram-LBJQPF4R-Bf5hVD55.js → diagram-LBJQPF4R-BnhAYxgj.js} +2 -2
  56. package/dist/web/assets/{diagram-LBJQPF4R-Bf5hVD55.js.map → diagram-LBJQPF4R-BnhAYxgj.js.map} +1 -1
  57. package/dist/web/assets/{diagram-Q27KOJAE-CvO71PHg.js → diagram-Q27KOJAE-BTUkMYjS.js} +2 -2
  58. package/dist/web/assets/{diagram-Q27KOJAE-CvO71PHg.js.map → diagram-Q27KOJAE-BTUkMYjS.js.map} +1 -1
  59. package/dist/web/assets/{diagram-UB23O5K3-iQhxWPij.js → diagram-UB23O5K3-BO_rjksX.js} +2 -2
  60. package/dist/web/assets/{diagram-UB23O5K3-iQhxWPij.js.map → diagram-UB23O5K3-BO_rjksX.js.map} +1 -1
  61. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-3knPZeRi.js → ebnfDiagram-BXEA7PRR-Bfw7baSq.js} +2 -2
  62. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-3knPZeRi.js.map → ebnfDiagram-BXEA7PRR-Bfw7baSq.js.map} +1 -1
  63. package/dist/web/assets/{erDiagram-JOGREHBK-BusNzhCo.js → erDiagram-JOGREHBK-CGBfvZDV.js} +2 -2
  64. package/dist/web/assets/{erDiagram-JOGREHBK-BusNzhCo.js.map → erDiagram-JOGREHBK-CGBfvZDV.js.map} +1 -1
  65. package/dist/web/assets/{flowDiagram-UKHOOZJN-D1GiHCui.js → flowDiagram-UKHOOZJN-B5EmiiTz.js} +2 -2
  66. package/dist/web/assets/{flowDiagram-UKHOOZJN-D1GiHCui.js.map → flowDiagram-UKHOOZJN-B5EmiiTz.js.map} +1 -1
  67. package/dist/web/assets/{ganttDiagram-PKOTCBZU-cQM02Z_A.js → ganttDiagram-PKOTCBZU-CGqSoEb0.js} +2 -2
  68. package/dist/web/assets/{ganttDiagram-PKOTCBZU-cQM02Z_A.js.map → ganttDiagram-PKOTCBZU-CGqSoEb0.js.map} +1 -1
  69. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-mys_yOmq.js → gitGraphDiagram-DS77QQ5N-DH6rsz4e.js} +2 -2
  70. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-mys_yOmq.js.map → gitGraphDiagram-DS77QQ5N-DH6rsz4e.js.map} +1 -1
  71. package/dist/web/assets/index-C00qXlD3.js +321 -0
  72. package/dist/web/assets/index-C00qXlD3.js.map +1 -0
  73. package/dist/web/assets/index-x_ixrgA8.css +1 -0
  74. package/dist/web/assets/{infoDiagram-6WML65LV-CYUIhFE6.js → infoDiagram-6WML65LV-8GyCoK8Y.js} +2 -2
  75. package/dist/web/assets/{infoDiagram-6WML65LV-CYUIhFE6.js.map → infoDiagram-6WML65LV-8GyCoK8Y.js.map} +1 -1
  76. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-D0gaNJgz.js → ishikawaDiagram-WSZJBQD7-DsTRK7c-.js} +2 -2
  77. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-D0gaNJgz.js.map → ishikawaDiagram-WSZJBQD7-DsTRK7c-.js.map} +1 -1
  78. package/dist/web/assets/{journeyDiagram-NVQOT4AX-DIhXjZwD.js → journeyDiagram-NVQOT4AX-CoEJq9zb.js} +2 -2
  79. package/dist/web/assets/{journeyDiagram-NVQOT4AX-DIhXjZwD.js.map → journeyDiagram-NVQOT4AX-CoEJq9zb.js.map} +1 -1
  80. package/dist/web/assets/{jsQR-C8ubx0fr.js → jsQR-BOfQcojE.js} +2 -2
  81. package/dist/web/assets/{jsQR-C8ubx0fr.js.map → jsQR-BOfQcojE.js.map} +1 -1
  82. package/dist/web/assets/{kanban-definition-27J2QSJJ-BxGDo3GN.js → kanban-definition-27J2QSJJ-DIzs-NjM.js} +2 -2
  83. package/dist/web/assets/{kanban-definition-27J2QSJJ-BxGDo3GN.js.map → kanban-definition-27J2QSJJ-DIzs-NjM.js.map} +1 -1
  84. package/dist/web/assets/{linear-CUc_zRCa.js → linear-DFz1zZyg.js} +2 -2
  85. package/dist/web/assets/{linear-CUc_zRCa.js.map → linear-DFz1zZyg.js.map} +1 -1
  86. package/dist/web/assets/{mermaid.core-CT_PukdE.js → mermaid.core-f1Ho-4dn.js} +5 -5
  87. package/dist/web/assets/{mermaid.core-CT_PukdE.js.map → mermaid.core-f1Ho-4dn.js.map} +1 -1
  88. package/dist/web/assets/{mindmap-definition-FAOFIHXS-DzSWAB1J.js → mindmap-definition-FAOFIHXS-BGel_L1u.js} +2 -2
  89. package/dist/web/assets/{mindmap-definition-FAOFIHXS-DzSWAB1J.js.map → mindmap-definition-FAOFIHXS-BGel_L1u.js.map} +1 -1
  90. package/dist/web/assets/{pegDiagram-VL7TDLO6-B7M9OfRG.js → pegDiagram-VL7TDLO6-CH3zwC78.js} +2 -2
  91. package/dist/web/assets/{pegDiagram-VL7TDLO6-B7M9OfRG.js.map → pegDiagram-VL7TDLO6-CH3zwC78.js.map} +1 -1
  92. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-BcYxwyY_.js → pieDiagram-7S7Q4E2Y-DENb9y8v.js} +2 -2
  93. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-BcYxwyY_.js.map → pieDiagram-7S7Q4E2Y-DENb9y8v.js.map} +1 -1
  94. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-Cqm-8BCr.js → quadrantDiagram-CIZ2JOQS-BLK1220s.js} +2 -2
  95. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-Cqm-8BCr.js.map → quadrantDiagram-CIZ2JOQS-BLK1220s.js.map} +1 -1
  96. package/dist/web/assets/{railroadDiagram-AXF67PYL-Cd4kbtKm.js → railroadDiagram-AXF67PYL-BBDl06Il.js} +2 -2
  97. package/dist/web/assets/{railroadDiagram-AXF67PYL-Cd4kbtKm.js.map → railroadDiagram-AXF67PYL-BBDl06Il.js.map} +1 -1
  98. package/dist/web/assets/{requirementDiagram-LRYGKXZP-0QC6DgKB.js → requirementDiagram-LRYGKXZP-Kfi1Dz3z.js} +2 -2
  99. package/dist/web/assets/{requirementDiagram-LRYGKXZP-0QC6DgKB.js.map → requirementDiagram-LRYGKXZP-Kfi1Dz3z.js.map} +1 -1
  100. package/dist/web/assets/{sankeyDiagram-W5VNT64P-Dbw_ZsTK.js → sankeyDiagram-W5VNT64P-C4iAR6nR.js} +2 -2
  101. package/dist/web/assets/{sankeyDiagram-W5VNT64P-Dbw_ZsTK.js.map → sankeyDiagram-W5VNT64P-C4iAR6nR.js.map} +1 -1
  102. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-CTtqv5hy.js → sequenceDiagram-SI44F4Z6-CKRWa4zT.js} +2 -2
  103. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-CTtqv5hy.js.map → sequenceDiagram-SI44F4Z6-CKRWa4zT.js.map} +1 -1
  104. package/dist/web/assets/{sizeCapture-X5ZJPWSS-DEKrTD1X.js → sizeCapture-X5ZJPWSS-BNtX7Lu1.js} +2 -2
  105. package/dist/web/assets/{sizeCapture-X5ZJPWSS-DEKrTD1X.js.map → sizeCapture-X5ZJPWSS-BNtX7Lu1.js.map} +1 -1
  106. package/dist/web/assets/{stateDiagram-OKZ733FA-QTIZuWV9.js → stateDiagram-OKZ733FA-5ZsbTa9R.js} +2 -2
  107. package/dist/web/assets/{stateDiagram-OKZ733FA-QTIZuWV9.js.map → stateDiagram-OKZ733FA-5ZsbTa9R.js.map} +1 -1
  108. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-DTZRWphk.js +2 -0
  109. package/dist/web/assets/{stateDiagram-v2-UEYNNEHI-CrwRGZAU.js.map → stateDiagram-v2-UEYNNEHI-DTZRWphk.js.map} +1 -1
  110. package/dist/web/assets/{swimlanes-SLNWSIFB-uVYP6afm.js → swimlanes-SLNWSIFB-g2hMvWhj.js} +3 -3
  111. package/dist/web/assets/{swimlanes-SLNWSIFB-uVYP6afm.js.map → swimlanes-SLNWSIFB-g2hMvWhj.js.map} +1 -1
  112. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-DhyxkK3y.js +9 -0
  113. package/dist/web/assets/{swimlanesDiagram-ULZ7WXOC-Ck34axny.js.map → swimlanesDiagram-ULZ7WXOC-DhyxkK3y.js.map} +1 -1
  114. package/dist/web/assets/{timeline-definition-Z64GVDOM-qp3Mh9Uw.js → timeline-definition-Z64GVDOM-CDKcjIt1.js} +2 -2
  115. package/dist/web/assets/{timeline-definition-Z64GVDOM-qp3Mh9Uw.js.map → timeline-definition-Z64GVDOM-CDKcjIt1.js.map} +1 -1
  116. package/dist/web/assets/{vennDiagram-T6HMQDX7-BV12qOhE.js → vennDiagram-T6HMQDX7-tW7OofM5.js} +2 -2
  117. package/dist/web/assets/{vennDiagram-T6HMQDX7-BV12qOhE.js.map → vennDiagram-T6HMQDX7-tW7OofM5.js.map} +1 -1
  118. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-CD3UVrjV.js → wardleyDiagram-T6FBY63Y-CFrWaO2w.js} +2 -2
  119. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-CD3UVrjV.js.map → wardleyDiagram-T6FBY63Y-CFrWaO2w.js.map} +1 -1
  120. package/dist/web/assets/{xychartDiagram-ELKLHX3M-cB0ynd1S.js → xychartDiagram-ELKLHX3M-Ci3g3fFj.js} +2 -2
  121. package/dist/web/assets/{xychartDiagram-ELKLHX3M-cB0ynd1S.js.map → xychartDiagram-ELKLHX3M-Ci3g3fFj.js.map} +1 -1
  122. package/dist/web/index.html +2 -2
  123. package/dist/web/sw.js +1 -1
  124. package/dist/web/version.json +1 -1
  125. package/package.json +9 -8
  126. package/dist/web/assets/channel-CNo4GWLb.js +0 -2
  127. package/dist/web/assets/classDiagram-JCYQIIEL-n1b9u-Rf.js +0 -2
  128. package/dist/web/assets/classDiagram-v2-OCEON4UE-n1b9u-Rf.js +0 -2
  129. package/dist/web/assets/index-BWQQ5ucz.css +0 -1
  130. package/dist/web/assets/index-CAvELUgG.js +0 -321
  131. package/dist/web/assets/index-CAvELUgG.js.map +0 -1
  132. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-CrwRGZAU.js +0 -2
  133. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-Ck34axny.js +0 -9
@@ -0,0 +1,321 @@
1
+ function rC(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function zd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lc={exports:{}},Yo={},Oc={exports:{}},Fe={};/**
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 Mg;function iC(){if(Mg)return Fe;Mg=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=p&&O[p]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function E(O,J,M){this.props=O,this.context=J,this.refs=C,this.updater=M||w}E.prototype.isReactComponent={},E.prototype.setState=function(O,J){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,J,"setState")},E.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function T(){}T.prototype=E.prototype;function A(O,J,M){this.props=O,this.context=J,this.refs=C,this.updater=M||w}var j=A.prototype=new T;j.constructor=A,S(j,E.prototype),j.isPureReactComponent=!0;var R=Array.isArray,V=Object.prototype.hasOwnProperty,D={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function $(O,J,M){var te,me={},ye=null,de=null;if(J!=null)for(te in J.ref!==void 0&&(de=J.ref),J.key!==void 0&&(ye=""+J.key),J)V.call(J,te)&&!G.hasOwnProperty(te)&&(me[te]=J[te]);var Te=arguments.length-2;if(Te===1)me.children=M;else if(1<Te){for(var ge=Array(Te),_e=0;_e<Te;_e++)ge[_e]=arguments[_e+2];me.children=ge}if(O&&O.defaultProps)for(te in Te=O.defaultProps,Te)me[te]===void 0&&(me[te]=Te[te]);return{$$typeof:e,type:O,key:ye,ref:de,props:me,_owner:D.current}}function _(O,J){return{$$typeof:e,type:O.type,key:J,ref:O.ref,props:O.props,_owner:O._owner}}function P(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function K(O){var J={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(M){return J[M]})}var F=/\/+/g;function ie(O,J){return typeof O=="object"&&O!==null&&O.key!=null?K(""+O.key):J.toString(36)}function Z(O,J,M,te,me){var ye=typeof O;(ye==="undefined"||ye==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(ye){case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case t:de=!0}}if(de)return de=O,me=me(de),O=te===""?"."+ie(de,0):te,R(me)?(M="",O!=null&&(M=O.replace(F,"$&/")+"/"),Z(me,J,M,"",function(_e){return _e})):me!=null&&(P(me)&&(me=_(me,M+(!me.key||de&&de.key===me.key?"":(""+me.key).replace(F,"$&/")+"/")+O)),J.push(me)),1;if(de=0,te=te===""?".":te+":",R(O))for(var Te=0;Te<O.length;Te++){ye=O[Te];var ge=te+ie(ye,Te);de+=Z(ye,J,M,ge,me)}else if(ge=v(O),typeof ge=="function")for(O=ge.call(O),Te=0;!(ye=O.next()).done;)ye=ye.value,ge=te+ie(ye,Te++),de+=Z(ye,J,M,ge,me);else if(ye==="object")throw J=String(O),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.");return de}function ee(O,J,M){if(O==null)return O;var te=[],me=0;return Z(O,te,"","",function(ye){return J.call(M,ye,me++)}),te}function pe(O){if(O._status===-1){var J=O._result;J=J(),J.then(function(M){(O._status===0||O._status===-1)&&(O._status=1,O._result=M)},function(M){(O._status===0||O._status===-1)&&(O._status=2,O._result=M)}),O._status===-1&&(O._status=0,O._result=J)}if(O._status===1)return O._result.default;throw O._result}var xe={current:null},Q={transition:null},fe={ReactCurrentDispatcher:xe,ReactCurrentBatchConfig:Q,ReactCurrentOwner:D};function N(){throw Error("act(...) is not supported in production builds of React.")}return Fe.Children={map:ee,forEach:function(O,J,M){ee(O,function(){J.apply(this,arguments)},M)},count:function(O){var J=0;return ee(O,function(){J++}),J},toArray:function(O){return ee(O,function(J){return J})||[]},only:function(O){if(!P(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},Fe.Component=E,Fe.Fragment=n,Fe.Profiler=s,Fe.PureComponent=A,Fe.StrictMode=i,Fe.Suspense=f,Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fe,Fe.act=N,Fe.cloneElement=function(O,J,M){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var te=S({},O.props),me=O.key,ye=O.ref,de=O._owner;if(J!=null){if(J.ref!==void 0&&(ye=J.ref,de=D.current),J.key!==void 0&&(me=""+J.key),O.type&&O.type.defaultProps)var Te=O.type.defaultProps;for(ge in J)V.call(J,ge)&&!G.hasOwnProperty(ge)&&(te[ge]=J[ge]===void 0&&Te!==void 0?Te[ge]:J[ge])}var ge=arguments.length-2;if(ge===1)te.children=M;else if(1<ge){Te=Array(ge);for(var _e=0;_e<ge;_e++)Te[_e]=arguments[_e+2];te.children=Te}return{$$typeof:e,type:O.type,key:me,ref:ye,props:te,_owner:de}},Fe.createContext=function(O){return O={$$typeof:a,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:l,_context:O},O.Consumer=O},Fe.createElement=$,Fe.createFactory=function(O){var J=$.bind(null,O);return J.type=O,J},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(O){return{$$typeof:c,render:O}},Fe.isValidElement=P,Fe.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:pe}},Fe.memo=function(O,J){return{$$typeof:h,type:O,compare:J===void 0?null:J}},Fe.startTransition=function(O){var J=Q.transition;Q.transition={};try{O()}finally{Q.transition=J}},Fe.unstable_act=N,Fe.useCallback=function(O,J){return xe.current.useCallback(O,J)},Fe.useContext=function(O){return xe.current.useContext(O)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(O){return xe.current.useDeferredValue(O)},Fe.useEffect=function(O,J){return xe.current.useEffect(O,J)},Fe.useId=function(){return xe.current.useId()},Fe.useImperativeHandle=function(O,J,M){return xe.current.useImperativeHandle(O,J,M)},Fe.useInsertionEffect=function(O,J){return xe.current.useInsertionEffect(O,J)},Fe.useLayoutEffect=function(O,J){return xe.current.useLayoutEffect(O,J)},Fe.useMemo=function(O,J){return xe.current.useMemo(O,J)},Fe.useReducer=function(O,J,M){return xe.current.useReducer(O,J,M)},Fe.useRef=function(O){return xe.current.useRef(O)},Fe.useState=function(O){return xe.current.useState(O)},Fe.useSyncExternalStore=function(O,J,M){return xe.current.useSyncExternalStore(O,J,M)},Fe.useTransition=function(){return xe.current.useTransition()},Fe.version="18.3.1",Fe}var Ig;function Vd(){return Ig||(Ig=1,Oc.exports=iC()),Oc.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 Dg;function oC(){if(Dg)return Yo;Dg=1;var e=Vd(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function a(c,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)&&!l.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 Yo.Fragment=n,Yo.jsx=a,Yo.jsxs=a,Yo}var _g;function sC(){return _g||(_g=1,Lc.exports=oC()),Lc.exports}var y=sC(),Ha={},Fc={exports:{}},nn={},zc={exports:{}},Vc={};/**
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 Lg;function aC(){return Lg||(Lg=1,function(e){function t(Q,fe){var N=Q.length;Q.push(fe);e:for(;0<N;){var O=N-1>>>1,J=Q[O];if(0<s(J,fe))Q[O]=fe,Q[N]=J,N=O;else break e}}function n(Q){return Q.length===0?null:Q[0]}function i(Q){if(Q.length===0)return null;var fe=Q[0],N=Q.pop();if(N!==fe){Q[0]=N;e:for(var O=0,J=Q.length,M=J>>>1;O<M;){var te=2*(O+1)-1,me=Q[te],ye=te+1,de=Q[ye];if(0>s(me,N))ye<J&&0>s(de,me)?(Q[O]=de,Q[ye]=N,O=ye):(Q[O]=me,Q[te]=N,O=te);else if(ye<J&&0>s(de,N))Q[O]=de,Q[ye]=N,O=ye;else break e}}return fe}function s(Q,fe){var N=Q.sortIndex-fe.sortIndex;return N!==0?N:Q.id-fe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var f=[],h=[],m=1,p=null,v=3,w=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,T=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 j(Q){for(var fe=n(h);fe!==null;){if(fe.callback===null)i(h);else if(fe.startTime<=Q)i(h),fe.sortIndex=fe.expirationTime,t(f,fe);else break;fe=n(h)}}function R(Q){if(C=!1,j(Q),!S)if(n(f)!==null)S=!0,pe(V);else{var fe=n(h);fe!==null&&xe(R,fe.startTime-Q)}}function V(Q,fe){S=!1,C&&(C=!1,T($),$=-1),w=!0;var N=v;try{for(j(fe),p=n(f);p!==null&&(!(p.expirationTime>fe)||Q&&!K());){var O=p.callback;if(typeof O=="function"){p.callback=null,v=p.priorityLevel;var J=O(p.expirationTime<=fe);fe=e.unstable_now(),typeof J=="function"?p.callback=J:p===n(f)&&i(f),j(fe)}else i(f);p=n(f)}if(p!==null)var M=!0;else{var te=n(h);te!==null&&xe(R,te.startTime-fe),M=!1}return M}finally{p=null,v=N,w=!1}}var D=!1,G=null,$=-1,_=5,P=-1;function K(){return!(e.unstable_now()-P<_)}function F(){if(G!==null){var Q=e.unstable_now();P=Q;var fe=!0;try{fe=G(!0,Q)}finally{fe?ie():(D=!1,G=null)}}else D=!1}var ie;if(typeof A=="function")ie=function(){A(F)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,ee=Z.port2;Z.port1.onmessage=F,ie=function(){ee.postMessage(null)}}else ie=function(){E(F,0)};function pe(Q){G=Q,D||(D=!0,ie())}function xe(Q,fe){$=E(function(){Q(e.unstable_now())},fe)}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,pe(V))},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 fe=3;break;default:fe=v}var N=v;v=fe;try{return Q()}finally{v=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,fe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var N=v;v=Q;try{return fe()}finally{v=N}},e.unstable_scheduleCallback=function(Q,fe,N){var O=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?O+N:O):N=O,Q){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=N+J,Q={id:m++,callback:fe,priorityLevel:Q,startTime:N,expirationTime:J,sortIndex:-1},N>O?(Q.sortIndex=N,t(h,Q),n(f)===null&&Q===n(h)&&(C?(T($),$=-1):C=!0,xe(R,N-O))):(Q.sortIndex=J,t(f,Q),S||w||(S=!0,pe(V))),Q},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(Q){var fe=v;return function(){var N=v;v=fe;try{return Q.apply(this,arguments)}finally{v=N}}}}(Vc)),Vc}var Og;function lC(){return Og||(Og=1,zc.exports=aC()),zc.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 Fg;function uC(){if(Fg)return nn;Fg=1;var e=Vd(),t=lC();function n(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,s={};function l(r,o){a(r,o),a(r+"Capture",o)}function a(r,o){for(s[r]=o,r=0;r<o.length;r++)i.add(o[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),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 T=/[\-:]([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(T,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(T,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(T,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 j(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 R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),D=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),K=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),xe=Symbol.for("react.offscreen"),Q=Symbol.iterator;function fe(r){return r===null||typeof r!="object"?null:(r=Q&&r[Q]||r["@@iterator"],typeof r=="function"?r:null)}var N=Object.assign,O;function J(r){if(O===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);O=o&&o[1]||""}return`
34
+ `+O+r}var M=!1;function te(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(X){var d=X}Reflect.construct(r,[],o)}else{try{o.call()}catch(X){d=X}r.call(o.prototype)}else{try{throw Error()}catch(X){d=X}r()}}catch(X){if(X&&d&&typeof X.stack=="string"){for(var g=X.stack.split(`
35
+ `),x=d.stack.split(`
36
+ `),b=g.length-1,I=x.length-1;1<=b&&0<=I&&g[b]!==x[I];)I--;for(;1<=b&&0<=I;b--,I--)if(g[b]!==x[I]){if(b!==1||I!==1)do if(b--,I--,0>I||g[b]!==x[I]){var L=`
37
+ `+g[b].replace(" at new "," at ");return r.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",r.displayName)),L}while(1<=b&&0<=I);break}}}finally{M=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?J(r):""}function me(r){switch(r.tag){case 5:return J(r.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return r=te(r.type,!1),r;case 11:return r=te(r.type.render,!1),r;case 1:return r=te(r.type,!0),r;default:return""}}function ye(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 G:return"Fragment";case D:return"Portal";case _:return"Profiler";case $:return"StrictMode";case ie:return"Suspense";case Z:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case K:return(r.displayName||"Context")+".Consumer";case P:return(r._context.displayName||"Context")+".Provider";case F:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ee:return o=r.displayName||null,o!==null?o:ye(r.type)||"Memo";case pe:o=r._payload,r=r._init;try{return ye(r(o))}catch{}}return null}function de(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 ye(o);case 8:return o===$?"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 Te(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ge(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function _e(r){var o=ge(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 He(r){r._valueTracker||(r._valueTracker=_e(r))}function tt(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var u=o.getValue(),d="";return r&&(d=ge(r)?r.checked?"true":"false":r.value),r=d,r!==u?(o.setValue(r),!0):!1}function gt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function at(r,o){var u=o.checked;return N({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function _t(r,o){var u=o.defaultValue==null?"":o.defaultValue,d=o.checked!=null?o.checked:o.defaultChecked;u=Te(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 ot(r,o){o=o.checked,o!=null&&j(r,"checked",o,!1)}function Ke(r,o){ot(r,o);var u=Te(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")?hn(r,o.type,u):o.hasOwnProperty("defaultValue")&&hn(r,o.type,Te(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function jt(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 hn(r,o,u){(o!=="number"||gt(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var At=Array.isArray;function Gt(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=""+Te(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 Fn(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return N({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Oe(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(At(u)){if(1<u.length)throw Error(n(93));u=u[0]}o=u}o==null&&(o=""),u=o}r._wrapperState={initialValue:Te(u)}}function yt(r,o){var u=Te(o.value),d=Te(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 En(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function Y(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 ae(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?Y(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Pe,De=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(Pe=Pe||document.createElement("div"),Pe.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Pe.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 lt={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},W=["Webkit","ms","Moz","O"];Object.keys(lt).forEach(function(r){W.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),lt[o]=lt[r]})});function B(r,o,u){return o==null||typeof o=="boolean"||o===""?"":u||typeof o!="number"||o===0||lt.hasOwnProperty(r)&&lt[r]?(""+o).trim():o+"px"}function q(r,o){r=r.style;for(var u in o)if(o.hasOwnProperty(u)){var d=u.indexOf("--")===0,g=B(u,o[u],d);u==="float"&&(u="cssFloat"),d?r.setProperty(u,g):r[u]=g}}var se=N({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 he(r,o){if(o){if(se[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 ue(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 Ne=null;function ut(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var kt=null,$e=null,Ye=null;function Le(r){if(r=Do(r)){if(typeof kt!="function")throw Error(n(280));var o=r.stateNode;o&&(o=sa(o),kt(r.stateNode,r.type,o))}}function $t(r){$e?Ye?Ye.push(r):Ye=[r]:$e=r}function fr(){if($e){var r=$e,o=Ye;if(Ye=$e=null,Le(r),o)for(r=0;r<o.length;r++)Le(o[r])}}function Jh(r,o){return r(o)}function Zh(){}var Zl=!1;function ep(r,o,u){if(Zl)return r(o,u);Zl=!0;try{return Jh(r,o,u)}finally{Zl=!1,($e!==null||Ye!==null)&&(Zh(),fr())}}function ho(r,o){var u=r.stateNode;if(u===null)return null;var d=sa(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 eu=!1;if(c)try{var po={};Object.defineProperty(po,"passive",{get:function(){eu=!0}}),window.addEventListener("test",po,po),window.removeEventListener("test",po,po)}catch{eu=!1}function uS(r,o,u,d,g,x,b,I,L){var X=Array.prototype.slice.call(arguments,3);try{o.apply(u,X)}catch(re){this.onError(re)}}var mo=!1,Fs=null,zs=!1,tu=null,cS={onError:function(r){mo=!0,Fs=r}};function fS(r,o,u,d,g,x,b,I,L){mo=!1,Fs=null,uS.apply(cS,arguments)}function dS(r,o,u,d,g,x,b,I,L){if(fS.apply(this,arguments),mo){if(mo){var X=Fs;mo=!1,Fs=null}else throw Error(n(198));zs||(zs=!0,tu=X)}}function Wr(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 tp(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 np(r){if(Wr(r)!==r)throw Error(n(188))}function hS(r){var o=r.alternate;if(!o){if(o=Wr(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 np(g),r;if(x===d)return np(g),o;x=x.sibling}throw Error(n(188))}if(u.return!==d.return)u=g,d=x;else{for(var b=!1,I=g.child;I;){if(I===u){b=!0,u=g,d=x;break}if(I===d){b=!0,d=g,u=x;break}I=I.sibling}if(!b){for(I=x.child;I;){if(I===u){b=!0,u=x,d=g;break}if(I===d){b=!0,d=x,u=g;break}I=I.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 rp(r){return r=hS(r),r!==null?ip(r):null}function ip(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=ip(r);if(o!==null)return o;r=r.sibling}return null}var op=t.unstable_scheduleCallback,sp=t.unstable_cancelCallback,pS=t.unstable_shouldYield,mS=t.unstable_requestPaint,pt=t.unstable_now,gS=t.unstable_getCurrentPriorityLevel,nu=t.unstable_ImmediatePriority,ap=t.unstable_UserBlockingPriority,Vs=t.unstable_NormalPriority,yS=t.unstable_LowPriority,lp=t.unstable_IdlePriority,Bs=null,zn=null;function vS(r){if(zn&&typeof zn.onCommitFiberRoot=="function")try{zn.onCommitFiberRoot(Bs,r,void 0,(r.current.flags&128)===128)}catch{}}var Tn=Math.clz32?Math.clz32:kS,xS=Math.log,wS=Math.LN2;function kS(r){return r>>>=0,r===0?32:31-(xS(r)/wS|0)|0}var $s=64,Us=4194304;function go(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 Ws(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 I=b&~g;I!==0?d=go(I):(x&=b,x!==0&&(d=go(x)))}else b=u&~g,b!==0?d=go(b):x!==0&&(d=go(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-Tn(o),g=1<<u,d|=r[u],o&=~g;return d}function SS(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 bS(r,o){for(var u=r.suspendedLanes,d=r.pingedLanes,g=r.expirationTimes,x=r.pendingLanes;0<x;){var b=31-Tn(x),I=1<<b,L=g[b];L===-1?((I&u)===0||(I&d)!==0)&&(g[b]=SS(I,o)):L<=o&&(r.expiredLanes|=I),x&=~I}}function ru(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function up(){var r=$s;return $s<<=1,($s&4194240)===0&&($s=64),r}function iu(r){for(var o=[],u=0;31>u;u++)o.push(r);return o}function yo(r,o,u){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-Tn(o),r[o]=u}function CS(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-Tn(u),x=1<<g;o[g]=0,d[g]=-1,r[g]=-1,u&=~x}}function ou(r,o){var u=r.entangledLanes|=o;for(r=r.entanglements;u;){var d=31-Tn(u),g=1<<d;g&o|r[d]&o&&(r[d]|=o),u&=~g}}var Ge=0;function cp(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var fp,su,dp,hp,pp,au=!1,Hs=[],dr=null,hr=null,pr=null,vo=new Map,xo=new Map,mr=[],ES="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 mp(r,o){switch(r){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":vo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":xo.delete(o.pointerId)}}function wo(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=Do(o),o!==null&&su(o)),r):(r.eventSystemFlags|=d,o=r.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),r)}function TS(r,o,u,d,g){switch(o){case"focusin":return dr=wo(dr,r,o,u,d,g),!0;case"dragenter":return hr=wo(hr,r,o,u,d,g),!0;case"mouseover":return pr=wo(pr,r,o,u,d,g),!0;case"pointerover":var x=g.pointerId;return vo.set(x,wo(vo.get(x)||null,r,o,u,d,g)),!0;case"gotpointercapture":return x=g.pointerId,xo.set(x,wo(xo.get(x)||null,r,o,u,d,g)),!0}return!1}function gp(r){var o=Hr(r.target);if(o!==null){var u=Wr(o);if(u!==null){if(o=u.tag,o===13){if(o=tp(u),o!==null){r.blockedOn=o,pp(r.priority,function(){dp(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 Ks(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var u=uu(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var d=new u.constructor(u.type,u);Ne=d,u.target.dispatchEvent(d),Ne=null}else return o=Do(u),o!==null&&su(o),r.blockedOn=u,!1;o.shift()}return!0}function yp(r,o,u){Ks(r)&&u.delete(o)}function PS(){au=!1,dr!==null&&Ks(dr)&&(dr=null),hr!==null&&Ks(hr)&&(hr=null),pr!==null&&Ks(pr)&&(pr=null),vo.forEach(yp),xo.forEach(yp)}function ko(r,o){r.blockedOn===o&&(r.blockedOn=null,au||(au=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,PS)))}function So(r){function o(g){return ko(g,r)}if(0<Hs.length){ko(Hs[0],r);for(var u=1;u<Hs.length;u++){var d=Hs[u];d.blockedOn===r&&(d.blockedOn=null)}}for(dr!==null&&ko(dr,r),hr!==null&&ko(hr,r),pr!==null&&ko(pr,r),vo.forEach(o),xo.forEach(o),u=0;u<mr.length;u++)d=mr[u],d.blockedOn===r&&(d.blockedOn=null);for(;0<mr.length&&(u=mr[0],u.blockedOn===null);)gp(u),u.blockedOn===null&&mr.shift()}var vi=R.ReactCurrentBatchConfig,qs=!0;function RS(r,o,u,d){var g=Ge,x=vi.transition;vi.transition=null;try{Ge=1,lu(r,o,u,d)}finally{Ge=g,vi.transition=x}}function jS(r,o,u,d){var g=Ge,x=vi.transition;vi.transition=null;try{Ge=4,lu(r,o,u,d)}finally{Ge=g,vi.transition=x}}function lu(r,o,u,d){if(qs){var g=uu(r,o,u,d);if(g===null)Tu(r,o,d,Xs,u),mp(r,d);else if(TS(g,r,o,u,d))d.stopPropagation();else if(mp(r,d),o&4&&-1<ES.indexOf(r)){for(;g!==null;){var x=Do(g);if(x!==null&&fp(x),x=uu(r,o,u,d),x===null&&Tu(r,o,d,Xs,u),x===g)break;g=x}g!==null&&d.stopPropagation()}else Tu(r,o,d,null,u)}}var Xs=null;function uu(r,o,u,d){if(Xs=null,r=ut(d),r=Hr(r),r!==null)if(o=Wr(r),o===null)r=null;else if(u=o.tag,u===13){if(r=tp(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 Xs=r,null}function vp(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(gS()){case nu:return 1;case ap:return 4;case Vs:case yS:return 16;case lp:return 536870912;default:return 16}default:return 16}}var gr=null,cu=null,Ys=null;function xp(){if(Ys)return Ys;var r,o=cu,u=o.length,d,g="value"in gr?gr.value:gr.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 Ys=g.slice(r,1<d?1-d:void 0)}function Gs(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 Qs(){return!0}function wp(){return!1}function sn(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 I in r)r.hasOwnProperty(I)&&(u=r[I],this[I]=u?u(x):x[I]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Qs:wp,this.isPropagationStopped=wp,this}return N(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=Qs)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Qs)},persist:function(){},isPersistent:Qs}),o}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fu=sn(xi),bo=N({},xi,{view:0,detail:0}),AS=sn(bo),du,hu,Co,Js=N({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mu,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!==Co&&(Co&&r.type==="mousemove"?(du=r.screenX-Co.screenX,hu=r.screenY-Co.screenY):hu=du=0,Co=r),du)},movementY:function(r){return"movementY"in r?r.movementY:hu}}),kp=sn(Js),NS=N({},Js,{dataTransfer:0}),MS=sn(NS),IS=N({},bo,{relatedTarget:0}),pu=sn(IS),DS=N({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),_S=sn(DS),LS=N({},xi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),OS=sn(LS),FS=N({},xi,{data:0}),Sp=sn(FS),zS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VS={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"},BS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $S(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=BS[r])?!!o[r]:!1}function mu(){return $S}var US=N({},bo,{key:function(r){if(r.key){var o=zS[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=Gs(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?VS[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mu,charCode:function(r){return r.type==="keypress"?Gs(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Gs(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),WS=sn(US),HS=N({},Js,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bp=sn(HS),KS=N({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mu}),qS=sn(KS),XS=N({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),YS=sn(XS),GS=N({},Js,{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}),QS=sn(GS),JS=[9,13,27,32],gu=c&&"CompositionEvent"in window,Eo=null;c&&"documentMode"in document&&(Eo=document.documentMode);var ZS=c&&"TextEvent"in window&&!Eo,Cp=c&&(!gu||Eo&&8<Eo&&11>=Eo),Ep=" ",Tp=!1;function Pp(r,o){switch(r){case"keyup":return JS.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var wi=!1;function eb(r,o){switch(r){case"compositionend":return Rp(o);case"keypress":return o.which!==32?null:(Tp=!0,Ep);case"textInput":return r=o.data,r===Ep&&Tp?null:r;default:return null}}function tb(r,o){if(wi)return r==="compositionend"||!gu&&Pp(r,o)?(r=xp(),Ys=cu=gr=null,wi=!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 Cp&&o.locale!=="ko"?null:o.data;default:return null}}var nb={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 jp(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!nb[r.type]:o==="textarea"}function Ap(r,o,u,d){$t(d),o=ra(o,"onChange"),0<o.length&&(u=new fu("onChange","change",null,u,d),r.push({event:u,listeners:o}))}var To=null,Po=null;function rb(r){Xp(r,0)}function Zs(r){var o=Ei(r);if(tt(o))return r}function ib(r,o){if(r==="change")return o}var Np=!1;if(c){var yu;if(c){var vu="oninput"in document;if(!vu){var Mp=document.createElement("div");Mp.setAttribute("oninput","return;"),vu=typeof Mp.oninput=="function"}yu=vu}else yu=!1;Np=yu&&(!document.documentMode||9<document.documentMode)}function Ip(){To&&(To.detachEvent("onpropertychange",Dp),Po=To=null)}function Dp(r){if(r.propertyName==="value"&&Zs(Po)){var o=[];Ap(o,Po,r,ut(r)),ep(rb,o)}}function ob(r,o,u){r==="focusin"?(Ip(),To=o,Po=u,To.attachEvent("onpropertychange",Dp)):r==="focusout"&&Ip()}function sb(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Zs(Po)}function ab(r,o){if(r==="click")return Zs(o)}function lb(r,o){if(r==="input"||r==="change")return Zs(o)}function ub(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Pn=typeof Object.is=="function"?Object.is:ub;function Ro(r,o){if(Pn(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)||!Pn(r[g],o[g]))return!1}return!0}function _p(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Lp(r,o){var u=_p(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=_p(u)}}function Op(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Op(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Fp(){for(var r=window,o=gt();o instanceof r.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)r=o.contentWindow;else break;o=gt(r.document)}return o}function xu(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 cb(r){var o=Fp(),u=r.focusedElem,d=r.selectionRange;if(o!==u&&u&&u.ownerDocument&&Op(u.ownerDocument.documentElement,u)){if(d!==null&&xu(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=Lp(u,x);var b=Lp(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 fb=c&&"documentMode"in document&&11>=document.documentMode,ki=null,wu=null,jo=null,ku=!1;function zp(r,o,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ku||ki==null||ki!==gt(d)||(d=ki,"selectionStart"in d&&xu(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}),jo&&Ro(jo,d)||(jo=d,d=ra(wu,"onSelect"),0<d.length&&(o=new fu("onSelect","select",null,o,u),r.push({event:o,listeners:d}),o.target=ki)))}function ea(r,o){var u={};return u[r.toLowerCase()]=o.toLowerCase(),u["Webkit"+r]="webkit"+o,u["Moz"+r]="moz"+o,u}var Si={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionend:ea("Transition","TransitionEnd")},Su={},Vp={};c&&(Vp=document.createElement("div").style,"AnimationEvent"in window||(delete Si.animationend.animation,delete Si.animationiteration.animation,delete Si.animationstart.animation),"TransitionEvent"in window||delete Si.transitionend.transition);function ta(r){if(Su[r])return Su[r];if(!Si[r])return r;var o=Si[r],u;for(u in o)if(o.hasOwnProperty(u)&&u in Vp)return Su[r]=o[u];return r}var Bp=ta("animationend"),$p=ta("animationiteration"),Up=ta("animationstart"),Wp=ta("transitionend"),Hp=new Map,Kp="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 yr(r,o){Hp.set(r,o),l(o,[r])}for(var bu=0;bu<Kp.length;bu++){var Cu=Kp[bu],db=Cu.toLowerCase(),hb=Cu[0].toUpperCase()+Cu.slice(1);yr(db,"on"+hb)}yr(Bp,"onAnimationEnd"),yr($p,"onAnimationIteration"),yr(Up,"onAnimationStart"),yr("dblclick","onDoubleClick"),yr("focusin","onFocus"),yr("focusout","onBlur"),yr(Wp,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="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(" "),pb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ao));function qp(r,o,u){var d=r.type||"unknown-event";r.currentTarget=u,dS(d,o,void 0,r),r.currentTarget=null}function Xp(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 I=d[b],L=I.instance,X=I.currentTarget;if(I=I.listener,L!==x&&g.isPropagationStopped())break e;qp(g,I,X),x=L}else for(b=0;b<d.length;b++){if(I=d[b],L=I.instance,X=I.currentTarget,I=I.listener,L!==x&&g.isPropagationStopped())break e;qp(g,I,X),x=L}}}if(zs)throw r=tu,zs=!1,tu=null,r}function rt(r,o){var u=o[Mu];u===void 0&&(u=o[Mu]=new Set);var d=r+"__bubble";u.has(d)||(Yp(o,r,2,!1),u.add(d))}function Eu(r,o,u){var d=0;o&&(d|=4),Yp(u,r,d,o)}var na="_reactListening"+Math.random().toString(36).slice(2);function No(r){if(!r[na]){r[na]=!0,i.forEach(function(u){u!=="selectionchange"&&(pb.has(u)||Eu(u,!1,r),Eu(u,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[na]||(o[na]=!0,Eu("selectionchange",!1,o))}}function Yp(r,o,u,d){switch(vp(o)){case 1:var g=RS;break;case 4:g=jS;break;default:g=lu}u=g.bind(null,o,u,r),g=void 0,!eu||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 Tu(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 I=d.stateNode.containerInfo;if(I===g||I.nodeType===8&&I.parentNode===g)break;if(b===4)for(b=d.return;b!==null;){var L=b.tag;if((L===3||L===4)&&(L=b.stateNode.containerInfo,L===g||L.nodeType===8&&L.parentNode===g))return;b=b.return}for(;I!==null;){if(b=Hr(I),b===null)return;if(L=b.tag,L===5||L===6){d=x=b;continue e}I=I.parentNode}}d=d.return}ep(function(){var X=x,re=ut(u),oe=[];e:{var ne=Hp.get(r);if(ne!==void 0){var ve=fu,Se=r;switch(r){case"keypress":if(Gs(u)===0)break e;case"keydown":case"keyup":ve=WS;break;case"focusin":Se="focus",ve=pu;break;case"focusout":Se="blur",ve=pu;break;case"beforeblur":case"afterblur":ve=pu;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":ve=kp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=MS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=qS;break;case Bp:case $p:case Up:ve=_S;break;case Wp:ve=YS;break;case"scroll":ve=AS;break;case"wheel":ve=QS;break;case"copy":case"cut":case"paste":ve=OS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=bp}var Ce=(o&4)!==0,mt=!Ce&&r==="scroll",U=Ce?ne!==null?ne+"Capture":null:ne;Ce=[];for(var z=X,H;z!==null;){H=z;var ce=H.stateNode;if(H.tag===5&&ce!==null&&(H=ce,U!==null&&(ce=ho(z,U),ce!=null&&Ce.push(Mo(z,ce,H)))),mt)break;z=z.return}0<Ce.length&&(ne=new ve(ne,Se,null,u,re),oe.push({event:ne,listeners:Ce}))}}if((o&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",ve=r==="mouseout"||r==="pointerout",ne&&u!==Ne&&(Se=u.relatedTarget||u.fromElement)&&(Hr(Se)||Se[Jn]))break e;if((ve||ne)&&(ne=re.window===re?re:(ne=re.ownerDocument)?ne.defaultView||ne.parentWindow:window,ve?(Se=u.relatedTarget||u.toElement,ve=X,Se=Se?Hr(Se):null,Se!==null&&(mt=Wr(Se),Se!==mt||Se.tag!==5&&Se.tag!==6)&&(Se=null)):(ve=null,Se=X),ve!==Se)){if(Ce=kp,ce="onMouseLeave",U="onMouseEnter",z="mouse",(r==="pointerout"||r==="pointerover")&&(Ce=bp,ce="onPointerLeave",U="onPointerEnter",z="pointer"),mt=ve==null?ne:Ei(ve),H=Se==null?ne:Ei(Se),ne=new Ce(ce,z+"leave",ve,u,re),ne.target=mt,ne.relatedTarget=H,ce=null,Hr(re)===X&&(Ce=new Ce(U,z+"enter",Se,u,re),Ce.target=H,Ce.relatedTarget=mt,ce=Ce),mt=ce,ve&&Se)t:{for(Ce=ve,U=Se,z=0,H=Ce;H;H=bi(H))z++;for(H=0,ce=U;ce;ce=bi(ce))H++;for(;0<z-H;)Ce=bi(Ce),z--;for(;0<H-z;)U=bi(U),H--;for(;z--;){if(Ce===U||U!==null&&Ce===U.alternate)break t;Ce=bi(Ce),U=bi(U)}Ce=null}else Ce=null;ve!==null&&Gp(oe,ne,ve,Ce,!1),Se!==null&&mt!==null&&Gp(oe,mt,Se,Ce,!0)}}e:{if(ne=X?Ei(X):window,ve=ne.nodeName&&ne.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ne.type==="file")var Ee=ib;else if(jp(ne))if(Np)Ee=lb;else{Ee=sb;var Re=ob}else(ve=ne.nodeName)&&ve.toLowerCase()==="input"&&(ne.type==="checkbox"||ne.type==="radio")&&(Ee=ab);if(Ee&&(Ee=Ee(r,X))){Ap(oe,Ee,u,re);break e}Re&&Re(r,ne,X),r==="focusout"&&(Re=ne._wrapperState)&&Re.controlled&&ne.type==="number"&&hn(ne,"number",ne.value)}switch(Re=X?Ei(X):window,r){case"focusin":(jp(Re)||Re.contentEditable==="true")&&(ki=Re,wu=X,jo=null);break;case"focusout":jo=wu=ki=null;break;case"mousedown":ku=!0;break;case"contextmenu":case"mouseup":case"dragend":ku=!1,zp(oe,u,re);break;case"selectionchange":if(fb)break;case"keydown":case"keyup":zp(oe,u,re)}var je;if(gu)e:{switch(r){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else wi?Pp(r,u)&&(Me="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Me="onCompositionStart");Me&&(Cp&&u.locale!=="ko"&&(wi||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&wi&&(je=xp()):(gr=re,cu="value"in gr?gr.value:gr.textContent,wi=!0)),Re=ra(X,Me),0<Re.length&&(Me=new Sp(Me,r,null,u,re),oe.push({event:Me,listeners:Re}),je?Me.data=je:(je=Rp(u),je!==null&&(Me.data=je)))),(je=ZS?eb(r,u):tb(r,u))&&(X=ra(X,"onBeforeInput"),0<X.length&&(re=new Sp("onBeforeInput","beforeinput",null,u,re),oe.push({event:re,listeners:X}),re.data=je))}Xp(oe,o)})}function Mo(r,o,u){return{instance:r,listener:o,currentTarget:u}}function ra(r,o){for(var u=o+"Capture",d=[];r!==null;){var g=r,x=g.stateNode;g.tag===5&&x!==null&&(g=x,x=ho(r,u),x!=null&&d.unshift(Mo(r,x,g)),x=ho(r,o),x!=null&&d.push(Mo(r,x,g))),r=r.return}return d}function bi(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function Gp(r,o,u,d,g){for(var x=o._reactName,b=[];u!==null&&u!==d;){var I=u,L=I.alternate,X=I.stateNode;if(L!==null&&L===d)break;I.tag===5&&X!==null&&(I=X,g?(L=ho(u,x),L!=null&&b.unshift(Mo(u,L,I))):g||(L=ho(u,x),L!=null&&b.push(Mo(u,L,I)))),u=u.return}b.length!==0&&r.push({event:o,listeners:b})}var mb=/\r\n?/g,gb=/\u0000|\uFFFD/g;function Qp(r){return(typeof r=="string"?r:""+r).replace(mb,`
38
+ `).replace(gb,"")}function ia(r,o,u){if(o=Qp(o),Qp(r)!==o&&u)throw Error(n(425))}function oa(){}var Pu=null,Ru=null;function ju(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 Au=typeof setTimeout=="function"?setTimeout:void 0,yb=typeof clearTimeout=="function"?clearTimeout:void 0,Jp=typeof Promise=="function"?Promise:void 0,vb=typeof queueMicrotask=="function"?queueMicrotask:typeof Jp<"u"?function(r){return Jp.resolve(null).then(r).catch(xb)}:Au;function xb(r){setTimeout(function(){throw r})}function Nu(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),So(o);return}d--}else u!=="$"&&u!=="$?"&&u!=="$!"||d++;u=g}while(u);So(o)}function vr(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 Zp(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 Ci=Math.random().toString(36).slice(2),Vn="__reactFiber$"+Ci,Io="__reactProps$"+Ci,Jn="__reactContainer$"+Ci,Mu="__reactEvents$"+Ci,wb="__reactListeners$"+Ci,kb="__reactHandles$"+Ci;function Hr(r){var o=r[Vn];if(o)return o;for(var u=r.parentNode;u;){if(o=u[Jn]||u[Vn]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(r=Zp(r);r!==null;){if(u=r[Vn])return u;r=Zp(r)}return o}r=u,u=r.parentNode}return null}function Do(r){return r=r[Vn]||r[Jn],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Ei(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function sa(r){return r[Io]||null}var Iu=[],Ti=-1;function xr(r){return{current:r}}function it(r){0>Ti||(r.current=Iu[Ti],Iu[Ti]=null,Ti--)}function nt(r,o){Ti++,Iu[Ti]=r.current,r.current=o}var wr={},Lt=xr(wr),Qt=xr(!1),Kr=wr;function Pi(r,o){var u=r.type.contextTypes;if(!u)return wr;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 Jt(r){return r=r.childContextTypes,r!=null}function aa(){it(Qt),it(Lt)}function em(r,o,u){if(Lt.current!==wr)throw Error(n(168));nt(Lt,o),nt(Qt,u)}function tm(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,de(r)||"Unknown",g));return N({},u,d)}function la(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||wr,Kr=Lt.current,nt(Lt,r),nt(Qt,Qt.current),!0}function nm(r,o,u){var d=r.stateNode;if(!d)throw Error(n(169));u?(r=tm(r,o,Kr),d.__reactInternalMemoizedMergedChildContext=r,it(Qt),it(Lt),nt(Lt,r)):it(Qt),nt(Qt,u)}var Zn=null,ua=!1,Du=!1;function rm(r){Zn===null?Zn=[r]:Zn.push(r)}function Sb(r){ua=!0,rm(r)}function kr(){if(!Du&&Zn!==null){Du=!0;var r=0,o=Ge;try{var u=Zn;for(Ge=1;r<u.length;r++){var d=u[r];do d=d(!0);while(d!==null)}Zn=null,ua=!1}catch(g){throw Zn!==null&&(Zn=Zn.slice(r+1)),op(nu,kr),g}finally{Ge=o,Du=!1}}return null}var Ri=[],ji=0,ca=null,fa=0,pn=[],mn=0,qr=null,er=1,tr="";function Xr(r,o){Ri[ji++]=fa,Ri[ji++]=ca,ca=r,fa=o}function im(r,o,u){pn[mn++]=er,pn[mn++]=tr,pn[mn++]=qr,qr=r;var d=er;r=tr;var g=32-Tn(d)-1;d&=~(1<<g),u+=1;var x=32-Tn(o)+g;if(30<x){var b=g-g%5;x=(d&(1<<b)-1).toString(32),d>>=b,g-=b,er=1<<32-Tn(o)+g|u<<g|d,tr=x+r}else er=1<<x|u<<g|d,tr=r}function _u(r){r.return!==null&&(Xr(r,1),im(r,1,0))}function Lu(r){for(;r===ca;)ca=Ri[--ji],Ri[ji]=null,fa=Ri[--ji],Ri[ji]=null;for(;r===qr;)qr=pn[--mn],pn[mn]=null,tr=pn[--mn],pn[mn]=null,er=pn[--mn],pn[mn]=null}var an=null,ln=null,st=!1,Rn=null;function om(r,o){var u=xn(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 sm(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,an=r,ln=vr(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,an=r,ln=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(u=qr!==null?{id:er,overflow:tr}:null,r.memoizedState={dehydrated:o,treeContext:u,retryLane:1073741824},u=xn(18,null,null,0),u.stateNode=o,u.return=r,r.child=u,an=r,ln=null,!0):!1;default:return!1}}function Ou(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Fu(r){if(st){var o=ln;if(o){var u=o;if(!sm(r,o)){if(Ou(r))throw Error(n(418));o=vr(u.nextSibling);var d=an;o&&sm(r,o)?om(d,u):(r.flags=r.flags&-4097|2,st=!1,an=r)}}else{if(Ou(r))throw Error(n(418));r.flags=r.flags&-4097|2,st=!1,an=r}}}function am(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;an=r}function da(r){if(r!==an)return!1;if(!st)return am(r),st=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!ju(r.type,r.memoizedProps)),o&&(o=ln)){if(Ou(r))throw lm(),Error(n(418));for(;o;)om(r,o),o=vr(o.nextSibling)}if(am(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){ln=vr(r.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++}r=r.nextSibling}ln=null}}else ln=an?vr(r.stateNode.nextSibling):null;return!0}function lm(){for(var r=ln;r;)r=vr(r.nextSibling)}function Ai(){ln=an=null,st=!1}function zu(r){Rn===null?Rn=[r]:Rn.push(r)}var bb=R.ReactCurrentBatchConfig;function _o(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 I=g.refs;b===null?delete I[x]:I[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 ha(r,o){throw r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function um(r){var o=r._init;return o(r._payload)}function cm(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=jr(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 I(U,z,H,ce){return z===null||z.tag!==6?(z=Ac(H,U.mode,ce),z.return=U,z):(z=g(z,H),z.return=U,z)}function L(U,z,H,ce){var Ee=H.type;return Ee===G?re(U,z,H.props.children,ce,H.key):z!==null&&(z.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===pe&&um(Ee)===z.type)?(ce=g(z,H.props),ce.ref=_o(U,z,H),ce.return=U,ce):(ce=Oa(H.type,H.key,H.props,null,U.mode,ce),ce.ref=_o(U,z,H),ce.return=U,ce)}function X(U,z,H,ce){return z===null||z.tag!==4||z.stateNode.containerInfo!==H.containerInfo||z.stateNode.implementation!==H.implementation?(z=Nc(H,U.mode,ce),z.return=U,z):(z=g(z,H.children||[]),z.return=U,z)}function re(U,z,H,ce,Ee){return z===null||z.tag!==7?(z=ni(H,U.mode,ce,Ee),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=Ac(""+z,U.mode,H),z.return=U,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case V:return H=Oa(z.type,z.key,z.props,null,U.mode,H),H.ref=_o(U,null,z),H.return=U,H;case D:return z=Nc(z,U.mode,H),z.return=U,z;case pe:var ce=z._init;return oe(U,ce(z._payload),H)}if(At(z)||fe(z))return z=ni(z,U.mode,H,null),z.return=U,z;ha(U,z)}return null}function ne(U,z,H,ce){var Ee=z!==null?z.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Ee!==null?null:I(U,z,""+H,ce);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case V:return H.key===Ee?L(U,z,H,ce):null;case D:return H.key===Ee?X(U,z,H,ce):null;case pe:return Ee=H._init,ne(U,z,Ee(H._payload),ce)}if(At(H)||fe(H))return Ee!==null?null:re(U,z,H,ce,null);ha(U,H)}return null}function ve(U,z,H,ce,Ee){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return U=U.get(H)||null,I(z,U,""+ce,Ee);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case V:return U=U.get(ce.key===null?H:ce.key)||null,L(z,U,ce,Ee);case D:return U=U.get(ce.key===null?H:ce.key)||null,X(z,U,ce,Ee);case pe:var Re=ce._init;return ve(U,z,H,Re(ce._payload),Ee)}if(At(ce)||fe(ce))return U=U.get(H)||null,re(z,U,ce,Ee,null);ha(z,ce)}return null}function Se(U,z,H,ce){for(var Ee=null,Re=null,je=z,Me=z=0,Pt=null;je!==null&&Me<H.length;Me++){je.index>Me?(Pt=je,je=null):Pt=je.sibling;var qe=ne(U,je,H[Me],ce);if(qe===null){je===null&&(je=Pt);break}r&&je&&qe.alternate===null&&o(U,je),z=x(qe,z,Me),Re===null?Ee=qe:Re.sibling=qe,Re=qe,je=Pt}if(Me===H.length)return u(U,je),st&&Xr(U,Me),Ee;if(je===null){for(;Me<H.length;Me++)je=oe(U,H[Me],ce),je!==null&&(z=x(je,z,Me),Re===null?Ee=je:Re.sibling=je,Re=je);return st&&Xr(U,Me),Ee}for(je=d(U,je);Me<H.length;Me++)Pt=ve(je,U,Me,H[Me],ce),Pt!==null&&(r&&Pt.alternate!==null&&je.delete(Pt.key===null?Me:Pt.key),z=x(Pt,z,Me),Re===null?Ee=Pt:Re.sibling=Pt,Re=Pt);return r&&je.forEach(function(Ar){return o(U,Ar)}),st&&Xr(U,Me),Ee}function Ce(U,z,H,ce){var Ee=fe(H);if(typeof Ee!="function")throw Error(n(150));if(H=Ee.call(H),H==null)throw Error(n(151));for(var Re=Ee=null,je=z,Me=z=0,Pt=null,qe=H.next();je!==null&&!qe.done;Me++,qe=H.next()){je.index>Me?(Pt=je,je=null):Pt=je.sibling;var Ar=ne(U,je,qe.value,ce);if(Ar===null){je===null&&(je=Pt);break}r&&je&&Ar.alternate===null&&o(U,je),z=x(Ar,z,Me),Re===null?Ee=Ar:Re.sibling=Ar,Re=Ar,je=Pt}if(qe.done)return u(U,je),st&&Xr(U,Me),Ee;if(je===null){for(;!qe.done;Me++,qe=H.next())qe=oe(U,qe.value,ce),qe!==null&&(z=x(qe,z,Me),Re===null?Ee=qe:Re.sibling=qe,Re=qe);return st&&Xr(U,Me),Ee}for(je=d(U,je);!qe.done;Me++,qe=H.next())qe=ve(je,U,Me,qe.value,ce),qe!==null&&(r&&qe.alternate!==null&&je.delete(qe.key===null?Me:qe.key),z=x(qe,z,Me),Re===null?Ee=qe:Re.sibling=qe,Re=qe);return r&&je.forEach(function(nC){return o(U,nC)}),st&&Xr(U,Me),Ee}function mt(U,z,H,ce){if(typeof H=="object"&&H!==null&&H.type===G&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case V:e:{for(var Ee=H.key,Re=z;Re!==null;){if(Re.key===Ee){if(Ee=H.type,Ee===G){if(Re.tag===7){u(U,Re.sibling),z=g(Re,H.props.children),z.return=U,U=z;break e}}else if(Re.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===pe&&um(Ee)===Re.type){u(U,Re.sibling),z=g(Re,H.props),z.ref=_o(U,Re,H),z.return=U,U=z;break e}u(U,Re);break}else o(U,Re);Re=Re.sibling}H.type===G?(z=ni(H.props.children,U.mode,ce,H.key),z.return=U,U=z):(ce=Oa(H.type,H.key,H.props,null,U.mode,ce),ce.ref=_o(U,z,H),ce.return=U,U=ce)}return b(U);case D:e:{for(Re=H.key;z!==null;){if(z.key===Re)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=Nc(H,U.mode,ce),z.return=U,U=z}return b(U);case pe:return Re=H._init,mt(U,z,Re(H._payload),ce)}if(At(H))return Se(U,z,H,ce);if(fe(H))return Ce(U,z,H,ce);ha(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=Ac(H,U.mode,ce),z.return=U,U=z),b(U)):u(U,z)}return mt}var Ni=cm(!0),fm=cm(!1),pa=xr(null),ma=null,Mi=null,Vu=null;function Bu(){Vu=Mi=ma=null}function $u(r){var o=pa.current;it(pa),r._currentValue=o}function Uu(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 Ii(r,o){ma=r,Vu=Mi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&o)!==0&&(Zt=!0),r.firstContext=null)}function gn(r){var o=r._currentValue;if(Vu!==r)if(r={context:r,memoizedValue:o,next:null},Mi===null){if(ma===null)throw Error(n(308));Mi=r,ma.dependencies={lanes:0,firstContext:r}}else Mi=Mi.next=r;return o}var Yr=null;function Wu(r){Yr===null?Yr=[r]:Yr.push(r)}function dm(r,o,u,d){var g=o.interleaved;return g===null?(u.next=u,Wu(o)):(u.next=g.next,g.next=u),o.interleaved=u,nr(r,d)}function nr(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 Sr=!1;function Hu(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hm(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 rr(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function br(r,o,u){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(We&2)!==0){var g=d.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),d.pending=o,nr(r,u)}return g=d.interleaved,g===null?(o.next=o,Wu(d)):(o.next=g.next,g.next=o),d.interleaved=o,nr(r,u)}function ga(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,ou(r,u)}}function pm(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 ya(r,o,u,d){var g=r.updateQueue;Sr=!1;var x=g.firstBaseUpdate,b=g.lastBaseUpdate,I=g.shared.pending;if(I!==null){g.shared.pending=null;var L=I,X=L.next;L.next=null,b===null?x=X:b.next=X,b=L;var re=r.alternate;re!==null&&(re=re.updateQueue,I=re.lastBaseUpdate,I!==b&&(I===null?re.firstBaseUpdate=X:I.next=X,re.lastBaseUpdate=L))}if(x!==null){var oe=g.baseState;b=0,re=X=L=null,I=x;do{var ne=I.lane,ve=I.eventTime;if((d&ne)===ne){re!==null&&(re=re.next={eventTime:ve,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Se=r,Ce=I;switch(ne=o,ve=u,Ce.tag){case 1:if(Se=Ce.payload,typeof Se=="function"){oe=Se.call(ve,oe,ne);break e}oe=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ce.payload,ne=typeof Se=="function"?Se.call(ve,oe,ne):Se,ne==null)break e;oe=N({},oe,ne);break e;case 2:Sr=!0}}I.callback!==null&&I.lane!==0&&(r.flags|=64,ne=g.effects,ne===null?g.effects=[I]:ne.push(I))}else ve={eventTime:ve,lane:ne,tag:I.tag,payload:I.payload,callback:I.callback,next:null},re===null?(X=re=ve,L=oe):re=re.next=ve,b|=ne;if(I=I.next,I===null){if(I=g.shared.pending,I===null)break;ne=I,I=ne.next,ne.next=null,g.lastBaseUpdate=ne,g.shared.pending=null}}while(!0);if(re===null&&(L=oe),g.baseState=L,g.firstBaseUpdate=X,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);Jr|=b,r.lanes=b,r.memoizedState=oe}}function mm(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 Lo={},Bn=xr(Lo),Oo=xr(Lo),Fo=xr(Lo);function Gr(r){if(r===Lo)throw Error(n(174));return r}function Ku(r,o){switch(nt(Fo,o),nt(Oo,r),nt(Bn,Lo),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:ae(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=ae(o,r)}it(Bn),nt(Bn,o)}function Di(){it(Bn),it(Oo),it(Fo)}function gm(r){Gr(Fo.current);var o=Gr(Bn.current),u=ae(o,r.type);o!==u&&(nt(Oo,r),nt(Bn,u))}function qu(r){Oo.current===r&&(it(Bn),it(Oo))}var ct=xr(0);function va(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 Xu=[];function Yu(){for(var r=0;r<Xu.length;r++)Xu[r]._workInProgressVersionPrimary=null;Xu.length=0}var xa=R.ReactCurrentDispatcher,Gu=R.ReactCurrentBatchConfig,Qr=0,ft=null,St=null,Et=null,wa=!1,zo=!1,Vo=0,Cb=0;function Ot(){throw Error(n(321))}function Qu(r,o){if(o===null)return!1;for(var u=0;u<o.length&&u<r.length;u++)if(!Pn(r[u],o[u]))return!1;return!0}function Ju(r,o,u,d,g,x){if(Qr=x,ft=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,xa.current=r===null||r.memoizedState===null?Rb:jb,r=u(d,g),zo){x=0;do{if(zo=!1,Vo=0,25<=x)throw Error(n(301));x+=1,Et=St=null,o.updateQueue=null,xa.current=Ab,r=u(d,g)}while(zo)}if(xa.current=ba,o=St!==null&&St.next!==null,Qr=0,Et=St=ft=null,wa=!1,o)throw Error(n(300));return r}function Zu(){var r=Vo!==0;return Vo=0,r}function $n(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?ft.memoizedState=Et=r:Et=Et.next=r,Et}function yn(){if(St===null){var r=ft.alternate;r=r!==null?r.memoizedState:null}else r=St.next;var o=Et===null?ft.memoizedState:Et.next;if(o!==null)Et=o,St=r;else{if(r===null)throw Error(n(310));St=r,r={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Et===null?ft.memoizedState=Et=r:Et=Et.next=r}return Et}function Bo(r,o){return typeof o=="function"?o(r):o}function ec(r){var o=yn(),u=o.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var d=St,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 I=b=null,L=null,X=x;do{var re=X.lane;if((Qr&re)===re)L!==null&&(L=L.next={lane:0,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),d=X.hasEagerState?X.eagerState:r(d,X.action);else{var oe={lane:re,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null};L===null?(I=L=oe,b=d):L=L.next=oe,ft.lanes|=re,Jr|=re}X=X.next}while(X!==null&&X!==x);L===null?b=d:L.next=I,Pn(d,o.memoizedState)||(Zt=!0),o.memoizedState=d,o.baseState=b,o.baseQueue=L,u.lastRenderedState=d}if(r=u.interleaved,r!==null){g=r;do x=g.lane,ft.lanes|=x,Jr|=x,g=g.next;while(g!==r)}else g===null&&(u.lanes=0);return[o.memoizedState,u.dispatch]}function tc(r){var o=yn(),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);Pn(x,o.memoizedState)||(Zt=!0),o.memoizedState=x,o.baseQueue===null&&(o.baseState=x),u.lastRenderedState=x}return[x,d]}function ym(){}function vm(r,o){var u=ft,d=yn(),g=o(),x=!Pn(d.memoizedState,g);if(x&&(d.memoizedState=g,Zt=!0),d=d.queue,nc(km.bind(null,u,d,r),[r]),d.getSnapshot!==o||x||Et!==null&&Et.memoizedState.tag&1){if(u.flags|=2048,$o(9,wm.bind(null,u,d,g,o),void 0,null),Tt===null)throw Error(n(349));(Qr&30)!==0||xm(u,o,g)}return g}function xm(r,o,u){r.flags|=16384,r={getSnapshot:o,value:u},o=ft.updateQueue,o===null?(o={lastEffect:null,stores:null},ft.updateQueue=o,o.stores=[r]):(u=o.stores,u===null?o.stores=[r]:u.push(r))}function wm(r,o,u,d){o.value=u,o.getSnapshot=d,Sm(o)&&bm(r)}function km(r,o,u){return u(function(){Sm(o)&&bm(r)})}function Sm(r){var o=r.getSnapshot;r=r.value;try{var u=o();return!Pn(r,u)}catch{return!0}}function bm(r){var o=nr(r,1);o!==null&&Mn(o,r,1,-1)}function Cm(r){var o=$n();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:r},o.queue=r,r=r.dispatch=Pb.bind(null,ft,r),[o.memoizedState,r]}function $o(r,o,u,d){return r={tag:r,create:o,destroy:u,deps:d,next:null},o=ft.updateQueue,o===null?(o={lastEffect:null,stores:null},ft.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 Em(){return yn().memoizedState}function ka(r,o,u,d){var g=$n();ft.flags|=r,g.memoizedState=$o(1|o,u,void 0,d===void 0?null:d)}function Sa(r,o,u,d){var g=yn();d=d===void 0?null:d;var x=void 0;if(St!==null){var b=St.memoizedState;if(x=b.destroy,d!==null&&Qu(d,b.deps)){g.memoizedState=$o(o,u,x,d);return}}ft.flags|=r,g.memoizedState=$o(1|o,u,x,d)}function Tm(r,o){return ka(8390656,8,r,o)}function nc(r,o){return Sa(2048,8,r,o)}function Pm(r,o){return Sa(4,2,r,o)}function Rm(r,o){return Sa(4,4,r,o)}function jm(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 Am(r,o,u){return u=u!=null?u.concat([r]):null,Sa(4,4,jm.bind(null,o,r),u)}function rc(){}function Nm(r,o){var u=yn();o=o===void 0?null:o;var d=u.memoizedState;return d!==null&&o!==null&&Qu(o,d[1])?d[0]:(u.memoizedState=[r,o],r)}function Mm(r,o){var u=yn();o=o===void 0?null:o;var d=u.memoizedState;return d!==null&&o!==null&&Qu(o,d[1])?d[0]:(r=r(),u.memoizedState=[r,o],r)}function Im(r,o,u){return(Qr&21)===0?(r.baseState&&(r.baseState=!1,Zt=!0),r.memoizedState=u):(Pn(u,o)||(u=up(),ft.lanes|=u,Jr|=u,r.baseState=!0),o)}function Eb(r,o){var u=Ge;Ge=u!==0&&4>u?u:4,r(!0);var d=Gu.transition;Gu.transition={};try{r(!1),o()}finally{Ge=u,Gu.transition=d}}function Dm(){return yn().memoizedState}function Tb(r,o,u){var d=Pr(r);if(u={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null},_m(r))Lm(o,u);else if(u=dm(r,o,u,d),u!==null){var g=Wt();Mn(u,r,d,g),Om(u,o,d)}}function Pb(r,o,u){var d=Pr(r),g={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null};if(_m(r))Lm(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,I=x(b,u);if(g.hasEagerState=!0,g.eagerState=I,Pn(I,b)){var L=o.interleaved;L===null?(g.next=g,Wu(o)):(g.next=L.next,L.next=g),o.interleaved=g;return}}catch{}finally{}u=dm(r,o,g,d),u!==null&&(g=Wt(),Mn(u,r,d,g),Om(u,o,d))}}function _m(r){var o=r.alternate;return r===ft||o!==null&&o===ft}function Lm(r,o){zo=wa=!0;var u=r.pending;u===null?o.next=o:(o.next=u.next,u.next=o),r.pending=o}function Om(r,o,u){if((u&4194240)!==0){var d=o.lanes;d&=r.pendingLanes,u|=d,o.lanes=u,ou(r,u)}}var ba={readContext:gn,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useInsertionEffect:Ot,useLayoutEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useMutableSource:Ot,useSyncExternalStore:Ot,useId:Ot,unstable_isNewReconciler:!1},Rb={readContext:gn,useCallback:function(r,o){return $n().memoizedState=[r,o===void 0?null:o],r},useContext:gn,useEffect:Tm,useImperativeHandle:function(r,o,u){return u=u!=null?u.concat([r]):null,ka(4194308,4,jm.bind(null,o,r),u)},useLayoutEffect:function(r,o){return ka(4194308,4,r,o)},useInsertionEffect:function(r,o){return ka(4,2,r,o)},useMemo:function(r,o){var u=$n();return o=o===void 0?null:o,r=r(),u.memoizedState=[r,o],r},useReducer:function(r,o,u){var d=$n();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=Tb.bind(null,ft,r),[d.memoizedState,r]},useRef:function(r){var o=$n();return r={current:r},o.memoizedState=r},useState:Cm,useDebugValue:rc,useDeferredValue:function(r){return $n().memoizedState=r},useTransition:function(){var r=Cm(!1),o=r[0];return r=Eb.bind(null,r[1]),$n().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,u){var d=ft,g=$n();if(st){if(u===void 0)throw Error(n(407));u=u()}else{if(u=o(),Tt===null)throw Error(n(349));(Qr&30)!==0||xm(d,o,u)}g.memoizedState=u;var x={value:u,getSnapshot:o};return g.queue=x,Tm(km.bind(null,d,x,r),[r]),d.flags|=2048,$o(9,wm.bind(null,d,x,u,o),void 0,null),u},useId:function(){var r=$n(),o=Tt.identifierPrefix;if(st){var u=tr,d=er;u=(d&~(1<<32-Tn(d)-1)).toString(32)+u,o=":"+o+"R"+u,u=Vo++,0<u&&(o+="H"+u.toString(32)),o+=":"}else u=Cb++,o=":"+o+"r"+u.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},jb={readContext:gn,useCallback:Nm,useContext:gn,useEffect:nc,useImperativeHandle:Am,useInsertionEffect:Pm,useLayoutEffect:Rm,useMemo:Mm,useReducer:ec,useRef:Em,useState:function(){return ec(Bo)},useDebugValue:rc,useDeferredValue:function(r){var o=yn();return Im(o,St.memoizedState,r)},useTransition:function(){var r=ec(Bo)[0],o=yn().memoizedState;return[r,o]},useMutableSource:ym,useSyncExternalStore:vm,useId:Dm,unstable_isNewReconciler:!1},Ab={readContext:gn,useCallback:Nm,useContext:gn,useEffect:nc,useImperativeHandle:Am,useInsertionEffect:Pm,useLayoutEffect:Rm,useMemo:Mm,useReducer:tc,useRef:Em,useState:function(){return tc(Bo)},useDebugValue:rc,useDeferredValue:function(r){var o=yn();return St===null?o.memoizedState=r:Im(o,St.memoizedState,r)},useTransition:function(){var r=tc(Bo)[0],o=yn().memoizedState;return[r,o]},useMutableSource:ym,useSyncExternalStore:vm,useId:Dm,unstable_isNewReconciler:!1};function jn(r,o){if(r&&r.defaultProps){o=N({},o),r=r.defaultProps;for(var u in r)o[u]===void 0&&(o[u]=r[u]);return o}return o}function ic(r,o,u,d){o=r.memoizedState,u=u(d,o),u=u==null?o:N({},o,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Ca={isMounted:function(r){return(r=r._reactInternals)?Wr(r)===r:!1},enqueueSetState:function(r,o,u){r=r._reactInternals;var d=Wt(),g=Pr(r),x=rr(d,g);x.payload=o,u!=null&&(x.callback=u),o=br(r,x,g),o!==null&&(Mn(o,r,g,d),ga(o,r,g))},enqueueReplaceState:function(r,o,u){r=r._reactInternals;var d=Wt(),g=Pr(r),x=rr(d,g);x.tag=1,x.payload=o,u!=null&&(x.callback=u),o=br(r,x,g),o!==null&&(Mn(o,r,g,d),ga(o,r,g))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var u=Wt(),d=Pr(r),g=rr(u,d);g.tag=2,o!=null&&(g.callback=o),o=br(r,g,d),o!==null&&(Mn(o,r,d,u),ga(o,r,d))}};function Fm(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?!Ro(u,d)||!Ro(g,x):!0}function zm(r,o,u){var d=!1,g=wr,x=o.contextType;return typeof x=="object"&&x!==null?x=gn(x):(g=Jt(o)?Kr:Lt.current,d=o.contextTypes,x=(d=d!=null)?Pi(r,g):wr),o=new o(u,x),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ca,r.stateNode=o,o._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=g,r.__reactInternalMemoizedMaskedChildContext=x),o}function Vm(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&&Ca.enqueueReplaceState(o,o.state,null)}function oc(r,o,u,d){var g=r.stateNode;g.props=u,g.state=r.memoizedState,g.refs={},Hu(r);var x=o.contextType;typeof x=="object"&&x!==null?g.context=gn(x):(x=Jt(o)?Kr:Lt.current,g.context=Pi(r,x)),g.state=r.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(ic(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&&Ca.enqueueReplaceState(g,g.state,null),ya(r,u,g,d),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308)}function _i(r,o){try{var u="",d=o;do u+=me(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 sc(r,o,u){return{value:r,source:null,stack:u??null,digest:o??null}}function ac(r,o){try{console.error(o.value)}catch(u){setTimeout(function(){throw u})}}var Nb=typeof WeakMap=="function"?WeakMap:Map;function Bm(r,o,u){u=rr(-1,u),u.tag=3,u.payload={element:null};var d=o.value;return u.callback=function(){Na||(Na=!0,Sc=d),ac(r,o)},u}function $m(r,o,u){u=rr(-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(){ac(r,o)}}var x=r.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(u.callback=function(){ac(r,o),typeof d!="function"&&(Er===null?Er=new Set([this]):Er.add(this));var b=o.stack;this.componentDidCatch(o.value,{componentStack:b!==null?b:""})}),u}function Um(r,o,u){var d=r.pingCache;if(d===null){d=r.pingCache=new Nb;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=Hb.bind(null,r,o,u),o.then(r,r))}function Wm(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 Hm(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=rr(-1,1),o.tag=2,br(u,o,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=g,r)}var Mb=R.ReactCurrentOwner,Zt=!1;function Ut(r,o,u,d){o.child=r===null?fm(o,null,u,d):Ni(o,r.child,u,d)}function Km(r,o,u,d,g){u=u.render;var x=o.ref;return Ii(o,g),d=Ju(r,o,u,d,x,g),u=Zu(),r!==null&&!Zt?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~g,ir(r,o,g)):(st&&u&&_u(o),o.flags|=1,Ut(r,o,d,g),o.child)}function qm(r,o,u,d,g){if(r===null){var x=u.type;return typeof x=="function"&&!jc(x)&&x.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(o.tag=15,o.type=x,Xm(r,o,x,d,g)):(r=Oa(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:Ro,u(b,d)&&r.ref===o.ref)return ir(r,o,g)}return o.flags|=1,r=jr(x,d),r.ref=o.ref,r.return=o,o.child=r}function Xm(r,o,u,d,g){if(r!==null){var x=r.memoizedProps;if(Ro(x,d)&&r.ref===o.ref)if(Zt=!1,o.pendingProps=d=x,(r.lanes&g)!==0)(r.flags&131072)!==0&&(Zt=!0);else return o.lanes=r.lanes,ir(r,o,g)}return lc(r,o,u,d,g)}function Ym(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},nt(Oi,un),un|=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,nt(Oi,un),un|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=x!==null?x.baseLanes:u,nt(Oi,un),un|=d}else x!==null?(d=x.baseLanes|u,o.memoizedState=null):d=u,nt(Oi,un),un|=d;return Ut(r,o,g,u),o.child}function Gm(r,o){var u=o.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(o.flags|=512,o.flags|=2097152)}function lc(r,o,u,d,g){var x=Jt(u)?Kr:Lt.current;return x=Pi(o,x),Ii(o,g),u=Ju(r,o,u,d,x,g),d=Zu(),r!==null&&!Zt?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~g,ir(r,o,g)):(st&&d&&_u(o),o.flags|=1,Ut(r,o,u,g),o.child)}function Qm(r,o,u,d,g){if(Jt(u)){var x=!0;la(o)}else x=!1;if(Ii(o,g),o.stateNode===null)Ta(r,o),zm(o,u,d),oc(o,u,d,g),d=!0;else if(r===null){var b=o.stateNode,I=o.memoizedProps;b.props=I;var L=b.context,X=u.contextType;typeof X=="object"&&X!==null?X=gn(X):(X=Jt(u)?Kr:Lt.current,X=Pi(o,X));var re=u.getDerivedStateFromProps,oe=typeof re=="function"||typeof b.getSnapshotBeforeUpdate=="function";oe||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(I!==d||L!==X)&&Vm(o,b,d,X),Sr=!1;var ne=o.memoizedState;b.state=ne,ya(o,d,b,g),L=o.memoizedState,I!==d||ne!==L||Qt.current||Sr?(typeof re=="function"&&(ic(o,u,re,d),L=o.memoizedState),(I=Sr||Fm(o,u,I,d,ne,L,X))?(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=L),b.props=d,b.state=L,b.context=X,d=I):(typeof b.componentDidMount=="function"&&(o.flags|=4194308),d=!1)}else{b=o.stateNode,hm(r,o),I=o.memoizedProps,X=o.type===o.elementType?I:jn(o.type,I),b.props=X,oe=o.pendingProps,ne=b.context,L=u.contextType,typeof L=="object"&&L!==null?L=gn(L):(L=Jt(u)?Kr:Lt.current,L=Pi(o,L));var ve=u.getDerivedStateFromProps;(re=typeof ve=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(I!==oe||ne!==L)&&Vm(o,b,d,L),Sr=!1,ne=o.memoizedState,b.state=ne,ya(o,d,b,g);var Se=o.memoizedState;I!==oe||ne!==Se||Qt.current||Sr?(typeof ve=="function"&&(ic(o,u,ve,d),Se=o.memoizedState),(X=Sr||Fm(o,u,X,d,ne,Se,L)||!1)?(re||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,Se,L),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,Se,L)),typeof b.componentDidUpdate=="function"&&(o.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof b.componentDidUpdate!="function"||I===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||I===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=d,o.memoizedState=Se),b.props=d,b.state=Se,b.context=L,d=X):(typeof b.componentDidUpdate!="function"||I===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||I===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),d=!1)}return uc(r,o,u,d,x,g)}function uc(r,o,u,d,g,x){Gm(r,o);var b=(o.flags&128)!==0;if(!d&&!b)return g&&nm(o,u,!1),ir(r,o,x);d=o.stateNode,Mb.current=o;var I=b&&typeof u.getDerivedStateFromError!="function"?null:d.render();return o.flags|=1,r!==null&&b?(o.child=Ni(o,r.child,null,x),o.child=Ni(o,null,I,x)):Ut(r,o,I,x),o.memoizedState=d.state,g&&nm(o,u,!0),o.child}function Jm(r){var o=r.stateNode;o.pendingContext?em(r,o.pendingContext,o.pendingContext!==o.context):o.context&&em(r,o.context,!1),Ku(r,o.containerInfo)}function Zm(r,o,u,d,g){return Ai(),zu(g),o.flags|=256,Ut(r,o,u,d),o.child}var cc={dehydrated:null,treeContext:null,retryLane:0};function fc(r){return{baseLanes:r,cachePool:null,transitions:null}}function eg(r,o,u){var d=o.pendingProps,g=ct.current,x=!1,b=(o.flags&128)!==0,I;if((I=b)||(I=r!==null&&r.memoizedState===null?!1:(g&2)!==0),I?(x=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(g|=1),nt(ct,g&1),r===null)return Fu(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=Fa(b,d,0,null),r=ni(r,d,u,null),x.return=o,r.return=o,x.sibling=r,o.child=x,o.child.memoizedState=fc(u),o.memoizedState=cc,r):dc(o,b));if(g=r.memoizedState,g!==null&&(I=g.dehydrated,I!==null))return Ib(r,o,b,d,I,g,u);if(x){x=d.fallback,b=o.mode,g=r.child,I=g.sibling;var L={mode:"hidden",children:d.children};return(b&1)===0&&o.child!==g?(d=o.child,d.childLanes=0,d.pendingProps=L,o.deletions=null):(d=jr(g,L),d.subtreeFlags=g.subtreeFlags&14680064),I!==null?x=jr(I,x):(x=ni(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?fc(u):{baseLanes:b.baseLanes|u,cachePool:null,transitions:b.transitions},x.memoizedState=b,x.childLanes=r.childLanes&~u,o.memoizedState=cc,d}return x=r.child,r=x.sibling,d=jr(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 dc(r,o){return o=Fa({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function Ea(r,o,u,d){return d!==null&&zu(d),Ni(o,r.child,null,u),r=dc(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function Ib(r,o,u,d,g,x,b){if(u)return o.flags&256?(o.flags&=-257,d=sc(Error(n(422))),Ea(r,o,b,d)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(x=d.fallback,g=o.mode,d=Fa({mode:"visible",children:d.children},g,0,null),x=ni(x,g,b,null),x.flags|=2,d.return=o,x.return=o,d.sibling=x,o.child=d,(o.mode&1)!==0&&Ni(o,r.child,null,b),o.child.memoizedState=fc(b),o.memoizedState=cc,x);if((o.mode&1)===0)return Ea(r,o,b,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var I=d.dgst;return d=I,x=Error(n(419)),d=sc(x,d,void 0),Ea(r,o,b,d)}if(I=(b&r.childLanes)!==0,Zt||I){if(d=Tt,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,nr(r,g),Mn(d,r,g,-1))}return Rc(),d=sc(Error(n(421))),Ea(r,o,b,d)}return g.data==="$?"?(o.flags|=128,o.child=r.child,o=Kb.bind(null,r),g._reactRetry=o,null):(r=x.treeContext,ln=vr(g.nextSibling),an=o,st=!0,Rn=null,r!==null&&(pn[mn++]=er,pn[mn++]=tr,pn[mn++]=qr,er=r.id,tr=r.overflow,qr=o),o=dc(o,d.children),o.flags|=4096,o)}function tg(r,o,u){r.lanes|=o;var d=r.alternate;d!==null&&(d.lanes|=o),Uu(r.return,o,u)}function hc(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 ng(r,o,u){var d=o.pendingProps,g=d.revealOrder,x=d.tail;if(Ut(r,o,d.children,u),d=ct.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&&tg(r,u,o);else if(r.tag===19)tg(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(nt(ct,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&&va(r)===null&&(g=u),u=u.sibling;u=g,u===null?(g=o.child,o.child=null):(g=u.sibling,u.sibling=null),hc(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&&va(r)===null){o.child=g;break}r=g.sibling,g.sibling=u,u=g,g=r}hc(o,!0,u,null,x);break;case"together":hc(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Ta(r,o){(o.mode&1)===0&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function ir(r,o,u){if(r!==null&&(o.dependencies=r.dependencies),Jr|=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=jr(r,r.pendingProps),o.child=u,u.return=o;r.sibling!==null;)r=r.sibling,u=u.sibling=jr(r,r.pendingProps),u.return=o;u.sibling=null}return o.child}function Db(r,o,u){switch(o.tag){case 3:Jm(o),Ai();break;case 5:gm(o);break;case 1:Jt(o.type)&&la(o);break;case 4:Ku(o,o.stateNode.containerInfo);break;case 10:var d=o.type._context,g=o.memoizedProps.value;nt(pa,d._currentValue),d._currentValue=g;break;case 13:if(d=o.memoizedState,d!==null)return d.dehydrated!==null?(nt(ct,ct.current&1),o.flags|=128,null):(u&o.child.childLanes)!==0?eg(r,o,u):(nt(ct,ct.current&1),r=ir(r,o,u),r!==null?r.sibling:null);nt(ct,ct.current&1);break;case 19:if(d=(u&o.childLanes)!==0,(r.flags&128)!==0){if(d)return ng(r,o,u);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),nt(ct,ct.current),d)break;return null;case 22:case 23:return o.lanes=0,Ym(r,o,u)}return ir(r,o,u)}var rg,pc,ig,og;rg=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}},pc=function(){},ig=function(r,o,u,d){var g=r.memoizedProps;if(g!==d){r=o.stateNode,Gr(Bn.current);var x=null;switch(u){case"input":g=at(r,g),d=at(r,d),x=[];break;case"select":g=N({},g,{value:void 0}),d=N({},d,{value:void 0}),x=[];break;case"textarea":g=Fn(r,g),d=Fn(r,d),x=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=oa)}he(u,d);var b;u=null;for(X in g)if(!d.hasOwnProperty(X)&&g.hasOwnProperty(X)&&g[X]!=null)if(X==="style"){var I=g[X];for(b in I)I.hasOwnProperty(b)&&(u||(u={}),u[b]="")}else X!=="dangerouslySetInnerHTML"&&X!=="children"&&X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&X!=="autoFocus"&&(s.hasOwnProperty(X)?x||(x=[]):(x=x||[]).push(X,null));for(X in d){var L=d[X];if(I=g?.[X],d.hasOwnProperty(X)&&L!==I&&(L!=null||I!=null))if(X==="style")if(I){for(b in I)!I.hasOwnProperty(b)||L&&L.hasOwnProperty(b)||(u||(u={}),u[b]="");for(b in L)L.hasOwnProperty(b)&&I[b]!==L[b]&&(u||(u={}),u[b]=L[b])}else u||(x||(x=[]),x.push(X,u)),u=L;else X==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,I=I?I.__html:void 0,L!=null&&I!==L&&(x=x||[]).push(X,L)):X==="children"?typeof L!="string"&&typeof L!="number"||(x=x||[]).push(X,""+L):X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&(s.hasOwnProperty(X)?(L!=null&&X==="onScroll"&&rt("scroll",r),x||I===L||(x=[])):(x=x||[]).push(X,L))}u&&(x=x||[]).push("style",u);var X=x;(o.updateQueue=X)&&(o.flags|=4)}},og=function(r,o,u,d){u!==d&&(o.flags|=4)};function Uo(r,o){if(!st)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 Ft(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 _b(r,o,u){var d=o.pendingProps;switch(Lu(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(o),null;case 1:return Jt(o.type)&&aa(),Ft(o),null;case 3:return d=o.stateNode,Di(),it(Qt),it(Lt),Yu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(da(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Rn!==null&&(Ec(Rn),Rn=null))),pc(r,o),Ft(o),null;case 5:qu(o);var g=Gr(Fo.current);if(u=o.type,r!==null&&o.stateNode!=null)ig(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 Ft(o),null}if(r=Gr(Bn.current),da(o)){d=o.stateNode,u=o.type;var x=o.memoizedProps;switch(d[Vn]=o,d[Io]=x,r=(o.mode&1)!==0,u){case"dialog":rt("cancel",d),rt("close",d);break;case"iframe":case"object":case"embed":rt("load",d);break;case"video":case"audio":for(g=0;g<Ao.length;g++)rt(Ao[g],d);break;case"source":rt("error",d);break;case"img":case"image":case"link":rt("error",d),rt("load",d);break;case"details":rt("toggle",d);break;case"input":_t(d,x),rt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!x.multiple},rt("invalid",d);break;case"textarea":Oe(d,x),rt("invalid",d)}he(u,x),g=null;for(var b in x)if(x.hasOwnProperty(b)){var I=x[b];b==="children"?typeof I=="string"?d.textContent!==I&&(x.suppressHydrationWarning!==!0&&ia(d.textContent,I,r),g=["children",I]):typeof I=="number"&&d.textContent!==""+I&&(x.suppressHydrationWarning!==!0&&ia(d.textContent,I,r),g=["children",""+I]):s.hasOwnProperty(b)&&I!=null&&b==="onScroll"&&rt("scroll",d)}switch(u){case"input":He(d),jt(d,x,!0);break;case"textarea":He(d),En(d);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(d.onclick=oa)}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=Y(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[Vn]=o,r[Io]=d,rg(r,o,!1,!1),o.stateNode=r;e:{switch(b=ue(u,d),u){case"dialog":rt("cancel",r),rt("close",r),g=d;break;case"iframe":case"object":case"embed":rt("load",r),g=d;break;case"video":case"audio":for(g=0;g<Ao.length;g++)rt(Ao[g],r);g=d;break;case"source":rt("error",r),g=d;break;case"img":case"image":case"link":rt("error",r),rt("load",r),g=d;break;case"details":rt("toggle",r),g=d;break;case"input":_t(r,d),g=at(r,d),rt("invalid",r);break;case"option":g=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},g=N({},d,{value:void 0}),rt("invalid",r);break;case"textarea":Oe(r,d),g=Fn(r,d),rt("invalid",r);break;default:g=d}he(u,g),I=g;for(x in I)if(I.hasOwnProperty(x)){var L=I[x];x==="style"?q(r,L):x==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&De(r,L)):x==="children"?typeof L=="string"?(u!=="textarea"||L!=="")&&ze(r,L):typeof L=="number"&&ze(r,""+L):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(s.hasOwnProperty(x)?L!=null&&x==="onScroll"&&rt("scroll",r):L!=null&&j(r,x,L,b))}switch(u){case"input":He(r),jt(r,d,!1);break;case"textarea":He(r),En(r);break;case"option":d.value!=null&&r.setAttribute("value",""+Te(d.value));break;case"select":r.multiple=!!d.multiple,x=d.value,x!=null?Gt(r,!!d.multiple,x,!1):d.defaultValue!=null&&Gt(r,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(r.onclick=oa)}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 Ft(o),null;case 6:if(r&&o.stateNode!=null)og(r,o,r.memoizedProps,d);else{if(typeof d!="string"&&o.stateNode===null)throw Error(n(166));if(u=Gr(Fo.current),Gr(Bn.current),da(o)){if(d=o.stateNode,u=o.memoizedProps,d[Vn]=o,(x=d.nodeValue!==u)&&(r=an,r!==null))switch(r.tag){case 3:ia(d.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&ia(d.nodeValue,u,(r.mode&1)!==0)}x&&(o.flags|=4)}else d=(u.nodeType===9?u:u.ownerDocument).createTextNode(d),d[Vn]=o,o.stateNode=d}return Ft(o),null;case 13:if(it(ct),d=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(st&&ln!==null&&(o.mode&1)!==0&&(o.flags&128)===0)lm(),Ai(),o.flags|=98560,x=!1;else if(x=da(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[Vn]=o}else Ai(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ft(o),x=!1}else Rn!==null&&(Ec(Rn),Rn=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||(ct.current&1)!==0?bt===0&&(bt=3):Rc())),o.updateQueue!==null&&(o.flags|=4),Ft(o),null);case 4:return Di(),pc(r,o),r===null&&No(o.stateNode.containerInfo),Ft(o),null;case 10:return $u(o.type._context),Ft(o),null;case 17:return Jt(o.type)&&aa(),Ft(o),null;case 19:if(it(ct),x=o.memoizedState,x===null)return Ft(o),null;if(d=(o.flags&128)!==0,b=x.rendering,b===null)if(d)Uo(x,!1);else{if(bt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(b=va(r),b!==null){for(o.flags|=128,Uo(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 nt(ct,ct.current&1|2),o.child}r=r.sibling}x.tail!==null&&pt()>Fi&&(o.flags|=128,d=!0,Uo(x,!1),o.lanes=4194304)}else{if(!d)if(r=va(b),r!==null){if(o.flags|=128,d=!0,u=r.updateQueue,u!==null&&(o.updateQueue=u,o.flags|=4),Uo(x,!0),x.tail===null&&x.tailMode==="hidden"&&!b.alternate&&!st)return Ft(o),null}else 2*pt()-x.renderingStartTime>Fi&&u!==1073741824&&(o.flags|=128,d=!0,Uo(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=pt(),o.sibling=null,u=ct.current,nt(ct,d?u&1|2:u&1),o):(Ft(o),null);case 22:case 23:return Pc(),d=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(o.flags|=8192),d&&(o.mode&1)!==0?(un&1073741824)!==0&&(Ft(o),o.subtreeFlags&6&&(o.flags|=8192)):Ft(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function Lb(r,o){switch(Lu(o),o.tag){case 1:return Jt(o.type)&&aa(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Di(),it(Qt),it(Lt),Yu(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 5:return qu(o),null;case 13:if(it(ct),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ai()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return it(ct),null;case 4:return Di(),null;case 10:return $u(o.type._context),null;case 22:case 23:return Pc(),null;case 24:return null;default:return null}}var Pa=!1,zt=!1,Ob=typeof WeakSet=="function"?WeakSet:Set,we=null;function Li(r,o){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(d){dt(r,o,d)}else u.current=null}function mc(r,o,u){try{u()}catch(d){dt(r,o,d)}}var sg=!1;function Fb(r,o){if(Pu=qs,r=Fp(),xu(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,I=-1,L=-1,X=0,re=0,oe=r,ne=null;t:for(;;){for(var ve;oe!==u||g!==0&&oe.nodeType!==3||(I=b+g),oe!==x||d!==0&&oe.nodeType!==3||(L=b+d),oe.nodeType===3&&(b+=oe.nodeValue.length),(ve=oe.firstChild)!==null;)ne=oe,oe=ve;for(;;){if(oe===r)break t;if(ne===u&&++X===g&&(I=b),ne===x&&++re===d&&(L=b),(ve=oe.nextSibling)!==null)break;oe=ne,ne=oe.parentNode}oe=ve}u=I===-1||L===-1?null:{start:I,end:L}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ru={focusedElem:r,selectionRange:u},qs=!1,we=o;we!==null;)if(o=we,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,we=r;else for(;we!==null;){o=we;try{var Se=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ce=Se.memoizedProps,mt=Se.memoizedState,U=o.stateNode,z=U.getSnapshotBeforeUpdate(o.elementType===o.type?Ce:jn(o.type,Ce),mt);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(ce){dt(o,o.return,ce)}if(r=o.sibling,r!==null){r.return=o.return,we=r;break}we=o.return}return Se=sg,sg=!1,Se}function Wo(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&&mc(o,u,x)}g=g.next}while(g!==d)}}function Ra(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 gc(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 ag(r){var o=r.alternate;o!==null&&(r.alternate=null,ag(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[Vn],delete o[Io],delete o[Mu],delete o[wb],delete o[kb])),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 lg(r){return r.tag===5||r.tag===3||r.tag===4}function ug(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||lg(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 yc(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=oa));else if(d!==4&&(r=r.child,r!==null))for(yc(r,o,u),r=r.sibling;r!==null;)yc(r,o,u),r=r.sibling}function vc(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(vc(r,o,u),r=r.sibling;r!==null;)vc(r,o,u),r=r.sibling}var Nt=null,An=!1;function Cr(r,o,u){for(u=u.child;u!==null;)cg(r,o,u),u=u.sibling}function cg(r,o,u){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(Bs,u)}catch{}switch(u.tag){case 5:zt||Li(u,o);case 6:var d=Nt,g=An;Nt=null,Cr(r,o,u),Nt=d,An=g,Nt!==null&&(An?(r=Nt,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):Nt.removeChild(u.stateNode));break;case 18:Nt!==null&&(An?(r=Nt,u=u.stateNode,r.nodeType===8?Nu(r.parentNode,u):r.nodeType===1&&Nu(r,u),So(r)):Nu(Nt,u.stateNode));break;case 4:d=Nt,g=An,Nt=u.stateNode.containerInfo,An=!0,Cr(r,o,u),Nt=d,An=g;break;case 0:case 11:case 14:case 15:if(!zt&&(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)&&mc(u,o,b),g=g.next}while(g!==d)}Cr(r,o,u);break;case 1:if(!zt&&(Li(u,o),d=u.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=u.memoizedProps,d.state=u.memoizedState,d.componentWillUnmount()}catch(I){dt(u,o,I)}Cr(r,o,u);break;case 21:Cr(r,o,u);break;case 22:u.mode&1?(zt=(d=zt)||u.memoizedState!==null,Cr(r,o,u),zt=d):Cr(r,o,u);break;default:Cr(r,o,u)}}function fg(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new Ob),o.forEach(function(d){var g=qb.bind(null,r,d);u.has(d)||(u.add(d),d.then(g,g))})}}function Nn(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,I=b;e:for(;I!==null;){switch(I.tag){case 5:Nt=I.stateNode,An=!1;break e;case 3:Nt=I.stateNode.containerInfo,An=!0;break e;case 4:Nt=I.stateNode.containerInfo,An=!0;break e}I=I.return}if(Nt===null)throw Error(n(160));cg(x,b,g),Nt=null,An=!1;var L=g.alternate;L!==null&&(L.return=null),g.return=null}catch(X){dt(g,o,X)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)dg(o,r),o=o.sibling}function dg(r,o){var u=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Nn(o,r),Un(r),d&4){try{Wo(3,r,r.return),Ra(3,r)}catch(Ce){dt(r,r.return,Ce)}try{Wo(5,r,r.return)}catch(Ce){dt(r,r.return,Ce)}}break;case 1:Nn(o,r),Un(r),d&512&&u!==null&&Li(u,u.return);break;case 5:if(Nn(o,r),Un(r),d&512&&u!==null&&Li(u,u.return),r.flags&32){var g=r.stateNode;try{ze(g,"")}catch(Ce){dt(r,r.return,Ce)}}if(d&4&&(g=r.stateNode,g!=null)){var x=r.memoizedProps,b=u!==null?u.memoizedProps:x,I=r.type,L=r.updateQueue;if(r.updateQueue=null,L!==null)try{I==="input"&&x.type==="radio"&&x.name!=null&&ot(g,x),ue(I,b);var X=ue(I,x);for(b=0;b<L.length;b+=2){var re=L[b],oe=L[b+1];re==="style"?q(g,oe):re==="dangerouslySetInnerHTML"?De(g,oe):re==="children"?ze(g,oe):j(g,re,oe,X)}switch(I){case"input":Ke(g,x);break;case"textarea":yt(g,x);break;case"select":var ne=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!x.multiple;var ve=x.value;ve!=null?Gt(g,!!x.multiple,ve,!1):ne!==!!x.multiple&&(x.defaultValue!=null?Gt(g,!!x.multiple,x.defaultValue,!0):Gt(g,!!x.multiple,x.multiple?[]:"",!1))}g[Io]=x}catch(Ce){dt(r,r.return,Ce)}}break;case 6:if(Nn(o,r),Un(r),d&4){if(r.stateNode===null)throw Error(n(162));g=r.stateNode,x=r.memoizedProps;try{g.nodeValue=x}catch(Ce){dt(r,r.return,Ce)}}break;case 3:if(Nn(o,r),Un(r),d&4&&u!==null&&u.memoizedState.isDehydrated)try{So(o.containerInfo)}catch(Ce){dt(r,r.return,Ce)}break;case 4:Nn(o,r),Un(r);break;case 13:Nn(o,r),Un(r),g=r.child,g.flags&8192&&(x=g.memoizedState!==null,g.stateNode.isHidden=x,!x||g.alternate!==null&&g.alternate.memoizedState!==null||(kc=pt())),d&4&&fg(r);break;case 22:if(re=u!==null&&u.memoizedState!==null,r.mode&1?(zt=(X=zt)||re,Nn(o,r),zt=X):Nn(o,r),Un(r),d&8192){if(X=r.memoizedState!==null,(r.stateNode.isHidden=X)&&!re&&(r.mode&1)!==0)for(we=r,re=r.child;re!==null;){for(oe=we=re;we!==null;){switch(ne=we,ve=ne.child,ne.tag){case 0:case 11:case 14:case 15:Wo(4,ne,ne.return);break;case 1:Li(ne,ne.return);var Se=ne.stateNode;if(typeof Se.componentWillUnmount=="function"){d=ne,u=ne.return;try{o=d,Se.props=o.memoizedProps,Se.state=o.memoizedState,Se.componentWillUnmount()}catch(Ce){dt(d,u,Ce)}}break;case 5:Li(ne,ne.return);break;case 22:if(ne.memoizedState!==null){mg(oe);continue}}ve!==null?(ve.return=ne,we=ve):mg(oe)}re=re.sibling}e:for(re=null,oe=r;;){if(oe.tag===5){if(re===null){re=oe;try{g=oe.stateNode,X?(x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(I=oe.stateNode,L=oe.memoizedProps.style,b=L!=null&&L.hasOwnProperty("display")?L.display:null,I.style.display=B("display",b))}catch(Ce){dt(r,r.return,Ce)}}}else if(oe.tag===6){if(re===null)try{oe.stateNode.nodeValue=X?"":oe.memoizedProps}catch(Ce){dt(r,r.return,Ce)}}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:Nn(o,r),Un(r),d&4&&fg(r);break;case 21:break;default:Nn(o,r),Un(r)}}function Un(r){var o=r.flags;if(o&2){try{e:{for(var u=r.return;u!==null;){if(lg(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=ug(r);vc(r,x,g);break;case 3:case 4:var b=d.stateNode.containerInfo,I=ug(r);yc(r,I,b);break;default:throw Error(n(161))}}catch(L){dt(r,r.return,L)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function zb(r,o,u){we=r,hg(r)}function hg(r,o,u){for(var d=(r.mode&1)!==0;we!==null;){var g=we,x=g.child;if(g.tag===22&&d){var b=g.memoizedState!==null||Pa;if(!b){var I=g.alternate,L=I!==null&&I.memoizedState!==null||zt;I=Pa;var X=zt;if(Pa=b,(zt=L)&&!X)for(we=g;we!==null;)b=we,L=b.child,b.tag===22&&b.memoizedState!==null?gg(g):L!==null?(L.return=b,we=L):gg(g);for(;x!==null;)we=x,hg(x),x=x.sibling;we=g,Pa=I,zt=X}pg(r)}else(g.subtreeFlags&8772)!==0&&x!==null?(x.return=g,we=x):pg(r)}}function pg(r){for(;we!==null;){var o=we;if((o.flags&8772)!==0){var u=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:zt||Ra(5,o);break;case 1:var d=o.stateNode;if(o.flags&4&&!zt)if(u===null)d.componentDidMount();else{var g=o.elementType===o.type?u.memoizedProps:jn(o.type,u.memoizedProps);d.componentDidUpdate(g,u.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var x=o.updateQueue;x!==null&&mm(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}mm(o,b,u)}break;case 5:var I=o.stateNode;if(u===null&&o.flags&4){u=I;var L=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&u.focus();break;case"img":L.src&&(u.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var X=o.alternate;if(X!==null){var re=X.memoizedState;if(re!==null){var oe=re.dehydrated;oe!==null&&So(oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}zt||o.flags&512&&gc(o)}catch(ne){dt(o,o.return,ne)}}if(o===r){we=null;break}if(u=o.sibling,u!==null){u.return=o.return,we=u;break}we=o.return}}function mg(r){for(;we!==null;){var o=we;if(o===r){we=null;break}var u=o.sibling;if(u!==null){u.return=o.return,we=u;break}we=o.return}}function gg(r){for(;we!==null;){var o=we;try{switch(o.tag){case 0:case 11:case 15:var u=o.return;try{Ra(4,o)}catch(L){dt(o,u,L)}break;case 1:var d=o.stateNode;if(typeof d.componentDidMount=="function"){var g=o.return;try{d.componentDidMount()}catch(L){dt(o,g,L)}}var x=o.return;try{gc(o)}catch(L){dt(o,x,L)}break;case 5:var b=o.return;try{gc(o)}catch(L){dt(o,b,L)}}}catch(L){dt(o,o.return,L)}if(o===r){we=null;break}var I=o.sibling;if(I!==null){I.return=o.return,we=I;break}we=o.return}}var Vb=Math.ceil,ja=R.ReactCurrentDispatcher,xc=R.ReactCurrentOwner,vn=R.ReactCurrentBatchConfig,We=0,Tt=null,vt=null,Mt=0,un=0,Oi=xr(0),bt=0,Ho=null,Jr=0,Aa=0,wc=0,Ko=null,en=null,kc=0,Fi=1/0,or=null,Na=!1,Sc=null,Er=null,Ma=!1,Tr=null,Ia=0,qo=0,bc=null,Da=-1,_a=0;function Wt(){return(We&6)!==0?pt():Da!==-1?Da:Da=pt()}function Pr(r){return(r.mode&1)===0?1:(We&2)!==0&&Mt!==0?Mt&-Mt:bb.transition!==null?(_a===0&&(_a=up()),_a):(r=Ge,r!==0||(r=window.event,r=r===void 0?16:vp(r.type)),r)}function Mn(r,o,u,d){if(50<qo)throw qo=0,bc=null,Error(n(185));yo(r,u,d),((We&2)===0||r!==Tt)&&(r===Tt&&((We&2)===0&&(Aa|=u),bt===4&&Rr(r,Mt)),tn(r,d),u===1&&We===0&&(o.mode&1)===0&&(Fi=pt()+500,ua&&kr()))}function tn(r,o){var u=r.callbackNode;bS(r,o);var d=Ws(r,r===Tt?Mt:0);if(d===0)u!==null&&sp(u),r.callbackNode=null,r.callbackPriority=0;else if(o=d&-d,r.callbackPriority!==o){if(u!=null&&sp(u),o===1)r.tag===0?Sb(vg.bind(null,r)):rm(vg.bind(null,r)),vb(function(){(We&6)===0&&kr()}),u=null;else{switch(cp(d)){case 1:u=nu;break;case 4:u=ap;break;case 16:u=Vs;break;case 536870912:u=lp;break;default:u=Vs}u=Tg(u,yg.bind(null,r))}r.callbackPriority=o,r.callbackNode=u}}function yg(r,o){if(Da=-1,_a=0,(We&6)!==0)throw Error(n(327));var u=r.callbackNode;if(zi()&&r.callbackNode!==u)return null;var d=Ws(r,r===Tt?Mt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||o)o=La(r,d);else{o=d;var g=We;We|=2;var x=wg();(Tt!==r||Mt!==o)&&(or=null,Fi=pt()+500,ei(r,o));do try{Ub();break}catch(I){xg(r,I)}while(!0);Bu(),ja.current=x,We=g,vt!==null?o=0:(Tt=null,Mt=0,o=bt)}if(o!==0){if(o===2&&(g=ru(r),g!==0&&(d=g,o=Cc(r,g))),o===1)throw u=Ho,ei(r,0),Rr(r,d),tn(r,pt()),u;if(o===6)Rr(r,d);else{if(g=r.current.alternate,(d&30)===0&&!Bb(g)&&(o=La(r,d),o===2&&(x=ru(r),x!==0&&(d=x,o=Cc(r,x))),o===1))throw u=Ho,ei(r,0),Rr(r,d),tn(r,pt()),u;switch(r.finishedWork=g,r.finishedLanes=d,o){case 0:case 1:throw Error(n(345));case 2:ti(r,en,or);break;case 3:if(Rr(r,d),(d&130023424)===d&&(o=kc+500-pt(),10<o)){if(Ws(r,0)!==0)break;if(g=r.suspendedLanes,(g&d)!==d){Wt(),r.pingedLanes|=r.suspendedLanes&g;break}r.timeoutHandle=Au(ti.bind(null,r,en,or),o);break}ti(r,en,or);break;case 4:if(Rr(r,d),(d&4194240)===d)break;for(o=r.eventTimes,g=-1;0<d;){var b=31-Tn(d);x=1<<b,b=o[b],b>g&&(g=b),d&=~x}if(d=g,d=pt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Vb(d/1960))-d,10<d){r.timeoutHandle=Au(ti.bind(null,r,en,or),d);break}ti(r,en,or);break;case 5:ti(r,en,or);break;default:throw Error(n(329))}}}return tn(r,pt()),r.callbackNode===u?yg.bind(null,r):null}function Cc(r,o){var u=Ko;return r.current.memoizedState.isDehydrated&&(ei(r,o).flags|=256),r=La(r,o),r!==2&&(o=en,en=u,o!==null&&Ec(o)),r}function Ec(r){en===null?en=r:en.push.apply(en,r)}function Bb(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(!Pn(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 Rr(r,o){for(o&=~wc,o&=~Aa,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var u=31-Tn(o),d=1<<u;r[u]=-1,o&=~d}}function vg(r){if((We&6)!==0)throw Error(n(327));zi();var o=Ws(r,0);if((o&1)===0)return tn(r,pt()),null;var u=La(r,o);if(r.tag!==0&&u===2){var d=ru(r);d!==0&&(o=d,u=Cc(r,d))}if(u===1)throw u=Ho,ei(r,0),Rr(r,o),tn(r,pt()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,ti(r,en,or),tn(r,pt()),null}function Tc(r,o){var u=We;We|=1;try{return r(o)}finally{We=u,We===0&&(Fi=pt()+500,ua&&kr())}}function Zr(r){Tr!==null&&Tr.tag===0&&(We&6)===0&&zi();var o=We;We|=1;var u=vn.transition,d=Ge;try{if(vn.transition=null,Ge=1,r)return r()}finally{Ge=d,vn.transition=u,We=o,(We&6)===0&&kr()}}function Pc(){un=Oi.current,it(Oi)}function ei(r,o){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,yb(u)),vt!==null)for(u=vt.return;u!==null;){var d=u;switch(Lu(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&aa();break;case 3:Di(),it(Qt),it(Lt),Yu();break;case 5:qu(d);break;case 4:Di();break;case 13:it(ct);break;case 19:it(ct);break;case 10:$u(d.type._context);break;case 22:case 23:Pc()}u=u.return}if(Tt=r,vt=r=jr(r.current,null),Mt=un=o,bt=0,Ho=null,wc=Aa=Jr=0,en=Ko=null,Yr!==null){for(o=0;o<Yr.length;o++)if(u=Yr[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}Yr=null}return r}function xg(r,o){do{var u=vt;try{if(Bu(),xa.current=ba,wa){for(var d=ft.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}wa=!1}if(Qr=0,Et=St=ft=null,zo=!1,Vo=0,xc.current=null,u===null||u.return===null){bt=1,Ho=o,vt=null;break}e:{var x=r,b=u.return,I=u,L=o;if(o=Mt,I.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var X=L,re=I,oe=re.tag;if((re.mode&1)===0&&(oe===0||oe===11||oe===15)){var ne=re.alternate;ne?(re.updateQueue=ne.updateQueue,re.memoizedState=ne.memoizedState,re.lanes=ne.lanes):(re.updateQueue=null,re.memoizedState=null)}var ve=Wm(b);if(ve!==null){ve.flags&=-257,Hm(ve,b,I,x,o),ve.mode&1&&Um(x,X,o),o=ve,L=X;var Se=o.updateQueue;if(Se===null){var Ce=new Set;Ce.add(L),o.updateQueue=Ce}else Se.add(L);break e}else{if((o&1)===0){Um(x,X,o),Rc();break e}L=Error(n(426))}}else if(st&&I.mode&1){var mt=Wm(b);if(mt!==null){(mt.flags&65536)===0&&(mt.flags|=256),Hm(mt,b,I,x,o),zu(_i(L,I));break e}}x=L=_i(L,I),bt!==4&&(bt=2),Ko===null?Ko=[x]:Ko.push(x),x=b;do{switch(x.tag){case 3:x.flags|=65536,o&=-o,x.lanes|=o;var U=Bm(x,L,o);pm(x,U);break e;case 1:I=L;var z=x.type,H=x.stateNode;if((x.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(Er===null||!Er.has(H)))){x.flags|=65536,o&=-o,x.lanes|=o;var ce=$m(x,I,o);pm(x,ce);break e}}x=x.return}while(x!==null)}Sg(u)}catch(Ee){o=Ee,vt===u&&u!==null&&(vt=u=u.return);continue}break}while(!0)}function wg(){var r=ja.current;return ja.current=ba,r===null?ba:r}function Rc(){(bt===0||bt===3||bt===2)&&(bt=4),Tt===null||(Jr&268435455)===0&&(Aa&268435455)===0||Rr(Tt,Mt)}function La(r,o){var u=We;We|=2;var d=wg();(Tt!==r||Mt!==o)&&(or=null,ei(r,o));do try{$b();break}catch(g){xg(r,g)}while(!0);if(Bu(),We=u,ja.current=d,vt!==null)throw Error(n(261));return Tt=null,Mt=0,bt}function $b(){for(;vt!==null;)kg(vt)}function Ub(){for(;vt!==null&&!pS();)kg(vt)}function kg(r){var o=Eg(r.alternate,r,un);r.memoizedProps=r.pendingProps,o===null?Sg(r):vt=o,xc.current=null}function Sg(r){var o=r;do{var u=o.alternate;if(r=o.return,(o.flags&32768)===0){if(u=_b(u,o,un),u!==null){vt=u;return}}else{if(u=Lb(u,o),u!==null){u.flags&=32767,vt=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{bt=6,vt=null;return}}if(o=o.sibling,o!==null){vt=o;return}vt=o=r}while(o!==null);bt===0&&(bt=5)}function ti(r,o,u){var d=Ge,g=vn.transition;try{vn.transition=null,Ge=1,Wb(r,o,u,d)}finally{vn.transition=g,Ge=d}return null}function Wb(r,o,u,d){do zi();while(Tr!==null);if((We&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(CS(r,x),r===Tt&&(vt=Tt=null,Mt=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Ma||(Ma=!0,Tg(Vs,function(){return zi(),null})),x=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||x){x=vn.transition,vn.transition=null;var b=Ge;Ge=1;var I=We;We|=4,xc.current=null,Fb(r,u),dg(u,r),cb(Ru),qs=!!Pu,Ru=Pu=null,r.current=u,zb(u),mS(),We=I,Ge=b,vn.transition=x}else r.current=u;if(Ma&&(Ma=!1,Tr=r,Ia=g),x=r.pendingLanes,x===0&&(Er=null),vS(u.stateNode),tn(r,pt()),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(Na)throw Na=!1,r=Sc,Sc=null,r;return(Ia&1)!==0&&r.tag!==0&&zi(),x=r.pendingLanes,(x&1)!==0?r===bc?qo++:(qo=0,bc=r):qo=0,kr(),null}function zi(){if(Tr!==null){var r=cp(Ia),o=vn.transition,u=Ge;try{if(vn.transition=null,Ge=16>r?16:r,Tr===null)var d=!1;else{if(r=Tr,Tr=null,Ia=0,(We&6)!==0)throw Error(n(331));var g=We;for(We|=4,we=r.current;we!==null;){var x=we,b=x.child;if((we.flags&16)!==0){var I=x.deletions;if(I!==null){for(var L=0;L<I.length;L++){var X=I[L];for(we=X;we!==null;){var re=we;switch(re.tag){case 0:case 11:case 15:Wo(8,re,x)}var oe=re.child;if(oe!==null)oe.return=re,we=oe;else for(;we!==null;){re=we;var ne=re.sibling,ve=re.return;if(ag(re),re===X){we=null;break}if(ne!==null){ne.return=ve,we=ne;break}we=ve}}}var Se=x.alternate;if(Se!==null){var Ce=Se.child;if(Ce!==null){Se.child=null;do{var mt=Ce.sibling;Ce.sibling=null,Ce=mt}while(Ce!==null)}}we=x}}if((x.subtreeFlags&2064)!==0&&b!==null)b.return=x,we=b;else e:for(;we!==null;){if(x=we,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:Wo(9,x,x.return)}var U=x.sibling;if(U!==null){U.return=x.return,we=U;break e}we=x.return}}var z=r.current;for(we=z;we!==null;){b=we;var H=b.child;if((b.subtreeFlags&2064)!==0&&H!==null)H.return=b,we=H;else e:for(b=z;we!==null;){if(I=we,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:Ra(9,I)}}catch(Ee){dt(I,I.return,Ee)}if(I===b){we=null;break e}var ce=I.sibling;if(ce!==null){ce.return=I.return,we=ce;break e}we=I.return}}if(We=g,kr(),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(Bs,r)}catch{}d=!0}return d}finally{Ge=u,vn.transition=o}}return!1}function bg(r,o,u){o=_i(u,o),o=Bm(r,o,1),r=br(r,o,1),o=Wt(),r!==null&&(yo(r,1,o),tn(r,o))}function dt(r,o,u){if(r.tag===3)bg(r,r,u);else for(;o!==null;){if(o.tag===3){bg(o,r,u);break}else if(o.tag===1){var d=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Er===null||!Er.has(d))){r=_i(u,r),r=$m(o,r,1),o=br(o,r,1),r=Wt(),o!==null&&(yo(o,1,r),tn(o,r));break}}o=o.return}}function Hb(r,o,u){var d=r.pingCache;d!==null&&d.delete(o),o=Wt(),r.pingedLanes|=r.suspendedLanes&u,Tt===r&&(Mt&u)===u&&(bt===4||bt===3&&(Mt&130023424)===Mt&&500>pt()-kc?ei(r,0):wc|=u),tn(r,o)}function Cg(r,o){o===0&&((r.mode&1)===0?o=1:(o=Us,Us<<=1,(Us&130023424)===0&&(Us=4194304)));var u=Wt();r=nr(r,o),r!==null&&(yo(r,o,u),tn(r,u))}function Kb(r){var o=r.memoizedState,u=0;o!==null&&(u=o.retryLane),Cg(r,u)}function qb(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),Cg(r,u)}var Eg;Eg=function(r,o,u){if(r!==null)if(r.memoizedProps!==o.pendingProps||Qt.current)Zt=!0;else{if((r.lanes&u)===0&&(o.flags&128)===0)return Zt=!1,Db(r,o,u);Zt=(r.flags&131072)!==0}else Zt=!1,st&&(o.flags&1048576)!==0&&im(o,fa,o.index);switch(o.lanes=0,o.tag){case 2:var d=o.type;Ta(r,o),r=o.pendingProps;var g=Pi(o,Lt.current);Ii(o,u),g=Ju(null,o,d,r,g,u);var x=Zu();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,Jt(d)?(x=!0,la(o)):x=!1,o.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Hu(o),g.updater=Ca,o.stateNode=g,g._reactInternals=o,oc(o,d,r,u),o=uc(null,o,d,!0,x,u)):(o.tag=0,st&&x&&_u(o),Ut(null,o,g,u),o=o.child),o;case 16:d=o.elementType;e:{switch(Ta(r,o),r=o.pendingProps,g=d._init,d=g(d._payload),o.type=d,g=o.tag=Yb(d),r=jn(d,r),g){case 0:o=lc(null,o,d,r,u);break e;case 1:o=Qm(null,o,d,r,u);break e;case 11:o=Km(null,o,d,r,u);break e;case 14:o=qm(null,o,d,jn(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:jn(d,g),lc(r,o,d,g,u);case 1:return d=o.type,g=o.pendingProps,g=o.elementType===d?g:jn(d,g),Qm(r,o,d,g,u);case 3:e:{if(Jm(o),r===null)throw Error(n(387));d=o.pendingProps,x=o.memoizedState,g=x.element,hm(r,o),ya(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=_i(Error(n(423)),o),o=Zm(r,o,d,u,g);break e}else if(d!==g){g=_i(Error(n(424)),o),o=Zm(r,o,d,u,g);break e}else for(ln=vr(o.stateNode.containerInfo.firstChild),an=o,st=!0,Rn=null,u=fm(o,null,d,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ai(),d===g){o=ir(r,o,u);break e}Ut(r,o,d,u)}o=o.child}return o;case 5:return gm(o),r===null&&Fu(o),d=o.type,g=o.pendingProps,x=r!==null?r.memoizedProps:null,b=g.children,ju(d,g)?b=null:x!==null&&ju(d,x)&&(o.flags|=32),Gm(r,o),Ut(r,o,b,u),o.child;case 6:return r===null&&Fu(o),null;case 13:return eg(r,o,u);case 4:return Ku(o,o.stateNode.containerInfo),d=o.pendingProps,r===null?o.child=Ni(o,null,d,u):Ut(r,o,d,u),o.child;case 11:return d=o.type,g=o.pendingProps,g=o.elementType===d?g:jn(d,g),Km(r,o,d,g,u);case 7:return Ut(r,o,o.pendingProps,u),o.child;case 8:return Ut(r,o,o.pendingProps.children,u),o.child;case 12:return Ut(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,nt(pa,d._currentValue),d._currentValue=b,x!==null)if(Pn(x.value,b)){if(x.children===g.children&&!Qt.current){o=ir(r,o,u);break e}}else for(x=o.child,x!==null&&(x.return=o);x!==null;){var I=x.dependencies;if(I!==null){b=x.child;for(var L=I.firstContext;L!==null;){if(L.context===d){if(x.tag===1){L=rr(-1,u&-u),L.tag=2;var X=x.updateQueue;if(X!==null){X=X.shared;var re=X.pending;re===null?L.next=L:(L.next=re.next,re.next=L),X.pending=L}}x.lanes|=u,L=x.alternate,L!==null&&(L.lanes|=u),Uu(x.return,u,o),I.lanes|=u;break}L=L.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,I=b.alternate,I!==null&&(I.lanes|=u),Uu(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}Ut(r,o,g.children,u),o=o.child}return o;case 9:return g=o.type,d=o.pendingProps.children,Ii(o,u),g=gn(g),d=d(g),o.flags|=1,Ut(r,o,d,u),o.child;case 14:return d=o.type,g=jn(d,o.pendingProps),g=jn(d.type,g),qm(r,o,d,g,u);case 15:return Xm(r,o,o.type,o.pendingProps,u);case 17:return d=o.type,g=o.pendingProps,g=o.elementType===d?g:jn(d,g),Ta(r,o),o.tag=1,Jt(d)?(r=!0,la(o)):r=!1,Ii(o,u),zm(o,d,g),oc(o,d,g,u),uc(null,o,d,!0,r,u);case 19:return ng(r,o,u);case 22:return Ym(r,o,u)}throw Error(n(156,o.tag))};function Tg(r,o){return op(r,o)}function Xb(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 xn(r,o,u,d){return new Xb(r,o,u,d)}function jc(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Yb(r){if(typeof r=="function")return jc(r)?1:0;if(r!=null){if(r=r.$$typeof,r===F)return 11;if(r===ee)return 14}return 2}function jr(r,o){var u=r.alternate;return u===null?(u=xn(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 Oa(r,o,u,d,g,x){var b=2;if(d=r,typeof r=="function")jc(r)&&(b=1);else if(typeof r=="string")b=5;else e:switch(r){case G:return ni(u.children,g,x,o);case $:b=8,g|=8;break;case _:return r=xn(12,u,o,g|2),r.elementType=_,r.lanes=x,r;case ie:return r=xn(13,u,o,g),r.elementType=ie,r.lanes=x,r;case Z:return r=xn(19,u,o,g),r.elementType=Z,r.lanes=x,r;case xe:return Fa(u,g,x,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case P:b=10;break e;case K:b=9;break e;case F:b=11;break e;case ee:b=14;break e;case pe:b=16,d=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return o=xn(b,u,o,g),o.elementType=r,o.type=d,o.lanes=x,o}function ni(r,o,u,d){return r=xn(7,r,d,o),r.lanes=u,r}function Fa(r,o,u,d){return r=xn(22,r,d,o),r.elementType=xe,r.lanes=u,r.stateNode={isHidden:!1},r}function Ac(r,o,u){return r=xn(6,r,null,o),r.lanes=u,r}function Nc(r,o,u){return o=xn(4,r.children!==null?r.children:[],r.key,o),o.lanes=u,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function Gb(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=iu(0),this.expirationTimes=iu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=iu(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Mc(r,o,u,d,g,x,b,I,L){return r=new Gb(r,o,u,I,L),o===1?(o=1,x===!0&&(o|=8)):o=0,x=xn(3,null,null,o),r.current=x,x.stateNode=r,x.memoizedState={element:d,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hu(x),r}function Qb(r,o,u){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:d==null?null:""+d,children:r,containerInfo:o,implementation:u}}function Pg(r){if(!r)return wr;r=r._reactInternals;e:{if(Wr(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(Jt(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(Jt(u))return tm(r,u,o)}return o}function Rg(r,o,u,d,g,x,b,I,L){return r=Mc(u,d,!0,r,g,x,b,I,L),r.context=Pg(null),u=r.current,d=Wt(),g=Pr(u),x=rr(d,g),x.callback=o??null,br(u,x,g),r.current.lanes=g,yo(r,g,d),tn(r,d),r}function za(r,o,u,d){var g=o.current,x=Wt(),b=Pr(g);return u=Pg(u),o.context===null?o.context=u:o.pendingContext=u,o=rr(x,b),o.payload={element:r},d=d===void 0?null:d,d!==null&&(o.callback=d),r=br(g,o,b),r!==null&&(Mn(r,g,b,x),ga(r,g,b)),b}function Va(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 jg(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<o?u:o}}function Ic(r,o){jg(r,o),(r=r.alternate)&&jg(r,o)}function Jb(){return null}var Ag=typeof reportError=="function"?reportError:function(r){console.error(r)};function Dc(r){this._internalRoot=r}Ba.prototype.render=Dc.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));za(r,o,null,null)},Ba.prototype.unmount=Dc.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Zr(function(){za(null,r,null,null)}),o[Jn]=null}};function Ba(r){this._internalRoot=r}Ba.prototype.unstable_scheduleHydration=function(r){if(r){var o=hp();r={blockedOn:null,target:r,priority:o};for(var u=0;u<mr.length&&o!==0&&o<mr[u].priority;u++);mr.splice(u,0,r),u===0&&gp(r)}};function _c(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function $a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Ng(){}function Zb(r,o,u,d,g){if(g){if(typeof d=="function"){var x=d;d=function(){var X=Va(b);x.call(X)}}var b=Rg(o,d,r,0,null,!1,!1,"",Ng);return r._reactRootContainer=b,r[Jn]=b.current,No(r.nodeType===8?r.parentNode:r),Zr(),b}for(;g=r.lastChild;)r.removeChild(g);if(typeof d=="function"){var I=d;d=function(){var X=Va(L);I.call(X)}}var L=Mc(r,0,!1,null,null,!1,!1,"",Ng);return r._reactRootContainer=L,r[Jn]=L.current,No(r.nodeType===8?r.parentNode:r),Zr(function(){za(o,L,u,d)}),L}function Ua(r,o,u,d,g){var x=u._reactRootContainer;if(x){var b=x;if(typeof g=="function"){var I=g;g=function(){var L=Va(b);I.call(L)}}za(o,b,r,g)}else b=Zb(u,o,r,g,d);return Va(b)}fp=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var u=go(o.pendingLanes);u!==0&&(ou(o,u|1),tn(o,pt()),(We&6)===0&&(Fi=pt()+500,kr()))}break;case 13:Zr(function(){var d=nr(r,1);if(d!==null){var g=Wt();Mn(d,r,1,g)}}),Ic(r,1)}},su=function(r){if(r.tag===13){var o=nr(r,134217728);if(o!==null){var u=Wt();Mn(o,r,134217728,u)}Ic(r,134217728)}},dp=function(r){if(r.tag===13){var o=Pr(r),u=nr(r,o);if(u!==null){var d=Wt();Mn(u,r,o,d)}Ic(r,o)}},hp=function(){return Ge},pp=function(r,o){var u=Ge;try{return Ge=r,o()}finally{Ge=u}},kt=function(r,o,u){switch(o){case"input":if(Ke(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=sa(d);if(!g)throw Error(n(90));tt(d),Ke(d,g)}}}break;case"textarea":yt(r,u);break;case"select":o=u.value,o!=null&&Gt(r,!!u.multiple,o,!1)}},Jh=Tc,Zh=Zr;var eC={usingClientEntryPoint:!1,Events:[Do,Ei,sa,$t,fr,Tc]},Xo={findFiberByHostInstance:Hr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tC={bundleType:Xo.bundleType,version:Xo.version,rendererPackageName:Xo.rendererPackageName,rendererConfig:Xo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=rp(r),r===null?null:r.stateNode},findFiberByHostInstance:Xo.findFiberByHostInstance||Jb,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 Wa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wa.isDisabled&&Wa.supportsFiber)try{Bs=Wa.inject(tC),zn=Wa}catch{}}return nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eC,nn.createPortal=function(r,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_c(o))throw Error(n(200));return Qb(r,o,null,u)},nn.createRoot=function(r,o){if(!_c(r))throw Error(n(299));var u=!1,d="",g=Ag;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onRecoverableError!==void 0&&(g=o.onRecoverableError)),o=Mc(r,1,!1,null,null,u,!1,d,g),r[Jn]=o.current,No(r.nodeType===8?r.parentNode:r),new Dc(o)},nn.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=rp(o),r=r===null?null:r.stateNode,r},nn.flushSync=function(r){return Zr(r)},nn.hydrate=function(r,o,u){if(!$a(o))throw Error(n(200));return Ua(null,r,o,!0,u)},nn.hydrateRoot=function(r,o,u){if(!_c(r))throw Error(n(405));var d=u!=null&&u.hydratedSources||null,g=!1,x="",b=Ag;if(u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onRecoverableError!==void 0&&(b=u.onRecoverableError)),o=Rg(o,null,r,1,u??null,g,!1,x,b),r[Jn]=o.current,No(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 Ba(o)},nn.render=function(r,o,u){if(!$a(o))throw Error(n(200));return Ua(null,r,o,!1,u)},nn.unmountComponentAtNode=function(r){if(!$a(r))throw Error(n(40));return r._reactRootContainer?(Zr(function(){Ua(null,null,r,!1,function(){r._reactRootContainer=null,r[Jn]=null})}),!0):!1},nn.unstable_batchedUpdates=Tc,nn.unstable_renderSubtreeIntoContainer=function(r,o,u,d){if(!$a(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Ua(r,o,u,!1,d)},nn.version="18.3.1-next-f1338f8080-20240426",nn}var zg;function Ox(){if(zg)return Fc.exports;zg=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(),Fc.exports=uC(),Fc.exports}var Vg;function cC(){if(Vg)return Ha;Vg=1;var e=Ox();return Ha.createRoot=e.createRoot,Ha.hydrateRoot=e.hydrateRoot,Ha}var fC=cC(),k=Vd();const dC=zd(k),Ts=rC({__proto__:null,default:dC},[k]),Bd=k.createContext({});function zl(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const hC=typeof window<"u",$d=hC?k.useLayoutEffect:k.useEffect,Vl=k.createContext(null);function Ud(e,t){e.indexOf(t)===-1&&e.push(t)}function wl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Yn=(e,t,n)=>n>t?t:n<e?e:n;let Bl=()=>{};const Fr={},Fx=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zx=e=>typeof e=="object"&&e!==null,Vx=e=>/^0[^.\s]+$/u.test(e);function Bx(e){let t;return()=>(t===void 0&&(t=e()),t)}const bn=e=>e,Ps=(...e)=>e.reduce((t,n)=>i=>n(t(i))),hs=(e,t,n)=>{const i=t-e;return i?(n-e)/i:1};class Wd{constructor(){this.subscriptions=[]}add(t){return Ud(this.subscriptions,t),()=>wl(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let l=0;l<s;l++){const a=this.subscriptions[l];a&&a(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const fn=e=>e*1e3,Sn=e=>e/1e3,$x=(e,t)=>t?e*(1e3/t):0,Ux=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,pC=1e-7,mC=12;function gC(e,t,n,i,s){let l,a,c=0;do a=t+(n-t)/2,l=Ux(a,i,s)-e,l>0?n=a:t=a;while(Math.abs(l)>pC&&++c<mC);return a}function Rs(e,t,n,i){if(e===t&&n===i)return bn;const s=l=>gC(l,0,1,e,n);return l=>l===0||l===1?l:Ux(s(l),t,i)}const Wx=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hx=e=>t=>1-e(1-t),Kx=Rs(.33,1.53,.69,.99),Hd=Hx(Kx),qx=Wx(Hd),Xx=e=>e>=1?1:(e*=2)<1?.5*Hd(e):.5*(2-Math.pow(2,-10*(e-1))),Kd=e=>1-Math.sin(Math.acos(e)),Yx=Hx(Kd),Gx=Wx(Kd),yC=Rs(.42,0,1,1),vC=Rs(0,0,.58,1),Qx=Rs(.42,0,.58,1),xC=e=>Array.isArray(e)&&typeof e[0]!="number",Jx=e=>Array.isArray(e)&&typeof e[0]=="number",wC={linear:bn,easeIn:yC,easeInOut:Qx,easeOut:vC,circIn:Kd,circInOut:Gx,circOut:Yx,backIn:Hd,backInOut:qx,backOut:Kx,anticipate:Xx},kC=e=>typeof e=="string",Bg=e=>{if(Jx(e)){Bl(e.length===4);const[t,n,i,s]=e;return Rs(t,n,i,s)}else if(kC(e))return wC[e];return e},Ka=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function SC(e){let t=new Set,n=new Set,i=!1,s=!1;const l=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(h){l.has(h)&&(f.schedule(h),e()),h(a)}const f={schedule:(h,m=!1,p=!1)=>{const w=p&&i?t:n;return m&&l.add(h),w.add(h),h},cancel:h=>{n.delete(h),l.delete(h)},process:h=>{if(a=h,i){s=!0;return}i=!0;const m=t;t=n,n=m,t.forEach(c),t.clear(),i=!1,s&&(s=!1,f.process(h))}};return f}const bC=40;function Zx(e,t){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},l=()=>n=!0,a=Ka.reduce((j,R)=>(j[R]=SC(l),j),{}),{setup:c,read:f,resolveKeyframes:h,preUpdate:m,update:p,preRender:v,render:w,postRender:S}=a,C=()=>{const j=Fr.useManualTiming,R=j?s.timestamp:performance.now();n=!1,j||(s.delta=i?1e3/60:Math.max(Math.min(R-s.timestamp,bC),1)),s.timestamp=R,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:Ka.reduce((j,R)=>{const V=a[R];return j[R]=(D,G=!1,$=!1)=>(n||E(),V.schedule(D,G,$)),j},{}),cancel:j=>{for(let R=0;R<Ka.length;R++)a[Ka[R]].cancel(j)},state:s,steps:a}}const{schedule:Ze,cancel:zr,state:It,steps:Bc}=Zx(typeof requestAnimationFrame<"u"?requestAnimationFrame:bn,!0);let al;function CC(){al=void 0}const qt={now:()=>(al===void 0&&qt.set(It.isProcessing||Fr.useManualTiming?It.timestamp:performance.now()),al),set:e=>{al=e,queueMicrotask(CC)}},ew=e=>t=>typeof t=="string"&&t.startsWith(e),tw=ew("--"),EC=ew("var(--"),qd=e=>EC(e)?TC.test(e.split("/*")[0].trim()):!1,TC=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $g(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const oo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ps={...oo,transform:e=>Yn(0,1,e)},qa={...oo,default:1},os=e=>Math.round(e*1e5)/1e5,Xd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function PC(e){return e==null}const RC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yd=(e,t)=>n=>!!(typeof n=="string"&&RC.test(n)&&n.startsWith(e)||t&&!PC(n)&&Object.prototype.hasOwnProperty.call(n,t)),nw=(e,t,n)=>i=>{if(typeof i!="string")return i;const[s,l,a,c]=i.match(Xd);return{[e]:parseFloat(s),[t]:parseFloat(l),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},jC=e=>Yn(0,255,e),$c={...oo,transform:e=>Math.round(jC(e))},li={test:Yd("rgb","red"),parse:nw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+$c.transform(e)+", "+$c.transform(t)+", "+$c.transform(n)+", "+os(ps.transform(i))+")"};function AC(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 Nf={test:Yd("#"),parse:AC,transform:li.transform},js=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),sr=js("deg"),Xn=js("%"),be=js("px"),NC=js("vh"),MC=js("vw"),Ug={...Xn,parse:e=>Xn.parse(e)/100,transform:e=>Xn.transform(e*100)},Yi={test:Yd("hsl","hue"),parse:nw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Xn.transform(os(t))+", "+Xn.transform(os(n))+", "+os(ps.transform(i))+")"},wt={test:e=>li.test(e)||Nf.test(e)||Yi.test(e),parse:e=>li.test(e)?li.parse(e):Yi.test(e)?Yi.parse(e):Nf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?li.transform(e):Yi.transform(e),getAnimatableNone:e=>{const t=wt.parse(e);return t.alpha=0,wt.transform(t)}},IC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DC(e){return isNaN(e)&&typeof e=="string"&&(e.match(Xd)?.length||0)+(e.match(IC)?.length||0)>0}const rw="number",iw="color",_C="var",LC="var(",Wg="${}",OC=/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 eo(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},s=[];let l=0;const c=t.replace(OC,f=>(wt.test(f)?(i.color.push(l),s.push(iw),n.push(wt.parse(f))):f.startsWith(LC)?(i.var.push(l),s.push(_C),n.push(f)):(i.number.push(l),s.push(rw),n.push(parseFloat(f))),++l,Wg)).split(Wg);return{values:n,split:c,indexes:i,types:s}}function FC(e){return eo(e).values}function ow({split:e,types:t}){const n=e.length;return i=>{let s="";for(let l=0;l<n;l++)if(s+=e[l],i[l]!==void 0){const a=t[l];a===rw?s+=os(i[l]):a===iw?s+=wt.transform(i[l]):s+=i[l]}return s}}function zC(e){return ow(eo(e))}const VC=e=>typeof e=="number"?0:wt.test(e)?wt.getAnimatableNone(e):e,BC=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:VC(e);function $C(e){const t=eo(e);return ow(t)(t.values.map((i,s)=>BC(i,t.split[s])))}const _n={test:DC,parse:FC,createTransformer:zC,getAnimatableNone:$C};function Uc(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 UC({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,l=0,a=0;if(!t)s=l=a=n;else{const c=n<.5?n*(1+t):n+t-n*t,f=2*n-c;s=Uc(f,c,e+1/3),l=Uc(f,c,e),a=Uc(f,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(l*255),blue:Math.round(a*255),alpha:i}}function kl(e,t){return n=>n>0?t:e}const Je=(e,t,n)=>e+(t-e)*n,Wc=(e,t,n)=>{const i=e*e,s=n*(t*t-i)+i;return s<0?0:Math.sqrt(s)},WC=[Nf,li,Yi],HC=e=>WC.find(t=>t.test(e));function Hg(e){const t=HC(e);if(!t)return!1;let n=t.parse(e);return t===Yi&&(n=UC(n)),n}const Kg=(e,t)=>{const n=Hg(e),i=Hg(t);if(!n||!i)return kl(e,t);const s={...n};return l=>(s.red=Wc(n.red,i.red,l),s.green=Wc(n.green,i.green,l),s.blue=Wc(n.blue,i.blue,l),s.alpha=Je(n.alpha,i.alpha,l),li.transform(s))},Mf=new Set(["none","hidden"]);function KC(e,t){return Mf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qC(e,t){return n=>Je(e,t,n)}function Gd(e){return typeof e=="number"?qC:typeof e=="string"?qd(e)?kl:wt.test(e)?Kg:GC:Array.isArray(e)?sw:typeof e=="object"?wt.test(e)?Kg:XC:kl}function sw(e,t){const n=[...e],i=n.length,s=e.map((l,a)=>Gd(l)(l,t[a]));return l=>{for(let a=0;a<i;a++)n[a]=s[a](l);return n}}function XC(e,t){const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=Gd(e[s])(e[s],t[s]));return s=>{for(const l in i)n[l]=i[l](s);return n}}function YC(e,t){const n=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const l=t.types[s],a=e.indexes[l][i[l]],c=e.values[a]??0;n[s]=c,i[l]++}return n}const GC=(e,t)=>{const n=_n.createTransformer(t),i=eo(e),s=eo(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?Mf.has(e)&&!s.values.length||Mf.has(t)&&!i.values.length?KC(e,t):Ps(sw(YC(i,s),s.values),n):kl(e,t)};function aw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Je(e,t,n):Gd(e)(e,t)}const QC=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ze.update(t,n),stop:()=>zr(t),now:()=>It.isProcessing?It.timestamp:qt.now()}},lw=(e,t,n=10)=>{let i="";const s=Math.max(Math.round(t/n),2);for(let l=0;l<s;l++)i+=Math.round(e(l/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Sl=2e4;function Qd(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<Sl;)t+=n,i=e.next(t);return t>=Sl?1/0:t}function JC(e,t=100,n){const i=n({...e,keyframes:[0,t]}),s=Math.min(Qd(i),Sl);return{type:"keyframes",ease:l=>i.next(s*l).value/t,duration:Sn(s)}}const ht={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 If(e,t){return e*Math.sqrt(1-t*t)}const ZC=12;function eE(e,t,n){let i=n;for(let s=1;s<ZC;s++)i=i-e(i)/t(i);return i}const Hc=.001;function tE({duration:e=ht.duration,bounce:t=ht.bounce,velocity:n=ht.velocity,mass:i=ht.mass}){let s,l,a=1-t;a=Yn(ht.minDamping,ht.maxDamping,a),e=Yn(ht.minDuration,ht.maxDuration,Sn(e)),a<1?(s=h=>{const m=h*a,p=m*e,v=m-n,w=If(h,a),S=Math.exp(-p);return Hc-v/w*S},l=h=>{const p=h*a*e,v=p*n+n,w=Math.pow(a,2)*Math.pow(h,2)*e,S=Math.exp(-p),C=If(Math.pow(h,2),a);return(-s(h)+Hc>0?-1:1)*((v-w)*S)/C}):(s=h=>{const m=Math.exp(-h*e),p=(h-n)*e+1;return-Hc+m*p},l=h=>{const m=Math.exp(-h*e),p=(n-h)*(e*e);return m*p});const c=5/e,f=eE(s,l,c);if(e=fn(e),isNaN(f))return{stiffness:ht.stiffness,damping:ht.damping,duration:e};{const h=Math.pow(f,2)*i;return{stiffness:h,damping:a*2*Math.sqrt(i*h),duration:e}}}const nE=["duration","bounce"],rE=["stiffness","damping","mass"];function qg(e,t){return t.some(n=>e[n]!==void 0)}function iE(e){let t={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...e};if(!qg(e,rE)&&qg(e,nE))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,l=2*Yn(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ht.mass,stiffness:s,damping:l}}else{const n=tE({...e,velocity:0});t={...t,...n,mass:ht.mass},t.isResolvedFromDuration=!0}return t}function bl(e=ht.visualDuration,t=ht.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:s}=n;const l=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:l},{stiffness:f,damping:h,mass:m,duration:p,velocity:v,isResolvedFromDuration:w}=iE({...n,velocity:-Sn(n.velocity||0)}),S=v||0,C=h/(2*Math.sqrt(f*m)),E=a-l,T=Sn(Math.sqrt(f/m)),A=Math.abs(E)<5;i||(i=A?ht.restSpeed.granular:ht.restSpeed.default),s||(s=A?ht.restDelta.granular:ht.restDelta.default);let j,R,V,D,G,$;if(C<1)V=If(T,C),D=(S+C*T*E)/V,j=P=>{const K=Math.exp(-C*T*P);return a-K*(D*Math.sin(V*P)+E*Math.cos(V*P))},G=C*T*D+E*V,$=C*T*E-D*V,R=P=>Math.exp(-C*T*P)*(G*Math.sin(V*P)+$*Math.cos(V*P));else if(C===1){j=K=>a-Math.exp(-T*K)*(E+(S+T*E)*K);const P=S+T*E;R=K=>Math.exp(-T*K)*(T*P*K-S)}else{const P=T*Math.sqrt(C*C-1);j=Z=>{const ee=Math.exp(-C*T*Z),pe=Math.min(P*Z,300);return a-ee*((S+C*T*E)*Math.sinh(pe)+P*E*Math.cosh(pe))/P};const K=(S+C*T*E)/P,F=C*T*K-E*P,ie=C*T*E-K*P;R=Z=>{const ee=Math.exp(-C*T*Z),pe=Math.min(P*Z,300);return ee*(F*Math.sinh(pe)+ie*Math.cosh(pe))}}const _={calculatedDuration:w&&p||null,velocity:P=>fn(R(P)),next:P=>{if(!w&&C<1){const F=Math.exp(-C*T*P),ie=Math.sin(V*P),Z=Math.cos(V*P),ee=a-F*(D*ie+E*Z),pe=fn(F*(G*ie+$*Z));return c.done=Math.abs(pe)<=i&&Math.abs(a-ee)<=s,c.value=c.done?a:ee,c}const K=j(P);if(w)c.done=P>=p;else{const F=fn(R(P));c.done=Math.abs(F)<=i&&Math.abs(a-K)<=s}return c.value=c.done?a:K,c},toString:()=>{const P=Math.min(Qd(_),Sl),K=lw(F=>_.next(P*F).value,P,30);return P+"ms "+K},toTransition:()=>{}};return _}bl.applyToOptions=e=>{const t=JC(e,100,bl);return e.ease=t.ease,e.duration=fn(t.duration),e.type="keyframes",e};const oE=5;function uw(e,t,n){const i=Math.max(t-oE,0);return $x(n-e(i),t-i)}function Df({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:l=500,modifyTarget:a,min:c,max:f,restDelta:h=.5,restSpeed:m}){const p=e[0],v={done:!1,value:p},w=$=>c!==void 0&&$<c||f!==void 0&&$>f,S=$=>c===void 0?f:f===void 0||Math.abs(c-$)<Math.abs(f-$)?c:f;let C=n*t;const E=p+C,T=a===void 0?E:a(E);T!==E&&(C=T-p);const A=$=>-C*Math.exp(-$/i),j=$=>T+A($),R=$=>{const _=A($),P=j($);v.done=Math.abs(_)<=h,v.value=v.done?T:P};let V,D;const G=$=>{w(v.value)&&(V=$,D=bl({keyframes:[v.value,S(v.value)],velocity:uw(j,$,v.value),damping:s,stiffness:l,restDelta:h,restSpeed:m}))};return G(0),{calculatedDuration:null,next:$=>{let _=!1;return!D&&V===void 0&&(_=!0,R($),G($)),V!==void 0&&$>=V?D.next($-V):(!_&&R($),v)}}}function sE(e,t,n){const i=[],s=n||Fr.mix||aw,l=e.length-1;for(let a=0;a<l;a++){let c=s(e[a],e[a+1]);if(t){const f=Array.isArray(t)?t[a]||bn:t;c=Ps(f,c)}i.push(c)}return i}function aE(e,t,{clamp:n=!0,ease:i,mixer:s}={}){const l=e.length;if(Bl(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=sE(t,i,s),f=c.length,h=m=>{if(a&&m<e[0])return t[0];let p=0;if(f>1)for(;p<e.length-2&&!(m<e[p+1]);p++);const v=hs(e[p],e[p+1],m);return c[p](v)};return n?m=>h(Yn(e[0],e[l-1],m)):h}function lE(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=hs(0,t,i);e.push(Je(n,1,s))}}function uE(e){const t=[0];return lE(t,e.length-1),t}function cE(e,t){return e.map(n=>n*t)}function fE(e,t){return e.map(()=>t||Qx).splice(0,e.length-1)}function ss({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=xC(i)?i.map(Bg):Bg(i),l={done:!1,value:t[0]},a=cE(n&&n.length===t.length?n:uE(t),e),c=aE(a,t,{ease:Array.isArray(s)?s:fE(t,s)});return{calculatedDuration:e,next:f=>(l.value=c(f),l.done=f>=e,l)}}const dE=e=>e!==null;function $l(e,{repeat:t,repeatType:n="loop"},i,s=1){const l=e.filter(dE),c=s<0||t&&n!=="loop"&&t%2===1?0:l.length-1;return!c||i===void 0?l[c]:i}const hE={decay:Df,inertia:Df,tween:ss,keyframes:ss,spring:bl};function cw(e){typeof e.type=="string"&&(e.type=hE[e.type])}class Jd{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 pE=e=>e/100;class Cl extends Jd{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!==qt.now()&&this.tick(qt.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;cw(t);const{type:n=ss,repeat:i=0,repeatDelay:s=0,repeatType:l,velocity:a=0}=t;let{keyframes:c}=t;const f=n||ss;f!==ss&&typeof c[0]!="number"&&(this.mixKeyframes=Ps(pE,aw(c[0],c[1])),c=[0,100]);const h=f({...t,keyframes:c});l==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=Qd(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=h}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:l,mirroredGenerator:a,resolvedDuration:c,calculatedDuration: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 T=this.currentTime-h*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?T<0:T>s;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let j=this.currentTime,R=i;if(p){const $=Math.min(this.currentTime,s)/c;let _=Math.floor($),P=$%1;!P&&$>=1&&(P=1),P===1&&_--,_=Math.min(_,p+1),!!(_%2)&&(v==="reverse"?(P=1-P,w&&(P-=w/c)):v==="mirror"&&(R=a)),j=Yn(0,1,P)*c}let V;A?(this.delayState.value=m[0],V=this.delayState):V=R.next(j),l&&!A&&(V.value=l(V.value));let{done:D}=V;!A&&f!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const G=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return G&&S!==Df&&(V.value=$l(m,this.options,E,this.speed)),C&&C(V.value),G&&this.finish(),V}then(t,n){return this.finished.then(t,n)}get duration(){return Sn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sn(t)}get time(){return Sn(this.currentTime)}set time(t){t=fn(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 uw(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(qt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Sn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=QC,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(qt.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 mE(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ui=e=>e*180/Math.PI,_f=e=>{const t=ui(Math.atan2(e[1],e[0]));return Lf(t)},gE={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_f,rotateZ:_f,skewX:e=>ui(Math.atan(e[1])),skewY:e=>ui(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Lf=e=>(e=e%360,e<0&&(e+=360),e),Xg=_f,Yg=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Gg=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),yE={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yg,scaleY:Gg,scale:e=>(Yg(e)+Gg(e))/2,rotateX:e=>Lf(ui(Math.atan2(e[6],e[5]))),rotateY:e=>Lf(ui(Math.atan2(-e[2],e[0]))),rotateZ:Xg,rotate:Xg,skewX:e=>ui(Math.atan(e[4])),skewY:e=>ui(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Of(e){return e.includes("scale")?1:0}function Ff(e,t){if(!e||e==="none")return Of(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=yE,s=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=gE,s=c}if(!s)return Of(t);const l=i[t],a=s[1].split(",").map(xE);return typeof l=="function"?l(a):a[l]}const vE=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ff(n,t)};function xE(e){return parseFloat(e.trim())}const so=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ao=new Set([...so,"pathRotation"]),Qg=e=>e===oo||e===be,wE=new Set(["x","y","z"]),kE=so.filter(e=>!wE.has(e));function SE(e){const t=[];return kE.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Lr={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})=>Ff(t,"x"),y:(e,{transform:t})=>Ff(t,"y")};Lr.translateX=Lr.x;Lr.translateY=Lr.y;const ci=new Set;let zf=!1,Vf=!1,Bf=!1;function fw(){if(Vf){const e=Array.from(ci).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const s=SE(i);s.length&&(n.set(i,s),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([l,a])=>{i.getValue(l)?.set(a)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Vf=!1,zf=!1,ci.forEach(e=>e.complete(Bf)),ci.clear()}function dw(){ci.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vf=!0)})}function bE(){Bf=!0,dw(),fw(),Bf=!1}class Zd{constructor(t,n,i,s,l,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=s,this.element=l,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(ci.add(this),zf||(zf=!0,Ze.read(dw),Ze.resolveKeyframes(fw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(t[0]===null){const l=s?.get(),a=t[t.length-1];if(l!==void 0)t[0]=l;else if(i&&n){const c=i.readValue(n,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),s&&l===void 0&&s.set(t[0])}mE(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ci.delete(this)}cancel(){this.state==="scheduled"&&(ci.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const CE=e=>e.startsWith("--");function hw(e,t,n){CE(t)?e.style.setProperty(t,n):e.style[t]=n}const EE={};function pw(e,t){const n=Bx(e);return()=>EE[t]??n()}const TE=pw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),mw=pw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ns=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,Jg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ns([0,.65,.55,1]),circOut:ns([.55,0,1,.45]),backIn:ns([.31,.01,.66,-.59]),backOut:ns([.33,1.53,.69,.99])};function gw(e,t){if(e)return typeof e=="function"?mw()?lw(e,t):"ease-out":Jx(e)?ns(e):Array.isArray(e)?e.map(n=>gw(n,t)||Jg.easeOut):Jg[e]}function PE(e,t,n,{delay:i=0,duration:s=300,repeat:l=0,repeatType:a="loop",ease:c="easeOut",times:f}={},h=void 0){const m={[t]:n};f&&(m.offset=f);const p=gw(c,s);Array.isArray(p)&&(m.easing=p);const v={delay:i,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:l+1,direction:a==="reverse"?"alternate":"normal"};return h&&(v.pseudoElement=h),e.animate(m,v)}function yw(e){return typeof e=="function"&&"applyToOptions"in e}function RE({type:e,...t}){return yw(e)&&mw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class vw extends Jd{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:l,allowFlatten:a=!1,finalKeyframe:c,onComplete:f}=t;this.isPseudoElement=!!l,this.allowFlatten=a,this.options=t,Bl(typeof t.type!="string");const h=RE(t);this.animation=PE(n,i,s,h,l),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const m=$l(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(m),hw(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 Sn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sn(t)}get time(){return Sn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=fn(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&&TE()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),bn):s(this)}}const xw={anticipate:Xx,backInOut:qx,circInOut:Gx};function jE(e){return e in xw}function AE(e){typeof e.ease=="string"&&jE(e.ease)&&(e.ease=xw[e.ease])}const Kc=10;class NE extends vw{constructor(t){AE(t),cw(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:l,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Cl({...a,autoplay:!1}),f=Math.max(Kc,qt.now()-this.startTime),h=Yn(0,Kc,f-Kc),m=c.sample(f).value,{name:p}=this.options;l&&p&&hw(l,p,m),n.setWithVelocity(c.sample(Math.max(0,f-h)).value,m,h),c.stop()}}const Zg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(_n.test(e)||e==="0")&&!e.startsWith("url("));function ME(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 IE(e,t,n,i){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],a=Zg(s,t),c=Zg(l,t);return!a||!c?!1:ME(e)||(n==="spring"||yw(n))&&i}function $f(e){e.duration=0,e.type="keyframes"}const ww=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),DE=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function _E(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&DE.test(e[t]))return!0;return!1}const LE=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),OE=Bx(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function FE(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:s,damping:l,type:a,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 OE()&&n&&(ww.has(n)||LE.has(n)&&_E(c))&&(n!=="transform"||!m)&&!h&&!i&&s!=="mirror"&&l!==0&&a!=="inertia"}const zE=40;class VE extends Jd{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:l=0,repeatType:a="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=qt.now();const v={autoplay:t,delay:n,type:i,repeat:s,repeatDelay:l,repeatType:a,name:f,motionValue:h,element:m,...p},w=m?.KeyframeResolver||Zd;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:l,type:a,velocity:c,delay:f,isHandoff:h,onUpdate:m}=i;this.resolvedAt=qt.now();let p=!0;IE(t,l,a,c)||(p=!1,(Fr.instantAnimations||!f)&&m?.($l(t,i,n)),t[0]=t[t.length-1],$f(i),i.repeat=0);const w={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>zE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},S=p&&!h&&FE(w),C=w.motionValue?.owner?.current;let E;if(S)try{E=new NE({...w,element:C})}catch{E=new Cl(w)}else E=new Cl(w);E.finished.then(()=>{this.notifyFinished()}).catch(bn),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(),bE()),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 kw(e,t,n,i=0,s=1){const l=Array.from(e).sort((h,m)=>h.sortNodePosition(m)).indexOf(t),a=e.size,c=(a-1)*i;return typeof n=="function"?n(l,a):s===1?l*i:c-l*i}const ey=30,BE=e=>!isNaN(parseFloat(e));class $E{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const s=qt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=qt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=BE(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 Wd);const i=this.events[t].add(n);return t==="change"?()=>{i(),Ze.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=qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ey)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ey);return $x(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 to(e,t){return new $E(e,t)}function eh(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function th(e,t){const n=e?.[t]??e?.default??e;return n!==e?eh(n,e):n}const UE={type:"spring",stiffness:500,damping:25,restSpeed:10},WE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),HE={type:"keyframes",duration:.8},KE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qE=(e,{keyframes:t})=>t.length>2?HE:ao.has(e)?e.startsWith("scale")?WE(t[1]):UE:KE,XE=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function YE(e){for(const t in e)if(!XE.has(t))return!0;return!1}const nh=(e,t,n,i={},s,l)=>a=>{const c=th(i,e)||{},f=c.delay||i.delay||0;let{elapsed:h=0}=i;h=h-fn(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:()=>{a(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:l?void 0:s};YE(c)||Object.assign(m,qE(e,m)),m.duration&&(m.duration=fn(m.duration)),m.repeatDelay&&(m.repeatDelay=fn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let p=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&($f(m),m.delay===0&&(p=!0)),(Fr.instantAnimations||Fr.skipAnimations||s?.shouldSkipAnimations||c.skipAnimations)&&(p=!0,$f(m),m.delay=0),m.allowFlatten=!c.type&&!c.ease,p&&!l&&t.get()!==void 0){const v=$l(m.keyframes,c);if(v!==void 0){Ze.update(()=>{m.onUpdate(v),m.onComplete()});return}}return c.isSync?new Cl(m):new VE(m)},GE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function QE(e){const t=GE.exec(e);if(!t)return[,];const[,n,i,s]=t;return[`--${n??i}`,s]}function Sw(e,t,n=1){const[i,s]=QE(e);if(!i)return;const l=window.getComputedStyle(t).getPropertyValue(i);if(l){const a=l.trim();return Fx(a)?parseFloat(a):a}return qd(s)?Sw(s,t,n+1):s}function ty(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function rh(e,t,n,i){if(typeof t=="function"){const[s,l]=ty(i);t=t(n!==void 0?n:e.custom,s,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,l]=ty(i);t=t(n!==void 0?n:e.custom,s,l)}return t}function fi(e,t,n){const i=e.getProps();return rh(i,t,n!==void 0?n:i.custom,e)}const bw=new Set(["width","height","top","left","right","bottom",...so]),Uf=e=>Array.isArray(e);function JE(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,to(n))}function ZE(e){return Uf(e)?e[e.length-1]||0:e}function eT(e,t){const n=fi(e,t);let{transitionEnd:i={},transition:s={},...l}=n||{};l={...l,...i};for(const a in l){const c=ZE(l[a]);JE(e,a,c)}}const Dt=e=>!!(e&&e.getVelocity);function tT(e){return!!(Dt(e)&&e.add)}function Wf(e,t){const n=e.getValue("willChange");if(tT(n))return n.add(t);if(!n&&Fr.WillChange){const i=new Fr.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function ih(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const nT="framerAppearId",Cw="data-"+ih(nT);function Ew(e){return e.props[Cw]}function rT({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Tw(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:l,transitionEnd:a,...c}=t;const f=e.getDefaultTransition();l=l?eh(l,f):f;const h=l?.reduceMotion,m=l?.skipAnimations;i&&(l=i);const p=[],v=s&&e.animationState&&e.animationState.getState()[s],w=l?.path;w&&w.animateVisualElement(e,c,l,n,p);for(const S in c){const C=e.getValue(S,e.latestValues[S]??null),E=c[S];if(E===void 0||v&&rT(v,S))continue;const T={delay:n,...th(l||{},S)};m&&(T.skipAnimations=!0);const A=C.get();if(A!==void 0&&!C.isAnimating()&&!Array.isArray(E)&&E===A&&!T.velocity){Ze.update(()=>C.set(E));continue}let j=!1;if(window.MotionHandoffAnimation){const D=Ew(e);if(D){const G=window.MotionHandoffAnimation(D,S,Ze);G!==null&&(T.startTime=G,j=!0)}}Wf(e,S);const R=h??e.shouldReduceMotion;C.start(nh(S,C,E,R&&bw.has(S)?{type:!1}:T,e,j));const V=C.animation;V&&p.push(V)}if(a){const S=()=>Ze.update(()=>{a&&eT(e,a)});p.length?Promise.all(p).then(S):S()}return p}function Hf(e,t,n={}){const i=fi(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const l=i?()=>Promise.all(Tw(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=s;return iT(e,t,f,h,m,p,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[f,h]=c==="beforeChildren"?[l,a]:[a,l];return f().then(()=>h())}else return Promise.all([l(),a(n.delay)])}function iT(e,t,n=0,i=0,s=0,l=1,a){const c=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),c.push(Hf(f,t,{...a,delay:n+(typeof i=="function"?0:i)+kw(e.variantChildren,f,i,s,l)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(c)}function oT(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(l=>Hf(e,l,n));i=Promise.all(s)}else if(typeof t=="string")i=Hf(e,t,n);else{const s=typeof t=="function"?fi(e,t,n.custom):t;i=Promise.all(Tw(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const sT={test:e=>e==="auto",parse:e=>e},Pw=e=>t=>t.test(e),Rw=[oo,be,Xn,sr,MC,NC,sT],ny=e=>Rw.find(Pw(e));function aT(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Vx(e):!0}const lT=new Set(["brightness","contrast","saturate","opacity"]);function uT(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Xd)||[];if(!i)return e;const s=n.replace(i,"");let l=lT.has(t)?1:0;return i!==n&&(l*=100),t+"("+l+s+")"}const cT=/\b([a-z-]*)\(.*?\)/gu,Kf={..._n,getAnimatableNone:e=>{const t=e.match(cT);return t?t.map(uT).join(" "):e}},qf={..._n,getAnimatableNone:e=>{const t=_n.parse(e);return _n.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},ry={...oo,transform:Math.round},fT={rotate:sr,pathRotation:sr,rotateX:sr,rotateY:sr,rotateZ:sr,scale:qa,scaleX:qa,scaleY:qa,scaleZ:qa,skew:sr,skewX:sr,skewY:sr,distance:be,translateX:be,translateY:be,translateZ:be,x:be,y:be,z:be,perspective:be,transformPerspective:be,opacity:ps,originX:Ug,originY:Ug,originZ:be},El={borderWidth:be,borderTopWidth:be,borderRightWidth:be,borderBottomWidth:be,borderLeftWidth:be,borderRadius:be,borderTopLeftRadius:be,borderTopRightRadius:be,borderBottomRightRadius:be,borderBottomLeftRadius:be,width:be,maxWidth:be,height:be,maxHeight:be,top:be,right:be,bottom:be,left:be,inset:be,insetBlock:be,insetBlockStart:be,insetBlockEnd:be,insetInline:be,insetInlineStart:be,insetInlineEnd:be,padding:be,paddingTop:be,paddingRight:be,paddingBottom:be,paddingLeft:be,paddingBlock:be,paddingBlockStart:be,paddingBlockEnd:be,paddingInline:be,paddingInlineStart:be,paddingInlineEnd:be,margin:be,marginTop:be,marginRight:be,marginBottom:be,marginLeft:be,marginBlock:be,marginBlockStart:be,marginBlockEnd:be,marginInline:be,marginInlineStart:be,marginInlineEnd:be,fontSize:be,backgroundPositionX:be,backgroundPositionY:be,...fT,zIndex:ry,fillOpacity:ps,strokeOpacity:ps,numOctaves:ry},dT={...El,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:Kf,WebkitFilter:Kf,mask:qf,WebkitMask:qf},jw=e=>dT[e],hT=new Set([Kf,qf]);function Aw(e,t){let n=jw(e);return hT.has(n)||(n=_n),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const pT=new Set(["auto","none","0"]);function mT(e,t,n){let i=0,s;for(;i<e.length&&!s;){const l=e[i];typeof l=="string"&&!pT.has(l)&&eo(l).values.length&&(s=e[i]),i++}if(s&&n)for(const l of t)e[l]=Aw(n,s)}class gT extends Zd{constructor(t,n,i,s,l){super(t,n,i,s,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let p=t[m];if(typeof p=="string"&&(p=p.trim(),qd(p))){const v=Sw(p,n.current);v!==void 0&&(t[m]=v),m===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!bw.has(i)||t.length!==2)return;const[s,l]=t,a=ny(s),c=ny(l),f=$g(s),h=$g(l);if(f!==h&&Lr[i]){this.needsMeasurement=!0;return}if(a!==c)if(Qg(a)&&Qg(c))for(let m=0;m<t.length;m++){const p=t[m];typeof p=="string"&&(t[m]=parseFloat(p))}else Lr[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let s=0;s<t.length;s++)(t[s]===null||aT(t[s]))&&i.push(s);i.length&&mT(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=Lr[i](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(i,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const l=i.length-1,a=i[l];i[l]=Lr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{t.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const oh=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Nw(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 Xf=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ll(e){return zx(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:sh}=Zx(queueMicrotask,!1),Dn={x:!1,y:!1};function Mw(){return Dn.x||Dn.y}function yT(e){return e==="x"||e==="y"?Dn[e]?null:(Dn[e]=!0,()=>{Dn[e]=!1}):Dn.x||Dn.y?null:(Dn.x=Dn.y=!0,()=>{Dn.x=Dn.y=!1})}function Iw(e,t){const n=Nw(e),i=new AbortController,s={passive:!0,...t,signal:i.signal};return[n,s,()=>i.abort()]}function vT(e){return!(e.pointerType==="touch"||Mw())}function xT(e,t,n={}){const[i,s,l]=Iw(e,n);return i.forEach(a=>{let c=!1,f=!1,h;const m=()=>{a.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(!vT(E))return;f=!1;const T=t(a,E);typeof T=="function"&&(h=T,a.addEventListener("pointerleave",S,s))};a.addEventListener("pointerenter",C,s),a.addEventListener("pointerdown",w,s)}),l}const Dw=(e,t)=>t?e===t?!0:Dw(e,t.parentElement):!1,ah=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,wT=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kT(e){return wT.has(e.tagName)||e.isContentEditable===!0}const ST=new Set(["INPUT","SELECT","TEXTAREA"]);function bT(e){return ST.has(e.tagName)||e.isContentEditable===!0}const ul=new WeakSet;function iy(e){return t=>{t.key==="Enter"&&e(t)}}function qc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const CT=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=iy(()=>{if(ul.has(n))return;qc(n,"down");const s=iy(()=>{qc(n,"up")}),l=()=>qc(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",l,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function oy(e){return ah(e)&&!Mw()}const sy=new WeakSet;function ET(e,t,n={}){const[i,s,l]=Iw(e,n),a=c=>{const f=c.currentTarget;if(!oy(c)||sy.has(c))return;ul.add(f),n.stopPropagation&&sy.add(c);const h=t(f,c),m={...s,capture:!0},p=(S,C)=>{window.removeEventListener("pointerup",v,m),window.removeEventListener("pointercancel",w,m),ul.has(f)&&ul.delete(f),oy(S)&&typeof h=="function"&&h(S,{success:C})},v=S=>{p(S,f===window||f===document||n.useGlobalTarget||Dw(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",a,s),ll(c)&&(c.addEventListener("focus",h=>CT(h,s)),!kT(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),l}function lh(e){return zx(e)&&"ownerSVGElement"in e}const cl=new WeakMap;let fl;const _w=(e,t,n)=>(i,s)=>s&&s[0]?s[0][e+"Size"]:lh(i)&&"getBBox"in i?i.getBBox()[t]:i[n],TT=_w("inline","width","offsetWidth"),PT=_w("block","height","offsetHeight");function RT({target:e,borderBoxSize:t}){cl.get(e)?.forEach(n=>{n(e,{get width(){return TT(e,t)},get height(){return PT(e,t)}})})}function jT(e){e.forEach(RT)}function AT(){typeof ResizeObserver>"u"||(fl=new ResizeObserver(jT))}function NT(e,t){fl||AT();const n=Nw(e);return n.forEach(i=>{let s=cl.get(i);s||(s=new Set,cl.set(i,s)),s.add(t),fl?.observe(i)}),()=>{n.forEach(i=>{const s=cl.get(i);s?.delete(t),s?.size||fl?.unobserve(i)})}}const dl=new Set;let Gi;function MT(){Gi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};dl.forEach(t=>t(e))},window.addEventListener("resize",Gi)}function IT(e){return dl.add(e),Gi||MT(),()=>{dl.delete(e),!dl.size&&typeof Gi=="function"&&(window.removeEventListener("resize",Gi),Gi=void 0)}}function ay(e,t){return typeof e=="function"?IT(e):NT(e,t)}function DT(e){return lh(e)&&e.tagName==="svg"}const _T=[...Rw,wt,_n],LT=e=>_T.find(Pw(e)),ly=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qi=()=>({x:ly(),y:ly()}),uy=()=>({min:0,max:0}),Ct=()=>({x:uy(),y:uy()}),OT=new WeakMap;function Ul(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ms(e){return typeof e=="string"||Array.isArray(e)}const uh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ch=["initial",...uh];function Wl(e){return Ul(e.animate)||ch.some(t=>ms(e[t]))}function Lw(e){return!!(Wl(e)||e.variants)}function FT(e,t,n){for(const i in t){const s=t[i],l=n[i];if(Dt(s))e.addValue(i,s);else if(Dt(l))e.addValue(i,to(s,{owner:e}));else if(l!==s)if(e.hasValue(i)){const a=e.getValue(i);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(i);e.addValue(i,to(a!==void 0?a:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const Yf={current:null},Ow={current:!1},zT=typeof window<"u";function VT(){if(Ow.current=!0,!!zT)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Yf.current=e.matches;e.addEventListener("change",t),t()}else Yf.current=!1}const cy=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Tl={};function Fw(e){Tl=e}function BT(){return Tl}class $T{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:l,blockInitialAnimation:a,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=Zd,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=qt.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,Ze.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=l,this.options=f,this.blockInitialAnimation=!!a,this.isControllingVariants=Wl(n),this.isVariantNode=Lw(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&&Dt(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,OT.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:(Ow.current||VT(),this.shouldReduceMotion=Yf.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(),zr(this.notifyUpdate),zr(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&&ww.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:f,ease:h,duration:m}=n.accelerate,p=new vw({element:this.current,name:t,keyframes:c,times:f,ease:h,duration:fn(m)}),v=a(p);this.valueSubscriptions.set(t,()=>{v(),p.cancel()});return}const i=ao.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Ze.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),l&&l()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Tl){const n=Tl[t];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ct()}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<cy.length;i++){const s=cy[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const l="on"+s,a=t[l];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=FT(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=to(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"&&(Fx(i)||Vx(i))?i=parseFloat(i):!LT(i)&&_n.test(n)&&(i=Aw(t,n)),this.setBaseTarget(t,Dt(i)?i.get():i)),Dt(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const l=rh(this.props,n,this.presenceContext?.custom);l&&(i=l[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Dt(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 Wd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){sh.render(this.render)}}class zw extends $T{constructor(){super(...arguments),this.KeyframeResolver=gT}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;Dt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class $r{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Vw({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function UT({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function WT(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 Xc(e){return e===void 0||e===1}function Gf({scale:e,scaleX:t,scaleY:n}){return!Xc(e)||!Xc(t)||!Xc(n)}function oi(e){return Gf(e)||Bw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Bw(e){return fy(e.x)||fy(e.y)}function fy(e){return e&&e!=="0%"}function Pl(e,t,n){const i=e-n,s=t*i;return n+s}function dy(e,t,n,i,s){return s!==void 0&&(e=Pl(e,s,i)),Pl(e,n,i)+t}function Qf(e,t=0,n=1,i,s){e.min=dy(e.min,t,n,i,s),e.max=dy(e.max,t,n,i,s)}function $w(e,{x:t,y:n}){Qf(e.x,t.translate,t.scale,t.originPoint),Qf(e.y,n.translate,n.scale,n.originPoint)}const hy=.999999999999,py=1.0000000000001;function HT(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let l,a;for(let c=0;c<s;c++){l=n[c],a=l.projectionDelta;const{visualElement:f}=l.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(Kn(e.x,-l.scroll.offset.x),Kn(e.y,-l.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,$w(e,a)),i&&oi(l.latestValues)&&hl(e,l.latestValues,l.layout?.layoutBox))}t.x<py&&t.x>hy&&(t.x=1),t.y<py&&t.y>hy&&(t.y=1)}function Kn(e,t){e.min+=t,e.max+=t}function my(e,t,n,i,s=.5){const l=Je(e.min,e.max,s);Qf(e,t,n,l,i)}function gy(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function hl(e,t,n){const i=n??e;my(e.x,gy(t.x,i.x),t.scaleX,t.scale,t.originX),my(e.y,gy(t.y,i.y),t.scaleY,t.scale,t.originY)}function Uw(e,t){return Vw(WT(e.getBoundingClientRect(),t))}function KT(e,t,n){const i=Uw(e,n),{scroll:s}=t;return s&&(Kn(i.x,s.offset.x),Kn(i.y,s.offset.y)),i}const qT={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},XT=so.length;function YT(e,t,n){let i="",s=!0;for(let a=0;a<XT;a++){const c=so[a],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=Xf(f,El[c]);if(!h){s=!1;const p=qT[c]||c;i+=`${p}(${m}) `}n&&(t[c]=m)}}const l=e.pathRotation;return l&&(s=!1,i+=`rotate(${Xf(l,El.pathRotation)}) `),i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function fh(e,t,n){const{style:i,vars:s,transformOrigin:l}=e;let a=!1,c=!1;for(const f in t){const h=t[f];if(ao.has(f)){a=!0;continue}else if(tw(f)){s[f]=h;continue}else{const m=Xf(h,El[f]);f.startsWith("origin")?(c=!0,l[f]=m):i[f]=m}}if(t.transform||(a||n?i.transform=YT(t,e.transform,n):i.transform&&(i.transform="none")),c){const{originX:f="50%",originY:h="50%",originZ:m=0}=l;i.transformOrigin=`${f} ${h} ${m}`}}function Ww(e,{style:t,vars:n},i,s){const l=e.style;let a;for(a in t)l[a]=t[a];s?.applyProjectionStyles(l,i);for(a in n)l.setProperty(a,n[a])}function yy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(be.test(e))e=parseFloat(e);else return e;const n=yy(e,t.target.x),i=yy(e,t.target.y);return`${n}% ${i}%`}},GT={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=_n.parse(e);if(s.length>5)return i;const l=_n.createTransformer(e),a=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,f=n.y.scale*t.y;s[0+a]/=c,s[1+a]/=f;const h=Je(c,f,.5);return typeof s[2+a]=="number"&&(s[2+a]/=h),typeof s[3+a]=="number"&&(s[3+a]/=h),l(s)}},Jf={borderRadius:{...Go,applyTo:[...oh]},borderTopLeftRadius:Go,borderTopRightRadius:Go,borderBottomLeftRadius:Go,borderBottomRightRadius:Go,boxShadow:GT};function Hw(e,{layout:t,layoutId:n}){return ao.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Jf[e]||e==="opacity")}function dh(e,t,n){const i=e.style,s=t?.style,l={};if(!i)return l;for(const a in i)(Dt(i[a])||s&&Dt(s[a])||Hw(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(l[a]=i[a]);return l}function QT(e){return window.getComputedStyle(e)}class JT extends zw{constructor(){super(...arguments),this.type="html",this.renderInstance=Ww}mount(t){Bl(!!t.style),super.mount(t)}readValueFromInstance(t,n){if(ao.has(n))return this.projection?.isProjecting?Of(n):vE(t,n);{const i=QT(t),s=(tw(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Uw(t,n)}build(t,n,i){fh(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return dh(t,n,i)}}const ZT={offset:"stroke-dashoffset",array:"stroke-dasharray"},eP={offset:"strokeDashoffset",array:"strokeDasharray"};function tP(e,t,n=1,i=0,s=!0){e.pathLength=1;const l=s?ZT:eP;e[l.offset]=`${-i}`,e[l.array]=`${t} ${n}`}const nP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Kw(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:l=1,pathOffset:a=0,...c},f,h,m){if(fh(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 nP)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&&tP(p,s,l,a,!1)}const qw=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"]),Xw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function rP(e,t,n,i){Ww(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(qw.has(s)?s:ih(s),t.attrs[s])}function Yw(e,t,n){const i=dh(e,t,n);for(const s in e)if(Dt(e[s])||Dt(t[s])){const l=so.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[l]=e[s]}return i}class iP extends zw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ao.has(n)){const i=jw(n);return i&&i.default||0}return n=qw.has(n)?n:ih(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return Yw(t,n,i)}build(t,n,i){Kw(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){rP(t,n,i,s)}mount(t){this.isSVGTag=Xw(t.tagName),super.mount(t)}}const oP=ch.length;function Gw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Gw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<oP;n++){const i=ch[n],s=e.props[i];(ms(s)||s===!1)&&(t[i]=s)}return t}function Qw(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 sP=[...uh].reverse(),aP=uh.length;function lP(e){return t=>Promise.all(t.map(({animation:n,options:i})=>oT(e,n,i)))}function uP(e){let t=lP(e),n=vy(),i=!0,s=!1;const l=h=>(m,p)=>{const v=fi(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 a(h){t=h(e)}function c(h){const{props:m}=e,p=Gw(e.parent)||{},v=[],w=new Set;let S={},C=1/0;for(let T=0;T<aP;T++){const A=sP[T],j=n[A],R=m[A]!==void 0?m[A]:p[A],V=ms(R),D=A===h?j.isActive:null;D===!1&&(C=T);let G=R===p[A]&&R!==m[A]&&V;if(G&&(i||s)&&e.manuallyAnimateOnMount&&(G=!1),j.protectedKeys={...S},!j.isActive&&D===null||!R&&!j.prevProp||Ul(R)||typeof R=="boolean")continue;if(A==="exit"&&j.isActive&&D!==!0){j.prevResolvedValues&&(S={...S,...j.prevResolvedValues});continue}const $=cP(j.prevProp,R);let _=$||A===h&&j.isActive&&!G&&V||T>C&&V,P=!1;const K=Array.isArray(R)?R:[R];let F=K.reduce(l(A),{});D===!1&&(F={});const{prevResolvedValues:ie={}}=j,Z={...ie,...F},ee=Q=>{_=!0,w.has(Q)&&(P=!0,w.delete(Q)),j.needsAnimating[Q]=!0;const fe=e.getValue(Q);fe&&(fe.liveStyle=!1)};for(const Q in Z){const fe=F[Q],N=ie[Q];if(S.hasOwnProperty(Q))continue;let O=!1;Uf(fe)&&Uf(N)?O=!Qw(fe,N)||$:O=fe!==N,O?fe!=null?ee(Q):w.add(Q):fe!==void 0&&w.has(Q)?ee(Q):j.protectedKeys[Q]=!0}j.prevProp=R,j.prevResolvedValues=F,j.isActive&&(S={...S,...F}),(i||s)&&e.blockInitialAnimation&&(_=!1);const pe=G&&$;_&&(!pe||P)&&v.push(...K.map(Q=>{const fe={type:A};if(typeof Q=="string"&&(i||s)&&!pe&&e.manuallyAnimateOnMount&&e.parent){const{parent:N}=e,O=fi(N,Q);if(N.enteringChildren&&O){const{delayChildren:J}=O.transition||{};fe.delay=kw(N.enteringChildren,e,J)}}return{animation:Q,options:fe}}))}if(w.size){const T={};if(typeof m.initial!="boolean"){const A=fi(e,Array.isArray(m.initial)?m.initial[0]:m.initial);A&&A.transition&&(T.transition=A.transition)}w.forEach(A=>{const j=e.getBaseTarget(A),R=e.getValue(A);R&&(R.liveStyle=!0),T[A]=j??null}),v.push({animation:T})}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:a,getState:()=>n,reset:()=>{n=vy(),s=!0}}}function cP(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Qw(t,e):!1}function ri(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vy(){return{animate:ri(!0),whileInView:ri(),whileHover:ri(),whileTap:ri(),whileDrag:ri(),whileFocus:ri(),exit:ri()}}function Zf(e,t){e.min=t.min,e.max=t.max}function In(e,t){Zf(e.x,t.x),Zf(e.y,t.y)}function xy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Jw=1e-4,fP=1-Jw,dP=1+Jw,Zw=.01,hP=0-Zw,pP=0+Zw;function Xt(e){return e.max-e.min}function mP(e,t,n){return Math.abs(e-t)<=n}function wy(e,t,n,i=.5){e.origin=i,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Xt(n)/Xt(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=fP&&e.scale<=dP||isNaN(e.scale))&&(e.scale=1),(e.translate>=hP&&e.translate<=pP||isNaN(e.translate))&&(e.translate=0)}function as(e,t,n,i){wy(e.x,t.x,n.x,i?i.originX:void 0),wy(e.y,t.y,n.y,i?i.originY:void 0)}function ky(e,t,n,i=0){const s=i?Je(n.min,n.max,i):n.min;e.min=s+t.min,e.max=e.min+Xt(t)}function gP(e,t,n,i){ky(e.x,t.x,n.x,i?.x),ky(e.y,t.y,n.y,i?.y)}function Sy(e,t,n,i=0){const s=i?Je(n.min,n.max,i):n.min;e.min=t.min-s,e.max=e.min+Xt(t)}function Rl(e,t,n,i){Sy(e.x,t.x,n.x,i?.x),Sy(e.y,t.y,n.y,i?.y)}function by(e,t,n,i,s){return e-=t,e=Pl(e,1/n,i),s!==void 0&&(e=Pl(e,1/s,i)),e}function yP(e,t=0,n=1,i=.5,s,l=e,a=e){if(Xn.test(t)&&(t=parseFloat(t),t=Je(a.min,a.max,t/100)-a.min),typeof t!="number")return;let c=Je(l.min,l.max,i);e===l&&(c-=t),e.min=by(e.min,t,n,c,s),e.max=by(e.max,t,n,c,s)}function Cy(e,t,[n,i,s],l,a){yP(e,t[n],t[i],t[s],t.scale,l,a)}const vP=["x","scaleX","originX"],xP=["y","scaleY","originY"];function Ey(e,t,n,i){Cy(e.x,t,vP,n?n.x:void 0,i?i.x:void 0),Cy(e.y,t,xP,n?n.y:void 0,i?i.y:void 0)}function Ty(e){return e.translate===0&&e.scale===1}function e0(e){return Ty(e.x)&&Ty(e.y)}function Py(e,t){return e.min===t.min&&e.max===t.max}function wP(e,t){return Py(e.x,t.x)&&Py(e.y,t.y)}function Ry(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function t0(e,t){return Ry(e.x,t.x)&&Ry(e.y,t.y)}function jy(e){return Xt(e.x)/Xt(e.y)}function Ay(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Wn(e){return[e("x"),e("y")]}function kP(e,t,n){let i="";const s=e.x.translate/t.x,l=e.y.translate/t.y,a=n?.z||0;if((s||l||a)&&(i=`translate3d(${s}px, ${l}px, ${a}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:m,pathRotation:p,rotateX: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 SP=oh.length,Ny=e=>typeof e=="string"?parseFloat(e):e,My=e=>typeof e=="number"||be.test(e);function bP(e,t,n,i,s,l){s?(e.opacity=Je(0,n.opacity??1,CP(i)),e.opacityExit=Je(t.opacity??1,0,EP(i))):l&&(e.opacity=Je(t.opacity??1,n.opacity??1,i));for(let a=0;a<SP;a++){const c=oh[a];let f=Iy(t,c),h=Iy(n,c);if(f===void 0&&h===void 0)continue;f||(f=0),h||(h=0),f===0||h===0||My(f)===My(h)?(e[c]=Math.max(Je(Ny(f),Ny(h),i),0),(Xn.test(h)||Xn.test(f))&&(e[c]+="%")):e[c]=h}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,i))}function Iy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const CP=n0(0,.5,Yx),EP=n0(.5,.95,bn);function n0(e,t,n){return i=>i<e?0:i>t?1:n(hs(e,t,i))}function TP(e,t,n){const i=Dt(e)?e:to(e);return i.start(nh("",i,t,n)),i.animation}function gs(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}const PP=(e,t)=>e.depth-t.depth;class RP{constructor(){this.children=[],this.isDirty=!1}add(t){Ud(this.children,t),this.isDirty=!0}remove(t){wl(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(PP),this.isDirty=!1,this.children.forEach(t)}}function jP(e,t){const n=qt.now(),i=({timestamp:s})=>{const l=s-n;l>=t&&(zr(i),e(l-t))};return Ze.setup(i,!0),()=>zr(i)}function pl(e){return Dt(e)?e.get():e}class AP{constructor(){this.members=[]}add(t){Ud(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&&(wl(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(wl(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:l}=t.options;(s===void 0||s!==l)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const ml={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Yc=["","X","Y","Z"],NP=1e3;let MP=0;function Gc(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function r0(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ew(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ze,!(s||l))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&r0(i)}function i0({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(a={},c=t?.()){this.id=MP++,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(_P),this.nodes.forEach(BP),this.nodes.forEach($P),this.nodes.forEach(LP)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new RP)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Wd),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const f=this.eventHandlers.get(a);f&&f.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=lh(a)&&!DT(a),this.instance=a;const{layoutId:c,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),e){let m,p=0;const v=()=>this.root.updateBlockedByResize=!1;Ze.read(()=>{p=window.innerWidth}),e(a,()=>{const w=window.innerWidth;w!==p&&(p=w,this.root.updateBlockedByResize=!0,m&&m(),m=jP(v,250),ml.hasAnimatedSinceResize&&(ml.hasAnimatedSinceResize=!1,this.nodes.forEach(Ly)))})}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()||qP,{onLayoutAnimationStart:C,onLayoutAnimationComplete:E}=h.getProps(),T=!this.targetLayout||!t0(this.targetLayout,w),A=!p&&v;if(this.options.layoutRoot||this.resumeFrom||A||p&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const j={...th(S,"layout"),onPlay:C,onComplete:E};(h.shouldReduceMotion||this.options.layoutRoot)&&(j.delay=0,j.type=!1),this.startAnimation(j),this.setAnimationOrigin(m,A,j.path)}else p||Ly(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),zr(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(UP),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&r0(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(),a&&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(FP),this.nodes.forEach(Dy);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(_y);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(zP),this.nodes.forEach(VP),this.nodes.forEach(IP),this.nodes.forEach(DP)):this.nodes.forEach(_y),this.clearAllSnapshots();const c=qt.now();It.delta=Yn(0,1e3/60,c-It.timestamp),It.timestamp=c,It.isProcessing=!0,Bc.update.process(It),Bc.preRender.process(It),Bc.render.process(It),It.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(OP),this.sharedNodes.forEach(WP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ze.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ze.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Xt(this.snapshot.measuredBox.x)&&!Xt(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 a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ct()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!e0(this.projectionDelta),f=this.getTransformTemplate(),h=f?f(this.latestValues,""):void 0,m=h!==this.prevTransformTemplateValue;a&&this.instance&&(c||oi(this.latestValues)||m)&&(s(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return a&&(f=this.removeTransform(f)),XP(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return Ct();const c=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(YP))){const{scroll:h}=this.root;h&&(Kn(c.x,h.offset.x),Kn(c.y,h.offset.y))}return c}removeElementScroll(a){const c=Ct();if(In(c,a),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&&In(c,a),Kn(c.x,m.offset.x),Kn(c.y,m.offset.y))}return c}applyTransform(a,c=!1,f){const h=f||Ct();In(h,a);for(let m=0;m<this.path.length;m++){const p=this.path[m];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Kn(h.x,-p.scroll.offset.x),Kn(h.y,-p.scroll.offset.y)),oi(p.latestValues)&&hl(h,p.latestValues,p.layout?.layoutBox)}return oi(this.latestValues)&&hl(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(a){const c=Ct();In(c,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!oi(h.latestValues))continue;let m;h.instance&&(Gf(h.latestValues)&&h.updateSnapshot(),m=Ct(),In(m,h.measurePageBox())),Ey(c,h.latestValues,h.snapshot?.layoutBox,m)}return oi(this.latestValues)&&Ey(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==It.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(a||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=It.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=Ct(),this.targetWithTransforms=Ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gP(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):In(this.target,this.layout.layoutBox),$w(this.target,this.targetDelta)):In(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||Gf(this.parent.latestValues)||Bw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,f){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ct(),this.relativeTargetOrigin=Ct(),Rl(this.relativeTargetOrigin,c,f,this.options.layoutAnchor||void 0),In(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),c=!!this.resumingFrom||this!==a;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===It.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;In(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,v=this.treeScale.y;HT(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Ct());const{target:w}=a;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xy(this.prevProjectionDelta.x,this.projectionDelta.x),xy(this.prevProjectionDelta.y,this.projectionDelta.y)),as(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==v||!Ay(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ay(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qi(),this.projectionDelta=Qi(),this.projectionDeltaWithTransform=Qi()}setAnimationOrigin(a,c=!1,f){const h=this.snapshot,m=h?h.latestValues:{},p={...this.latestValues},v=Qi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const w=Ct(),S=h?h.source:void 0,C=this.layout?this.layout.source:void 0,E=S!==C,T=this.getStack(),A=!T||T.members.length<=1,j=!!(E&&!A&&this.options.crossfade===!0&&!this.path.some(KP));this.animationProgress=0;let R;const V=f?.interpolateProjection(a);this.mixTargetDelta=D=>{const G=D/1e3,$=V?.(G);$?(v.x.translate=$.x,v.x.scale=Je(a.x.scale,1,G),v.x.origin=a.x.origin,v.x.originPoint=a.x.originPoint,v.y.translate=$.y,v.y.scale=Je(a.y.scale,1,G),v.y.origin=a.y.origin,v.y.originPoint=a.y.originPoint):(Oy(v.x,a.x,G),Oy(v.y,a.y,G)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rl(w,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),HP(this.relativeTarget,this.relativeTargetOrigin,w,G),R&&wP(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Ct()),In(R,this.relativeTarget)),E&&(this.animationValues=p,bP(p,m,this.latestValues,G,j,A)),$&&$.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=$.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=G},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(zr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ze.update(()=>{ml.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=to(0)),this.motionValue.jump(0,!1),this.currentAnimation=TP(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(NP),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:f,layout:h,latestValues:m}=a;if(!(!c||!f||!h)){if(this!==a&&this.layout&&h&&o0(this.options.animationType,this.layout.layoutBox,h.layoutBox)){f=this.target||Ct();const p=Xt(this.layout.layoutBox.x);f.x.min=a.target.x.min,f.x.max=f.x.min+p;const v=Xt(this.layout.layoutBox.y);f.y.min=a.target.y.min,f.y.max=f.y.min+v}In(c,f),hl(c,m),as(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new AP),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:f}={}){const h=this.getStack();h&&h.promote(this,f),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:f}=a;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const h={};f.z&&Gc("z",a,h,this.animationValues);for(let m=0;m<Yc.length;m++)Gc(`rotate${Yc[m]}`,a,h,this.animationValues),Gc(`skew${Yc[m]}`,a,h,this.animationValues);a.render();for(const m in h)a.setStaticValue(m,h[m]),this.animationValues&&(this.animationValues[m]=h[m]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=pl(c?.pointerEvents)||"",a.transform=f?f(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=pl(c?.pointerEvents)||""),this.hasProjected&&!oi(this.latestValues)&&(a.transform=f?f({},""):"none",this.hasProjected=!1);return}a.visibility="";const m=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=kP(this.projectionDeltaWithTransform,this.treeScale,m);f&&(p=f(m,p)),a.transform=p;const{x:v,y:w}=this.projectionDelta;a.transformOrigin=`${v.origin*100}% ${w.origin*100}% 0`,h.animationValues?a.opacity=h===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:a.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const S in Jf){if(m[S]===void 0)continue;const{correct:C,applyTo:E,isCSSVariable:T}=Jf[S],A=p==="none"?m[S]:C(m[S],h);if(E){const j=E.length;for(let R=0;R<j;R++)a[E[R]]=A}else T?this.options.visualElement.renderState.vars[S]=A:a[S]=A}this.options.layoutId&&(a.pointerEvents=h===this?pl(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Dy),this.root.sharedNodes.clear()}}}function IP(e){e.updateLayout()}function DP(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,l=t.source!==e.layout.source;if(s==="size")Wn(m=>{const p=l?t.measuredBox[m]:t.layoutBox[m],v=Xt(p);p.min=n[m].min,p.max=p.min+v});else if(s==="x"||s==="y"){const m=s==="x"?"y":"x";Zf(l?t.measuredBox[m]:t.layoutBox[m],n[m])}else o0(s,t.layoutBox,n)&&Wn(m=>{const p=l?t.measuredBox[m]:t.layoutBox[m],v=Xt(n[m]);p.max=p.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+v)});const a=Qi();as(a,n,t.layoutBox);const c=Qi();l?as(c,e.applyTransform(i,!0),t.measuredBox):as(c,n,t.layoutBox);const f=!e0(a);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=Ct();Rl(S,t.layoutBox,p.layoutBox,w);const C=Ct();Rl(C,n,v.layoutBox,w),t0(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:a,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function _P(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 LP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function OP(e){e.clearSnapshot()}function Dy(e){e.clearMeasurements()}function FP(e){e.isLayoutDirty=!0,e.updateLayout()}function _y(e){e.isLayoutDirty=!1}function zP(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function VP(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ly(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function BP(e){e.resolveTargetDelta()}function $P(e){e.calcProjection()}function UP(e){e.resetSkewAndRotation()}function WP(e){e.removeLeadSnapshot()}function Oy(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Fy(e,t,n,i){e.min=Je(t.min,n.min,i),e.max=Je(t.max,n.max,i)}function HP(e,t,n,i){Fy(e.x,t.x,n.x,i),Fy(e.y,t.y,n.y,i)}function KP(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const qP={duration:.45,ease:[.4,0,.1,1]},zy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vy=zy("applewebkit/")&&!zy("chrome/")?Math.round:bn;function By(e){e.min=Vy(e.min),e.max=Vy(e.max)}function XP(e){By(e.x),By(e.y)}function o0(e,t,n){return e==="position"||e==="preserve-aspect"&&!mP(jy(t),jy(n),.2)}function YP(e){return e!==e.root&&e.scroll?.wasRoot}const GP=i0({attachResizeListener:(e,t)=>gs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Qc={current:void 0},s0=i0({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qc.current){const e=new GP({});e.mount(window),e.setOptions({layoutScroll:!0}),Qc.current=e}return Qc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ys=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function $y(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function QP(...e){return t=>{let n=!1;const i=e.map(s=>{const l=$y(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<i.length;s++){const l=i[s];typeof l=="function"?l():$y(e[s],null)}}}}function JP(...e){return k.useCallback(QP(...e),e)}class ZP extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(ll(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,s=ll(i)&&i.offsetWidth||0,l=ll(i)&&i.offsetHeight||0,a=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(a.height),c.width=parseFloat(a.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=l-c.height-c.top,c.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function eR({children:e,isPresent:t,anchorX:n,anchorY:i,root:s,pop:l}){const a=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(ys),m=l!==!1?e.props?.ref??e?.ref:void 0,p=JP(c,m);return k.useInsertionEffect(()=>{const{width:v,height:w,top:S,left:C,right:E,bottom:T,direction:A}=f.current;if(t||l===!1||!c.current||!v||!w)return;const j=A==="rtl",R=n==="left"?j?`right: ${E}`:`left: ${C}`:j?`left: ${C}`:`right: ${E}`,V=i==="bottom"?`bottom: ${T}`:`top: ${S}`;c.current.dataset.motionPopId=a;const D=document.createElement("style");h&&(D.nonce=h);const G=s??document.head;return G.appendChild(D),D.sheet&&D.sheet.insertRule(`
41
+ [data-motion-pop-id="${a}"] {
42
+ position: absolute !important;
43
+ width: ${v}px !important;
44
+ height: ${w}px !important;
45
+ ${R}px !important;
46
+ ${V}px !important;
47
+ }
48
+ `),()=>{c.current?.removeAttribute("data-motion-pop-id"),G.contains(D)&&G.removeChild(D)}},[t]),y.jsx(ZP,{isPresent:t,childRef:c,sizeRef:f,pop:l,children:l===!1?e:k.cloneElement(e,{ref:p})})}const tR=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:l,mode:a,anchorX:c,anchorY:f,root:h})=>{const m=zl(nR),p=k.useId(),v=k.useRef(n),w=k.useRef(i);$d(()=>{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 T of m.values())if(!T)return;i&&i()},register:E=>(m.set(E,!1),()=>{m.delete(E),!v.current&&!m.size&&w.current?.()})}),[n,m,i]);return l&&S&&(C={...C}),k.useMemo(()=>{m.forEach((E,T)=>m.set(T,!1))},[n]),k.useEffect(()=>{!n&&!m.size&&i&&i()},[n]),e=y.jsx(eR,{pop:a==="popLayout",isPresent:n,anchorX:c,anchorY:f,root:h,children:e}),y.jsx(Vl.Provider,{value:C,children:e})};function nR(){return new Map}function a0(e=!0){const t=k.useContext(Vl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,l=k.useId();k.useEffect(()=>{if(e)return s(l)},[e]);const a=k.useCallback(()=>e&&i&&i(l),[l,i,e]);return!n&&i?[!1,a]:[!0]}const Xa=e=>e.key||"";function Uy(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const rR=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:l="sync",propagate:a=!1,anchorX:c="left",anchorY:f="top",root:h})=>{const[m,p]=a0(a),v=k.useMemo(()=>Uy(e),[e]),w=a&&!m?[]:v.map(Xa),S=k.useRef(!0),C=k.useRef(v),E=zl(()=>new Map),T=k.useRef(new Set),[A,j]=k.useState(v),[R,V]=k.useState(v);$d(()=>{S.current=!1,C.current=v;for(let $=0;$<R.length;$++){const _=Xa(R[$]);w.includes(_)?(E.delete(_),T.current.delete(_)):E.get(_)!==!0&&E.set(_,!1)}},[R,w.length,w.join("-")]);const D=[];if(v!==A){let $=[...v];for(let _=0;_<R.length;_++){const P=R[_],K=Xa(P);w.includes(K)||($.splice(_,0,P),D.push(P))}return l==="wait"&&D.length&&($=D),V(Uy($)),j(v),null}const{forceRender:G}=k.useContext(Bd);return y.jsx(y.Fragment,{children:R.map($=>{const _=Xa($),P=a&&!m?!1:v===R||w.includes(_),K=()=>{if(T.current.has(_))return;if(E.has(_))T.current.add(_),E.set(_,!0);else return;let F=!0;E.forEach(ie=>{ie||(F=!1)}),F&&(G?.(),V(C.current),a&&p?.(),i&&i())};return y.jsx(tR,{isPresent:P,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:l,root:h,onExitComplete:P?void 0:K,anchorX:c,anchorY:f,children:$},_)})})},l0=k.createContext({strict:!1}),Wy={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 Hy=!1;function iR(){if(Hy)return;const e={};for(const t in Wy)e[t]={isEnabled:n=>Wy[t].some(i=>!!n[i])};Fw(e),Hy=!0}function u0(){return iR(),BT()}function oR(e){const t=u0();for(const n in e)t[n]={...t[n],...e[n]};Fw(t)}const sR=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 jl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||sR.has(e)}let c0=e=>!jl(e);function f0(e){typeof e=="function"&&(c0=t=>t.startsWith("on")?!jl(t):e(t))}try{f0(require("@emotion/is-prop-valid").default)}catch{}function aR(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||Dt(e[s])||(c0(s)||n===!0&&jl(s)||!t&&!jl(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function lR({children:e,isValidProp:t,...n}){t&&f0(t);const i=k.useContext(ys);n={...i,...n},n.transition=eh(n.transition,i.transition),n.isStatic=zl(()=>n.isStatic);const s=k.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return y.jsx(ys.Provider,{value:s,children:e})}const Hl=k.createContext({});function uR(e,t){if(Wl(e)){const{initial:n,animate:i}=e;return{initial:n===!1||ms(n)?n:void 0,animate:ms(i)?i:void 0}}return e.inherit!==!1?t:{}}function cR(e){const{initial:t,animate:n}=uR(e,k.useContext(Hl));return k.useMemo(()=>({initial:t,animate:n}),[Ky(t),Ky(n)])}function Ky(e){return Array.isArray(e)?e.join(" "):e}const hh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function d0(e,t,n){for(const i in t)!Dt(t[i])&&!Hw(i,n)&&(e[i]=t[i])}function fR({transformTemplate:e},t){return k.useMemo(()=>{const n=hh();return fh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dR(e,t){const n=e.style||{},i={};return d0(i,n,e),Object.assign(i,fR(e,t)),i}function hR(e,t){const n={},i=dR(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 h0=()=>({...hh(),attrs:{}});function pR(e,t,n,i){const s=k.useMemo(()=>{const l=h0();return Kw(l,t,Xw(i),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};d0(l,e.style,e),s.style={...l,...s.style}}return s}const mR=["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 ph(e){return typeof e!="string"||e.includes("-")?!1:!!(mR.indexOf(e)>-1||/[A-Z]/u.test(e))}function gR(e,t,n,{latestValues:i},s,l=!1,a){const f=(a??ph(e)?pR:hR)(t,i,s,e),h=aR(t,typeof e=="string",l),m=e!==k.Fragment?{...h,...f,ref:n}:{},{children:p}=t,v=k.useMemo(()=>Dt(p)?p.get():p,[p]);return k.createElement(e,{...m,children:v})}function yR({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:vR(n,i,s,e),renderState:t()}}function vR(e,t,n,i){const s={},l=i(e,{});for(const v in l)s[v]=pl(l[v]);let{initial:a,animate:c}=e;const f=Wl(e),h=Lw(e);t&&h&&!f&&e.inherit!==!1&&(a===void 0&&(a=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const p=m?c:a;if(p&&typeof p!="boolean"&&!Ul(p)){const v=Array.isArray(p)?p:[p];for(let w=0;w<v.length;w++){const S=rh(e,v[w]);if(S){const{transitionEnd:C,transition:E,...T}=S;for(const A in T){let j=T[A];if(Array.isArray(j)){const R=m?j.length-1:0;j=j[R]}j!==null&&(s[A]=j)}for(const A in C)s[A]=C[A]}}}return s}const p0=e=>(t,n)=>{const i=k.useContext(Hl),s=k.useContext(Vl),l=()=>yR(e,t,i,s);return n?l():zl(l)},xR=p0({scrapeMotionValuesFromProps:dh,createRenderState:hh}),wR=p0({scrapeMotionValuesFromProps:Yw,createRenderState:h0}),kR=Symbol.for("motionComponentSymbol");function SR(e,t,n){const i=k.useRef(n);k.useInsertionEffect(()=>{i.current=n});const s=k.useRef(null);return k.useCallback(l=>{l&&e.onMount?.(l),t&&(l?t.mount(l):t.unmount());const a=i.current;if(typeof a=="function")if(l){const c=a(l);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(l);else a&&(a.current=l)},[t])}const m0=k.createContext({});function Ki(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function bR(e,t,n,i,s,l){const{visualElement:a}=k.useContext(Hl),c=k.useContext(l0),f=k.useContext(Vl),h=k.useContext(ys),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:a,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:m,skipAnimations:p,isSVG:l}),w.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const S=v.current,C=k.useContext(m0);S&&!S.projection&&s&&(S.type==="html"||S.type==="svg")&&CR(v.current,n,s,C);const E=k.useRef(!1);k.useInsertionEffect(()=>{S&&E.current&&S.update(n,f)});const T=n[Cw],A=k.useRef(!!T&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return $d(()=>{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?.(T)}),A.current=!1),S.enteringChildren=void 0)}),S}function CR(e,t,n,i){const{layoutId:s,layout:l,drag:a,dragConstraints:c,layoutScroll:f,layoutRoot:h,layoutAnchor:m,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:g0(e.parent)),e.projection.setOptions({layoutId:s,layout:l,alwaysMeasureLayout:!!a||c&&Ki(c),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:f,layoutRoot:h,layoutAnchor:m})}function g0(e){if(e)return e.options.allowProjection!==!1?e.projection:g0(e.parent)}function Jc(e,{forwardMotionProps:t=!1,type:n}={},i,s){i&&oR(i);const l=n?n==="svg":ph(e),a=l?wR:xR;function c(h,m){let p;const v={...k.useContext(ys),...h,layoutId:ER(h)},{isStatic:w}=v,S=cR(h),C=a(h,w);if(!w&&typeof window<"u"){TR();const E=PR(v);p=E.MeasureLayout,S.visualElement=bR(e,C,v,s,E.ProjectionNode,l)}return y.jsxs(Hl.Provider,{value:S,children:[p&&S.visualElement?y.jsx(p,{visualElement:S.visualElement,...v}):null,gR(e,h,SR(C,S.visualElement,m),C,w,t,l)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=k.forwardRef(c);return f[kR]=e,f}function ER({layoutId:e}){const t=k.useContext(Bd).id;return t&&e!==void 0?t+"-"+e:e}function TR(e,t){k.useContext(l0).strict}function PR(e){const t=u0(),{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 RR(e,t){if(typeof Proxy>"u")return Jc;const n=new Map,i=(l,a)=>Jc(l,a,e,t),s=(l,a)=>i(l,a);return new Proxy(s,{get:(l,a)=>a==="create"?i:(n.has(a)||n.set(a,Jc(a,void 0,e,t)),n.get(a))})}const jR=(e,t)=>t.isSVG??ph(e)?new iP(t):new JT(t,{allowProjection:e!==k.Fragment});class AR extends $r{constructor(t){super(t),t.animationState||(t.animationState=uP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ul(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let NR=0;class MR extends $r{constructor(){super(...arguments),this.id=NR++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){const{initial:l,custom:a}=this.node.getProps();if(typeof l=="string"||typeof l=="object"&&l!==null&&!Array.isArray(l)){const c=fi(this.node,l,a);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 IR={animation:{Feature:AR},exit:{Feature:MR}};function As(e){return{point:{x:e.pageX,y:e.pageY}}}const DR=e=>t=>ah(t)&&e(t,As(t));function ls(e,t,n,i){return gs(e,t,DR(n),i)}const y0=({current:e})=>e?e.ownerDocument.defaultView:null,qy=(e,t)=>Math.abs(e-t);function _R(e,t){const n=qy(e.x,t.x),i=qy(e.y,t.y);return Math.sqrt(n**2+i**2)}const Xy=new Set(["auto","scroll"]);class v0{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:l=!1,distanceThreshold:a=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=S=>{this.handleScroll(S.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ya(this.lastRawMoveEventInfo,this.transformPagePoint));const S=Zc(this.lastMoveEventInfo,this.history),C=this.startEvent!==null,E=_R(S.offset,{x:0,y:0})>=this.distanceThreshold;if(!C&&!E)return;const{point:T}=S,{timestamp:A}=It;this.history.push({...T,timestamp:A});const{onStart:j,onMove:R}=this.handlers;C||(j&&j(this.lastMoveEvent,S),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,S)},this.handlePointerMove=(S,C)=>{this.lastMoveEvent=S,this.lastRawMoveEventInfo=C,this.lastMoveEventInfo=Ya(C,this.transformPagePoint),Ze.update(this.updatePoint,!0)},this.handlePointerUp=(S,C)=>{this.end();const{onEnd:E,onSessionEnd:T,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=Zc(S.type==="pointercancel"?this.lastMoveEventInfo:Ya(C,this.transformPagePoint),this.history);this.startEvent&&E&&E(S,j),T&&T(S,j)},!ah(t))return;this.dragSnapToOrigin=l,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=a,this.contextWindow=s||window;const f=As(t),h=Ya(f,this.transformPagePoint),{point:m}=h,{timestamp:p}=It;this.history=[{...m,timestamp:p}];const{onSessionStart:v}=n;v&&v(t,Zc(h,this.history));const w={passive:!0,capture:!0};this.removeListeners=Ps(ls(this.contextWindow,"pointermove",this.handlePointerMove,w),ls(this.contextWindow,"pointerup",this.handlePointerUp,w),ls(this.contextWindow,"pointercancel",this.handlePointerUp,w)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(Xy.has(i.overflowX)||Xy.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const i=t===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:s.x-n.x,y:s.y-n.y};l.x===0&&l.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,s),Ze.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),zr(this.updatePoint)}}function Ya(e,t){return t?{point:t(e.point)}:e}function Yy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zc({point:e},t){return{point:e,delta:Yy(e,x0(t)),offset:Yy(e,LR(t)),velocity:OR(t,.1)}}function LR(e){return e[0]}function x0(e){return e[e.length-1]}function OR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=x0(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>fn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&s.timestamp-i.timestamp>fn(t)*2&&(i=e[1]);const l=Sn(s.timestamp-i.timestamp);if(l===0)return{x:0,y:0};const a={x:(s.x-i.x)/l,y:(s.y-i.y)/l};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function FR(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?Je(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?Je(n,e,i.max):Math.min(e,n)),e}function Gy(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 zR(e,{top:t,left:n,bottom:i,right:s}){return{x:Gy(e.x,n,s),y:Gy(e.y,t,i)}}function Qy(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 VR(e,t){return{x:Qy(e.x,t.x),y:Qy(e.y,t.y)}}function BR(e,t){let n=.5;const i=Xt(e),s=Xt(t);return s>i?n=hs(t.min,t.max-i,e.min):i>s&&(n=hs(e.min,e.max-s,t.min)),Yn(0,1,n)}function $R(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 ed=.35;function UR(e=ed){return e===!1?e=0:e===!0&&(e=ed),{x:Jy(e,"left","right"),y:Jy(e,"top","bottom")}}function Jy(e,t,n){return{min:Zy(e,t),max:Zy(e,n)}}function Zy(e,t){return typeof e=="number"?e:e[t]||0}const WR=new WeakMap;class HR{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=Ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const l=p=>{n&&this.snapToCursor(As(p).point),this.stopAnimation()},a=(p,v)=>{const{drag:w,dragPropagation:S,onDragStart:C}=this.getProps();if(w&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yT(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),Wn(T=>{let A=this.getAxisMotionValue(T).get()||0;if(Xn.test(A)){const{projection:j}=this.visualElement;if(j&&j.layout){const R=j.layout.layoutBox[T];R&&(A=Xt(R)*(parseFloat(A)/100))}}this.originPoint[T]=A}),C&&Ze.update(()=>C(p,v),!1,!0),Wf(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:T}=v;if(S&&this.currentDirection===null){this.currentDirection=qR(T),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",v.point,T),this.updateAxis("y",v.point,T),this.visualElement.render(),E&&Ze.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 v0(t,{onSessionStart:l,onStart:a,onMove:c,onSessionEnd:f,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:i,contextWindow:y0(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!s||!i)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&Ze.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||!Ga(t,s,this.currentDirection))return;const l=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=FR(a,this.constraints[t],this.elastic[t])),l.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&Ki(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=zR(i.layoutBox,t):this.constraints=!1,this.elastic=UR(n),s!==this.constraints&&!Ki(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Wn(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=$R(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ki(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const l=KT(i,s.root,this.visualElement.getTransformPagePoint());let a=VR(s.layout.layoutBox,l);if(n){const c=n(UT(a));this.hasMutatedConstraints=!!c,c&&(a=Vw(c))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:l,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},h=Wn(m=>{if(!Ga(m,n,this.currentDirection))return;let p=f&&f[m]||{};(a===!0||a===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,...l,...p};return this.startAxisValueAnimation(m,S)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return Wf(this.visualElement,t),i.start(nh(t,i,0,n,this.visualElement,!1))}stopAnimation(){Wn(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){Wn(n=>{const{drag:i}=this.getProps();if(!Ga(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,l=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:c}=s.layout.layoutBox[n],f=l.get()||0;l.set(t[n]-Je(a,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Ki(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Wn(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const f=c.get();s[a]=BR({min:f,max:f},this.constraints[a])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Wn(a=>{if(!Ga(a,t,null))return;const c=this.getAxisMotionValue(a),{min:f,max:h}=this.constraints[a];c.set(Je(f,h,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;WR.set(this.visualElement,this);const t=this.visualElement.current,n=ls(t,"pointerdown",h=>{const{drag:m,dragListener:p=!0}=this.getProps(),v=h.target,w=v!==t&&bT(v);m&&p&&!w&&this.start(h)});let i;const s=()=>{const{dragConstraints:h}=this.getProps();Ki(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),i||(i=KR(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,a=l.addEventListener("measure",s);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),Ze.read(s);const c=gs(window,"resize",()=>this.scalePositionWithinConstraints()),f=l.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(Wn(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(),a(),f&&f(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:l=!1,dragElastic:a=ed,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:l,dragElastic:a,dragMomentum:c}}}function ev(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function KR(e,t,n){const i=ay(e,ev(n)),s=ay(t,ev(n));return()=>{i(),s()}}function Ga(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class XR extends $r{constructor(t){super(t),this.removeGroupControls=bn,this.removeListeners=bn,this.controls=new HR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||bn}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 ef=e=>(t,n)=>{e&&Ze.update(()=>e(t,n),!1,!0)};class YR extends $r{constructor(){super(...arguments),this.removePointerDownListener=bn}onPointerDown(t){this.session=new v0(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:y0(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:ef(t),onStart:ef(n),onMove:ef(i),onEnd:(l,a)=>{delete this.session,s&&Ze.postRender(()=>s(l,a))}}}mount(){this.removePointerDownListener=ls(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 tf=!1;class GR extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:l}=t;l&&(n.group&&n.group.add(l),i&&i.register&&s&&i.register(l),tf&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ml.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:l}=this.props,{projection:a}=i;return a&&(a.isPresent=l,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),tf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==l?a.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?a.promote():a.relegate()||Ze.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),sh.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;tf=!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 w0(e){const[t,n]=a0(),i=k.useContext(Bd);return y.jsx(GR,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(m0),isPresent:t,safeToRemove:n})}const QR={pan:{Feature:YR},drag:{Feature:XR,ProjectionNode:s0,MeasureLayout:w0}};function tv(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,l=i[s];l&&Ze.postRender(()=>l(t,As(t)))}class JR extends $r{mount(){const{current:t}=this.node;t&&(this.unmount=xT(t,(n,i)=>(tv(this.node,i,"Start"),s=>tv(this.node,s,"End"))))}unmount(){}}class ZR extends $r{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ps(gs(this.node.current,"focus",()=>this.onFocus()),gs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function nv(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),l=i[s];l&&Ze.postRender(()=>l(t,As(t)))}class ej extends $r{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=ET(t,(s,l)=>(nv(this.node,l,"Start"),(a,{success:c})=>nv(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const td=new WeakMap,nf=new WeakMap,tj=e=>{const t=td.get(e.target);t&&t(e)},nj=e=>{e.forEach(tj)};function rj({root:e,...t}){const n=e||document;nf.has(n)||nf.set(n,{});const i=nf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(nj,{root:e,...t})),i[s]}function ij(e,t,n){const i=rj(t);return td.set(e,n),i.observe(e),()=>{td.delete(e),i.unobserve(e)}}const oj={some:0,all:1};class sj extends $r{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:l}=t,a={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:oj[s]},c=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,l&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),v=h?m:p;v&&v(f)};this.stopObserver=ij(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aj(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function aj({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const lj={inView:{Feature:sj},tap:{Feature:ej},focus:{Feature:ZR},hover:{Feature:JR}},uj={layout:{ProjectionNode:s0,MeasureLayout:w0}},cj={...IR,...lj,...QR,...uj},Ji=RR(cj,jR);class vs extends Error{constructor(t,n){super(n),this.status=t}}function fj(e){let t="";for(let i=0;i<e.length;i+=32768)t+=String.fromCharCode(...e.subarray(i,i+32768));return btoa(t)}function dj(e=globalThis.fetch.bind(globalThis)){async function t(n,i){const s=(i?.method??"GET").toUpperCase(),a=await e(n,{...i,cache:"no-store",credentials:"same-origin",headers:s!=="GET"&&s!=="HEAD"?{"content-type":"application/json","X-Ours-Messenger-CSRF":"1",...i?.headers}:i?.headers}),c=await a.text();let f=null;if(c)try{f=JSON.parse(c)}catch{throw new vs(a.status,a.ok?"Server returned an invalid response":`HTTP ${a.status}`)}if(!a.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 ${a.status}`;throw new vs(a.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,l)=>t("/api/messages/send",{method:"POST",signal:l,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,l,a,c)=>t("/api/commands/send",{method:"POST",signal:c,body:JSON.stringify({contact:n,recipient_cid:n,command:i,arguments:s,invocation_id:l,catalog_fingerprint:a,confirmed:!0})}),sendFile:async(n,i,s,l,a)=>t("/api/messages/send-file",{method:"POST",body:JSON.stringify({contact:n,data_base64:fj(new Uint8Array(await i.arrayBuffer())),filename:s,mime:l,...a?{reply_to_wire_id:a}:{}})}),files:n=>t(`/api/conversations/${encodeURIComponent(n)}/files`),fetchFiles:n=>t("/api/files/fetch",{method:"POST",body:JSON.stringify({wire_ids:n})}),mediaUrl:n=>`/api/media/${encodeURIComponent(n)}`,createInvite:(n="one_time",i)=>t("/api/invites",{method:"POST",body:JSON.stringify({mode:n,...i?{name:i}:{}})}),addContact:(n,i)=>t("/api/contacts/add",{method:"POST",body:JSON.stringify({invite:n,...i?{name:i}:{}})}),renameContact:(n,i)=>t("/api/contacts/rename",{method:"POST",body:JSON.stringify({contact:n,name:i})}),removeContact:n=>t("/api/contacts/remove",{method:"POST",body:JSON.stringify({contact:n})}),revokeInvite:n=>t("/api/invites/revoke",{method:"POST",body:JSON.stringify({invite_id:n})}),respondToIntroduction:(n,i)=>t("/api/contacts/introductions",{method:"POST",body:JSON.stringify({contact:n,action:i})}),vapidPublicKey:()=>t("/api/push/vapid-public-key"),ensurePush:n=>t("/api/push/subscriptions/ensure",{method:"POST",body:JSON.stringify(n)}),deletePush:n=>t("/api/push/subscriptions/delete",{method:"POST",body:JSON.stringify({binding_id:n})})}}const Xe=dj(),nd="ours-messenger-live-event";function k0(e){window.dispatchEvent(new CustomEvent(nd,{detail:e}))}function hj(e){const t=n=>{const i=n.detail;i?.v===1&&e(i)};return window.addEventListener(nd,t),()=>window.removeEventListener(nd,t)}function pj(e,t){const n=new EventSource("/api/events");let i=!1;t("connecting"),n.onopen=()=>{i=!0,t("live")},n.onerror=()=>t(i?"retrying":"connecting");const s=l=>{n.addEventListener(l,a=>{try{const c=JSON.parse(a.data);c&&c.v===1&&e({...c,type:l})}catch{}})};return s("sync_required"),s("message_received"),s("receipt_received"),s("file_received"),()=>n.close()}function mj(e=window.location){return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}/api/presence`}function gj(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 yj(e){let t=!1,n=null,i,s=1e3,l=0;const a=()=>{i!==void 0&&clearTimeout(i),i=void 0;const m=n;n=null,m&&m.readyState<WebSocket.CLOSING&&m.close(1e3,"hidden")},c=()=>{if(t||document.visibilityState!=="visible")return;e.onState?.("retrying");const m=s;s=Math.min(3e4,s*2),i=setTimeout(()=>{i=void 0,f()},m)},f=async()=>{if(a(),t||document.visibilityState!=="visible")return;const m=++l;e.onState?.("connecting");try{const[p,v]=await Promise.all([e.identity(),e.registration.pushManager.getSubscription()]);if(t||m!==l||document.visibilityState!=="visible")return;const w=v?.toJSON(),S=v?.endpoint,C=w?.keys?.auth;if(!S||!C)return;const E=new WebSocket(mj());n=E,E.onopen=()=>E.send(JSON.stringify({identity:p.cid,endpoint:S,auth:C})),E.onmessage=T=>{let A;try{A=JSON.parse(String(T.data))}catch{return}if(A?.ok===!0){s=1e3,e.onState?.("live");return}const j=gj(A);j&&e.onEvent(j)},E.onclose=()=>{n===E&&(n=null),m===l&&c()},E.onerror=()=>E.close()}catch{m===l&&c()}},h=()=>{l++,document.visibilityState==="visible"?(s=1e3,f()):a()};return document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",a),f(),()=>{t=!0,l++,document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",a),a()}}function vj(e,t){return t.visibility==="visible"&&t.appRoute==="chats"&&t.selectedContactCid===e&&(t.desktopLayout||t.mobileDetailOpen)&&!t.conversationCoveringDialogOpen}class xj{#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 rf(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 Nr(e){return e?`/chats/${encodeURIComponent(e)}`:"/chats"}function wj(e){return`/chats/${encodeURIComponent(e)}/contact`}function kj(e){return typeof e=="object"&&e!==null&&e.oursMessenger===!0?"back":"replace"}const rv={read:2,delivered:1};function iv(e){return e&&Object.hasOwn(rv,e)?rv[e]:0}function rd(e,t){return iv(t)>iv(e)?t:e}const Sj=()=>({contacts:[],pending:[]});function bj(e){return{identity:null,contacts:Sj(),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 si(e,t){return`${e}:${t}`}function Ir(e){return e.route.name==="chats"||e.route.name==="contact"?e.route.contactCid:null}function ar(e,t){return e.identity?e.pages[si(e.identity.cid,t)]??null:null}function Cj(e,t){const n=rd(e.receipt,t.receipt);return n===t.receipt?t:{...t,receipt:n}}function Vi(e,t){const n=[...e],i=new Map;n.forEach((s,l)=>{s.wire_id&&i.set(s.wire_id,l)});for(const s of t){const l=s.wire_id?i.get(s.wire_id):void 0;l===void 0?(s.wire_id&&i.set(s.wire_id,n.length),n.push(s)):n[l]=Cj(n[l],s)}return n}function ov(e,t){const n=Ir(e);return!n||t.contacts.some(i=>i.container_id===n)?{}:{route:{name:"chats",contactCid:null},mobileDetailOpen:!1}}function sv(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}:{},...ov(e,t.contacts)}}case"contacts":return{...e,contacts:t.contacts,...ov(e,t.contacts)};case"page":{if(!e.identity)return e;const n=si(e.identity.cid,t.contactCid),i=e.pages[n],s=e.pendingSends[n]??[],l=new Set(t.page.messages.map(v=>v.wire_id)),a=s.filter(v=>!l.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=rd(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:Vi(i.messages,f),hasMore:i.hasMore,nextBefore:i.nextBefore}:{...t.page,messages:f},m=Vi(h.messages,a),p={...h,messages:m,total:Math.max(h.total+a.length,m.length)};return{...e,pages:{...e.pages,[n]:p},pendingSends:{...e.pendingSends,[n]:a.length?a:void 0}}}case"sent_message":{if(!e.identity)return e;const n=si(e.identity.cid,t.contactCid),i=e.pages[n];if(i?.messages.some(a=>a.wire_id===t.message.wire_id))return e;const s=Vi(e.pendingSends[n]??[],[t.message]);if(!i)return{...e,pendingSends:{...e.pendingSends,[n]:s}};const l=Vi(i.messages,[t.message]);return{...e,pages:{...e.pages,[n]:{...i,messages:l,total:Math.max(i.total+1,l.length)}},pendingSends:{...e.pendingSends,[n]:s}}}case"receipt":{if(!e.identity)return e;const n=si(e.identity.cid,t.contactCid),i=e.pages[n],s=e.pendingSends[n],l=new Set(t.wireIds),a=h=>{let m=!1;const p=h.map(v=>{if(!v.wire_id||!l.has(v.wire_id))return v;const w=rd(v.receipt,t.kind);return w===v.receipt?v:(m=!0,{...v,receipt:w})});return m?p:h},c=i?a(i.messages):void 0,f=s?a(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=si(e.identity.cid,t.contactCid),i=e.pages[n];if(!i)return e;const s=Vi(Vi(t.page.messages,t.newer),i.messages),l={...t.page,preview:i.preview,total:Math.max(t.page.total,i.total,s.length),messages:s};return{...e,pages:{...e.pages,[n]:l}}}case"route":return{...e,route:t.route,mobileDetailOpen:t.mobileDetailOpen??(t.route.name==="chats"&&t.route.contactCid!==null||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,[si(e.identity.cid,t.contactCid)]:t.value}}:e;case"reply":return e.identity?{...e,replies:{...e.replies,[si(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 Ej(e,t,n){return!e||t?"ignore":n?"defer":"reload"}function Ns(){return{api:Xe,notification:globalThis.Notification,navigator}}function _r(e,t,n){return new Promise((i,s)=>{const l=setTimeout(()=>s(new Error(`${n} did not complete within ${t/1e3}s — try again`)),t);e.then(a=>{clearTimeout(l),i(a)},a=>{clearTimeout(l),s(a)})})}async function Tj(e,t={}){let n=null,i=!1,s=!1;const l="serviceWorker"in navigator&&window.isSecureContext,a=()=>e({supported:l,offline:!navigator.onLine,updateAvailable:i,registration:n}),c=()=>a(),f=()=>a(),h=()=>{document.visibilityState==="visible"&&n?.update().catch(()=>{})},m=w=>{if(w.data?.type==="ours-push-repair-required"){window.dispatchEvent(new Event("ours-push-repair-required"));return}if(w.data?.type==="ours-push-foreground"){const S=w.data.contact_id,C=w.data.wire_id,E=w.data.kind;typeof S=="string"&&typeof C=="string"&&k0({v:1,type:E==="file"?"file_received":"message_received",contact_id:S,wire_id:C,date:new Date().toISOString()})}},p=l&&!!navigator.serviceWorker.controller,v=()=>{const w=Ej(p,s,t.shouldDeferReload?.()??!1);if(w!=="ignore"){if(w==="defer"){i=!0,a();return}s=!0,(t.reload??(()=>location.reload()))()}};if(window.addEventListener("online",c),window.addEventListener("offline",f),document.addEventListener("visibilitychange",h),navigator.serviceWorker?.addEventListener("message",m),navigator.serviceWorker?.addEventListener("controllerchange",v),l){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,a())});w(n.installing),n.addEventListener("updatefound",()=>w(n?.installing??null)),n.update().catch(()=>{})}return a(),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",f),document.removeEventListener("visibilitychange",h),navigator.serviceWorker?.removeEventListener("message",m),navigator.serviceWorker?.removeEventListener("controllerchange",v)}}async function av(e,t=()=>location.reload(),n=navigator.serviceWorker){const i=e.waiting;if(!i){t();return}await _r(new Promise(s=>{let l=!1;const a=()=>{l||(l=!0,n.removeEventListener("controllerchange",a),t(),s())};n.addEventListener("controllerchange",a),i.postMessage({type:"SKIP_WAITING"})}),1e4,"service-worker update")}function Pj(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 Rj(e){return e?e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null}function lv(e,t){const n=Rj(e);return!!n&&n.length===t.length&&n.every((i,s)=>i===t[s])}function id(e=navigator.userAgent){return/iP(?:hone|ad|od)/.test(e)}function od(e=navigator,t=window){return id(e.userAgent)&&(e.standalone===!0||t.matchMedia("(display-mode: standalone)").matches)}function jj(){return id()&&!od()?"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"?id()?"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 Aj(e={}){const t=e.notification??Ns().notification;if(!t)return Promise.reject(new Error("notification permission is unavailable"));const n=new Promise((i,s)=>{let l=!1;const a=c=>{if(l)return;const f=c??t.permission;f!=="granted"&&f!=="denied"&&f!=="default"||(l=!0,i(f))};try{const c=t.requestPermission(a);c&&typeof c.then=="function"&&c.then(a,s)}catch(c){s(c)}});return _r(n,e.timeoutMs??15e3,"notification permission")}function S0(e,t){return!!e&&!!e.pushManager&&!!t.notification&&!!t.navigator.serviceWorker}function di(e,t={}){return{status:e,preview:"full",...t}}async function Nj(e,t,n){let i=await _r(e.pushManager.getSubscription(),5e3,"push subscription lookup");if((n||i?.options.applicationServerKey&&!lv(i.options.applicationServerKey,t))&&(i&&await _r(i.unsubscribe(),5e3,"stale push unsubscribe"),i=null),i&&lv(i.options.applicationServerKey,t))return i;try{return await _r(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push subscribe")}catch(s){const l=await e.pushManager.getSubscription();if(!l)throw s;return await _r(l.unsubscribe(),5e3,"stale push unsubscribe"),_r(e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t}),15e3,"push repair")}}async function b0(e,t,n,i){const s=await i.api.vapidPublicKey(),a=await _r(Promise.resolve(i.navigator.serviceWorker.ready),1e4,"service-worker readiness")??e,c=Pj(s.publicKey),h=(await Nj(a,c,n)).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys.auth)throw new Error("browser returned an incomplete push subscription");const m=await i.api.ensurePush({...h,label:i.navigator.userAgent.slice(0,160),...t===void 0?{}:{preview:t}});if(m.status!=="on"||m.fingerprint!==s.fingerprint||m.configEpoch!==s.configEpoch)throw new Error("server did not acknowledge the current Web Push configuration");return di("on",{bindingId:m.binding_id,fingerprint:m.fingerprint,configEpoch:m.configEpoch,preview:m.preview})}async function uv(e,t=Ns()){return S0(e,t)?t.notification.permission!=="granted"?di("needs-permission",{blocked:t.notification.permission==="denied"}):await e.pushManager.getSubscription()?b0(e,void 0,!1,t):di("off"):di("unsupported")}async function C0(e,t={},n=Ns()){if(!S0(e,n))return di("unsupported");const i=await Aj({notification:n.notification});return i!=="granted"?di("needs-permission",{blocked:i==="denied"}):b0(e,t.preview??"full",t.forceFresh??!1,n)}const Mj=(e,t,n=Ns())=>C0(e,{preview:t,forceFresh:!0},n);async function Ij(e,t,n=Ns()){const i=await e.pushManager.getSubscription(),s=[];if(t.bindingId)try{await n.api.deletePush(t.bindingId)}catch(l){s.push(l)}if(i)try{await i.unsubscribe()}catch(l){s.push(l)}if(s.length)throw new Error("notification disable did not fully converge — choose Repair and try again");return di("off",{preview:t.preview})}function Dj(e=15e3){if(!("serviceWorker"in navigator))return()=>{};let t;const n=()=>{const l={type:"ours-visibility",state:document.visibilityState,ts:Date.now(),iosStandalone:od()};navigator.serviceWorker.ready.then(a=>{(navigator.serviceWorker.controller??a.active)?.postMessage(l)}).catch(()=>{})},i=()=>{n(),t!==void 0&&clearInterval(t),t=document.visibilityState==="visible"?setInterval(n,e):void 0,document.visibilityState==="visible"&&E0()},s=l=>{l.data?.type!=="ours-visibility-query"||!l.ports?.[0]||l.ports[0].postMessage({type:"ours-visibility-reply",state:document.visibilityState,iosStandalone:od()})};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 E0(){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 _j=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),T0=(...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 Lj={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 Oj=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:a,...c},f)=>k.createElement("svg",{ref:f,...Lj,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:T0("lucide",s),...c},[...a.map(([h,m])=>k.createElement(h,m)),...Array.isArray(l)?l:[l]]));/**
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 Be=(e,t)=>{const n=k.forwardRef(({className:i,...s},l)=>k.createElement(Oj,{ref:l,iconNode:t,className:T0(`lucide-${_j(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 Fj=Be("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 zj=Be("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 Vj=Be("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 cv=Be("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 Bj=Be("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 $j=Be("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 Uj=Be("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 Wj=Be("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 Hj=Be("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 Kj=Be("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 qj=Be("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 Xj=Be("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 fv=Be("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 Yj=Be("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 Gj=Be("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 Qj=Be("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 Jj=Be("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 Zj=Be("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 eA=Be("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"}]]);/**
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 tA=Be("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"}]]);/**
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 nA=Be("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"}]]);/**
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 rA=Be("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
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 iA=Be("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"}]]);/**
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 oA=Be("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"}]]);/**
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 sA=Be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 aA=Be("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"}]]);/**
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 lA=Be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 uA=Be("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"}]]);/**
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 cA=Be("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"}]]);/**
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 fA=Be("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"}]]);/**
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 dA=Be("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"}]]);/**
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 hA=Be("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"}]]);/**
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 pA=Be("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"}]]);/**
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 mA=Be("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
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 gA=Be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),yA={app:Yj,back:Fj,bolt:zj,chat:tA,check:Bj,chevron:Uj,chevronDown:$j,close:gA,clusters:cv,copy:Kj,download:qj,edit:oA,inbox:Gj,link:Qj,lock:Jj,mic:nA,maximize:Zj,minus:rA,monitor:fv,monitorEye:fv,more:Xj,paperclip:iA,pause:Wj,play:Hj,plus:sA,refresh:aA,reply:eA,search:lA,send:uA,settings:cA,shield:fA,sliders:dA,trash:hA,user:mA,invite:pA,agent:Vj,network:cv};function ke(e){const{name:t,size:n=18,stroke:i=1.8,fill:s=!1,style:l,className:a}=e,c=yA[t];return c?y.jsx(c,{className:"ic "+(a||""),width:n,height:n,strokeWidth:i,fill:s?"currentColor":"none",style:l,"aria-hidden":"true"}):null}function P0(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 l=new Date(`${i}${t[9]}`);return Number.isNaN(l.getTime())?null:l.toISOString()}return s.toISOString()}function Al(e){const t=P0(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 vA(e){const t=P0(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 Qo="room",xA="room_",Nl="ours-cowork-room:",dv="ours-cowork:",hv="ours-cowork-",pv="cowork-room-",sd=/^[0-7][0-9a-hjkmnp-tv-z]{25}$/,wA=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,kA=25,SA=64,bA=80,mv=1e3,xs=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ht=e=>typeof e=="string"&&e.length>0;function CA(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!xs(i)||i.version!==1||!Ht(i.kind)||!i.kind.startsWith(xA)||!Ht(i.room_id)||t&&!Ht(i.signature)?null:i}function EA(e){const t=xs(e.author)?e.author:{};return{name:Ht(t.display_name)?t.display_name:"",role:Ht(t.role)?t.role:""}}function of(e){const n=Array.from(String(e)).slice(0,bA).join("").replace(/^room_/,"").split("_").filter(Boolean);return n.length===0?"Room notice":n.join(" ").replace(/^./,i=>i.toUpperCase())}function TA(e){if(!xs(e))return null;const t=Ht(e.kind)?e.kind:"",n=EA(e),i=typeof e.text=="string"?e.text:"",s=Number.isSafeInteger(e.briefing_version)&&e.briefing_version>0?e.briefing_version:null,l={roomName:R0(e.room_name)??"",authoredAt:Ht(e.at)?e.at:""};switch(t){case"room_msg":return n.role===Qo?Dr(t,"Room message",i||"Room notice",{...l,authoredBy:n.name}):{variant:"chat",kind:t,author:n.name||"Unknown member",role:n.role,label:"",text:i,...l};case"room_briefing":return Dr(t,s===null?"Room briefing":`Room briefing · v${s}`,i||"The room briefing was updated.",{...l,authoredBy:n.name,presentation:"briefing"});case"room_role_briefing":{const a=Ht(e.briefing_role)?e.briefing_role:"",c=["Role briefing",a,s===null?"":`v${s}`].filter(Boolean).join(" · ");return Dr(t,c,i||"Your role briefing was updated.",{...l,authoredBy:n.name,presentation:"role",details:a?[`Role: ${a}`]:[]})}case"room_membership":{const a=xs(e.membership)?e.membership:{},c=[Ht(a.action)?`Status: ${jA(a.action)}`:"",Ht(a.alias)?`Member: ${a.alias}`:"",Ht(a.role)?`Role: ${a.role}`:"",Number.isSafeInteger(a.epoch)&&a.epoch>=0?`Epoch: ${a.epoch}`:""].filter(Boolean);return Dr(t,"Membership",i||IA(a),{...l,authoredBy:n.name,presentation:"membership",details:c})}case"room_file":{const a=Ht(e.filename)?e.filename:"Shared file",c=[Ht(e.mime)?`Type: ${e.mime}`:"",Number.isSafeInteger(e.size)&&e.size>=0?`Size: ${AA(e.size)}`:"",Ht(e.sha256)?`SHA-256: ${NA(e.sha256)}`:""].filter(Boolean);return Dr(t,"Room file",a,{...l,authoredBy:n.name,role:n.role,presentation:"file",details:c})}case"room_not_member":return Dr(t,"Room access","You are no longer a member of this room.",{...l,presentation:"lifecycle",details:["Status: Removed"]});default:return i?{variant:n.role&&n.role!==Qo?"chat":"system",kind:t,author:n.role&&n.role!==Qo?n.name||"Unknown member":"",role:n.role&&n.role!==Qo?n.role:"",label:n.role&&n.role!==Qo?"":of(t),text:MA(i),...l}:Dr(t,of(t),`${of(t)} from the room.`,l)}}function PA(e,t){if(!RA(e))return null;const n=yh(e)?.roomId??null,i=mh(e),s=gh(e),l=CA(t,n===null&&s===null);return l!==null&&n!==null&&l.room_id!==n||l!==null&&i!==null&&l.room_id!==i?gv("Room provenance mismatch"):TA(l)}function R0(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<=SA?t:null}function mh(e){if(typeof e!="string"||!e.startsWith(pv))return null;const t=e.slice(pv.length);return sd.test(t)?t:null}function gh(e){return typeof e!="string"||!e.startsWith(dv)?null:R0(e.slice(dv.length))}function yh(e){if(typeof e!="string"||!e.startsWith(hv))return null;const t=e.slice(hv.length);if(sd.test(t))return{roomId:t,slug:null};const n=t.slice(-26),i=t.at(-27),s=t.slice(0,-27);return i!=="-"||!sd.test(n)||s.length<1||s.length>kA?null:wA.test(s)?{roomId:n,slug:s}:null}function RA(e){const t=String(e??"").trim();return t.startsWith(Nl)&&t.slice(Nl.length).trim().length>0||gh(e)!==null||yh(e)!==null||mh(e)!==null}function Dr(e,t,n,i={}){return{variant:"system",kind:e,author:"",role:"",label:t,text:n,...i}}function jA(e){return String(e).replace(/_/g," ").replace(/^./,t=>t.toUpperCase())}function AA(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function NA(e){const t=String(e);return t.length<=20?t:`${t.slice(0,12)}…${t.slice(-6)}`}function MA(e){const t=Array.from(String(e));return t.length<=mv?t.join(""):`${t.slice(0,mv).join("")}…`}function gv(e){return Dr("room_invalid","Room notice","This room envelope could not be displayed safely.",{presentation:"lifecycle",details:[`Status: ${e}`]})}function IA(e){if(!xs(e))return"The room membership changed.";const t=Ht(e.alias)?e.alias:"A member";return e.action==="remove"?`${t} left the room.`:"The room membership changed."}function DA(e){if(!e)return"";const t=e.variant==="chat"?e.author:e.label,n=_A(e.text);return t?n?`${t} · ${n}`:t:n}function _A(e){return String(e??"").replace(/\s+/g," ").trim()}function LA(e){const t=String(e??"").trim();if(t.startsWith(Nl))return t.slice(Nl.length).trim()||null;const n=gh(e);if(n!==null)return n;const i=yh(e);if(i?.slug)return i.slug.replace(/-/g," ").replace(/[a-z]/,a=>a.toUpperCase());if(i)return`Room ${i.roomId.slice(0,8)}`;const s=mh(e);return s===null?null:`Room ${s.slice(0,8)}`}const vh=vA;function ad(e){const t=e.trim().split(/\s+/).filter(Boolean);if(!t.length)return"?";const n=i=>Array.from(i).find(s=>/[\p{L}\p{N}]/u.test(s))??Array.from(i)[0]??"";if(t.length===1){const i=Array.from(t[0]),s=i.filter(l=>/[\p{L}\p{N}]/u.test(l));return(s.length?s.slice(0,2).join(""):i[0]??"?").toUpperCase()}return(n(t[0])+n(t.at(-1)??"")).toUpperCase()}function OA(e){const t=vh(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 hi(e){const t=vh(e);return t?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function FA(e){const t=vh(e);return t?t.toLocaleString():e}function j0(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}function zA(e){return/^[0-9A-Fa-f]{40,}$/.test(e.trim())}function VA(e,t,n){const i=(e??"").trim(),s=LA(i);return s||(i&&!zA(i)?i:i?j0(i):"Unnamed")}function Ml(e){return e.display_name?.trim()||VA(e.name)}const BA="x-ours-kind=voice-message",A0="voice-message-",rs=20*1024*1024;let ws=null,ld=[];const xh=new Map;function $A(e){ws=e;for(const t of ld)t(e);ld=[]}function yv(e){for(const t of e)xh.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 UA(){xh.clear()}function N0(e){return xh.get(e)??null}function WA(e){return ws?.url(e)??null}function HA(e){return`${e}; ${BA}`}function no(e,t){return/x-ours-kind\s*=\s*voice-message/i.test(e)||t.toLowerCase().startsWith(A0)&&e.toLowerCase().startsWith("audio/")}function KA(e,t){const n=e??"file",i=t??"";return no(i,n)?"🎤 Voice message":i.toLowerCase().startsWith("image/")?"🖼 Photo":`📎 ${n}`}async function Kl(e){return(ws??await new Promise(n=>ld.push(n))).bytes(e)}async function qA(e){if(!ws)throw new Error("Media provider is not ready");await ws.fetch(e)}function Vr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function XA(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 ud({receipt:e,content:t="Message",receiptless:n=!1}){const i=XA(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 vv(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 Kt=Ur(/[A-Za-z]/),Vt=Ur(/[\dA-Za-z]/),YA=Ur(/[#-'*+\--9=?A-Z^-~]/);function Il(e){return e!==null&&(e<32||e===127)}const cd=Ur(/\d/),GA=Ur(/[\dA-Fa-f]/),QA=Ur(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function et(e){return e!==null&&(e<0||e===32)}function Ve(e){return e===-2||e===-1||e===32}const ql=Ur(/\p{P}|\p{S}/u),mi=Ur(/\s/);function Ur(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function JA(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Xl=function(e){if(e==null)return nN;if(typeof e=="function")return Yl(e);if(typeof e=="object")return Array.isArray(e)?ZA(e):eN(e);if(typeof e=="string")return tN(e);throw new Error("Expected function, string, or object as test")};function ZA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xl(e[n]);return Yl(i);function i(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function eN(e){const t=e;return Yl(n);function n(i){const s=i;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function tN(e){return Yl(t);function t(n){return n&&n.type===e}}function Yl(e){return t;function t(n,i,s){return!!(rN(n)&&e.call(this,n,typeof i=="number"?i:void 0,s||void 0))}}function nN(){return!0}function rN(e){return e!==null&&typeof e=="object"&&"type"in e}const M0=[],iN=!0,fd=!1,oN="skip";function I0(e,t,n,i){let s;typeof t=="function"&&typeof n!="function"?(i=n,n=t):s=t;const l=Xl(s),a=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=M0,S,C,E;if((!t||l(f,h,m[m.length-1]||void 0))&&(w=sN(n(f,m)),w[0]===fd))return w;if("children"in f&&f.children){const T=f;if(T.children&&w[0]!==oN)for(C=(i?T.children.length:-1)+a,E=m.concat(T);C>-1&&C<T.children.length;){const A=T.children[C];if(S=c(A,C,E)(),S[0]===fd)return S;C=typeof S[1]=="number"?S[1]:C+a}}return w}}}function sN(e){return Array.isArray(e)?e:typeof e=="number"?[iN,e]:e==null?M0:[e]}function aN(e,t,n){const s=Xl((n||{}).ignore||[]),l=lN(t);let a=-1;for(;++a<l.length;)I0(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=l[a][0],w=l[a][1];let S=0;const E=p.children.indexOf(h);let T=!1,A=[];v.lastIndex=0;let j=v.exec(h.value);for(;j;){const R=j.index,V={index:j.index,input:j.input,stack:[...m,h]};let D=w(...j,V);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=R+1:(S!==R&&A.push({type:"text",value:h.value.slice(S,R)}),Array.isArray(D)?A.push(...D):D&&A.push(D),S=R+j[0].length,T=!0),!v.global)break;j=v.exec(h.value)}return T?(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 lN(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([uN(s[0]),cN(s[1])])}return t}function uN(e){return typeof e=="string"?new RegExp(JA(e),"g"):e}function cN(e){return typeof e=="function"?e:function(){return e}}const sf="phrasing",af=["autolink","link","image","label"];function fN(){return{transforms:[vN],enter:{literalAutolink:hN,literalAutolinkEmail:lf,literalAutolinkHttp:lf,literalAutolinkWww:lf},exit:{literalAutolink:yN,literalAutolinkEmail:gN,literalAutolinkHttp:pN,literalAutolinkWww:mN}}}function dN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sf,notInConstruct:af},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sf,notInConstruct:af},{character:":",before:"[ps]",after:"\\/",inConstruct:sf,notInConstruct:af}]}}function hN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function lf(e){this.config.enter.autolinkProtocol.call(this,e)}function pN(e){this.config.exit.autolinkProtocol.call(this,e)}function mN(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 gN(e){this.config.exit.autolinkEmail.call(this,e)}function yN(e){this.exit(e)}function vN(e){aN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xN],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,wN]],{ignore:["link","linkReference"]})}function xN(e,t,n,i,s){let l="";if(!D0(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!kN(n)))return!1;const a=SN(n+i);if(!a[0])return!1;const c={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[c,{type:"text",value:a[1]}]:c}function wN(e,t,n,i){return!D0(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function kN(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 SN(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=vv(e,"(");let l=vv(e,")");for(;i!==-1&&s>l;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),l++;return[e,n]}function D0(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||mi(n)||ql(n))&&(!t||n!==47)}function Ln(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}_0.peek=NN;function bN(){this.buffer()}function CN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function EN(){this.buffer()}function TN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function PN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ln(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RN(e){this.exit(e)}function jN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ln(this.sliceSerialize(e)).toLowerCase(),n.label=t}function AN(e){this.exit(e)}function NN(){return"["}function _0(e,t,n,i){const s=n.createTracker(i);let l=s.move("[^");const a=n.enter("footnoteReference"),c=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),a(),l+=s.move("]"),l}function MN(){return{enter:{gfmFootnoteCallString:bN,gfmFootnoteCall:CN,gfmFootnoteDefinitionLabelString:EN,gfmFootnoteDefinition:TN},exit:{gfmFootnoteCallString:PN,gfmFootnoteCall:RN,gfmFootnoteDefinitionLabelString:jN,gfmFootnoteDefinition:AN}}}function IN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,s,l,a){const c=l.createTracker(a);let f=c.move("[^");const h=l.enter("footnoteDefinition"),m=l.enter("label");return f+=c.move(l.safe(l.associationId(i),{before:f,after:"]"})),m(),f+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),f+=c.move((t?`
244
+ `:" ")+l.indentLines(l.containerFlow(i,c.current()),t?L0:DN))),h(),f}}function DN(e,t,n){return t===0?e:L0(e,t,n)}function L0(e,t,n){return(n?"":" ")+e}const _N=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];O0.peek=VN;function LN(){return{canContainEols:["delete"],enter:{strikethrough:FN},exit:{strikethrough:zN}}}function ON(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_N}],handlers:{delete:O0}}}function FN(e){this.enter({type:"delete",children:[]},e)}function zN(e){this.exit(e)}function O0(e,t,n,i){const s=n.createTracker(i),l=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),l(),a}function VN(){return"~"}function BN(e){return e.length}function $N(e,t){const n=t||{},i=(n.align||[]).concat(),s=n.stringLength||BN,l=[],a=[],c=[],f=[];let h=0,m=-1;for(;++m<e.length;){const C=[],E=[];let T=-1;for(e[m].length>h&&(h=e[m].length);++T<e[m].length;){const A=UN(e[m][T]);if(n.alignDelimiters!==!1){const j=s(A);E[T]=j,(f[T]===void 0||j>f[T])&&(f[T]=j)}C.push(A)}a[m]=C,c[m]=E}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<h;)l[p]=xv(i[p]);else{const C=xv(i);for(;++p<h;)l[p]=C}p=-1;const v=[],w=[];for(;++p<h;){const C=l[p];let E="",T="";C===99?(E=":",T=":"):C===108?E=":":C===114&&(T=":");let A=n.alignDelimiters===!1?1:Math.max(1,f[p]-E.length-T.length);const j=E+"-".repeat(A)+T;n.alignDelimiters!==!1&&(A=E.length+A+T.length,A>f[p]&&(f[p]=A),w[p]=A),v[p]=j}a.splice(1,0,v),c.splice(1,0,w),m=-1;const S=[];for(;++m<a.length;){const C=a[m],E=c[m];p=-1;const T=[];for(;++p<h;){const A=C[p]||"";let j="",R="";if(n.alignDelimiters!==!1){const V=f[p]-(E[p]||0),D=l[p];D===114?j=" ".repeat(V):D===99?V%2?(j=" ".repeat(V/2+.5),R=" ".repeat(V/2-.5)):(j=" ".repeat(V/2),R=j):R=" ".repeat(V)}n.delimiterStart!==!1&&!p&&T.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&T.push(" "),n.alignDelimiters!==!1&&T.push(j),T.push(A),n.alignDelimiters!==!1&&T.push(R),n.padding!==!1&&T.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&T.push("|")}S.push(n.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return S.join(`
245
+ `)}function UN(e){return e==null?"":String(e)}function xv(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 WN(e,t,n,i){const s=n.enter("blockquote"),l=n.createTracker(i);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),HN);return s(),a}function HN(e,t,n){return">"+(n?"":" ")+e}function KN(e,t){return wv(e,t.inConstruct,!0)&&!wv(e,t.notInConstruct,!1)}function wv(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 kv(e,t,n,i){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
246
+ `&&KN(n.stack,n.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
247
+ `}function qN(e,t){const n=String(e);let i=n.indexOf(t),s=i,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++l>a&&(a=l):l=1,s=i+t.length,i=n.indexOf(t,s);return a}function XN(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 YN(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 GN(e,t,n,i){const s=YN(n),l=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(XN(e,n)){const p=n.enter("codeIndented"),v=n.indentLines(l,QN);return p(),v}const c=n.createTracker(i),f=s.repeat(Math.max(qN(l,s)+1,3)),h=n.enter("codeFenced");let m=c.move(f);if(e.lang){const p=n.enter(`codeFencedLang${a}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${a}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
248
+ `,encode:["`"],...c.current()})),p()}return m+=c.move(`
249
+ `),l&&(m+=c.move(l+`
250
+ `)),m+=c.move(f),h(),m}function QN(e,t,n){return(n?"":" ")+e}function wh(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 JN(e,t,n,i){const s=wh(n),l=s==='"'?"Quote":"Apostrophe",a=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?" ":`
251
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),c()),a(),h}function ZN(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 ks(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ro(e){if(e===null||et(e)||mi(e))return 1;if(ql(e))return 2}function Dl(e,t,n){const i=ro(e),s=ro(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}}F0.peek=eM;function F0(e,t,n,i){const s=ZN(n),l=n.enter("emphasis"),a=n.createTracker(i),c=a.move(s);let f=a.move(n.containerPhrasing(e,{after:s,before:c,...a.current()}));const h=f.charCodeAt(0),m=Dl(i.before.charCodeAt(i.before.length-1),h,s);m.inside&&(f=ks(h)+f.slice(1));const p=f.charCodeAt(f.length-1),v=Dl(i.after.charCodeAt(0),p,s);v.inside&&(f=f.slice(0,-1)+ks(p));const w=a.move(s);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+f+w}function eM(e,t,n){return n.options.emphasis||"*"}function kh(e,t,n,i){let s,l,a;typeof t=="function"&&typeof n!="function"?(l=void 0,a=t,s=n):(l=t,a=n,s=i),I0(e,l,c,s);function c(f,h){const m=h[h.length-1],p=m?m.children.indexOf(f):void 0;return a(f,p,m)}}const tM={};function Sh(e,t){const n=tM,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return z0(e,i,s)}function z0(e,t,n){if(nM(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 Sv(e.children,t,n)}return Array.isArray(e)?Sv(e,t,n):""}function Sv(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=z0(e[s],t,n);return i.join("")}function nM(e){return!!(e&&typeof e=="object")}function rM(e,t){let n=!1;return kh(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,fd}),!!((!e.depth||e.depth<3)&&Sh(e)&&(t.options.setext||n))}function iM(e,t,n,i){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(i);if(rM(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),v=n.containerPhrasing(e,{...l.current(),before:`
252
+ `,after:`
253
+ `});return p(),m(),v+`
254
+ `+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
255
+ `))+1))}const a="#".repeat(s),c=n.enter("headingAtx"),f=n.enter("phrasing");l.move(a+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
256
+ `,...l.current()});return/^[\t ]/.test(h)&&(h=ks(h.charCodeAt(0))+h.slice(1)),h=h?a+" "+h:a,n.options.closeAtx&&(h+=" "+a),f(),c(),h}V0.peek=oM;function V0(e){return e.value||""}function oM(){return"<"}B0.peek=sM;function B0(e,t,n,i){const s=wh(n),l=s==='"'?"Quote":"Apostrophe",a=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${l}`),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(")"),a(),h}function sM(){return"!"}$0.peek=aM;function $0(e,t,n,i){const s=e.referenceType,l=n.enter("imageReference");let a=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+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return a(),n.stack=m,l(),s==="full"||!h||h!==p?f+=c.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function aM(){return"!"}U0.peek=lM;function U0(e,t,n){let i=e.value||"",s="`",l=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++l<n.unsafe.length;){const a=n.unsafe[l],c=n.compilePattern(a);let f;if(a.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 lM(){return"`"}function W0(e,t){const n=Sh(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))}H0.peek=uM;function H0(e,t,n,i){const s=wh(n),l=s==='"'?"Quote":"Apostrophe",a=n.createTracker(i);let c,f;if(W0(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(e,{before:p,after:">",...a.current()})),p+=a.move(">"),c(),n.stack=m,p}c=n.enter("link"),f=n.enter("label");let h=a.move("[");return h+=a.move(n.containerPhrasing(e,{before:h,after:"](",...a.current()})),h+=a.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=a.move("<"),h+=a.move(n.safe(e.url,{before:h,after:">",...a.current()})),h+=a.move(">")):(f=n.enter("destinationRaw"),h+=a.move(n.safe(e.url,{before:h,after:e.title?" ":")",...a.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=a.move(" "+s),h+=a.move(n.safe(e.title,{before:h,after:s,...a.current()})),h+=a.move(s),f()),h+=a.move(")"),c(),h}function uM(e,t,n){return W0(e,n)?"<":"["}K0.peek=cM;function K0(e,t,n,i){const s=e.referenceType,l=n.enter("linkReference");let a=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+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return a(),n.stack=m,l(),s==="full"||!h||h!==p?f+=c.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function cM(){return"["}function bh(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 fM(e){const t=bh(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 dM(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 q0(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 hM(e,t,n,i){const s=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?dM(n):bh(n);const c=e.ordered?a==="."?")":".":fM(n);let f=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),q0(n)===a&&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&&(a=c),n.bulletCurrent=a;const h=n.containerFlow(e,i);return n.bulletLastUsed=a,n.bulletCurrent=l,s(),h}function pM(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 mM(e,t,n,i){const s=pM(n);let l=n.bulletCurrent||bh(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const c=n.createTracker(i);c.move(l+" ".repeat(a-l.length)),c.shift(a);const 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(a))+p:(w?l:l+" ".repeat(a-l.length))+p}}function gM(e,t,n,i){const s=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,i);return l(),s(),a}const yM=Xl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vM(e,t,n,i){return(e.children.some(function(a){return yM(a)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function xM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}X0.peek=wM;function X0(e,t,n,i){const s=xM(n),l=n.enter("strong"),a=n.createTracker(i),c=a.move(s+s);let f=a.move(n.containerPhrasing(e,{after:s,before:c,...a.current()}));const h=f.charCodeAt(0),m=Dl(i.before.charCodeAt(i.before.length-1),h,s);m.inside&&(f=ks(h)+f.slice(1));const p=f.charCodeAt(f.length-1),v=Dl(i.after.charCodeAt(0),p,s);v.inside&&(f=f.slice(0,-1)+ks(p));const w=a.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:m.outside},c+f+w}function wM(e,t,n){return n.options.strong||"*"}function kM(e,t,n,i){return n.safe(e.value,i)}function SM(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 bM(e,t,n){const i=(q0(n)+(n.options.ruleSpaces?" ":"")).repeat(SM(n));return n.options.ruleSpaces?i.slice(0,-1):i}const Y0={blockquote:WN,break:kv,code:GN,definition:JN,emphasis:F0,hardBreak:kv,heading:iM,html:V0,image:B0,imageReference:$0,inlineCode:U0,link:H0,linkReference:K0,list:hM,listItem:mM,paragraph:gM,root:vM,strong:X0,text:kM,thematicBreak:bM},bv=document.createElement("i");function Ch(e){const t="&"+e+";";bv.innerHTML=t;const n=bv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function G0(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 CM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function EM(e){return e.replace(CM,TM)}function TM(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return G0(n.slice(l?2:1),l?16:10)}return Ch(n)||e}function PM(){return{enter:{table:RM,tableData:Cv,tableHeader:Cv,tableRow:AM},exit:{codeText:NM,table:jM,tableData:uf,tableHeader:uf,tableRow:uf}}}function RM(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 jM(e){this.exit(e),this.data.inTable=void 0}function AM(e){this.enter({type:"tableRow",children:[]},e)}function uf(e){this.exit(e)}function Cv(e){this.enter({type:"tableCell",children:[]},e)}function NM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,MM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function MM(e,t){return t==="|"?t:e}function IM(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
257
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:a,tableCell:f,tableRow:c}};function a(w,S,C,E){return h(m(w,C,E),w.align)}function c(w,S,C,E){const T=p(w,C,E),A=h([T]);return A.slice(0,A.indexOf(`
258
+ `))}function f(w,S,C,E){const T=C.enter("tableCell"),A=C.enter("phrasing"),j=C.containerPhrasing(w,{...E,before:l,after:l});return A(),T(),j}function h(w,S){return $N(w,{align:S,alignDelimiters:i,padding:n,stringLength:s})}function m(w,S,C){const E=w.children;let T=-1;const A=[],j=S.enter("table");for(;++T<E.length;)A[T]=p(E[T],S,C);return j(),A}function p(w,S,C){const E=w.children;let T=-1;const A=[],j=S.enter("tableRow");for(;++T<E.length;)A[T]=f(E[T],w,S,C);return j(),A}function v(w,S,C){let E=Y0.inlineCode(w,S,C);return C.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function DM(){return{exit:{taskListCheckValueChecked:Ev,taskListCheckValueUnchecked:Ev,paragraph:LM}}}function _M(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:OM}}}function Ev(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function LM(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const s=t.children;let l=-1,a;for(;++l<s.length;){const c=s[l];if(c.type==="paragraph"){a=c;break}}a===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function OM(e,t,n,i){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);l&&c.move(a);let f=Y0.listItem(e,t,n,{...i,...c.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(m){return m+a}}function Q0(){return[fN(),MN(),LN(),PM(),DM()]}function FM(e){return{extensions:[dN(),IN(e),ON(),IM(e),_M()]}}function dn(e,t,n,i){const s=e.length;let l=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)a=Array.from(i),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<i.length;)a=i.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function wn(e,t){return e.length>0?(dn(e,e.length,0,t),e):t}const Tv={}.hasOwnProperty;function J0(e){const t={};let n=-1;for(;++n<e.length;)zM(t,e[n]);return t}function zM(e,t){let n;for(n in t){const s=(Tv.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Tv.call(s,a)||(s[a]=[]);const c=l[a];VM(s[a],Array.isArray(c)?c:c?[c]:[])}}}function VM(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);dn(e,0,0,i)}function lo(e){const t=[];let n=-1,i=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&Vt(e.charCodeAt(n+1))&&Vt(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(a=String.fromCharCode(l,c),s=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(i,n),encodeURIComponent(a)),i=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(i)}function Ue(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(f){return Ve(f)?(e.enter(n),c(f)):t(f)}function c(f){return Ve(f)&&l++<s?(e.consume(f),c):(e.exit(n),t(f))}}const BM={tokenize:$M};function $M(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"),Ue(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),l(c)}function l(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ae(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),a)}}const UM={tokenize:WM},Pv={tokenize:HM};function WM(e){const t=this,n=[];let i=0,s,l,a;return c;function c(j){if(i<n.length){const R=n[i];return t.containerState=R[1],e.attempt(R[0].continuation,f,h)(j)}return h(j)}function f(j){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const R=t.events.length;let V=R,D;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){D=t.events[V][1].end;break}T(i);let G=R;for(;G<t.events.length;)t.events[G][1].end={...D},G++;return dn(t.events,V+1,0,t.events.slice(R)),t.events.length=G,h(j)}return c(j)}function h(j){if(i===n.length){if(!s)return v(j);if(s.currentConstruct&&s.currentConstruct.concrete)return S(j);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Pv,m,p)(j)}function m(j){return s&&A(),T(i),v(j)}function p(j){return t.parser.lazy[t.now().line]=i!==n.length,a=t.now().offset,S(j)}function v(j){return t.containerState={},e.attempt(Pv,w,S)(j)}function w(j){return i++,n.push([t.currentConstruct,t.containerState]),v(j)}function S(j){if(j===null){s&&A(),T(0),e.consume(j);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),C(j)}function C(j){if(j===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(j);return}return Ae(j)?(e.consume(j),E(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(j),C)}function E(j,R){const V=t.sliceStream(j);if(R&&V.push(null),j.previous=l,l&&(l.next=j),l=j,s.defineSkip(j.start),s.write(V),t.parser.lazy[j.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<a&&(!s.events[D][1].end||s.events[D][1].end.offset>a))return;const G=t.events.length;let $=G,_,P;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(_){P=t.events[$][1].end;break}_=!0}for(T(i),D=G;D<t.events.length;)t.events[D][1].end={...P},D++;dn(t.events,$+1,0,t.events.slice(G)),t.events.length=D}}function T(j){let R=n.length;for(;R-- >j;){const V=n[R];t.containerState=V[1],V[0].exit.call(t,e)}n.length=j}function A(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function HM(e,t,n){return Ue(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gl(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!i.includes(l)&&(t=l(t,n),i.push(l))}return t}const dd={name:"attention",resolveAll:KM,tokenize:qM};function KM(e,t){let n=-1,i,s,l,a,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};Rv(p,-f),Rv(v,f),a={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},l={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[i][1].end={...a.start},e[n][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=wn(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=wn(h,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",l,t]]),h=wn(h,Gl(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=wn(h,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=wn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,dn(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 qM(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=ro(i);let l;return a;function a(f){return l=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===l)return e.consume(f),c;const h=e.exit("attentionSequence"),m=ro(f),p=!m||m===2&&s||n.includes(f),v=!s||s===2&&m||n.includes(i);return h._open=!!(l===42?p:p&&(s||!v)),h._close=!!(l===42?v:v&&(m||!p)),t(f)}}function Rv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const XM={name:"autolink",tokenize:YM};function YM(e,t,n){let i=0;return s;function s(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(w){return Kt(w)?(e.consume(w),a):w===64?n(w):h(w)}function a(w){return w===43||w===45||w===46||Vt(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||Vt(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||Il(w)?n(w):(e.consume(w),f)}function h(w){return w===64?(e.consume(w),m):YA(w)?(e.consume(w),h):n(w)}function m(w){return Vt(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||Vt(w))&&i++<63){const S=w===45?v:p;return e.consume(w),S}return n(w)}}const Ms={partial:!0,tokenize:GM};function GM(e,t,n){return i;function i(l){return Ve(l)?Ue(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Ae(l)?t(l):n(l)}}const Z0={continuation:{tokenize:JM},exit:ZM,name:"blockQuote",tokenize:QM};function QM(e,t,n){const i=this;return s;function s(a){if(a===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return Ve(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function JM(e,t,n){const i=this;return s;function s(a){return Ve(a)?Ue(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(Z0,t,n)(a)}}function ZM(e){e.exit("blockQuote")}const e1={name:"characterEscape",tokenize:e2};function e2(e,t,n){return i;function i(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return QA(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const t1={name:"characterReference",tokenize:t2};function t2(e,t,n){const i=this;let s=0,l,a;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,a=Vt,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=GA,m):(e.enter("characterReferenceValue"),l=7,a=cd,m(p))}function m(p){if(p===59&&s){const v=e.exit("characterReferenceValue");return a===Vt&&!Ch(i.sliceSerialize(v))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(p)&&s++<l?(e.consume(p),m):n(p)}}const jv={partial:!0,tokenize:r2},Av={concrete:!0,name:"codeFenced",tokenize:n2};function n2(e,t,n){const i=this,s={partial:!0,tokenize:V};let l=0,a=0,c;return f;function f(D){return h(D)}function h(D){const G=i.events[i.events.length-1];return l=G&&G[1].type==="linePrefix"?G[2].sliceSerialize(G[1],!0).length:0,c=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(D)}function m(D){return D===c?(a++,e.consume(D),m):a<3?n(D):(e.exit("codeFencedFenceSequence"),Ve(D)?Ue(e,p,"whitespace")(D):p(D))}function p(D){return D===null||Ae(D)?(e.exit("codeFencedFence"),i.interrupt?t(D):e.check(jv,C,R)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Ae(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):Ve(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ue(e,w,"whitespace")(D)):D===96&&D===c?n(D):(e.consume(D),v)}function w(D){return D===null||Ae(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||Ae(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===c?n(D):(e.consume(D),S)}function C(D){return e.attempt(s,R,E)(D)}function E(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),T}function T(D){return l>0&&Ve(D)?Ue(e,A,"linePrefix",l+1)(D):A(D)}function A(D){return D===null||Ae(D)?e.check(jv,C,R)(D):(e.enter("codeFlowValue"),j(D))}function j(D){return D===null||Ae(D)?(e.exit("codeFlowValue"),A(D)):(e.consume(D),j)}function R(D){return e.exit("codeFenced"),t(D)}function V(D,G,$){let _=0;return P;function P(ee){return D.enter("lineEnding"),D.consume(ee),D.exit("lineEnding"),K}function K(ee){return D.enter("codeFencedFence"),Ve(ee)?Ue(D,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):F(ee)}function F(ee){return ee===c?(D.enter("codeFencedFenceSequence"),ie(ee)):$(ee)}function ie(ee){return ee===c?(_++,D.consume(ee),ie):_>=a?(D.exit("codeFencedFenceSequence"),Ve(ee)?Ue(D,Z,"whitespace")(ee):Z(ee)):$(ee)}function Z(ee){return ee===null||Ae(ee)?(D.exit("codeFencedFence"),G(ee)):$(ee)}}}function r2(e,t,n){const i=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}const cf={name:"codeIndented",tokenize:o2},i2={partial:!0,tokenize:s2};function o2(e,t,n){const i=this;return s;function s(h){return e.enter("codeIndented"),Ue(e,l,"linePrefix",5)(h)}function l(h){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(h):n(h)}function a(h){return h===null?f(h):Ae(h)?e.attempt(i2,a,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Ae(h)?(e.exit("codeFlowValue"),a(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function s2(e,t,n){const i=this;return s;function s(a){return i.parser.lazy[i.now().line]?n(a):Ae(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Ue(e,l,"linePrefix",5)(a)}function l(a){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):Ae(a)?s(a):n(a)}}const a2={name:"codeText",previous:u2,resolve:l2,tokenize:c2};function l2(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 u2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function c2(e,t,n){let i=0,s,l;return a;function a(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),i++,c):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(l=e.enter("codeTextSequence"),s=0,m(p)):Ae(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||Ae(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)):(l.type="codeTextData",h(p))}}class f2{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&Jo(this.left,i),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Jo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jo(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);Jo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jo(this.left,n.reverse())}}}function Jo(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 n1(e){const t={};let n=-1,i,s,l,a,c,f,h;const m=new f2(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,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,d2(m,n)),n=t[n],h=!0);else if(i[1]._container){for(l=n,s=void 0;l--;)if(a=m.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(i[1].end={...m.get(s)[1].start},c=m.slice(s,n),c.unshift(i),m.splice(s,n-s+1,c))}}return dn(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function d2(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const l=[];let a=n._tokenizer;a||(a=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,f=[],h={};let m,p,v=-1,w=n,S=0,C=0;const E=[C];for(;w;){for(;e.get(++s)[1]!==w;);l.push(s),w._tokenizer||(m=i.sliceStream(w),w.next||m.push(null),p&&a.defineSkip(w.start),w._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),w._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),p=w,w=w.next}for(w=n;++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(a.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),v=E.length;v--;){const T=c.slice(E[v],E[v+1]),A=l.pop();f.push([A,A+T.length-1]),e.splice(A,2,T)}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 h2={resolve:m2,tokenize:g2},p2={partial:!0,tokenize:y2};function m2(e){return n1(e),e}function g2(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?l(c):Ae(c)?e.check(p2,a,l)(c):(e.consume(c),s)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function y2(e,t,n){const i=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ue(e,l,"linePrefix")}function l(a){if(a===null||Ae(a))return n(a);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(i.parser.constructs.flow,n,t)(a)}}function r1(e,t,n,i,s,l,a,c,f){const h=f||Number.POSITIVE_INFINITY;let m=0;return p;function p(T){return T===60?(e.enter(i),e.enter(s),e.enter(l),e.consume(T),e.exit(l),v):T===null||T===32||T===41||Il(T)?n(T):(e.enter(i),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(T))}function v(T){return T===62?(e.enter(l),e.consume(T),e.exit(l),e.exit(s),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),w(T))}function w(T){return T===62?(e.exit("chunkString"),e.exit(c),v(T)):T===null||T===60||Ae(T)?n(T):(e.consume(T),T===92?S:w)}function S(T){return T===60||T===62||T===92?(e.consume(T),w):w(T)}function C(T){return!m&&(T===null||T===41||et(T))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(i),t(T)):m<h&&T===40?(e.consume(T),m++,C):T===41?(e.consume(T),m--,C):T===null||T===32||T===40||Il(T)?n(T):(e.consume(T),T===92?E:C)}function E(T){return T===40||T===41||T===92?(e.consume(T),C):C(T)}}function i1(e,t,n,i,s,l){const a=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(l),m}function m(w){return c>999||w===null||w===91||w===93&&!f||w===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(w):w===93?(e.exit(l),e.enter(s),e.consume(w),e.exit(s),e.exit(i),t):Ae(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||Ae(w)||c++>999?(e.exit("chunkString"),m(w)):(e.consume(w),f||(f=!Ve(w)),w===92?v:p)}function v(w){return w===91||w===92||w===93?(e.consume(w),c++,p):p(w)}}function o1(e,t,n,i,s,l){let a;return c;function c(v){return v===34||v===39||v===40?(e.enter(i),e.enter(s),e.consume(v),e.exit(s),a=v===40?41:v,f):n(v)}function f(v){return v===a?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),t):(e.enter(l),h(v))}function h(v){return v===a?(e.exit(l),f(a)):v===null?n(v):Ae(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Ue(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===a||v===null||Ae(v)?(e.exit("chunkString"),h(v)):(e.consume(v),v===92?p:m)}function p(v){return v===a||v===92?(e.consume(v),m):m(v)}}function us(e,t){let n;return i;function i(s){return Ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):Ve(s)?Ue(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const v2={name:"definition",tokenize:w2},x2={partial:!0,tokenize:k2};function w2(e,t,n){const i=this;let s;return l;function l(w){return e.enter("definition"),a(w)}function a(w){return i1.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function c(w){return s=Ln(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 et(w)?us(e,h)(w):h(w)}function h(w){return r1(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(x2,p,p)(w)}function p(w){return Ve(w)?Ue(e,v,"whitespace")(w):v(w)}function v(w){return w===null||Ae(w)?(e.exit("definition"),i.parser.defined.push(s),t(w)):n(w)}}function k2(e,t,n){return i;function i(c){return et(c)?us(e,s)(c):n(c)}function s(c){return o1(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Ve(c)?Ue(e,a,"whitespace")(c):a(c)}function a(c){return c===null||Ae(c)?t(c):n(c)}}const S2={name:"hardBreakEscape",tokenize:b2};function b2(e,t,n){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Ae(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const C2={name:"headingAtx",resolve:E2,tokenize:T2};function E2(e,t){let n=e.length-2,i=3,s,l;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},l={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},dn(e,i,n-i+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function T2(e,t,n){let i=0;return s;function s(m){return e.enter("atxHeading"),l(m)}function l(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&i++<6?(e.consume(m),a):m===null||et(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||Ae(m)?(e.exit("atxHeading"),t(m)):Ve(m)?Ue(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||et(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const P2=["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"],Nv=["pre","script","style","textarea"],R2={concrete:!0,name:"htmlFlow",resolveTo:N2,tokenize:M2},j2={partial:!0,tokenize:D2},A2={partial:!0,tokenize:I2};function N2(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 M2(e,t,n){const i=this;let s,l,a,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),l=!0,C):M===63?(e.consume(M),s=3,i.interrupt?t:N):Kt(M)?(e.consume(M),a=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):Kt(M)?(e.consume(M),s=4,i.interrupt?t:N):n(M)}function w(M){return M===45?(e.consume(M),i.interrupt?t:N):n(M)}function S(M){const te="CDATA[";return M===te.charCodeAt(c++)?(e.consume(M),c===te.length?i.interrupt?t:F:S):n(M)}function C(M){return Kt(M)?(e.consume(M),a=String.fromCharCode(M),E):n(M)}function E(M){if(M===null||M===47||M===62||et(M)){const te=M===47,me=a.toLowerCase();return!te&&!l&&Nv.includes(me)?(s=1,i.interrupt?t(M):F(M)):P2.includes(a.toLowerCase())?(s=6,te?(e.consume(M),T):i.interrupt?t(M):F(M)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(M):l?A(M):j(M))}return M===45||Vt(M)?(e.consume(M),a+=String.fromCharCode(M),E):n(M)}function T(M){return M===62?(e.consume(M),i.interrupt?t:F):n(M)}function A(M){return Ve(M)?(e.consume(M),A):P(M)}function j(M){return M===47?(e.consume(M),P):M===58||M===95||Kt(M)?(e.consume(M),R):Ve(M)?(e.consume(M),j):P(M)}function R(M){return M===45||M===46||M===58||M===95||Vt(M)?(e.consume(M),R):V(M)}function V(M){return M===61?(e.consume(M),D):Ve(M)?(e.consume(M),V):j(M)}function D(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),f=M,G):Ve(M)?(e.consume(M),D):$(M)}function G(M){return M===f?(e.consume(M),f=null,_):M===null||Ae(M)?n(M):(e.consume(M),G)}function $(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||et(M)?V(M):(e.consume(M),$)}function _(M){return M===47||M===62||Ve(M)?j(M):n(M)}function P(M){return M===62?(e.consume(M),K):n(M)}function K(M){return M===null||Ae(M)?F(M):Ve(M)?(e.consume(M),K):n(M)}function F(M){return M===45&&s===2?(e.consume(M),pe):M===60&&s===1?(e.consume(M),xe):M===62&&s===4?(e.consume(M),O):M===63&&s===3?(e.consume(M),N):M===93&&s===5?(e.consume(M),fe):Ae(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(j2,J,ie)(M)):M===null||Ae(M)?(e.exit("htmlFlowData"),ie(M)):(e.consume(M),F)}function ie(M){return e.check(A2,Z,J)(M)}function Z(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),ee}function ee(M){return M===null||Ae(M)?ie(M):(e.enter("htmlFlowData"),F(M))}function pe(M){return M===45?(e.consume(M),N):F(M)}function xe(M){return M===47?(e.consume(M),a="",Q):F(M)}function Q(M){if(M===62){const te=a.toLowerCase();return Nv.includes(te)?(e.consume(M),O):F(M)}return Kt(M)&&a.length<8?(e.consume(M),a+=String.fromCharCode(M),Q):F(M)}function fe(M){return M===93?(e.consume(M),N):F(M)}function N(M){return M===62?(e.consume(M),O):M===45&&s===2?(e.consume(M),N):F(M)}function O(M){return M===null||Ae(M)?(e.exit("htmlFlowData"),J(M)):(e.consume(M),O)}function J(M){return e.exit("htmlFlow"),t(M)}}function I2(e,t,n){const i=this;return s;function s(a){return Ae(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):n(a)}function l(a){return i.parser.lazy[i.now().line]?n(a):t(a)}}function D2(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Ms,t,n)}}const _2={name:"htmlText",tokenize:L2};function L2(e,t,n){const i=this;let s,l,a;return c;function c(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),V):N===63?(e.consume(N),j):Kt(N)?(e.consume(N),$):n(N)}function h(N){return N===45?(e.consume(N),m):N===91?(e.consume(N),l=0,S):Kt(N)?(e.consume(N),A):n(N)}function m(N){return N===45?(e.consume(N),w):n(N)}function p(N){return N===null?n(N):N===45?(e.consume(N),v):Ae(N)?(a=p,xe(N)):(e.consume(N),p)}function v(N){return N===45?(e.consume(N),w):p(N)}function w(N){return N===62?pe(N):N===45?v(N):p(N)}function S(N){const O="CDATA[";return N===O.charCodeAt(l++)?(e.consume(N),l===O.length?C:S):n(N)}function C(N){return N===null?n(N):N===93?(e.consume(N),E):Ae(N)?(a=C,xe(N)):(e.consume(N),C)}function E(N){return N===93?(e.consume(N),T):C(N)}function T(N){return N===62?pe(N):N===93?(e.consume(N),T):C(N)}function A(N){return N===null||N===62?pe(N):Ae(N)?(a=A,xe(N)):(e.consume(N),A)}function j(N){return N===null?n(N):N===63?(e.consume(N),R):Ae(N)?(a=j,xe(N)):(e.consume(N),j)}function R(N){return N===62?pe(N):j(N)}function V(N){return Kt(N)?(e.consume(N),D):n(N)}function D(N){return N===45||Vt(N)?(e.consume(N),D):G(N)}function G(N){return Ae(N)?(a=G,xe(N)):Ve(N)?(e.consume(N),G):pe(N)}function $(N){return N===45||Vt(N)?(e.consume(N),$):N===47||N===62||et(N)?_(N):n(N)}function _(N){return N===47?(e.consume(N),pe):N===58||N===95||Kt(N)?(e.consume(N),P):Ae(N)?(a=_,xe(N)):Ve(N)?(e.consume(N),_):pe(N)}function P(N){return N===45||N===46||N===58||N===95||Vt(N)?(e.consume(N),P):K(N)}function K(N){return N===61?(e.consume(N),F):Ae(N)?(a=K,xe(N)):Ve(N)?(e.consume(N),K):_(N)}function F(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),s=N,ie):Ae(N)?(a=F,xe(N)):Ve(N)?(e.consume(N),F):(e.consume(N),Z)}function ie(N){return N===s?(e.consume(N),s=void 0,ee):N===null?n(N):Ae(N)?(a=ie,xe(N)):(e.consume(N),ie)}function Z(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||et(N)?_(N):(e.consume(N),Z)}function ee(N){return N===47||N===62||et(N)?_(N):n(N)}function pe(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function xe(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),Q}function Q(N){return Ve(N)?Ue(e,fe,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):fe(N)}function fe(N){return e.enter("htmlTextData"),a(N)}}const Eh={name:"labelEnd",resolveAll:V2,resolveTo:B2,tokenize:$2},O2={tokenize:U2},F2={tokenize:W2},z2={tokenize:H2};function V2(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&&dn(e,0,e.length,n),e}function B2(e,t){let n=e.length,i=0,s,l,a,c;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(a=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[l+i+2][1].end},end:{...e[a-2][1].start}};return c=[["enter",f,t],["enter",h,t]],c=wn(c,e.slice(l+1,l+i+3)),c=wn(c,[["enter",m,t]]),c=wn(c,Gl(t.parser.constructs.insideSpan.null,e.slice(l+i+4,a-3),t)),c=wn(c,[["exit",m,t],e[a-2],e[a-1],["exit",h,t]]),c=wn(c,e.slice(a+1)),c=wn(c,[["exit",f,t]]),dn(e,l,e.length,c),e}function $2(e,t,n){const i=this;let s=i.events.length,l,a;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){l=i.events[s][1];break}return c;function c(v){return l?l._inactive?p(v):(a=i.parser.defined.includes(Ln(i.sliceSerialize({start:l.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(O2,m,a?m:p)(v):v===91?e.attempt(F2,m,a?h:p)(v):a?m(v):p(v)}function h(v){return e.attempt(z2,m,p)(v)}function m(v){return t(v)}function p(v){return l._balanced=!0,n(v)}}function U2(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 et(p)?us(e,l)(p):l(p)}function l(p){return p===41?m(p):r1(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function a(p){return et(p)?us(e,f)(p):m(p)}function c(p){return n(p)}function f(p){return p===34||p===39||p===40?o1(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return et(p)?us(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 W2(e,t,n){const i=this;return s;function s(c){return i1.call(i,e,l,a,"reference","referenceMarker","referenceString")(c)}function l(c){return i.parser.defined.includes(Ln(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function H2(e,t,n){return i;function i(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const K2={name:"labelStartImage",resolveAll:Eh.resolveAll,tokenize:q2};function q2(e,t,n){const i=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const X2={name:"labelStartLink",resolveAll:Eh.resolveAll,tokenize:Y2};function Y2(e,t,n){const i=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}const ff={name:"lineEnding",tokenize:G2};function G2(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Ue(e,t,"linePrefix")}}const gl={name:"thematicBreak",tokenize:Q2};function Q2(e,t,n){let i=0,s;return l;function l(h){return e.enter("thematicBreak"),a(h)}function a(h){return s=h,c(h)}function c(h){return h===s?(e.enter("thematicBreakSequence"),f(h)):i>=3&&(h===null||Ae(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===s?(e.consume(h),i++,f):(e.exit("thematicBreakSequence"),Ve(h)?Ue(e,c,"whitespace")(h):c(h))}}const rn={continuation:{tokenize:tI},exit:rI,name:"list",tokenize:eI},J2={partial:!0,tokenize:iI},Z2={partial:!0,tokenize:nI};function eI(e,t,n){const i=this,s=i.events[i.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return c;function c(w){const S=i.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||w===i.containerState.marker:cd(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(gl,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 cd(w)&&++a<10?(e.consume(w),f):(!i.interrupt||a<2)&&(i.containerState.marker?w===i.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||w,e.check(Ms,i.interrupt?n:m,e.attempt(J2,v,p))}function m(w){return i.containerState.initialBlankLine=!0,l++,v(w)}function p(w){return Ve(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),v):n(w)}function v(w){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function tI(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ms,s,l);function s(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Ue(e,t,"listItemIndent",i.containerState.size+1)(c)}function l(c){return i.containerState.furtherBlankLines||!Ve(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Z2,t,a)(c))}function a(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Ue(e,e.attempt(rn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function nI(e,t,n){const i=this;return Ue(e,s,"listItemIndent",i.containerState.size+1);function s(l){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(l):n(l)}}function rI(e){e.exit(this.containerState.type)}function iI(e,t,n){const i=this;return Ue(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const a=i.events[i.events.length-1];return!Ve(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Mv={name:"setextUnderline",resolveTo:oI,tokenize:sI};function oI(e,t){let n=e.length,i,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",a,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end={...e[l][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function sI(e,t,n){const i=this;let s;return l;function l(h){let m=i.events.length,p;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){p=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),s=h,a(h)):n(h)}function a(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===s?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ve(h)?Ue(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||Ae(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const aI={tokenize:lI};function lI(e){const t=this,n=e.attempt(Ms,i,e.attempt(this.parser.constructs.flowInitial,s,Ue(e,e.attempt(this.parser.constructs.flow,s,e.attempt(h2,s)),"linePrefix")));return n;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const uI={resolveAll:a1()},cI=s1("string"),fI=s1("text");function s1(e){return{resolveAll:a1(e==="text"?dI:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],l=n.attempt(s,a,c);return a;function a(m){return h(m)?l(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return h(m)?(n.exit("data"),l(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 a1(e){return t;function t(n,i){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,i):n}}function dI(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],s=t.sliceStream(i);let l=s.length,a=-1,c=0,f;for(;l--;){const h=s[l];if(typeof h=="string"){for(a=h.length;h.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(h===-2)f=!0,c++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:i.start._bufferIndex+a,_index:i.start._index+l,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const hI={42:rn,43:rn,45:rn,48:rn,49:rn,50:rn,51:rn,52:rn,53:rn,54:rn,55:rn,56:rn,57:rn,62:Z0},pI={91:v2},mI={[-2]:cf,[-1]:cf,32:cf},gI={35:C2,42:gl,45:[Mv,gl],60:R2,61:Mv,95:gl,96:Av,126:Av},yI={38:t1,92:e1},vI={[-5]:ff,[-4]:ff,[-3]:ff,33:K2,38:t1,42:dd,60:[XM,_2],91:X2,92:[S2,e1],93:Eh,95:dd,96:a2},xI={null:[dd,uI]},wI={null:[42,95]},kI={null:[]},SI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wI,contentInitial:pI,disable:kI,document:hI,flow:gI,flowInitial:mI,insideSpan:xI,string:yI,text:vI},Symbol.toStringTag,{value:"Module"}));function bI(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let a=[],c=[];const f={attempt:G(V),check:G(D),consume:A,enter:j,exit:R,interrupt:G(D,{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&&l.push(t),h;function p(K){return a=wn(a,K),E(),a[a.length-1]!==null?[]:($(t,0),h.events=Gl(l,h.events,h),h.events)}function v(K,F){return EI(w(K),F)}function w(K){return CI(a,K)}function S(){const{_bufferIndex:K,_index:F,line:ie,column:Z,offset:ee}=i;return{_bufferIndex:K,_index:F,line:ie,column:Z,offset:ee}}function C(K){s[K.line]=K.column,P()}function E(){let K;for(;i._index<a.length;){const F=a[i._index];if(typeof F=="string")for(K=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===K&&i._bufferIndex<F.length;)T(F.charCodeAt(i._bufferIndex));else T(F)}}function T(K){m=m(K)}function A(K){Ae(K)?(i.line++,i.column=1,i.offset+=K===-3?2:1,P()):K!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===a[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=K}function j(K,F){const ie=F||{};return ie.type=K,ie.start=S(),h.events.push(["enter",ie,h]),c.push(ie),ie}function R(K){const F=c.pop();return F.end=S(),h.events.push(["exit",F,h]),F}function V(K,F){$(K,F.from)}function D(K,F){F.restore()}function G(K,F){return ie;function ie(Z,ee,pe){let xe,Q,fe,N;return Array.isArray(Z)?J(Z):"tokenize"in Z?J([Z]):O(Z);function O(ye){return de;function de(Te){const ge=Te!==null&&ye[Te],_e=Te!==null&&ye.null,He=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return J(He)(Te)}}function J(ye){return xe=ye,Q=0,ye.length===0?pe:M(ye[Q])}function M(ye){return de;function de(Te){return N=_(),fe=ye,ye.partial||(h.currentConstruct=ye),ye.name&&h.parser.constructs.disable.null.includes(ye.name)?me():ye.tokenize.call(F?Object.assign(Object.create(h),F):h,f,te,me)(Te)}}function te(ye){return K(fe,N),ee}function me(ye){return N.restore(),++Q<xe.length?M(xe[Q]):pe}}}function $(K,F){K.resolveAll&&!l.includes(K)&&l.push(K),K.resolve&&dn(h.events,F,h.events.length-F,K.resolve(h.events.slice(F),h)),K.resolveTo&&(h.events=K.resolveTo(h.events,h))}function _(){const K=S(),F=h.previous,ie=h.currentConstruct,Z=h.events.length,ee=Array.from(c);return{from:Z,restore:pe};function pe(){i=K,h.previous=F,h.currentConstruct=ie,h.events.length=Z,c=ee,P()}}function P(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function CI(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(i,l)];else{if(a=e.slice(n,s),i>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(i):a.shift()}l>0&&a.push(e[s].slice(0,l))}return a}function EI(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
259
+ `;break}case-3:{a=`\r
260
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(l)}s=l===-2,i.push(a)}return i.join("")}function TI(e){const i={constructs:J0([SI,...(e||{}).extensions||[]]),content:s(BM),defined:[],document:s(UM),flow:s(aI),lazy:{},string:s(cI),text:s(fI)};return i;function s(l){return a;function a(c){return bI(i,l,c)}}}function PI(e){for(;!n1(e););return e}const Iv=/[\0\t\n\r]/g;function RI(){let e=1,t="",n=!0,i;return s;function s(l,a,c){const f=[];let h,m,p,v,w;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l)),p=0,t="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(Iv.lastIndex=p,h=Iv.exec(l),v=h&&h.index!==void 0?h.index:l.length,w=l.charCodeAt(v),!h){t=l.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(l.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 cs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dv(e.position):"start"in e||"end"in e?Dv(e):"line"in e||"column"in e?hd(e):""}function hd(e){return _v(e&&e.line)+":"+_v(e&&e.column)}function Dv(e){return hd(e&&e.start)+"-"+hd(e&&e.end)}function _v(e){return e&&typeof e=="number"?e:1}const l1={}.hasOwnProperty;function u1(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),jI(n)(PI(TI(n).document().write(RI()(e,t,!0))))}function jI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(hn),autolinkProtocol:_,autolinkEmail:_,atxHeading:l(_t),blockQuote:l(_e),characterEscape:_,characterReference:_,codeFenced:l(He),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l(He,a),codeText:l(tt,a),codeTextData:_,data:_,codeFlowValue:_,definition:l(gt),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(at),hardBreakEscape:l(ot),hardBreakTrailing:l(ot),htmlFlow:l(Ke,a),htmlFlowData:_,htmlText:l(Ke,a),htmlTextData:_,image:l(jt),label:a,link:l(hn),listItem:l(Gt),listItemValue:v,listOrdered:l(At,p),listUnordered:l(At),paragraph:l(Fn),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(_t),strong:l(Oe),thematicBreak:l(En)},exit:{atxHeading:f(),atxHeadingSequence:V,autolink:f(),autolinkEmail:ge,autolinkProtocol:Te,blockQuote:f(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ye,characterReference:de,codeFenced:f(E),codeFencedFence:C,codeFencedFenceInfo:w,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:f(T),codeText:f(ee),codeTextData:P,data:P,definition:f(),definitionDestinationString:R,definitionLabelString:A,definitionTitleString:j,emphasis:f(),hardBreakEscape:f(F),hardBreakTrailing:f(F),htmlFlow:f(ie),htmlFlowData:P,htmlText:f(Z),htmlTextData:P,image:f(xe),label:fe,labelText:Q,lineEnding:K,link:f(pe),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:te,resourceDestinationString:N,resourceTitleString:O,resource:J,setextHeading:f($),setextHeadingLineSequence:G,setextHeadingText:D,strong:f(),thematicBreak:f()}};c1(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(Y){let ae={type:"root",children:[]};const Pe={stack:[ae],tokenStack:[],config:t,enter:c,exit:h,buffer:a,resume:m,data:n},De=[];let ze=-1;for(;++ze<Y.length;)if(Y[ze][1].type==="listOrdered"||Y[ze][1].type==="listUnordered")if(Y[ze][0]==="enter")De.push(ze);else{const lt=De.pop();ze=s(Y,lt,ze)}for(ze=-1;++ze<Y.length;){const lt=t[Y[ze][0]];l1.call(lt,Y[ze][1].type)&&lt[Y[ze][1].type].call(Object.assign({sliceSerialize:Y[ze][2].sliceSerialize},Pe),Y[ze][1])}if(Pe.tokenStack.length>0){const lt=Pe.tokenStack[Pe.tokenStack.length-1];(lt[1]||Lv).call(Pe,void 0,lt[0])}for(ae.position={start:Mr(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Mr(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ae=t.transforms[ze](ae)||ae;return ae}function s(Y,ae,Pe){let De=ae-1,ze=-1,lt=!1,W,B,q,se;for(;++De<=Pe;){const he=Y[De];switch(he[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{he[0]==="enter"?ze++:ze--,se=void 0;break}case"lineEndingBlank":{he[0]==="enter"&&(W&&!se&&!ze&&!q&&(q=De),se=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:se=void 0}if(!ze&&he[0]==="enter"&&he[1].type==="listItemPrefix"||ze===-1&&he[0]==="exit"&&(he[1].type==="listUnordered"||he[1].type==="listOrdered")){if(W){let ue=De;for(B=void 0;ue--;){const Ne=Y[ue];if(Ne[1].type==="lineEnding"||Ne[1].type==="lineEndingBlank"){if(Ne[0]==="exit")continue;B&&(Y[B][1].type="lineEndingBlank",lt=!0),Ne[1].type="lineEnding",B=ue}else if(!(Ne[1].type==="linePrefix"||Ne[1].type==="blockQuotePrefix"||Ne[1].type==="blockQuotePrefixWhitespace"||Ne[1].type==="blockQuoteMarker"||Ne[1].type==="listItemIndent"))break}q&&(!B||q<B)&&(W._spread=!0),W.end=Object.assign({},B?Y[B][1].start:he[1].end),Y.splice(B||De,0,["exit",W,he[2]]),De++,Pe++}if(he[1].type==="listItemPrefix"){const ue={type:"listItem",_spread:!1,start:Object.assign({},he[1].start),end:void 0};W=ue,Y.splice(De,0,["enter",ue,he[2]]),De++,Pe++,q=void 0,se=!0}}}return Y[ae][1]._spread=lt,Pe}function l(Y,ae){return Pe;function Pe(De){c.call(this,Y(De),De),ae&&ae.call(this,De)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(Y,ae,Pe){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([ae,Pe||void 0]),Y.position={start:Mr(ae.start),end:void 0}}function f(Y){return ae;function ae(Pe){Y&&Y.call(this,Pe),h.call(this,Pe)}}function h(Y,ae){const Pe=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==Y.type&&(ae?ae.call(this,Y,De[0]):(De[1]||Lv).call(this,Y,De[0]));else throw new Error("Cannot close `"+Y.type+"` ("+cs({start:Y.start,end:Y.end})+"): it’s not open");Pe.position.end=Mr(Y.end)}function m(){return Sh(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(Y){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function w(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=Y}function S(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=Y}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Y.replace(/(\r?\n|\r)$/g,"")}function A(Y){const ae=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ae,Pe.identifier=Ln(this.sliceSerialize(Y)).toLowerCase()}function j(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.title=Y}function R(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.url=Y}function V(Y){const ae=this.stack[this.stack.length-1];if(!ae.depth){const Pe=this.sliceSerialize(Y).length;ae.depth=Pe}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function G(Y){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function _(Y){const Pe=this.stack[this.stack.length-1].children;let De=Pe[Pe.length-1];(!De||De.type!=="text")&&(De=yt(),De.position={start:Mr(Y.start),end:void 0},Pe.push(De)),this.stack.push(De)}function P(Y){const ae=this.stack.pop();ae.value+=this.sliceSerialize(Y),ae.position.end=Mr(Y.end)}function K(Y){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=ae.children[ae.children.length-1];Pe.position.end=Mr(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ae.type)&&(_.call(this,Y),P.call(this,Y))}function F(){this.data.atHardBreak=!0}function ie(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Y}function Z(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Y}function ee(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Y}function pe(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ae,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function xe(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ae,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function Q(Y){const ae=this.sliceSerialize(Y),Pe=this.stack[this.stack.length-2];Pe.label=EM(ae),Pe.identifier=Ln(ae).toLowerCase()}function fe(){const Y=this.stack[this.stack.length-1],ae=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const De=Y.children;Pe.children=De}else Pe.alt=ae}function N(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.url=Y}function O(){const Y=this.resume(),ae=this.stack[this.stack.length-1];ae.title=Y}function J(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function te(Y){const ae=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ae,Pe.identifier=Ln(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function me(Y){this.data.characterReferenceType=Y.type}function ye(Y){const ae=this.sliceSerialize(Y),Pe=this.data.characterReferenceType;let De;Pe?(De=G0(ae,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Ch(ae);const ze=this.stack[this.stack.length-1];ze.value+=De}function de(Y){const ae=this.stack.pop();ae.position.end=Mr(Y.end)}function Te(Y){P.call(this,Y);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize(Y)}function ge(Y){P.call(this,Y);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize(Y)}function _e(){return{type:"blockquote",children:[]}}function He(){return{type:"code",lang:null,meta:null,value:""}}function tt(){return{type:"inlineCode",value:""}}function gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function at(){return{type:"emphasis",children:[]}}function _t(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function Ke(){return{type:"html",value:""}}function jt(){return{type:"image",title:null,url:"",alt:null}}function hn(){return{type:"link",title:null,url:"",children:[]}}function At(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Gt(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Fn(){return{type:"paragraph",children:[]}}function Oe(){return{type:"strong",children:[]}}function yt(){return{type:"text",value:""}}function En(){return{type:"thematicBreak"}}}function Mr(e){return{line:e.line,column:e.column,offset:e.offset}}function c1(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?c1(e,i):AI(e,i)}}function AI(e,t){let n;for(n in t)if(l1.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 Lv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+cs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+cs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+cs({start:t.start,end:t.end})+") is still open")}const NI={tokenize:OI,partial:!0},f1={tokenize:FI,partial:!0},d1={tokenize:zI,partial:!0},h1={tokenize:VI,partial:!0},MI={tokenize:BI,partial:!0},p1={name:"wwwAutolink",tokenize:_I,previous:g1},m1={name:"protocolAutolink",tokenize:LI,previous:y1},cr={name:"emailAutolink",tokenize:DI,previous:v1},Gn={};function II(){return{text:Gn}}let ii=48;for(;ii<123;)Gn[ii]=cr,ii++,ii===58?ii=65:ii===91&&(ii=97);Gn[43]=cr;Gn[45]=cr;Gn[46]=cr;Gn[95]=cr;Gn[72]=[cr,m1];Gn[104]=[cr,m1];Gn[87]=[cr,p1];Gn[119]=[cr,p1];function DI(e,t,n){const i=this;let s,l;return a;function a(p){return!pd(p)||!v1.call(i,i.previous)||Th(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return pd(p)?(e.consume(p),c):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(MI,m,h)(p):p===45||p===95||Vt(p)?(l=!0,e.consume(p),f):m(p)}function h(p){return e.consume(p),s=!0,f}function m(p){return l&&s&&Kt(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function _I(e,t,n){const i=this;return s;function s(a){return a!==87&&a!==119||!g1.call(i,i.previous)||Th(i.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(NI,e.attempt(f1,e.attempt(d1,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function LI(e,t,n){const i=this;let s="",l=!1;return a;function a(p){return(p===72||p===104)&&y1.call(i,i.previous)&&!Th(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Kt(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),l?h:(l=!0,f)):n(p)}function h(p){return p===null||Il(p)||et(p)||mi(p)||ql(p)?n(p):e.attempt(f1,e.attempt(d1,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function OI(e,t,n){let i=0;return s;function s(a){return(a===87||a===119)&&i<3?(i++,e.consume(a),s):a===46&&i===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function FI(e,t,n){let i,s,l;return a;function a(h){return h===46||h===95?e.check(h1,f,c)(h):h===null||et(h)||mi(h)||h!==45&&ql(h)?f(h):(l=!0,e.consume(h),a)}function c(h){return h===95?i=!0:(s=i,i=void 0),e.consume(h),a}function f(h){return s||i||!l?n(h):t(h)}}function zI(e,t){let n=0,i=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&i<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(h1,t,l)(a):a===null||et(a)||mi(a)?t(a):(e.consume(a),s)}function l(a){return a===41&&i++,e.consume(a),s}}function VI(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),l):c===93?(e.consume(c),s):c===60||c===null||et(c)||mi(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||et(c)||mi(c)?t(c):i(c)}function l(c){return Kt(c)?a(c):n(c)}function a(c){return c===59?(e.consume(c),i):Kt(c)?(e.consume(c),a):n(c)}}function BI(e,t,n){return i;function i(l){return e.consume(l),s}function s(l){return Vt(l)?n(l):t(l)}}function g1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||et(e)}function y1(e){return!Kt(e)}function v1(e){return!(e===47||pd(e))}function pd(e){return e===43||e===45||e===46||e===95||Vt(e)}function Th(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 $I={tokenize:GI,partial:!0};function UI(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:qI,continuation:{tokenize:XI},exit:YI}},text:{91:{name:"gfmFootnoteCall",tokenize:KI},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:WI,resolveTo:HI}}}}function WI(e,t,n){const i=this;let s=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;s--;){const f=i.events[s][1];if(f.type==="labelImage"){a=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(!a||!a._balanced)return n(f);const h=Ln(i.sliceSerialize({start:a.end,end:i.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function HI(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function KI(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,a;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),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(l>999||p===93&&!a||p===null||p===91||et(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return s.includes(Ln(i.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return et(p)||(a=!0),l++,e.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function qI(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,a=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(a>999||S===93&&!c||S===null||S===91||et(S))return n(S);if(S===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return l=Ln(i.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return et(S)||(c=!0),a++,e.consume(S),S===92?p:m}function p(S){return S===91||S===92||S===93?(e.consume(S),a++,m):m(S)}function v(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(l)||s.push(l),Ue(e,w,"gfmFootnoteDefinitionWhitespace")):n(S)}function w(S){return t(S)}}function XI(e,t,n){return e.check(Ms,t,e.attempt($I,t,n))}function YI(e){e.exit("gfmFootnoteDefinition")}function GI(e,t,n){const i=this;return Ue(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function QI(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(a,c){let f=-1;for(;++f<a.length;)if(a[f][0]==="enter"&&a[f][1].type==="strikethroughSequenceTemporary"&&a[f][1]._close){let h=f;for(;h--;)if(a[h][0]==="exit"&&a[h][1].type==="strikethroughSequenceTemporary"&&a[h][1]._open&&a[f][1].end.offset-a[f][1].start.offset===a[h][1].end.offset-a[h][1].start.offset){a[f][1].type="strikethroughSequence",a[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},a[h][1].start),end:Object.assign({},a[f][1].end)},p={type:"strikethroughText",start:Object.assign({},a[h][1].end),end:Object.assign({},a[f][1].start)},v=[["enter",m,c],["enter",a[h][1],c],["exit",a[h][1],c],["enter",p,c]],w=c.parser.constructs.insideSpan.null;w&&dn(v,v.length,0,Gl(w,a.slice(h+1,f),c)),dn(v,v.length,0,[["exit",p,c],["enter",a[f][1],c],["exit",a[f][1],c],["exit",m,c]]),dn(a,h-1,f-h+3,v),f=h+v.length-2;break}}for(f=-1;++f<a.length;)a[f][1].type==="strikethroughSequenceTemporary"&&(a[f][1].type="data");return a}function l(a,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):(a.enter("strikethroughSequenceTemporary"),w(S))}function w(S){const C=ro(h);if(S===126)return p>1?f(S):(a.consume(S),p++,w);if(p<2&&!n)return f(S);const E=a.exit("strikethroughSequenceTemporary"),T=ro(S);return E._open=!T||T===2&&!!C,E._close=!C||C===2&&!!T,c(S)}}}class JI{constructor(){this.map=[]}add(t,n,i){ZI(this,t,n,i)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let s=i.pop();for(;s;){for(const l of s)t.push(l);s=i.pop()}this.map.length=0}}function ZI(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 eD(e,t){let n=!1;const i=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=i.length-1;i[l]=i[l]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function tD(){return{flow:{null:{name:"table",tokenize:nD,resolveAll:rD}}}}function nD(e,t,n){const i=this;let s=0,l=0,a;return c;function c(P){let K=i.events.length-1;for(;K>-1;){const Z=i.events[K][1].type;if(Z==="lineEnding"||Z==="linePrefix")K--;else break}const F=K>-1?i.events[K][1].type:null,ie=F==="tableHead"||F==="tableRow"?D:f;return ie===D&&i.parser.lazy[i.now().line]?n(P):ie(P)}function f(P){return e.enter("tableHead"),e.enter("tableRow"),h(P)}function h(P){return P===124||(a=!0,l+=1),m(P)}function m(P){return P===null?n(P):Ae(P)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),w):n(P):Ve(P)?Ue(e,m,"whitespace")(P):(l+=1,a&&(a=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),a=!0,m):(e.enter("data"),p(P)))}function p(P){return P===null||P===124||et(P)?(e.exit("data"),m(P)):(e.consume(P),P===92?v:p)}function v(P){return P===92||P===124?(e.consume(P),p):p(P)}function w(P){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(P):(e.enter("tableDelimiterRow"),a=!1,Ve(P)?Ue(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?E(P):P===124?(a=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),C):V(P)}function C(P){return Ve(P)?Ue(e,E,"whitespace")(P):E(P)}function E(P){return P===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),T):P===45?(l+=1,T(P)):P===null||Ae(P)?R(P):V(P)}function T(P){return P===45?(e.enter("tableDelimiterFiller"),A(P)):V(P)}function A(P){return P===45?(e.consume(P),A):P===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(P))}function j(P){return Ve(P)?Ue(e,R,"whitespace")(P):R(P)}function R(P){return P===124?S(P):P===null||Ae(P)?!a||s!==l?V(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):V(P)}function V(P){return n(P)}function D(P){return e.enter("tableRow"),G(P)}function G(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),G):P===null||Ae(P)?(e.exit("tableRow"),t(P)):Ve(P)?Ue(e,G,"whitespace")(P):(e.enter("data"),$(P))}function $(P){return P===null||P===124||et(P)?(e.exit("data"),G(P)):(e.consume(P),P===92?_:$)}function _(P){return P===92||P===124?(e.consume(P),$):$(P)}}function rD(e,t){let n=-1,i=!0,s=0,l=[0,0,0,0],a=[0,0,0,0],c=!1,f=0,h,m,p;const v=new JI;for(;++n<e.length;){const w=e[n],S=w[1];w[0]==="enter"?S.type==="tableHead"?(c=!1,f!==0&&(Ov(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,l=[0,0,0,0],a=[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,a[2]===0&&(l[1]!==0&&(a[0]=a[1],p=Qa(v,t,l,s,void 0,p),l=[0,0,0,0]),a[2]=n)):S.type==="tableCellDivider"&&(i?i=!1:(l[1]!==0&&(a[0]=a[1],p=Qa(v,t,l,s,void 0,p)),l=a,a=[l[1],n,0,0])):S.type==="tableHead"?(c=!0,f=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(f=n,l[1]!==0?(a[0]=a[1],p=Qa(v,t,l,s,n,p)):a[1]!==0&&(p=Qa(v,t,a,s,n,p)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(a[3]=n)}for(f!==0&&Ov(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=eD(t.events,n))}return e}function Qa(e,t,n,i,s,l){const a=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},qi(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=qi(t.events,n[1]);if(l={type:a,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=qi(t.events,n[2]),m=qi(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&&(l.end=Object.assign({},qi(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function Ov(e,t,n,i,s){const l=[],a=qi(t.events,n);s&&(s.end=Object.assign({},a),l.push(["exit",s,t])),i.end=Object.assign({},a),l.push(["exit",i,t]),e.add(n+1,0,l)}function qi(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const iD={name:"tasklistCheck",tokenize:sD};function oD(){return{text:{91:iD}}}function sD(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"),l)}function l(f){return et(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),a):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),a):n(f)}function a(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Ae(f)?t(f):Ve(f)?e.check({tokenize:aD},t,n)(f):n(f)}}function aD(e,t,n){return Ue(e,i,"whitespace");function i(s){return s===null?n(s):t(s)}}function x1(e){return J0([II(),UI(),QI(e),tD(),oD()])}function w1(e){return typeof e=="string"&&/\.md$/i.test(e.trim())}function lD(e,t){const n=String(e??"").trim().split(/\r?\n/).map(s=>`> ${s}`).join(`
261
+ `),i=String(t??"").trim();return n&&i?`${n}
262
+
263
+ ${i}`:n||i}function uD(e){const t=String(e??""),n=t.lastIndexOf(".");return`${n>0?t.slice(0,n):t}_review.md`}function cD(e,t,n){const i=String(e??""),s=String(t??""),l=Math.max(0,Number(n)||0);if(!s)return 0;let a=0,c=0;for(;c<=i.length;){const f=i.indexOf(s,c);if(f<0||f>=l)return a;a+=1,c=f+Math.max(s.length,1)}return a}function fD(e){return(String(e??"").match(/https?:\/\/[^\s<>()\[\]{}"']+/gi)??[]).map(n=>n.replace(/[.,!?;:]+$/,""))}function md(e){return e?.kind!=="file"?null:String(e.mime??"").toLowerCase().startsWith("image/")?"photo":"file"}function dD(e){const t=i=>{const s=Date.parse(String(i??""));return Number.isFinite(s)?s:0},n=new Map;for(const i of e??[]){const s=String(i?.message?.filename||"file"),l=n.get(s)??[];l.push(i),n.set(s,l)}return[...n.entries()].map(([i,s])=>({filename:i,versions:s.sort((l,a)=>t(a.message?.date)-t(l.message?.date))})).sort((i,s)=>t(s.versions[0]?.message?.date)-t(i.versions[0]?.message?.date))}const hD=new Set(["delete","emphasis","inlineCode","link","linkReference","strong"]);function pD(e){const t=u1(e,{extensions:[x1()],mdastExtensions:[Q0()]}),n=[],i=[],s=[],l=(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),T=E>=0?E:Math.min(S,Math.max(v.length-1,0));n.push(C),i.push(m+T+1),S=T+1}},a=c=>{const f=n.length;if(c.type==="text"||c.type==="inlineCode"||c.type==="code")l(c.value,c);else for(const p of c.children??[])a(p);const h=n.length,m=c.position?.end?.offset;h>f&&hD.has(c.type)&&Number.isInteger(m)&&s.push({visibleEnd:h,rawEnd:m})};return a(t),{text:n.join(""),rawEnds:i,trailingRanges:s}}function mD(e,t,n){let i=-1,s=0;for(let l=0;l<=n;l+=1){if(i=e.indexOf(t,s),i<0)return-1;s=i+Math.max(t.length,1)}return i}function gD(e,t){const n=String(e??""),i=pD(n),s=new Map,l=[];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?mD(i.text,m,w):-1,C=S+m.length;let E=S>=0?i.rawEnds[C-1]:void 0;if(!Number.isInteger(E)){l.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 T=s.get(E)??[];T.push(v),s.set(E,T)}let a=n;const c=[...s.keys()].sort((f,h)=>h-f);for(const f of c)a=`${a.slice(0,f)} ${s.get(f).join(" ")}${a.slice(f)}`;return l.length>0&&(a=`${a.trimEnd()}
264
+
265
+ ${l.join(`
266
+ `)}
267
+ `),a}const yD="",vD="application/octet-stream",xD=/\.([A-Za-z0-9]{1,12})$/;function k1(e){return String(e??"").split(";")[0].trim().toLowerCase()}function S1(e){const t=xD.exec(String(e??"").trim());return t?t[1].toLowerCase():""}function wD(e){const t=S1(e);return t==="html"||t==="htm"}function Is(e,t){return wD(e)?!0:S1(e)?!1:k1(t)==="text/html"}function Ph(e,t){const n=k1(e);return n==="text/html"||Is(t,e)?vD:n}const gd=48e3,kD=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"}]),b1="x-ours-duration",SD=4e3;function bD(e){return!Number.isFinite(e)||e<=0?null:String(Math.round(e*100)/100)}function CD(e,t){const n=t===null?null:bD(t);return n===null?e:`${e};${b1}=${n}`}function ED(e){if(!e)return null;const t=new RegExp(`${b1}\\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 TD(e,t=SD){return typeof Audio!="function"||typeof URL?.createObjectURL!="function"?Promise.resolve(null):new Promise(n=>{const i=URL.createObjectURL(e),s=new Audio;let l=!1;const a=f=>{l||(l=!0,clearTimeout(c),s.removeAttribute("src"),s.load(),URL.revokeObjectURL(i),n(Number.isFinite(f)&&(f??0)>0?f:null))},c=setTimeout(()=>a(null),t);s.addEventListener("loadedmetadata",()=>{Number.isFinite(s.duration)&&s.duration>0?a(s.duration):s.currentTime=Number.MAX_SAFE_INTEGER},{once:!0}),s.addEventListener("durationchange",()=>{Number.isFinite(s.duration)&&s.duration>0&&a(s.duration)}),s.addEventListener("error",()=>a(null),{once:!0}),s.preload="metadata",s.src=i})}const C1=40,PD=44,E1=.14,RD=.5,jD=e=>e<0?0:e>1?1:e;function T1(e,{floor:t=E1,gamma:n=RD}={}){const i=Math.pow(jD(Number.isFinite(e)?e:0),n);return t+(1-t)*i}function AD(e,t=C1){const n=Math.max(1,Math.floor(t)),i=new Array(n).fill(0);if(!e||e.length===0)return i;const s=e.length/n;for(let l=0;l<n;l++){const a=Math.floor(l*s),c=Math.min(e.length,Math.max(a+1,Math.floor((l+1)*s)));let f=0;for(let h=a;h<c;h++)f+=e[h]*e[h];i[l]=Math.sqrt(f/(c-a))}return i}function ND(e,t={}){const{silenceFloor:n=1e-4}=t,i=e.reduce((s,l)=>l>s?l:s,0);return i>n?e.map(s=>T1(s/i,t)):e.map(()=>E1)}function MD({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),T1(s/n)},get reference(){return n}}}function P1(e){return Ph(e.mime,e.filename)}function Rh(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 l=e.available?WA(e.id):null;return l?(n({url:l,size:e.size,loaded:!0}),()=>{}):(Kl(e.id).then(a=>{if(s)return;if(!a){n({url:null,size:0,loaded:!0});return}const c=URL.createObjectURL(new Blob([a],{type:P1(e)}));i=c,n({url:c,size:a.byteLength,loaded:!0})}),()=>{s=!0,i&&URL.revokeObjectURL(i)})},[e.id,e.available]),t}function jh({label:e}){return y.jsxs("div",{className:"file-offdevice",children:[y.jsx("div",{className:"file-offdevice-ic",children:y.jsx(ke,{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 Fv({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 ID({rec:e,receipt:t,receiptless:n,onPreview:i,onFetch:s}){const l=e.dir==="out",a=`bubble file-bubble${l?" me":""}`,c=no(e.mime,e.filename)?"Voice message":"File",f=y.jsxs("div",{className:"bubble-at",children:[hi(e.date),l&&y.jsx(ud,{receipt:t,content:c,receiptless:n})]});return e.mime.startsWith("image/")?y.jsx(DD,{rec:e,cls:a,footer:f,onFetch:s}):no(e.mime,e.filename)?y.jsx(_D,{rec:e,cls:a,footer:f,onFetch:s}):y.jsx(LD,{rec:e,cls:a,footer:f,onPreview:i,onFetch:s})}function Ah({rec:e,onFetch:t}){const[n,i]=k.useState(!1),[s,l]=k.useState(!1);return y.jsxs("div",{className:"file-offdevice",children:[y.jsx("div",{className:"file-offdevice-ic",children:y.jsx(ke,{name:"inbox",size:16})}),y.jsxs("div",{className:"filecard-meta",children:[y.jsx("div",{className:"filecard-name",title:e.filename,children:no(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),l(!1),(t?.(e.id)??qA(e.id)).catch(()=>l(!0)).finally(()=>i(!1))},children:n?"Fetching…":"Fetch"})]})}function DD({rec:e,cls:t,footer:n,onFetch:i}){const{url:s,loaded:l}=Rh(e);return l&&!s?y.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?y.jsx(Ah,{rec:e,onFetch:i}):y.jsx(jh,{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 _D({rec:e,cls:t,footer:n,onFetch:i}){const{url:s,loaded:l}=Rh(e),a=k.useRef(null),c=k.useRef(null),[f,h]=k.useState(!1),[m,p]=k.useState(0),[v,w]=k.useState(()=>ED(e.mime)),[S,C]=k.useState(!1),[E,T]=k.useState(null);if(k.useEffect(()=>{if(!s)return;let $=!1;const _=typeof window>"u"?void 0:window.AudioContext||window.webkitAudioContext;if(!_)return;const P=new _,K=()=>{try{P.close()?.catch?.(()=>{})}catch{}};return(async()=>{try{const F=await fetch(s).then(Z=>Z.arrayBuffer()),ie=await P.decodeAudioData(F);if($)return;T(ND(AD(ie.getChannelData(0),C1)))}catch{}finally{K()}})(),()=>{$=!0,K()}},[s]),l&&!s)return y.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?y.jsx(Ah,{rec:e,onFetch:i}):y.jsx(jh,{label:"Voice message"}),n,y.jsx(Fv,{rec:e})]});const A=()=>{const $=a.current;$&&(f?$.pause():$.play())},j=$=>{const _=c.current;if(!_)return 0;const P=_.getBoundingClientRect();return Math.max(0,Math.min(1,($-P.left)/P.width))},R=$=>{const _=a.current;p($),_&&v&&isFinite(v)&&(_.currentTime=$*v)},V=$=>{s&&($.currentTarget.setPointerCapture?.($.pointerId),C(!0),R(j($.clientX)))},D=$=>{S&&R(j($.clientX))},G=$=>{S&&($.currentTarget.releasePointerCapture?.($.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(ke,{name:f?"pause":"play",size:14})}),y.jsxs("div",{className:"voice-track"+(s?" seekable":"")+(S?" scrubbing":"")+(E?" has-wave":""),ref:c,onPointerDown:V,onPointerMove:D,onPointerUp:G,onPointerCancel:G,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(($,_)=>y.jsx("span",{className:"voice-wave-bar"+(_/E.length<m?" played":""),style:{height:`${Math.round($*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:a,src:s,onPlay:()=>h(!0),onPause:()=>h(!1),onEnded:()=>{h(!1),p(0)},onTimeUpdate:$=>{const _=$.currentTarget;!S&&_.duration>0&&isFinite(_.duration)&&p(_.currentTime/_.duration)},onLoadedMetadata:$=>{const _=$.currentTarget.duration;isFinite(_)&&_>0&&w(_)}}),n,y.jsx(Fv,{rec:e})]})}function LD({rec:e,cls:t,footer:n,onPreview:i,onFetch:s}){const{url:l,size:a,loaded:c}=Rh(e);return c&&!l?y.jsxs("div",{className:t+" filecard-bubble file-offdevice-bubble",children:[e.available===!1?y.jsx(Ah,{rec:e,onFetch:s}):y.jsx(jh,{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(ke,{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:a?Vr(a):e.size?Vr(e.size):""})]}),w1(e.filename)&&l&&i&&y.jsx("button",{className:"icon-btn",onClick:()=>i(e),title:"Preview markdown",children:y.jsx(ke,{name:"monitor",size:16})}),Is(e.filename,e.mime)&&l&&i&&y.jsx("button",{className:"icon-btn",onClick:()=>i(e),title:"Preview HTML",children:y.jsx(ke,{name:"monitor",size:16})}),y.jsx("a",{className:"icon-btn"+(l?"":" disabled"),href:l??void 0,download:e.filename,title:"Download",children:y.jsx(ke,{name:"download",size:16})})]}),n]})}function R1(e){const{att:t}=e,[n,i]=k.useState(null);return k.useEffect(()=>{const s=P1({mime:t.mime,filename:t.filename}),l=URL.createObjectURL(new Blob([t.bytes],{type:s}));return i(l),()=>URL.revokeObjectURL(l)},[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(ke,{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:[Vr(t.bytes.length),t.originalSize&&t.originalSize>t.bytes.length?` · optimized from ${Vr(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(ke,{name:"close"})})]})}const OD={channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},FD=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`,zv=84,Vv=120,zD=550,VD=Math.floor(rs/(gd/8)),BD=Math.min(300,VD),$D=PD;function j1(e){const[t,n]=k.useState("idle"),[i,s]=k.useState(0),[l,a]=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"),T=k.useRef(!1),A=k.useRef({x:0,y:0}),j=k.useRef(0),R=k.useRef(!1),V=k.useRef(null),D=k.useRef(null),G=k.useRef(null),$=k.useRef(e.onReady),_=k.useRef(e.onError),P=k.useRef(e.onActiveChange);$.current=e.onReady,_.current=e.onError,P.current=e.onActiveChange;const K=te=>{p.current=te,n(te),P.current?.(te==="recording"||te==="locked"||te==="arming")},F=()=>{D.current!=null&&cancelAnimationFrame(D.current),D.current=null,G.current&&clearInterval(G.current),G.current=null,V.current?.close().catch(()=>{}),V.current=null,w.current?.getTracks().forEach(te=>te.stop()),w.current=null},ie=()=>{window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",Q),window.removeEventListener("pointercancel",Q)},Z=te=>{T.current=te;const me=v.current;me&&me.state!=="inactive"?me.stop():ee(),ie()},ee=()=>{F(),K("idle"),s(0),a([]),f(0),m(0)},pe=()=>{p.current==="recording"&&(ie(),m(0),K("locked"))};function xe(te){if(p.current!=="recording")return;const me=A.current.y-te.clientY,ye=A.current.x-te.clientX,de=Math.max(0,Math.min(1,me/zv)),Te=Math.max(0,Math.min(1,ye/Vv));f(de),m(Te),me>=zv?pe():ye>=Vv&&Z(!0)}function Q(){if(p.current==="arming"){R.current=!0,ie();return}if(p.current!=="recording")return;const te=Date.now()-j.current<zD;Z(te)}const fe=te=>{e.disabled||p.current!=="idle"||(te.preventDefault(),A.current={x:te.clientX,y:te.clientY},R.current=!1,T.current=!1,S.current=[],f(0),m(0),K("arming"),window.addEventListener("pointermove",xe),window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q),N())};async function N(){let te;try{te=await navigator.mediaDevices.getUserMedia({audio:OD})}catch{_.current("Microphone unavailable — check the browser permission."),ie(),K("idle");return}if(R.current||p.current==="idle"){te.getTracks().forEach(de=>de.stop()),K("idle");return}w.current=te;const me=kD.find(de=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(de.rec));C.current=me?.ext??"webm",E.current=me?.base??"audio/webm";const ye=me?new MediaRecorder(te,{mimeType:me.rec,audioBitsPerSecond:gd}):new MediaRecorder(te,{audioBitsPerSecond:gd});v.current=ye,ye.ondataavailable=de=>{de.data.size>0&&S.current.push(de.data)},ye.onstop=()=>{if(T.current){ee();return}const Te=new Blob(S.current,{type:E.current});Promise.all([Te.arrayBuffer(),TD(Te)]).then(([ge,_e])=>{if(ee(),ge.byteLength===0)return;const He=new Date().toISOString().replace(/[-:]/g,"").replace(/\..+/,"").replace("T","-");$.current({filename:`${A0}${He}.${C.current}`,mime:CD(HA(E.current),_e),bytes:new Uint8Array(ge),voice:!0})})},ye.start(),j.current=Date.now(),K("recording"),s(0),G.current=setInterval(()=>{s(de=>{const Te=de+1;return Te>=BD&&Z(!1),Te})},1e3),O(te)}function O(te){try{const me=window.AudioContext||window.webkitAudioContext,ye=new me;V.current=ye;const de=ye.createMediaStreamSource(te),Te=ye.createAnalyser();Te.fftSize=256,de.connect(Te);const ge=new Uint8Array(Te.fftSize),_e=MD();let He=0;const tt=gt=>{if(D.current=requestAnimationFrame(tt),gt-He<80)return;He=gt,Te.getByteTimeDomainData(ge);let at=0;for(let Ke=0;Ke<ge.length;Ke++){const jt=(ge[Ke]-128)/128;at+=jt*jt}const _t=Math.sqrt(at/ge.length),ot=_e.push(_t);a(Ke=>{const jt=Ke.length>=$D?Ke.slice(1):Ke.slice();return jt.push(ot),jt})};D.current=requestAnimationFrame(tt)}catch{}}k.useEffect(()=>()=>{T.current=!0,v.current?.stop(),ie(),F()},[]);const J=t==="recording"||t==="locked"||t==="arming",M=y.jsx("div",{className:"vr-wave","aria-hidden":!0,children:l.map((te,me)=>y.jsx("span",{className:"vr-bar",style:{height:`${Math.round(te*100)}%`}},me))});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:fe,onContextMenu:te=>te.preventDefault(),children:y.jsx(ke,{name:"mic",size:18})}),J&&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(ke,{name:"lock",size:13}),y.jsx(ke,{name:"chevronDown",size:12})]}),y.jsx("span",{className:"voice-rec-dot"}),y.jsx("span",{className:"vr-time mono",children:FD(i)}),t==="locked"?y.jsxs(y.Fragment,{children:[M,y.jsx("button",{className:"icon-btn vr-trash",title:"Cancel",onClick:()=>Z(!0),children:y.jsx(ke,{name:"trash",size:16})}),y.jsxs("button",{className:"btn primary sm vr-stop",onClick:()=>Z(!1),children:[y.jsx(ke,{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"})]})]})]})}const UD="modulepreload",WD=function(e){return"/"+e},Bv={},Nh=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let a=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");s=a(n.map(h=>{if(h=WD(h),h in Bv)return;Bv[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":UD,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 l(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return s.then(a=>{for(const c of a||[])c.status==="rejected"&&l(c.reason);return t().catch(l)})};var HD=Object.defineProperty,uo=(e,t)=>HD(e,"name",{value:t,configurable:!0}),A1=!!(typeof window<"u"&&window.document&&window.document.createElement);function Or(e,t,{checkForDefaultPrevented:n=!0}={}){return uo(function(s){if(e?.(s),n===!1||!s||!s.defaultPrevented)return t?.(s)},"handleEvent")}uo(Or,"composeEventHandlers");function KD(e){if(!A1)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}uo(KD,"getOwnerWindow");function yd(e){if(!A1)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}uo(yd,"getOwnerDocument");function N1(e,t=!1){const{activeElement:n}=yd(e);if(!n?.nodeName)return null;if(M1(n)&&n.contentDocument)return N1(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const s=yd(n).getElementById(i);if(s)return s}}return n}uo(N1,"getActiveElement");function M1(e){return e.tagName==="IFRAME"}uo(M1,"isFrame");var qD=Object.defineProperty,Mh=(e,t)=>qD(e,"name",{value:t,configurable:!0});function vd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Mh(vd,"setRef");function I1(...e){return t=>{let n=!1;const i=e.map(s=>{const l=vd(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<i.length;s++){const l=i[s];typeof l=="function"?l():vd(e[s],null)}}}}Mh(I1,"composeRefs");function co(...e){return k.useCallback(I1(...e),e)}Mh(co,"useComposedRefs");var XD=Object.defineProperty,kn=(e,t)=>XD(e,"name",{value:t,configurable:!0});function YD(e,t){const n=k.createContext(t);n.displayName=e+"Context";const i=kn(l=>{const{children:a,...c}=l,f=k.useMemo(()=>c,Object.values(c));return y.jsx(n.Provider,{value:f,children:a})},"Provider");i.displayName=e+"Provider";function s(l,a={}){const{optional:c=!1}=a,f=k.useContext(n);if(f)return f;if(t!==void 0)return t;if(!c)throw new Error(`\`${l}\` must be used within \`${e}\``)}return kn(s,"useContext"),[i,s]}kn(YD,"createContext");function D1(e,t=[]){let n=[];function i(l,a){const c=k.createContext(a);c.displayName=l+"Context";const f=n.length;n=[...n,a];const h=kn(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=l+"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(a!==void 0)return a;if(!S)throw new Error(`\`${p}\` must be used within \`${l}\``)}return kn(m,"useContext"),[h,m]}kn(i,"createContext");const s=kn(()=>{const l=n.map(a=>k.createContext(a));return kn(function(c){const f=c?.[e]||l;return k.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])},"useScope")},"createScope");return s.scopeName=e,[i,_1(s,...t)]}kn(D1,"createContextScope");function _1(...e){const t=e[0];if(e.length===1)return t;const n=kn(()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return kn(function(l){const a=i.reduce((c,{useScope:f,scopeName:h})=>{const p=f(l)[`__scope${h}`];return{...c,...p}},{});return k.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}kn(_1,"composeContextScopes");var Br=globalThis?.document?k.useLayoutEffect:()=>{},GD=Object.defineProperty,QD=(e,t)=>GD(e,"name",{value:t,configurable:!0}),JD=Ts[" useId ".trim().toString()]||(()=>{}),ZD=0;function yl(e){const[t,n]=k.useState(JD());return Br(()=>{e||n(i=>i??String(ZD++))},[e]),e||(t?`radix-${t}`:"")}QD(yl,"useId");var e_=Object.defineProperty,t_=(e,t)=>e_(e,"name",{value:t,configurable:!0}),$v=Ts[" useEffectEvent ".trim().toString()],Uv=Ts[" useInsertionEffect ".trim().toString()];function L1(e){if(typeof $v=="function")return $v(e);const t=k.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Uv=="function"?Uv(()=>{t.current=e}):Br(()=>{t.current=e}),k.useMemo(()=>(...n)=>t.current?.(...n),[])}t_(L1,"useEffectEvent");var n_=Object.defineProperty,Ds=(e,t)=>n_(e,"name",{value:t,configurable:!0}),r_=Ts[" useInsertionEffect ".trim().toString()]||Br;function O1({prop:e,defaultProp:t,onChange:n=Ds(()=>{},"onChange"),caller:i}){const[s,l,a]=F1({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:s,h=k.useCallback(m=>{if(c){const p=z1(m)?m(e):m;p!==e&&a.current?.(p)}else l(m)},[c,e,l,a]);return[f,h]}Ds(O1,"useControllableState");function F1({defaultProp:e,onChange:t}){const[n,i]=k.useState(e),s=k.useRef(n),l=k.useRef(t);return r_(()=>{l.current=t},[t]),k.useEffect(()=>{s.current!==n&&(l.current?.(n),s.current=n)},[n,s]),[n,i,l]}Ds(F1,"useUncontrolledState");function z1(e){return typeof e=="function"}Ds(z1,"isFunction");var Wv=Symbol("RADIX:SYNC_STATE");function i_(e,t,n,i){const{prop:s,defaultProp:l,onChange:a,caller:c}=t,f=s!==void 0,h=L1(a),m=[{...n,state:l}];i&&m.push(i);const[p,v]=k.useReducer((E,T)=>{if(T.type===Wv)return{...E,state:T.state};const A=e(E,T);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:Wv,state:s})},[s,p.state,f]),[C,v]}Ds(i_,"useControllableStateReducer");var V1=Ox(),o_=Object.defineProperty,On=(e,t)=>o_(e,"name",{value:t,configurable:!0});function Ih(e){const t=k.forwardRef((n,i)=>{let{children:s,...l}=n,a=null,c=!1;const f=[];xd(s)&&typeof Ja=="function"&&(s=Ja(s._payload)),k.Children.forEach(s,v=>{if(W1(v)){c=!0;const w=v;let S="child"in w.props?w.props.child:w.props.children;xd(S)&&typeof Ja=="function"&&(S=Ja(S._payload)),a=a_(w,S),f.push(a?.props?.children)}else f.push(v)}),a?a=k.cloneElement(a,void 0,f):!c&&k.Children.count(s)===1&&k.isValidElement(s)&&(a=s);const h=a?U1(a):void 0,m=co(i,h);if(!a){if(s||s===0)throw new Error(c?c_(e):u_(e));return s}const p=$1(l,a.props??{});return a.type!==k.Fragment&&(p.ref=i?m:h),k.cloneElement(a,p)});return t.displayName=`${e}.Slot`,t}On(Ih,"createSlot");var B1=Symbol.for("radix.slottable");function s_(e){const t=On(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=B1,t}On(s_,"createSlottable");var a_=On((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 $1(e,t){const n={...t};for(const i in t){const s=e[i],l=t[i];/^on[A-Z]/.test(i)?s&&l?n[i]=(...c)=>{const f=l(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...l}:i==="className"&&(n[i]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}On($1,"mergeProps");function U1(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)}On(U1,"getElementRef");function W1(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B1}On(W1,"isSlottable");var l_=Symbol.for("react.lazy");function xd(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===l_&&"_payload"in e&&H1(e._payload)}On(xd,"isLazyComponent");function H1(e){return typeof e=="object"&&e!==null&&"then"in e}On(H1,"isPromiseLike");var u_=On(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),c_=On(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ja=Ts[" use ".trim().toString()],f_=Object.defineProperty,d_=(e,t)=>f_(e,"name",{value:t,configurable:!0}),h_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gi=h_.reduce((e,t)=>{const n=Ih(`Primitive.${t}`),i=k.forwardRef((s,l)=>{const{asChild:a,...c}=s,f=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(f,{...c,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function K1(e,t){e&&V1.flushSync(()=>e.dispatchEvent(t))}d_(K1,"dispatchDiscreteCustomEvent");var p_=Object.defineProperty,m_=(e,t)=>p_(e,"name",{value:t,configurable:!0});function io(e){const t=k.useRef(e);return k.useEffect(()=>{t.current=e}),k.useMemo(()=>(...n)=>t.current?.(...n),[])}m_(io,"useCallbackRef");var g_=Object.defineProperty,Rt=(e,t)=>g_(e,"name",{value:t,configurable:!0}),wd="dismissableLayer.update",y_="dismissableLayer.pointerDownOutside",v_="dismissableLayer.focusOutside",Hv,q1=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),x_=k.forwardRef(Rt(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,onDismiss:h,...m}=t,p=k.useContext(q1),[v,w]=k.useState(null),S=v?.ownerDocument??globalThis?.document,[,C]=k.useState({}),E=co(n,w),T=Array.from(p.layers),[A]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),j=A?T.indexOf(A):-1,R=v?T.indexOf(v):-1,V=p.layersWithOutsidePointerEventsDisabled.size>0,D=R>=j,G=k.useRef(!1),$=Y1(F=>{a?.(F),f?.(F),F.defaultPrevented||h?.()},{ownerDocument:S,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:G,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(F=>{if(!(F instanceof Node))return!1;const ie=[...p.branches].some(Z=>Z.contains(F));return D&&!ie},[p.branches,D])}),_=G1(F=>{if(s&&G.current)return;const ie=F.target;[...p.branches].some(ee=>ee.contains(ie))||(c?.(F),f?.(F),F.defaultPrevented||h?.())},S),P=v?R===T.length-1:!1,K=io(F=>{F.key==="Escape"&&(l?.(F),!F.defaultPrevented&&h&&(F.preventDefault(),h()))});return k.useEffect(()=>{if(P)return S.addEventListener("keydown",K,{capture:!0}),()=>S.removeEventListener("keydown",K,{capture:!0})},[S,P,K]),k.useEffect(()=>{if(v)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Hv=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),kd(),()=>{i&&(p.layersWithOutsidePointerEventsDisabled.delete(v),p.layersWithOutsidePointerEventsDisabled.size===0&&(S.body.style.pointerEvents=Hv))}},[v,S,i,p]),k.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),kd())},[v,p]),k.useEffect(()=>{const F=Rt(()=>C({}),"handleUpdate");return document.addEventListener(wd,F),()=>document.removeEventListener(wd,F)},[]),y.jsx(gi.div,{...m,ref:E,style:{pointerEvents:V?D?"auto":"none":void 0,...t.style},onFocusCapture:Or(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Or(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Or(t.onPointerDownCapture,$.onPointerDownCapture)})},"DismissableLayer"));function X1(){const e=k.useContext(q1),[t,n]=k.useState(null);return k.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Rt(X1,"useDismissableLayerSurface");var w_=Rt(()=>!0,"IS_TRUE");function Y1(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:l,shouldHandlePointerDownOutside:a=w_}=t,c=io(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()}Rt(v,"resetOutsideInteraction");function w(){return Array.from(m.current.values()).some(Boolean)}Rt(w,"isOutsideInteractionIntercepted");function S(j){if(!h.current)return;const R=j.target;R instanceof Node&&[...l].some(D=>D.contains(R))||m.current.set(j.type,!0),j.type==="click"&&window.setTimeout(()=>{h.current&&p.current()},0)}Rt(S,"handleInteractionCapture");function C(j){h.current&&m.current.set(j.type,!1)}Rt(C,"handleInteractionBubble");const E=Rt(j=>{if(j.target&&!f.current){let R=function(){n.removeEventListener("click",p.current);const D=w();v(),D||Dh(y_,c,V,{discrete:!0})};if(Rt(R,"handleAndDispatchPointerDownOutsideEvent"),!a(j.target)){n.removeEventListener("click",p.current),v(),f.current=!1;return}const V={originalEvent:j};h.current=!0,s.current=i&&j.button===0,m.current.clear(),!i||j.button!==0?R():(n.removeEventListener("click",p.current),p.current=R,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),v();f.current=!1},"handlePointerDown"),T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const j of T)n.addEventListener(j,S,!0),n.addEventListener(j,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 j of T)n.removeEventListener(j,S,!0),n.removeEventListener(j,C)}},[n,c,i,s,l,a]),{onPointerDownCapture:Rt(()=>f.current=!0,"onPointerDownCapture")}}Rt(Y1,"usePointerDownOutside");function G1(e,t=globalThis?.document){const n=io(e),i=k.useRef(!1);return k.useEffect(()=>{const s=Rt(l=>{l.target&&!i.current&&Dh(v_,n,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:Rt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Rt(()=>i.current=!1,"onBlurCapture")}}Rt(G1,"useFocusOutside");function kd(){const e=new CustomEvent(wd);document.dispatchEvent(e)}Rt(kd,"dispatchUpdate");function Dh(e,t,n,{discrete:i}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),i?K1(s,l):s.dispatchEvent(l)}Rt(Dh,"handleAndDispatchCustomEvent");var k_=Object.defineProperty,Yt=(e,t)=>k_(e,"name",{value:t,configurable:!0}),df="focusScope.autoFocusOnMount",hf="focusScope.autoFocusOnUnmount",Kv={bubbles:!1,cancelable:!0},S_=k.forwardRef(Yt(function(t,n){const{loop:i=!1,trapped:s=!1,onMountAutoFocus:l,onUnmountAutoFocus:a,...c}=t,[f,h]=k.useState(null),m=io(l),p=io(a),v=k.useRef(null),w=co(n,h),S=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(s){let E=function(R){if(S.paused||!f)return;const V=R.target;f.contains(V)?v.current=V:lr(v.current,{select:!0})},T=function(R){if(S.paused||!f)return;const V=R.relatedTarget;V!==null&&(f.contains(V)||lr(v.current,{select:!0}))},A=function(R){if(document.activeElement===document.body)for(const D of R)D.removedNodes.length>0&&lr(f)};Yt(E,"handleFocusIn"),Yt(T,"handleFocusOut"),Yt(A,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",T);const j=new MutationObserver(A);return f&&j.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",T),j.disconnect()}}},[s,f,S.paused]),k.useEffect(()=>{if(f){qv.add(S);const E=document.activeElement;if(!f.contains(E)){const A=new CustomEvent(df,Kv);f.addEventListener(df,m),f.dispatchEvent(A),A.defaultPrevented||(Q1(nk(_h(f)),{select:!0}),document.activeElement===E&&lr(f))}return()=>{f.removeEventListener(df,m),setTimeout(()=>{const A=new CustomEvent(hf,Kv);f.addEventListener(hf,p),f.dispatchEvent(A),A.defaultPrevented||lr(E??document.body,{select:!0}),f.removeEventListener(hf,p),qv.remove(S)},0)}}},[f,m,p,S]);const C=k.useCallback(E=>{if(!i&&!s||S.paused)return;const T=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,A=document.activeElement;if(T&&A){const j=E.currentTarget,[R,V]=J1(j);R&&V?!E.shiftKey&&A===V?(E.preventDefault(),i&&lr(R,{select:!0})):E.shiftKey&&A===R&&(E.preventDefault(),i&&lr(V,{select:!0})):A===j&&E.preventDefault()}},[i,s,S.paused]);return y.jsx(gi.div,{tabIndex:-1,...c,ref:w,onKeyDown:C})},"FocusScope"));function Q1(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(lr(i,{select:t}),document.activeElement!==n)return}Yt(Q1,"focusFirst");function J1(e){const t=_h(e),n=Sd(t,e),i=Sd(t.reverse(),e);return[n,i]}Yt(J1,"getTabbableEdges");function _h(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Yt(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}Yt(_h,"getTabbableCandidates");function Sd(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):Z1(i,{upTo:t})))return i}Yt(Sd,"findVisible");function Z1(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}Yt(Z1,"isHidden");function ek(e){return e instanceof HTMLInputElement&&"select"in e}Yt(ek,"isSelectableInput");function lr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ek(e)&&t&&e.select()}}Yt(lr,"focus");var qv=tk();function tk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=bd(e,t),e.unshift(t)},remove(t){e=bd(e,t),e[0]?.resume()}}}Yt(tk,"createFocusScopesStack");function bd(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}Yt(bd,"arrayRemove");function nk(e){return e.filter(t=>t.tagName!=="A")}Yt(nk,"removeLinks");var b_=Object.defineProperty,C_=(e,t)=>b_(e,"name",{value:t,configurable:!0}),E_=k.forwardRef(C_(function(t,n){const{container:i,...s}=t,[l,a]=k.useState(!1);Br(()=>a(!0),[]);const c=i||l&&globalThis?.document?.body;return c?V1.createPortal(y.jsx(gi.div,{...s,ref:n}),c):null},"Portal")),T_=Object.defineProperty,ur=(e,t)=>T_(e,"name",{value:t,configurable:!0});function rk(e,t){return k.useReducer((n,i)=>t[n][i]??n,e)}ur(rk,"useStateMachine");var Lh=ur(e=>{const{present:t,children:n}=e,i=ik(t),s=typeof n=="function"?n({present:i.isPresent}):k.Children.only(n),l=ok(i.ref,sk(s));return typeof n=="function"||i.isPresent?k.cloneElement(s,{ref:l}):null},"Presence");function ik(e){const[t,n]=k.useState(),i=k.useRef(null),s=k.useRef(e),l=k.useRef("none"),a=k.useRef(void 0),c=e?"mounted":"unmounted",[f,h]=rk(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{f==="mounted"?(l.current=a.current??Xi(i.current),a.current=void 0):l.current="none"},[f]),Br(()=>{const m=i.current,p=s.current;if(p!==e){const w=l.current,S=Xi(m);e?(a.current=S,h("MOUNT")):S==="none"||m?.display==="none"?h("UNMOUNT"):h(p&&w!==S?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Br(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,v=ur(S=>{const E=Xi(i.current).includes(CSS.escape(S.animationName));if(S.target===t&&E&&(h("ANIMATION_END"),!s.current)){const T=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=T)})}},"handleAnimationEnd"),w=ur(S=>{S.target===t&&(l.current=Xi(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,a.current=Xi(p)}else i.current=null;n(m)},[])}}ur(ik,"usePresence");function Cd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ur(Cd,"setRef");function ok(...e){const t=k.useRef(e);return t.current=e,k.useCallback(n=>{const i=t.current;let s=!1;const l=i.map(a=>{const c=Cd(a,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let a=0;a<l.length;a++){const c=l[a];typeof c=="function"?c():Cd(i[a],null)}}},[])}ur(ok,"useStableComposedRefs");function Xi(e){return e?.animationName||"none"}ur(Xi,"getAnimationName");function sk(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)}ur(sk,"getElementRef");var P_=Object.defineProperty,Oh=(e,t)=>P_(e,"name",{value:t,configurable:!0}),Za=0,Bi=null;function R_(e){return Fh(),e.children}Oh(R_,"FocusGuards");function Fh(){k.useEffect(()=>{Bi||(Bi={start:Ed(),end:Ed()});const{start:e,end:t}=Bi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Za++,()=>{Za===1&&(Bi?.start.remove(),Bi?.end.remove(),Bi=null),Za=Math.max(0,Za-1)}},[])}Oh(Fh,"useFocusGuards");function Ed(){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}Oh(Ed,"createFocusGuard");var qn=function(){return qn=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},qn.apply(this,arguments)};function ak(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 j_(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,l;i<s;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}var vl="right-scroll-bar-position",xl="width-before-scroll-bar",A_="with-scroll-bars-hidden",N_="--removed-body-scroll-bar-size";function pf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function M_(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 I_=typeof window<"u"?k.useLayoutEffect:k.useEffect,Xv=new WeakMap;function D_(e,t){var n=M_(null,function(i){return e.forEach(function(s){return pf(s,i)})});return I_(function(){var i=Xv.get(n);if(i){var s=new Set(i),l=new Set(e),a=n.current;s.forEach(function(c){l.has(c)||pf(c,null)}),l.forEach(function(c){s.has(c)||pf(c,a)})}Xv.set(n,e)},[e]),n}function __(e){return e}function L_(e,t){t===void 0&&(t=__);var n=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var a=t(l,i);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(l){for(i=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){i=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(l),a=n}var f=function(){var m=a;a=[],m.forEach(l)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){a.push(m),h()},filter:function(m){return a=a.filter(m),n}}}};return s}function O_(e){e===void 0&&(e={});var t=L_(null);return t.options=qn({async:!0,ssr:!1},e),t}var lk=function(e){var t=e.sideCar,n=ak(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,qn({},n))};lk.isSideCarExport=!0;function F_(e,t){return e.useMedium(t),lk}var uk=O_(),mf=function(){},Ql=k.forwardRef(function(e,t){var n=k.useRef(null),i=k.useState({onScrollCapture:mf,onWheelCapture:mf,onTouchMoveCapture:mf}),s=i[0],l=i[1],a=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,T=e.as,A=T===void 0?"div":T,j=e.gapMode,R=ak(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),V=v,D=D_([n,t]),G=qn(qn({},R),s);return k.createElement(k.Fragment,null,m&&k.createElement(V,{sideCar:uk,removeScrollBar:h,shards:p,noRelative:w,noIsolation:S,inert:C,setCallbacks:l,allowPinchZoom:!!E,lockRef:n,gapMode:j}),a?k.cloneElement(k.Children.only(c),qn(qn({},G),{ref:D})):k.createElement(A,qn({},G,{className:f,ref:D}),c))});Ql.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ql.classNames={fullWidth:xl,zeroRight:vl};var z_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function V_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=z_();return t&&e.setAttribute("nonce",t),e}function B_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var U_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=V_())&&(B_(t,n),$_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},W_=function(){var e=U_();return function(t,n){k.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ck=function(){var e=W_(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},H_={left:0,top:0,right:0,gap:0},gf=function(e){return parseInt(e||"",10)||0},K_=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[gf(n),gf(i),gf(s)]},q_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return H_;var t=K_(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])}},X_=ck(),Zi="data-scroll-locked",Y_=function(e,t,n,i){var s=e.left,l=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
268
+ .`.concat(A_,` {
269
+ overflow: hidden `).concat(i,`;
270
+ padding-right: `).concat(c,"px ").concat(i,`;
271
+ }
272
+ body[`).concat(Zi,`] {
273
+ overflow: hidden `).concat(i,`;
274
+ overscroll-behavior: contain;
275
+ `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
276
+ padding-left: `.concat(s,`px;
277
+ padding-top: `).concat(l,`px;
278
+ padding-right: `).concat(a,`px;
279
+ margin-left:0;
280
+ margin-top:0;
281
+ margin-right: `).concat(c,"px ").concat(i,`;
282
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
283
+ }
284
+
285
+ .`).concat(vl,` {
286
+ right: `).concat(c,"px ").concat(i,`;
287
+ }
288
+
289
+ .`).concat(xl,` {
290
+ margin-right: `).concat(c,"px ").concat(i,`;
291
+ }
292
+
293
+ .`).concat(vl," .").concat(vl,` {
294
+ right: 0 `).concat(i,`;
295
+ }
296
+
297
+ .`).concat(xl," .").concat(xl,` {
298
+ margin-right: 0 `).concat(i,`;
299
+ }
300
+
301
+ body[`).concat(Zi,`] {
302
+ `).concat(N_,": ").concat(c,`px;
303
+ }
304
+ `)},Yv=function(){var e=parseInt(document.body.getAttribute(Zi)||"0",10);return isFinite(e)?e:0},G_=function(){k.useEffect(function(){return document.body.setAttribute(Zi,(Yv()+1).toString()),function(){var e=Yv()-1;e<=0?document.body.removeAttribute(Zi):document.body.setAttribute(Zi,e.toString())}},[])},Q_=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;G_();var l=k.useMemo(function(){return q_(s)},[s]);return k.createElement(X_,{styles:Y_(l,!t,s,n?"":"!important")})},Td=!1;if(typeof window<"u")try{var el=Object.defineProperty({},"passive",{get:function(){return Td=!0,!0}});window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Td=!1}var $i=Td?{passive:!1}:!1,J_=function(e){return e.tagName==="TEXTAREA"},fk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!J_(e)&&n[t]==="visible")},Z_=function(e){return fk(e,"overflowY")},eL=function(e){return fk(e,"overflowX")},Gv=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=dk(e,i);if(s){var l=hk(e,i),a=l[1],c=l[2];if(a>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},tL=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},nL=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},dk=function(e,t){return e==="v"?Z_(t):eL(t)},hk=function(e,t){return e==="v"?tL(t):nL(t)},rL=function(e,t){return e==="h"&&t==="rtl"?-1:1},iL=function(e,t,n,i,s){var l=rL(e,window.getComputedStyle(t).direction),a=l*i,c=n.target,f=t.contains(c),h=!1,m=a>0,p=0,v=0;do{if(!c)break;var w=hk(e,c),S=w[0],C=w[1],E=w[2],T=C-E-l*S;(S||T)&&dk(e,c)&&(p+=T,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},tl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qv=function(e){return[e.deltaX,e.deltaY]},Jv=function(e){return e&&"current"in e?e.current:e},oL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sL=function(e){return`
305
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
306
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
307
+ `)},aL=0,Ui=[];function lL(e){var t=k.useRef([]),n=k.useRef([0,0]),i=k.useRef(),s=k.useState(aL++)[0],l=k.useState(ck)[0],a=k.useRef(e);k.useEffect(function(){a.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=j_([e.lockRef.current],(e.shards||[]).map(Jv),!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!a.current.allowPinchZoom;var T=tl(C),A=n.current,j="deltaX"in C?C.deltaX:A[0]-T[0],R="deltaY"in C?C.deltaY:A[1]-T[1],V,D=C.target,G=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in C&&G==="h"&&D.type==="range")return!1;var $=window.getSelection(),_=$&&$.anchorNode,P=_?_===D||_.contains(D):!1;if(P)return!1;var K=Gv(G,D);if(!K)return!0;if(K?V=G:(V=G==="v"?"h":"v",K=Gv(G,D)),!K)return!1;if(!i.current&&"changedTouches"in C&&(j||R)&&(i.current=V),!V)return!0;var F=i.current||V;return iL(F,E,C,F==="h"?j:R)},[]),f=k.useCallback(function(C){var E=C;if(!(!Ui.length||Ui[Ui.length-1]!==l)){var T="deltaY"in E?Qv(E):tl(E),A=t.current.filter(function(V){return V.name===E.type&&(V.target===E.target||E.target===V.shadowParent)&&oL(V.delta,T)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var j=(a.current.shards||[]).map(Jv).filter(Boolean).filter(function(V){return V.contains(E.target)}),R=j.length>0?c(E,j[0]):!a.current.noIsolation;R&&E.cancelable&&E.preventDefault()}}},[]),h=k.useCallback(function(C,E,T,A){var j={name:C,delta:E,target:T,should:A,shadowParent:uL(T)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(R){return R!==j})},1)},[]),m=k.useCallback(function(C){n.current=tl(C),i.current=void 0},[]),p=k.useCallback(function(C){h(C.type,Qv(C),C.target,c(C,e.lockRef.current))},[]),v=k.useCallback(function(C){h(C.type,tl(C),C.target,c(C,e.lockRef.current))},[]);k.useEffect(function(){return Ui.push(l),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,$i),document.addEventListener("touchmove",f,$i),document.addEventListener("touchstart",m,$i),function(){Ui=Ui.filter(function(C){return C!==l}),document.removeEventListener("wheel",f,$i),document.removeEventListener("touchmove",f,$i),document.removeEventListener("touchstart",m,$i)}},[]);var w=e.removeScrollBar,S=e.inert;return k.createElement(k.Fragment,null,S?k.createElement(l,{styles:sL(s)}):null,w?k.createElement(Q_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function uL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cL=F_(uk,lL);var pk=k.forwardRef(function(e,t){return k.createElement(Ql,qn({},e,{ref:t,sideCar:cL}))});pk.classNames=Ql.classNames;var fL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wi=new WeakMap,nl=new WeakMap,rl={},yf=0,mk=function(e){return e&&(e.host||mk(e.parentNode))},dL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=mk(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})},hL=function(e,t,n,i){var s=dL(t,Array.isArray(e)?e:[e]);rl[n]||(rl[n]=new WeakMap);var l=rl[n],a=[],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=(Wi.get(v)||0)+1,E=(l.get(v)||0)+1;Wi.set(v,C),l.set(v,E),a.push(v),C===1&&S&&nl.set(v,!0),E===1&&v.setAttribute(n,"true"),S||v.setAttribute(i,"true")}catch(T){console.error("aria-hidden: cannot operate on ",v,T)}})};return m(t),c.clear(),yf++,function(){a.forEach(function(p){var v=Wi.get(p)-1,w=l.get(p)-1;Wi.set(p,v),l.set(p,w),v||(nl.has(p)||p.removeAttribute(i),nl.delete(p)),w||p.removeAttribute(n)}),yf--,yf||(Wi=new WeakMap,Wi=new WeakMap,nl=new WeakMap,rl={})}},pL=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=fL(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),hL(i,s,n,"aria-hidden")):function(){return null}},mL=Object.defineProperty,Cn=(e,t)=>mL(e,"name",{value:t,configurable:!0}),zh="Dialog",[gk,Gz]=D1(zh),[gL,Qn]=gk(zh),yk=Cn(e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:s,onOpenChange:l,modal:a=!0}=e,c=k.useRef(null),f=k.useRef(null),[h,m]=O1({prop:i,defaultProp:s??!1,onChange:l,caller:zh}),[p,v]=k.useState(0),[w,S]=k.useState(0);return y.jsx(gL,{scope:t,triggerRef:c,contentRef:f,contentId:yl(),titleId:yl(),descriptionId:yl(),titlePresent:p>0,descriptionPresent:w>0,setTitleCount:v,setDescriptionCount:S,open:h,onOpenChange:m,onOpenToggle:k.useCallback(()=>m(C=>!C),[m]),modal:a,children:n})},"Dialog"),vk="DialogPortal",[yL,xk]=gk(vk,{forceMount:void 0}),wk=Cn(e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,l=Qn(vk,t);return y.jsx(yL,{scope:t,forceMount:n,children:k.Children.map(i,a=>y.jsx(Lh,{present:n||l.open,children:y.jsx(E_,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),Pd="DialogOverlay",kk=k.forwardRef(Cn(function(t,n){const i=xk(Pd,t.__scopeDialog),{forceMount:s=i.forceMount,...l}=t,a=Qn(Pd,t.__scopeDialog);return a.modal?y.jsx(Lh,{present:s||a.open,children:y.jsx(xL,{...l,ref:n})}):null},"DialogOverlay")),vL=Ih("DialogOverlay.RemoveScroll"),xL=k.forwardRef(Cn(function(t,n){const{__scopeDialog:i,...s}=t,l=Qn(Pd,i),a=X1(),c=co(n,a);return y.jsx(pk,{as:vL,allowPinchZoom:!0,shards:[l.contentRef],children:y.jsx(gi.div,{"data-state":Vh(l.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Ss="DialogContent",Sk=k.forwardRef(Cn(function(t,n){const i=xk(Ss,t.__scopeDialog),{forceMount:s=i.forceMount,...l}=t,a=Qn(Ss,t.__scopeDialog);return y.jsx(Lh,{present:s||a.open,children:a.modal?y.jsx(wL,{...l,ref:n}):y.jsx(kL,{...l,ref:n})})},"DialogContent")),wL=k.forwardRef(Cn(function(t,n){const i=Qn(Ss,t.__scopeDialog),s=k.useRef(null),l=co(n,i.contentRef,s);return k.useEffect(()=>{const a=s.current;if(a)return pL(a)},[]),y.jsx(bk,{...t,ref:l,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Or(t.onCloseAutoFocus,a=>{a.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:Or(t.onPointerDownOutside,a=>{const c=a.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&a.preventDefault()}),onFocusOutside:Or(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),kL=k.forwardRef(Cn(function(t,n){const i=Qn(Ss,t.__scopeDialog),s=k.useRef(!1),l=k.useRef(!1);return y.jsx(bk,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(s.current||i.triggerRef.current?.focus(),a.preventDefault()),s.current=!1,l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=a.target;i.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&l.current&&a.preventDefault()}})},"DialogContentNonModal")),bk=k.forwardRef(Cn(function(t,n){const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:a,...c}=t,f=Qn(Ss,i);return Fh(),y.jsx(y.Fragment,{children:y.jsx(S_,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:a,children:y.jsx(x_,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":Vh(f.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),SL="DialogTitle",Ck=k.forwardRef(Cn(function(t,n){const{__scopeDialog:i,...s}=t,l=Qn(SL,i),{setTitleCount:a}=l;return Br(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),y.jsx(gi.h2,{id:l.titleId,...s,ref:n})},"DialogTitle")),bL="DialogDescription",Ek=k.forwardRef(Cn(function(t,n){const{__scopeDialog:i,...s}=t,l=Qn(bL,i),{setDescriptionCount:a}=l;return Br(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),y.jsx(gi.p,{id:l.descriptionId,...s,ref:n})},"DialogDescription")),CL="DialogClose",Tk=k.forwardRef(Cn(function(t,n){const{__scopeDialog:i,...s}=t,l=Qn(CL,i);return y.jsx(gi.button,{type:"button",...s,ref:n,onClick:Or(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Vh(e){return e?"open":"closed"}Cn(Vh,"getState");function EL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RL={};function Zv(e,t){return(RL.jsx?PL:TL).test(e)}const jL=/[ \t\n\f\r]/g;function AL(e){return typeof e=="object"?e.type==="text"?ex(e.value):!1:ex(e)}function ex(e){return e.replace(jL,"")===""}class _s{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}_s.prototype.normal={};_s.prototype.property={};_s.prototype.space=void 0;function Pk(e,t){const n={},i={};for(const s of e)Object.assign(n,s.property),Object.assign(i,s.normal);return new _s(n,i,t)}function Rd(e){return e.toLowerCase()}class on{constructor(t,n){this.attribute=n,this.property=t}}on.prototype.attribute="";on.prototype.booleanish=!1;on.prototype.boolean=!1;on.prototype.commaOrSpaceSeparated=!1;on.prototype.commaSeparated=!1;on.prototype.defined=!1;on.prototype.mustUseProperty=!1;on.prototype.number=!1;on.prototype.overloadedBoolean=!1;on.prototype.property="";on.prototype.spaceSeparated=!1;on.prototype.space=void 0;let NL=0;const Ie=yi(),xt=yi(),jd=yi(),le=yi(),Qe=yi(),pi=yi(),cn=yi();function yi(){return 2**++NL}const Ad=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:xt,commaOrSpaceSeparated:cn,commaSeparated:pi,number:le,overloadedBoolean:jd,spaceSeparated:Qe},Symbol.toStringTag,{value:"Module"})),vf=Object.keys(Ad);class Bh extends on{constructor(t,n,i,s){let l=-1;if(super(t,n),tx(this,"space",s),typeof i=="number")for(;++l<vf.length;){const a=vf[l];tx(this,vf[l],(i&Ad[a])===Ad[a])}}}Bh.prototype.defined=!0;function tx(e,t,n){n&&(e[t]=n)}function fo(e){const t={},n={};for(const[i,s]of Object.entries(e.properties)){const l=new Bh(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[Rd(i)]=i,n[Rd(l.attribute)]=i}return new _s(t,n,e.space)}const Rk=fo({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:Qe,ariaCurrent:null,ariaDescribedBy:Qe,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:Qe,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:Qe,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qe,ariaLevel:le,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:Qe,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:Qe,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:xt,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 jk(e,t){return t in e?e[t]:t}function Ak(e,t){return jk(e,t.toLowerCase())}const ML=fo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pi,acceptCharset:Qe,accessKey:Qe,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:Qe,autoFocus:Ie,autoPlay:Ie,blocking:Qe,capture:null,charSet:null,checked:Ie,cite:null,className:Qe,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:xt,controls:Ie,controlsList:Qe,coords:le|pi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:jd,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:Qe,height:le,hidden:jd,high:le,href:null,hrefLang:null,htmlFor:Qe,httpEquiv:Qe,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:Qe,itemRef:Qe,itemScope:Ie,itemType:Qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:le,pattern:null,ping:Qe,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:Qe,required:Ie,reversed:Ie,rows:le,rowSpan:le,sandbox:Qe,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:xt,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:Ie,useMap:null,value:xt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qe,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:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:xt,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:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:pi,part:Qe,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:Ak}),IL=fo({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:cn,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:Qe,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:Ie,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:pi,g2:pi,glyphName:pi,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:cn,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:Qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cn,rev:cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cn,requiredFeatures:cn,requiredFonts:cn,requiredFormats:cn,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:cn,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:cn,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:cn,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:jk}),Nk=fo({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()}}),Mk=fo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ak}),Ik=fo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),DL={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"},_L=/[A-Z]/g,nx=/-[a-z]/g,LL=/^data[-\w.:]+$/i;function OL(e,t){const n=Rd(t);let i=t,s=on;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&LL.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(nx,zL);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!nx.test(l)){let a=l.replace(_L,FL);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Bh}return new s(i,t)}function FL(e){return"-"+e.toLowerCase()}function zL(e){return e.charAt(1).toUpperCase()}const VL=Pk([Rk,ML,Nk,Mk,Ik],"html"),$h=Pk([Rk,IL,Nk,Mk,Ik],"svg");function BL(e){return e.join(" ").trim()}var Hi={},xf,rx;function $L(){if(rx)return xf;rx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
308
+ `,h="/",m="*",p="",v="comment",w="declaration";function S(E,T){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];T=T||{};var A=1,j=1;function R(Z){var ee=Z.match(t);ee&&(A+=ee.length);var pe=Z.lastIndexOf(f);j=~pe?Z.length-pe:j+Z.length}function V(){var Z={line:A,column:j};return function(ee){return ee.position=new D(Z),_(),ee}}function D(Z){this.start=Z,this.end={line:A,column:j},this.source=T.source}D.prototype.content=E;function G(Z){var ee=new Error(T.source+":"+A+":"+j+": "+Z);if(ee.reason=Z,ee.filename=T.source,ee.line=A,ee.column=j,ee.source=E,!T.silent)throw ee}function $(Z){var ee=Z.exec(E);if(ee){var pe=ee[0];return R(pe),E=E.slice(pe.length),ee}}function _(){$(n)}function P(Z){var ee;for(Z=Z||[];ee=K();)ee!==!1&&Z.push(ee);return Z}function K(){var Z=V();if(!(h!=E.charAt(0)||m!=E.charAt(1))){for(var ee=2;p!=E.charAt(ee)&&(m!=E.charAt(ee)||h!=E.charAt(ee+1));)++ee;if(ee+=2,p===E.charAt(ee-1))return G("End of comment missing");var pe=E.slice(2,ee-2);return j+=2,R(pe),E=E.slice(ee),j+=2,Z({type:v,comment:pe})}}function F(){var Z=V(),ee=$(i);if(ee){if(K(),!$(s))return G("property missing ':'");var pe=$(l),xe=Z({type:w,property:C(ee[0].replace(e,p)),value:pe?C(pe[0].replace(e,p)):p});return $(a),xe}}function ie(){var Z=[];P(Z);for(var ee;ee=F();)ee!==!1&&(Z.push(ee),P(Z));return Z}return _(),ie()}function C(E){return E?E.replace(c,p):p}return xf=S,xf}var ix;function UL(){if(ix)return Hi;ix=1;var e=Hi&&Hi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=n;const t=e($L());function n(i,s){let l=null;if(!i||typeof i!="string")return l;const a=(0,t.default)(i),c=typeof s=="function";return a.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:m}=f;c?s(h,m,f):m&&(l=l||{},l[h]=m)}),l}return Hi}var Zo={},ox;function WL(){if(ox)return Zo;ox=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},a=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},f=function(h,m){return m===void 0&&(m={}),l(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,c):h=h.replace(i,c),h.replace(t,a))};return Zo.camelCase=f,Zo}var es,sx;function HL(){if(sx)return es;sx=1;var e=es&&es.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(UL()),n=WL();function i(s,l){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(c,f){c&&f&&(a[(0,n.camelCase)(c,l)]=f)}),a}return i.default=i,es=i,es}var KL=HL();const qL=zd(KL),Dk=_k("end"),Uh=_k("start");function _k(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 XL(e){const t=Uh(e),n=Dk(e);if(t&&n)return{start:t,end:n}}class Bt extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(a=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?l.ruleId=i:(l.source=i.slice(0,f),l.ruleId=i.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=cs(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bt.prototype.file="";Bt.prototype.name="";Bt.prototype.reason="";Bt.prototype.message="";Bt.prototype.stack="";Bt.prototype.column=void 0;Bt.prototype.line=void 0;Bt.prototype.ancestors=void 0;Bt.prototype.cause=void 0;Bt.prototype.fatal=void 0;Bt.prototype.place=void 0;Bt.prototype.ruleId=void 0;Bt.prototype.source=void 0;const Wh={}.hasOwnProperty,YL=new Map,GL=/[A-Z]/g,QL=new Set(["table","tbody","thead","tfoot","tr"]),JL=new Set(["td","th"]),Lk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ZL(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=aO(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=sO(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"?$h:VL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Ok(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function Ok(e,t,n){if(t.type==="element")return eO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rO(e,t,n);if(t.type==="mdxjsEsm")return nO(e,t);if(t.type==="root")return iO(e,t,n);if(t.type==="text")return oO(e,t)}function eO(e,t,n){const i=e.schema;let s=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=$h,e.schema=s),e.ancestors.push(t);const l=zk(e,t.tagName,!1),a=lO(e,t);let c=Kh(e,t);return QL.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!AL(f):!0})),Fk(e,a,l,t),Hh(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,n)}function tO(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)}bs(e,t.position)}function nO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bs(e,t.position)}function rO(e,t,n){const i=e.schema;let s=i;t.name==="svg"&&i.space==="html"&&(s=$h,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:zk(e,t.name,!0),a=uO(e,t),c=Kh(e,t);return Fk(e,a,l,t),Hh(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,n)}function iO(e,t,n){const i={};return Hh(i,Kh(e,t)),e.create(t,e.Fragment,i,n)}function oO(e,t){return t.value}function Fk(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Hh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function sO(e,t,n){return i;function i(s,l,a,c){const h=Array.isArray(a.children)?n:t;return c?h(l,a,c):h(l,a)}}function aO(e,t){return n;function n(i,s,l,a){const c=Array.isArray(l.children),f=Uh(i);return t(s,l,a,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function lO(e,t){const n={};let i,s;for(s in t.properties)if(s!=="children"&&Wh.call(t.properties,s)){const l=cO(e,s,t.properties[s]);if(l){const[a,c]=l;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&JL.has(t.tagName)?i=c:n[a]=c}}if(i){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function uO(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const a=l.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else bs(e,t.position);else{const s=i.name;let l;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else bs(e,t.position);else l=i.value===null?!0:i.value;n[s]=l}return n}function Kh(e,t){const n=[];let i=-1;const s=e.passKeys?new Map:YL;for(;++i<t.children.length;){const l=t.children[i];let a;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const h=s.get(f)||0;a=f+"-"+h,s.set(f,h+1)}}const c=Ok(e,l,a);c!==void 0&&n.push(c)}return n}function cO(e,t,n){const i=OL(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?EL(n):BL(n)),i.property==="style"){let s=typeof n=="object"?n:fO(e,String(n));return e.stylePropertyNameCase==="css"&&(s=dO(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?DL[i.property]||i.property:i.attribute,n]}}function fO(e,t){try{return qL(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,s=new Bt("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=Lk+"#cannot-parse-style-attribute",s}}function zk(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,a;for(;++l<s.length;){const c=Zv(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}i=a}else i=Zv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const s=i.value;return Wh.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);bs(e)}function bs(e,t){const n=new Bt("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=Lk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function dO(e){const t={};let n;for(n in e)Wh.call(e,n)&&(t[hO(n)]=e[n]);return t}function hO(e){let t=e.replace(GL,pO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pO(e){return"-"+e.toLowerCase()}const wf={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 mO(e){const t=this;t.parser=n;function n(i){return u1(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function gO(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 yO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
309
+ `}]}function vO(e,t){const n=t.value?t.value+`
310
+ `:"",i={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(i.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function xO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),s=lo(i.toLowerCase()),l=e.footnoteOrder.indexOf(i);let a,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),a=e.footnoteOrder.length):a=l+1,c+=1,e.footnoteCounts.set(i,c);const 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(a)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function SO(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 bO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Vk(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const s=e.all(t),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=i:s.push({type:"text",value:i}),s}function CO(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Vk(e,t);const s={src:lo(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function EO(e,t){const n={src:lo(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 TO(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 PO(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return Vk(e,t);const s={href:lo(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function RO(e,t){const n={href:lo(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 jO(e,t,n){const i=e.all(t),s=n?AO(n):Bk(t),l={},a=[];if(typeof t.checked=="boolean"){const m=i[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(s||c!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
311
+ `}),m.type==="element"&&m.tagName==="p"&&!s?a.push(...m.children):a.push(m)}const f=i[i.length-1];f&&(s||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
312
+ `});const h={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,h),e.applyData(t,h)}function AO(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=Bk(n[i])}return t}function Bk(e){const t=e.spread;return t??e.children.length>1}function NO(e,t){const n={},i=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<i.length;){const a=i[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function MO(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IO(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function DO(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _O(e,t){const n=e.all(t),i=n.shift(),s=[];if(i){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Uh(t.children[1]),f=Dk(t.children[t.children.length-1]);c&&f&&(a.position={start:c,end:f}),s.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function LO(e,t,n){const i=n?n.children:void 0,l=(i?i.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,c=a?a.length:t.children.length;let f=-1;const h=[];for(;++f<c;){const p=t.children[f],v={},w=a?a[f]:void 0;w&&(v.align=w);let S={type:"element",tagName:l,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 OO(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ax=9,lx=32;function FO(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),s=0;const l=[];for(;i;)l.push(ux(t.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=n.exec(t);return l.push(ux(t.slice(s),s>0,!1)),l.join("")}function ux(e,t,n){let i=0,s=e.length;if(t){let l=e.codePointAt(i);for(;l===ax||l===lx;)i++,l=e.codePointAt(i)}if(n){let l=e.codePointAt(s-1);for(;l===ax||l===lx;)s--,l=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function zO(e,t){const n={type:"text",value:FO(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function VO(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const BO={blockquote:gO,break:yO,code:vO,delete:xO,emphasis:wO,footnoteReference:kO,heading:SO,html:bO,imageReference:CO,image:EO,inlineCode:TO,linkReference:PO,link:RO,listItem:jO,list:NO,paragraph:MO,root:IO,strong:DO,table:_O,tableCell:OO,tableRow:LO,text:zO,thematicBreak:VO,toml:il,yaml:il,definition:il,footnoteDefinition:il};function il(){}const $k=-1,Jl=0,fs=1,_l=2,qh=3,Xh=4,Yh=5,Gh=6,Uk=7,Wk=8,Hk=typeof self=="object"?self:globalThis,cx=(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 Hk[e](t)},$O=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),i=s=>{if(e.has(s))return e.get(s);const[l,a]=t[s];switch(l){case Jl:case $k:return n(a,s);case fs:{const c=n([],s);for(const f of a)c.push(i(f));return c}case _l:{const c=n({},s);for(const[f,h]of a)c[i(f)]=i(h);return c}case qh:return n(new Date(a),s);case Xh:{const{source:c,flags:f}=a;return n(new RegExp(c,f),s)}case Yh:{const c=n(new Map,s);for(const[f,h]of a)c.set(i(f),i(h));return c}case Gh:{const c=n(new Set,s);for(const f of a)c.add(i(f));return c}case Uk:{const{name:c,message:f}=a;return n(typeof Hk[c]=="function"?cx(c,f):new Error(f),s)}case Wk:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(cx(l,a),s)};return i},fx=e=>$O(new Map,e)(0),ai="",{toString:UO}={},{keys:WO}=Object,ts=e=>{const t=typeof e;if(t!=="object"||!e)return[Jl,t];const n=UO.call(e).slice(8,-1);switch(n){case"Array":return[fs,ai];case"Object":return[_l,ai];case"Date":return[qh,ai];case"RegExp":return[Xh,ai];case"Map":return[Yh,ai];case"Set":return[Gh,ai];case"DataView":return[fs,n]}return n.includes("Array")?[fs,n]:e instanceof Error?[Uk,e.name||"Error"]:[_l,n]},ol=([e,t])=>e===Jl&&(t==="function"||t==="symbol"),HO=(e,t,n,i)=>{const s=(a,c)=>{const f=i.push(a)-1;return n.set(c,f),f},l=a=>{if(n.has(a))return n.get(a);let[c,f]=ts(a);switch(c){case Jl:{let m=a;switch(f){case"bigint":c=Wk,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return s([$k],a)}return s([c,m],a)}case fs:{if(f){let v=a;return f==="DataView"?v=new Uint8Array(a.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(a)),s([f,[...v]],a)}const m=[],p=s([c,m],a);for(const v of a)m.push(l(v));return p}case _l:{if(f)switch(f){case"BigInt":return s([f,a.toString()],a);case"Boolean":case"Number":case"String":return s([f,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const m=[],p=s([c,m],a);for(const v of WO(a))(e||!ol(ts(a[v])))&&m.push([l(v),l(a[v])]);return p}case qh:return s([c,isNaN(a.getTime())?ai:a.toISOString()],a);case Xh:{const{source:m,flags:p}=a;return s([c,{source:m,flags:p}],a)}case Yh:{const m=[],p=s([c,m],a);for(const[v,w]of a)(e||!(ol(ts(v))||ol(ts(w))))&&m.push([l(v),l(w)]);return p}case Gh:{const m=[],p=s([c,m],a);for(const v of a)(e||!ol(ts(v)))&&m.push(l(v));return p}}const{message:h}=a;return s([c,{name:f,message:h}],a)};return l},dx=(e,{json:t,lossy:n}={})=>{const i=[];return HO(!(t||n),!!t,new Map,i)(e),i},Ll=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fx(dx(e,t)):structuredClone(e):(e,t)=>fx(dx(e,t));function KO(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 qO(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function XO(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KO,i=e.options.footnoteBackLabel||qO,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=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=lo(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 T={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(h,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Ll(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
313
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
314
+ `}]}}const Nd={}.hasOwnProperty,YO={};function GO(e,t){const n=t||YO,i=new Map,s=new Map,l=new Map,a={...BO,...n.handlers},c={all:h,applyData:JO,definitionById:i,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:a,one:f,options:n,patch:QO,wrap:eF};return kh(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(Nd.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,T=Ll(E);return T.children=c.all(m),T}return Ll(m)}return(c.options.unknownHandler||ZO)(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=hx(S.value)),!Array.isArray(S)&&S.type==="element")){const C=S.children[0];C&&C.type==="text"&&(C.value=hx(C.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function QO(e,t){e.position&&(t.position=XL(e))}function JO(e,t){let n=t;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const a="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,Ll(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function ZO(e,t){const n=t.data||{},i="value"in t&&!(Nd.call(n,"hProperties")||Nd.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 eF(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
315
+ `});++i<e.length;)i&&n.push({type:"text",value:`
316
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
317
+ `}),n}function hx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function px(e,t){const n=GO(e,t),i=n.one(e,void 0),s=XO(n),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
318
+ `},s),l}function tF(e,t){return e&&"run"in e?async function(n,i){const s=px(n,{file:i,...t});await e.run(s,i)}:function(n,i){return px(n,{file:i,...e||t})}}function mx(e){if(e)throw e}var kf,gx;function nF(){if(gx)return kf;gx=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var v;for(v in h);return typeof v>"u"||e.call(h,v)},a=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(i)return i(h,m).value}else return;return h[m]};return kf=function f(){var h,m,p,v,w,S,C=arguments[0],E=1,T=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<T;++E)if(h=arguments[E],h!=null)for(m in h)p=c(C,m),v=c(h,m),C!==v&&(A&&v&&(l(v)||(w=s(v)))?(w?(w=!1,S=p&&s(p)?p:[]):S=p&&l(p)?p:{},a(C,{name:m,newValue:f(A,S,v)})):typeof v<"u"&&a(C,{name:m,newValue:v}));return C},kf}var rF=nF();const Sf=zd(rF);function Md(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 iF(){const e=[],t={run:n,use:i};return t;function n(...s){let l=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);c(null,...s);function c(f,...h){const m=e[++l];let p=-1;if(f){a(f);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?oF(m,c)(...h):a(null,...h)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function oF(e,t){let n;return i;function i(...a){const c=e.length>a.length;let f;c&&a.push(s);try{f=e.apply(this,a)}catch(h){const m=h;if(c&&n)throw m;return s(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,s):f instanceof Error?s(f):l(f))}function s(a,...c){n||(n=!0,t(a,...c))}function l(a){s(null,a)}}const Hn={basename:sF,dirname:aF,extname:lF,join:uF,sep:"/"};function sF(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ls(e);let n=0,i=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else i<0&&(l=!0,i=s+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let a=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else a<0&&(l=!0,a=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(i=s):(c=-1,i=a));return n===i?i=a:i<0&&(i=e.length),e.slice(n,i)}function aF(e){if(Ls(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 lF(e){Ls(e);let t=e.length,n=-1,i=0,s=-1,l=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){i=t+1;break}continue}n<0&&(a=!0,n=t+1),c===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===i+1?"":e.slice(s,n)}function uF(...e){let t=-1,n;for(;++t<e.length;)Ls(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cF(n)}function cF(e){Ls(e);const t=e.codePointAt(0)===47;let n=fF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function fF(e,t){let n="",i=0,s=-1,l=0,a=-1,c,f;for(;++a<=e.length;){if(a<e.length)c=e.codePointAt(a);else{if(c===47)break;c=47}if(c===47){if(!(s===a-1||l===1))if(s!==a-1&&l===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),s=a,l=0;continue}}else if(n.length>0){n="",i=0,s=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),i=a-s-1;s=a,l=0}else c===46&&l>-1?l++:l=-1}return n}function Ls(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dF={cwd:hF};function hF(){return"/"}function Id(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pF(e){if(typeof e=="string")e=new URL(e);else if(!Id(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 mF(e)}function mF(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 bf=["history","path","basename","stem","extname","dirname"];class Kk{constructor(t){let n;t?Id(t)?n={path:t}:typeof t=="string"||gF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<bf.length;){const l=bf[i];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)bf.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Hn.basename(this.path):void 0}set basename(t){Ef(t,"basename"),Cf(t,"basename"),this.path=Hn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Hn.dirname(this.path):void 0}set dirname(t){yx(this.basename,"dirname"),this.path=Hn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Hn.extname(this.path):void 0}set extname(t){if(Cf(t,"extname"),yx(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=Hn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Id(t)&&(t=pF(t)),Ef(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Hn.basename(this.path,this.extname):void 0}set stem(t){Ef(t,"stem"),Cf(t,"stem"),this.path=Hn.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 Bt(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 Cf(e,t){if(e&&e.includes(Hn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Hn.sep+"`")}function Ef(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function yx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yF=function(e){const i=this.constructor.prototype,s=i[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,i),l},vF={}.hasOwnProperty;class Qh extends yF{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=iF()}copy(){const t=new Qh;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Sf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rf("data",this.frozen),this.namespace[t]=n,this):vF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rf("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=sl(t),i=this.parser||this.Parser;return Tf("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Tf("process",this.parser||this.Parser),Pf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,a){const c=sl(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);kF(S)?v.value=S:v.result=S,h(m,v)});function h(m,p){m||!p?a(m):l?l(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),Tf("processSync",this.parser||this.Parser),Pf("processSync",this.compiler||this.Compiler),this.process(t,s),xx("processSync","process",n),i;function s(l,a){n=!0,mx(l),i=a}}run(t,n,i){vx(t),this.freeze();const s=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?l(void 0,i):new Promise(l);function l(a,c){const f=sl(n);s.run(t,f,h);function h(m,p,v){const w=p||t;m?c(m):a?a(w):i(void 0,w,v)}}}runSync(t,n){let i=!1,s;return this.run(t,n,l),xx("runSync","run",i),s;function l(a,c){mx(a),s=c,i=!0}}stringify(t,n){this.freeze();const i=sl(n),s=this.compiler||this.Compiler;return Pf("stringify",s),vx(t),s(t,i)}use(t,...n){const i=this.attachers,s=this.namespace;if(Rf("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;f(m,p)}else a(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function a(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(h.plugins),h.settings&&(s.settings=Sf(!0,s.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];l(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function 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];Md(C)&&Md(w)&&(w=Sf(!0,C,w)),i[v]=[h,w,...S]}}}}const xF=new Qh().freeze();function Tf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rf(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 vx(e){if(!Md(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function sl(e){return wF(e)?e:new Kk(e)}function wF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kF(e){return typeof e=="string"||SF(e)}function SF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wx=[],kx={allowDangerousHtml:!0},CF=/^(https?|ircs?|mailto|xmpp)$/i,EF=[{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 qk(e){const t=TF(e),n=PF(e);return RF(t.runSync(t.parse(n),n),e)}function TF(e){const t=e.rehypePlugins||wx,n=e.remarkPlugins||wx,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kx}:kx;return xF().use(mO).use(n).use(tF,i).use(t)}function PF(e){const t=e.children||"",n=new Kk;return typeof t=="string"&&(n.value=t),n}function RF(e,t){const n=t.allowedElements,i=t.allowElement,s=t.components,l=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||jF;for(const m of EF)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+bF+m.id,void 0);return kh(e,h),ZL(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 a?v.children.splice(p,1):v.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let w;for(w in wf)if(Object.hasOwn(wf,w)&&Object.hasOwn(m.properties,w)){const S=m.properties[w],C=wf[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):l?l.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 jF(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||CF.test(e.slice(0,t))?e:""}const AF={};function Xk(e){const t=this,n=e||AF,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(x1(n)),l.push(Q0()),a.push(FM(n))}function Os(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(yk,{open:!0,onOpenChange:n=>{n||e.onClose()},children:y.jsxs(wk,{children:[y.jsx(kk,{className:"modal-backdrop"}),y.jsxs(Sk,{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(Ck,{asChild:!0,children:y.jsx("h3",{children:e.title})}),e.description&&y.jsx(Ek,{className:"modal-description",children:e.description})]}),y.jsx(Tk,{asChild:!0,children:y.jsx("button",{className:"icon-btn","aria-label":`Close ${e.title}`,children:y.jsx(ke,{name:"close"})})})]}),e.tabs,y.jsx("div",{className:"modal-body",children:e.children})]})]})})}const NF=.25,MF=8;let Sx=Promise.resolve();function bx(){return document.documentElement.classList.contains("theme-dark")?"dark":"default"}function IF(){const[e,t]=k.useState(bx);return k.useEffect(()=>{const n=document.documentElement,i=()=>t(bx()),s=new MutationObserver(i);return s.observe(n,{attributes:!0,attributeFilter:["class"]}),i(),()=>s.disconnect()},[]),e}function DF(e,t,n){const i=Sx.then(async()=>{const{default:s}=await Nh(async()=>{const{default:l}=await import("./mermaid.core-f1Ho-4dn.js").then(a=>a.bp);return{default:l}},[]);return s.initialize({startOnLoad:!1,securityLevel:"strict",theme:n,fontFamily:"var(--sans)"}),s.render(e,t)});return Sx=i.then(()=>{},()=>{}),i}function _F(e){return Math.min(MF,Math.max(NF,e))}function LF(e){const t=k.useRef(null),n=k.useRef(null),[i,s]=k.useState(1),[l,a]=k.useState({x:0,y:0}),[c,f]=k.useState(!1),h=()=>{s(1),a({x:0,y:0})},m=(p,v,w)=>{const S=_F(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,T=(w??C.top+C.height/2)-C.top-C.height/2,A=S/i;a(j=>({x:E-A*(E-j.x),y:T-A*(T-j.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(yk,{open:!0,onOpenChange:p=>{p||e.onClose()},children:y.jsxs(wk,{children:[y.jsx(kk,{className:"mermaid-fullscreen-backdrop"}),y.jsxs(Sk,{className:"mermaid-fullscreen","data-mermaid-theme":e.theme,"aria-describedby":"mermaid-fullscreen-help",children:[y.jsx(Ck,{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(ke,{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(ke,{name:"plus"})}),y.jsx(Tk,{asChild:!0,children:y.jsx("button",{className:"icon-btn","aria-label":"Close diagram viewer",title:"Close (Esc)",children:y.jsx(ke,{name:"close"})})})]}),y.jsx("div",{ref:t,className:"mermaid-fullscreen-viewport"+(c?" dragging":""),onWheel:p=>{p.preventDefault(),m(i*Math.exp(-p.deltaY*.0015),p.clientX,p.clientY)},onDoubleClick:p=>m(i*1.5,p.clientX,p.clientY),onPointerDown:p=>{p.button===0&&(n.current={pointerId:p.pointerId,startX:p.clientX,startY:p.clientY,panX:l.x,panY:l.y},p.currentTarget.setPointerCapture(p.pointerId),f(!0))},onPointerMove:p=>{const v=n.current;!v||v.pointerId!==p.pointerId||a({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(${l.x}px, ${l.y}px) scale(${i})`},dangerouslySetInnerHTML:{__html:e.svg}})}),y.jsx(Ek,{id:"mermaid-fullscreen-help",className:"mermaid-fullscreen-help",children:"Scroll to zoom · drag to move · double-click to zoom in"})]})]})})}function OF({source:e}){const t=k.useId(),[n,i]=k.useState(""),[s,l]=k.useState(""),[a,c]=k.useState("default"),[f,h]=k.useState(!1),m=IF();return k.useEffect(()=>{let p=!0;const v=`mermaid-${t.replace(/[^a-zA-Z0-9_-]/g,"")}`;return i(""),l(""),DF(v,e,m).then(w=>{p&&(c(m),i(w.svg))}).catch(w=>{p&&l(w instanceof Error?w.message:String(w))}),()=>{p=!1,document.getElementById(`d${v}`)?.remove()}},[t,e,m]),s?y.jsxs("pre",{className:"markdown-mermaid-error",children:["Mermaid error: ",s]}):n?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"markdown-mermaid","data-mermaid-theme":a,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(ke,{name:"maximize"})}),y.jsx("div",{className:"markdown-mermaid-diagram",dangerouslySetInnerHTML:{__html:n}})]}),f&&y.jsx(LF,{svg:n,theme:a,onClose:()=>h(!1)})]}):y.jsx("div",{className:"markdown-mermaid-loading",children:"Rendering diagram…"})}const FF=k.memo(function(t){return y.jsx("article",{className:"markdown-body",ref:t.contentRef,children:y.jsx(qk,{remarkPlugins:[Xk],components:{a:({children:n,...i})=>y.jsx("a",{...i,target:"_blank",rel:"noreferrer",children:n}),code:({className:n,children:i,...s})=>{const l=/language-([\w-]+)/.exec(n??"")?.[1],a=String(i).replace(/\n$/,"");return l==="mermaid"?y.jsx(OF,{source:a}):y.jsx("code",{className:n,...s,children:i})}},children:t.markdown})})});function Yk(e){const{rec:t}=e,n=k.useRef(null),[i,s]=k.useState(""),[l,a]=k.useState(null),[c,f]=k.useState("loading"),[h,m]=k.useState(""),[p,v]=k.useState(0),[w,S]=k.useState(""),[C,E]=k.useState(0),[T,A]=k.useState(!1),[j,R]=k.useState(""),[V,D]=k.useState(!1),[G,$]=k.useState(!1),[_,P]=k.useState([]),[K,F]=k.useState(!1),[ie,Z]=k.useState(null),[ee,pe]=k.useState(!1),[xe,Q]=k.useState("");k.useEffect(()=>{let M=!0,te=null;return f("loading"),Kl(t.id).then(me=>{if(M){if(!me){f("missing");return}s(new TextDecoder("utf-8").decode(me)),te=URL.createObjectURL(new Blob([me],{type:"text/markdown;charset=utf-8"})),a(te),f("ready")}}).catch(()=>{M&&f("error")}),()=>{M=!1,te&&URL.revokeObjectURL(te)}},[t.id]),k.useEffect(()=>{const M=()=>{const te=window.getSelection(),me=n.current;if(!te||te.isCollapsed||!me){m(""),v(0);return}if(!me.contains(te.anchorNode)||!me.contains(te.focusNode)){m(""),v(0);return}const ye=te.getRangeAt(0),de=te.toString(),Te=de.length-de.trimStart().length,ge=de.trim().slice(0,4e3),_e=document.createRange();_e.selectNodeContents(me),_e.setEnd(ye.startContainer,ye.startOffset);const He=_e.toString().length+Te;m(ge),v(cD(me.textContent,ge,He))};return document.addEventListener("selectionchange",M),()=>document.removeEventListener("selectionchange",M)},[]);const fe=()=>{h&&(S(h),E(p),A(!0),Q(""))},N=async()=>{if(G){if(!w||!j.trim())return;P(te=>[...te,{selection:w,comment:j.trim(),occurrence:C}]),R(""),A(!1),Q("Comment added to review");return}const M=lD(w,j);if(!(!M||!j.trim()||V)){D(!0),Q("");try{await e.onSendText(M,t.id||void 0),R(""),A(!1),Q("Feedback sent")}catch(te){Q(`Send failed: ${String(te)}`)}finally{D(!1)}}},O=async()=>{if(_.length===0||K)return;const M=gD(i,_);F(!0),Q("");try{e.onSendFile?await e.onSendFile({filename:uD(t.filename),mime:"text/markdown",bytes:new TextEncoder().encode(M)},t.id||void 0):await e.onSendText(M,t.id||void 0),P([]),$(!1),Q("Review submitted")}catch(te){Q(`Review send failed: ${String(te)}`)}finally{F(!1)}},J=async()=>{if(!(!ie||!e.onSendFile||ee)){pe(!0),Q("");try{await e.onSendFile(ie,t.id||void 0),Z(null),Q("Voice feedback sent")}catch(M){Q(`Voice send failed: ${String(M)}`)}finally{pe(!1)}}};return y.jsx(Os,{title:t.filename,description:"Markdown preview · select text to send precise feedback",onClose:e.onClose,wide:!0,className:"markdown-modal",children:y.jsxs("div",{className:"markdown-preview",children:[y.jsxs("div",{className:"markdown-review-toolbar",children:[y.jsxs("button",{className:"btn sm",disabled:!h,onMouseDown:M=>M.preventDefault(),onClick:fe,children:[y.jsx(ke,{name:"reply",size:14}),G?"Add review comment":"Quick message",h?` (${h.length})`:""]}),G?y.jsx("button",{className:"btn sm",onClick:()=>{$(!1),P([]),A(!1),Q("Review discarded")},children:"Cancel review"}):y.jsxs("button",{className:"btn sm",onClick:()=>{$(!0),P([]),Q("Review started — select passages to add comments")},children:[y.jsx(ke,{name:"edit",size:14}),"Start review"]}),l&&y.jsxs("a",{className:"btn sm",href:l,download:t.filename,children:[y.jsx(ke,{name:"download",size:14}),"Download"]}),e.onSendFile&&y.jsx(j1,{disabled:!!ie||ee,onReady:Z,onError:Q}),y.jsx("span",{className:"markdown-review-hint",children:h?"Selection ready for feedback":"Highlight any passage to comment on it"})]}),T&&y.jsxs("div",{className:"markdown-feedback",children:[y.jsx("blockquote",{children:w}),y.jsx("textarea",{className:"field",rows:3,autoFocus:!0,placeholder:"What should change?",value:j,onChange:M=>R(M.target.value)}),y.jsxs("div",{className:"markdown-feedback-actions",children:[y.jsx("button",{className:"btn sm",onClick:()=>A(!1),children:"Cancel"}),y.jsxs("button",{className:"btn sm primary",disabled:!j.trim()||V,onClick:()=>void N(),children:[y.jsx(ke,{name:"send",size:14}),G?"Add to review":V?"Sending…":"Send feedback"]})]})]}),G&&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||K,onClick:()=>void O(),children:[y.jsx(ke,{name:"send",size:14}),K?"Submitting…":"Submit review"]})]}),_.map((M,te)=>y.jsxs("div",{className:"markdown-review-comment",children:[y.jsx("span",{children:te+1}),y.jsxs("div",{children:[y.jsx("blockquote",{children:M.selection}),y.jsx("p",{children:M.comment})]}),y.jsx("button",{className:"icon-btn",title:"Remove comment",onClick:()=>P(me=>me.filter((ye,de)=>de!==te)),children:y.jsx(ke,{name:"close",size:14})})]},`${te}-${M.selection.slice(0,24)}`))]}),ie&&y.jsx(R1,{att:ie,sending:ee,onSend:()=>void J(),onDiscard:()=>Z(null)}),xe&&y.jsx("div",{className:"markdown-review-status",role:"status",children:xe}),y.jsxs("div",{className:"markdown-preview-scroll",children:[c==="loading"&&y.jsx("div",{className:"markdown-empty",children:"Loading preview…"}),c==="missing"&&y.jsx("div",{className:"markdown-empty",children:"This file is available on the original device only."}),c==="error"&&y.jsx("div",{className:"markdown-empty",children:"The file could not be opened."}),c==="ready"&&y.jsx(FF,{markdown:i,contentRef:n})]})]})})}function Gk(e){const{rec:t}=e,[n,i]=k.useState(null),[s,l]=k.useState(0),[a,c]=k.useState(!1),[f,h]=k.useState("loading");return k.useEffect(()=>{let m=!0,p=null;return h("loading"),Kl(t.id).then(v=>{if(m){if(!v){h("missing");return}l(v.byteLength),p=URL.createObjectURL(new Blob([v],{type:Ph(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(Os,{title:t.filename,description:"Transformed safe preview · external navigation disabled",onClose:e.onClose,wide:!0,className:"markdown-modal html-modal"+(a?" 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(ke,{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(ke,{name:"maximize",size:14}),"Fullscreen"]}),n&&y.jsxs("a",{className:"btn sm",href:n,download:t.filename,children:[y.jsx(ke,{name:"download",size:14}),"Download original",s?` · ${Vr(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:yD,referrerPolicy:"no-referrer",src:`/api/html-preview/${encodeURIComponent(t.id)}`},t.id)]})]})})}function Qk(e){const t=(n,i)=>{const{key:s}=n;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(s))return;n.preventDefault();const l=e.options.length-1,a=s==="Home"?0:s==="End"?l:s==="ArrowLeft"||s==="ArrowUp"?(i-1+e.options.length)%e.options.length:(i+1)%e.options.length,c=e.options[a];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 Dd(e){const{message:t}=e,[n,i]=k.useState(null),[s,l]=k.useState(0),a=N0(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 Kl(t.wireId).then(p=>{!h||!p||(l(p.byteLength),m=URL.createObjectURL(new Blob([p],{type:Ph(a.mime,a.filename)})),i(m))}).catch(()=>{}),()=>{h=!1,m&&URL.revokeObjectURL(m)}},[t.wireId,a.mime,a.filename]);const c=md(t)==="photo",f=no(a.mime,a.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:a.filename}):y.jsx("span",{className:"shared-media-icon",children:y.jsx(ke,{name:f?"mic":"copy",size:18})}),y.jsxs("span",{className:"shared-media-copy",children:[y.jsx("strong",{children:c?a.filename||"Photo":f?"Voice message":a.filename}),y.jsxs("span",{children:[e.versionLabel?`${e.versionLabel} · `:"",hi(a.date),s?` · ${Vr(s)}`:""]})]})]}),y.jsxs("span",{className:"shared-media-actions",children:[w1(a.filename)&&n&&y.jsx("button",{className:"icon-btn",title:"Preview markdown",onClick:()=>e.onPreview(a),children:y.jsx(ke,{name:"monitor",size:16})}),Is(a.filename,a.mime)&&n&&y.jsx("button",{className:"icon-btn",title:"Preview HTML",onClick:()=>e.onPreview(a),children:y.jsx(ke,{name:"monitor",size:16})}),y.jsx("a",{className:"icon-btn"+(n?"":" disabled"),href:n??void 0,download:a.filename,title:"Download",children:y.jsx(ke,{name:"download",size:16})})]})]})}function zF(e){const[t,n]=k.useState(!1);if(e.versions.length===1){const i=e.versions[0];return y.jsx(Dd,{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(ke,{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 ",hi(e.versions[0].message.date)]})]}),y.jsx(ke,{name:t?"chevronDown":"chevron",size:16})]}),t&&y.jsx("div",{className:"file-version-stack-list",children:e.versions.map((i,s)=>y.jsx(Dd,{message:i.message,messageKey:i.key,versionLabel:`Version ${e.versions.length-s}`,onJump:e.onJump,onPreview:e.onPreview},i.key))})]})}function VF(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})=>md(h)==="photo"),l=i.filter(({message:h})=>md(h)==="file"),a=dD(l),c=i.flatMap(({message:h,key:m})=>h.kind==="file"?[]:fD(h.text).map(p=>({url:p,message:h,key:m}))),f=[{id:"photo",label:"Photos",count:s.length},{id:"file",label:"Files",count:l.length},{id:"link",label:"Links",count:c.length}];return y.jsx(Os,{title:"Shared media",description:"Photos, files, and links from this conversation",onClose:e.onClose,wide:!0,className:"shared-media-modal",tabs:y.jsx(Qk,{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(Dd,{message:h.message,messageKey:h.key,onJump:e.onJump,onPreview:e.onPreview},h.key)),t==="file"&&a.map(h=>y.jsx(zF,{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(ke,{name:"link",size:18})}),y.jsxs("span",{className:"shared-media-copy",children:[y.jsx("strong",{children:h.url}),y.jsx("span",{children:hi(h.message.date)})]})]}),y.jsx("button",{className:"icon-btn",title:"Jump to message",onClick:()=>e.onJump(h.key),children:y.jsx(ke,{name:"reply",size:16})})]},`${h.key}-${h.url}-${m}`)),(t==="photo"&&s.length===0||t==="file"&&l.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 BF=Object.freeze(["image/avif","image/bmp","image/heic","image/heif","image/jpeg","image/jpg","image/png","image/webp"]),$F=/\.(avif|bmp|heic|heif|jpe?g|png|webp)$/i;function Jk(e,t=""){return BF.includes(String(e??"").toLowerCase())||$F.test(String(t??""))}function UF(e){return`${(String(e||"photo").trim()||"photo").replace(/\.[^./\\]+$/,"")||"photo"}.jpg`}function WF(e,t,n){const i=Math.max(1,Number(e)||1),s=Math.max(1,Number(t)||1),l=Math.max(1,Number(n)||1),a=Math.min(1,l/Math.max(i,s));return{width:Math.max(1,Math.round(i*a)),height:Math.max(1,Math.round(s*a))}}const HF=2048,KF=640,qF=.82,XF=[.84,.7,.56,.44],YF=.94;function GF(e){return new Promise((t,n)=>{const i=URL.createObjectURL(e),s=new Image,l=()=>URL.revokeObjectURL(i);s.onload=()=>t({image:s,release:l}),s.onerror=()=>{l(),n(new Error("This browser could not decode the selected image."))},s.src=i})}function QF(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 JF(e,t){if(!Jk(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*YF)),{image:i,release:s}=await GF(e),l=document.createElement("canvas"),a=l.getContext("2d",{alpha:!1});if(!a)throw s(),new Error("Photo optimization is unavailable in this browser.");try{let c=Math.min(HF,Math.max(i.naturalWidth,i.naturalHeight));for(;c>=KF;){const f=WF(i.naturalWidth,i.naturalHeight,c);l.width=f.width,l.height=f.height,a.fillStyle="#fff",a.fillRect(0,0,l.width,l.height),a.drawImage(i,0,0,l.width,l.height);for(const h of XF){const m=await QF(l,h);if(m.size<=n)return{filename:UF(e.name),mime:"image/jpeg",bytes:new Uint8Array(await m.arrayBuffer()),width:l.width,height:l.height,originalSize:e.size}}c=Math.floor(c*qF)}}finally{s(),l.width=1,l.height=1}throw new Error("The photo is still too large after optimization.")}const ZF=5e4,ez=new Set(["http:","https:","mailto:"]);function Zk(e){if(!(!e||e!==e.trim()||/[\u0000-\u001f\u007f]/u.test(e)))try{const t=new URL(e);return ez.has(t.protocol.toLowerCase())?e:void 0}catch{return}}function eS(e){const t="language-";return e?.startsWith(t)&&e.slice(t.length)||void 0}function tz(e){return e.split(/(\n[ \t]*\n)/).map(t=>{if(/^\n[ \t]*\n$/.test(t))return t;const n=t.split(`
319
+ `),i=n.filter(a=>a.trim().length>0);if(i.length===0)return t;const s=i.map(a=>a.match(/^[ \t]+/)?.[0]??"");if(s.some(a=>a.length===0))return t;const l=Math.min(...s.map(a=>a.length));return n.map(a=>a.trim().length>0?a.slice(l):a).join(`
320
+ `)}).join("")}function nz({children:e}){const t=k.isValidElement(e)?e:null,n=eS(t?.props.className);return 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 rz=[Xk],iz={a:({node:e,children:t,href:n,...i})=>{const s=Zk(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:nz,code:({node:e,className:t,children:n,...i})=>y.jsx("code",{className:t,"data-language":eS(t),...i,children:n})},Cx=k.memo(function({text:t,className:n="bubble-text message-markdown"}){return t.length>ZF?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(qk,{remarkPlugins:rz,components:iz,urlTransform:i=>Zk(i)??"",children:tz(t)})})}),oz=new Set(["type","title","description","default","enum","minimum","maximum","minLength","maxLength","properties","required","items","minItems","maxItems"]),Ex=6,Tx=64;function _d(e,t=0,n={value:0}){if(t>Ex)return`Schema depth exceeds ${Ex}`;if(n.value++,n.value>Tx)return`Schema exceeds ${Tx} controls`;const i=Object.keys(e).find(l=>!oz.has(l));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)return"An explicit type or enum 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 l of["minimum","maximum"])if(e[l]!==void 0&&(typeof e[l]!="number"||!Number.isFinite(e[l])))return`${l} must be a finite number`;for(const l of["minLength","maxLength","minItems","maxItems"])if(e[l]!==void 0&&(typeof e[l]!="number"||!Number.isInteger(e[l])||e[l]<0))return`${l} 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.minItems!==void 0||e.maxItems!==void 0)&&s!=="array")return"minItems/maxItems require array type";if(s==="object"){const l=e.properties;if(l!==void 0&&(!l||typeof l!="object"||Array.isArray(l)))return"properties must be an object";if(e.required!==void 0&&(!Array.isArray(e.required)||e.required.some(a=>typeof a!="string")))return"required must be an array of property names";for(const a of Object.values(l??{})){if(!a||typeof a!="object"||Array.isArray(a))return"property schema must be an object";const c=_d(a,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":_d(e.items,t+1,n):null}function Ld(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,l)=>Ld(s,t[l]));const n=Object.keys(e).sort(),i=Object.keys(t).sort();return n.length===i.length&&n.every((s,l)=>s===i[l]&&Ld(e[s],t[s]))}function Ol(e,t,n="Arguments"){if(Array.isArray(e.enum)&&!e.enum.some(i=>Ld(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")return typeof t!="string"?`${n} must be text`:typeof e.minLength=="number"&&t.length<e.minLength?`${n} is too short`:typeof e.maxLength=="number"&&t.length>e.maxLength?`${n} is too long`: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=Ol(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=Array.isArray(e.required)?e.required:[];for(const s of i)if(!Object.hasOwn(t,s))return`${n}.${s||"(empty key)"} is required`;for(const[s,l]of Object.entries(e.properties??{})){if(!Object.hasOwn(t,s))continue;const a=Ol(l,t[s],`${n}.${s||"(empty key)"}`);if(a)return a}}return null}function Cs(e){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 l=s;(n.has(i)||l.default!==void 0)&&(t[i]=Cs(l))}return t}return e.type==="array"?[]:e.type==="boolean"?!1:e.type==="number"||e.type==="integer"?0:e.type==="null"?null:""}function Px(e,t){return typeof e.title=="string"&&e.title?e.title:t||"(empty key)"}function Rx(e,t,n){const i=Object.create(null);for(const[s,l]of Object.entries(e))i[s]=l;return i[t]=n,i}function sz(e,t){const n=Object.create(null);for(const[i,s]of Object.entries(e))i!==t&&(n[i]=s);return n}function az(e){const{schema:t,label:n,path:i,value:s,required:l,description:a,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 T=A=>{w(A);let j;try{j=JSON.parse(A)}catch{const V=`${n} must contain valid JSON`;C(V),f(i,V);return}if(!Array.isArray(j)){const V=`${n} must be a JSON array`;C(V),f(i,V);return}const R=Ol(t,j,n);C(R),f(i,R),E.current=JSON.stringify(j),c(j)};return y.jsxs("label",{className:"command-field",children:[y.jsxs("span",{children:[n,l?" *":""]}),y.jsx("textarea",{value:v,rows:3,"aria-describedby":p,"aria-invalid":S?"true":void 0,onChange:A=>T(A.target.value)}),y.jsx("small",{id:p,children:a??"JSON array"}),S&&y.jsx("span",{className:"command-field-error",role:"alert",children:S})]})}function tS(e){const{schema:t,name:n,path:i,value:s,required:l,onChange:a,onValidityChange:c}=e,f=Px(t,n),h=typeof t.description=="string"?t.description:void 0;if(Array.isArray(t.enum))return y.jsxs("label",{className:"command-field",children:[y.jsxs("span",{children:[f,l?" *":""]}),y.jsx("select",{value:JSON.stringify(s),onChange:p=>a(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),T=Px(C,w),A=`${i}.${w||"(empty key)"}`;return!E&&!v.has(w)?y.jsxs("button",{type:"button",className:"linkbtn command-property-add",onClick:()=>a(Rx(p,w,Cs(C))),children:["Add ",T]},w):y.jsxs("div",{className:"command-property",children:[y.jsx(tS,{schema:C,name:w,path:A,value:E?p[w]:Cs(C),required:v.has(w),onValidityChange:c,onChange:j=>a(Rx(p,w,j))}),!v.has(w)&&y.jsx("button",{type:"button",className:"linkbtn command-property-remove","aria-label":`Remove ${T}`,onClick:()=>a(sz(p,w)),children:"Remove"})]},w)})]})}if(t.type==="array")return y.jsx(az,{schema:t,label:f,path:i,value:s,required:l,description:h,onChange:a,onValidityChange:c});if(t.type==="boolean")return y.jsxs("label",{className:"command-check",children:[y.jsx("input",{type:"checkbox",checked:s===!0,onChange:p=>a(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.jsxs("label",{className:"command-field",children:[y.jsxs("span",{children:[f,l?" *":""]}),y.jsx("input",{type:m?"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:m?"any":void 0,required:l,onChange:p=>a(m?Number(p.target.value):p.target.value)}),h&&y.jsx("small",{children:h})]})}function lz(e){const t=`ours-command-attempt:${e.storageScope}:${e.catalog.recipient_cid}`,n=()=>{if(typeof localStorage>"u")return null;try{const P=JSON.parse(localStorage.getItem(t)??"null");return P?.version===1&&P.recipientCid===e.catalog.recipient_cid&&typeof P.command=="string"&&typeof P.invocationId=="string"&&typeof P.catalogFingerprint=="string"&&Object.hasOwn(P,"arguments")&&(P.state==="reserved"||P.state==="accepted"||P.state==="pending"||P.state==="failed"||P.state==="indeterminate")?P:null}catch{return null}},i=k.useMemo(n,[t]),[s,l]=k.useState(i),[a,c]=k.useState(i?.command??e.catalog.commands[0]?.name??""),f=e.catalog.commands.find(P=>P.name===a)??e.catalog.commands[0],h=k.useMemo(()=>f?_d(f.input_schema):null,[f]),[m,p]=k.useState(()=>i?.arguments??(f?Cs(f.input_schema):null)),[v,w]=k.useState(!1),[S,C]=k.useState(""),[E,T]=k.useState("idle"),[A,j]=k.useState({}),R=k.useRef(!1),V=k.useCallback((P,K)=>{j(F=>{if(K===null){if(!Object.hasOwn(F,P))return F;const ie={...F};return delete ie[P],ie}return F[P]===K?F:{...F,[P]:K}})},[]),D=P=>{l(P),!(typeof localStorage>"u")&&(P?localStorage.setItem(t,JSON.stringify(P)):localStorage.removeItem(t))},G=P=>{const K=e.catalog.commands.find(F=>F.name===P);s||(c(P),p(K?Cs(K.input_schema):null),w(!1),C(""),T("idle"),j({}))},$=async(P,K)=>{if(!(R.current||e.busy)){R.current=!0,C(P.state==="reserved"?"Sending encrypted command…":"Reconciling the existing command attempt…"),T("pending");try{const F=await e.onSend(K,P.arguments,P.invocationId,P.catalogFingerprint),ie={...P,state:F.status};D(ie),F.status==="failed"?(C("Command was refused before delivery. Verify the outcome before starting a new attempt."),T("error")):F.status==="pending"?(C("Command delivery is pending; reconcile this attempt instead of submitting it again."),T("warning")):F.status==="indeterminate"||!F.wire_id?(C("Command state is indeterminate; reconcile this attempt or verify its outcome before reset."),T("indeterminate")):(C(F.deduplicated?"Existing command attempt reconciled; pending result.":"Command accepted and pending result."),T("success"))}catch(F){const ie={...P,state:"indeterminate"};D(ie),C(F instanceof vs?`Command response was not confirmed: ${F.message}. Reconcile this attempt before any reset.`:"Command connection was interrupted; its state is indeterminate. Reconcile this attempt before any reset."),T("indeterminate")}finally{R.current=!1}}},_=P=>{if(P.preventDefault(),!f||h||!v||e.busy||R.current||s)return;const F=Object.values(A)[0]??Ol(f.input_schema,m);if(F){C(`Validation denied: ${F}`),T("error");return}const ie={version:1,recipientCid:e.catalog.recipient_cid,catalogFingerprint:e.catalog.fingerprint,command:f.name,arguments:m,invocationId:crypto.randomUUID(),state:"reserved"};D(ie),$(ie,f)};return y.jsxs("form",{className:"command-panel","aria-label":"Send a typed command",onSubmit:_,onKeyDown:P=>{P.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:f?.name,onChange:P=>G(P.target.value),children:e.catalog.commands.map(P=>y.jsx("option",{value:P.name,children:P.name},P.name))})]}),f?.description&&y.jsx("p",{children:f.description}),h?y.jsxs("div",{className:"banner error",role:"alert",children:["Cannot render this command safely: ",h]}):f&&y.jsx(tS,{schema:f.input_schema,name:"Arguments",path:"Arguments",value:m,onChange:p,onValidityChange:V}),y.jsxs("label",{className:"command-check",children:[y.jsx("input",{type:"checkbox",checked:v,onChange:P=>w(P.target.checked)}),"Confirm sending this command. It may change data on the recipient."]}),y.jsx("button",{className:"btn primary",disabled:!!h||!v||e.busy||!!s||Object.keys(A).length>0,children:"Send command"}),s&&y.jsxs("div",{className:"command-attempt",role:"status",children:[y.jsxs("strong",{children:["Saved attempt: ",s.state]}),y.jsx("span",{className:"mono",children:s.invocationId}),y.jsxs("div",{className:"command-attempt-actions",children:[y.jsx("button",{type:"button",className:"btn",disabled:e.busy,onClick:()=>void $(s,{name:s.command,input_schema:{}}),children:"Reconcile saved attempt"}),y.jsx("button",{type:"button",className:"linkbtn",onClick:()=>{window.confirm("Only reset after checking the conversation and verifying this attempt cannot still execute. Continue?")&&(D(null),C("Saved attempt reset after explicit verification."),T("success"),w(!1))},children:"Reset after verifying outcome"})]})]}),y.jsx("div",{className:`command-status ${E}`,"data-state":E,role:"status","aria-live":"polite",children:S})]})]})}const is={type:"spring",stiffness:430,damping:38,mass:.72},jx=10,nS=56,uz=18,cz=650;function fz(e,t){return Math.abs(e)<jx&&Math.abs(t)<jx?"pending":Math.abs(e)>Math.abs(t)&&e>0?"drag":"reject"}function dz(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 hz(e,t){const n=dz(t);return n>=0&&(e>=nS||e>=uz&&n>=cz)}const Od="ours.chats.listMode",ds="recent";function rS(){try{return globalThis.localStorage}catch{return}}function pz(e=rS()){try{return e?.getItem(Od)==="identity"?"identity":ds}catch{return ds}}function mz(e,t=rS()){const n=e==="identity"?"identity":ds;try{return t?.setItem(Od,n),t?.getItem(Od)===n?n:ds}catch{return ds}}function Es(e){return typeof e=="string"?e:""}function Fl(e,t){const n=Es(e),i=Es(t),s=n.normalize().toLowerCase(),l=i.normalize().toLowerCase();return s<l?-1:s>l?1:n<i?-1:n>i?1:0}function gz(e,t){const n=Al(Es(t.activityAt))-Al(Es(e.activityAt));if(n!==0)return n;const i=Fl(e.name,t.name);return i!==0?i:Fl(e.id,t.id)}function Fd(e){return[...e].sort(gz)}function Ax(e){return e.contacts.length>0?Al(Es(e.contacts[0].activityAt)):0}function yz(e,t){const n=new Map,i=[];for(const l of e){const a=l.root||(t?.[l.id]?l.id:null);if(!a){i.push(l);continue}const c=t?.[a]||{label:a,note:""};let f=n.get(a);f||(f={id:`root:${a}`,rootId:a,label:c.label,note:c.note,contacts:[]},n.set(a,f)),f.contacts.push(l)}const s=[...n.values()].map(l=>({...l,contacts:Fd(l.contacts)}));return i.length>0&&s.push({id:"rootless",rootId:null,label:"Independent identities",note:"People, agents and apps without a verified Human/root group",contacts:Fd(i)}),s.sort((l,a)=>{const c=Ax(a)-Ax(l);if(c!==0)return c;const f=Fl(l.label,a.label);return f!==0?f:Fl(l.id,a.id)})}const vz=15e3;function jf(e){const{c:t,active:n,grouped:i}=e,[s,l]=k.useState(!1),a=async(h,m)=>{if(!(!h||s)){l(!0);try{const p=await h();requestAnimationFrame(()=>{p?document.getElementById("chat-list-title")?.focus():m.focus()})}finally{l(!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 a(e.onApprove,h.currentTarget),children:"Approve"}),y.jsx("button",{type:"button",className:"linkbtn quiet",disabled:s,onClick:h=>void a(e.onReject,h.currentTarget),children:"Reject"})]}),n&&y.jsx(Ji.span,{className:"contact-active-glow",layoutId:"active-contact",transition:is})]}),f="contact-row"+(n?" active":"")+(i?" grouped":"")+(t.status==="pending"?" pending":"");return t.status==="pending"?y.jsx("div",{className:f,children:c}):y.jsx(Ji.button,{type:"button",className:f,onClick:e.onClick,children:c})}function xz(e){const{contacts:t,roots:n,selected:i}=e,[s,l]=k.useState(""),a=k.useRef(null),c=k.useRef(null),[f,h]=k.useState(()=>pz()),m=_=>_.name.toLowerCase().includes(s.toLowerCase()),p=t.filter(_=>_.status!=="pending"&&m(_)),v=t.filter(_=>_.status==="pending"&&m(_)),w=Fd(p),S=yz(p,n),C=p.length===0&&v.length===0,E=_=>{h(mz(_))},T=[{id:"recent",label:"Recent"},{id:"identity",label:"By identity"}],A=k.useRef(null),j=k.useRef({id:-1,x0:0,y0:0,mode:"idle"}),R=k.useRef(!1),V=(_,P)=>{const K=j.current;if(K.id!==_)return;const F=A.current;if(P&&K.mode==="drag"&&F){const ie=parseFloat(F.style.getPropertyValue("--mode-drag-x"))||0,Z=Math.max(0,(F.clientWidth-8)/2);E(ie>=Z/2?"identity":"recent"),R.current=!0,window.setTimeout(()=>{R.current=!1},0)}j.current={id:-1,x0:0,y0:0,mode:"idle"},F?.hasPointerCapture?.(_)&&F.releasePointerCapture(_),F?.classList.remove("dragging"),F?.style.removeProperty("--mode-drag-x")},D=_=>{!_.isPrimary||j.current.id!==-1||(j.current={id:_.pointerId,x0:_.clientX,y0:_.clientY,mode:"pending"})},G=_=>{const P=j.current;if(P.id!==_.pointerId||P.mode==="idle")return;const K=_.clientX-P.x0,F=_.clientY-P.y0;if(P.mode==="pending"){if(Math.abs(K)<10&&Math.abs(F)<10)return;if(Math.abs(F)>Math.abs(K)){V(_.pointerId,!1);return}P.mode="drag",_.currentTarget.setPointerCapture?.(_.pointerId),_.currentTarget.classList.add("dragging")}_.preventDefault();const ie=Math.max(0,(_.currentTarget.clientWidth-8)/2),Z=f==="identity"?ie:0;_.currentTarget.style.setProperty("--mode-drag-x",`${Math.min(ie,Math.max(0,Z+K))}px`)},$=(_,P)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(_.key))return;_.preventDefault();const F=_.key==="Home"?"recent":_.key==="End"||P==="recent"?"identity":"recent";E(F),document.getElementById(`conversation-list-${F}`)?.focus()};return k.useLayoutEffect(()=>{const _=a.current,P=c.current;if(!_||!P)return;const K=()=>_.style.setProperty("--list-bottom-chrome-height",`${P.getBoundingClientRect().height}px`);K();const F=new ResizeObserver(K);return F.observe(P),()=>{F.disconnect(),_.style.removeProperty("--list-bottom-chrome-height")}},[]),y.jsxs("div",{className:"listcol",ref:a,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(ke,{name:"invite",size:18})}),y.jsx("button",{className:"icon-btn","aria-label":"Settings",title:"Settings",onClick:e.onSettings,children:y.jsx(ke,{name:"settings",size:18})})]})]}),y.jsx("div",{ref:A,className:"conversation-list-modes",role:"tablist","aria-label":"Conversation list layout","data-mode":f,onPointerDown:D,onPointerMove:G,onPointerUp:_=>V(_.pointerId,!0),onPointerCancel:_=>V(_.pointerId,!1),onLostPointerCapture:_=>V(_.pointerId,!1),children:T.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:P=>{if(R.current){P.preventDefault();return}E(_.id)},onKeyDown:P=>$(P,_.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(jf,{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(ke,{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(P=>y.jsx(jf,{c:P,grouped:_.rootId!==null,active:i===P.id,onClick:()=>e.onSelect(P.id)},P.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(jf,{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(ke,{name:"search"})}),y.jsx("input",{className:"field",placeholder:"Search people, agents, apps…",value:s,onChange:_=>l(_.target.value),onKeyDown:_=>{_.key==="Escape"&&(_.preventDefault(),l(""))}})]}),y.jsx("button",{type:"button",className:"icon-btn list-bottom-invite","aria-label":"Invite",title:"Invite",onClick:e.onInvite,children:y.jsx(ke,{name:"invite",size:20})})]})]})}function wz(e){const[t,n]=k.useState(!1),[i,s]=k.useState(e.contact.name),[l,a]=k.useState(!1),[c,f]=k.useState(null),h=k.useRef(!1);k.useEffect(()=>{const p=v=>{v.key!=="Escape"||l||c||t||(v.preventDefault(),e.onBack())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t,c,e.onBack,l]);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(ke,{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(ke,{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:()=>a(!0),children:[y.jsxs("span",{children:[y.jsx(ke,{name:"paperclip"}),"Shared photos, files, and links"]}),y.jsx(ke,{name:"chevron"})]}),y.jsxs("button",{type:"button",onClick:()=>{h.current=!1,s(e.contact.name),n(!0)},children:[y.jsxs("span",{children:[y.jsx(ke,{name:"edit"}),"Rename contact"]}),y.jsx(ke,{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(ke,{name:"copy",size:14}),"Copy identity"]})]}),y.jsxs("button",{type:"button",className:"contact-remove",onClick:e.onRemove,children:[y.jsx(ke,{name:"trash"}),"Remove contact"]})]}),l&&y.jsx(VF,{messages:e.messages,indexOffset:e.indexOffset,onClose:()=>a(!1),onJump:e.onOpenMessage,onPreview:p=>{a(!1),f(p)}}),c&&(Is(c.filename,c.mime)?y.jsx(Gk,{rec:c,onClose:()=>f(null)}):y.jsx(Yk,{rec:c,onClose:()=>f(null),onSendText:e.onSendText,onSendFile:e.onSendFile}))]})}const iS=e=>`chat-message-${encodeURIComponent(e)}`,oS=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Af(e){const{dir:t,canReply:n,onReply:i}=e,s=k.useRef(null),l=k.useRef(null),a=k.useRef(null),c=k.useRef(i);c.current=i;const f=t==="in"?1:-1,h=nS,m=84,p=()=>({id:-1,x0:0,y0:0,mode:"idle",armed:!1,distance:0,samples:[]}),v=k.useRef(p()),w=A=>{const j=l.current,R=a.current,V=oS();if(j&&(j.style.transform=A&&!V?`translateX(${A}px)`:""),R){const D=Math.min(1,Math.abs(A)/h);R.style.opacity=String(D),R.style.transform=V?"scale(1)":`scale(${.5+.5*D})`}},S=(A,j)=>{const R=v.current;if(R.id!==A)return;const V=j&&R.mode==="drag"&&hz(R.distance,R.samples);v.current=p(),l.current?.classList.remove("swiping"),a.current?.classList.remove("armed"),w(0);const D=s.current;D?.hasPointerCapture?.(A)&&D.releasePointerCapture(A),V&&c.current()};k.useEffect(()=>{const A=s.current;if(!A)return;const j=R=>S(R.pointerId,!1);return A.addEventListener("lostpointercapture",j),()=>{A.removeEventListener("lostpointercapture",j);const R=v.current.id;R!==-1&&S(R,!1)}},[]);const C=A=>{const j=A.target,R=window.getSelection?.();!n||!A.isPrimary||A.pointerType==="mouse"||A.pointerType==="pen"&&A.button!==0||v.current.id!==-1||R&&!R.isCollapsed||j.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 j=v.current;if(j.id!==A.pointerId||j.mode==="idle")return;const R=A.clientX-j.x0,V=A.clientY-j.y0,D=window.getSelection?.();if(D&&!D.isCollapsed){S(A.pointerId,!1);return}if(j.mode==="maybe"){const K=fz(R*f,V);if(K==="pending")return;if(K==="drag")j.mode="drag",A.currentTarget.setPointerCapture?.(A.pointerId),l.current?.classList.add("swiping");else{j.mode="idle";return}}A.preventDefault();const G=A.timeStamp;j.samples.push({x:A.clientX*f,time:G}),j.samples=j.samples.filter(K=>G-K.time<=120);let $=R*f;$<0&&($=0),$>h&&($=h+($-h)*.35),$=Math.min($,m),j.distance=$;const _=$*f,P=Math.abs(_)>=h;P!==j.armed&&(j.armed=P,a.current?.classList.toggle("armed",P),P&&navigator.vibrate?.(10)),w(_)},T=A=>{const j=v.current;j.id===A.pointerId&&j.mode==="drag"&&(j.samples.push({x:A.clientX*f,time:A.timeStamp}),j.distance=Math.max(0,(A.clientX-j.x0)*f),j.armed=j.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:T,onPointerCancel:A=>S(A.pointerId,!1),onLostPointerCapture:A=>S(A.pointerId,!1),children:[n&&y.jsx("span",{className:"swipe-cue",ref:a,"aria-hidden":!0,children:y.jsx(ke,{name:"reply",size:16})}),y.jsx("div",{className:"bubble-wrap",ref:l,children:e.children}),e.after]})}const kz=k.memo(function(t){const{messages:n,optimisticSend:i,sentKeys:s,hiddenEarlier:l,unreadWireId:a,roomLines:c,contactCid:f,contactName:h,onStartReply:m,onPreview:p,onFetchFile:v}=t,w=new Map;for(const R of n)R.wireId&&w.set(R.wireId,R);const S=R=>c.get(R)??null,C=R=>{if(R.dir==="out")return"You";const V=S(R);return V&&V.variant==="chat"?V.author:h},E=R=>{if(R.kind==="file")return R.mime?.startsWith("image/")?"Photo":no(R.mime??"",R.filename??"")?"Voice message":R.filename||"File";const V=S(R);return V?V.text||DA(V):R.text},T=R=>{if(!R.replyTo)return null;const V=w.get(R.replyTo.wireId);return V?{author:C(V),text:E(V)}:{author:"",text:"Original message"}},A=R=>{R.wireId&&m({wireId:R.wireId,author:C(R),text:E(R)})},j=R=>{if(!R)return null;const V=S(R);return V?V.variant==="system"?"room:system":`room:chat:${V.author}${V.role}`:R.dir};return y.jsx(rR,{initial:!1,children:n.map((R,V)=>{const D=R===i?.message?i.key:R.wireId&&s.get(R.wireId)||R.wireId||`${R.date}-${l+V}`,G=iS(R.wireId||D),$=n[V-1],_=n[V+1],P=S(R),K=j(R),F=!!$&&j($)===K&&K!=="room:system",ie=!!_&&j(_)===K&&K!=="room:system",Z=(R.dir==="out"?"out":"in")+(F?" cont-top":"")+(ie?" cont-bot":""),ee=R.wireId?y.jsx("button",{className:"msg-reply",title:"Reply",onClick:()=>A(R),children:y.jsx(ke,{name:"reply",size:15})}):null,pe=R.wireId===a?y.jsx("div",{id:`unread-${G}`,className:"unread-divider",role:"separator",children:y.jsx("span",{children:"Unread messages"})}):null;if(P&&P.variant==="system"){const Q=P.presentation??"system";return y.jsxs(Ji.div,{className:"message-motion",id:G,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:is,children:[pe,y.jsxs("div",{className:`room-system room-${Q}-card`,role:"note",children:[P.label&&y.jsx("span",{className:"room-system-label",children:P.label}),P.roomName&&y.jsx("strong",{className:"room-card-name",children:P.roomName}),y.jsx(Cx,{text:P.text,className:"room-system-text message-markdown"}),!!P.details?.length&&y.jsx("ul",{className:"room-card-details","aria-label":"Room event details",children:P.details.map(fe=>y.jsx("li",{children:fe},fe))}),y.jsxs("span",{className:"room-card-provenance",children:[P.authoredBy&&y.jsx("span",{className:"room-card-author",children:P.authoredBy}),y.jsx("span",{className:"room-system-at",children:hi(R.date)})]})]})]},D)}if(R.kind==="file"){const Q=N0(R.wireId)??{id:R.wireId,dir:R.dir,filename:R.filename??"file",mime:R.mime??"application/octet-stream",size:0,date:R.date};return y.jsxs(Ji.div,{className:"message-motion",id:G,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:is,children:[pe,y.jsx(Af,{dir:R.dir==="out"?"out":"in",rowClass:Z,canReply:!!R.wireId,onReply:()=>A(R),after:ee,children:y.jsx("div",{className:`ours-message ours-message-file ours-message--${R.dir}`,children:y.jsx(ID,{rec:Q,receipt:R.receipt,receiptless:R.receiptless,onPreview:p,onFetch:v})})})]},D)}if(R.typed){const Q=R.typed.kind==="command_result"&&R.replyTo?w.get(R.replyTo.wireId):void 0,fe=R.typed.kind==="command_result"&&R.dir==="in"&&R.peerCid===f&&Q?.dir==="out"&&Q.peerCid===f&&Q.typed?.kind==="command",N=R.typed.kind==="command_result"&&!R.typed.outcome.ok?R.typed.outcome.error.toLowerCase():"",O=R.typed.kind==="command"?R.dir==="out"?"Accepted · pending result":"Received command":R.typed.kind==="unknown"?"Safe failure":R.dir==="out"?"Result sent":fe?N==="validation_denied"||N==="validation_failed"?"Validation denied":N==="policy_denied"||N==="unauthorized"||N==="forbidden"?"Policy denied":R.typed.outcome.ok?"Completed":"Failed":"Unmatched result · safe failure",J=R.typed.kind==="command"?R.typed.command:R.typed.kind==="command_result"?`Result for ${fe&&Q?.typed?.kind==="command"?Q.typed.command:"unmatched command"}`:`Unsupported ${R.typed.wire_kind}`,M=R.typed.kind==="command"?R.typed.arguments:R.typed.kind==="command_result"?R.typed.outcome:{safe_failure:R.typed.malformed?"Malformed typed message":"Future typed message preserved"};return y.jsxs(Ji.div,{className:"message-motion",id:G,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0},transition:is,children:[pe,y.jsx(Af,{dir:R.dir,rowClass:Z,canReply:!!R.wireId,onReply:()=>A(R),after:ee,children:y.jsxs("div",{className:`ours-message typed-message ours-message--${R.dir}`,children:[y.jsx("div",{className:"typed-message-kind",children:R.typed.kind==="command"?"Command":R.typed.kind==="command_result"?"Result":"Typed message"}),y.jsx("strong",{children:J}),y.jsx("div",{className:"typed-message-state",role:"status",children:O}),y.jsx("pre",{children:JSON.stringify(M,null,2)}),y.jsxs("div",{className:"bubble-at",children:[hi(R.date),R.dir==="out"&&y.jsx(ud,{receipt:R.receipt,receiptless:R.receiptless})]})]})})]},D)}const xe=T(R);return y.jsxs(Ji.div,{className:"message-motion",id:G,initial:{opacity:0,y:12,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.98},transition:is,children:[pe,y.jsx(Af,{dir:R.dir==="out"?"out":"in",rowClass:Z,canReply:!!R.wireId,onReply:()=>A(R),after:ee,children:y.jsxs("div",{className:`ours-message ours-message--${R.dir}`,children:[xe&&y.jsxs("div",{className:"quote",children:[xe.author&&y.jsx("span",{className:"quote-author",children:xe.author}),y.jsx("span",{className:"quote-text",children:xe.text})]}),P&&!F&&y.jsxs(y.Fragment,{children:[P.roomName&&y.jsx("div",{className:"room-message-room",children:P.roomName}),y.jsxs("div",{className:"room-author",children:[y.jsx("span",{className:"room-author-name",children:P.author}),P.role&&y.jsx("span",{className:"room-author-role",children:P.role})]})]}),y.jsx(Cx,{text:P?P.text:R.text}),y.jsxs("div",{className:"bubble-at",children:[hi(R.date),R.dir==="out"&&y.jsx(ud,{receipt:R.receipt,receiptless:R.receiptless})]})]})})]},D)})})});function Sz(e){const{contact:t,messages:n}=e,[i,s]=k.useState(""),[l,a]=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),[T,A]=k.useState(!1),[j,R]=k.useState(!1),[V,D]=k.useState(!1),[G,$]=k.useState(null),[_,P]=k.useState(null),[K,F]=k.useState(!1),[ie,Z]=k.useState(!1),ee=k.useRef(null),pe=k.useRef(null),xe=k.useRef(null),Q=k.useRef(null),fe=k.useRef(null),N=k.useRef(null),O=k.useRef(null),J=k.useRef(!1),M=k.useRef(null),te=k.useRef(!1),[me,ye]=k.useState(!1),[de,Te]=k.useState(0),ge=k.useRef(null),_e=k.useRef(!0),He=k.useRef(null),tt=k.useRef(0),gt=k.useRef(null),at=k.useRef(new Map),_t=k.useRef(0),ot=k.useRef(null),Ke=k.useRef(null),jt=k.useRef(0),hn=k.useRef(null),At=k.useRef("");k.useLayoutEffect(()=>{const B=fe.current,q=N.current,se=O.current;if(!B||!q||!se)return;let he=-1,ue=-1,Ne=null;const ut=()=>{const $e=Math.round(q.getBoundingClientRect().height),Ye=Math.round(se.getBoundingClientRect().height);if($e!==he&&(he=$e,B.style.setProperty("--conversation-head-height",`${$e}px`)),Ye!==ue){const Le=_e.current;ue=Ye,B.style.setProperty("--conversation-compose-height",`${Ye}px`),Le&&(Ne!==null&&cancelAnimationFrame(Ne),Ne=requestAnimationFrame(()=>{Ne=null;const $t=M.current;$t&&_e.current&&($t.scrollTop=Math.max(0,$t.scrollHeight-$t.clientHeight))}))}};ut();const kt=new ResizeObserver(ut);return kt.observe(q),kt.observe(se),()=>{kt.disconnect(),Ne!==null&&cancelAnimationFrame(Ne),B.style.removeProperty("--conversation-head-height"),B.style.removeProperty("--conversation-compose-height")}},[t?.id]),k.useEffect(()=>{s(""),m(null),v(null),f(null),S(null),E(null),A(!1),R(!1),D(!1),tt.current+=1,$(null),ee.current?.abort(),P(null),F(!1),Z(!1),at.current.clear(),ot.current=null,Ke.current=null},[t?.id]);const Gt=async()=>{if(!t||!e.onLoadCommands)return;ee.current?.abort();const B=new AbortController;ee.current=B,Z(!0),m(null);try{const q=await e.onLoadCommands(t.id,B.signal);!B.signal.aborted&&q.recipient_cid===t.id?(P(q),F(!0)):B.signal.aborted||m("Command discovery was refused because the authenticated recipient changed.")}catch(q){B.signal.aborted||m(q instanceof vs?`Command discovery failed: ${q.message}`:"Command discovery failed safely. The recipient may be offline or unsupported.")}finally{ee.current===B&&Z(!1)}},Fn=()=>{F(!1),pe.current?.focus()};k.useEffect(()=>{if(!p)return;const B=p.reply?.wireId;n.some(se=>se.kind!=="file"&&se.dir==="out"&&!!se.wireId&&!p.wireIds.has(se.wireId)&&se.text===p.text&&(se.replyTo?.wireId??void 0)===B)&&(v(null),m(null),s(se=>se===p.draft?"":se),S(se=>se===p.reply?null:se))},[n,p]);const Oe=!!c?.wireId&&n.some(B=>B.wireId===c.wireId),yt=k.useMemo(()=>c&&!Oe?[...n,c.message]:n,[n,c,Oe]);k.useEffect(()=>{Oe&&f(null)},[Oe]),k.useLayoutEffect(()=>{const B=Q.current;if(!B)return;i.startsWith(At.current)||(B.style.height="0px");const se=B.scrollHeight,ue=`${Math.max(44,Math.min(se,132))}px`;B.style.height!==ue&&(B.style.height=ue),B.style.overflowY=se>132?"auto":"hidden",At.current=i},[i,t?.id]);const En=B=>{const q=M.current;if(!q)return;const se=Math.max(0,q.scrollHeight-q.clientHeight);if(Math.abs(q.scrollTop-se)<1){ot.current=null,Ke.current=null;return}const he=B&&!oS();ot.current=he?se:null,Ke.current=he?q.scrollTop:null,he?q.scrollTo({top:se,behavior:"smooth"}):q.scrollTop=se},Y=()=>{ge.current===null&&(ge.current=requestAnimationFrame(()=>{ge.current=null;const B=M.current;if(!B)return;const q=B.scrollHeight-B.clientHeight-B.scrollTop>48;ye(q),q||Te(0)}))};k.useLayoutEffect(()=>{if(!t){He.current=null,_e.current=!0,jt.current=0;return}const B=M.current;if(!B)return;const q=He.current!==t.id,se=jt.current,he=yt.length!==se,ue=yt.at(-1),Ne=ue?ue.wireId||`${ue.date}:${ue.text}`:null,ut=hn.current;if(jt.current=yt.length,hn.current=Ne,!q&&!he&&ot.current===null&&(_e.current=B.scrollHeight-B.clientHeight-B.scrollTop<=48),q||_e.current)En(he&&!q&&He.current!==null),_e.current=!0;else if(he&&yt.length>se&&Ne!==ut){const kt=ut===null?-1:yt.findIndex($e=>($e.wireId||`${$e.date}:${$e.text}`)===ut);Te($e=>$e+Math.max(1,yt.length-Math.max(0,kt+1)))}He.current=t.id,Y()},[t,yt.length]),k.useLayoutEffect(()=>{if(te.current||!e.unreadOpen||window.location.hash.startsWith("#chat-message-"))return;const B=M.current,q=document.getElementById(`unread-${iS(e.unreadOpen.wireId)}`);!B||!q||(B.scrollTop=Math.max(0,q.offsetTop-16),_e.current=!1,te.current=!0,Y())},[e.unreadOpen,yt.length]),k.useLayoutEffect(()=>{const B=window.location.hash;if(!B.startsWith("#chat-message-"))return;const q=document.getElementById(B.slice(1));q&&(q.scrollIntoView({block:"center"}),_e.current=!1)},[t?.id,yt.length]),k.useLayoutEffect(()=>{const B=gt.current,q=M.current;if(B===null||!q)return;const se=requestAnimationFrame(()=>{gt.current===B&&(q.scrollTop=B.top+q.scrollHeight-B.height,gt.current=null)});return()=>cancelAnimationFrame(se)},[yt.length]),k.useEffect(()=>{const B=M.current;if(!B||typeof ResizeObserver>"u")return;const q=B.firstElementChild;if(!q)return;const se=new ResizeObserver(()=>{_e.current&&En(ot.current!==null),Y()});return se.observe(q),se.observe(B),()=>{se.disconnect(),ge.current!==null&&cancelAnimationFrame(ge.current)}},[t?.id]);const ae=async B=>{const q=++tt.current;m(null),D(!0);try{if(B.size>rs&&Jk(B.type,B.name)){const he=await JF(B,rs);if(q!==tt.current)return;E({filename:he.filename,mime:he.mime,bytes:he.bytes,originalSize:he.originalSize});return}if(B.size>rs){m(`"${B.name}" is ${Vr(B.size)} — files up to ${Vr(rs)} can be sent.`);return}const se=await B.arrayBuffer();if(q!==tt.current)return;E({filename:B.name||"file",mime:B.type||"application/octet-stream",bytes:new Uint8Array(se)})}catch(se){q===tt.current&&m(`Photo optimization failed: ${se instanceof Error?se.message:String(se)}`)}finally{q===tt.current&&D(!1)}},Pe=()=>{!C||!e.onSendFile||j||(R(!0),e.onSendFile(C,w?.wireId).then(()=>{E(null),S(null)}).catch(B=>m(`File send failed: ${String(B)} — it was not delivered.`)).finally(()=>R(!1)))},De=e.onDraftChange;k.useEffect(()=>(De?.(i.trim().length>0||l),()=>De?.(!1)),[i,l,De]);const ze=k.useMemo(()=>{const B=new Map;for(const q of yt)B.set(q,q.kind==="file"?null:q.dir==="in"?PA(t?.announcedName??"",q.text):null);return B},[yt,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(ke,{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 lt=async()=>{const B=i,q=B.trim(),se=!!p&&B===p.draft&&(w?.wireId??void 0)===p.reply?.wireId;if(!q||J.current||se)return;p&&v(null),J.current=!0,a(!0),m(null);const he=w,ue=he?.wireId,Ne=new AbortController;let ut=!1,kt=0;s(""),S(null);const $e=`optimistic-${++_t.current}`;f({key:$e,wireId:null,message:{dir:"out",text:q,date:new Date().toISOString(),read:!0,wireId:"",replyTo:ue?{wireId:ue}:null}});try{const Ye=await Promise.race([e.onSend(q,ue,Ne.signal),new Promise((Le,$t)=>{kt=window.setTimeout(()=>{ut=!0,Ne.abort(),$t(new Error("send timeout"))},vz)})]);Ye?(at.current.set(Ye,$e),f(Le=>Le?.key===$e?{...Le,wireId:Ye}:Le)):f(Le=>Le?.key===$e?null:Le),v(null)}catch(Ye){f(null),s(Le=>Le===""?B:Le),S(Le=>Le===null?he:Le),ut||!(Ye instanceof vs)?(v({draft:B,text:q,reply:he,wireIds:new Set(n.flatMap(Le=>Le.wireId?[Le.wireId]:[]))}),m(`${ut?"Send timed out":"Send connection was interrupted"} — delivery status is unknown. Check the conversation; edit the draft before sending again.`)):m(`Send failed: ${String(Ye)} — the message was not delivered.`)}finally{window.clearTimeout(kt),J.current=!1,a(!1)}},W=!!p&&i===p.draft&&(w?.wireId??void 0)===p.reply?.wireId;return y.jsxs("div",{className:"detail detail-chat",ref:fe,children:[y.jsx("div",{className:"detail-head",ref:N,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(ke,{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(ke,{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:M,tabIndex:-1,"aria-label":"Conversation timeline",onScroll:B=>{const q=B.currentTarget,se=q.scrollHeight-q.clientHeight-q.scrollTop;if(ot.current!==null){const he=Ke.current;if(he===null||q.scrollTop>=he-1){Ke.current=q.scrollTop,se<=4&&(ot.current=null,Ke.current=null);return}ot.current=null,Ke.current=null}_e.current=se<=48,Y()},onPointerDown:()=>{ot.current=null,Ke.current=null},onTouchStart:()=>{ot.current=null,Ke.current=null},onWheel:()=>{ot.current=null,Ke.current=null},onDragOver:B=>{e.onSendFile&&B.preventDefault()},onDrop:B=>{if(!e.onSendFile)return;B.preventDefault();const q=B.dataTransfer.files?.[0];q&&ae(q)},children:y.jsxs("div",{className:"messages-inner",children:[y.jsxs("div",{className:"e2e-note",children:[y.jsx(ke,{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:()=>{_e.current=!1;const B=M.current;gt.current=B?{height:B.scrollHeight,top:B.scrollTop}:null,e.onLoadEarlier?.()},children:["Load earlier messages (",e.hiddenEarlier," remaining)"]}),y.jsx(kz,{messages:yt,optimisticSend:c,sentKeys:at.current,hiddenEarlier:e.hiddenEarlier??0,unreadWireId:e.unreadOpen?.wireId,roomLines:ze,contactCid:t.id,contactName:t.name,onStartReply:S,onPreview:$,onFetchFile:e.onFetchFile}),y.jsx("div",{className:"thread-end","aria-hidden":!0})]})},t.id),me&&y.jsxs("button",{type:"button",className:"jump-latest btn sm","aria-label":de?`Jump to latest, ${de} new messages`:"Jump to latest",onClick:B=>{const q=B.currentTarget===document.activeElement;Te(0),En(!0),q&&requestAnimationFrame(()=>M.current?.focus({preventScroll:!0}))},children:[y.jsx("span",{children:"Jump to latest"}),!!de&&y.jsx("span",{className:"jump-latest-count","aria-live":"polite",children:de})]}),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 lt(),children:"retry"})})]}),y.jsxs("div",{className:"composer-wrap",ref:O,children:[ie&&!K&&y.jsxs("div",{className:"command-status pending","data-state":"pending",role:"status","aria-live":"polite",children:["Loading commands for ",t.name,"…"]}),K&&_&&e.onSendCommand&&y.jsx(lz,{catalog:_,recipientName:t.name,storageScope:e.identityCid??"unknown-identity",busy:ie,onRefresh:()=>void Gt(),onClose:Fn,onSend:async(B,q,se,he)=>{if(!t||t.id!==_.recipient_cid)throw new Error("Recipient changed; refresh commands");Z(!0);try{return await e.onSendCommand(t.id,B.name,q,se,he)}finally{Z(!1)}}},`${_.recipient_cid}:${_.fingerprint}`),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(ke,{name:"close",size:16})})]}),C&&y.jsx(R1,{att:C,sending:j,onSend:Pe,onDiscard:()=>E(null)}),V&&y.jsx("div",{className:"attachment-processing",role:"status",children:"Optimizing photo for secure delivery…"}),y.jsxs("div",{className:"composer"+(T?" recording":""),children:[e.onLoadCommands&&y.jsxs("button",{ref:pe,type:"button",className:"icon-btn composer-tool command-trigger",title:"Recipient commands","aria-label":"Recipient commands","aria-expanded":K,disabled:ie,onClick:()=>K?Fn():void Gt(),children:[y.jsx(ke,{name:"bolt",size:17}),y.jsx("span",{children:"Commands"})]}),e.onSendFile&&y.jsxs(y.Fragment,{children:[y.jsx("input",{ref:xe,type:"file",style:{display:"none"},onChange:B=>{const q=B.target.files?.[0];q&&ae(q),B.target.value=""}}),y.jsx("button",{className:"icon-btn composer-tool",title:"Attach a file or photo",disabled:j||V||T,onClick:()=>xe.current?.click(),children:y.jsx(ke,{name:"paperclip",size:18})})]}),y.jsx("textarea",{ref:Q,className:"field",rows:1,placeholder:(w?"Reply to "+w.author:"Message "+t.name)+"…",value:i,"aria-busy":l,onChange:B=>s(B.target.value),onKeyDown:B=>{B.key==="Enter"?!(window.matchMedia("(pointer: coarse)").matches||window.innerWidth<=860)&&!B.shiftKey&&(B.preventDefault(),lt()):B.key==="Escape"&&S(null)}}),e.onSendFile&&!i.trim()&&!C&&!V&&!j?y.jsx(j1,{disabled:j||V||!!C,onReady:B=>{A(!1),E(B)},onError:B=>{A(!1),m(B)},onActiveChange:A},t.id):y.jsxs("button",{className:"btn primary","aria-label":"Send",onPointerDown:B=>{B.button===0&&document.activeElement===Q.current&&B.preventDefault()},onClick:()=>void lt(),disabled:l||W||!i.trim(),title:W?"Delivery status unknown — edit before sending again":void 0,children:[y.jsx(ke,{name:"send",size:16}),y.jsx("span",{className:"btn-label",children:"Send"})]})]})]}),G&&(Is(G.filename,G.mime)?y.jsx(Gk,{rec:G,onClose:()=>$(null)}):y.jsx(Yk,{rec:G,onClose:()=>$(null),onSendText:e.onSend,onSendFile:e.onSendFile}))]})}const sS=3;function bz(e,t,n=sS){return[t,...e.filter(i=>i.cid!==t.cid)].slice(0,n)}function Cz(e,t){return e.filter(n=>n.id!==t)}const Ez=6e3,Tz=bz,Pz=Cz;function Rz(){const[e,t]=k.useState([]),n=k.useRef(0),i=k.useCallback((a,c,f)=>{const h=Date.now(),m={id:`${a}:${h}:${n.current++}`,cid:a,name:c,preview:"",at:h};t(p=>Tz(p,m,sS))},[]),s=k.useCallback(a=>t(c=>Pz(c,a)),[]),l=k.useCallback(a=>t(c=>c.filter(f=>f.cid!==a)),[]);return{toasts:e,push:i,dismiss:s,clear:l}}function jz(e){const{item:t,onOpen:n,onDismiss:i}=e,[s,l]=k.useState(!1),[a,c]=k.useState(!1),f=s||a;return k.useEffect(()=>{if(f)return;const h=setTimeout(()=>i(t.id),Ez);return()=>clearTimeout(h)},[t.id,f,i]),y.jsxs("div",{className:"banner msg",role:"status",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>c(!0),onBlur:h=>{h.currentTarget.contains(h.relatedTarget)||c(!1)},children:[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:ad(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(ke,{name:"close",size:15})})]})}function Az(e){return y.jsx(y.Fragment,{children:e.items.map(t=>y.jsx(jz,{item:t,onOpen:e.onOpen,onDismiss:e.onDismiss},t.id))})}function Nz(e){const t=k.useRef(null),{text:n,size:i=240}=e;return k.useEffect(()=>{if(!t.current||!n)return;const s=t.current;Nh(()=>import("./browser-PbepkUqh.js").then(l=>l.b),[]).then(l=>{l.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 Mz(e){const t=k.useRef(null),n=k.useRef(null),i=k.useRef(null),s=k.useRef(0),l=k.useRef(!0),[a,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"),T=()=>{if(l.current)if(S.readyState>=S.HAVE_ENOUGH_DATA){const A=S.videoWidth||320,j=S.videoHeight||240;C.width=A,C.height=j,E.drawImage(S,0,0,A,j);const R=E.getImageData(0,0,A,j);Nh(()=>import("./jsQR-BOfQcojE.js").then(V=>V.j),[]).then(V=>{const D=V.default,G=D(R.data,R.width,R.height,{inversionAttempts:"dontInvert"});if(G&&G.data&&l.current){m(),e.onDecode(G.data);return}l.current&&(s.current=requestAnimationFrame(T))})}else s.current=requestAnimationFrame(T)};s.current=requestAnimationFrame(T)},[m,e]);k.useEffect(()=>{if(l.current=!0,!navigator.mediaDevices?.getUserMedia){c("nocamera");return}return navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then(w=>{if(!l.current){w.getTracks().forEach(S=>S.stop());return}c("scanning"),p(w)}).catch(w=>{if(!l.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)))}),()=>{l.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:[(a==="requesting"||a==="scanning")&&y.jsxs(y.Fragment,{children:[y.jsx("p",{className:"muted",style:{margin:0,fontSize:"0.88rem"},children:a==="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}}),a==="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)"}})})]})]}),a==="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(ke,{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."})]}),a==="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(ke,{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."})]}),a==="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:a==="scanning"?y.jsxs(y.Fragment,{children:[y.jsx(ke,{name:"close",size:14}),"Cancel scan"]}):y.jsxs(y.Fragment,{children:[y.jsx(ke,{name:"close",size:14}),"Close scanner"]})})]})}function Iz(e){const[t,n]=k.useState("generate"),[i,s]=k.useState("one_time"),[l,a]=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),[T,A]=k.useState(null),[j,R]=k.useState(null),[V,D]=k.useState(!1),[G,$]=k.useState(null),_=k.useRef(!1),P=async()=>{if(!_.current){_.current=!0,E(!0),R(null),A(null);try{m(i),f(await e.onCreate(i,i==="one_time"&&l.trim()||void 0))}catch(F){R(F instanceof Error?F.message:String(F))}finally{_.current=!1,E(!1)}}},K=y.jsx(Qk,{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(Os,{title:t==="generate"?"Invite a contact":"Accept an invite",onClose:()=>{_.current||e.onClose()},tabs:K,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:["@",j0(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:l,onChange:F=>a(F.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 P(),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(F=>F.mode==="public").length===0&&y.jsx("p",{className:"muted",style:{margin:0},children:"None right now."}),e.invites.filter(F=>F.mode==="public").map(F=>y.jsxs("div",{"data-testid":"public-invite-row",style:{padding:"8px 10px",background:"var(--inset)",borderRadius:7},children:[y.jsx("span",{className:"mono",children:F.invite_id}),y.jsxs("p",{className:"muted",children:["Created ",F.created?FA(F.created):"unknown"," · Active until revoked · No expiry"]}),G===F.invite_id?y.jsxs("span",{children:[y.jsx("button",{className:"btn sm danger",onClick:()=>void e.onRevoke(F.invite_id).then(()=>($(null),e.onRefresh())).catch(ie=>R(String(ie))),children:"Confirm revoke"})," ",y.jsx("button",{className:"btn sm",onClick:()=>$(null),children:"Keep it"})]}):y.jsx("button",{className:"btn sm",onClick:()=>$(F.invite_id),children:"Revoke"})]},F.invite_id))]}),T&&y.jsx("p",{className:"muted",children:T}),j&&y.jsx("p",{className:"onb-error",children:j})]}),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 ${l.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:F=>F.currentTarget.select()}),h==="one_time"&&y.jsx(Nz,{text:c}),y.jsxs("button",{className:"btn primary",onClick:()=>void navigator.clipboard.writeText(c).then(()=>A("Copied to clipboard.")),children:[y.jsx(ke,{name:"copy",size:15}),"Copy invite"]}),h==="public"&&y.jsx("button",{className:"btn","data-testid":"done-hide-invite",onClick:()=>{f(null),a(""),e.onRefresh()},children:"Done — hide invite"}),T&&y.jsx("p",{className:"muted",children:T})]}),t==="accept"&&y.jsxs("form",{style:{display:"flex",flexDirection:"column",gap:13},onSubmit:F=>{F.preventDefault(),!(!p.trim()||C)&&(E(!0),R(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(ie=>R(String(ie))).finally(()=>E(!1)))},children:[y.jsx("p",{className:"muted",children:"Paste the invite you received, or scan a QR code."}),V?y.jsx(Mz,{onDecode:F=>{v(F),D(!1)},onClose:()=>D(!1)}):y.jsxs("button",{type:"button",className:"btn",onClick:()=>D(!0),children:[y.jsx(ke,{name:"monitor",size:15}),"Scan QR code"]}),y.jsx("textarea",{className:"field mono","aria-label":"Invite",rows:5,value:p,onChange:F=>v(F.target.value),placeholder:"Paste invite text…"}),y.jsx("input",{className:"field",value:w,onChange:F=>S(F.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"}),T&&y.jsx("p",{className:"muted",children:T}),j&&y.jsx("p",{className:"onb-error",children:j})]})]})})}function Dz(e){const[t,n]=k.useState(e.identity.bio??""),[i,s]=k.useState(!1),[l,a]=k.useState(null),[c,f]=k.useState(e.push.preview),h=jj(),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(Os,{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),a(null)}}),y.jsx("button",{className:"btn sm",onClick:()=>{a(null),e.onSaveBio(t).then(()=>s(!0)).catch(p=>a(String(p)))},children:i?"Saved":"Save bio"}),l&&y.jsx("p",{className:"onb-error",children:l})]}),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 _z(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 Lz="fc69d758b33ed660f9f4fd4ee5e9b44aa0fe1b7e",Oz=15*6e4,Fz=6e4,zz=_z;async function Vz(){try{const e=await fetch("/version.json",{cache:"no-store"});return e.ok?await e.json():null}catch{return null}}function Bz(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 Vz(),h=zz(Lz,f,t,Date.now(),Fz);h==="newer-available"?(e.onUpdateAvailable(),navigator.serviceWorker?.getRegistration().then(m=>m?.update())):h==="stuck"&&!i&&(i=!0,e.onStuck(f.sha))},l=setTimeout(()=>void s(),5e3),a=setInterval(()=>void s(),Oz),c=()=>{document.visibilityState==="visible"&&s()};return document.addEventListener("visibilitychange",c),()=>{clearTimeout(l),clearInterval(a),document.removeEventListener("visibilitychange",c),navigator.serviceWorker?.removeEventListener("controllerchange",n)}}async function $z(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 Uz(){const e=new URL(location.href);e.searchParams.has("v")&&(e.searchParams.delete("v"),history.replaceState(null,"",e.pathname+e.search+e.hash))}const Nx=[0,100,400,1e3,3e3,6e3],Mx=e=>new Promise(t=>setTimeout(t,e)),Ix={delivered:1,read:2},Dx="ours-dark-v3",_x="#chat-message-",Lx=Al,Wz=e=>e instanceof Error&&e.message?e.message:"The request could not be completed.";function aS(e,t){const n=new Map,i=[];for(const s of e?.messages??[]){const l={dir:s.dir,text:s.text,date:s.date,read:s.read,wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:null,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,l):i.push(l)}for(const s of t){const l=n.get(s.wire_id);n.set(s.wire_id,{dir:s.dir,text:"",date:s.date,read:l?.read??s.dir==="out",wireId:s.wire_id,replyTo:s.reply_to?{wireId:s.reply_to.wire_id}:l?.replyTo??null,kind:"file",filename:s.filename,mime:s.mime,receipt:l?.receipt})}return[...i,...n.values()].sort((s,l)=>{const a=Lx(s.date)-Lx(l.date);return a===0?s.wireId.localeCompare(l.wireId):a})}function Hz(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 Kz(e,t){return[...e.contacts.contacts.map(i=>{const s=e.contacts.roots?.[i.container_id],l=ar(e,i.container_id),c=aS(l,t[i.container_id]??[]).at(-1),f=Ml(i);return{id:i.container_id,name:f,announcedName:i.name,initials:ad(f),when:c?OA(c.date):"",activityAt:c?.date??"",last:c?.kind==="file"?KA(c.filename,c.mime):l?.preview??c?.text??"",unread:l?.unread??0,status:"active",root:s?.root_cid??null,sub:s?`role “${s.role_id}” of ${s.root_name}`:"",roleId:s?.role_id??null,rootName:s?.root_name??null,mine:!1,kind:s?"agent":"person"}}),...e.contacts.pending.map(i=>{const s=Ml(i);return{id:`pending:${i.container_id}`,name:s,announcedName:i.name,initials:ad(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 qz(){return y.jsx(Xz,{})}function Xz(){const e=k.useRef(bj(rf(window.location.pathname))).current,[t,n]=k.useReducer(sv,e),[i,s]=k.useState(null),l=k.useRef(0),a=k.useRef(null),c=k.useRef(t),f=k.useRef(new xj),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),T=k.useRef(new Set),[A,j]=k.useState(null),R=k.useRef(A),V=k.useRef(!1),[D,G]=k.useState([]),[$,_]=k.useState(null),[P,K]=k.useState(()=>localStorage.getItem(Dx)!=="0"),[F,ie]=k.useState(null),[Z,ee]=k.useState({supported:!1,offline:!navigator.onLine,updateAvailable:!1,registration:null}),[pe,xe]=k.useState({status:"unsupported",preview:"full"}),[Q,fe]=k.useState(!1),N=k.useRef(!1),[O,J]=k.useState(()=>window.location.hash.startsWith(_x)),{toasts:M,push:te,dismiss:me,clear:ye}=Rz(),de=k.useCallback(W=>{c.current=sv(c.current,W),n(W)},[]),Te=k.useCallback(W=>{V.current=W},[]);k.useEffect(()=>{c.current=t},[t]),R.current=A,S.current=v,k.useMemo(()=>(yv(Object.values(v).flat()),null),[v]),k.useEffect(()=>(document.documentElement.classList.toggle("theme-dark",P),()=>document.documentElement.classList.remove("theme-dark")),[P]);const ge=k.useCallback(W=>de({type:"error",message:Wz(W)}),[de]),_e=k.useCallback(()=>{const W=c.current;return{visibility:document.visibilityState,appRoute:W.route.name==="chats"?"chats":"other",selectedContactCid:Ir(W),desktopLayout:h.current?.matches??window.innerWidth>=861,mobileDetailOpen:W.mobileDetailOpen,conversationCoveringDialogOpen:R.current!==null}},[]),He=k.useCallback(async(W,B=!0)=>{try{const q=await Xe.conversation(W);return de({type:"page",contactCid:W,page:q}),q}catch(q){return B&&ge(q),null}},[de,ge]),tt=k.useCallback(async(W,B=!0)=>{try{const q=await Xe.files(W);return yv(q.files),w(se=>({...se,[W]:q.files})),q.files}catch(q){return B&&ge(q),null}},[ge]);k.useEffect(()=>Bz({onUpdateAvailable:()=>ee(W=>({...W,updateAvailable:!0})),onStuck:W=>{$z(W)}}),[]);const gt=k.useCallback(async()=>{const W=await Xe.contacts();return de({type:"contacts",contacts:{...W,pending:W.pending??[]}}),W},[de]),at=k.useCallback(async()=>{try{const[W,B,q]=await Promise.all([Xe.identity(),Xe.contacts(),Xe.buildInfo()]),se={...B,pending:B.pending??[]};return c.current.identity&&c.current.identity.cid!==W.cid&&(UA(),S.current={},w({})),de({type:"snapshot",identity:W,contacts:se}),_(q),await Promise.all(se.contacts.flatMap(he=>[He(he.container_id,!1),tt(he.container_id,!1)])),Ir(c.current)}catch(W){return ge(W),null}},[de,tt,He,ge]),_t=k.useCallback(async W=>{await f.current.request(W,async()=>{vj(W,_e())&&(await Xe.markRead(W),await Promise.all([He(W),gt()]))}).catch(ge)},[_e,gt,He,ge]),ot=k.useCallback(async W=>{const B=++l.current;a.current?.abort();const q=new AbortController;a.current=q,s(null),ye(W),tt(W,!1);let se;try{se=await Xe.conversation(W,void 0,q.signal)}catch(Le){q.signal.aborted||ge(Le);return}if(q.signal.aborted||B!==l.current)return;de({type:"page",contactCid:W,page:se});const he=se.unread;let ue=[...se.messages],Ne=se.nextBefore;const ut=new Set,kt=new Set(ue.map(Le=>Le.wire_id).filter(Boolean)),$e=()=>ue.filter(Le=>Le.dir==="in"&&!Le.read);for(;$e().length<he&&Ne&&!ut.has(Ne);){ut.add(Ne);let Le;try{Le=await Xe.conversation(W,Ne,q.signal)}catch{break}if(q.signal.aborted||B!==l.current)return;const $t=Le.messages.filter(fr=>!fr.wire_id||!kt.has(fr.wire_id));if(!$t.length&&Le.nextBefore===Ne)break;for(const fr of $t)fr.wire_id&&kt.add(fr.wire_id);ue=[...$t,...ue],de({type:"older_page",contactCid:W,page:Le,newer:se.messages}),Ne=Le.nextBefore}const Ye=$e()[0];Ye?.wire_id&&B===l.current&&!q.signal.aborted&&s({contactCid:W,wireId:Ye.wire_id,count:he}),await _t(W)},[ye,de,_t,tt,ge]),Ke=k.useCallback(async(W,B,q="page")=>{const se=`page:${W}:${q}`,he=(m.current.get(se)??0)+1;m.current.set(se,he);for(const ue of Nx){if(ue&&await Mx(ue),m.current.get(se)!==he)return;const Ne=await He(W,!1);if(Ne&&B(Ne))return}},[He]),jt=k.useCallback(async(W,B)=>{const q=`file:${W}`,se=(m.current.get(q)??0)+1;m.current.set(q,se);for(const he of Nx)if(he&&await Mx(he),m.current.get(q)!==se||(await tt(W,!1))?.some(Ne=>Ne.wire_id===B))return},[tt]),hn=k.useRef(!1);k.useEffect(()=>{if(!O||!t.loaded)return;const W=decodeURIComponent(window.location.hash.slice(_x.length)),B=Ir(c.current);if(!W||!B){J(!1);return}if(ar(c.current,B)?.messages.some(q=>q.wire_id===W)){J(!1);return}hn.current||(hn.current=!0,Ke(B,q=>q.messages.some(se=>se.wire_id===W),`anchor:${W}`).catch(()=>{}).finally(()=>J(!1)))},[O,Ke,t.loaded,t.pages]),k.useMemo(()=>($A({url:W=>Object.values(S.current).flat().find(q=>q.wire_id===W)?.available?Xe.mediaUrl(W):null,bytes:async W=>{if(!Object.values(S.current).flat().find(se=>se.wire_id===W)?.available)return null;const q=await fetch(Xe.mediaUrl(W),{cache:"no-store",credentials:"same-origin"});if(!q.ok)throw new Error(`Media request failed (HTTP ${q.status})`);return new Uint8Array(await q.arrayBuffer())},fetch:async W=>{const B=Object.values(S.current).flat().find(q=>q.wire_id===W);if(!B)throw new Error("Media record is unavailable");await Xe.fetchFiles([W]),await tt(B.contact_id)}}),null),[tt]),k.useEffect(()=>{let W;Tj(q=>{ee(q),uv(q.registration).then(xe).catch(()=>xe(se=>({...se,status:"error"})))},{shouldDeferReload:()=>V.current||R.current!==null}).then(q=>{W=q}).catch(ge);const B=q=>{q.preventDefault(),ie(q)};return window.addEventListener("beforeinstallprompt",B),()=>{W?.(),window.removeEventListener("beforeinstallprompt",B)}},[ge]),k.useEffect(()=>Dj(),[]),k.useEffect(()=>{if(!(!Z.registration||pe.status!=="on"))return yj({registration:Z.registration,identity:Xe.identity,onEvent:k0})},[pe.status,pe.bindingId,Z.registration]),k.useEffect(()=>{const W=()=>xe(B=>({...B,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,"",Nr()),h.current=window.matchMedia("(min-width: 861px)");const W=()=>{const ue=rf(window.location.pathname);a.current?.abort(),l.current+=1,s(null),de({type:"route",route:ue}),N.current&&ue.name==="chats"&&ue.contactCid&&(N.current=!1,requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0}))),ue.name==="chats"&&ue.contactCid&&ot(ue.contactCid)},B=()=>{if(document.visibilityState!=="visible")return;const ue=Ir(c.current);ue&&_t(ue),E0(),Z.registration&&uv(Z.registration).then(xe).catch(()=>xe(Ne=>({...Ne,status:"error"})))};window.addEventListener("popstate",W),document.addEventListener("visibilitychange",B);const q=ue=>{const Ne=ue.type==="sync_required"?`${ue.type}:${ue.reason}`:ue.type==="receipt_received"?`${ue.type}:${ue.contact_id}:${ue.kind}:${ue.wire_ids.join(",")}`:`${ue.type}:${ue.contact_id}:${ue.wire_id}`,ut=Date.now(),kt=p.current.get(Ne)??0;p.current.set(Ne,ut);for(const[$e,Ye]of p.current)ut-Ye>6e4&&p.current.delete($e);ut-kt<6e4||(async()=>{if(ue.type==="sync_required"){await at();return}if(gt().catch(ge),ue.type==="file_received"){await jt(ue.contact_id,ue.wire_id);const $e=c.current.contacts.contacts.find(Ye=>Ye.container_id===ue.contact_id);Ir(c.current)!==ue.contact_id&&$e&&te(ue.contact_id,Ml($e),"New file");return}if(ue.type==="message_received"){const $e=c.current.contacts.contacts.find(Ye=>Ye.container_id===ue.contact_id);await Ke(ue.contact_id,Ye=>Ye.messages.some(Le=>Le.wire_id===ue.wire_id),`message:${ue.wire_id}`),Ir(c.current)===ue.contact_id?await _t(ue.contact_id):$e&&te(ue.contact_id,Ml($e),"New message");return}de({type:"receipt",contactCid:ue.contact_id,kind:ue.kind,wireIds:ue.wire_ids}),await Ke(ue.contact_id,$e=>ue.wire_ids.every(Ye=>{const Le=$e.messages.find($t=>$t.wire_id===Ye);return!!Le?.receipt&&Ix[Le.receipt]>=Ix[ue.kind]}),`receipt:${ue.wire_ids.join(",")}`)})().catch(ge)},se=hj(q),he=pj(q,ue=>de({type:"connection",connection:ue}));return at().then(ue=>{ue&&ot(ue)}),()=>{he(),se(),window.removeEventListener("popstate",W),document.removeEventListener("visibilitychange",B)}},[Ke,jt,de,_t,ot,te,gt,at,ge,Z.registration]);const At=(W,B,q)=>{window.history.pushState({oursMessenger:!0},"",B),de({type:"route",route:W,mobileDetailOpen:q})},Gt=async W=>{At({name:"chats",contactCid:W},Nr(W),!0),await ot(W)},Fn=async W=>{const B=ar(c.current,W);if(!(!B?.nextBefore||T.current.has(W))){T.current.add(W),E(W);try{const q=await Xe.conversation(W,B.nextBefore);de({type:"older_page",contactCid:W,page:q,newer:B.messages})}catch(q){ge(q)}finally{T.current.delete(W),E(null)}}},Oe=Ir(t),yt=t.contacts.contacts.find(W=>W.container_id===Oe),En=k.useMemo(()=>Kz(t,v),[t,v]),Y=En.find(W=>W.id===Oe)??null,ae=Oe?aS(ar(t,Oe),v[Oe]??[]):[],Pe=t.identity;k.useEffect(()=>{if(!t.loaded)return;const W=rf(window.location.pathname),B=W.name==="chats"||W.name==="contact"?W.contactCid:null;!B||t.contacts.contacts.some(q=>q.container_id===B)||(window.history.replaceState({oursMessenger:!0},"",Nr()),i?.contactCid===B&&(a.current?.abort(),l.current+=1,s(null)))},[t.loaded,t.contacts.contacts,i]);const De=t.loaded?Oe&&!ar(t,Oe)||O?"updating":t.connection!=="live"?"connecting":null:"connecting",ze=async(W,B=pe.preview)=>{if(Z.registration){fe(!0),xe(q=>({...q,status:"repairing",preview:B}));try{xe(await(W==="enable"?C0(Z.registration,{preview:B}):W==="repair"?Mj(Z.registration,B):Ij(Z.registration,pe)))}catch(q){xe(se=>({...se,status:"error"})),ge(q)}finally{fe(!1)}}},lt=()=>{G([]),j("invite"),Xe.invites().then(G).catch(ge)};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:()=>At({name:"chats",contactCid:null},Nr()),children:"Open chats"})]}):Pe?y.jsx("div",{className:P?"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(xz,{contacts:En,roots:Hz(t.contacts),selected:Oe,onSelect:W=>{W.startsWith("pending:")||Gt(W)},onInvite:lt,onSettings:()=>j("settings"),onApprovePending:async W=>{try{return await Xe.respondToIntroduction(W,"approve"),await at(),!0}catch(B){return ge(B),!1}},onRejectPending:async W=>{try{return await Xe.respondToIntroduction(W,"reject"),await at(),!0}catch(B){return ge(B),!1}}}),t.route.name==="contact"&&Y?y.jsx(wz,{contact:Y,messages:ae,onBack:()=>{N.current=!0,kj(window.history.state)==="back"?window.history.back():(window.history.replaceState({oursMessenger:!0},"",Nr(Y.id)),de({type:"route",route:{name:"chats",contactCid:Y.id},mobileDetailOpen:!0}),requestAnimationFrame(()=>document.querySelector("[data-contact-trigger]")?.focus({preventScroll:!0})),N.current=!1)},onRename:W=>void Xe.renameContact(Y.id,W).then(at).catch(ge),onRemove:()=>{confirm(`Remove “${yt?.name??"contact"}”?`)&&Xe.removeContact(Y.id).then(()=>(window.history.replaceState({oursMessenger:!0},"",Nr()),de({type:"route",route:{name:"chats",contactCid:null},mobileDetailOpen:!1}),at())).catch(ge)},onOpenMessage:W=>{At({name:"chats",contactCid:Y.id},Nr(Y.id),!0);let B=12;const q=()=>{const se=document.getElementById(`chat-message-${encodeURIComponent(W)}`),he=se?.closest(".messages");if((!se||!he||he.clientHeight<=0)&&B-- >0){requestAnimationFrame(q);return}if(!se||!he)return;const ue=se.getBoundingClientRect(),Ne=he.getBoundingClientRect(),ut=he.scrollTop+ue.top-Ne.top-Math.max(0,(he.clientHeight-ue.height)/2),kt=Math.max(0,Math.min(ut,he.scrollHeight-he.clientHeight));he.scrollTo({top:kt,behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})};requestAnimationFrame(q)},indexOffset:ar(t,Y.id)?.hasMore?Math.max(1,(ar(t,Y.id)?.total??ae.length)-ae.length):0,onSendText:async(W,B)=>{const q=await Xe.send(Y.id,W,B);return await He(Y.id,!1),q.wire_id??void 0},onSendFile:async(W,B)=>{await Xe.sendFile(Y.id,new Blob([W.bytes],{type:W.mime}),W.filename,W.mime,B),await Promise.all([tt(Y.id),He(Y.id,!1)])}}):y.jsx(Sz,{identityCid:Pe.cid,contact:Y,messages:ae,syncing:De,unreadOpen:i?.contactCid===Oe?i:null,hiddenEarlier:ar(t,Oe??"")?.hasMore?Math.max(1,(ar(t,Oe??"")?.total??ae.length)-ae.length):0,onLoadEarlier:Oe&&C!==Oe?()=>void Fn(Oe):void 0,onBack:()=>{a.current?.abort(),l.current+=1,s(null),At({name:"chats",contactCid:null},Nr(),!1)},onOpenContact:()=>{Oe&&At({name:"contact",contactCid:Oe},wj(Oe),!0)},onDraftChange:Te,onSend:async(W,B,q)=>{if(!Oe)return;const se=Oe,he=await Xe.send(se,W,B,q);return de({type:"sent_message",contactCid:se,message:{dir:"out",text:W,date:new Date().toISOString(),read:!0,wire_id:he.wire_id??"",receipt:null,reply_to:B?{wire_id:B}:null}}),he.wire_id?Ke(se,ue=>ue.messages.some(Ne=>Ne.wire_id===he.wire_id),`send:${he.wire_id}`):gt().catch(ge),he.wire_id??void 0},onLoadCommands:async(W,B)=>Xe.commands(W,B),onSendCommand:async(W,B,q,se,he,ue)=>{const Ne=await Xe.sendCommand(W,B,q,se,he,ue);return He(W,!1),Ne},onSendFile:async(W,B)=>{Oe&&(await Xe.sendFile(Oe,new Blob([W.bytes],{type:W.mime}),W.filename,W.mime,B),await Promise.all([tt(Oe),He(Oe,!1)]))},onFetchFile:async W=>{await Xe.fetchFiles([W]),Oe&&await tt(Oe)}},Oe??"no-conversation")]}),y.jsxs("div",{className:"app-banners",children:[Z.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…"}),Z.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:()=>{Z.registration&&av(Z.registration)},children:"Restart now"})})]}),y.jsx(Az,{items:M,onDismiss:me,onOpen:W=>void Gt(W)})]}),A==="invite"&&y.jsx(Iz,{identity:Pe,invites:D,onRefresh:async()=>G(await Xe.invites()),onCreate:async(W,B)=>(await Xe.createInvite(W,B)).blob,onAccept:async(W,B)=>{await Xe.addContact(W,B),await at()},onRevoke:async W=>{await Xe.revokeInvite(W)},onClose:()=>{j(null),at()}}),A==="settings"&&y.jsx(Dz,{identity:Pe,push:pe,workerSupported:Z.supported,busy:Q,offline:Z.offline,updateAvailable:Z.updateAvailable,build:$,dark:P,onToggleDark:()=>K(W=>(localStorage.setItem(Dx,W?"0":"1"),!W)),onSaveBio:async W=>{await Xe.setBio(W),await at()},onPushAction:ze,onInstall:F?()=>void F.prompt().then(()=>ie(null)):void 0,onReloadUpdate:()=>{Z.registration&&av(Z.registration)},onClose:()=>{R.current=null,j(null),Oe&&_t(Oe)}}),t.error&&y.jsxs("div",{className:"banner error",role:"alert","aria-live":"assertive",children:[t.error,y.jsx("button",{className:"linkbtn",onClick:()=>de({type:"error",message:null}),children:"dismiss"})]})]})}):y.jsx("div",{className:P?"theme-dark":"",style:{height:"100%"},children:y.jsx("div",{className:"centered-screen",children:y.jsx("p",{className:"muted",children:"Loading…"})})})}Uz();const lS=document.getElementById("root");if(!lS)throw new Error("missing #root");fC.createRoot(lS).render(y.jsx(lR,{reducedMotion:"user",children:y.jsx(qz,{})}));export{Nh as _,zd as g};
321
+ //# sourceMappingURL=index-C00qXlD3.js.map