lookatstudy-mobile 0.20.0 → 0.22.0

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 (202) hide show
  1. package/package.json +1 -1
  2. package/server.cjs +410 -309
  3. package/web/assets/Tableau10-Cz3F1amA.js +1 -0
  4. package/web/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
  5. package/web/assets/abnfDiagram-N423BO3Z-BqeMquUh.js +1 -0
  6. package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-BuesB7xR.js +1 -0
  7. package/web/assets/api-web-DeJFZI02.js +1 -0
  8. package/web/assets/arc-Bb-hQPAI.js +1 -0
  9. package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-0sZWP2Gt.js +36 -0
  10. package/web/assets/{architectureDiagram-T3A2C74G-djSyr1mz.js → architectureDiagram-T3A2C74G-BUX7eVzV.js} +3 -3
  11. package/web/assets/band-dPffDWoQ.js +1 -0
  12. package/web/assets/blockDiagram-NRAW4CY4-UMJ6PMQQ-DMEi53vA.js +129 -0
  13. package/web/assets/{blockDiagram-VBNYF7ZC-CMyKXBrP.js → blockDiagram-VBNYF7ZC-CquWGiud.js} +4 -4
  14. package/web/assets/c-BIGW1oBm.js +1 -0
  15. package/web/assets/{c4Diagram-5PPSVZJV-BIkHBEIX.js → c4Diagram-5PPSVZJV-DwhWxb7s.js} +2 -2
  16. package/web/assets/c4Diagram-UCG6FXSJ-75X3U2P3-Cw6KuLDN.js +38 -0
  17. package/web/assets/channel-BTMwuCXz.js +1 -0
  18. package/web/assets/chunk-2GRJ4B5K-CzGtEVrd.js +1 -0
  19. package/web/assets/{chunk-2Q5K7J3B-5KwfG7mC.js → chunk-2Q5K7J3B-svQDV2bG.js} +1 -1
  20. package/web/assets/{chunk-5RXB4S5H-BfjkbTOR.js → chunk-5RXB4S5H-CkBumCja.js} +3 -3
  21. package/web/assets/{chunk-5VM5RSS4-CknJ0UrM.js → chunk-5VM5RSS4-DmqVK3OP.js} +1 -1
  22. package/web/assets/{chunk-6Q2QTUOP-PEKlwd8q.js → chunk-6Q2QTUOP-j-yShG78.js} +3 -3
  23. package/web/assets/chunk-7XDTSPCN-BF54U_Qe.js +338 -0
  24. package/web/assets/chunk-CTNIYPP6-BLGT5nzg.js +1 -0
  25. package/web/assets/chunk-CXNFBKHE-CHtCVUVZ.js +15 -0
  26. package/web/assets/{chunk-GF5L2VYU-FwREiZq-.js → chunk-GF5L2VYU-HY4EUgWS.js} +4 -4
  27. package/web/assets/chunk-ISA7TJRJ-AUc9mrxX.js +1 -0
  28. package/web/assets/{chunk-JWPE2WC7-Df8WvQEt.js → chunk-JWPE2WC7-DmzvUH3q.js} +1 -1
  29. package/web/assets/chunk-KBJHAD2P-C3HnMhHX.js +1 -0
  30. package/web/assets/chunk-LV3HUYFY-D3kDosNp.js +1 -0
  31. package/web/assets/chunk-M3IUQBOH-CMBqYbjd.js +231 -0
  32. package/web/assets/chunk-NDIOYS4C-D4XcxlS5.js +1 -0
  33. package/web/assets/chunk-RE4WF27V-ANjTafEs.js +1 -0
  34. package/web/assets/{chunk-RYQCIY6F-w-ex678p.js → chunk-RYQCIY6F-CV9wg8xs.js} +1 -1
  35. package/web/assets/chunk-VII2H2IX-DK2MWM1y.js +1 -0
  36. package/web/assets/chunk-X5GNSKZ3-YRz76YFi.js +206 -0
  37. package/web/assets/chunk-XCWWM2C3-CSRjUbE8.js +88 -0
  38. package/web/assets/chunk-XXDRQBXY-j9X99vQo.js +1 -0
  39. package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-D00H1X9p.js +1 -0
  40. package/web/assets/classDiagram-JCYQIIEL-ClQHMNoR.js +1 -0
  41. package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-D00H1X9p.js +1 -0
  42. package/web/assets/classDiagram-v2-OCEON4UE-ClQHMNoR.js +1 -0
  43. package/web/assets/colors-Cc3OSVma.js +1 -0
  44. package/web/assets/core-Drxo65nc.js +12 -0
  45. package/web/assets/{cose-bilkent-JH36ORCC-CuRVnite.js → cose-bilkent-JH36ORCC-CN6Mp4ds.js} +1 -1
  46. package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-Bvxs1RhI.js +1 -0
  47. package/web/assets/cpp-DddhVWhK.js +1 -0
  48. package/web/assets/csharp-DSvCPggb.js +1 -0
  49. package/web/assets/css-CLj8gQPS.js +1 -0
  50. package/web/assets/cynefin-OW5HDTMX-GVF3BKWE-BVXFZGhi.js +178 -0
  51. package/web/assets/{cynefin-VYW2F7L2-deqxDK2d.js → cynefin-VYW2F7L2-CBHvDLlv.js} +1 -1
  52. package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-CM4Mj-Vd.js +62 -0
  53. package/web/assets/cynefinDiagram-MW4NZA55-aMzbAFWs.js +62 -0
  54. package/web/assets/dagre-3AP2YEHR-DCERTXHT-BMVGWTPf.js +4 -0
  55. package/web/assets/{dagre-VZM6K2ZE-CGNHDakS.js → dagre-VZM6K2ZE-DhQcrBKB.js} +2 -2
  56. package/web/assets/{defaultLocale-DX6XiGOO.js → defaultLocale-5voVPcsN.js} +1 -1
  57. package/web/assets/{diagram-7IWD3JNH-D_gUTAQc.js → diagram-7IWD3JNH-neTaugq1.js} +4 -4
  58. package/web/assets/{diagram-B4RE2ZJO-YGyPH2BM.js → diagram-B4RE2ZJO-D9KmoYBV.js} +3 -3
  59. package/web/assets/diagram-LBJQPF4R-9J-F2MVE.js +24 -0
  60. package/web/assets/diagram-Q27KOJAE-Dz9KITJh.js +24 -0
  61. package/web/assets/diagram-S7CK7UJ4-MULGZGEL-r3BljA8e.js +30 -0
  62. package/web/assets/diagram-UB23O5K3-BA5gPgQ7.js +41 -0
  63. package/web/assets/diagram-UQ7AKVKN-YQBY353J-IIvT6Y42.js +41 -0
  64. package/web/assets/diagram-VSXAHHWV-WLNH2ELY-BMCz6ope.js +3 -0
  65. package/web/assets/diagram-VX7I27RA-XW6YQV5G-Z3lYjMVR.js +24 -0
  66. package/web/assets/diagram-Z3DM3KII-HG7RF65D-CsLqhzUJ.js +24 -0
  67. package/web/assets/diff-D97Zzqfu.js +1 -0
  68. package/web/assets/dockerfile-BcOcwvcX.js +1 -0
  69. package/web/assets/ebnfDiagram-BXEA7PRR-BoUlG0c_.js +1 -0
  70. package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-CgMcEf9P.js +1 -0
  71. package/web/assets/elk.bundled-DjGexDyy.js +24 -0
  72. package/web/assets/engine-javascript-DBd1bXLz.js +141 -0
  73. package/web/assets/{erDiagram-JOGREHBK-BuY7vR4r.js → erDiagram-JOGREHBK-DV_Tzdk0.js} +4 -4
  74. package/web/assets/erDiagram-SSCWMZ5O-PIPKOIK7-Ct9t5yN5.js +99 -0
  75. package/web/assets/flowDiagram-A5DVABFB-2Z4AVO5R-C4iDReFc.js +168 -0
  76. package/web/assets/{flowDiagram-UKHOOZJN-TxEOjs8K.js → flowDiagram-UKHOOZJN-DvQGnBrF.js} +10 -10
  77. package/web/assets/ganttDiagram-EL5Y4UJY-JZNG7GOG-BPWBTDqB.js +292 -0
  78. package/web/assets/ganttDiagram-PKOTCBZU-7gjvaw6I.js +292 -0
  79. package/web/assets/{gitGraphDiagram-DS77QQ5N-rZzK4UXV.js → gitGraphDiagram-DS77QQ5N-B54T3l5T.js} +7 -7
  80. package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-CmG0_dMg.js +106 -0
  81. package/web/assets/github-dark-DHJKELXO.js +1 -0
  82. package/web/assets/github-light-DAi9KRSo.js +1 -0
  83. package/web/assets/go-C27-OAKa.js +1 -0
  84. package/web/assets/graphql-ChdNCCLP.js +1 -0
  85. package/web/assets/html-pp8916En.js +1 -0
  86. package/web/assets/{index-DFfbtrtQ.js → index-B6q9ygFx.js} +9 -9
  87. package/web/assets/index-CU6ublfJ.js +1 -0
  88. package/web/assets/index-CvYzv8kf.js +1 -0
  89. package/web/assets/index-Cz8nGS3-.css +1 -0
  90. package/web/assets/index-H1bePBGl.js +3 -0
  91. package/web/assets/index-yzG6be5R.js +416 -0
  92. package/web/assets/infoDiagram-6WML65LV-BJSGxY2D.js +2 -0
  93. package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-Cz3Y1Unl.js +2 -0
  94. package/web/assets/ini-BEwlwnbL.js +1 -0
  95. package/web/assets/ishikawaDiagram-5VMMS53U-7GCIT7WU-BT6MsYfb.js +70 -0
  96. package/web/assets/{ishikawaDiagram-WSZJBQD7-B4Ja0YPZ.js → ishikawaDiagram-WSZJBQD7-BsYCRLYP.js} +6 -6
  97. package/web/assets/java-CylS5w8V.js +1 -0
  98. package/web/assets/javascript-wDzz0qaB.js +1 -0
  99. package/web/assets/journeyDiagram-EYS64GPL-OAPELBT7-Bx1wxARt.js +139 -0
  100. package/web/assets/{journeyDiagram-NVQOT4AX-BmhpGG29.js → journeyDiagram-NVQOT4AX-DkJv2QF6.js} +2 -2
  101. package/web/assets/json-Cp-IABpG.js +1 -0
  102. package/web/assets/jsx-g9-lgVsj.js +1 -0
  103. package/web/assets/{kanban-definition-27J2QSJJ-CiuTLc9W.js → kanban-definition-27J2QSJJ-BCWiZznF.js} +8 -8
  104. package/web/assets/kanban-definition-3QL26DDD-I7RKWQQY-uHjeKCG_.js +89 -0
  105. package/web/assets/katex-N6JRN4PM-D4hrRJKq.js +257 -0
  106. package/web/assets/kotlin-BdnUsdx6.js +1 -0
  107. package/web/assets/latex-B2nUCzCX.js +1 -0
  108. package/web/assets/linear-BHfMepXe.js +1 -0
  109. package/web/assets/lua-BaeVxFsk.js +1 -0
  110. package/web/assets/main-B239_4z1.js +796 -0
  111. package/web/assets/makefile-CHLpvVh8.js +1 -0
  112. package/web/assets/markdown-Cvjx9yec.js +1 -0
  113. package/web/assets/mermaid-layout-elk.core-C4McJve2.js +2 -0
  114. package/web/assets/mermaid.core-CmjrekXI.js +314 -0
  115. package/web/assets/min-tv6RD-6E.js +1 -0
  116. package/web/assets/{mindmap-definition-FAOFIHXS-Bt-VPht2.js → mindmap-definition-FAOFIHXS-PIVNjK20.js} +4 -4
  117. package/web/assets/mindmap-definition-FBJOCRG2-KIYZG64Y-C8ko7Fkc.js +96 -0
  118. package/web/assets/pegDiagram-VL7TDLO6-D0oejFBc.js +1 -0
  119. package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-Cqs1jeYc.js +1 -0
  120. package/web/assets/{pet-a4xGZJ4o.js → pet-CZ36ImJS.js} +1 -1
  121. package/web/assets/php-Csjmro_R.js +1 -0
  122. package/web/assets/pie-xhYaZtwS.js +1 -0
  123. package/web/assets/pieDiagram-7S7Q4E2Y-CdvhM-aN.js +39 -0
  124. package/web/assets/pieDiagram-E7YTZNPT-2UOTW327-BMlCBlPI.js +39 -0
  125. package/web/assets/python-B6aJPvgy.js +1 -0
  126. package/web/assets/quadrantDiagram-AXDQQJYC-SN3ASJJK-CEEgxhrf.js +7 -0
  127. package/web/assets/{quadrantDiagram-CIZ2JOQS-B-1McWhJ.js → quadrantDiagram-CIZ2JOQS-BrKm5erH.js} +2 -2
  128. package/web/assets/r-Cf5RLm7j.js +1 -0
  129. package/web/assets/railroadDiagram-AXF67PYL-CJudf8AD.js +1 -0
  130. package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-C8RacTGn.js +1 -0
  131. package/web/assets/render-O7CIS3YK-BtRzL6gS.js +354 -0
  132. package/web/assets/requirementDiagram-EFPCY7ZU-NGAFFSMB-CTXLwcL9.js +84 -0
  133. package/web/assets/{requirementDiagram-LRYGKXZP-BVqLmmFw.js → requirementDiagram-LRYGKXZP-mS__tKrf.js} +4 -4
  134. package/web/assets/ruby-B6QtyW_S.js +1 -0
  135. package/web/assets/rust-B1yitclQ.js +1 -0
  136. package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-DyuDtBvQ.js +40 -0
  137. package/web/assets/sankeyDiagram-W5VNT64P-COKGPXfA.js +40 -0
  138. package/web/assets/scss-D5BDwBP9.js +1 -0
  139. package/web/assets/{sequenceDiagram-SI44F4Z6-7pBYtwXq.js → sequenceDiagram-SI44F4Z6-CNMY38eS.js} +3 -3
  140. package/web/assets/sequenceDiagram-WJ2MYXX4-Q2IOPB4R-_u4WjXk1.js +162 -0
  141. package/web/assets/shellscript-Yzrsuije.js +1 -0
  142. package/web/assets/sizeCapture-X5ZJPWSS-DWdLSp6i.js +1 -0
  143. package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-Cs-f36Xi.js +1 -0
  144. package/web/assets/sql-CRqJ_cUM.js +1 -0
  145. package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-D3Vb1Yoi.js +1 -0
  146. package/web/assets/stateDiagram-OKZ733FA-DWpXAgAW.js +1 -0
  147. package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-C6PXffxU.js +1 -0
  148. package/web/assets/stateDiagram-v2-UEYNNEHI-D3rCYZ7F.js +1 -0
  149. package/web/assets/step-SI6FXFD6.js +1 -0
  150. package/web/assets/swift-C2oV4EkX.js +1 -0
  151. package/web/assets/swimlanes-SLNWSIFB--qlM3PH1.js +2 -0
  152. package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-Dq7F7g7w.js +1 -0
  153. package/web/assets/swimlanesDiagram-ULZ7WXOC-C2JzshU-.js +8 -0
  154. package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-C1mY3FR0.js +8 -0
  155. package/web/assets/time-CLfYygnx.js +1 -0
  156. package/web/assets/timeline-definition-24CTP7MA-KN7RSRVM-BRP9kk4o.js +120 -0
  157. package/web/assets/{timeline-definition-Z64GVDOM-CPyFZDbL.js → timeline-definition-Z64GVDOM-CGIURnLx.js} +4 -4
  158. package/web/assets/toml-vGWfd6FD.js +1 -0
  159. package/web/assets/transform-CzGDKG_M.js +1 -0
  160. package/web/assets/tsx-COt5Ahok.js +1 -0
  161. package/web/assets/typescript-BPQ3VLAy.js +1 -0
  162. package/web/assets/vennDiagram-4TSXK5OY-AKJ7LXAN-Row28BrM.js +34 -0
  163. package/web/assets/{vennDiagram-T6HMQDX7-CrYCZIBM.js → vennDiagram-T6HMQDX7-CCAqbOji.js} +5 -5
  164. package/web/assets/vue-CHlpWS_5.js +1 -0
  165. package/web/assets/{wardleyDiagram-T6FBY63Y-C-bOW3CV.js → wardleyDiagram-T6FBY63Y-BsHQ7eqA.js} +2 -2
  166. package/web/assets/wardleyDiagram-VM6X3IG4-3B6A3BN5-DBcNZZDs.js +78 -0
  167. package/web/assets/xml-sdJ4AIDG.js +1 -0
  168. package/web/assets/xychartDiagram-ELKLHX3M-Bdjq4REQ.js +7 -0
  169. package/web/assets/xychartDiagram-S5SC5T6Z-OBDNV6WG-ClGm8SGz.js +7 -0
  170. package/web/assets/yaml-Buea-lGh.js +1 -0
  171. package/web/index.html +3 -3
  172. package/web/pet.html +3 -3
  173. package/web/assets/abnfDiagram-N423BO3Z-BgfNjjBj.js +0 -1
  174. package/web/assets/api-web-DI50TDfG.js +0 -1
  175. package/web/assets/arc-RE7zZVS-.js +0 -1
  176. package/web/assets/channel-BhfjE8vu.js +0 -1
  177. package/web/assets/chunk-2GRJ4B5K-Cam0QBnt.js +0 -1
  178. package/web/assets/chunk-KBJHAD2P-BsrsrevO.js +0 -1
  179. package/web/assets/chunk-XXDRQBXY-BtPTE4dn.js +0 -1
  180. package/web/assets/classDiagram-JCYQIIEL-mL7PrSyJ.js +0 -1
  181. package/web/assets/classDiagram-v2-OCEON4UE-mL7PrSyJ.js +0 -1
  182. package/web/assets/cynefinDiagram-MW4NZA55-BVpP0nLh.js +0 -62
  183. package/web/assets/diagram-LBJQPF4R-B32aZsIz.js +0 -24
  184. package/web/assets/diagram-Q27KOJAE-DwwhihNN.js +0 -24
  185. package/web/assets/diagram-UB23O5K3-BdxB0b3R.js +0 -41
  186. package/web/assets/ebnfDiagram-BXEA7PRR-PAN05I_q.js +0 -1
  187. package/web/assets/ganttDiagram-PKOTCBZU-BqnBC4Aw.js +0 -292
  188. package/web/assets/index-D8iAKGNi.css +0 -1
  189. package/web/assets/infoDiagram-6WML65LV-B4sR-B3M.js +0 -2
  190. package/web/assets/linear-l0VVDmXM.js +0 -1
  191. package/web/assets/main-5hScumEl.js +0 -792
  192. package/web/assets/mermaid.core-DZ6Z8vWa.js +0 -314
  193. package/web/assets/pegDiagram-VL7TDLO6-CANPvqfq.js +0 -1
  194. package/web/assets/pieDiagram-7S7Q4E2Y-HpK8uEiY.js +0 -39
  195. package/web/assets/railroadDiagram-AXF67PYL-DA507-no.js +0 -1
  196. package/web/assets/sankeyDiagram-W5VNT64P-WV_Swfln.js +0 -40
  197. package/web/assets/sizeCapture-X5ZJPWSS-Ba9eWTxX.js +0 -1
  198. package/web/assets/stateDiagram-OKZ733FA-lonr0yA-.js +0 -1
  199. package/web/assets/stateDiagram-v2-UEYNNEHI-Dt1VC3TV.js +0 -1
  200. package/web/assets/swimlanes-SLNWSIFB-BSQT7r6F.js +0 -2
  201. package/web/assets/swimlanesDiagram-ULZ7WXOC-Dhdnb080.js +0 -8
  202. package/web/assets/xychartDiagram-ELKLHX3M-BB-TjDfD.js +0 -7
@@ -0,0 +1,796 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./elk.bundled-DjGexDyy.js","./index-B6q9ygFx.js","./index-Cz8nGS3-.css","./_commonjs-dynamic-modules-TDtrdbi3.js","./mermaid.core-CmjrekXI.js","./transform-CzGDKG_M.js","./step-SI6FXFD6.js","./cpp-DddhVWhK.js","./c-BIGW1oBm.js","./ruby-B6QtyW_S.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-CRqJ_cUM.js","./graphql-ChdNCCLP.js","./typescript-BPQ3VLAy.js","./jsx-g9-lgVsj.js","./tsx-COt5Ahok.js","./shellscript-Yzrsuije.js","./lua-BaeVxFsk.js","./yaml-Buea-lGh.js","./php-Csjmro_R.js","./json-Cp-IABpG.js","./scss-D5BDwBP9.js","./latex-B2nUCzCX.js","./r-Cf5RLm7j.js","./vue-CHlpWS_5.js","./core-Drxo65nc.js","./index-yzG6be5R.js","./index-CU6ublfJ.js","./index-H1bePBGl.js","./min-tv6RD-6E.js","./ordinal-Cboi1Yqb.js","./init-Gi6I4Gst.js","./colors-Cc3OSVma.js"])))=>i.map(i=>d[i]);
2
+ var z3=Object.defineProperty;var H3=(e,t,n)=>t in e?z3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hl=(e,t,n)=>H3(e,typeof t!="symbol"?t+"":t,n);import{r as w,e as U3,j as f,c as yh,g as F0,u as z0,h as vh,k as fi,l as V3,m as mc,n as q3,o as $3,p as _n,q as W3,V as G3,v as Y3,F as wh,s as kh,t as K3,w as V1,x as X3,y as Eh,z as Th,A as Q3,B as Z3,C as J3,D as q1,E as pc,G as ey,M as $1,H as ty,I as Sh,J as ny,K as ry,b as Hn,L as Ah,N as Jr,R as iy,O as ay,P as Ch,Q as Nh,S as Ul,T as ya,U as sy,W as va,X as oy,Y as ly,Z as uy,_ as cy,$ as Mh,a0 as dy,a1 as Ih,a2 as hy,a3 as fy,a4 as my,a5 as py,a6 as H0}from"./index-B6q9ygFx.js";const gy="modulepreload",xy=function(e,t){return new URL(e,t).href},_h={},Ye=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=s(n.map(c=>{if(c=xy(c,r),c in _h)return;_h[c]=!0;const h=c.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(!!r)for(let g=o.length-1;g>=0;g--){const x=o[g];if(x.href===c&&(!h||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${m}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":gy,h||(p.as="script"),p.crossOrigin="",p.href=c,u&&p.setAttribute("nonce",u),document.head.appendChild(p),h)return new Promise((g,x)=>{p.addEventListener("load",g),p.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return t().catch(a)})};/**
3
+ * @license lucide-react v0.468.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */const by=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),W1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
8
+ * @license lucide-react v0.468.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */var yy={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"};/**
13
+ * @license lucide-react v0.468.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */const vy=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...o},l)=>w.createElement("svg",{ref:l,...yy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:W1("lucide",i),...o},[...s.map(([u,c])=>w.createElement(u,c)),...Array.isArray(a)?a:[a]]));/**
18
+ * @license lucide-react v0.468.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */const Ie=(e,t)=>{const n=w.forwardRef(({className:r,...i},a)=>w.createElement(vy,{ref:a,iconNode:t,className:W1(`lucide-${by(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
23
+ * @license lucide-react v0.468.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */const wy=Ie("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
28
+ * @license lucide-react v0.468.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */const gc=Ie("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
33
+ * @license lucide-react v0.468.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */const ky=Ie("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
38
+ * @license lucide-react v0.468.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */const Ey=Ie("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
43
+ * @license lucide-react v0.468.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */const or=Ie("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
48
+ * @license lucide-react v0.468.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */const Ty=Ie("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"}]]);/**
53
+ * @license lucide-react v0.468.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const U0=Ie("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
58
+ * @license lucide-react v0.468.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const Sy=Ie("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
63
+ * @license lucide-react v0.468.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const Tn=Ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
68
+ * @license lucide-react v0.468.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const V0=Ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
73
+ * @license lucide-react v0.468.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const Ay=Ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
78
+ * @license lucide-react v0.468.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const G1=Ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
83
+ * @license lucide-react v0.468.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const xc=Ie("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
88
+ * @license lucide-react v0.468.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const Wn=Ie("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
93
+ * @license lucide-react v0.468.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const Cy=Ie("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
98
+ * @license lucide-react v0.468.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const Ny=Ie("CircleSlash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
103
+ * @license lucide-react v0.468.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const ki=Ie("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
108
+ * @license lucide-react v0.468.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const Y1=Ie("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
113
+ * @license lucide-react v0.468.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const K1=Ie("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
118
+ * @license lucide-react v0.468.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const My=Ie("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"}]]);/**
123
+ * @license lucide-react v0.468.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const X1=Ie("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
128
+ * @license lucide-react v0.468.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const Iy=Ie("Dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);/**
133
+ * @license lucide-react v0.468.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const _y=Ie("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"}]]);/**
138
+ * @license lucide-react v0.468.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const ps=Ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
143
+ * @license lucide-react v0.468.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const Q1=Ie("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
148
+ * @license lucide-react v0.468.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const Ry=Ie("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/**
153
+ * @license lucide-react v0.468.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const Ly=Ie("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
158
+ * @license lucide-react v0.468.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const Dy=Ie("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
163
+ * @license lucide-react v0.468.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const Z1=Ie("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
168
+ * @license lucide-react v0.468.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const Py=Ie("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
173
+ * @license lucide-react v0.468.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const Oy=Ie("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
178
+ * @license lucide-react v0.468.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const jy=Ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
183
+ * @license lucide-react v0.468.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const By=Ie("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
188
+ * @license lucide-react v0.468.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const Mo=Ie("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
193
+ * @license lucide-react v0.468.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const Fy=Ie("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
198
+ * @license lucide-react v0.468.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const q0=Ie("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
203
+ * @license lucide-react v0.468.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const zy=Ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
208
+ * @license lucide-react v0.468.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const Hy=Ie("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
213
+ * @license lucide-react v0.468.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const $0=Ie("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
218
+ * @license lucide-react v0.468.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const gs=Ie("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"}]]);/**
223
+ * @license lucide-react v0.468.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const J1=Ie("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
228
+ * @license lucide-react v0.468.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const Uy=Ie("MessageSquare",[["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"}]]);/**
233
+ * @license lucide-react v0.468.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const Fa=Ie("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"}]]);/**
238
+ * @license lucide-react v0.468.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const Vy=Ie("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
243
+ * @license lucide-react v0.468.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const qy=Ie("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
248
+ * @license lucide-react v0.468.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const Rh=Ie("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
253
+ * @license lucide-react v0.468.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const $y=Ie("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
258
+ * @license lucide-react v0.468.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const Wy=Ie("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
263
+ * @license lucide-react v0.468.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const Gy=Ie("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"}]]);/**
268
+ * @license lucide-react v0.468.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const Yy=Ie("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
273
+ * @license lucide-react v0.468.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const ns=Ie("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"}]]);/**
278
+ * @license lucide-react v0.468.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const Lh=Ie("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
283
+ * @license lucide-react v0.468.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const nl=Ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
288
+ * @license lucide-react v0.468.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const Vl=Ie("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/**
293
+ * @license lucide-react v0.468.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const eg=Ie("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
298
+ * @license lucide-react v0.468.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const Ky=Ie("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
303
+ * @license lucide-react v0.468.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const Xy=Ie("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
308
+ * @license lucide-react v0.468.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const za=Ie("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
313
+ * @license lucide-react v0.468.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const Qy=Ie("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
318
+ * @license lucide-react v0.468.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const Zy=Ie("ScanText",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]);/**
323
+ * @license lucide-react v0.468.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const W0=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
328
+ * @license lucide-react v0.468.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const Jy=Ie("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
333
+ * @license lucide-react v0.468.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const e5=Ie("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"}]]);/**
338
+ * @license lucide-react v0.468.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const Io=Ie("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
343
+ * @license lucide-react v0.468.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const G0=Ie("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
348
+ * @license lucide-react v0.468.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const t5=Ie("Shield",[["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"}]]);/**
353
+ * @license lucide-react v0.468.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const n5=Ie("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/**
358
+ * @license lucide-react v0.468.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const bc=Ie("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
363
+ * @license lucide-react v0.468.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const r5=Ie("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
368
+ * @license lucide-react v0.468.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const Y0=Ie("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
373
+ * @license lucide-react v0.468.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const i5=Ie("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
378
+ * @license lucide-react v0.468.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const tg=Ie("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
383
+ * @license lucide-react v0.468.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const $i=Ie("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
388
+ * @license lucide-react v0.468.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const a5=Ie("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
393
+ * @license lucide-react v0.468.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const ng=Ie("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"}]]);/**
398
+ * @license lucide-react v0.468.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const yc=Ie("Trash",[["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"}]]);/**
403
+ * @license lucide-react v0.468.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const wr=Ie("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
408
+ * @license lucide-react v0.468.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const s5=Ie("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
413
+ * @license lucide-react v0.468.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const rg=Ie("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
418
+ * @license lucide-react v0.468.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const o5=Ie("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
423
+ * @license lucide-react v0.468.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */const xs=Ie("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
428
+ * @license lucide-react v0.468.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */const Fn=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
433
+ * @license lucide-react v0.468.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */const vc=Ie("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ie=new Proxy({},{get(e,t){if(typeof window>"u"||!window.api)throw new Error(`window.api 未注入(尝试访问 ${t})。请检查 preload 是否正确加载。`);const n=window.api[t];if(typeof n!="function")throw new Error(`window.api.${t} 不是函数`);return n}}),mr=typeof navigator<"u"&&navigator.userAgent.includes("Electron"),l5=/[\u2E80-\u9FFF\uF900-\uFAFF\u3000-\u303F\uFF00-\uFFEF]/g;function ig(e){if(!e)return 0;const t=(e.match(l5)??[]).length,n=e.length-t;return Math.ceil(t*11/10+n/4)}function u5(e,t){return!t||t<=0?null:e<=0?0:Math.min(100,Math.round(e/t*100))}function c5(e,t){const n=e.reduce((r,i)=>r+i,0);return n<=0||t<=0?e.map(()=>0):e.map(r=>t*r/n)}function _i(e){return e<1e3?String(Math.round(e)):e<1e4?`${(e/1e3).toFixed(1)}k`:`${Math.round(e/1e3)}k`}const ag=.5,d5=.9,h5=.85;var K0=U3();const sg="lookatstudy-lang";let _o=typeof localStorage>"u"?"zh-CN":localStorage.getItem(sg)||"zh-CN";const wc=new Set;function og(e){return wc.add(e),()=>{wc.delete(e)}}const Dh={"zh-CN":{"action.close":"关闭","action.delete":"删除","action.undo":"撤销","action.confirm":"确认","action.cancel":"取消","header.toggleLeft":"切换左栏 (Ctrl+B)","header.toggleRight":"切换右栏","header.font.smaller":"缩小字号","header.font.larger":"放大字号","header.settings":"设置 (Ctrl+S)","header.xp":"XP","header.theme.dark":"切换到亮色","header.theme.light":"切换到暗色","map.tab.map":"课程地图","map.tab.import":"导入课程","map.course.none":"未选择课程","map.review.label":"复习","map.search.label":"搜索","map.search.placeholder":"搜索章节、课时或内容…","map.search.close":"关闭","map.search.clear":"清空","map.search.noResults":"没有匹配的结果","map.search.contentGroup":"内容匹配","chat.action.startLearning":"开始学习「{title}」","chat.action.startLearningPrompt":`我想开始学「{title}」。但我现在没什么劲——别直接讲概念,也别出计分题考我。请这样开场:
438
+ 1. 先用一两句散文抛个钩子(反直觉的、或跟我日常有关的,让我产生好奇);
439
+ 2. 然后调用 pose_guess 工具,给我一个二选一的小猜测(就是玩,不是考试);
440
+ 3. 我会点选项猜,你【下一回合】再揭晓,顺带把这课最核心的一点讲清楚。
441
+ 铁律:起手不要讲座、不要用 generate_quiz 出计分题、不要计分。把我勾住是唯一目标。`,"starter.go-deeper.label":"深入这点","starter.go-deeper.hint":"把刚揭晓的概念讲深一层","starter.go-deeper.message":"帮我深入讲讲「{title}」刚才那个核心点——展开它的结构、细节和容易忽略的边界。","starter.give-example.label":"举个例子","starter.give-example.hint":"用真实例子帮你看懂","starter.give-example.message":"给我一个「{title}」的实际例子或用法,让我更具体地理解。","starter.quiz-me.label":"考考我","starter.quiz-me.hint":"出题检验(答对涨掌握度)","starter.quiz-me.message":"出一道关于「{title}」的应用题考考我,看我是否真懂了——我答完请判断对错。","starter.confused.label":"我没太懂","starter.confused.hint":"告诉 AI 你卡在哪(会记下)","starter.confused.message":"关于「{title}」,我有地方不太懂,帮我理一理——先问我是哪里不清楚。","map.world.study":"学习","map.world.practice":"实操","pane.switcher":"视图切换","pane.map":"课程","pane.chat":"导师","pane.notes":"黑板","map.streaming.notice":"AI 正在回答,完成后可切换节点","map.generating":"正在生成课程路径…","map.empty.cta.title":"开始你的第一门课","map.empty.cta.desc":"导入一个 GitHub 学习仓库,自动生成选关路径","map.empty.cta.btn":"点这里导入 →","map.empty.practice":"这个课程暂无实操练习内容","node.locked.chapterHint":"(完成本章所有课时后解锁)","node.due.hint":"(待复习)","import.empty":"还没有课程。用下方导入第一个吧。","import.cta":"导入新课程","import.tab.url":"URL","import.tab.md":"MD","import.tab.folder":"文件夹","import.url.placeholder":"GitHub 仓库 / 网页文章 / arXiv 论文 链接","import.url.desc":"粘贴任意链接自动识别:GitHub 仓库 / arXiv 论文 / 网页文章 / B站·YouTube 视频(转写成课;B站多分P 不带 ?p= 导整季;更多站点需自装 yt-dlp)。","import.btn.url":"导入","import.btn.url.busy":"导入中…","import.placeholder.name":"课程名称(可选)","import.placeholder.md":"粘贴任意长文本或 Markdown…(没有小标题会自动分段)","import.btn.md":"导入为课程","import.btn.md.busy":"生成中…","import.folder.desc":"递归扫描 .txt/.md/.html/.pdf,适合已下载的课程资料包。","import.btn.folder":"选择文件夹","import.tab.epub":"电子书","import.epub.desc":"EPUB 电子书按章节拆课(章节边界来自书的目录与书脊顺序)。","import.btn.epub":"选择 EPUB 文件导入","import.tab.audio":"音频","import.audio.desc":"播客/讲座音频或本地视频(mp4)本地转写成课(音频 wav/mp3/m4a/flac,视频 mp4/m4v/mov,可多选=多集)。首次使用自动下载 Whisper 模型(约 1GB)。","import.btn.audio":"选择音频文件导入","import.tab.pack":"课程包","import.btn.pack":"选择课程包文件导入","import.pack.desc":"课程包是别人分享的导入方案快照(零 AI 调用,秒过分类和结构设计)。GitHub 仓库内容一致时直接复用;有更新会自动丢弃消失文件对应的课。","import.export":"导出","import.folder.pathPlaceholder":"服务器侧文件夹路径(如 /storage/emulated/0/Download/我的课程)","import.folder.pathRequired":"请填写服务器侧文件夹路径","import.pack.export":"导出课程包(分享给别人零 AI 导入)","import.pack.exported":"课程包已导出:{path}","import.error.resume":"从断点重试(跳过已完成的 AI 步骤)","import.success.reused":"复用已有方案,零 AI 调用","import.btn.folder.busy":"处理中…","import.delete":"删除","import.delete.confirm":"所有进度和练习都会清除,无法撤销。","import.delete.current":"删除当前课程","course.empty.title":"选择一门课程开始学习","course.empty.desc":"从左侧「导入课程」面板选择一门已导入的课程,或导入新课程。","import.success.md":"生成成功","import.success.folder":"导入成功","import.error.network":`
442
+
443
+ 网络受限或私有仓库请改用「Markdown」方式。`,"import.progress.elapsed":"已 {s}s","import.progress.title":"正在导入课程…","import.progress.starting":"正在启动…","import.progress.note":"导入在后台进行,可继续浏览其他课程","import.progress.cancel":"取消导入","import.cancelled":"已取消导入","toast.threadCreateFailed":"创建失败了,再试一次","toast.threadCreated":"新对话","toast.threadRenamed":"已重命名","toast.threadArchived":"已归档","toast.threadDeleted":"已删除","toast.threadDefault":"新会话","toast.restored":"已恢复","toast.noteSaved":"已加到笔记","toast.noteDeleted":"已删除笔记","toast.artifactSaved":"已记到笔记本","artifact.type.concept_map":"概念图","artifact.type.quiz":"练习题","artifact.type.compare_table":"对比表","artifact.type.diagram":"流程图","artifact.type.code_walkthrough":"代码讲解","artifact.type.unknown":"产物","command.placeholder":"输入指令或问题…(↑↓ 选择,Enter 确认)","command.empty.node":"没有匹配的命令","command.empty.nonode":"先在左侧选一个节点,才能用这些命令","command.footer.hint":"AI 导师会根据指令生成对应内容","command.footer.keys":"↵ 确认 · esc 关闭","command.group.node":"基于当前节点","command.group.mode":"学习模式","command.group.nav":"导航","command.explain_simple":"用大白话解释这一节","command.quiz_3":"出 3 道练习题考考我","command.concept_map":"画个概念图理清结构","command.compare_prev":"和上一节做对比表","command.socratic":"切到苏格拉底模式(提问引导)","command.exam_mode":"切到考试冲刺模式","review.title":"复习","review.nudge":"📅 今天有 {n} 个待复习,点左侧地图的「复习」入口巩固一下","review.loading":"正在检查哪些课该复习了…","review.empty.title":"还没有复习项","review.empty.desc":"完成一些练习后,这里会出现间隔复习提醒","review.due.count":"个待复习","review.start":"开始复习","review.shuffle":"混合练习(随机交错)","review.interleave":"交错复习","review.reviewLesson":"复习该课","review.selectSection":"选择章节","review.dueIn":"待复习","review.noDueInSection":"该章节暂无待复习内容","review.srsHint":"复习提醒","review.myProgress":"我的课程进度","review.overdueQuickHint":"逾期项,点击直接复习","review.quadrant.overdue":"逾期","review.quadrant.short":"短期","review.quadrant.long":"长期","review.quadrant.inactive":"待激活","review.quadrant.more":"更多","review.tip":"复习采用 SM-2 间隔重复算法。逾期项优先复习;长期记忆项间隔更长。单次复习封顶 {n} 题,避免积压压垮节奏。","review.selfrated":"✓ 已记录,掌握度已更新","review.selfrate.title":"复习完了吗?给自己打分","review.selfrate.again":"忘了","review.selfrate.again.hint":"明天重练","review.selfrate.remembered":"记得","review.selfrate.remembered.hint":"推迟几天","review.selfrate.mastered":"很熟","review.selfrate.mastered.hint":"很久后再看","lang.original":"原文","error.checkReadyFailed":"无法检查就绪状态","notebook.tab.explain":"讲解","notebook.tab.notes":"笔记","notebook.tab.board":"黑板","notebook.board.empty":"对话里产生概念图、流程图、对比表、代码讲解时,这里会实时展示最新的一幅大图,方便边看边问。","notebook.zone.understand":"理解","notebook.zone.note":"记录","notebook.zone.practice":"练习","notebook.empty.explain.title":"选一节课开始","notebook.empty.explain.desc":"在左侧地图选一个课时,这里会显示讲解内容","notebook.empty.notes.title":"还没有笔记","notebook.empty.notes.desc":"选中讲解文字画线,或让 AI 生成概念图/对比表,会出现在这里","settings.group.ai":"主模型","settings.group.speech":"语音模型","settings.group.vision":"看图模型","settings.group.appearance":"外观与语言","settings.row.provider":"服务商","settings.row.theme":"主题","settings.row.interface_lang":"界面语言","settings.row.import_lang":"导入偏好","settings.custom.form_title":"添加自定义 Provider","settings.footer.hint":"主模型区的改动需保存后生效,其余即时生效","settings.footer.save":"保存 AI 配置","header.energy":"今日能量","header.level.title":"等级(累计经验值的持久成长线,不随每日能量清零)","settings.title":"设置","view.tree":"技能树","view.dashboard":"仪表盘","view.import":"导入课程","mode.chat":"💬 对话","mode.exercise":"📝 练习","mode.settings":"⚙️ 设置","chat.starter.hint":"💡 从下面选一个开始,或者直接输入你的问题","chat.no_key.title":"还没有配置 AI 模型","chat.no_key.desc":"配置后即可开始 AI 导师对话和练习","chat.no_key.btn":"去配置模型","chat.input.placeholder":"问 AI 导师…(Enter 发送)","chat.input.no_node":"先在左侧选一个 lesson…","chat.send":"发送","chat.stop":"停止","chat.clear":"清空对话历史","chat.selection.quote":"提问这段","chat.soul.label":"风格:","chat.no_key.short":"未配置 AI 模型","chat.no_key.cta":"去配置 →","chat.attach.add":"添加图片或文件(可粘贴 / 拖拽)","chat.attach.remove":"移除 {name}","chat.attach.tooMany":"一条消息最多 {n} 个附件","chat.attach.tooLargeImage":"图片超过 5MB:{name}","chat.attach.tooLargeText":"文本文件超过 256KB:{name}","chat.attach.unsupported":"暂不支持该类型:{name}(支持图片与常见文本 / 代码文件)","chat.attach.visionUnsupported":"当前模型不支持看图,请用右侧模型切换器选一个带眼睛图标的模型,或在设置 → AI 看图里配置视觉模型覆盖","chat.attach.bridgeChip":"主模型是纯文本:图片将先由 {model} 转译成文字再交给它","chat.attach.preview":"查看 {name}","chat.attach.textChip":"文本附件,内容已随消息发给 AI","chat.attach.imageOnlyText":"请看这张图片。","context.label":"上下文","context.aria":"上下文已用 {p}","context.approx":"约","context.system":"系统提示","context.node":"课文","context.learner":"学习者状态","context.history":"对话历史","context.draft":"草稿","context.unknownWindow":"模型窗口未知","model.picker.label":"模型","model.picker.manage":"管理模型与密钥…","model.picker.vision":"支持看图","model.picker.noneConfigured":"还没有配置任何 provider 密钥","effort.label":"思考强度","effort.auto.label":"自动","effort.auto.desc":"模型默认行为,不干预","effort.fast.label":"快速","effort.fast.desc":"尽量关思考,答得快、省 token","effort.deep.label":"深度","effort.deep.desc":"尽量开思考,难题多想几步","effort.unsupported":"当前 provider 暂不支持思考强度切换","soul.direct":"精讲","soul.guide":"引导","soul.practice":"实战","soul.direct.desc":"精讲派 · 新手/想搞懂时用。先讲清楚再确认,给完整范例,不让你猜","soul.guide.desc":"引导派 · 有点基础、想自己推时用。不直接给答案,用引导性问题帮你推导","soul.practice.desc":"实战派 · 想动手时用。围绕真实世界的乱问题,在做中把概念织成网","settings.provider":"AI 服务商(Provider)","settings.model":"模型(Model)","settings.apikey":"API Key","settings.test":"测试连接","settings.testing":"测试中…","settings.save":"保存设置","settings.saved":"✅ 已保存","settings.daily_goal":"每日学习目标(XP)","settings.custom.add":"+ 添加自定义 Provider","settings.language":"语言(Language)","settings.add_custom":"自定义","settings.custom.label_ph":"名称","settings.custom.baseurl_ph":"Base URL(如 https://api.example.com/v1)","settings.custom.model_ph":"模型 ID","settings.custom.new":"新建自定义","settings.custom.form_title_vision":"配置看图模型(自定义 provider)","settings.custom.model_ph_vision":"如 glm-4.6v / gpt-4o","settings.custom.form_title_tts":"配置朗读 provider(OpenAI 兼容 /audio/speech 端点)","settings.custom.model_ph_tts":"如 tts-1 / FunAudioLLM/CosyVoice2-0.5B","settings.custom.form_title_asr":"配置听写 provider(OpenAI 兼容 /audio/transcriptions 端点)","settings.custom.model_ph_asr":"如 whisper-large-v3-turbo","settings.custom.apikey_ph":"API Key(可选)","settings.custom.save":"保存","settings.custom.windowLabel":"上下文窗口(tokens)","settings.custom.windowPh":"如 128000 或 128k(留空 = 未知)","settings.custom.windowHint":"当前模型的最大上下文,可在模型官方文档查到。填了输入框旁的上下文表才会显示占比。","settings.custom.vision":"支持看图(多模态)","settings.custom.visionHint":"勾选后系统将图片直接发给主模型;不勾选则走视觉转译桥(需在 AI 看图区配视觉模型)或跳过图片。","settings.delete_custom":"删除此自定义 Provider","settings.delete_custom_confirm":"删除自定义 Provider「{name}」?无法撤销。","settings.key.overwrite_ph":"覆盖…","settings.key.paste_ph":"粘贴 key","settings.key.get":"获取 →","settings.refresh":"刷新","settings.discovering":"刷新中…","settings.discover_failed":"刷新失败(可能网络受限)","settings.daily_goal.hint":"XP / 天(每答对一题 +10 XP)","settings.theme.auto":"跟随系统","settings.theme.light":"浅色","settings.theme.dark":"深色","settings.theme.following":"当前跟随系统:{mode}","settings.lang_pref.desc":"导入课程时自动按此偏好选择翻译。仓库原文语言与偏好一致时直接用原文;无对应翻译时也用原文。","settings.img_download":"图片下载","settings.img_download.desc":"导入课程时自动下载 md/notebook 里引用的图片(默认开启)","settings.multimodal.toggle":"AI 看图(聊天时)","settings.multimodal.toggle.desc":"开启后,聊天时 AI 能看到当前课关联的图片并讲解;问图/图表/架构图时生效(需 vision 模型)。导入时下载图片由上面的「图片下载」控制。","settings.group.memory":"学习者记忆","settings.memory.toggle":"让 AI 记住我","settings.memory.toggle.desc":"开启后,AI 会跨会话记住你的学习方式(偏好/卡点/反复混淆),越教越懂你。你拿皇冠(通关一节)时自动总结;也可手动触发。所有记忆只存本地。","settings.group.companion":"伴学伙伴","settings.companion.toggle":"伴学伙伴","settings.companion.toggle.desc":"伴学伙伴常驻课程地图、笔记本与对话栏:高光时刻一起庆祝,朗读课文时对口型,你的每次键击它都跟着拍手。五款形象随时换,只在本地运行。","settings.companion.sfx":"宠物音效","settings.companion.sfx.desc":"戳他/被拍/落地时的短促啾哔声(合成音,低音量)","settings.companion.pet":"桌宠模式","settings.companion.pet.desc":"伴学伙伴在应用外常驻桌面:透明置顶、慢慢巡游,点他仍可互动。开启后应用内的伙伴会休息,避免双影。","settings.companion.form":"形象","companion.name":"小焰","companion.form.ember.name":"小焰","companion.form.ember.desc":"赤焰守护机——热情的原点,能量核随今日 XP 充能","companion.form.frost.name":"霜绒","companion.form.frost.desc":"冰晶守望机——冷静沉稳,六瓣冰晶核逐瓣点亮","companion.form.moss.name":"苔芽","companion.form.moss.desc":"自然精灵机——温软陪伴,胸口种子随进度发芽张叶","companion.form.astro.name":"星尘","companion.form.astro.desc":"星空观测机——夜空屏面,能量核是随 XP 变圆的月相","companion.form.ink.name":"墨墨","companion.form.ink.desc":"砚上学者机——书房静气,墨池水位就是今日进度","companion.greet.1":"我在呢,继续!","companion.greet.2":"这节快拿下了!","companion.greet.3":"要我再讲一遍吗?","companion.greet.4":"深呼吸,再来一次。","settings.multimodal.current_model":"当前主模型:{model}","settings.multimodal.not_selected":"(未选)","settings.multimodal.hint_custom":"自定义 provider — 视觉能力未知。如不支持看图,在下方覆盖一个 vision 模型。","settings.multimodal.hint_preset":"如当前模型不支持 vision,可在下方配置专门的 vision 模型。常见:GLM-4V / GPT-4o / Claude 3.5 / Gemini。","settings.multimodal.override_title":"Vision 模型覆盖(可选 — 留空则复用主模型)","settings.multimodal.override_bridge_hint":"主模型不支持看图时,聊天中上传的图片会先由该模型转译成文字描述,再交给主模型解读(图像转译桥)。","settings.multimodal.legacy_preset":"旧配置(预设 {label})仍生效;可停止覆盖或改用自定义。","settings.multimodal.replace_custom":"更换","settings.multimodal.stop_override":"停止覆盖","settings.multimodal.vision_capable":"vision","settings.multimodal.test_override":"测试模型","settings.mathvision.toggle":"PDF 公式视觉转写(实验)","settings.mathvision.desc":"导入 PDF 时检测公式密集页,整页渲染成图交给上面的看图模型转成 LaTeX。需先配好看图模型,按页消耗额度;未开启或失败时按普通文本层导入。","settings.saved_text":"已保存","settings.key.configured":"已配置","settings.custom.test_label":"(测试)","settings.proto.openai":"OpenAI 兼容","chat.empty.overview":"这是这一课的概览","chat.empty.summary.title":"本课摘要","chat.empty.summary.none":"暂无摘要,点开始学习让 AI 帮你了解这一课","chat.empty.start":"开始学习","chat.empty.greeting":"👋 准备好了吗?这一课我们慢慢来。","chat.empty.keyless.title":"内容已在右侧,先读一读","chat.empty.keyless.desc":"配置好 AI 模型,就能和我对练、做练习、追踪掌握度。","chat.empty.keyless.btn":"去配置 AI 模型","chat.empty.no_node.title":"从左侧地图选一个节点","chat.empty.no_node.desc":"点击圆球节点开始学习。绿色=可学,金色=已掌握,紫色=章节考试","chat.scroll.bottom":"回到底部","chat.speech.speak":"朗读这条消息","chat.speech.stop":"停止朗读","chat.speech.progress":"{n}/{total} 句","chat.speech.model_missing":"语音模型还没下载。到 设置 → 语音能力 下载后即可朗读。","chat.speech.engine_unavailable":"语音引擎未就位。桌面版开箱可用;Termux 端重跑一行安装命令即可补装(约 12MB)。","chat.speech.dictation":"语音输入","chat.speech.hold_to_talk":"按住说话","chat.speech.release_to_stop":"松开,结束录音","chat.speech.recording_hint":"正在录音,松开结束","chat.speech.rerecord":"取消重录","chat.speech.retry":"重试","chat.speech.back_to_keyboard":"切回键盘输入","chat.speech.keyboard":"键盘","chat.speech.custom_provider_missing":"自定义语音 provider 不存在或已删除,到 设置 → 语音模型 重新配置。","chat.speech.no_speech":"没听到声音,请检查麦克风后重试。","chat.speech.transcribing":"转录中…","chat.speech.asr_failed":"转录失败,请重试。","chat.speech.groq_key_missing":"Groq 密钥未配置。到 设置 → 模型服务 配置 Groq,或改用本地引擎。","chat.speech.azure_stt_key_missing":"旧 Azure 听写配置缺少密钥。请在 设置 → 语音模型 改用自定义听写端点。","chat.speech.azure_stt_region_missing":"旧 Azure 听写配置缺少区域。请在 设置 → 语音模型 改用自定义听写端点。","chat.speech.asr_model_missing":"听写模型还没下载。到 设置 → 语音模型 下载 Whisper(本地离线),或改用自定义听写端点。","chat.speech.asr_start_fail":"麦克风启动失败,请检查系统权限。","chat.speech.asr_insecure_context":"浏览器只允许在安全上下文(https 或 127.0.0.1)使用麦克风。请用手机引导器打开本页,或给 serve 配置 --tls-cert/--tls-key 后改走 https 访问。","chat.speech.read_aloud_node":"朗读本课","chat.speech.azure_key_missing":"Azure 朗读缺少密钥。到 设置 → 语音能力 填写后使用。","chat.speech.azure_region_missing":"Azure 朗读缺少区域。到 设置 → 语音能力 填写后使用。","chat.speech.edge_failed":"在线朗读失败,且本地模型未就绪无法降级。稍后重试或改用本地引擎。","chat.speech.edge_disclosed":"朗读将文本发送至微软在线服务(Edge 免费通道)。想完全离线:设置 → 语音能力 → 本地离线。","settings.speech.tts_engine":"朗读引擎","settings.speech.engine.edge":"Edge 在线","settings.speech.engine.azure":"Azure","settings.speech.engine.local":"本地离线","settings.speech.engine.custom":"自定义","settings.speech.engine.system":"系统引擎","settings.speech.engine.system_note":"音色来自本机浏览器/系统的语音引擎,质量随设备而定(国产手机的厂商/讯飞引擎通常更自然)。本地播放、不联网;朗读时逐句高亮照常,伴学嘴型不可用。","settings.speech.engine.system_unavailable":"当前环境(WebView)不支持系统朗读","settings.speech.voice_auto":"自动(优先中文音色)","settings.speech.model.turbo_short":"Whisper Turbo(约 1GB)","settings.speech.model.small_short":"Whisper Small(约 360MB)","settings.speech.tts_title":"朗读","settings.speech.asr_title":"听写","settings.speech.custom_voice_ph":"如 alloy(留空用端点默认)","settings.speech.legacy":"旧配置,仍生效","settings.speech.key_saved":"密钥已存","settings.speech.confirm_del_custom":"删除后该档不可用,确认?","settings.speech.downloading":"下载中…","settings.speech.asr_engine.custom_note":"OpenAI 兼容转写端点;Groq 用户填 https://api.groq.com/openai/v1 + whisper-large-v3-turbo。","settings.speech.engine.edge_note":"微软 Edge 朗读通道:免费、无需密钥、音色为产品级;文本经在线服务合成。","settings.speech.voice":"音色","settings.speech.speed":"语速","settings.speech.asr_engine":"听写引擎","settings.speech.asr_engine.local":"本地离线","settings.speech.asr_engine.local_note":"Whisper 离线转写(自带标点,中文质量好);下载模型后完全离线,Turbo 约 1GB / Small 约 360MB。","settings.speech.asr_auto_stop":"静音后自动停止录音","settings.speech.asr_ux_note":"点输入框旁的麦克风进入语音模式:按住说话,松开后可修改识别文字再发送。","settings.speech.model.asr_turbo":"听写引擎 Whisper Turbo(约 1GB,推荐桌面)","settings.speech.model.asr_small":"听写引擎 Whisper Small(约 360MB,轻量)","settings.speech.license_mit":"MIT · 本地推理","settings.speech.model.tts":"朗读引擎(Kokoro,约 430MB)","settings.speech.state.absent":"未下载","settings.speech.state.ready":"已就绪","settings.speech.state.error":"出错","settings.speech.download":"下载","settings.speech.delete":"删除","settings.speech.license":"Apache-2.0 · 本地推理","chat.friction.trigger":"我卡住了","chat.friction.hint":"选一个最接近的感受(可选写一句原因),AI 会记住并据此调整讲解。","chat.friction.confused":"糊涂","chat.friction.blocked":"卡住","chat.friction.frustrated":"受挫","chat.friction.desc_placeholder":"具体卡在哪了?(可选)","chat.friction.cancel":"取消","chat.friction.submit":"记下","chat.friction.saved":"已记下,AI 会据此调整这一课的讲法","chat.mastered.toast":"👑 太棒了!你掌握了这一课","chat.note.add":"加笔记","chat.note.add.title":"把这段对话存到记录区","chat.reasoning.label":"思考过程","chat.reasoning.chars":"{n} 字","chat.proposal.title":"AI 提议","chat.proposal.fallback":"提议({tool})","chat.proposal.apply":"应用","chat.proposal.reject":"拒绝","chat.proposal.mastered.title":"AI 建议你已掌握这节课","chat.proposal.mastered.hint":"采纳后本课解锁皇冠、进入复习排期。","chat.proposal.confirm":"确认掌握","chat.proposal.later":"再练练","chat.proposal.applied":"已采纳 · 本课已掌握","chat.proposal.rejected":"已忽略,继续学习","chat.copy":"复制","chat.copied":"已复制","chat.tool.get_node_info":"读取节点信息","chat.tool.record_answer":"记录答题观测","chat.tool.mark_mastered":"标记掌握","chat.tool.show_concept_map":"生成概念图","chat.tool.generate_quiz":"出练习题","chat.tool.compare_table":"生成对比表","chat.tool.draw_diagram":"画流程图","chat.tool.show_code_walkthrough":"代码讲解","thread.empty.no_node":"未选节点","thread.empty.hint":"输入问题开始","thread.actions.label":"操作","thread.new.label":"新建会话","thread.menu.rename":"重命名","thread.menu.archive":"归档","thread.delete.confirm":"删除会话「{name}」?消息也会一并删除。","notebook.empty.select_node":"从左侧地图选一个节点开始学习,讲解会显示在这里","notebook.empty.no_notes_message":"这一节还没有笔记。选中讲解文字「加笔记」,或问 AI「画个概念图」「出 3 道题」「做个对比表」","notebook.node_type.section":"章节","notebook.node_type.concept":"概念","notebook.node_type.lesson":"课时","notebook.content.loading":"正在加载这一节的讲解…","notebook.content.load_failed":"内容加载失败。","notebook.content.retry":"重试","notebook.content.render_failed":"这段内容渲染失败(可能翻译格式有问题)。","notebook.content.truncated":"…(截断)","notebook.content.retry_render":"重试渲染","notebook.content.empty":"这一节还没有讲解内容。问 AI 导师:「给我讲讲这一节」","notebook.mindmap.toggle":"思维导图视图","notebook.images.heading":"插图({n})","notebook.quote.template":"关于这段内容「{text}」,我不太懂,请帮我解释:","notebook.quote.ask":"提问","notebook.quote.add_note":"加笔记","notebook.quote.save_note.title":"把选中文字存到记录区,带溯源跳转","notebook.quote.hint":"选中讲解文字点「加笔记」;AI 生成的概念图/对比表/练习卡会自动进「笔记」标签","notebook.source.label":"来源","notebook.source.jump_content":"跳到讲解原位","notebook.source.jump_chat":"跳到对话原位","notebook.zone.understand.subtitle":"AI 帮你梳理的知识结构","notebook.zone.understand.empty_hint":"问 AI「画个概念图」「做个对比表」梳理这一节","notebook.zone.note.subtitle":"你的画线,点击可跳回原位","notebook.zone.note.empty_hint":"选中讲解或对话的文字,点「加笔记」存到这里","notebook.zone.practice.subtitle_empty":"做题检验掌握,可重做","notebook.zone.practice.subtitle_stats":"{n} 题 · 上次答对 {c} · 答错 {w}","notebook.zone.practice.empty_hint":"问 AI「出 3 道题考考我」,题目会自动进这里","notebook.note.comment.ph_new":"写下你对这段画线的注释…","notebook.note.comment.ph_edit":"编辑注释…(清空保存即可删除)","notebook.action.save":"保存","notebook.action.cancel":"取消","notebook.note.edit_comment":"编辑注释","notebook.note.add_comment":"加注释","notebook.note.pinned":"已置顶","notebook.note.pin":"置顶","notebook.note.unpin":"取消置顶","notebook.note.delete":"删除","notebook.quiz.last_correct":"上次答对","notebook.quiz.last_wrong":"上次答错","notebook.artifact.broken":"产物数据损坏","notebook.asset.loading":"加载中…","exam.loading":"正在生成章节考试题…","exam.errorTitle":"考试加载失败","exam.errorEmpty":"题目生成失败,请稍后重试","exam.reload":"重新加载","exam.question.label":"第 {n} 题","exam.next":"下一题","exam.submit":"提交考试","exam.accuracy":"正确率 {n}%","exam.stars.congrats":"恭喜,获得 {n} 星!","exam.stars.thisAndBest":"本次 {n} 星 · 历史最佳 {m} 星","exam.stars.failed":"未达 60%,再接再厉","exam.review.title":"逐题回顾","exam.review.questionFallback":"(题目 {n})","exam.review.yourAnswer":"你的答案:","exam.review.correctAnswer":"正确:","exam.review.unanswered":"(未答)","exam.retry":"重新考试(题目已缓存)","exam.generating.title":"正在生成章节考试题…","exam.generating.stage":"AI 正在按本章知识点逐批出题","exam.generating.kcProgress":"已覆盖 {done} / {total} 个知识点","exam.generating.preparing":"准备中…","exam.generating.canLeave":"可以离开本页,生成会在后台继续;完成后会通知你。","exam.failed.retry":"重新生成","exam.ready.title":"考试已生成","exam.ready.meta":"{q} 题 · 覆盖 {kc} 个知识点 · 预计 {min} 分钟","exam.ready.toast":"「{title}」的考试题已生成,随时可以开考","exam.start":"开始考试","exam.retryExam":"重新考试","exam.regenerate":"重新出题","exam.regenerate.confirmMsg":"重新出题会丢弃当前题库,并让 AI 按本章知识点重新出一批(历史成绩保留)。","exam.submitting":"正在判分…","exam.q.progress":"第 {i} / {n} 题","exam.q.next":"下一题","exam.q.submit":"提交考试","exam.terminated.banner":"本场考试因中途离开被终止,未答的题按答错计分。","exam.result.score":"{correct} / {total} 题正确","exam.result.accuracy":"正确率 {pct}%","exam.result.best":"历史最好:{stars} 星","exam.result.attempts":"已考 {n} 次","exam.result.kcBreakdown":"按知识点","exam.result.weakKc":"薄弱 · 建议复习","exam.result.correctLabel":"答对","exam.result.unanswered":"未答","exam.result.yourAnswer":"你的答案:","exam.result.correctAnswer":"正确答案:","exam.result.review":"逐题回顾","exam.leave.title":"离开将终止考试","exam.leave.message":"未答的题将按答错计分,本场成绩会被记录。确定要离开吗?","exam.leave.confirm":"终止并离开","exam.leave.cancel":"继续考试","error.renderFailed":"这部分内容渲染失败(可能格式有问题)。","error.retry":"重试","artifact.unknownHeader":"产物(未识别类型)","artifact.zoomOut":"缩小","artifact.zoomReset":"重置缩放","artifact.zoomIn":"放大","artifact.canvas.fit":"适屏","artifact.viewer.open":"放大查看","artifact.viewer.hint":"双指缩放 · 单指拖动 · Ctrl+滚轮","artifact.conceptmap.stats":"{nodes} 个概念 · {edges} 个关系 · Ctrl+滚轮缩放 · 拖动平移","artifact.codewalk.sectionLabel":"逐段讲解(点击定位代码)","artifact.codewalk.lineSingle":"第 {n} 行","artifact.codewalk.lineRange":"第 {a}-{b} 行","artifact.diagram.flowchart":"流程图","artifact.diagram.sequence":"时序图","artifact.diagram.state":"状态图","artifact.mermaid.openLive":"在 mermaid.live 打开(可编辑)","artifact.mermaid.rendering":"渲染图中…","artifact.mermaid.renderFailed":"渲染失败,显示源码(可复制到 mermaid.live 查看)","artifact.mermaid.repairing":"图有语法问题,正在自动修复…","artifact.mermaid.errorPrefix":"错误: {msg}","artifact.mermaid.hint":"Ctrl+滚轮缩放 · 拖动平移查看","quiz.questionProgress":"第 {cur}/{total} 题","quiz.answeredCorrect":"已答对 {n}","quiz.correct":"答对了","quiz.wrong":"答错了","quiz.finish":"完成练习","quiz.scoreSummary":"{correct}/{total} 答对","quiz.hook.label":"📊 答题完成:{{correct}}/{{total}}","quiz.hook.finish":"完成答题","quiz.hook.sent":"成绩单已交给导师,等待分析…","quiz.hook.message":`我刚做完了答题卡{{title}},成绩 {{correct}}/{{total}}。下面是逐题情况:
444
+ 请根据我的表现决定下一步:答错的题讲清为什么错和正确思路;全对的话判断我是否可以进入下一部分。不要重新出同一组题,也不要只说一句做得好。`,"quiz.hook.lineOk":"✅ 第{{n}}题「{{prompt}}」:答对","quiz.hook.lineWrong":"❌ 第{{n}}题「{{prompt}}」:我选了「{{chosen}}」,正确答案是「{{answer}}」","quiz.allCorrectHint":"全部答对,掌握度已提议更新","quiz.tryAgainHint":"再练一组巩固一下","quiz.action.nextPrompt":"接下来可以:","quiz.action.explainWrong":"讲讲我答错的","quiz.action.retry":"再来一组","quiz.action.goDeeper":"深入讲讲原理","quiz.action.markMastered":"确认我掌握了","quiz.action.nextTopic":"下一个知识点","guess.header":"来猜一个","guess.pickedPrefix":"我猜:","guess.waitReveal":"已猜,等 AI 揭晓 ⋯","import.deleted":"已删除:{title}","exercise.title":"📝 练习","exercise.generate":"出一道练习","exercise.submit":"提交答案","exercise.next":"下一题 →","exercise.correct":"✅ 答对了!","exercise.wrong":"❌ 答错了","exercise.types.mcq":"选择题","exercise.types.fill_blank":"填空题","exercise.types.true_false":"判断题","dashboard.title":"学习仪表盘","dashboard.stat.streak":"连续天数","dashboard.stat.due":"今日待复习","dashboard.stat.mastery":"整体掌握度","dashboard.review":"去复习","dashboard.cleared":"已清空","dashboard.export.md":"📄 导出报告","dashboard.export.json":"导出 JSON","dashboard.section_mastery":"按章节掌握度","dashboard.mini.sections":"章节掌握度","dashboard.mini.struggle":"你的薄弱点(点开重学)","import.title":"导入课程","import.url":"GitHub URL","import.markdown":"粘贴 Markdown","import.btn":"导入","import.md_btn":"生成课程","streak.days":"天","streak.title":"连续学习 {n} 天 · 最长 {m} 天","streak.freeze.title":"剩余冻结 {n} 个:漏签一天可自动保住连击"},en:{"action.close":"Close","action.delete":"Delete","action.undo":"Undo","action.confirm":"Confirm","action.cancel":"Cancel","header.toggleLeft":"Toggle left pane (Ctrl+B)","header.toggleRight":"Toggle right pane","header.font.smaller":"Decrease font size","header.font.larger":"Increase font size","header.settings":"Settings (Ctrl+S)","header.xp":"XP","header.theme.dark":"Switch to light","header.theme.light":"Switch to dark","map.tab.map":"Course Map","map.tab.import":"Import","map.course.none":"No course selected","map.review.label":"Review","map.search.label":"Search","map.search.placeholder":"Search chapters, lessons or content…","map.search.close":"Close","map.search.clear":"Clear","map.search.noResults":"No results","map.search.contentGroup":"Content matches","chat.action.startLearning":"Start learning “{title}”","chat.action.startLearningPrompt":`I want to start learning “{title}”, but I'm low on energy right now — don't lecture me with concepts and don't quiz me with scored questions. Open like this instead:
445
+ 1. First hook me with a sentence or two of prose (counter-intuitive, or tied to daily life — make me curious);
446
+ 2. Then call the pose_guess tool with a small two-option guess (just for fun, not a test);
447
+ 3. I'll pick an option and guess; in your NEXT turn, reveal the answer and teach the one core idea of this lesson.
448
+ Iron rules: no lecture to start, no generate_quiz scored questions, no scoring. Hooking me is the only goal.`,"starter.go-deeper.label":"Go deeper","starter.go-deeper.hint":"Unpack the concept one level down","starter.go-deeper.message":"Go deeper on “{title}” — expand the structure, the details, and the easy-to-miss edge cases of the core point we just uncovered.","starter.give-example.label":"Give an example","starter.give-example.hint":"Make it concrete with a real example","starter.give-example.message":"Give me a concrete example or use case for “{title}” so I can understand it more tangibly.","starter.quiz-me.label":"Quiz me","starter.quiz-me.hint":"Retrieve and apply (correct answers raise mastery)","starter.quiz-me.message":"Quiz me with one applied question about “{title}” to check whether I really get it — judge my answer when I respond.","starter.confused.label":"I'm lost","starter.confused.hint":"Tell the AI where you're stuck (it takes notes)","starter.confused.message":"I'm fuzzy on part of “{title}” — help me untangle it, and start by asking which part isn't clear.","map.world.study":"Learn","map.world.practice":"Practice","pane.switcher":"Switch view","pane.map":"Course","pane.chat":"Tutor","pane.notes":"Blackboard","map.streaming.notice":"AI is responding. Switch nodes after it finishes.","map.generating":"Generating course path…","map.empty.cta.title":"Start your first course","map.empty.cta.desc":"Import a GitHub learning repo to auto-generate a skill path","map.empty.cta.btn":"Click to import →","map.empty.practice":"No practice content for this course","node.locked.chapterHint":"(unlocks after completing all lessons in this chapter)","node.due.hint":"(due for review)","import.empty":"No courses yet. Import your first one below.","import.cta":"Import New Course","import.tab.url":"URL","import.tab.md":"MD","import.tab.folder":"Folder","import.url.placeholder":"GitHub repo / web article / arXiv paper link","import.url.desc":"Paste any link — GitHub repo / arXiv paper / web article / Bilibili·YouTube video (transcribed into a course; multi-part Bilibili videos import the whole season without ?p=; more sites need yt-dlp installed).","import.btn.url":"Import","import.btn.url.busy":"Importing…","import.placeholder.name":"Course name (optional)","import.placeholder.md":"Paste any long text or Markdown… (auto-split when there are no headings)","import.btn.md":"Import as Course","import.btn.md.busy":"Generating…","import.folder.desc":"Recursively scans .txt/.md/.html/.pdf. For downloaded course material packs.","import.btn.folder":"Select Folder","import.tab.epub":"eBook","import.epub.desc":"EPUB books become one lesson per chapter (chapter order from the book's spine & TOC).","import.btn.epub":"Pick an EPUB file","import.tab.audio":"Audio","import.audio.desc":"Audio (wav/mp3/m4a/flac) or local video (mp4/m4v/mov) transcribed locally into a course; multi-select = multiple episodes. Whisper model (~1 GB) downloads automatically on first use.","import.btn.audio":"Pick audio files","import.tab.pack":"Pack","import.btn.pack":"Pick a course pack file","import.pack.desc":"A course pack is a shared import-plan snapshot — zero AI calls, classification and structure design are instant. Reused as-is when the GitHub repo matches; if the repo moved on, lessons pointing at removed files are dropped automatically.","import.export":"Export","import.folder.pathPlaceholder":"Server-side folder path (e.g. /storage/emulated/0/Download/my-course)","import.folder.pathRequired":"Enter the server-side folder path first","import.pack.export":"Export course pack (share for zero-AI import)","import.pack.exported":"Course pack exported: {path}","import.error.resume":"Retry from checkpoint (skips finished AI steps)","import.success.reused":"reused saved plan, zero AI calls","import.btn.folder.busy":"Processing…","import.delete":"Delete","import.delete.confirm":"All progress and exercises will be erased. This cannot be undone.","import.delete.current":"Delete current course","course.empty.title":"Pick a course to start learning","course.empty.desc":"Choose an imported course from the Import panel on the left, or import a new one.","import.success.md":"Generated","import.success.folder":"Imported","import.error.network":`
449
+
450
+ For restricted networks or private repos, use the Markdown method.`,"import.progress.elapsed":"{s}s elapsed","import.progress.title":"Importing course…","import.progress.starting":"Starting…","import.progress.note":"Import runs in the background — keep browsing other courses","import.progress.cancel":"Cancel import","import.cancelled":"Import cancelled","toast.threadCreateFailed":"Couldn't create — try again","toast.threadCreated":"New chat","toast.threadRenamed":"Renamed","toast.threadArchived":"Archived","toast.threadDeleted":"Deleted","toast.threadDefault":"New thread","toast.restored":"Restored","toast.noteSaved":"Added to notes","toast.noteDeleted":"Note deleted","toast.artifactSaved":"Saved to notebook","artifact.type.concept_map":"Concept Map","artifact.type.quiz":"Quiz","artifact.type.compare_table":"Comparison Table","artifact.type.diagram":"Diagram","artifact.type.code_walkthrough":"Code Walkthrough","artifact.type.unknown":"Artifact","command.placeholder":"Type a command or question… (↑↓ to select, Enter to confirm)","command.empty.node":"No matching commands","command.empty.nonode":"Select a node on the left first","command.footer.hint":"The AI tutor generates content based on your command","command.footer.keys":"↵ confirm · esc to close","command.group.node":"Current Node","command.group.mode":"Study Mode","command.group.nav":"Navigation","command.explain_simple":"Explain this section in plain words","command.quiz_3":"Give me 3 practice questions","command.concept_map":"Draw a concept map","command.compare_prev":"Compare with the previous section","command.socratic":"Switch to Socratic mode (guided questions)","command.exam_mode":"Switch to Exam prep mode","review.title":"Review","review.nudge":"📅 {n} review(s) due today — tap the Review entry in the map to consolidate","review.loading":"Checking what to review…","review.empty.title":"No reviews yet","review.empty.desc":"Complete some exercises and spaced-repetition reminders will appear here","review.due.count":"due","review.start":"Start Review","review.shuffle":"Shuffle (interleaved)","review.interleave":"Interleaved Review","review.reviewLesson":"Review","review.selectSection":"Select a section","review.dueIn":"due","review.noDueInSection":"No reviews in this section","review.srsHint":"Review Reminders","review.myProgress":"My Progress","review.overdueQuickHint":"Overdue items — click to review","review.quadrant.overdue":"Overdue","review.quadrant.short":"Short-term","review.quadrant.long":"Long-term","review.quadrant.inactive":"Inactive","review.quadrant.more":"more","review.tip":"Review uses the SM-2 spaced repetition algorithm. Overdue items first; long-term memory items have longer intervals. Capped at {n} items per session to avoid backlog overwhelm.","review.selfrated":"✓ Recorded. Mastery updated.","review.selfrate.title":"Done reviewing? Rate yourself","review.selfrate.again":"Forgot","review.selfrate.again.hint":"Review tomorrow","review.selfrate.remembered":"Recalled","review.selfrate.remembered.hint":"In a few days","review.selfrate.mastered":"Easy","review.selfrate.mastered.hint":"Much later","lang.original":"Original","error.checkReadyFailed":"Could not check readiness","notebook.tab.explain":"Explain","notebook.tab.notes":"Notes","notebook.tab.board":"Blackboard","notebook.board.empty":"When the tutor produces a concept map, diagram, comparison table, or code walkthrough in chat, the latest one is rendered here in full size.","notebook.zone.understand":"Understand","notebook.zone.note":"Notes","notebook.zone.practice":"Practice","notebook.empty.explain.title":"Pick a lesson to start","notebook.empty.explain.desc":"Select a lesson in the map on the left; its explanation shows here.","notebook.empty.notes.title":"No notes yet","notebook.empty.notes.desc":"Highlight text in the explanation, or have the AI generate a concept map / comparison table — it shows up here.","settings.group.ai":"Main Model","settings.group.speech":"Speech Models","settings.group.vision":"Vision Model","settings.group.appearance":"Appearance & Language","settings.row.provider":"Provider","settings.row.theme":"Theme","settings.row.interface_lang":"Interface language","settings.row.import_lang":"Import preference","settings.custom.form_title":"Add custom provider","settings.footer.hint":"Main model changes need Save; everything else is instant.","settings.footer.save":"Save AI config","header.energy":"Today's energy","header.level.title":"Level (cumulative XP growth line — doesn't reset with daily energy)","settings.title":"Settings","view.tree":"Skill Tree","view.dashboard":"Dashboard","view.import":"Import Course","mode.chat":"💬 Chat","mode.exercise":"📝 Practice","mode.settings":"⚙️ Settings","chat.starter.hint":"💡 Pick one to start, or type your question","chat.no_key.title":"No AI model configured","chat.no_key.desc":"Configure a model to start AI tutoring and practice","chat.no_key.btn":"Configure Model","chat.input.placeholder":"Ask your AI tutor… (Enter to send)","chat.input.no_node":"Select a lesson on the left…","chat.send":"Send","chat.stop":"Stop","chat.clear":"Clear chat history","chat.selection.quote":"Ask about this","chat.soul.label":"Style:","chat.no_key.short":"AI model not configured","chat.no_key.cta":"Configure →","chat.attach.add":"Add image or file (paste / drag also works)","chat.attach.remove":"Remove {name}","chat.attach.tooMany":"Up to {n} attachments per message","chat.attach.tooLargeImage":"Image over 5MB: {name}","chat.attach.tooLargeText":"Text file over 256KB: {name}","chat.attach.unsupported":"Unsupported type: {name} (images and common text / code files)","chat.attach.visionUnsupported":"Current model can't see images — pick one with the eye icon in the model switcher, or set a vision model override in Settings → AI vision","chat.attach.bridgeChip":"Main model is text-only: images will be transcribed to text by {model} first","chat.attach.preview":"View {name}","chat.attach.textChip":"Text attachment, content sent with the message","chat.attach.imageOnlyText":"Please look at this image.","context.label":"Context","context.aria":"{p} of context used","context.approx":"~","context.system":"System prompt","context.node":"Lesson","context.learner":"Learner state","context.history":"History","context.draft":"Draft","context.unknownWindow":"model window unknown","model.picker.label":"Model","model.picker.manage":"Manage models & keys…","model.picker.vision":"Vision capable","model.picker.noneConfigured":"No provider key configured yet","effort.label":"Thinking effort","effort.auto.label":"Auto","effort.auto.desc":"Model default, no override","effort.fast.label":"Fast","effort.fast.desc":"Thinking off when possible — quicker, fewer tokens","effort.deep.label":"Deep","effort.deep.desc":"Thinking on when possible — extra steps for hard problems","effort.unsupported":"Current provider doesn't support effort switching","soul.direct":"Direct","soul.guide":"Guide","soul.practice":"Practice","soul.direct.desc":"Direct · for beginners or low energy. Explains clearly then checks, gives full worked examples — never makes you guess","soul.guide.desc":"Guide · when you have some footing and want to reason it out. No direct answers — guiding questions help you derive it","soul.practice.desc":"Practice · for hands-on learners. Each concept lands on a messy real-world problem; learn by doing and connect the dots","settings.provider":"AI Provider","settings.model":"Model","settings.apikey":"API Key","settings.test":"Test Connection","settings.testing":"Testing…","settings.save":"Save Settings","settings.saved":"✅ Saved","settings.daily_goal":"Daily Goal (XP)","settings.custom.add":"+ Add Custom Provider","settings.language":"Language","settings.add_custom":"Custom","settings.custom.label_ph":"Name","settings.custom.baseurl_ph":"Base URL (e.g. https://api.example.com/v1)","settings.custom.model_ph":"Model ID","settings.custom.new":"New custom","settings.custom.form_title_vision":"Configure vision model (custom provider)","settings.custom.model_ph_vision":"e.g. glm-4.6v / gpt-4o","settings.custom.form_title_tts":"Configure TTS provider (OpenAI-compatible /audio/speech)","settings.custom.model_ph_tts":"e.g. tts-1 / FunAudioLLM/CosyVoice2-0.5B","settings.custom.form_title_asr":"Configure dictation provider (OpenAI-compatible /audio/transcriptions)","settings.custom.model_ph_asr":"e.g. whisper-large-v3-turbo","settings.custom.apikey_ph":"API Key (optional)","settings.custom.save":"Save","settings.custom.windowLabel":"Context window (tokens)","settings.custom.windowPh":"e.g. 128000 or 128k (empty = unknown)","settings.custom.windowHint":"Max context of the current model, found in its official docs. The composer context meter only shows a percentage when this is set.","settings.custom.vision":"Supports vision (multimodal)","settings.custom.visionHint":"When checked, images are sent directly to the main model. Unchecked uses the vision bridge (configure a vision model in AI Vision section) or skips images.","settings.delete_custom":"Delete this custom provider","settings.delete_custom_confirm":'Delete custom provider "{name}"? This cannot be undone.',"settings.key.overwrite_ph":"Overwrite…","settings.key.paste_ph":"Paste key","settings.key.get":"Get key →","settings.refresh":"Refresh","settings.discovering":"Refreshing…","settings.discover_failed":"Refresh failed (network may be restricted)","settings.daily_goal.hint":"XP / day (+10 XP per correct answer)","settings.theme.auto":"System","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.following":"Following system: {mode}","settings.lang_pref.desc":"When importing a course, auto-pick the translation matching this preference. If the repo's source language already matches, the original is used; if no translation exists, the original is used as well.","settings.img_download":"Image download","settings.img_download.desc":"Auto-download images referenced in markdown/notebooks during import (on by default)","settings.multimodal.toggle":"AI vision (in chat)","settings.multimodal.toggle.desc":"When on, the AI can see and explain this lesson's images during chat — used for diagrams/charts/architecture (needs a vision model).","settings.group.memory":"Learner memory","settings.memory.toggle":"Let the AI remember me","settings.memory.toggle.desc":"When on, the AI remembers how you learn across sessions (preferences / stuck points / recurring confusions) and adapts over time. Auto-summarized when you earn a crown (clear a node); also manually triggerable. All memory stays local.","settings.group.companion":"Learning companion","settings.companion.toggle":"Learning companion","settings.companion.toggle.desc":"Your companion lives in the course map, notebook and chat: celebrates wins, lip-syncs read-alouds, and taps along with every keystroke. Five forms to switch between. Fully local.","settings.companion.sfx":"Pet sounds","settings.companion.sfx.desc":"Short chirps when poked/hit/landing (synthesized, low volume)","settings.companion.pet":"Desktop pet mode","settings.companion.pet.desc":"Keep the companion on your desktop outside the app: transparent, always on top, wandering slowly — still poke-able. The in-app buddy takes a rest so you never see double.","settings.companion.form":"Form","companion.name":"Ember","companion.form.ember.name":"Ember","companion.form.ember.desc":"Blazing guardian — the passionate original; core charges with today's XP","companion.form.frost.name":"Frost","companion.form.frost.desc":"Crystal watcher — calm and steady; the hex core lights petal by petal","companion.form.moss.name":"Moss","companion.form.moss.desc":"Nature spirit — gentle company; the seed sprouts as you progress","companion.form.astro.name":"Astro","companion.form.astro.desc":"Stargazer — night-sky visor; the core moon waxes with today's XP","companion.form.ink.name":"Ink","companion.form.ink.desc":"Inkstone scholar — quiet study vibes; the ink pool rises with your progress","companion.greet.1":"I'm here — keep going!","companion.greet.2":"Almost got this one!","companion.greet.3":"Want me to explain again?","companion.greet.4":"Breathe. One more try.","settings.multimodal.current_model":"Current main model: {model}","settings.multimodal.not_selected":"(none)","settings.multimodal.hint_custom":"Custom provider — vision capability unknown. If it can't see images, override a vision model below.","settings.multimodal.hint_preset":"If the current model lacks vision, configure a dedicated vision model below. Common: GLM-4V / GPT-4o / Claude 3.5 / Gemini.","settings.multimodal.override_title":"Vision model override (optional — leave blank to reuse main model)","settings.multimodal.override_bridge_hint":"When the main model is text-only, images uploaded in chat are transcribed to text by this model before reaching the main model (image bridge).","settings.multimodal.legacy_preset":"Legacy config (preset {label}) still active; stop the override or switch to custom.","settings.multimodal.replace_custom":"Replace","settings.multimodal.stop_override":"Stop override","settings.multimodal.vision_capable":"vision","settings.multimodal.test_override":"Test model","settings.mathvision.toggle":"PDF math vision transcription (experimental)","settings.mathvision.desc":"When importing PDFs, math-dense pages are rendered to images and transcribed to LaTeX by the vision model configured above. Requires a vision model and spends quota per page; falls back to the plain text layer when off or on failure.","settings.saved_text":"Saved","settings.key.configured":"Configured","settings.custom.test_label":"(test)","settings.proto.openai":"OpenAI-compatible","chat.empty.overview":"Overview of this lesson","chat.empty.summary.title":"Lesson Summary","chat.empty.summary.none":"No summary yet — click Start to let the AI walk you through this lesson.","chat.empty.start":"Start Learning","chat.empty.greeting":"👋 Ready? Let's take this one step at a time.","chat.empty.keyless.title":"The lesson is on the right — give it a read","chat.empty.keyless.desc":"Configure an AI model to practice with me, do exercises, and track mastery.","chat.empty.keyless.btn":"Configure AI model","chat.empty.no_node.title":"Pick a node from the map on the left","chat.empty.no_node.desc":"Click a node to start learning. Green = available, Gold = mastered, Purple = chapter exam","chat.scroll.bottom":"Scroll to bottom","chat.speech.speak":"Read aloud","chat.speech.stop":"Stop reading","chat.speech.progress":"{n}/{total}","chat.speech.model_missing":"Speech model not downloaded yet. Get it in Settings → Speech.","chat.speech.engine_unavailable":"Speech engine not installed. Desktop has it built in; on Termux rerun the one-line install command to restore it (~12MB).","chat.speech.dictation":"Voice input","chat.speech.hold_to_talk":"Hold to talk","chat.speech.release_to_stop":"Release to finish","chat.speech.recording_hint":"Recording — release to finish","chat.speech.rerecord":"Discard & retry","chat.speech.retry":"Retry","chat.speech.back_to_keyboard":"Back to keyboard input","chat.speech.keyboard":"Keyboard","chat.speech.custom_provider_missing":"Custom speech provider missing or deleted. Reconfigure it in Settings → Speech Models.","chat.speech.no_speech":"No speech detected. Check your microphone and retry.","chat.speech.transcribing":"Transcribing…","chat.speech.asr_failed":"Transcription failed. Please retry.","chat.speech.groq_key_missing":"Groq key not configured. Set it in Settings → Model providers, or switch to the local engine.","chat.speech.azure_stt_key_missing":"Legacy Azure dictation key missing. Switch to a custom endpoint in Settings → Speech Models.","chat.speech.azure_stt_region_missing":"Legacy Azure dictation region missing. Switch to a custom endpoint in Settings → Speech Models.","chat.speech.asr_model_missing":"Dictation model not downloaded. Get Whisper in Settings → Speech Models (local offline), or use a custom endpoint.","chat.speech.asr_start_fail":"Microphone failed to start. Check system permissions.","chat.speech.asr_insecure_context":"Browsers only allow the microphone on secure contexts (https or 127.0.0.1). Open this page via the phone launcher, or enable serve TLS (--tls-cert/--tls-key) and access over https.","chat.speech.read_aloud_node":"Read this lesson","chat.speech.azure_key_missing":"Azure TTS key missing. Fill it in Settings → Speech.","chat.speech.azure_region_missing":"Azure TTS region missing. Fill it in Settings → Speech.","chat.speech.edge_failed":"Online synthesis failed and no local fallback model is ready. Retry later or switch to the local engine.","chat.speech.edge_disclosed":"Read-aloud sends text to Microsoft's online service (free Edge channel). For fully offline: Settings → Speech → Local.","settings.speech.tts_engine":"TTS engine","settings.speech.engine.edge":"Edge online","settings.speech.engine.azure":"Azure","settings.speech.engine.local":"Local offline","settings.speech.engine.custom":"Custom","settings.speech.engine.system":"System","settings.speech.engine.system_note":"Voices come from this device's browser/system speech engine; quality varies by device (vendor engines on Chinese Android phones are often more natural). Plays locally with no network; sentence highlighting still works while reading, companion mouth animation is unavailable.","settings.speech.engine.system_unavailable":"System speech is unavailable in this WebView","settings.speech.voice_auto":"Auto (prefer Chinese)","settings.speech.model.turbo_short":"Whisper Turbo (~1GB)","settings.speech.model.small_short":"Whisper Small (~360MB)","settings.speech.tts_title":"Read aloud","settings.speech.asr_title":"Dictation","settings.speech.custom_voice_ph":"e.g. alloy (empty = endpoint default)","settings.speech.legacy":"legacy, still active","settings.speech.key_saved":"key saved","settings.speech.confirm_del_custom":"Delete this provider? The tier becomes unusable.","settings.speech.downloading":"Downloading…","settings.speech.asr_engine.custom_note":"OpenAI-compatible transcription endpoint; for Groq use https://api.groq.com/openai/v1 + whisper-large-v3-turbo.","settings.speech.engine.edge_note":"Microsoft Edge read-aloud channel: free, no key, product-grade voices; text is synthesized online.","settings.speech.voice":"Voice","settings.speech.speed":"Speed","settings.speech.asr_engine":"Dictation engine","settings.speech.asr_engine.local":"Local offline","settings.speech.asr_engine.local_note":"Whisper offline transcription (native punctuation, strong Chinese); fully offline once the model is downloaded — Turbo ~1GB / Small ~360MB.","settings.speech.asr_auto_stop":"Auto-stop recording after silence","settings.speech.asr_ux_note":"Click the mic beside the input box to enter voice mode: hold to talk, then edit the recognized text before sending.","settings.speech.model.asr_turbo":"Dictation engine Whisper Turbo (~1GB, recommended on desktop)","settings.speech.model.asr_small":"Dictation engine Whisper Small (~360MB, lightweight)","settings.speech.license_mit":"MIT · local inference","settings.speech.model.tts":"Read-aloud engine (Kokoro, ~430MB)","settings.speech.state.absent":"Not downloaded","settings.speech.state.ready":"Ready","settings.speech.state.error":"Error","settings.speech.download":"Download","settings.speech.delete":"Delete","settings.speech.license":"Apache-2.0 · local inference","chat.friction.trigger":"I'm stuck","chat.friction.hint":"Pick what fits (optional one-liner). The AI will remember and adapt how it teaches this.","chat.friction.confused":"Confused","chat.friction.blocked":"Blocked","chat.friction.frustrated":"Frustrated","chat.friction.desc_placeholder":"Where exactly? (optional)","chat.friction.cancel":"Cancel","chat.friction.submit":"Log it","chat.friction.saved":"Logged — the AI will adapt how it teaches this lesson","chat.mastered.toast":"👑 You mastered this lesson!","chat.note.add":"Add note","chat.note.add.title":"Save this message to your notes","chat.reasoning.label":"Reasoning","chat.reasoning.chars":"{n} chars","chat.proposal.title":"AI Proposal","chat.proposal.fallback":"Proposal ({tool})","chat.proposal.apply":"Apply","chat.proposal.reject":"Reject","chat.proposal.mastered.title":"AI suggests you've mastered this lesson","chat.proposal.mastered.hint":"Accept to unlock the crown and schedule reviews.","chat.proposal.confirm":"Confirm mastery","chat.proposal.later":"Keep practicing","chat.proposal.applied":"Accepted · lesson mastered","chat.proposal.rejected":"Dismissed, keep learning","chat.copy":"Copy","chat.copied":"Copied","chat.tool.get_node_info":"Read node info","chat.tool.record_answer":"Record answer","chat.tool.mark_mastered":"Mark mastered","chat.tool.show_concept_map":"Generate concept map","chat.tool.generate_quiz":"Generate quiz","chat.tool.compare_table":"Generate comparison table","chat.tool.draw_diagram":"Draw diagram","chat.tool.show_code_walkthrough":"Code walkthrough","thread.empty.no_node":"No node selected","thread.empty.hint":"Type to start","thread.actions.label":"Actions","thread.new.label":"New thread","thread.menu.rename":"Rename","thread.menu.archive":"Archive","thread.delete.confirm":'Delete thread "{name}"? Messages will also be deleted.',"notebook.empty.select_node":"Pick a node from the map on the left — its explanation shows here.","notebook.empty.no_notes_message":'No notes for this lesson yet. Select explanation text to "Add note", or ask the AI to "draw a concept map", "generate 3 questions", or "make a comparison table".',"notebook.node_type.section":"Chapter","notebook.node_type.concept":"Concept","notebook.node_type.lesson":"Lesson","notebook.content.loading":"Loading this lesson…","notebook.content.load_failed":"Failed to load content. ","notebook.content.retry":"Retry","notebook.content.render_failed":"This content failed to render (possibly malformed translation).","notebook.content.truncated":"…(truncated)","notebook.content.retry_render":"Retry render","notebook.content.empty":'No explanation for this lesson yet. Ask the AI tutor: "Walk me through this lesson."',"notebook.mindmap.toggle":"Mind map view","notebook.images.heading":"Images ({n})","notebook.quote.template":"About this passage 「{text}」, I don't quite get it. Please explain:","notebook.quote.ask":"Ask","notebook.quote.add_note":"Add note","notebook.quote.save_note.title":"Save the selected text to your notes (with source jump)","notebook.quote.hint":"Select any text in the explanation to add a note; AI-generated concept maps, comparison tables, and quiz cards land in the Notes tab automatically.","notebook.source.label":"Source","notebook.source.jump_content":"Jump to explanation","notebook.source.jump_chat":"Jump to chat message","notebook.zone.understand.subtitle":"Knowledge structure the AI lays out for you","notebook.zone.understand.empty_hint":'Ask the AI to "draw a concept map" or "make a comparison table" to structure this lesson',"notebook.zone.note.subtitle":"Your highlights — click to jump back to source","notebook.zone.note.empty_hint":'Select text in the explanation or chat, then "Add note" to save here',"notebook.zone.practice.subtitle_empty":"Test your grasp; redoable","notebook.zone.practice.subtitle_stats":"{n} questions · last correct {c} · wrong {w}","notebook.zone.practice.empty_hint":'Ask the AI "give me 3 questions" — they land here',"notebook.note.comment.ph_new":"Write a note about this highlight…","notebook.note.comment.ph_edit":"Edit note… (clear + save to delete)","notebook.action.save":"Save","notebook.action.cancel":"Cancel","notebook.note.edit_comment":"Edit note","notebook.note.add_comment":"Add note","notebook.note.pinned":"Pinned","notebook.note.pin":"Pin","notebook.note.unpin":"Unpin","notebook.note.delete":"Delete","notebook.quiz.last_correct":"Last correct","notebook.quiz.last_wrong":"Last wrong","notebook.artifact.broken":"Broken artifact data","notebook.asset.loading":"Loading…","exam.loading":"Generating exam questions…","exam.errorTitle":"Exam failed to load","exam.errorEmpty":"Failed to generate questions. Please try again later.","exam.reload":"Reload","exam.question.label":"Question {n}","exam.next":"Next","exam.submit":"Submit Exam","exam.accuracy":"Accuracy {n}%","exam.stars.congrats":"Congratulations! {n} stars earned!","exam.stars.thisAndBest":"This run: {n} stars · Best: {m} stars","exam.stars.failed":"Below 60%. Keep practicing!","exam.review.title":"Question Review","exam.review.questionFallback":"(Question {n})","exam.review.yourAnswer":"Your answer:","exam.review.correctAnswer":"Correct:","exam.review.unanswered":"(no answer)","exam.retry":"Retake exam (questions cached)","exam.generating.title":"Generating chapter exam…","exam.generating.stage":"AI is writing questions knowledge point by knowledge point","exam.generating.kcProgress":"{done} / {total} knowledge points covered","exam.generating.preparing":"Preparing…","exam.generating.canLeave":"You can leave this page — generation continues in the background and you'll be notified.","exam.failed.retry":"Regenerate","exam.ready.title":"Exam ready","exam.ready.meta":"{q} questions · {kc} knowledge points · ~{min} min","exam.ready.toast":'Exam questions for "{title}" are ready',"exam.start":"Start exam","exam.retryExam":"Retake exam","exam.regenerate":"New questions","exam.regenerate.confirmMsg":"Regenerating discards the current questions and has the AI write a fresh set for this chapter (past scores are kept).","exam.submitting":"Grading…","exam.q.progress":"Question {i} / {n}","exam.q.next":"Next","exam.q.submit":"Submit exam","exam.terminated.banner":"This attempt was terminated by leaving mid-exam. Unanswered questions were counted as wrong.","exam.result.score":"{correct} / {total} correct","exam.result.accuracy":"Accuracy {pct}%","exam.result.best":"Best: {stars} stars","exam.result.attempts":"{n} attempts","exam.result.kcBreakdown":"By knowledge point","exam.result.weakKc":"Weak · review suggested","exam.result.correctLabel":"Correct","exam.result.unanswered":"No answer","exam.result.yourAnswer":"Your answer:","exam.result.correctAnswer":"Correct answer:","exam.result.review":"Question review","exam.leave.title":"Leaving will end the exam","exam.leave.message":"Unanswered questions will be counted as wrong and this attempt will be recorded. Leave anyway?","exam.leave.confirm":"End and leave","exam.leave.cancel":"Keep going","error.renderFailed":"This content failed to render (possibly malformed).","error.retry":"Retry","artifact.unknownHeader":"Artifact (unknown type)","artifact.zoomOut":"Zoom out","artifact.zoomReset":"Reset zoom","artifact.zoomIn":"Zoom in","artifact.canvas.fit":"Fit","artifact.viewer.open":"Open large view","artifact.viewer.hint":"Pinch to zoom · drag to pan · Ctrl+scroll","artifact.conceptmap.stats":"{nodes} concepts · {edges} relations · Ctrl+scroll to zoom · drag to pan","artifact.codewalk.sectionLabel":"Step-by-step notes (click to jump to code)","artifact.codewalk.lineSingle":"Line {n}","artifact.codewalk.lineRange":"Lines {a}-{b}","artifact.diagram.flowchart":"Flowchart","artifact.diagram.sequence":"Sequence","artifact.diagram.state":"State","artifact.mermaid.openLive":"Open in mermaid.live (editable)","artifact.mermaid.rendering":"Rendering diagram…","artifact.mermaid.renderFailed":"Render failed. Showing source (copy to mermaid.live to view).","artifact.mermaid.repairing":"The diagram has a syntax error, auto-repairing…","artifact.mermaid.errorPrefix":"Error: {msg}","artifact.mermaid.hint":"Ctrl+scroll to zoom · drag to pan","quiz.questionProgress":"Q {cur}/{total}","quiz.answeredCorrect":"{n} correct","quiz.correct":"Correct","quiz.wrong":"Wrong","quiz.finish":"Finish","quiz.scoreSummary":"{correct}/{total} correct","quiz.hook.label":"📊 Quiz done: {{correct}}/{{total}}","quiz.hook.finish":"Finish quiz","quiz.hook.sent":"Results sent to your tutor, awaiting analysis…","quiz.hook.message":`I just finished the quiz{{title}}, scoring {{correct}}/{{total}}. Per-question breakdown below:
451
+ Based on my performance, decide what comes next: explain why I got questions wrong and the right reasoning, or judge whether I can move on. Do not re-issue the same set of questions, and do not just say well done.`,"quiz.hook.lineOk":"✅ Q{{n}}: {{prompt}} — correct","quiz.hook.lineWrong":"❌ Q{{n}}: {{prompt}} — I chose {{chosen}}, correct answer is {{answer}}","quiz.allCorrectHint":"All correct! Mastery update proposed.","quiz.tryAgainHint":"Practice another set to consolidate.","quiz.action.nextPrompt":"What's next:","quiz.action.explainWrong":"Explain what I got wrong","quiz.action.retry":"Another set","quiz.action.goDeeper":"Go deeper","quiz.action.markMastered":"Confirm I've mastered it","quiz.action.nextTopic":"Next topic","guess.header":"Take a guess","guess.pickedPrefix":"I guess: ","guess.waitReveal":"Guessed — waiting for the reveal…","import.deleted":"Deleted: {title}","exercise.title":"📝 Practice","exercise.generate":"Generate a question","exercise.submit":"Submit Answer","exercise.next":"Next →","exercise.correct":"✅ Correct!","exercise.wrong":"❌ Wrong","exercise.types.mcq":"Multiple Choice","exercise.types.fill_blank":"Fill in the Blank","exercise.types.true_false":"True or False","dashboard.title":"Learning Dashboard","dashboard.stat.streak":"Streak","dashboard.stat.due":"Due Today","dashboard.stat.mastery":"Overall Mastery","dashboard.review":"Review","dashboard.cleared":"Cleared","dashboard.export.md":"📄 Export Report","dashboard.export.json":"Export JSON","dashboard.section_mastery":"Mastery by Section","dashboard.mini.sections":"Mastery by section","dashboard.mini.struggle":"Your struggle spots (tap to relearn)","import.title":"Import Course","import.url":"GitHub URL","import.markdown":"Paste Markdown","import.btn":"Import","import.md_btn":"Generate Course","streak.days":"days","streak.title":"{n}-day streak · longest {m} days","streak.freeze.title":"{n} freeze left: saves your streak on a missed day"}};function Yi(){return _o}function f5(e){e!==_o&&(_o=e,typeof localStorage<"u"&&localStorage.setItem(sg,e),wc.forEach(t=>t()))}function X0(e,t=_o,n){var i,a;let r=((i=Dh[t])==null?void 0:i[e])??((a=Dh["zh-CN"])==null?void 0:a[e])??e;if(n)for(const[s,o]of Object.entries(n))r=r.replaceAll(`{${s}}`,String(o));return r}function $e(){const e=w.useSyncExternalStore(og,Yi,Yi);return w.useCallback((t,n)=>X0(t,e,n),[e])}function lg(){return w.useSyncExternalStore(og,Yi,Yi)}const m5=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].map(e=>`${e}:not([hidden])`).join(",");function Ph(e){return Array.from(e.querySelectorAll(m5)).filter(t=>t.offsetParent!==null||t===document.activeElement)}function ra(e,t){w.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const r=document.activeElement,a=Ph(n)[0]??n,s=window.setTimeout(()=>a.focus(),0),o=l=>{if(l.key!=="Tab")return;const u=Ph(n);if(u.length===0){l.preventDefault(),n.focus();return}const c=u[0],h=u[u.length-1];l.shiftKey?(document.activeElement===c||!n.contains(document.activeElement))&&(l.preventDefault(),h.focus()):document.activeElement===h&&(l.preventDefault(),c.focus())};return n.addEventListener("keydown",o),()=>{if(window.clearTimeout(s),n.removeEventListener("keydown",o),r&&document.body.contains(r))try{r.focus()}catch{}}},[e,t])}const Ls=220;function rl({anchorRect:e,message:t,onConfirm:n,onCancel:r,confirmLabel:i,cancelLabel:a,danger:s=!1,testid:o="confirm-card"}){const l=$e(),u=w.useRef(null);ra(u,!0);const c=i??l("action.confirm"),h=a??l("action.cancel");w.useEffect(()=>{const b=E=>{u.current&&!u.current.contains(E.target)&&r()},v=E=>{E.key==="Escape"&&r(),E.key==="Enter"&&(E.preventDefault(),n())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",v)}},[r,n]);const m=window.innerWidth,d=window.innerHeight,p=e.right-Ls,g=Math.max(8,Math.min(p,m-Ls-8)),x=e.bottom+4+Ls>d?Math.max(8,e.top-4-Ls):e.bottom+4;return K0.createPortal(f.jsxs("div",{ref:u,className:`confirm-card fixed z-[60] w-[220px] bg-surface-0 rounded-xl shadow-elevated border p-3 ${s?"border-warning/50":"border-[var(--border)]"}`,style:{left:g,top:x},role:"alertdialog","aria-modal":"false","data-testid":o,onClick:b=>b.stopPropagation(),children:[f.jsx("p",{className:"text-body text-ink-muted leading-relaxed mb-3",children:t}),f.jsxs("div",{className:"flex gap-2 justify-end",children:[f.jsx("button",{onClick:r,"data-testid":`${o}-cancel`,className:"px-2.5 py-1 rounded-md text-label font-bold text-ink-muted hover:text-ink-strong hover:bg-surface-3 transition-colors",children:h}),f.jsx("button",{onClick:n,"data-testid":`${o}-confirm`,className:"btn-3d-brand px-2.5 py-1 text-label",style:s?{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"}:void 0,children:c})]})]}),document.body)}function p5(e,t,n){return[...e].sort((r,i)=>r.orderIdx-i.orderIdx).map(r=>{const i=t.filter(o=>o.parentId===r.id).sort((o,l)=>o.orderIdx-l.orderIdx),a=i.filter(o=>o.type==="lesson"),s=a.length>0&&a.every(o=>{var l;return(((l=n[o.id])==null?void 0:l.mastery)??0)>=ag});return{section:r,lessons:i,chapterLessonsMastered:s}})}function kc(e,t,n){var r;return e.type==="exam"?!n:(((r=t[e.id])==null?void 0:r.status)??"locked")==="locked"}function g5(e,t){const n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;const r=i=>{const a=i.toLowerCase();return n.every(s=>a.includes(s))};return e.map(i=>{if(r(i.section.title))return i;const a=i.lessons.filter(s=>r(s.title));return a.length>0?{...i,lessons:a}:null}).filter(i=>i!==null)}function x5(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return null;const r=e.toLowerCase().indexOf(n.toLowerCase());return r>=0?[r,r+n.length]:null}function b5(e){const t=$e(),[n,r]=w.useState(""),[i,a]=w.useState([]),s=w.useRef(null);w.useEffect(()=>{var g;(g=s.current)==null||g.focus()},[]);const o=w.useMemo(()=>p5(e.sections,e.tree,e.progressMap),[e.sections,e.tree,e.progressMap]),l=w.useMemo(()=>g5(o,n),[o,n]),u=w.useMemo(()=>new Set(e.tree.map(g=>g.id)),[e.tree]),c=w.useMemo(()=>new Set(l.flatMap(g=>g.lessons.map(x=>x.id))),[l]),h=w.useMemo(()=>new Map(e.tree.map(g=>[g.id,g])),[e.tree]),m=w.useMemo(()=>new Map(o.map(g=>[g.section.id,g.chapterLessonsMastered])),[o]);w.useEffect(()=>{const g=n.trim();if(g.length<2){a([]);return}const x=setTimeout(()=>{ie.searchContent(g).then(b=>{a(b.filter(v=>u.has(v.nodeId)&&!c.has(v.nodeId)).slice(0,8))}).catch(()=>a([]))},250);return()=>clearTimeout(x)},[n,u,c]);const d=w.useMemo(()=>{for(const g of l){const x=g.lessons.find(b=>!kc(b,e.progressMap,g.chapterLessonsMastered));if(x)return x}return null},[l,e.progressMap]),p=l.length>0||i.length>0;return f.jsxs("div",{"data-testid":"course-search-panel",className:"absolute inset-0 z-50 flex flex-col",style:{background:"rgb(var(--surface-rail-rgb) / 0.96)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},onKeyDown:g=>{g.key==="Escape"&&e.onClose()},children:[f.jsxs("div",{className:"flex items-center gap-1.5 m-2 p-1.5 rounded-lg bg-black/40 ring-1 ring-white/15 focus-within:ring-brand/60 transition-colors",children:[f.jsx(W0,{className:"w-4 h-4 text-white/50 shrink-0"}),f.jsx("input",{ref:s,value:n,onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&d&&e.onJump(d)},placeholder:t("map.search.placeholder"),"data-testid":"course-search-input",className:"flex-1 bg-transparent text-body text-white placeholder:text-white/35 outline-none min-w-0"}),n&&f.jsx("button",{onClick:()=>{var g;r(""),(g=s.current)==null||g.focus()},"aria-label":t("map.search.clear"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/50 hover:text-white hover:bg-white/10 transition-colors",children:f.jsx(Fn,{className:"w-3.5 h-3.5"})}),f.jsx("button",{onClick:e.onClose,"data-testid":"course-search-close","aria-label":t("map.search.close"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/50 hover:text-white hover:bg-white/10 transition-colors",children:f.jsx(Fn,{className:"w-3.5 h-3.5"})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-2",children:[!p&&f.jsx("div",{"data-testid":"course-search-empty",className:"text-center text-label text-white/60 mt-8 px-4",children:t("map.search.noResults")}),l.map((g,x)=>f.jsx(y5,{row:g,sectionIndex:x,query:n,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onPick:e.onJump},g.section.id)),i.length>0&&f.jsxs("div",{"data-testid":"course-search-content-group",className:"pt-1",children:[f.jsx("div",{className:"px-1.5 py-1 text-caption font-bold text-white/50 uppercase tracking-wider",children:t("map.search.contentGroup")}),i.map(g=>{const x=h.get(g.nodeId);if(!x)return null;const b=kc(x,e.progressMap,m.get(x.parentId??"")??!1);return f.jsxs("button",{disabled:b,"data-testid":`search-content-row-${x.id.slice(0,8)}`,onClick:()=>!b&&e.onJump(x),className:`w-full text-left px-2 py-1.5 rounded-lg transition-colors ${b?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${x.id===e.selectedNodeId?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(or,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),f.jsx("span",{className:"flex-1 text-label font-bold text-white truncate",children:f.jsx(Ec,{text:g.title,query:n})})]}),f.jsx("div",{className:"text-caption text-white/55 line-clamp-2 leading-snug pl-5.5",children:g.snippet})]},g.nodeId)})]})]})]})}function y5({row:e,sectionIndex:t,query:n,progressMap:r,selectedNodeId:i,onPick:a}){const s=$e(),o=(e.section.world??"study")==="practice";return f.jsxs("div",{"data-testid":`search-section-${e.section.id.slice(0,8)}`,children:[f.jsxs("div",{className:"flex items-center gap-2 px-1.5 py-1",children:[f.jsx("span",{className:"w-5 h-5 rounded-full bg-gold text-neutral-900 text-caption font-extrabold flex items-center justify-center shrink-0 ring-2 ring-gold/40",children:t+1}),f.jsx("span",{className:"text-label font-bold text-white truncate flex-1",children:f.jsx(Ec,{text:e.section.title,query:n})}),o&&f.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded-full bg-accent/20 text-accent text-caption font-bold",children:s("map.world.practice")})]}),e.lessons.map(l=>{var m;const u=kc(l,r,e.chapterLessonsMastered),c=((m=r[l.id])==null?void 0:m.status)??"locked",h=l.type==="exam";return f.jsxs("button",{disabled:u,"data-testid":`search-row-${l.id.slice(0,8)}`,onClick:()=>!u&&a(l),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors ${u?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${l.id===i?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[u?f.jsx(Hy,{className:"w-3.5 h-3.5 text-white/50 shrink-0"}):h?f.jsx($i,{className:"w-3.5 h-3.5 text-accent shrink-0"}):c==="mastered"?f.jsx(X1,{className:"w-3.5 h-3.5 text-gold shrink-0"}):f.jsx(or,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),f.jsx("span",{className:"flex-1 text-label text-white truncate",children:f.jsx(Ec,{text:l.title,query:n})})]},l.id)})]})}function Ec({text:e,query:t}){const n=x5(e,t);return n?f.jsxs(f.Fragment,{children:[e.slice(0,n[0]),f.jsx("span",{className:"text-brand font-extrabold",children:e.slice(n[0],n[1])}),e.slice(n[1])]}):f.jsx(f.Fragment,{children:e})}const v5=268,Q0=28,w5=20,ug=Q0*2+w5,k5=ug+8,E5=104,T5=18,ql=Q0+6,S5=26,A5=22;function Tc(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function C5(e,t=v5,n=""){const r=[],i=t/2,a=t/2-T5-Q0;for(let l=0;l<e;l++){const u=ql+l*E5,h=Tc(`${n}:${l}`)/4294967295*2-1,m=i+h*a,p=Tc(`${n}:${l}:y`)/4294967295*2-1,g=u+p*S5;r.push({x:m,y:g,index:l})}if(r.length>0){r[0].y<ql&&(r[0].y=ql);for(let l=1;l<r.length;l++){const u=r[l-1].y+k5;r[l].y<u&&(r[l].y=u)}}const s=[];for(let l=0;l<r.length-1;l++)s.push({from:r[l],to:r[l+1],index:l});const o=r.length===0?40:r[r.length-1].y+ug/2+10;return{nodes:r,segments:s,height:o}}function N5(e){const{from:t,to:n}=e,r=(t.y+n.y)/2+A5;return`M ${t.x} ${t.y} C ${t.x} ${r}, ${n.x} ${r}, ${n.x} ${n.y}`}var co={exports:{}};/*!
452
+ * matter-js 0.19.0 by @liabru
453
+ * http://brm.io/matter-js/
454
+ * License MIT
455
+ *
456
+ * The MIT License (MIT)
457
+ *
458
+ * Copyright (c) Liam Brummitt and contributors.
459
+ *
460
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
461
+ * of this software and associated documentation files (the "Software"), to deal
462
+ * in the Software without restriction, including without limitation the rights
463
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
464
+ * copies of the Software, and to permit persons to whom the Software is
465
+ * furnished to do so, subject to the following conditions:
466
+ *
467
+ * The above copyright notice and this permission notice shall be included in
468
+ * all copies or substantial portions of the Software.
469
+ *
470
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
471
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
472
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
473
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
474
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
475
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
476
+ * THE SOFTWARE.
477
+ */var M5=co.exports,Oh;function I5(){return Oh||(Oh=1,(function(e,t){(function(r,i){e.exports=i()})(M5,function(){return(function(n){var r={};function i(a){if(r[a])return r[a].exports;var s=r[a]={i:a,l:!1,exports:{}};return n[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=n,i.c=r,i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:o})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(s&1&&(a=i(a)),s&8||s&4&&typeof a=="object"&&a&&a.__esModule)return a;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:a}),s&2&&typeof a!="string")for(var l in a)i.d(o,l,(function(u){return a[u]}).bind(null,l));return o},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=20)})([(function(n,r){var i={};n.exports=i,(function(){i._baseDelta=1e3/60,i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i._warnedOnce={},i._decomp=null,i.extend=function(s,o){var l,u;typeof o=="boolean"?(l=2,u=o):(l=1,u=!0);for(var c=l;c<arguments.length;c++){var h=arguments[c];if(h)for(var m in h)u&&h[m]&&h[m].constructor===Object&&(!s[m]||s[m].constructor===Object)?(s[m]=s[m]||{},i.extend(s[m],u,h[m])):s[m]=h[m]}return s},i.clone=function(s,o){return i.extend({},o,s)},i.keys=function(s){if(Object.keys)return Object.keys(s);var o=[];for(var l in s)o.push(l);return o},i.values=function(s){var o=[];if(Object.keys){for(var l=Object.keys(s),u=0;u<l.length;u++)o.push(s[l[u]]);return o}for(var c in s)o.push(s[c]);return o},i.get=function(s,o,l,u){o=o.split(".").slice(l,u);for(var c=0;c<o.length;c+=1)s=s[o[c]];return s},i.set=function(s,o,l,u,c){var h=o.split(".").slice(u,c);return i.get(s,o,0,-1)[h[h.length-1]]=l,l},i.shuffle=function(s){for(var o=s.length-1;o>0;o--){var l=Math.floor(i.random()*(o+1)),u=s[o];s[o]=s[l],s[l]=u}return s},i.choose=function(s){return s[Math.floor(i.random()*s.length)]},i.isElement=function(s){return typeof HTMLElement<"u"?s instanceof HTMLElement:!!(s&&s.nodeType&&s.nodeName)},i.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"},i.isFunction=function(s){return typeof s=="function"},i.isPlainObject=function(s){return typeof s=="object"&&s.constructor===Object},i.isString=function(s){return toString.call(s)==="[object String]"},i.clamp=function(s,o,l){return s<o?o:s>l?l:s},i.sign=function(s){return s<0?-1:1},i.now=function(){if(typeof window<"u"&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-i._nowStartTime},i.random=function(s,o){return s=typeof s<"u"?s:0,o=typeof o<"u"?o:1,s+a()*(o-s)};var a=function(){return i._seed=(i._seed*9301+49297)%233280,i._seed/233280};i.colorToNumber=function(s){return s=s.replace("#",""),s.length==3&&(s=s.charAt(0)+s.charAt(0)+s.charAt(1)+s.charAt(1)+s.charAt(2)+s.charAt(2)),parseInt(s,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warnOnce=function(){var s=Array.prototype.slice.call(arguments).join(" ");i._warnedOnce[s]||(i.warn(s),i._warnedOnce[s]=!0)},i.deprecated=function(s,o,l){s[o]=i.chain(function(){i.warnOnce("🔅 deprecated 🔅",l)},s[o])},i.nextId=function(){return i._nextId++},i.indexOf=function(s,o){if(s.indexOf)return s.indexOf(o);for(var l=0;l<s.length;l++)if(s[l]===o)return l;return-1},i.map=function(s,o){if(s.map)return s.map(o);for(var l=[],u=0;u<s.length;u+=1)l.push(o(s[u]));return l},i.topologicalSort=function(s){var o=[],l=[],u=[];for(var c in s)!l[c]&&!u[c]&&i._topologicalSort(c,l,u,s,o);return o},i._topologicalSort=function(s,o,l,u,c){var h=u[s]||[];l[s]=!0;for(var m=0;m<h.length;m+=1){var d=h[m];l[d]||o[d]||i._topologicalSort(d,o,l,u,c)}l[s]=!1,o[s]=!0,c.push(s)},i.chain=function(){for(var s=[],o=0;o<arguments.length;o+=1){var l=arguments[o];l._chained?s.push.apply(s,l._chained):s.push(l)}var u=function(){for(var c,h=new Array(arguments.length),m=0,d=arguments.length;m<d;m++)h[m]=arguments[m];for(m=0;m<s.length;m+=1){var p=s[m].apply(c,h);typeof p<"u"&&(c=p)}return c};return u._chained=s,u},i.chainPathBefore=function(s,o,l){return i.set(s,o,i.chain(l,i.get(s,o)))},i.chainPathAfter=function(s,o,l){return i.set(s,o,i.chain(i.get(s,o),l))},i.setDecomp=function(s){i._decomp=s},i.getDecomp=function(){var s=i._decomp;try{!s&&typeof window<"u"&&(s=window.decomp),!s&&typeof yh<"u"&&(s=yh.decomp)}catch{s=null}return s}})()}),(function(n,r){var i={};n.exports=i,(function(){i.create=function(a){var s={min:{x:0,y:0},max:{x:0,y:0}};return a&&i.update(s,a),s},i.update=function(a,s,o){a.min.x=1/0,a.max.x=-1/0,a.min.y=1/0,a.max.y=-1/0;for(var l=0;l<s.length;l++){var u=s[l];u.x>a.max.x&&(a.max.x=u.x),u.x<a.min.x&&(a.min.x=u.x),u.y>a.max.y&&(a.max.y=u.y),u.y<a.min.y&&(a.min.y=u.y)}o&&(o.x>0?a.max.x+=o.x:a.min.x+=o.x,o.y>0?a.max.y+=o.y:a.min.y+=o.y)},i.contains=function(a,s){return s.x>=a.min.x&&s.x<=a.max.x&&s.y>=a.min.y&&s.y<=a.max.y},i.overlaps=function(a,s){return a.min.x<=s.max.x&&a.max.x>=s.min.x&&a.max.y>=s.min.y&&a.min.y<=s.max.y},i.translate=function(a,s){a.min.x+=s.x,a.max.x+=s.x,a.min.y+=s.y,a.max.y+=s.y},i.shift=function(a,s){var o=a.max.x-a.min.x,l=a.max.y-a.min.y;a.min.x=s.x,a.max.x=s.x+o,a.min.y=s.y,a.max.y=s.y+l}})()}),(function(n,r){var i={};n.exports=i,(function(){i.create=function(a,s){return{x:a||0,y:s||0}},i.clone=function(a){return{x:a.x,y:a.y}},i.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)},i.magnitudeSquared=function(a){return a.x*a.x+a.y*a.y},i.rotate=function(a,s,o){var l=Math.cos(s),u=Math.sin(s);o||(o={});var c=a.x*l-a.y*u;return o.y=a.x*u+a.y*l,o.x=c,o},i.rotateAbout=function(a,s,o,l){var u=Math.cos(s),c=Math.sin(s);l||(l={});var h=o.x+((a.x-o.x)*u-(a.y-o.y)*c);return l.y=o.y+((a.x-o.x)*c+(a.y-o.y)*u),l.x=h,l},i.normalise=function(a){var s=i.magnitude(a);return s===0?{x:0,y:0}:{x:a.x/s,y:a.y/s}},i.dot=function(a,s){return a.x*s.x+a.y*s.y},i.cross=function(a,s){return a.x*s.y-a.y*s.x},i.cross3=function(a,s,o){return(s.x-a.x)*(o.y-a.y)-(s.y-a.y)*(o.x-a.x)},i.add=function(a,s,o){return o||(o={}),o.x=a.x+s.x,o.y=a.y+s.y,o},i.sub=function(a,s,o){return o||(o={}),o.x=a.x-s.x,o.y=a.y-s.y,o},i.mult=function(a,s){return{x:a.x*s,y:a.y*s}},i.div=function(a,s){return{x:a.x/s,y:a.y/s}},i.perp=function(a,s){return s=s===!0?-1:1,{x:s*-a.y,y:s*a.x}},i.neg=function(a){return{x:-a.x,y:-a.y}},i.angle=function(a,s){return Math.atan2(s.y-a.y,s.x-a.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]})()}),(function(n,r,i){var a={};n.exports=a;var s=i(2),o=i(0);(function(){a.create=function(l,u){for(var c=[],h=0;h<l.length;h++){var m=l[h],d={x:m.x,y:m.y,index:h,body:u,isInternal:!1};c.push(d)}return c},a.fromPath=function(l,u){var c=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,h=[];return l.replace(c,function(m,d,p){h.push({x:parseFloat(d),y:parseFloat(p)})}),a.create(h,u)},a.centre=function(l){for(var u=a.area(l,!0),c={x:0,y:0},h,m,d,p=0;p<l.length;p++)d=(p+1)%l.length,h=s.cross(l[p],l[d]),m=s.mult(s.add(l[p],l[d]),h),c=s.add(c,m);return s.div(c,6*u)},a.mean=function(l){for(var u={x:0,y:0},c=0;c<l.length;c++)u.x+=l[c].x,u.y+=l[c].y;return s.div(u,l.length)},a.area=function(l,u){for(var c=0,h=l.length-1,m=0;m<l.length;m++)c+=(l[h].x-l[m].x)*(l[h].y+l[m].y),h=m;return u?c/2:Math.abs(c)/2},a.inertia=function(l,u){for(var c=0,h=0,m=l,d,p,g=0;g<m.length;g++)p=(g+1)%m.length,d=Math.abs(s.cross(m[p],m[g])),c+=d*(s.dot(m[p],m[p])+s.dot(m[p],m[g])+s.dot(m[g],m[g])),h+=d;return u/6*(c/h)},a.translate=function(l,u,c){c=typeof c<"u"?c:1;var h=l.length,m=u.x*c,d=u.y*c,p;for(p=0;p<h;p++)l[p].x+=m,l[p].y+=d;return l},a.rotate=function(l,u,c){if(u!==0){var h=Math.cos(u),m=Math.sin(u),d=c.x,p=c.y,g=l.length,x,b,v,E;for(E=0;E<g;E++)x=l[E],b=x.x-d,v=x.y-p,x.x=d+(b*h-v*m),x.y=p+(b*m+v*h);return l}},a.contains=function(l,u){for(var c=u.x,h=u.y,m=l.length,d=l[m-1],p,g=0;g<m;g++){if(p=l[g],(c-d.x)*(p.y-d.y)+(h-d.y)*(d.x-p.x)>0)return!1;d=p}return!0},a.scale=function(l,u,c,h){if(u===1&&c===1)return l;h=h||a.centre(l);for(var m,d,p=0;p<l.length;p++)m=l[p],d=s.sub(m,h),l[p].x=h.x+d.x*u,l[p].y=h.y+d.y*c;return l},a.chamfer=function(l,u,c,h,m){typeof u=="number"?u=[u]:u=u||[8],c=typeof c<"u"?c:-1,h=h||2,m=m||14;for(var d=[],p=0;p<l.length;p++){var g=l[p-1>=0?p-1:l.length-1],x=l[p],b=l[(p+1)%l.length],v=u[p<u.length?p:u.length-1];if(v===0){d.push(x);continue}var E=s.normalise({x:x.y-g.y,y:g.x-x.x}),N=s.normalise({x:b.y-x.y,y:x.x-b.x}),k=Math.sqrt(2*Math.pow(v,2)),S=s.mult(o.clone(E),v),_=s.normalise(s.mult(s.add(E,N),.5)),C=s.sub(x,s.mult(_,k)),I=c;c===-1&&(I=Math.pow(v,.32)*1.75),I=o.clamp(I,h,m),I%2===1&&(I+=1);for(var A=Math.acos(s.dot(E,N)),R=A/I,L=0;L<I;L++)d.push(s.add(s.rotate(S,R*L),C))}return d},a.clockwiseSort=function(l){var u=a.mean(l);return l.sort(function(c,h){return s.angle(u,c)-s.angle(u,h)}),l},a.isConvex=function(l){var u=0,c=l.length,h,m,d,p;if(c<3)return null;for(h=0;h<c;h++)if(m=(h+1)%c,d=(h+2)%c,p=(l[m].x-l[h].x)*(l[d].y-l[m].y),p-=(l[m].y-l[h].y)*(l[d].x-l[m].x),p<0?u|=1:p>0&&(u|=2),u===3)return!1;return u!==0?!0:null},a.hull=function(l){var u=[],c=[],h,m;for(l=l.slice(0),l.sort(function(d,p){var g=d.x-p.x;return g!==0?g:d.y-p.y}),m=0;m<l.length;m+=1){for(h=l[m];c.length>=2&&s.cross3(c[c.length-2],c[c.length-1],h)<=0;)c.pop();c.push(h)}for(m=l.length-1;m>=0;m-=1){for(h=l[m];u.length>=2&&s.cross3(u[u.length-2],u[u.length-1],h)<=0;)u.pop();u.push(h)}return u.pop(),c.pop(),u.concat(c)}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(3),o=i(2),l=i(7),u=i(0),c=i(1),h=i(11);(function(){a._timeCorrection=!0,a._inertiaScale=4,a._nextCollidingGroupId=1,a._nextNonCollidingGroupId=-1,a._nextCategory=1,a._baseDelta=1e3/60,a.create=function(d){var p={id:u.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:s.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,strokeStyle:null,fillStyle:null,lineWidth:null,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0}},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,deltaTime:16.666666666666668,_original:null},g=u.extend(p,d);return m(g,d),g},a.nextGroup=function(d){return d?a._nextNonCollidingGroupId--:a._nextCollidingGroupId++},a.nextCategory=function(){return a._nextCategory=a._nextCategory<<1,a._nextCategory};var m=function(d,p){p=p||{},a.set(d,{bounds:d.bounds||c.create(d.vertices),positionPrev:d.positionPrev||o.clone(d.position),anglePrev:d.anglePrev||d.angle,vertices:d.vertices,parts:d.parts||[d],isStatic:d.isStatic,isSleeping:d.isSleeping,parent:d.parent||d}),s.rotate(d.vertices,d.angle,d.position),h.rotate(d.axes,d.angle),c.update(d.bounds,d.vertices,d.velocity),a.set(d,{axes:p.axes||d.axes,area:p.area||d.area,mass:p.mass||d.mass,inertia:p.inertia||d.inertia});var g=d.isStatic?"#14151f":u.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),x=d.isStatic?"#555":"#ccc",b=d.isStatic&&d.render.fillStyle===null?1:0;d.render.fillStyle=d.render.fillStyle||g,d.render.strokeStyle=d.render.strokeStyle||x,d.render.lineWidth=d.render.lineWidth||b,d.render.sprite.xOffset+=-(d.bounds.min.x-d.position.x)/(d.bounds.max.x-d.bounds.min.x),d.render.sprite.yOffset+=-(d.bounds.min.y-d.position.y)/(d.bounds.max.y-d.bounds.min.y)};a.set=function(d,p,g){var x;typeof p=="string"&&(x=p,p={},p[x]=g);for(x in p)if(Object.prototype.hasOwnProperty.call(p,x))switch(g=p[x],x){case"isStatic":a.setStatic(d,g);break;case"isSleeping":l.set(d,g);break;case"mass":a.setMass(d,g);break;case"density":a.setDensity(d,g);break;case"inertia":a.setInertia(d,g);break;case"vertices":a.setVertices(d,g);break;case"position":a.setPosition(d,g);break;case"angle":a.setAngle(d,g);break;case"velocity":a.setVelocity(d,g);break;case"angularVelocity":a.setAngularVelocity(d,g);break;case"speed":a.setSpeed(d,g);break;case"angularSpeed":a.setAngularSpeed(d,g);break;case"parts":a.setParts(d,g);break;case"centre":a.setCentre(d,g);break;default:d[x]=g}},a.setStatic=function(d,p){for(var g=0;g<d.parts.length;g++){var x=d.parts[g];x.isStatic=p,p?(x._original={restitution:x.restitution,friction:x.friction,mass:x.mass,inertia:x.inertia,density:x.density,inverseMass:x.inverseMass,inverseInertia:x.inverseInertia},x.restitution=0,x.friction=1,x.mass=x.inertia=x.density=1/0,x.inverseMass=x.inverseInertia=0,x.positionPrev.x=x.position.x,x.positionPrev.y=x.position.y,x.anglePrev=x.angle,x.angularVelocity=0,x.speed=0,x.angularSpeed=0,x.motion=0):x._original&&(x.restitution=x._original.restitution,x.friction=x._original.friction,x.mass=x._original.mass,x.inertia=x._original.inertia,x.density=x._original.density,x.inverseMass=x._original.inverseMass,x.inverseInertia=x._original.inverseInertia,x._original=null)}},a.setMass=function(d,p){var g=d.inertia/(d.mass/6);d.inertia=g*(p/6),d.inverseInertia=1/d.inertia,d.mass=p,d.inverseMass=1/d.mass,d.density=d.mass/d.area},a.setDensity=function(d,p){a.setMass(d,p*d.area),d.density=p},a.setInertia=function(d,p){d.inertia=p,d.inverseInertia=1/d.inertia},a.setVertices=function(d,p){p[0].body===d?d.vertices=p:d.vertices=s.create(p,d),d.axes=h.fromVertices(d.vertices),d.area=s.area(d.vertices),a.setMass(d,d.density*d.area);var g=s.centre(d.vertices);s.translate(d.vertices,g,-1),a.setInertia(d,a._inertiaScale*s.inertia(d.vertices,d.mass)),s.translate(d.vertices,d.position),c.update(d.bounds,d.vertices,d.velocity)},a.setParts=function(d,p,g){var x;for(p=p.slice(0),d.parts.length=0,d.parts.push(d),d.parent=d,x=0;x<p.length;x++){var b=p[x];b!==d&&(b.parent=d,d.parts.push(b))}if(d.parts.length!==1){if(g=typeof g<"u"?g:!0,g){var v=[];for(x=0;x<p.length;x++)v=v.concat(p[x].vertices);s.clockwiseSort(v);var E=s.hull(v),N=s.centre(E);a.setVertices(d,E),s.translate(d.vertices,N)}var k=a._totalProperties(d);d.area=k.area,d.parent=d,d.position.x=k.centre.x,d.position.y=k.centre.y,d.positionPrev.x=k.centre.x,d.positionPrev.y=k.centre.y,a.setMass(d,k.mass),a.setInertia(d,k.inertia),a.setPosition(d,k.centre)}},a.setCentre=function(d,p,g){g?(d.positionPrev.x+=p.x,d.positionPrev.y+=p.y,d.position.x+=p.x,d.position.y+=p.y):(d.positionPrev.x=p.x-(d.position.x-d.positionPrev.x),d.positionPrev.y=p.y-(d.position.y-d.positionPrev.y),d.position.x=p.x,d.position.y=p.y)},a.setPosition=function(d,p,g){var x=o.sub(p,d.position);g?(d.positionPrev.x=d.position.x,d.positionPrev.y=d.position.y,d.velocity.x=x.x,d.velocity.y=x.y,d.speed=o.magnitude(x)):(d.positionPrev.x+=x.x,d.positionPrev.y+=x.y);for(var b=0;b<d.parts.length;b++){var v=d.parts[b];v.position.x+=x.x,v.position.y+=x.y,s.translate(v.vertices,x),c.update(v.bounds,v.vertices,d.velocity)}},a.setAngle=function(d,p,g){var x=p-d.angle;g?(d.anglePrev=d.angle,d.angularVelocity=x,d.angularSpeed=Math.abs(x)):d.anglePrev+=x;for(var b=0;b<d.parts.length;b++){var v=d.parts[b];v.angle+=x,s.rotate(v.vertices,x,d.position),h.rotate(v.axes,x),c.update(v.bounds,v.vertices,d.velocity),b>0&&o.rotateAbout(v.position,x,d.position,v.position)}},a.setVelocity=function(d,p){var g=d.deltaTime/a._baseDelta;d.positionPrev.x=d.position.x-p.x*g,d.positionPrev.y=d.position.y-p.y*g,d.velocity.x=(d.position.x-d.positionPrev.x)/g,d.velocity.y=(d.position.y-d.positionPrev.y)/g,d.speed=o.magnitude(d.velocity)},a.getVelocity=function(d){var p=a._baseDelta/d.deltaTime;return{x:(d.position.x-d.positionPrev.x)*p,y:(d.position.y-d.positionPrev.y)*p}},a.getSpeed=function(d){return o.magnitude(a.getVelocity(d))},a.setSpeed=function(d,p){a.setVelocity(d,o.mult(o.normalise(a.getVelocity(d)),p))},a.setAngularVelocity=function(d,p){var g=d.deltaTime/a._baseDelta;d.anglePrev=d.angle-p*g,d.angularVelocity=(d.angle-d.anglePrev)/g,d.angularSpeed=Math.abs(d.angularVelocity)},a.getAngularVelocity=function(d){return(d.angle-d.anglePrev)*a._baseDelta/d.deltaTime},a.getAngularSpeed=function(d){return Math.abs(a.getAngularVelocity(d))},a.setAngularSpeed=function(d,p){a.setAngularVelocity(d,u.sign(a.getAngularVelocity(d))*p)},a.translate=function(d,p,g){a.setPosition(d,o.add(d.position,p),g)},a.rotate=function(d,p,g,x){if(!g)a.setAngle(d,d.angle+p,x);else{var b=Math.cos(p),v=Math.sin(p),E=d.position.x-g.x,N=d.position.y-g.y;a.setPosition(d,{x:g.x+(E*b-N*v),y:g.y+(E*v+N*b)},x),a.setAngle(d,d.angle+p,x)}},a.scale=function(d,p,g,x){var b=0,v=0;x=x||d.position;for(var E=0;E<d.parts.length;E++){var N=d.parts[E];s.scale(N.vertices,p,g,x),N.axes=h.fromVertices(N.vertices),N.area=s.area(N.vertices),a.setMass(N,d.density*N.area),s.translate(N.vertices,{x:-N.position.x,y:-N.position.y}),a.setInertia(N,a._inertiaScale*s.inertia(N.vertices,N.mass)),s.translate(N.vertices,{x:N.position.x,y:N.position.y}),E>0&&(b+=N.area,v+=N.inertia),N.position.x=x.x+(N.position.x-x.x)*p,N.position.y=x.y+(N.position.y-x.y)*g,c.update(N.bounds,N.vertices,d.velocity)}d.parts.length>1&&(d.area=b,d.isStatic||(a.setMass(d,d.density*b),a.setInertia(d,v))),d.circleRadius&&(p===g?d.circleRadius*=p:d.circleRadius=null)},a.update=function(d,p){p=(typeof p<"u"?p:1e3/60)*d.timeScale;var g=p*p,x=a._timeCorrection?p/(d.deltaTime||p):1,b=1-d.frictionAir*(p/u._baseDelta),v=(d.position.x-d.positionPrev.x)*x,E=(d.position.y-d.positionPrev.y)*x;d.velocity.x=v*b+d.force.x/d.mass*g,d.velocity.y=E*b+d.force.y/d.mass*g,d.positionPrev.x=d.position.x,d.positionPrev.y=d.position.y,d.position.x+=d.velocity.x,d.position.y+=d.velocity.y,d.deltaTime=p,d.angularVelocity=(d.angle-d.anglePrev)*b*x+d.torque/d.inertia*g,d.anglePrev=d.angle,d.angle+=d.angularVelocity;for(var N=0;N<d.parts.length;N++){var k=d.parts[N];s.translate(k.vertices,d.velocity),N>0&&(k.position.x+=d.velocity.x,k.position.y+=d.velocity.y),d.angularVelocity!==0&&(s.rotate(k.vertices,d.angularVelocity,d.position),h.rotate(k.axes,d.angularVelocity),N>0&&o.rotateAbout(k.position,d.angularVelocity,d.position,k.position)),c.update(k.bounds,k.vertices,d.velocity)}},a.updateVelocities=function(d){var p=a._baseDelta/d.deltaTime,g=d.velocity;g.x=(d.position.x-d.positionPrev.x)*p,g.y=(d.position.y-d.positionPrev.y)*p,d.speed=Math.sqrt(g.x*g.x+g.y*g.y),d.angularVelocity=(d.angle-d.anglePrev)*p,d.angularSpeed=Math.abs(d.angularVelocity)},a.applyForce=function(d,p,g){var x={x:p.x-d.position.x,y:p.y-d.position.y};d.force.x+=g.x,d.force.y+=g.y,d.torque+=x.x*g.y-x.y*g.x},a._totalProperties=function(d){for(var p={mass:0,area:0,inertia:0,centre:{x:0,y:0}},g=d.parts.length===1?0:1;g<d.parts.length;g++){var x=d.parts[g],b=x.mass!==1/0?x.mass:1;p.mass+=b,p.area+=x.area,p.inertia+=x.inertia,p.centre=o.add(p.centre,o.mult(x.position,b))}return p.centre=o.div(p.centre,p.mass),p}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(0);(function(){a.on=function(o,l,u){for(var c=l.split(" "),h,m=0;m<c.length;m++)h=c[m],o.events=o.events||{},o.events[h]=o.events[h]||[],o.events[h].push(u);return u},a.off=function(o,l,u){if(!l){o.events={};return}typeof l=="function"&&(u=l,l=s.keys(o.events).join(" "));for(var c=l.split(" "),h=0;h<c.length;h++){var m=o.events[c[h]],d=[];if(u&&m)for(var p=0;p<m.length;p++)m[p]!==u&&d.push(m[p]);o.events[c[h]]=d}},a.trigger=function(o,l,u){var c,h,m,d,p=o.events;if(p&&s.keys(p).length>0){u||(u={}),c=l.split(" ");for(var g=0;g<c.length;g++)if(h=c[g],m=p[h],m){d=s.clone(u,!1),d.name=h,d.source=o;for(var x=0;x<m.length;x++)m[x].apply(o,[d])}}}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(5),o=i(0),l=i(1),u=i(4);(function(){a.create=function(c){return o.extend({id:o.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},c)},a.setModified=function(c,h,m,d){if(c.isModified=h,h&&c.cache&&(c.cache.allBodies=null,c.cache.allConstraints=null,c.cache.allComposites=null),m&&c.parent&&a.setModified(c.parent,h,m,d),d)for(var p=0;p<c.composites.length;p++){var g=c.composites[p];a.setModified(g,h,m,d)}},a.add=function(c,h){var m=[].concat(h);s.trigger(c,"beforeAdd",{object:h});for(var d=0;d<m.length;d++){var p=m[d];switch(p.type){case"body":if(p.parent!==p){o.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}a.addBody(c,p);break;case"constraint":a.addConstraint(c,p);break;case"composite":a.addComposite(c,p);break;case"mouseConstraint":a.addConstraint(c,p.constraint);break}}return s.trigger(c,"afterAdd",{object:h}),c},a.remove=function(c,h,m){var d=[].concat(h);s.trigger(c,"beforeRemove",{object:h});for(var p=0;p<d.length;p++){var g=d[p];switch(g.type){case"body":a.removeBody(c,g,m);break;case"constraint":a.removeConstraint(c,g,m);break;case"composite":a.removeComposite(c,g,m);break;case"mouseConstraint":a.removeConstraint(c,g.constraint);break}}return s.trigger(c,"afterRemove",{object:h}),c},a.addComposite=function(c,h){return c.composites.push(h),h.parent=c,a.setModified(c,!0,!0,!1),c},a.removeComposite=function(c,h,m){var d=o.indexOf(c.composites,h);if(d!==-1&&a.removeCompositeAt(c,d),m)for(var p=0;p<c.composites.length;p++)a.removeComposite(c.composites[p],h,!0);return c},a.removeCompositeAt=function(c,h){return c.composites.splice(h,1),a.setModified(c,!0,!0,!1),c},a.addBody=function(c,h){return c.bodies.push(h),a.setModified(c,!0,!0,!1),c},a.removeBody=function(c,h,m){var d=o.indexOf(c.bodies,h);if(d!==-1&&a.removeBodyAt(c,d),m)for(var p=0;p<c.composites.length;p++)a.removeBody(c.composites[p],h,!0);return c},a.removeBodyAt=function(c,h){return c.bodies.splice(h,1),a.setModified(c,!0,!0,!1),c},a.addConstraint=function(c,h){return c.constraints.push(h),a.setModified(c,!0,!0,!1),c},a.removeConstraint=function(c,h,m){var d=o.indexOf(c.constraints,h);if(d!==-1&&a.removeConstraintAt(c,d),m)for(var p=0;p<c.composites.length;p++)a.removeConstraint(c.composites[p],h,!0);return c},a.removeConstraintAt=function(c,h){return c.constraints.splice(h,1),a.setModified(c,!0,!0,!1),c},a.clear=function(c,h,m){if(m)for(var d=0;d<c.composites.length;d++)a.clear(c.composites[d],h,!0);return h?c.bodies=c.bodies.filter(function(p){return p.isStatic}):c.bodies.length=0,c.constraints.length=0,c.composites.length=0,a.setModified(c,!0,!0,!1),c},a.allBodies=function(c){if(c.cache&&c.cache.allBodies)return c.cache.allBodies;for(var h=[].concat(c.bodies),m=0;m<c.composites.length;m++)h=h.concat(a.allBodies(c.composites[m]));return c.cache&&(c.cache.allBodies=h),h},a.allConstraints=function(c){if(c.cache&&c.cache.allConstraints)return c.cache.allConstraints;for(var h=[].concat(c.constraints),m=0;m<c.composites.length;m++)h=h.concat(a.allConstraints(c.composites[m]));return c.cache&&(c.cache.allConstraints=h),h},a.allComposites=function(c){if(c.cache&&c.cache.allComposites)return c.cache.allComposites;for(var h=[].concat(c.composites),m=0;m<c.composites.length;m++)h=h.concat(a.allComposites(c.composites[m]));return c.cache&&(c.cache.allComposites=h),h},a.get=function(c,h,m){var d,p;switch(m){case"body":d=a.allBodies(c);break;case"constraint":d=a.allConstraints(c);break;case"composite":d=a.allComposites(c).concat(c);break}return d?(p=d.filter(function(g){return g.id.toString()===h.toString()}),p.length===0?null:p[0]):null},a.move=function(c,h,m){return a.remove(c,h),a.add(m,h),c},a.rebase=function(c){for(var h=a.allBodies(c).concat(a.allConstraints(c)).concat(a.allComposites(c)),m=0;m<h.length;m++)h[m].id=o.nextId();return c},a.translate=function(c,h,m){for(var d=m?a.allBodies(c):c.bodies,p=0;p<d.length;p++)u.translate(d[p],h);return c},a.rotate=function(c,h,m,d){for(var p=Math.cos(h),g=Math.sin(h),x=d?a.allBodies(c):c.bodies,b=0;b<x.length;b++){var v=x[b],E=v.position.x-m.x,N=v.position.y-m.y;u.setPosition(v,{x:m.x+(E*p-N*g),y:m.y+(E*g+N*p)}),u.rotate(v,h)}return c},a.scale=function(c,h,m,d,p){for(var g=p?a.allBodies(c):c.bodies,x=0;x<g.length;x++){var b=g[x],v=b.position.x-d.x,E=b.position.y-d.y;u.setPosition(b,{x:d.x+v*h,y:d.y+E*m}),u.scale(b,h,m)}return c},a.bounds=function(c){for(var h=a.allBodies(c),m=[],d=0;d<h.length;d+=1){var p=h[d];m.push(p.bounds.min,p.bounds.max)}return l.create(m)}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(4),o=i(5),l=i(0);(function(){a._motionWakeThreshold=.18,a._motionSleepThreshold=.08,a._minBias=.9,a.update=function(u,c){for(var h=c/l._baseDelta,m=a._motionSleepThreshold,d=0;d<u.length;d++){var p=u[d],g=s.getSpeed(p),x=s.getAngularSpeed(p),b=g*g+x*x;if(p.force.x!==0||p.force.y!==0){a.set(p,!1);continue}var v=Math.min(p.motion,b),E=Math.max(p.motion,b);p.motion=a._minBias*v+(1-a._minBias)*E,p.sleepThreshold>0&&p.motion<m?(p.sleepCounter+=1,p.sleepCounter>=p.sleepThreshold/h&&a.set(p,!0)):p.sleepCounter>0&&(p.sleepCounter-=1)}},a.afterCollisions=function(u){for(var c=a._motionSleepThreshold,h=0;h<u.length;h++){var m=u[h];if(m.isActive){var d=m.collision,p=d.bodyA.parent,g=d.bodyB.parent;if(!(p.isSleeping&&g.isSleeping||p.isStatic||g.isStatic)&&(p.isSleeping||g.isSleeping)){var x=p.isSleeping&&!p.isStatic?p:g,b=x===p?g:p;!x.isStatic&&b.motion>c&&a.set(x,!1)}}}},a.set=function(u,c){var h=u.isSleeping;c?(u.isSleeping=!0,u.sleepCounter=u.sleepThreshold,u.positionImpulse.x=0,u.positionImpulse.y=0,u.positionPrev.x=u.position.x,u.positionPrev.y=u.position.y,u.anglePrev=u.angle,u.speed=0,u.angularSpeed=0,u.motion=0,h||o.trigger(u,"sleepStart")):(u.isSleeping=!1,u.sleepCounter=0,h&&o.trigger(u,"sleepEnd"))}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(3),o=i(9);(function(){var l=[],u={overlap:0,axis:null},c={overlap:0,axis:null};a.create=function(h,m){return{pair:null,collided:!1,bodyA:h,bodyB:m,parentA:h.parent,parentB:m.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},a.collides=function(h,m,d){if(a._overlapAxes(u,h.vertices,m.vertices,h.axes),u.overlap<=0||(a._overlapAxes(c,m.vertices,h.vertices,m.axes),c.overlap<=0))return null;var p=d&&d.table[o.id(h,m)],g;p?g=p.collision:(g=a.create(h,m),g.collided=!0,g.bodyA=h.id<m.id?h:m,g.bodyB=h.id<m.id?m:h,g.parentA=g.bodyA.parent,g.parentB=g.bodyB.parent),h=g.bodyA,m=g.bodyB;var x;u.overlap<c.overlap?x=u:x=c;var b=g.normal,v=g.supports,E=x.axis,N=E.x,k=E.y;N*(m.position.x-h.position.x)+k*(m.position.y-h.position.y)<0?(b.x=N,b.y=k):(b.x=-N,b.y=-k),g.tangent.x=-b.y,g.tangent.y=b.x,g.depth=x.overlap,g.penetration.x=b.x*g.depth,g.penetration.y=b.y*g.depth;var S=a._findSupports(h,m,b,1),_=0;if(s.contains(h.vertices,S[0])&&(v[_++]=S[0]),s.contains(h.vertices,S[1])&&(v[_++]=S[1]),_<2){var C=a._findSupports(m,h,b,-1);s.contains(m.vertices,C[0])&&(v[_++]=C[0]),_<2&&s.contains(m.vertices,C[1])&&(v[_++]=C[1])}return _===0&&(v[_++]=S[0]),v.length=_,g},a._overlapAxes=function(h,m,d,p){var g=m.length,x=d.length,b=m[0].x,v=m[0].y,E=d[0].x,N=d[0].y,k=p.length,S=Number.MAX_VALUE,_=0,C,I,A,R,L,z;for(L=0;L<k;L++){var j=p[L],B=j.x,H=j.y,Y=b*B+v*H,V=E*B+N*H,Z=Y,O=V;for(z=1;z<g;z+=1)R=m[z].x*B+m[z].y*H,R>Z?Z=R:R<Y&&(Y=R);for(z=1;z<x;z+=1)R=d[z].x*B+d[z].y*H,R>O?O=R:R<V&&(V=R);if(I=Z-V,A=O-Y,C=I<A?I:A,C<S&&(S=C,_=L,C<=0))break}h.axis=p[_],h.overlap=S},a._projectToAxis=function(h,m,d){for(var p=m[0].x*d.x+m[0].y*d.y,g=p,x=1;x<m.length;x+=1){var b=m[x].x*d.x+m[x].y*d.y;b>g?g=b:b<p&&(p=b)}h.min=p,h.max=g},a._findSupports=function(h,m,d,p){var g=m.vertices,x=g.length,b=h.position.x,v=h.position.y,E=d.x*p,N=d.y*p,k=Number.MAX_VALUE,S,_,C,I,A;for(A=0;A<x;A+=1)_=g[A],I=E*(b-_.x)+N*(v-_.y),I<k&&(k=I,S=_);return C=g[(x+S.index-1)%x],k=E*(b-C.x)+N*(v-C.y),_=g[(S.index+1)%x],E*(b-_.x)+N*(v-_.y)<k?(l[0]=S,l[1]=_,l):(l[0]=S,l[1]=C,l)}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(16);(function(){a.create=function(o,l){var u=o.bodyA,c=o.bodyB,h={id:a.id(u,c),bodyA:u,bodyB:c,collision:o,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:u.isSensor||c.isSensor,timeCreated:l,timeUpdated:l,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return a.update(h,o,l),h},a.update=function(o,l,u){var c=o.contacts,h=l.supports,m=o.activeContacts,d=l.parentA,p=l.parentB,g=d.vertices.length;o.isActive=!0,o.timeUpdated=u,o.collision=l,o.separation=l.depth,o.inverseMass=d.inverseMass+p.inverseMass,o.friction=d.friction<p.friction?d.friction:p.friction,o.frictionStatic=d.frictionStatic>p.frictionStatic?d.frictionStatic:p.frictionStatic,o.restitution=d.restitution>p.restitution?d.restitution:p.restitution,o.slop=d.slop>p.slop?d.slop:p.slop,l.pair=o,m.length=0;for(var x=0;x<h.length;x++){var b=h[x],v=b.body===d?b.index:g+b.index,E=c[v];E?m.push(E):m.push(c[v]=s.create(b))}},a.setActive=function(o,l,u){l?(o.isActive=!0,o.timeUpdated=u):(o.isActive=!1,o.activeContacts.length=0)},a.id=function(o,l){return o.id<l.id?"A"+o.id+"B"+l.id:"A"+l.id+"B"+o.id}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(3),o=i(2),l=i(7),u=i(1),c=i(11),h=i(0);(function(){a._warming=.4,a._torqueDampen=1,a._minLength=1e-6,a.create=function(m){var d=m;d.bodyA&&!d.pointA&&(d.pointA={x:0,y:0}),d.bodyB&&!d.pointB&&(d.pointB={x:0,y:0});var p=d.bodyA?o.add(d.bodyA.position,d.pointA):d.pointA,g=d.bodyB?o.add(d.bodyB.position,d.pointB):d.pointB,x=o.magnitude(o.sub(p,g));d.length=typeof d.length<"u"?d.length:x,d.id=d.id||h.nextId(),d.label=d.label||"Constraint",d.type="constraint",d.stiffness=d.stiffness||(d.length>0?1:.7),d.damping=d.damping||0,d.angularStiffness=d.angularStiffness||0,d.angleA=d.bodyA?d.bodyA.angle:d.angleA,d.angleB=d.bodyB?d.bodyB.angle:d.angleB,d.plugin={};var b={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return d.length===0&&d.stiffness>.1?(b.type="pin",b.anchors=!1):d.stiffness<.9&&(b.type="spring"),d.render=h.extend(b,d.render),d},a.preSolveAll=function(m){for(var d=0;d<m.length;d+=1){var p=m[d],g=p.constraintImpulse;p.isStatic||g.x===0&&g.y===0&&g.angle===0||(p.position.x+=g.x,p.position.y+=g.y,p.angle+=g.angle)}},a.solveAll=function(m,d){for(var p=h.clamp(d/h._baseDelta,0,1),g=0;g<m.length;g+=1){var x=m[g],b=!x.bodyA||x.bodyA&&x.bodyA.isStatic,v=!x.bodyB||x.bodyB&&x.bodyB.isStatic;(b||v)&&a.solve(m[g],p)}for(g=0;g<m.length;g+=1)x=m[g],b=!x.bodyA||x.bodyA&&x.bodyA.isStatic,v=!x.bodyB||x.bodyB&&x.bodyB.isStatic,!b&&!v&&a.solve(m[g],p)},a.solve=function(m,d){var p=m.bodyA,g=m.bodyB,x=m.pointA,b=m.pointB;if(!(!p&&!g)){p&&!p.isStatic&&(o.rotate(x,p.angle-m.angleA,x),m.angleA=p.angle),g&&!g.isStatic&&(o.rotate(b,g.angle-m.angleB,b),m.angleB=g.angle);var v=x,E=b;if(p&&(v=o.add(p.position,x)),g&&(E=o.add(g.position,b)),!(!v||!E)){var N=o.sub(v,E),k=o.magnitude(N);k<a._minLength&&(k=a._minLength);var S=(k-m.length)/k,_=m.stiffness>=1||m.length===0,C=_?m.stiffness*d:m.stiffness*d*d,I=m.damping*d,A=o.mult(N,S*C),R=(p?p.inverseMass:0)+(g?g.inverseMass:0),L=(p?p.inverseInertia:0)+(g?g.inverseInertia:0),z=R+L,j,B,H,Y,V;if(I>0){var Z=o.create();H=o.div(N,k),V=o.sub(g&&o.sub(g.position,g.positionPrev)||Z,p&&o.sub(p.position,p.positionPrev)||Z),Y=o.dot(H,V)}p&&!p.isStatic&&(B=p.inverseMass/R,p.constraintImpulse.x-=A.x*B,p.constraintImpulse.y-=A.y*B,p.position.x-=A.x*B,p.position.y-=A.y*B,I>0&&(p.positionPrev.x-=I*H.x*Y*B,p.positionPrev.y-=I*H.y*Y*B),j=o.cross(x,A)/z*a._torqueDampen*p.inverseInertia*(1-m.angularStiffness),p.constraintImpulse.angle-=j,p.angle-=j),g&&!g.isStatic&&(B=g.inverseMass/R,g.constraintImpulse.x+=A.x*B,g.constraintImpulse.y+=A.y*B,g.position.x+=A.x*B,g.position.y+=A.y*B,I>0&&(g.positionPrev.x+=I*H.x*Y*B,g.positionPrev.y+=I*H.y*Y*B),j=o.cross(b,A)/z*a._torqueDampen*g.inverseInertia*(1-m.angularStiffness),g.constraintImpulse.angle+=j,g.angle+=j)}}},a.postSolveAll=function(m){for(var d=0;d<m.length;d++){var p=m[d],g=p.constraintImpulse;if(!(p.isStatic||g.x===0&&g.y===0&&g.angle===0)){l.set(p,!1);for(var x=0;x<p.parts.length;x++){var b=p.parts[x];s.translate(b.vertices,g),x>0&&(b.position.x+=g.x,b.position.y+=g.y),g.angle!==0&&(s.rotate(b.vertices,g.angle,p.position),c.rotate(b.axes,g.angle),x>0&&o.rotateAbout(b.position,g.angle,p.position,b.position)),u.update(b.bounds,b.vertices,p.velocity)}g.angle*=a._warming,g.x*=a._warming,g.y*=a._warming}}},a.pointAWorld=function(m){return{x:(m.bodyA?m.bodyA.position.x:0)+(m.pointA?m.pointA.x:0),y:(m.bodyA?m.bodyA.position.y:0)+(m.pointA?m.pointA.y:0)}},a.pointBWorld=function(m){return{x:(m.bodyB?m.bodyB.position.x:0)+(m.pointB?m.pointB.x:0),y:(m.bodyB?m.bodyB.position.y:0)+(m.pointB?m.pointB.y:0)}}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(2),o=i(0);(function(){a.fromVertices=function(l){for(var u={},c=0;c<l.length;c++){var h=(c+1)%l.length,m=s.normalise({x:l[h].y-l[c].y,y:l[c].x-l[h].x}),d=m.y===0?1/0:m.x/m.y;d=d.toFixed(3).toString(),u[d]=m}return o.values(u)},a.rotate=function(l,u){if(u!==0)for(var c=Math.cos(u),h=Math.sin(u),m=0;m<l.length;m++){var d=l[m],p;p=d.x*c-d.y*h,d.y=d.x*h+d.y*c,d.x=p}}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(3),o=i(0),l=i(4),u=i(1),c=i(2);(function(){a.rectangle=function(h,m,d,p,g){g=g||{};var x={label:"Rectangle Body",position:{x:h,y:m},vertices:s.fromPath("L 0 0 L "+d+" 0 L "+d+" "+p+" L 0 "+p)};if(g.chamfer){var b=g.chamfer;x.vertices=s.chamfer(x.vertices,b.radius,b.quality,b.qualityMin,b.qualityMax),delete g.chamfer}return l.create(o.extend({},x,g))},a.trapezoid=function(h,m,d,p,g,x){x=x||{},g*=.5;var b=(1-g*2)*d,v=d*g,E=v+b,N=E+v,k;g<.5?k="L 0 0 L "+v+" "+-p+" L "+E+" "+-p+" L "+N+" 0":k="L 0 0 L "+E+" "+-p+" L "+N+" 0";var S={label:"Trapezoid Body",position:{x:h,y:m},vertices:s.fromPath(k)};if(x.chamfer){var _=x.chamfer;S.vertices=s.chamfer(S.vertices,_.radius,_.quality,_.qualityMin,_.qualityMax),delete x.chamfer}return l.create(o.extend({},S,x))},a.circle=function(h,m,d,p,g){p=p||{};var x={label:"Circle Body",circleRadius:d};g=g||25;var b=Math.ceil(Math.max(10,Math.min(g,d)));return b%2===1&&(b+=1),a.polygon(h,m,b,d,o.extend({},x,p))},a.polygon=function(h,m,d,p,g){if(g=g||{},d<3)return a.circle(h,m,p,g);for(var x=2*Math.PI/d,b="",v=x*.5,E=0;E<d;E+=1){var N=v+E*x,k=Math.cos(N)*p,S=Math.sin(N)*p;b+="L "+k.toFixed(3)+" "+S.toFixed(3)+" "}var _={label:"Polygon Body",position:{x:h,y:m},vertices:s.fromPath(b)};if(g.chamfer){var C=g.chamfer;_.vertices=s.chamfer(_.vertices,C.radius,C.quality,C.qualityMin,C.qualityMax),delete g.chamfer}return l.create(o.extend({},_,g))},a.fromVertices=function(h,m,d,p,g,x,b,v){var E=o.getDecomp(),N,k,S,_,C,I,A,R,L,z,j;for(N=!!(E&&E.quickDecomp),p=p||{},S=[],g=typeof g<"u"?g:!1,x=typeof x<"u"?x:.01,b=typeof b<"u"?b:10,v=typeof v<"u"?v:.01,o.isArray(d[0])||(d=[d]),z=0;z<d.length;z+=1)if(I=d[z],_=s.isConvex(I),C=!_,C&&!N&&o.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),_||!N)_?I=s.clockwiseSort(I):I=s.hull(I),S.push({position:{x:h,y:m},vertices:I});else{var B=I.map(function(K){return[K.x,K.y]});E.makeCCW(B),x!==!1&&E.removeCollinearPoints(B,x),v!==!1&&E.removeDuplicatePoints&&E.removeDuplicatePoints(B,v);var H=E.quickDecomp(B);for(A=0;A<H.length;A++){var Y=H[A],V=Y.map(function(K){return{x:K[0],y:K[1]}});b>0&&s.area(V)<b||S.push({position:s.centre(V),vertices:V})}}for(A=0;A<S.length;A++)S[A]=l.create(o.extend(S[A],p));if(g){var Z=5;for(A=0;A<S.length;A++){var O=S[A];for(R=A+1;R<S.length;R++){var X=S[R];if(u.overlaps(O.bounds,X.bounds)){var ne=O.vertices,P=X.vertices;for(L=0;L<O.vertices.length;L++)for(j=0;j<X.vertices.length;j++){var te=c.magnitudeSquared(c.sub(ne[(L+1)%ne.length],P[j])),Q=c.magnitudeSquared(c.sub(ne[L],P[(j+1)%P.length]));te<Z&&Q<Z&&(ne[L].isInternal=!0,P[j].isInternal=!0)}}}}}return S.length>1?(k=l.create(o.extend({parts:S.slice(0)},p)),l.setPosition(k,{x:h,y:m}),k):S[0]}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(0),o=i(8);(function(){a.create=function(l){var u={bodies:[],pairs:null};return s.extend(u,l)},a.setBodies=function(l,u){l.bodies=u.slice(0)},a.clear=function(l){l.bodies=[]},a.collisions=function(l){var u=[],c=l.pairs,h=l.bodies,m=h.length,d=a.canCollide,p=o.collides,g,x;for(h.sort(a._compareBoundsX),g=0;g<m;g++){var b=h[g],v=b.bounds,E=b.bounds.max.x,N=b.bounds.max.y,k=b.bounds.min.y,S=b.isStatic||b.isSleeping,_=b.parts.length,C=_===1;for(x=g+1;x<m;x++){var I=h[x],A=I.bounds;if(A.min.x>E)break;if(!(N<A.min.y||k>A.max.y)&&!(S&&(I.isStatic||I.isSleeping))&&d(b.collisionFilter,I.collisionFilter)){var R=I.parts.length;if(C&&R===1){var L=p(b,I,c);L&&u.push(L)}else for(var z=_>1?1:0,j=R>1?1:0,B=z;B<_;B++)for(var H=b.parts[B],v=H.bounds,Y=j;Y<R;Y++){var V=I.parts[Y],A=V.bounds;if(!(v.min.x>A.max.x||v.max.x<A.min.x||v.max.y<A.min.y||v.min.y>A.max.y)){var L=p(H,V,c);L&&u.push(L)}}}}}return u},a.canCollide=function(l,u){return l.group===u.group&&l.group!==0?l.group>0:(l.mask&u.category)!==0&&(u.mask&l.category)!==0},a._compareBoundsX=function(l,u){return l.bounds.min.x-u.bounds.min.x}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(0);(function(){a.create=function(o){var l={};return o||s.log("Mouse.create: element was undefined, defaulting to document.body","warn"),l.element=o||document.body,l.absolute={x:0,y:0},l.position={x:0,y:0},l.mousedownPosition={x:0,y:0},l.mouseupPosition={x:0,y:0},l.offset={x:0,y:0},l.scale={x:1,y:1},l.wheelDelta=0,l.button=-1,l.pixelRatio=parseInt(l.element.getAttribute("data-pixel-ratio"),10)||1,l.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},l.mousemove=function(u){var c=a._getRelativeMousePosition(u,l.element,l.pixelRatio),h=u.changedTouches;h&&(l.button=0,u.preventDefault()),l.absolute.x=c.x,l.absolute.y=c.y,l.position.x=l.absolute.x*l.scale.x+l.offset.x,l.position.y=l.absolute.y*l.scale.y+l.offset.y,l.sourceEvents.mousemove=u},l.mousedown=function(u){var c=a._getRelativeMousePosition(u,l.element,l.pixelRatio),h=u.changedTouches;h?(l.button=0,u.preventDefault()):l.button=u.button,l.absolute.x=c.x,l.absolute.y=c.y,l.position.x=l.absolute.x*l.scale.x+l.offset.x,l.position.y=l.absolute.y*l.scale.y+l.offset.y,l.mousedownPosition.x=l.position.x,l.mousedownPosition.y=l.position.y,l.sourceEvents.mousedown=u},l.mouseup=function(u){var c=a._getRelativeMousePosition(u,l.element,l.pixelRatio),h=u.changedTouches;h&&u.preventDefault(),l.button=-1,l.absolute.x=c.x,l.absolute.y=c.y,l.position.x=l.absolute.x*l.scale.x+l.offset.x,l.position.y=l.absolute.y*l.scale.y+l.offset.y,l.mouseupPosition.x=l.position.x,l.mouseupPosition.y=l.position.y,l.sourceEvents.mouseup=u},l.mousewheel=function(u){l.wheelDelta=Math.max(-1,Math.min(1,u.wheelDelta||-u.detail)),u.preventDefault()},a.setElement(l,l.element),l},a.setElement=function(o,l){o.element=l,l.addEventListener("mousemove",o.mousemove),l.addEventListener("mousedown",o.mousedown),l.addEventListener("mouseup",o.mouseup),l.addEventListener("mousewheel",o.mousewheel),l.addEventListener("DOMMouseScroll",o.mousewheel),l.addEventListener("touchmove",o.mousemove),l.addEventListener("touchstart",o.mousedown),l.addEventListener("touchend",o.mouseup)},a.clearSourceEvents=function(o){o.sourceEvents.mousemove=null,o.sourceEvents.mousedown=null,o.sourceEvents.mouseup=null,o.sourceEvents.mousewheel=null,o.wheelDelta=0},a.setOffset=function(o,l){o.offset.x=l.x,o.offset.y=l.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y},a.setScale=function(o,l){o.scale.x=l.x,o.scale.y=l.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y},a._getRelativeMousePosition=function(o,l,u){var c=l.getBoundingClientRect(),h=document.documentElement||document.body.parentNode||document.body,m=window.pageXOffset!==void 0?window.pageXOffset:h.scrollLeft,d=window.pageYOffset!==void 0?window.pageYOffset:h.scrollTop,p=o.changedTouches,g,x;return p?(g=p[0].pageX-c.left-m,x=p[0].pageY-c.top-d):(g=o.pageX-c.left-m,x=o.pageY-c.top-d),{x:g/(l.clientWidth/(l.width||l.clientWidth)*u),y:x/(l.clientHeight/(l.height||l.clientHeight)*u)}}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(0);(function(){a._registry={},a.register=function(o){if(a.isPlugin(o)||s.warn("Plugin.register:",a.toString(o),"does not implement all required fields."),o.name in a._registry){var l=a._registry[o.name],u=a.versionParse(o.version).number,c=a.versionParse(l.version).number;u>c?(s.warn("Plugin.register:",a.toString(l),"was upgraded to",a.toString(o)),a._registry[o.name]=o):u<c?s.warn("Plugin.register:",a.toString(l),"can not be downgraded to",a.toString(o)):o!==l&&s.warn("Plugin.register:",a.toString(o),"is already registered to different plugin object")}else a._registry[o.name]=o;return o},a.resolve=function(o){return a._registry[a.dependencyParse(o).name]},a.toString=function(o){return typeof o=="string"?o:(o.name||"anonymous")+"@"+(o.version||o.range||"0.0.0")},a.isPlugin=function(o){return o&&o.name&&o.version&&o.install},a.isUsed=function(o,l){return o.used.indexOf(l)>-1},a.isFor=function(o,l){var u=o.for&&a.dependencyParse(o.for);return!o.for||l.name===u.name&&a.versionSatisfies(l.version,u.range)},a.use=function(o,l){if(o.uses=(o.uses||[]).concat(l||[]),o.uses.length===0){s.warn("Plugin.use:",a.toString(o),"does not specify any dependencies to install.");return}for(var u=a.dependencies(o),c=s.topologicalSort(u),h=[],m=0;m<c.length;m+=1)if(c[m]!==o.name){var d=a.resolve(c[m]);if(!d){h.push("❌ "+c[m]);continue}a.isUsed(o,d.name)||(a.isFor(d,o)||(s.warn("Plugin.use:",a.toString(d),"is for",d.for,"but installed on",a.toString(o)+"."),d._warned=!0),d.install?d.install(o):(s.warn("Plugin.use:",a.toString(d),"does not specify an install function."),d._warned=!0),d._warned?(h.push("🔶 "+a.toString(d)),delete d._warned):h.push("✅ "+a.toString(d)),o.used.push(d.name))}h.length>0&&s.info(h.join(" "))},a.dependencies=function(o,l){var u=a.dependencyParse(o),c=u.name;if(l=l||{},!(c in l)){o=a.resolve(o)||o,l[c]=s.map(o.uses||[],function(m){a.isPlugin(m)&&a.register(m);var d=a.dependencyParse(m),p=a.resolve(m);return p&&!a.versionSatisfies(p.version,d.range)?(s.warn("Plugin.dependencies:",a.toString(p),"does not satisfy",a.toString(d),"used by",a.toString(u)+"."),p._warned=!0,o._warned=!0):p||(s.warn("Plugin.dependencies:",a.toString(m),"used by",a.toString(u),"could not be resolved."),o._warned=!0),d.name});for(var h=0;h<l[c].length;h+=1)a.dependencies(l[c][h],l);return l}},a.dependencyParse=function(o){if(s.isString(o)){var l=/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/;return l.test(o)||s.warn("Plugin.dependencyParse:",o,"is not a valid dependency string."),{name:o.split("@")[0],range:o.split("@")[1]||"*"}}return{name:o.name,range:o.range||o.version}},a.versionParse=function(o){var l=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;l.test(o)||s.warn("Plugin.versionParse:",o,"is not a valid version or range.");var u=l.exec(o),c=Number(u[4]),h=Number(u[5]),m=Number(u[6]);return{isRange:!!(u[1]||u[2]),version:u[3],range:o,operator:u[1]||u[2]||"",major:c,minor:h,patch:m,parts:[c,h,m],prerelease:u[7],number:c*1e8+h*1e4+m}},a.versionSatisfies=function(o,l){l=l||"*";var u=a.versionParse(l),c=a.versionParse(o);if(u.isRange){if(u.operator==="*"||o==="*")return!0;if(u.operator===">")return c.number>u.number;if(u.operator===">=")return c.number>=u.number;if(u.operator==="~")return c.major===u.major&&c.minor===u.minor&&c.patch>=u.patch;if(u.operator==="^")return u.major>0?c.major===u.major&&c.number>=u.number:u.minor>0?c.minor===u.minor&&c.patch>=u.patch:c.patch===u.patch}return o===l||o==="*"}})()}),(function(n,r){var i={};n.exports=i,(function(){i.create=function(a){return{vertex:a,normalImpulse:0,tangentImpulse:0}}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(7),o=i(18),l=i(13),u=i(19),c=i(5),h=i(6),m=i(10),d=i(0),p=i(4);(function(){a.create=function(g){g=g||{};var x={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},b=d.extend(x,g);return b.world=g.world||h.create({label:"World"}),b.pairs=g.pairs||u.create(),b.detector=g.detector||l.create(),b.grid={buckets:[]},b.world.gravity=b.gravity,b.broadphase=b.grid,b.metrics={},b},a.update=function(g,x){var b=d.now(),v=g.world,E=g.detector,N=g.pairs,k=g.timing,S=k.timestamp,_;x=typeof x<"u"?x:d._baseDelta,x*=k.timeScale,k.timestamp+=x,k.lastDelta=x;var C={timestamp:k.timestamp,delta:x};c.trigger(g,"beforeUpdate",C);var I=h.allBodies(v),A=h.allConstraints(v);for(v.isModified&&(l.setBodies(E,I),h.setModified(v,!1,!1,!0)),g.enableSleeping&&s.update(I,x),a._bodiesApplyGravity(I,g.gravity),x>0&&a._bodiesUpdate(I,x),m.preSolveAll(I),_=0;_<g.constraintIterations;_++)m.solveAll(A,x);m.postSolveAll(I),E.pairs=g.pairs;var R=l.collisions(E);u.update(N,R,S),g.enableSleeping&&s.afterCollisions(N.list),N.collisionStart.length>0&&c.trigger(g,"collisionStart",{pairs:N.collisionStart});var L=d.clamp(20/g.positionIterations,0,1);for(o.preSolvePosition(N.list),_=0;_<g.positionIterations;_++)o.solvePosition(N.list,x,L);for(o.postSolvePosition(I),m.preSolveAll(I),_=0;_<g.constraintIterations;_++)m.solveAll(A,x);for(m.postSolveAll(I),o.preSolveVelocity(N.list),_=0;_<g.velocityIterations;_++)o.solveVelocity(N.list,x);return a._bodiesUpdateVelocities(I),N.collisionActive.length>0&&c.trigger(g,"collisionActive",{pairs:N.collisionActive}),N.collisionEnd.length>0&&c.trigger(g,"collisionEnd",{pairs:N.collisionEnd}),a._bodiesClearForces(I),c.trigger(g,"afterUpdate",C),g.timing.lastElapsed=d.now()-b,g},a.merge=function(g,x){if(d.extend(g,x),x.world){g.world=x.world,a.clear(g);for(var b=h.allBodies(g.world),v=0;v<b.length;v++){var E=b[v];s.set(E,!1),E.id=d.nextId()}}},a.clear=function(g){u.clear(g.pairs),l.clear(g.detector)},a._bodiesClearForces=function(g){for(var x=g.length,b=0;b<x;b++){var v=g[b];v.force.x=0,v.force.y=0,v.torque=0}},a._bodiesApplyGravity=function(g,x){var b=typeof x.scale<"u"?x.scale:.001,v=g.length;if(!(x.x===0&&x.y===0||b===0))for(var E=0;E<v;E++){var N=g[E];N.isStatic||N.isSleeping||(N.force.y+=N.mass*x.y*b,N.force.x+=N.mass*x.x*b)}},a._bodiesUpdate=function(g,x){for(var b=g.length,v=0;v<b;v++){var E=g[v];E.isStatic||E.isSleeping||p.update(E,x)}},a._bodiesUpdateVelocities=function(g){for(var x=g.length,b=0;b<x;b++)p.updateVelocities(g[b])}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(3),o=i(0),l=i(1);(function(){a._restingThresh=2,a._restingThreshTangent=Math.sqrt(6),a._positionDampen=.9,a._positionWarming=.8,a._frictionNormalMultiplier=5,a._frictionMaxStatic=Number.MAX_VALUE,a.preSolvePosition=function(u){var c,h,m,d=u.length;for(c=0;c<d;c++)h=u[c],h.isActive&&(m=h.activeContacts.length,h.collision.parentA.totalContacts+=m,h.collision.parentB.totalContacts+=m)},a.solvePosition=function(u,c,h){var m,d,p,g,x,b,v,E,N=a._positionDampen*(h||1),k=o.clamp(c/o._baseDelta,0,1),S=u.length;for(m=0;m<S;m++)d=u[m],!(!d.isActive||d.isSensor)&&(p=d.collision,g=p.parentA,x=p.parentB,b=p.normal,d.separation=b.x*(x.positionImpulse.x+p.penetration.x-g.positionImpulse.x)+b.y*(x.positionImpulse.y+p.penetration.y-g.positionImpulse.y));for(m=0;m<S;m++)d=u[m],!(!d.isActive||d.isSensor)&&(p=d.collision,g=p.parentA,x=p.parentB,b=p.normal,E=d.separation-d.slop*k,(g.isStatic||x.isStatic)&&(E*=2),g.isStatic||g.isSleeping||(v=N/g.totalContacts,g.positionImpulse.x+=b.x*E*v,g.positionImpulse.y+=b.y*E*v),x.isStatic||x.isSleeping||(v=N/x.totalContacts,x.positionImpulse.x-=b.x*E*v,x.positionImpulse.y-=b.y*E*v))},a.postSolvePosition=function(u){for(var c=a._positionWarming,h=u.length,m=s.translate,d=l.update,p=0;p<h;p++){var g=u[p],x=g.positionImpulse,b=x.x,v=x.y,E=g.velocity;if(g.totalContacts=0,b!==0||v!==0){for(var N=0;N<g.parts.length;N++){var k=g.parts[N];m(k.vertices,x),d(k.bounds,k.vertices,E),k.position.x+=b,k.position.y+=v}g.positionPrev.x+=b,g.positionPrev.y+=v,b*E.x+v*E.y<0?(x.x=0,x.y=0):(x.x*=c,x.y*=c)}}},a.preSolveVelocity=function(u){var c=u.length,h,m;for(h=0;h<c;h++){var d=u[h];if(!(!d.isActive||d.isSensor)){var p=d.activeContacts,g=p.length,x=d.collision,b=x.parentA,v=x.parentB,E=x.normal,N=x.tangent;for(m=0;m<g;m++){var k=p[m],S=k.vertex,_=k.normalImpulse,C=k.tangentImpulse;if(_!==0||C!==0){var I=E.x*_+N.x*C,A=E.y*_+N.y*C;b.isStatic||b.isSleeping||(b.positionPrev.x+=I*b.inverseMass,b.positionPrev.y+=A*b.inverseMass,b.anglePrev+=b.inverseInertia*((S.x-b.position.x)*A-(S.y-b.position.y)*I)),v.isStatic||v.isSleeping||(v.positionPrev.x-=I*v.inverseMass,v.positionPrev.y-=A*v.inverseMass,v.anglePrev-=v.inverseInertia*((S.x-v.position.x)*A-(S.y-v.position.y)*I))}}}}},a.solveVelocity=function(u,c){var h=c/o._baseDelta,m=h*h,d=m*h,p=-a._restingThresh*h,g=a._restingThreshTangent,x=a._frictionNormalMultiplier*h,b=a._frictionMaxStatic,v=u.length,E,N,k,S;for(k=0;k<v;k++){var _=u[k];if(!(!_.isActive||_.isSensor)){var C=_.collision,I=C.parentA,A=C.parentB,R=I.velocity,L=A.velocity,z=C.normal.x,j=C.normal.y,B=C.tangent.x,H=C.tangent.y,Y=_.activeContacts,V=Y.length,Z=1/V,O=I.inverseMass+A.inverseMass,X=_.friction*_.frictionStatic*x;for(R.x=I.position.x-I.positionPrev.x,R.y=I.position.y-I.positionPrev.y,L.x=A.position.x-A.positionPrev.x,L.y=A.position.y-A.positionPrev.y,I.angularVelocity=I.angle-I.anglePrev,A.angularVelocity=A.angle-A.anglePrev,S=0;S<V;S++){var ne=Y[S],P=ne.vertex,te=P.x-I.position.x,Q=P.y-I.position.y,K=P.x-A.position.x,ce=P.y-A.position.y,le=R.x-Q*I.angularVelocity,ee=R.y+te*I.angularVelocity,Ce=L.x-ce*A.angularVelocity,de=L.y+K*A.angularVelocity,he=le-Ce,pe=ee-de,Ne=z*he+j*pe,Oe=B*he+H*pe,ot=_.separation+Ne,Be=Math.min(ot,1);Be=ot<0?0:Be;var ct=Be*X;Oe<-ct||Oe>ct?(N=Oe>0?Oe:-Oe,E=_.friction*(Oe>0?1:-1)*d,E<-N?E=-N:E>N&&(E=N)):(E=Oe,N=b);var me=te*j-Q*z,Ue=K*j-ce*z,dt=Z/(O+I.inverseInertia*me*me+A.inverseInertia*Ue*Ue),nt=(1+_.restitution)*Ne*dt;if(E*=dt,Ne<p)ne.normalImpulse=0;else{var mt=ne.normalImpulse;ne.normalImpulse+=nt,ne.normalImpulse>0&&(ne.normalImpulse=0),nt=ne.normalImpulse-mt}if(Oe<-g||Oe>g)ne.tangentImpulse=0;else{var Qe=ne.tangentImpulse;ne.tangentImpulse+=E,ne.tangentImpulse<-N&&(ne.tangentImpulse=-N),ne.tangentImpulse>N&&(ne.tangentImpulse=N),E=ne.tangentImpulse-Qe}var Pe=z*nt+B*E,oe=j*nt+H*E;I.isStatic||I.isSleeping||(I.positionPrev.x+=Pe*I.inverseMass,I.positionPrev.y+=oe*I.inverseMass,I.anglePrev+=(te*oe-Q*Pe)*I.inverseInertia),A.isStatic||A.isSleeping||(A.positionPrev.x-=Pe*A.inverseMass,A.positionPrev.y-=oe*A.inverseMass,A.anglePrev-=(K*oe-ce*Pe)*A.inverseInertia)}}}}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(9),o=i(0);(function(){a.create=function(l){return o.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},l)},a.update=function(l,u,c){var h=l.list,m=h.length,d=l.table,p=u.length,g=l.collisionStart,x=l.collisionEnd,b=l.collisionActive,v,E,N,k;for(g.length=0,x.length=0,b.length=0,k=0;k<m;k++)h[k].confirmedActive=!1;for(k=0;k<p;k++)v=u[k],N=v.pair,N?(N.isActive?b.push(N):g.push(N),s.update(N,v,c),N.confirmedActive=!0):(N=s.create(v,c),d[N.id]=N,g.push(N),h.push(N));var S=[];for(m=h.length,k=0;k<m;k++)N=h[k],N.confirmedActive||(s.setActive(N,!1,c),x.push(N),!N.collision.bodyA.isSleeping&&!N.collision.bodyB.isSleeping&&S.push(k));for(k=0;k<S.length;k++)E=S[k]-k,N=h[E],h.splice(E,1),delete d[N.id]},a.clear=function(l){return l.table={},l.list.length=0,l.collisionStart.length=0,l.collisionActive.length=0,l.collisionEnd.length=0,l}})()}),(function(n,r,i){var a=n.exports=i(21);a.Axes=i(11),a.Bodies=i(12),a.Body=i(4),a.Bounds=i(1),a.Collision=i(8),a.Common=i(0),a.Composite=i(6),a.Composites=i(22),a.Constraint=i(10),a.Contact=i(16),a.Detector=i(13),a.Engine=i(17),a.Events=i(5),a.Grid=i(23),a.Mouse=i(14),a.MouseConstraint=i(24),a.Pair=i(9),a.Pairs=i(19),a.Plugin=i(15),a.Query=i(25),a.Render=i(26),a.Resolver=i(18),a.Runner=i(27),a.SAT=i(28),a.Sleeping=i(7),a.Svg=i(29),a.Vector=i(2),a.Vertices=i(3),a.World=i(30),a.Engine.run=a.Runner.run,a.Common.deprecated(a.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")}),(function(n,r,i){var a={};n.exports=a;var s=i(15),o=i(0);(function(){a.name="matter-js",a.version="0.19.0",a.uses=[],a.used=[],a.use=function(){s.use(a,Array.prototype.slice.call(arguments))},a.before=function(l,u){return l=l.replace(/^Matter./,""),o.chainPathBefore(a,l,u)},a.after=function(l,u){return l=l.replace(/^Matter./,""),o.chainPathAfter(a,l,u)}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(6),o=i(10),l=i(0),u=i(4),c=i(12),h=l.deprecated;(function(){a.stack=function(m,d,p,g,x,b,v){for(var E=s.create({label:"Stack"}),N=m,k=d,S,_=0,C=0;C<g;C++){for(var I=0,A=0;A<p;A++){var R=v(N,k,A,C,S,_);if(R){var L=R.bounds.max.y-R.bounds.min.y,z=R.bounds.max.x-R.bounds.min.x;L>I&&(I=L),u.translate(R,{x:z*.5,y:L*.5}),N=R.bounds.max.x+x,s.addBody(E,R),S=R,_+=1}else N+=x}k+=I+b,N=m}return E},a.chain=function(m,d,p,g,x,b){for(var v=m.bodies,E=1;E<v.length;E++){var N=v[E-1],k=v[E],S=N.bounds.max.y-N.bounds.min.y,_=N.bounds.max.x-N.bounds.min.x,C=k.bounds.max.y-k.bounds.min.y,I=k.bounds.max.x-k.bounds.min.x,A={bodyA:N,pointA:{x:_*d,y:S*p},bodyB:k,pointB:{x:I*g,y:C*x}},R=l.extend(A,b);s.addConstraint(m,o.create(R))}return m.label+=" Chain",m},a.mesh=function(m,d,p,g,x){var b=m.bodies,v,E,N,k,S;for(v=0;v<p;v++){for(E=1;E<d;E++)N=b[E-1+v*d],k=b[E+v*d],s.addConstraint(m,o.create(l.extend({bodyA:N,bodyB:k},x)));if(v>0)for(E=0;E<d;E++)N=b[E+(v-1)*d],k=b[E+v*d],s.addConstraint(m,o.create(l.extend({bodyA:N,bodyB:k},x))),g&&E>0&&(S=b[E-1+(v-1)*d],s.addConstraint(m,o.create(l.extend({bodyA:S,bodyB:k},x)))),g&&E<d-1&&(S=b[E+1+(v-1)*d],s.addConstraint(m,o.create(l.extend({bodyA:S,bodyB:k},x))))}return m.label+=" Mesh",m},a.pyramid=function(m,d,p,g,x,b,v){return a.stack(m,d,p,g,x,b,function(E,N,k,S,_,C){var I=Math.min(g,Math.ceil(p/2)),A=_?_.bounds.max.x-_.bounds.min.x:0;if(!(S>I)){S=I-S;var R=S,L=p-1-S;if(!(k<R||k>L)){C===1&&u.translate(_,{x:(k+(p%2===1?1:-1))*A,y:0});var z=_?k*A:0;return v(m+z+k*x,N,k,S,_,C)}}})},a.newtonsCradle=function(m,d,p,g,x){for(var b=s.create({label:"Newtons Cradle"}),v=0;v<p;v++){var E=1.9,N=c.circle(m+v*(g*E),d+x,g,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),k=o.create({pointA:{x:m+v*(g*E),y:d},bodyB:N});s.addBody(b,N),s.addConstraint(b,k)}return b},h(a,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),a.car=function(m,d,p,g,x){var b=u.nextGroup(!0),v=20,E=-p*.5+v,N=p*.5-v,k=0,S=s.create({label:"Car"}),_=c.rectangle(m,d,p,g,{collisionFilter:{group:b},chamfer:{radius:g*.5},density:2e-4}),C=c.circle(m+E,d+k,x,{collisionFilter:{group:b},friction:.8}),I=c.circle(m+N,d+k,x,{collisionFilter:{group:b},friction:.8}),A=o.create({bodyB:_,pointB:{x:E,y:k},bodyA:C,stiffness:1,length:0}),R=o.create({bodyB:_,pointB:{x:N,y:k},bodyA:I,stiffness:1,length:0});return s.addBody(S,_),s.addBody(S,C),s.addBody(S,I),s.addConstraint(S,A),s.addConstraint(S,R),S},h(a,"car","Composites.car ➤ moved to car example"),a.softBody=function(m,d,p,g,x,b,v,E,N,k){N=l.extend({inertia:1/0},N),k=l.extend({stiffness:.2,render:{type:"line",anchors:!1}},k);var S=a.stack(m,d,p,g,x,b,function(_,C){return c.circle(_,C,E,N)});return a.mesh(S,p,g,v,k),S.label="Soft Body",S},h(a,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")})()}),(function(n,r,i){var a={};n.exports=a;var s=i(9),o=i(0),l=o.deprecated;(function(){a.create=function(u){var c={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(c,u)},a.update=function(u,c,h,m){var d,p,g,x=h.world,b=u.buckets,v,E,N=!1;for(d=0;d<c.length;d++){var k=c[d];if(!(k.isSleeping&&!m)&&!(x.bounds&&(k.bounds.max.x<x.bounds.min.x||k.bounds.min.x>x.bounds.max.x||k.bounds.max.y<x.bounds.min.y||k.bounds.min.y>x.bounds.max.y))){var S=a._getRegion(u,k);if(!k.region||S.id!==k.region.id||m){(!k.region||m)&&(k.region=S);var _=a._regionUnion(S,k.region);for(p=_.startCol;p<=_.endCol;p++)for(g=_.startRow;g<=_.endRow;g++){E=a._getBucketId(p,g),v=b[E];var C=p>=S.startCol&&p<=S.endCol&&g>=S.startRow&&g<=S.endRow,I=p>=k.region.startCol&&p<=k.region.endCol&&g>=k.region.startRow&&g<=k.region.endRow;!C&&I&&I&&v&&a._bucketRemoveBody(u,v,k),(k.region===S||C&&!I||m)&&(v||(v=a._createBucket(b,E)),a._bucketAddBody(u,v,k))}k.region=S,N=!0}}}N&&(u.pairsList=a._createActivePairsList(u))},l(a,"update","Grid.update ➤ replaced by Matter.Detector"),a.clear=function(u){u.buckets={},u.pairs={},u.pairsList=[]},l(a,"clear","Grid.clear ➤ replaced by Matter.Detector"),a._regionUnion=function(u,c){var h=Math.min(u.startCol,c.startCol),m=Math.max(u.endCol,c.endCol),d=Math.min(u.startRow,c.startRow),p=Math.max(u.endRow,c.endRow);return a._createRegion(h,m,d,p)},a._getRegion=function(u,c){var h=c.bounds,m=Math.floor(h.min.x/u.bucketWidth),d=Math.floor(h.max.x/u.bucketWidth),p=Math.floor(h.min.y/u.bucketHeight),g=Math.floor(h.max.y/u.bucketHeight);return a._createRegion(m,d,p,g)},a._createRegion=function(u,c,h,m){return{id:u+","+c+","+h+","+m,startCol:u,endCol:c,startRow:h,endRow:m}},a._getBucketId=function(u,c){return"C"+u+"R"+c},a._createBucket=function(u,c){var h=u[c]=[];return h},a._bucketAddBody=function(u,c,h){var m=u.pairs,d=s.id,p=c.length,g;for(g=0;g<p;g++){var x=c[g];if(!(h.id===x.id||h.isStatic&&x.isStatic)){var b=d(h,x),v=m[b];v?v[2]+=1:m[b]=[h,x,1]}}c.push(h)},a._bucketRemoveBody=function(u,c,h){var m=u.pairs,d=s.id,p;c.splice(o.indexOf(c,h),1);var g=c.length;for(p=0;p<g;p++){var x=m[d(h,c[p])];x&&(x[2]-=1)}},a._createActivePairsList=function(u){var c,h=u.pairs,m=o.keys(h),d=m.length,p=[],g;for(g=0;g<d;g++)c=h[m[g]],c[2]>0?p.push(c):delete h[m[g]];return p}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(3),o=i(7),l=i(14),u=i(5),c=i(13),h=i(10),m=i(6),d=i(0),p=i(1);(function(){a.create=function(g,x){var b=(g?g.mouse:null)||(x?x.mouse:null);b||(g&&g.render&&g.render.canvas?b=l.create(g.render.canvas):x&&x.element?b=l.create(x.element):(b=l.create(),d.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var v=h.create({label:"Mouse Constraint",pointA:b.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),E={type:"mouseConstraint",mouse:b,element:null,body:null,constraint:v,collisionFilter:{category:1,mask:4294967295,group:0}},N=d.extend(E,x);return u.on(g,"beforeUpdate",function(){var k=m.allBodies(g.world);a.update(N,k),a._triggerEvents(N)}),N},a.update=function(g,x){var b=g.mouse,v=g.constraint,E=g.body;if(b.button===0){if(v.bodyB)o.set(v.bodyB,!1),v.pointA=b.position;else for(var N=0;N<x.length;N++)if(E=x[N],p.contains(E.bounds,b.position)&&c.canCollide(E.collisionFilter,g.collisionFilter))for(var k=E.parts.length>1?1:0;k<E.parts.length;k++){var S=E.parts[k];if(s.contains(S.vertices,b.position)){v.pointA=b.position,v.bodyB=g.body=E,v.pointB={x:b.position.x-E.position.x,y:b.position.y-E.position.y},v.angleB=E.angle,o.set(E,!1),u.trigger(g,"startdrag",{mouse:b,body:E});break}}}else v.bodyB=g.body=null,v.pointB=null,E&&u.trigger(g,"enddrag",{mouse:b,body:E})},a._triggerEvents=function(g){var x=g.mouse,b=x.sourceEvents;b.mousemove&&u.trigger(g,"mousemove",{mouse:x}),b.mousedown&&u.trigger(g,"mousedown",{mouse:x}),b.mouseup&&u.trigger(g,"mouseup",{mouse:x}),l.clearSourceEvents(x)}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(2),o=i(8),l=i(1),u=i(12),c=i(3);(function(){a.collides=function(h,m){for(var d=[],p=m.length,g=h.bounds,x=o.collides,b=l.overlaps,v=0;v<p;v++){var E=m[v],N=E.parts.length,k=N===1?0:1;if(b(E.bounds,g))for(var S=k;S<N;S++){var _=E.parts[S];if(b(_.bounds,g)){var C=x(_,h);if(C){d.push(C);break}}}}return d},a.ray=function(h,m,d,p){p=p||1e-100;for(var g=s.angle(m,d),x=s.magnitude(s.sub(m,d)),b=(d.x+m.x)*.5,v=(d.y+m.y)*.5,E=u.rectangle(b,v,x,p,{angle:g}),N=a.collides(E,h),k=0;k<N.length;k+=1){var S=N[k];S.body=S.bodyB=S.bodyA}return N},a.region=function(h,m,d){for(var p=[],g=0;g<h.length;g++){var x=h[g],b=l.overlaps(x.bounds,m);(b&&!d||!b&&d)&&p.push(x)}return p},a.point=function(h,m){for(var d=[],p=0;p<h.length;p++){var g=h[p];if(l.contains(g.bounds,m))for(var x=g.parts.length===1?0:1;x<g.parts.length;x++){var b=g.parts[x];if(l.contains(b.bounds,m)&&c.contains(b.vertices,m)){d.push(g);break}}}return d}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(4),o=i(0),l=i(6),u=i(1),c=i(5),h=i(2),m=i(14);(function(){var d,p;typeof window<"u"&&(d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(k){window.setTimeout(function(){k(o.now())},1e3/60)},p=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),a._goodFps=30,a._goodDelta=1e3/60,a.create=function(k){var S={engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,timing:{historySize:60,delta:0,deltaHistory:[],lastTime:0,lastTimestamp:0,lastElapsed:0,timestampElapsed:0,timestampElapsedHistory:[],engineDeltaHistory:[],engineElapsedHistory:[],elapsedHistory:[]},options:{width:800,height:600,pixelRatio:1,background:"#14151f",wireframeBackground:"#14151f",hasBounds:!!k.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},_=o.extend(S,k);return _.canvas&&(_.canvas.width=_.options.width||_.canvas.width,_.canvas.height=_.options.height||_.canvas.height),_.mouse=k.mouse,_.engine=k.engine,_.canvas=_.canvas||b(_.options.width,_.options.height),_.context=_.canvas.getContext("2d"),_.textures={},_.bounds=_.bounds||{min:{x:0,y:0},max:{x:_.canvas.width,y:_.canvas.height}},_.controller=a,_.options.showBroadphase=!1,_.options.pixelRatio!==1&&a.setPixelRatio(_,_.options.pixelRatio),o.isElement(_.element)&&_.element.appendChild(_.canvas),_},a.run=function(k){(function S(_){k.frameRequestId=d(S),g(k,_),a.world(k,_),(k.options.showStats||k.options.showDebug)&&a.stats(k,k.context,_),(k.options.showPerformance||k.options.showDebug)&&a.performance(k,k.context,_)})()},a.stop=function(k){p(k.frameRequestId)},a.setPixelRatio=function(k,S){var _=k.options,C=k.canvas;S==="auto"&&(S=v(C)),_.pixelRatio=S,C.setAttribute("data-pixel-ratio",S),C.width=_.width*S,C.height=_.height*S,C.style.width=_.width+"px",C.style.height=_.height+"px"},a.lookAt=function(k,S,_,C){C=typeof C<"u"?C:!0,S=o.isArray(S)?S:[S],_=_||{x:0,y:0};for(var I={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},A=0;A<S.length;A+=1){var R=S[A],L=R.bounds?R.bounds.min:R.min||R.position||R,z=R.bounds?R.bounds.max:R.max||R.position||R;L&&z&&(L.x<I.min.x&&(I.min.x=L.x),z.x>I.max.x&&(I.max.x=z.x),L.y<I.min.y&&(I.min.y=L.y),z.y>I.max.y&&(I.max.y=z.y))}var j=I.max.x-I.min.x+2*_.x,B=I.max.y-I.min.y+2*_.y,H=k.canvas.height,Y=k.canvas.width,V=Y/H,Z=j/B,O=1,X=1;Z>V?X=Z/V:O=V/Z,k.options.hasBounds=!0,k.bounds.min.x=I.min.x,k.bounds.max.x=I.min.x+j*O,k.bounds.min.y=I.min.y,k.bounds.max.y=I.min.y+B*X,C&&(k.bounds.min.x+=j*.5-j*O*.5,k.bounds.max.x+=j*.5-j*O*.5,k.bounds.min.y+=B*.5-B*X*.5,k.bounds.max.y+=B*.5-B*X*.5),k.bounds.min.x-=_.x,k.bounds.max.x-=_.x,k.bounds.min.y-=_.y,k.bounds.max.y-=_.y,k.mouse&&(m.setScale(k.mouse,{x:(k.bounds.max.x-k.bounds.min.x)/k.canvas.width,y:(k.bounds.max.y-k.bounds.min.y)/k.canvas.height}),m.setOffset(k.mouse,k.bounds.min))},a.startViewTransform=function(k){var S=k.bounds.max.x-k.bounds.min.x,_=k.bounds.max.y-k.bounds.min.y,C=S/k.options.width,I=_/k.options.height;k.context.setTransform(k.options.pixelRatio/C,0,0,k.options.pixelRatio/I,0,0),k.context.translate(-k.bounds.min.x,-k.bounds.min.y)},a.endViewTransform=function(k){k.context.setTransform(k.options.pixelRatio,0,0,k.options.pixelRatio,0,0)},a.world=function(k,S){var _=o.now(),C=k.engine,I=C.world,A=k.canvas,R=k.context,L=k.options,z=k.timing,j=l.allBodies(I),B=l.allConstraints(I),H=L.wireframes?L.wireframeBackground:L.background,Y=[],V=[],Z,O={timestamp:C.timing.timestamp};if(c.trigger(k,"beforeRender",O),k.currentBackground!==H&&N(k,H),R.globalCompositeOperation="source-in",R.fillStyle="transparent",R.fillRect(0,0,A.width,A.height),R.globalCompositeOperation="source-over",L.hasBounds){for(Z=0;Z<j.length;Z++){var X=j[Z];u.overlaps(X.bounds,k.bounds)&&Y.push(X)}for(Z=0;Z<B.length;Z++){var ne=B[Z],P=ne.bodyA,te=ne.bodyB,Q=ne.pointA,K=ne.pointB;P&&(Q=h.add(P.position,ne.pointA)),te&&(K=h.add(te.position,ne.pointB)),!(!Q||!K)&&(u.contains(k.bounds,Q)||u.contains(k.bounds,K))&&V.push(ne)}a.startViewTransform(k),k.mouse&&(m.setScale(k.mouse,{x:(k.bounds.max.x-k.bounds.min.x)/k.options.width,y:(k.bounds.max.y-k.bounds.min.y)/k.options.height}),m.setOffset(k.mouse,k.bounds.min))}else V=B,Y=j,k.options.pixelRatio!==1&&k.context.setTransform(k.options.pixelRatio,0,0,k.options.pixelRatio,0,0);!L.wireframes||C.enableSleeping&&L.showSleeping?a.bodies(k,Y,R):(L.showConvexHulls&&a.bodyConvexHulls(k,Y,R),a.bodyWireframes(k,Y,R)),L.showBounds&&a.bodyBounds(k,Y,R),(L.showAxes||L.showAngleIndicator)&&a.bodyAxes(k,Y,R),L.showPositions&&a.bodyPositions(k,Y,R),L.showVelocity&&a.bodyVelocity(k,Y,R),L.showIds&&a.bodyIds(k,Y,R),L.showSeparations&&a.separations(k,C.pairs.list,R),L.showCollisions&&a.collisions(k,C.pairs.list,R),L.showVertexNumbers&&a.vertexNumbers(k,Y,R),L.showMousePosition&&a.mousePosition(k,k.mouse,R),a.constraints(V,R),L.hasBounds&&a.endViewTransform(k),c.trigger(k,"afterRender",O),z.lastElapsed=o.now()-_},a.stats=function(k,S,_){for(var C=k.engine,I=C.world,A=l.allBodies(I),R=0,L=55,z=44,j=0,B=0,H=0;H<A.length;H+=1)R+=A[H].parts.length;var Y={Part:R,Body:A.length,Cons:l.allConstraints(I).length,Comp:l.allComposites(I).length,Pair:C.pairs.list.length};S.fillStyle="#0e0f19",S.fillRect(j,B,L*5.5,z),S.font="12px Arial",S.textBaseline="top",S.textAlign="right";for(var V in Y){var Z=Y[V];S.fillStyle="#aaa",S.fillText(V,j+L,B+8),S.fillStyle="#eee",S.fillText(Z,j+L,B+26),j+=L}},a.performance=function(k,S){var _=k.engine,C=k.timing,I=C.deltaHistory,A=C.elapsedHistory,R=C.timestampElapsedHistory,L=C.engineDeltaHistory,z=C.engineElapsedHistory,j=_.timing.lastDelta,B=x(I),H=x(A),Y=x(L),V=x(z),Z=x(R),O=Z/B||0,X=1e3/B||0,ne=4,P=12,te=60,Q=34,K=10,ce=69;S.fillStyle="#0e0f19",S.fillRect(0,50,P*4+te*5+22,Q),a.status(S,K,ce,te,ne,I.length,Math.round(X)+" fps",X/a._goodFps,function(le){return I[le]/B-1}),a.status(S,K+P+te,ce,te,ne,L.length,j.toFixed(2)+" dt",a._goodDelta/j,function(le){return L[le]/Y-1}),a.status(S,K+(P+te)*2,ce,te,ne,z.length,V.toFixed(2)+" ut",1-V/a._goodFps,function(le){return z[le]/V-1}),a.status(S,K+(P+te)*3,ce,te,ne,A.length,H.toFixed(2)+" rt",1-H/a._goodFps,function(le){return A[le]/H-1}),a.status(S,K+(P+te)*4,ce,te,ne,R.length,O.toFixed(2)+" x",O*O*O,function(le){return(R[le]/I[le]/O||0)-1})},a.status=function(k,S,_,C,I,A,R,L,z){k.strokeStyle="#888",k.fillStyle="#444",k.lineWidth=1,k.fillRect(S,_+7,C,1),k.beginPath(),k.moveTo(S,_+7-I*o.clamp(.4*z(0),-2,2));for(var j=0;j<C;j+=1)k.lineTo(S+j,_+7-(j<A?I*o.clamp(.4*z(j),-2,2):0));k.stroke(),k.fillStyle="hsl("+o.clamp(25+95*L,0,120)+",100%,60%)",k.fillRect(S,_-7,4,4),k.font="12px Arial",k.textBaseline="middle",k.textAlign="right",k.fillStyle="#eee",k.fillText(R,S+C,_-5)},a.constraints=function(k,S){for(var _=S,C=0;C<k.length;C++){var I=k[C];if(!(!I.render.visible||!I.pointA||!I.pointB)){var A=I.bodyA,R=I.bodyB,L,z;if(A?L=h.add(A.position,I.pointA):L=I.pointA,I.render.type==="pin")_.beginPath(),_.arc(L.x,L.y,3,0,2*Math.PI),_.closePath();else{if(R?z=h.add(R.position,I.pointB):z=I.pointB,_.beginPath(),_.moveTo(L.x,L.y),I.render.type==="spring")for(var j=h.sub(z,L),B=h.perp(h.normalise(j)),H=Math.ceil(o.clamp(I.length/5,12,20)),Y,V=1;V<H;V+=1)Y=V%2===0?1:-1,_.lineTo(L.x+j.x*(V/H)+B.x*Y*4,L.y+j.y*(V/H)+B.y*Y*4);_.lineTo(z.x,z.y)}I.render.lineWidth&&(_.lineWidth=I.render.lineWidth,_.strokeStyle=I.render.strokeStyle,_.stroke()),I.render.anchors&&(_.fillStyle=I.render.strokeStyle,_.beginPath(),_.arc(L.x,L.y,3,0,2*Math.PI),_.arc(z.x,z.y,3,0,2*Math.PI),_.closePath(),_.fill())}}},a.bodies=function(k,S,_){var C=_;k.engine;var I=k.options,A=I.showInternalEdges||!I.wireframes,R,L,z,j;for(z=0;z<S.length;z++)if(R=S[z],!!R.render.visible){for(j=R.parts.length>1?1:0;j<R.parts.length;j++)if(L=R.parts[j],!!L.render.visible){if(I.showSleeping&&R.isSleeping?C.globalAlpha=.5*L.render.opacity:L.render.opacity!==1&&(C.globalAlpha=L.render.opacity),L.render.sprite&&L.render.sprite.texture&&!I.wireframes){var B=L.render.sprite,H=E(k,B.texture);C.translate(L.position.x,L.position.y),C.rotate(L.angle),C.drawImage(H,H.width*-B.xOffset*B.xScale,H.height*-B.yOffset*B.yScale,H.width*B.xScale,H.height*B.yScale),C.rotate(-L.angle),C.translate(-L.position.x,-L.position.y)}else{if(L.circleRadius)C.beginPath(),C.arc(L.position.x,L.position.y,L.circleRadius,0,2*Math.PI);else{C.beginPath(),C.moveTo(L.vertices[0].x,L.vertices[0].y);for(var Y=1;Y<L.vertices.length;Y++)!L.vertices[Y-1].isInternal||A?C.lineTo(L.vertices[Y].x,L.vertices[Y].y):C.moveTo(L.vertices[Y].x,L.vertices[Y].y),L.vertices[Y].isInternal&&!A&&C.moveTo(L.vertices[(Y+1)%L.vertices.length].x,L.vertices[(Y+1)%L.vertices.length].y);C.lineTo(L.vertices[0].x,L.vertices[0].y),C.closePath()}I.wireframes?(C.lineWidth=1,C.strokeStyle="#bbb",C.stroke()):(C.fillStyle=L.render.fillStyle,L.render.lineWidth&&(C.lineWidth=L.render.lineWidth,C.strokeStyle=L.render.strokeStyle,C.stroke()),C.fill())}C.globalAlpha=1}}},a.bodyWireframes=function(k,S,_){var C=_,I=k.options.showInternalEdges,A,R,L,z,j;for(C.beginPath(),L=0;L<S.length;L++)if(A=S[L],!!A.render.visible)for(j=A.parts.length>1?1:0;j<A.parts.length;j++){for(R=A.parts[j],C.moveTo(R.vertices[0].x,R.vertices[0].y),z=1;z<R.vertices.length;z++)!R.vertices[z-1].isInternal||I?C.lineTo(R.vertices[z].x,R.vertices[z].y):C.moveTo(R.vertices[z].x,R.vertices[z].y),R.vertices[z].isInternal&&!I&&C.moveTo(R.vertices[(z+1)%R.vertices.length].x,R.vertices[(z+1)%R.vertices.length].y);C.lineTo(R.vertices[0].x,R.vertices[0].y)}C.lineWidth=1,C.strokeStyle="#bbb",C.stroke()},a.bodyConvexHulls=function(k,S,_){var C=_,I,A,R;for(C.beginPath(),A=0;A<S.length;A++)if(I=S[A],!(!I.render.visible||I.parts.length===1)){for(C.moveTo(I.vertices[0].x,I.vertices[0].y),R=1;R<I.vertices.length;R++)C.lineTo(I.vertices[R].x,I.vertices[R].y);C.lineTo(I.vertices[0].x,I.vertices[0].y)}C.lineWidth=1,C.strokeStyle="rgba(255,255,255,0.2)",C.stroke()},a.vertexNumbers=function(k,S,_){var C=_,I,A,R;for(I=0;I<S.length;I++){var L=S[I].parts;for(R=L.length>1?1:0;R<L.length;R++){var z=L[R];for(A=0;A<z.vertices.length;A++)C.fillStyle="rgba(255,255,255,0.2)",C.fillText(I+"_"+A,z.position.x+(z.vertices[A].x-z.position.x)*.8,z.position.y+(z.vertices[A].y-z.position.y)*.8)}}},a.mousePosition=function(k,S,_){var C=_;C.fillStyle="rgba(255,255,255,0.8)",C.fillText(S.position.x+" "+S.position.y,S.position.x+5,S.position.y-5)},a.bodyBounds=function(k,S,_){var C=_;k.engine;var I=k.options;C.beginPath();for(var A=0;A<S.length;A++){var R=S[A];if(R.render.visible)for(var L=S[A].parts,z=L.length>1?1:0;z<L.length;z++){var j=L[z];C.rect(j.bounds.min.x,j.bounds.min.y,j.bounds.max.x-j.bounds.min.x,j.bounds.max.y-j.bounds.min.y)}}I.wireframes?C.strokeStyle="rgba(255,255,255,0.08)":C.strokeStyle="rgba(0,0,0,0.1)",C.lineWidth=1,C.stroke()},a.bodyAxes=function(k,S,_){var C=_;k.engine;var I=k.options,A,R,L,z;for(C.beginPath(),R=0;R<S.length;R++){var j=S[R],B=j.parts;if(j.render.visible)if(I.showAxes)for(L=B.length>1?1:0;L<B.length;L++)for(A=B[L],z=0;z<A.axes.length;z++){var H=A.axes[z];C.moveTo(A.position.x,A.position.y),C.lineTo(A.position.x+H.x*20,A.position.y+H.y*20)}else for(L=B.length>1?1:0;L<B.length;L++)for(A=B[L],z=0;z<A.axes.length;z++)C.moveTo(A.position.x,A.position.y),C.lineTo((A.vertices[0].x+A.vertices[A.vertices.length-1].x)/2,(A.vertices[0].y+A.vertices[A.vertices.length-1].y)/2)}I.wireframes?(C.strokeStyle="indianred",C.lineWidth=1):(C.strokeStyle="rgba(255, 255, 255, 0.4)",C.globalCompositeOperation="overlay",C.lineWidth=2),C.stroke(),C.globalCompositeOperation="source-over"},a.bodyPositions=function(k,S,_){var C=_;k.engine;var I=k.options,A,R,L,z;for(C.beginPath(),L=0;L<S.length;L++)if(A=S[L],!!A.render.visible)for(z=0;z<A.parts.length;z++)R=A.parts[z],C.arc(R.position.x,R.position.y,3,0,2*Math.PI,!1),C.closePath();for(I.wireframes?C.fillStyle="indianred":C.fillStyle="rgba(0,0,0,0.5)",C.fill(),C.beginPath(),L=0;L<S.length;L++)A=S[L],A.render.visible&&(C.arc(A.positionPrev.x,A.positionPrev.y,2,0,2*Math.PI,!1),C.closePath());C.fillStyle="rgba(255,165,0,0.8)",C.fill()},a.bodyVelocity=function(k,S,_){var C=_;C.beginPath();for(var I=0;I<S.length;I++){var A=S[I];if(A.render.visible){var R=s.getVelocity(A);C.moveTo(A.position.x,A.position.y),C.lineTo(A.position.x+R.x,A.position.y+R.y)}}C.lineWidth=3,C.strokeStyle="cornflowerblue",C.stroke()},a.bodyIds=function(k,S,_){var C=_,I,A;for(I=0;I<S.length;I++)if(S[I].render.visible){var R=S[I].parts;for(A=R.length>1?1:0;A<R.length;A++){var L=R[A];C.font="12px Arial",C.fillStyle="rgba(255,255,255,0.5)",C.fillText(L.id,L.position.x+10,L.position.y-10)}}},a.collisions=function(k,S,_){var C=_,I=k.options,A,R,L,z;for(C.beginPath(),L=0;L<S.length;L++)if(A=S[L],!!A.isActive)for(R=A.collision,z=0;z<A.activeContacts.length;z++){var j=A.activeContacts[z],B=j.vertex;C.rect(B.x-1.5,B.y-1.5,3.5,3.5)}for(I.wireframes?C.fillStyle="rgba(255,255,255,0.7)":C.fillStyle="orange",C.fill(),C.beginPath(),L=0;L<S.length;L++)if(A=S[L],!!A.isActive&&(R=A.collision,A.activeContacts.length>0)){var H=A.activeContacts[0].vertex.x,Y=A.activeContacts[0].vertex.y;A.activeContacts.length===2&&(H=(A.activeContacts[0].vertex.x+A.activeContacts[1].vertex.x)/2,Y=(A.activeContacts[0].vertex.y+A.activeContacts[1].vertex.y)/2),R.bodyB===R.supports[0].body||R.bodyA.isStatic===!0?C.moveTo(H-R.normal.x*8,Y-R.normal.y*8):C.moveTo(H+R.normal.x*8,Y+R.normal.y*8),C.lineTo(H,Y)}I.wireframes?C.strokeStyle="rgba(255,165,0,0.7)":C.strokeStyle="orange",C.lineWidth=1,C.stroke()},a.separations=function(k,S,_){var C=_,I=k.options,A,R,L,z,j;for(C.beginPath(),j=0;j<S.length;j++)if(A=S[j],!!A.isActive){R=A.collision,L=R.bodyA,z=R.bodyB;var B=1;!z.isStatic&&!L.isStatic&&(B=.5),z.isStatic&&(B=0),C.moveTo(z.position.x,z.position.y),C.lineTo(z.position.x-R.penetration.x*B,z.position.y-R.penetration.y*B),B=1,!z.isStatic&&!L.isStatic&&(B=.5),L.isStatic&&(B=0),C.moveTo(L.position.x,L.position.y),C.lineTo(L.position.x+R.penetration.x*B,L.position.y+R.penetration.y*B)}I.wireframes?C.strokeStyle="rgba(255,165,0,0.5)":C.strokeStyle="orange",C.stroke()},a.inspector=function(k,S){k.engine;var _=k.selected,C=k.render,I=C.options,A;if(I.hasBounds){var R=C.bounds.max.x-C.bounds.min.x,L=C.bounds.max.y-C.bounds.min.y,z=R/C.options.width,j=L/C.options.height;S.scale(1/z,1/j),S.translate(-C.bounds.min.x,-C.bounds.min.y)}for(var B=0;B<_.length;B++){var H=_[B].data;switch(S.translate(.5,.5),S.lineWidth=1,S.strokeStyle="rgba(255,165,0,0.9)",S.setLineDash([1,2]),H.type){case"body":A=H.bounds,S.beginPath(),S.rect(Math.floor(A.min.x-3),Math.floor(A.min.y-3),Math.floor(A.max.x-A.min.x+6),Math.floor(A.max.y-A.min.y+6)),S.closePath(),S.stroke();break;case"constraint":var Y=H.pointA;H.bodyA&&(Y=H.pointB),S.beginPath(),S.arc(Y.x,Y.y,10,0,2*Math.PI),S.closePath(),S.stroke();break}S.setLineDash([]),S.translate(-.5,-.5)}k.selectStart!==null&&(S.translate(.5,.5),S.lineWidth=1,S.strokeStyle="rgba(255,165,0,0.6)",S.fillStyle="rgba(255,165,0,0.1)",A=k.selectBounds,S.beginPath(),S.rect(Math.floor(A.min.x),Math.floor(A.min.y),Math.floor(A.max.x-A.min.x),Math.floor(A.max.y-A.min.y)),S.closePath(),S.stroke(),S.fill(),S.translate(-.5,-.5)),I.hasBounds&&S.setTransform(1,0,0,1,0,0)};var g=function(k,S){var _=k.engine,C=k.timing,I=C.historySize,A=_.timing.timestamp;C.delta=S-C.lastTime||a._goodDelta,C.lastTime=S,C.timestampElapsed=A-C.lastTimestamp||0,C.lastTimestamp=A,C.deltaHistory.unshift(C.delta),C.deltaHistory.length=Math.min(C.deltaHistory.length,I),C.engineDeltaHistory.unshift(_.timing.lastDelta),C.engineDeltaHistory.length=Math.min(C.engineDeltaHistory.length,I),C.timestampElapsedHistory.unshift(C.timestampElapsed),C.timestampElapsedHistory.length=Math.min(C.timestampElapsedHistory.length,I),C.engineElapsedHistory.unshift(_.timing.lastElapsed),C.engineElapsedHistory.length=Math.min(C.engineElapsedHistory.length,I),C.elapsedHistory.unshift(C.lastElapsed),C.elapsedHistory.length=Math.min(C.elapsedHistory.length,I)},x=function(k){for(var S=0,_=0;_<k.length;_+=1)S+=k[_];return S/k.length||0},b=function(k,S){var _=document.createElement("canvas");return _.width=k,_.height=S,_.oncontextmenu=function(){return!1},_.onselectstart=function(){return!1},_},v=function(k){var S=k.getContext("2d"),_=window.devicePixelRatio||1,C=S.webkitBackingStorePixelRatio||S.mozBackingStorePixelRatio||S.msBackingStorePixelRatio||S.oBackingStorePixelRatio||S.backingStorePixelRatio||1;return _/C},E=function(k,S){var _=k.textures[S];return _||(_=k.textures[S]=new Image,_.src=S,_)},N=function(k,S){var _=S;/(jpg|gif|png)$/.test(S)&&(_="url("+S+")"),k.canvas.style.background=_,k.canvas.style.backgroundSize="contain",k.currentBackground=S}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(5),o=i(17),l=i(0);(function(){var u,c;if(typeof window<"u"&&(u=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,c=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),!u){var h;u=function(m){h=setTimeout(function(){m(l.now())},1e3/60)},c=function(){clearTimeout(h)}}a.create=function(m){var d={fps:60,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,frameRequestId:null,isFixed:!1,enabled:!0},p=l.extend(d,m);return p.delta=p.delta||1e3/p.fps,p.deltaMin=p.deltaMin||1e3/p.fps,p.deltaMax=p.deltaMax||1e3/(p.fps*.5),p.fps=1e3/p.delta,p},a.run=function(m,d){return typeof m.positionIterations<"u"&&(d=m,m=a.create()),(function p(g){m.frameRequestId=u(p),g&&m.enabled&&a.tick(m,d,g)})(),m},a.tick=function(m,d,p){var g=d.timing,x;m.isFixed?x=m.delta:(x=p-m.timePrev||m.delta,m.timePrev=p,m.deltaHistory.push(x),m.deltaHistory=m.deltaHistory.slice(-m.deltaSampleSize),x=Math.min.apply(null,m.deltaHistory),x=x<m.deltaMin?m.deltaMin:x,x=x>m.deltaMax?m.deltaMax:x,m.delta=x);var b={timestamp:g.timestamp};s.trigger(m,"beforeTick",b),m.frameCounter+=1,p-m.counterTimestamp>=1e3&&(m.fps=m.frameCounter*((p-m.counterTimestamp)/1e3),m.counterTimestamp=p,m.frameCounter=0),s.trigger(m,"tick",b),s.trigger(m,"beforeUpdate",b),o.update(d,x),s.trigger(m,"afterUpdate",b),s.trigger(m,"afterTick",b)},a.stop=function(m){c(m.frameRequestId)},a.start=function(m,d){a.run(m,d)}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(8),o=i(0),l=o.deprecated;(function(){a.collides=function(u,c){return s.collides(u,c)},l(a,"collides","SAT.collides ➤ replaced by Collision.collides")})()}),(function(n,r,i){var a={};n.exports=a,i(1);var s=i(0);(function(){a.pathToVertices=function(o,l){typeof window<"u"&&!("SVGPathSeg"in window)&&s.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var u,c,h,m,d,p,g,x,b,v,E=[],N,k,S=0,_=0,C=0;l=l||15;var I=function(R,L,z){var j=z%2===1&&z>1;if(!b||R!=b.x||L!=b.y){b&&j?(N=b.x,k=b.y):(N=0,k=0);var B={x:N+R,y:k+L};(j||!b)&&(b=B),E.push(B),_=N+R,C=k+L}},A=function(R){var L=R.pathSegTypeAsLetter.toUpperCase();if(L!=="Z"){switch(L){case"M":case"L":case"T":case"C":case"S":case"Q":_=R.x,C=R.y;break;case"H":_=R.x;break;case"V":C=R.y;break}I(_,C,R.pathSegType)}};for(a._svgPathToAbsolute(o),h=o.getTotalLength(),p=[],u=0;u<o.pathSegList.numberOfItems;u+=1)p.push(o.pathSegList.getItem(u));for(g=p.concat();S<h;){if(v=o.getPathSegAtLength(S),d=p[v],d!=x){for(;g.length&&g[0]!=d;)A(g.shift());x=d}switch(d.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":m=o.getPointAtLength(S),I(m.x,m.y,0);break}S+=l}for(u=0,c=g.length;u<c;++u)A(g[u]);return E},a._svgPathToAbsolute=function(o){for(var l,u,c,h,m,d,p=o.pathSegList,g=0,x=0,b=p.numberOfItems,v=0;v<b;++v){var E=p.getItem(v),N=E.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(N))"x"in E&&(g=E.x),"y"in E&&(x=E.y);else switch("x1"in E&&(c=g+E.x1),"x2"in E&&(m=g+E.x2),"y1"in E&&(h=x+E.y1),"y2"in E&&(d=x+E.y2),"x"in E&&(g+=E.x),"y"in E&&(x+=E.y),N){case"m":p.replaceItem(o.createSVGPathSegMovetoAbs(g,x),v);break;case"l":p.replaceItem(o.createSVGPathSegLinetoAbs(g,x),v);break;case"h":p.replaceItem(o.createSVGPathSegLinetoHorizontalAbs(g),v);break;case"v":p.replaceItem(o.createSVGPathSegLinetoVerticalAbs(x),v);break;case"c":p.replaceItem(o.createSVGPathSegCurvetoCubicAbs(g,x,c,h,m,d),v);break;case"s":p.replaceItem(o.createSVGPathSegCurvetoCubicSmoothAbs(g,x,m,d),v);break;case"q":p.replaceItem(o.createSVGPathSegCurvetoQuadraticAbs(g,x,c,h),v);break;case"t":p.replaceItem(o.createSVGPathSegCurvetoQuadraticSmoothAbs(g,x),v);break;case"a":p.replaceItem(o.createSVGPathSegArcAbs(g,x,E.r1,E.r2,E.angle,E.largeArcFlag,E.sweepFlag),v);break;case"z":case"Z":g=l,x=u;break}(N=="M"||N=="m")&&(l=g,u=x)}}})()}),(function(n,r,i){var a={};n.exports=a;var s=i(6);i(0),(function(){a.create=s.create,a.add=s.add,a.remove=s.remove,a.clear=s.clear,a.addComposite=s.addComposite,a.addBody=s.addBody,a.addConstraint=s.addConstraint})()})])})})(co)),co.exports}var _5=I5();const Pr=F0(_5);{const e=Pr.Resolver;e&&typeof e._restingThresh=="number"&&(e._restingThresh=1.4)}const R5=6,Ln=28,xr=.92,$l=1.12,L5=34;function jh(e,t,n){return Math.hypot(t-e.startX,n-e.startY)<R5?"click":"drag"}function D5(e){const t=e.length;if(t===0)return"";const n=i=>`${i.x.toFixed(1)} ${i.y.toFixed(1)}`;if(t===1)return`M ${n(e[0])}`;if(t===2)return`M ${n(e[0])} L ${n(e[1])}`;let r=`M ${n(e[0])}`;for(let i=1;i<t-1;i++){const a=e[i],s=e[i+1];r+=` Q ${n(a)} ${((a.x+s.x)/2).toFixed(1)} ${((a.y+s.y)/2).toFixed(1)}`}return`${r} L ${n(e[t-1])}`}function P5(e,t){return e*Math.exp(-t/90)}function O5(e,t,n,r){const i=`translate3d(${e.toFixed(1)}px, ${t.toFixed(1)}px, 0)`;if(n<.01)return i;const a=r*180/Math.PI,s=Math.min(.35,n);return`${i} rotate(${a.toFixed(1)}deg) scale(${(1+s).toFixed(3)}, ${(1-s).toFixed(3)}) rotate(${(-a).toFixed(1)}deg)`}const cg=4e-5,j5=5e-4;function dg(e,t,n){return Math.sin(n*37e-5+t*.0013)*.6+Math.sin(n*19e-5+e*7e-4+1.7)*.4}function hg(e){switch(e){case"storm":return{wind:.95,gust:1,rainRate:.006,snowRate:0,airDrag:1.05};case"rain":return{wind:.6,gust:.25,rainRate:.004,snowRate:0,airDrag:1};case"snow":return{wind:.25,gust:0,rainRate:0,snowRate:4e-4,airDrag:1};case"fog":return{wind:.06,gust:0,rainRate:0,snowRate:0,airDrag:1.7};case"cloudy":return{wind:.4,gust:.1,rainRate:0,snowRate:0,airDrag:1};case"clear":default:return{wind:.3,gust:0,rainRate:0,snowRate:0,airDrag:1}}}function fg(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,(t>>>0)/4294967295}const wa=120,B5=.9,Bh=.7,F5=.09,z5=2.2,H5=2,Wl=Ln*2.45,U5=.006,Gl=22,Yl=.06;function V5(e){var z;const t=e.ballRadius??Ln,n=hg(e.weather??"clear"),{Engine:r,Bodies:i,Body:a,Composite:s,Constraint:o,Events:l}=Pr,u=r.create();u.gravity.y=1,u.positionIterations=8,u.velocityIterations=4;const c=e.nodes.map(j=>{var V,Z;const B=((V=j.spawn)==null?void 0:V.x)??j.x,H=((Z=j.spawn)==null?void 0:Z.y)??j.y,Y=i.circle(B,H,t,{restitution:.5,friction:.01,frictionAir:.03*n.airDrag,density:j.isExam?.0016:.001,inertia:1/0,isStatic:!!j.locked,collisionFilter:{group:0,category:2,mask:6}});return{nodeId:j.id,body:Y,layoutX:j.x,layoutY:j.y,isExam:!!j.isExam,snow:0,field:0,squash:0,squashAngle:0}});for(const j of c){s.add(u.world,j.body);const B=(z=e.nodes.find(H=>H.id===j.nodeId))==null?void 0:z.spawn;B&&(B.vx!==void 0||B.vy!==void 0)&&a.setVelocity(j.body,{x:B.vx??0,y:B.vy??0})}const h=wa/2,m={isStatic:!0,restitution:.4,friction:.05,collisionFilter:{category:4,mask:2}},d=(j,B)=>({x:Math.min(e.width-t,Math.max(t,j)),y:Math.min(e.height-t,Math.max(t,B))});s.add(u.world,[i.rectangle(e.width/2,-h,e.width*3,wa,m),i.rectangle(e.width/2,e.height+h,e.width*3,wa,m),i.rectangle(-h,e.height/2,wa,e.height*3,m),i.rectangle(e.width+h,e.height/2,wa,e.height*3,m)]);const p=j=>({x:j.body.position.x,y:j.body.position.y+t*xr}),g=[];function x(j,B,H,Y,V){return"body"in j?o.create({bodyA:j.body,pointA:j.offset,bodyB:B,pointB:H,length:Y,stiffness:V,damping:.05}):o.create({pointA:j.point,bodyB:B,pointB:H,length:Y,stiffness:V,damping:.05})}function b(j,B,H,Y){const V={x:H.body.position.x,y:H.body.position.y+t*xr},Z=V.x-j.x,O=V.y-j.y,X=Math.max(60,Math.hypot(Z,O)),ne=Math.max(5,Math.min(14,Math.round(X/L5))),P=X*$l/ne,te=[];let Q=B?{body:B,offset:{x:j.x-B.position.x,y:j.y-B.position.y}}:{point:j},K=!0;for(let ce=1;ce<ne;ce++){const le=ce/ne,ee=Math.sin(Math.PI*le)*X*($l-1)*.85,Ce=i.circle(j.x+Z*le,j.y+O*le+ee,3.5,{density:7e-4,frictionAir:.1*n.airDrag,collisionFilter:{category:8,mask:0}});te.push(Ce),s.add(u.world,Ce),s.add(u.world,x(Q,Ce,void 0,P,K?Bh:B5)),K=!1,Q={body:Ce,offset:{x:0,y:0}}}s.add(u.world,x(Q,H.body,{x:0,y:t*xr},P,Bh)),g.push({from:Y,to:H.nodeId,restLen:X*$l,particles:te})}const v=c[0],E=v?{x:e.anchorKnotX??v.layoutX,y:Ro}:{x:e.width/2,y:Ro};v&&b(E,null,v,"__anchor");for(let j=0;j<c.length-1;j++){const B=c[j],H=c[j+1];b(p(B),B.body,H,B.nodeId)}const N=c[c.length-1],k=e.nextKnot&&(N!=null&&N.isExam)?e.nextKnot:void 0;k&&N&&b(k,null,N,"__next");const S=new Map;for(const j of c){let B=0;for(const Y of g)if(Y.from===j.nodeId||Y.to===j.nodeId)for(const V of Y.particles)B+=V.mass*.5;const H=Math.min(.25,B/j.body.mass);S.set(j.nodeId,(1+H)*(.96+fg(j.nodeId)*.08))}let _=0,C=1;l.on(u,"beforeUpdate",()=>{const j=u.timing.timestamp;_*=.97,n.gust>0&&Math.random()<.0025*n.gust&&(_=n.gust*(.6+Math.random()*.4),C=Math.random()<.5?-1:1);for(const B of c){const H=B.body.mass,Y=u.gravity.y*u.gravity.scale,V=dg(B.body.position.x,B.body.position.y,j)*n.wind*cg*H+C*_*j5*H;let Z=-H*Y*(S.get(B.nodeId)??1);n.rainRate>0&&Math.random()<n.rainRate&&(Z+=H*Y*.35,a.applyForce(B.body,B.body.position,{x:(Math.random()-.5)*H*Y*.3,y:0})),a.applyForce(B.body,B.body.position,{x:V,y:Z})}});const I=[],A=(j,B,H,Y)=>{if(j.snow<=Yl)return;const V=Math.max(1,Math.min(Y,Math.round(j.snow*Y)+1));for(let Z=0;Z<V;Z++){const O=-(.35+Math.random()*1.9),X=t*(.55+Math.random()*.45);I.push({x:j.body.position.x+Math.cos(O)*X,y:j.body.position.y+Math.sin(O)*X,vx:j.body.velocity.x*.75+B.x*(.5+Math.random()*1.8)+(Math.random()-.5)*1.2,vy:j.body.velocity.y*.75+B.y*(.5+Math.random()*1.8)-.6-Math.random()*.8,amount:.02+Math.min(.05,H*.004)})}j.snow=Math.max(Yl*.5,j.snow-V*(.03+Math.min(.07,H*.005))),I.length>96&&I.splice(0,I.length-96)},R=[];l.on(u,"collisionStart",j=>{var B;for(const H of j.pairs){const{bodyA:Y,bodyB:V}=H,Z=c.find(K=>K.body===Y),O=c.find(K=>K.body===V);if(!Z&&!O)continue;const X={x:Y.velocity.x-V.velocity.x,y:Y.velocity.y-V.velocity.y},ne=Math.hypot(X.x,X.y);if(ne<z5)continue;const P=H.collision.normal,te=(B=H.collision.supports)==null?void 0:B[0];R.push(te?{x:te.x,y:te.y,speed:ne}:{x:(Y.position.x+V.position.x)/2,y:(Y.position.y+V.position.y)/2,speed:ne}),R.length>64&&R.shift();const Q=Math.min(.32,ne*.028);Z&&Q>Z.squash&&(Z.squash=Q,Z.squashAngle=Math.atan2(P.y,P.x)),O&&Q>O.squash&&(O.squash=Q,O.squashAngle=Math.atan2(-P.y,-P.x)),Z&&A(Z,{x:P.x,y:P.y},ne,5),O&&A(O,{x:-P.x,y:-P.y},ne,5)}}),l.on(u,"afterUpdate",()=>{if(!(n.snowRate<=0))for(const j of c)j.snow=Math.min(1,j.snow+n.snowRate)});let L=null;return{balls:c,links:g,anchor:E,nextKnot:k,ball(j){return c.find(B=>B.nodeId===j)},step(j){r.update(u,Math.min(33,Math.max(8,j)));for(let B=0;B<c.length;B++){const H=c[B];for(let Y=B+1;Y<c.length;Y++){const V=c[Y],Z=V.body.position.x-H.body.position.x,O=V.body.position.y-H.body.position.y,X=Z*Z+O*O;if(X>=Wl*Wl||X<.01)continue;const ne=Math.sqrt(X),P=(ne-2*t)/(Wl-2*t),te=P<=0?1:P>=1?0:1-P,K=Math.hypot(H.body.velocity.x-V.body.velocity.x,H.body.velocity.y-V.body.velocity.y)<1.2?U5*te*te:0,ce=Z/ne,le=O/ne;H.body.isStatic||a.applyForce(H.body,H.body.position,{x:-ce*K*H.body.mass,y:-le*K*H.body.mass}),V.body.isStatic||a.applyForce(V.body,V.body.position,{x:ce*K*V.body.mass,y:le*K*V.body.mass}),H.field=Math.max(H.field,te),V.field=Math.max(V.field,te)}}for(const B of c)B.field*=.88;for(const B of c){if(B.body.isStatic)continue;const H=B.body.velocity,Y=Math.hypot(H.x,H.y);Y>Gl&&a.setVelocity(B.body,{x:H.x/Y*Gl,y:H.y/Y*Gl})}for(let B=0;B<c.length;B++){const H=c[B];for(let Y=B+1;Y<c.length;Y++){const V=c[Y];let Z=V.body.position.x-H.body.position.x,O=V.body.position.y-H.body.position.y,X=Math.hypot(Z,O);if(X>=t*2)continue;X<.01&&(Z=1,O=0,X=1);const ne=t*2-X+.05,P=Z/X,te=O/X;H.body.isStatic&&V.body.isStatic||(H.body.isStatic?a.setPosition(V.body,{x:V.body.position.x+P*ne,y:V.body.position.y+te*ne}):V.body.isStatic?a.setPosition(H.body,{x:H.body.position.x-P*ne,y:H.body.position.y-te*ne}):(a.setPosition(H.body,{x:H.body.position.x-P*ne/2,y:H.body.position.y-te*ne/2}),a.setPosition(V.body,{x:V.body.position.x+P*ne/2,y:V.body.position.y+te*ne/2})))}}for(const B of c){const H=Math.hypot(B.body.velocity.x,B.body.velocity.y);B.snow>Yl&&H>H5&&A(B,{x:B.body.velocity.x/H,y:B.body.velocity.y/H},H,2)}for(const B of c){if(B.body.isStatic)continue;const H=B.body.position.x,Y=B.body.position.y,V=Math.min(e.width-t,Math.max(t,H)),Z=Math.min(e.height-t,Math.max(t,Y));(V!==H||Z!==Y)&&(a.setPosition(B.body,{x:V,y:Z}),a.setVelocity(B.body,{x:H<t||H>e.width-t?0:B.body.velocity.x,y:Y<t||Y>e.height-t?0:B.body.velocity.y}))}},beginDrag(j,B,H){this.endDrag();const Y=this.ball(j);if(!Y)return;const V=o.create({pointA:d(B,H),bodyB:Y.body,length:0,stiffness:F5,damping:.12});s.add(u.world,V),L={constraint:V,nodeId:j}},moveDrag(j,B){if(!L)return;const H=d(j,B);L.constraint.pointA=H},endDrag(){L&&(s.remove(u.world,L.constraint),L=null)},isDragging(){return L!==null},drainImpacts(){const j=R.slice();return R.length=0,j},drainFlakes(){const j=I.slice();return I.length=0,j},dispose(){this.endDrag(),l.off(u,"beforeUpdate"),l.off(u,"afterUpdate"),l.off(u,"collisionStart"),s.clear(u.world,!1),r.clear(u)}}}const Ro=-12;function Ds(e,t,n=20){return t<=n*2?t/2:n+fg(e)*(t-n*2)}function q5(e,t,n,r=Ln){if(t<=0||Math.abs(t-n)<=1)return e;const i=n/t,a={x:Math.min(n-r,Math.max(r,e.x*i)),y:e.y,vy:e.vy};return e.vx!==void 0&&(a.vx=e.vx*i),a}const mi=(e,t,n)=>e+(t-e)*n,il=(e,t,n)=>e<t?t:e>n?n:e,rs=e=>e<0?0:e>1?1:e*e*(3-2*e);function pi(e,t,n){return[mi(e[0],t[0],n),mi(e[1],t[1],n),mi(e[2],t[2],n)]}const Kl=e=>`rgb(${e[0]|0},${e[1]|0},${e[2]|0})`,Ki=(e,t)=>`rgba(${e[0]|0},${e[1]|0},${e[2]|0},${t})`;function al(){return[{t:0,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]},{t:.12,top:[30,32,72],mid:[78,56,104],hor:[158,100,116]},{t:.22,top:[124,156,214],mid:[232,152,120],hor:[250,196,128]},{t:.36,top:[80,142,196],mid:[132,186,226],hor:[188,214,232]},{t:.5,top:[60,120,178],mid:[108,168,212],hor:[168,200,226]},{t:.62,top:[120,132,152],mid:[150,150,160],hor:[180,178,182]},{t:.74,top:[70,60,88],mid:[108,78,110],hor:[180,110,100]},{t:.86,top:[40,30,60],mid:[88,44,76],hor:[168,72,72]},{t:1,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]}]}function sl(e,t){return e.map(n=>({t:n.t,top:t(n.top),mid:t(n.mid),hor:t(n.hor)}))}const Xl=()=>sl(al(),e=>[e[0]*1,e[1]*1.15,e[2]*.7]),Ps=()=>sl(al(),e=>[e[0]*.75,e[1]*1,Math.min(255,e[2]*1.25)]),Ql=()=>sl(al(),e=>[Math.min(255,e[0]*1.35),e[1]*.8,e[2]*.55]),Fh=()=>sl(al(),e=>{const t=(e[0]+e[1]+e[2])/3;return[t*.7+e[0]*.1,t*.7+e[1]*.1,t*.95+e[2]*.15]}),Zl={far:[28,50,36],near:[56,110,52],snowy:!1},Os={far:[20,48,30],near:[34,82,40],snowy:!1},Jl={far:[54,36,24],near:[128,78,36],snowy:!1},zh={far:[60,66,82],near:[232,236,244],snowy:!0};function Rn(e){return t=>{let n=e;return t>.3&&t<.5?n=mi(n,Math.min(1,n+.2),rs((t-.3)/.2)):t>=.5&&t<.74?n=Math.min(1,n+.15):t>=.74&&t<.84&&(n=mi(n,Math.max(0,n-.3),rs((t-.74)/.1))),il(n,0,1)}}const mg={"spring|clear":{season:"spring",weather:"clear",sky:Xl(),cloudCover:Rn(.1),particles:"none",lightning:!1,fogAlpha:0,ground:Zl},"spring|cloudy":{season:"spring",weather:"cloudy",sky:Xl(),cloudCover:Rn(.5),particles:"none",lightning:!1,fogAlpha:0,ground:Zl},"spring|rain":{season:"spring",weather:"rain",sky:Xl(),cloudCover:Rn(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:Zl},"summer|clear":{season:"summer",weather:"clear",sky:Ps(),cloudCover:Rn(.1),particles:"none",lightning:!1,fogAlpha:0,ground:Os},"summer|cloudy":{season:"summer",weather:"cloudy",sky:Ps(),cloudCover:Rn(.5),particles:"none",lightning:!1,fogAlpha:0,ground:Os},"summer|rain":{season:"summer",weather:"rain",sky:Ps(),cloudCover:Rn(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:Os},"summer|storm":{season:"summer",weather:"storm",sky:Ps(),cloudCover:Rn(1),particles:"rain",lightning:!0,fogAlpha:0,ground:Os},"autumn|clear":{season:"autumn",weather:"clear",sky:Ql(),cloudCover:Rn(.15),particles:"none",lightning:!1,fogAlpha:0,ground:Jl,sunTint:[255,180,110]},"autumn|cloudy":{season:"autumn",weather:"cloudy",sky:Ql(),cloudCover:Rn(.55),particles:"none",lightning:!1,fogAlpha:0,ground:Jl},"autumn|storm":{season:"autumn",weather:"storm",sky:Ql(),cloudCover:Rn(1),particles:"rain",lightning:!0,fogAlpha:0,ground:Jl},"winter|clear":{season:"winter",weather:"clear",sky:Fh(),cloudCover:Rn(.2),particles:"none",lightning:!1,fogAlpha:0,ground:zh,sunTint:[220,230,245]},"winter|snow":{season:"winter",weather:"snow",sky:Fh(),cloudCover:Rn(.9),particles:"snow",lightning:!1,fogAlpha:.2,ground:zh}},Hh=Object.keys(mg);function $5(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function W5(e){const t=`${e??"none"}:${Math.floor(performance.now()/1e3)}`;return Hh[$5(t)%Hh.length]}function G5(e,t){let n=0;for(;n<t.length-1&&e>t[n+1].t;)n++;const r=t[n],i=t[Math.min(n+1,t.length-1)],a=rs(il((e-r.t)/(i.t-r.t||1),0,1));return{top:pi(r.top,i.top,a),mid:pi(r.mid,i.mid,a),hor:pi(r.hor,i.hor,a)}}function Y5(e,t,n,r,i){if(e<r||e>i)return null;const a=(e-r)/(i-r),s=mi(.1,.9,a),o=n*.26,l=n*.98,u=l-Math.sin(a*Math.PI)*(l-o);return{x:s*t,y:u,peakness:Math.sin(a*Math.PI)}}function K5(e,t,n,r,i){let a;if(e>=r)a=(e-r)/(1-r+i);else if(e<=i)a=(1-r+e)/(1-r+i);else return null;const s=mi(.12,.88,a),o=n*.26,l=n*.98,u=l-Math.sin(a*Math.PI)*(l-o);return{x:s*t,y:u,peakness:Math.sin(a*Math.PI)}}function pg(e){return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function Uh(e,t){const n=pg(20260809),r=Math.max(28,Math.round(e*t/7e3)),i=[];for(let a=0;a<r;a++)i.push({x:n(),y:n()*.7,r:n()*1.2+.3,tw:n()*Math.PI*2,sp:.6+n()*1.4,big:n()<.06});return i}function X5(){const e=pg(7),t=[];for(let n=0;n<6;n++)t.push({x:e(),y:.12+e()*.4,s:.55+e()*1.2,speed:18e-6+e()*35e-6,seed:e()*1e3,drift:e()*.035+.008});return t}function Q5(e,t,n,r){const i=e.createLinearGradient(0,0,0,r);i.addColorStop(0,Kl(t.top)),i.addColorStop(.55,Kl(t.mid)),i.addColorStop(1,Kl(t.hor)),e.fillStyle=i,e.fillRect(0,0,n,r)}function Z5(e,t,n,r,i,a){let s=0;if(t<.22?s=rs(1-t/.22):t>.8&&(s=rs((t-.8)/.2)),!(s<=.01))for(const o of n){const l=.55+.45*Math.sin(a*o.sp+o.tw),u=s*l;if(u<.02)continue;e.fillStyle=`rgba(255,248,228,${u})`;const c=o.big?o.r*1.8:o.r;e.beginPath(),e.arc(o.x*r,o.y*i,c,0,Math.PI*2),e.fill(),o.big&&(e.fillStyle=`rgba(255,240,210,${u*.35})`,e.fillRect(o.x*r-c*4,o.y*i-.4,c*8,.8),e.fillRect(o.x*r-.4,o.y*i-c*4,.8,c*8))}}function J5(e,t,n){if(!t)return;const{x:r,y:i,peakness:a}=t,s=28+a*8,o=e.createRadialGradient(r,i,s*.4,r,i,s*5);o.addColorStop(0,"rgba(255,236,190,0.55)"),o.addColorStop(.4,"rgba(255,210,150,0.16)"),o.addColorStop(1,"rgba(255,200,140,0)"),e.fillStyle=o,e.fillRect(r-s*5,i-s*5,s*10,s*10);const l=e.createRadialGradient(r,i,0,r,i,s),u=n??[255,236,180],c=n?pi(n,[255,214,150],.5):[255,214,150];l.addColorStop(0,"rgba(255,252,238,1)"),l.addColorStop(.7,Ki(u,1)),l.addColorStop(1,Ki(c,.9)),e.fillStyle=l,e.beginPath(),e.arc(r,i,s,0,Math.PI*2),e.fill()}function ev(e,t){if(!t)return;const{x:n,y:r}=t,i=24,a=e.createRadialGradient(n,r,i*.8,n,r,i*5);a.addColorStop(0,"rgba(220,232,255,0.38)"),a.addColorStop(.5,"rgba(220,232,255,0.1)"),a.addColorStop(1,"rgba(220,232,255,0)"),e.fillStyle=a,e.fillRect(n-i*5,r-i*5,i*10,i*10);const s=e.createRadialGradient(n-i*.25,r-i*.3,i*.2,n,r,i);s.addColorStop(0,"rgba(255,254,247,1)"),s.addColorStop(.7,"rgba(244,242,232,1)"),s.addColorStop(1,"rgba(214,222,236,1)"),e.fillStyle=s,e.beginPath(),e.arc(n,r,i,0,Math.PI*2),e.fill(),e.fillStyle="rgba(150,160,180,0.16)";const o=[[-10,-6,4],[5,3,5],[-3,9,3],[11,-8,3]];for(const[l,u,c]of o)e.beginPath(),e.arc(n+l,r+u,c,0,Math.PI*2),e.fill()}function tv(e,t,n,r,i,a){const s=18*r,o=[[0,0,1],[-1.1,.1,.8],[1.1,.1,.8],[-.5,-.5,.7],[.6,-.45,.75],[-1.8,.3,.6],[1.8,.3,.6]];e.save(),e.translate(t,n),e.fillStyle=Ki([i[0]*.7,i[1]*.7,i[2]*.78],a*.9);for(const[l,u,c]of o)e.beginPath(),e.arc(l*s,u*s*1.1+s*.45,s*c*1.05,0,Math.PI*2),e.fill();e.fillStyle=Ki(i,a);for(const[l,u,c]of o)e.beginPath(),e.arc(l*s,u*s,s*c,0,Math.PI*2),e.fill();e.restore()}function nv(e,t,n,r,i,a,s,o,l){const u=s(t);if(u<.02)return;const c=pi(o.hor,[255,255,255],.35),h=pi(o.mid,[20,20,30],.45),m=l?h:c;for(let d=0;d<n.length;d++){const p=n[d],g=(p.x+a*p.speed)%1.2-.1,x=p.y+Math.sin(a*1e-4+p.seed)*p.drift;d/n.length<u&&tv(e,g*r,x*i,p.s,m,il(u*.92,0,.92))}}const Bi=[];let si=[];const La=[];let oi=[];const js=[],ka=[];let Da=[];function rv(e,t,n,r,i,a){if(i<.04)return;const s=r*(.02+i*.07),o=.12+i*.73,l=t-r*o,u=t+r*o,c=n-Math.sqrt(Math.max(0,r*r-r*o*(r*o))),h=n-r-s,m=(c+h)/2;e.save(),e.beginPath(),e.moveTo(l,c),e.bezierCurveTo(l,m,t-r*.3,h,t,h),e.bezierCurveTo(t+r*.3,h,u,m,u,c),e.quadraticCurveTo(t,n-r*.78,l,c),e.closePath();const d=e.createLinearGradient(0,h,0,c);d.addColorStop(0,"rgba(255,255,255,0.98)"),d.addColorStop(.65,"rgba(245,250,255,0.95)"),d.addColorStop(1,"rgba(218,230,246,0.9)"),e.fillStyle=d,e.fill(),e.strokeStyle="rgba(168,192,225,0.28)",e.lineWidth=1.5,e.beginPath(),e.moveTo(l,c),e.quadraticCurveTo(t,n-r*.78,u,c),e.stroke(),e.restore()}function eu(e,t,n,r,i){const a=Math.sin(r),s=Math.cos(r);return{x:e+Math.sin(i)*a*n,y:t-s*n}}function iv(e,t,n,r){e.save(),e.beginPath(),e.arc(t,n,r*.99,0,Math.PI*2),e.clip();const i=e.createRadialGradient(t-r*.35,n-r*.4,0,t-r*.35,n-r*.4,r*.8);i.addColorStop(0,"rgba(255,255,255,0.4)"),i.addColorStop(.5,"rgba(255,255,255,0.12)"),i.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=i,e.fillRect(t-r,n-r,r*2,r*2),e.strokeStyle="rgba(255,255,255,0.55)",e.lineWidth=1.8,e.beginPath(),e.arc(t,n,r*.92,Math.PI*1.15,Math.PI*1.5),e.stroke(),e.restore()}function av(e,t){if(t.length!==0){e.save();for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.x+=r.vx,r.y+=r.vy,r.vy+=.14,r.vx*=.985,r.vy*=.99,r.life--,r.life<=0){t.splice(n,1);continue}const i=r.life/r.maxLife;e.fillStyle=`rgba(248,250,255,${(.9*i).toFixed(3)})`,e.beginPath(),e.arc(r.x,r.y,r.r*(.5+.5*i),0,Math.PI*2),e.fill()}e.restore()}}function gg(e,t){e.save();for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.x+=r.vx,r.y+=r.vy,r.vy+=.18,r.life--,r.life<=0){t.splice(n,1);continue}const i=Math.min(1,r.life/20)*.8;e.fillStyle=`rgba(215,238,255,${i})`,e.beginPath(),e.arc(r.x,r.y,1.3,0,Math.PI*2),e.fill()}e.restore()}function sv(e,t,n,r,i,a){e.save(),e.beginPath(),e.arc(t,n,r*.99,0,Math.PI*2),e.clip();for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.prog+=o.speed,o.life--,o.prog>Math.PI*1.05||o.life<=0){i.splice(s,1);continue}const l=7;for(let h=0;h<l;h++){const m=o.prog-o.len*(h/l),d=o.prog-o.len*((h+1)/l),p=eu(t,n,r,m,o.theta),g=eu(t,n,r,d,o.theta),x=(1-h/l)*.42;e.strokeStyle=`rgba(200,228,250,${x})`,e.lineWidth=o.thick*(1-h/l*.7),e.lineCap="round",e.beginPath(),e.moveTo(p.x,p.y),e.lineTo(g.x,g.y),e.stroke()}const u=eu(t,n,r,o.prog,o.theta),c=e.createRadialGradient(u.x-1.2,u.y-1.2,0,u.x,u.y,o.thick*1.3);c.addColorStop(0,"rgba(255,255,255,0.85)"),c.addColorStop(.4,"rgba(180,215,240,0.5)"),c.addColorStop(1,"rgba(120,165,205,0.25)"),e.fillStyle=c,e.beginPath(),e.arc(u.x,u.y,o.thick*1.1,0,Math.PI*2),e.fill()}e.restore()}function ov(e,t,n,r){for(;Bi.length<t.length;)Bi.push([]);for(;si.length<t.length;)si.push(0);for(;Da.length<t.length;)Da.push(.3);for(;La.length<t.length;)La.push([]);for(;oi.length<t.length;)oi.push(0);for(let i=0;i<t.length;i++){const a=t[i];if(n.particles==="snow"){const s=a.snow!==void 0?a.snow:Math.min(1,(Da[i]??.3)+8e-4);Da[i]=s,rv(e,a.x,a.y,a.r,s)}else if(n.particles==="rain"){if(iv(e,a.x,a.y,a.r),si[i]=si[i]-1,si[i]<=0&&Bi[i].length<3){const s=Math.random()<.5?-1:1;Bi[i].push({theta:s*(.2+Math.random()*.3),prog:.1+Math.random()*.2,speed:.012+Math.random()*.012,len:.3+Math.random()*.3,thick:1.6+Math.random()*1.4,life:250+Math.random()*200}),si[i]=40+Math.random()*60}if(sv(e,a.x,a.y,a.r,Bi[i]),oi[i]=oi[i]-1,oi[i]<=0){const s=a.x+(Math.random()-.5)*a.r*1.2,o=s-a.x,l=a.y-Math.sqrt(Math.max(0,a.r*a.r-o*o)),u=4+Math.floor(Math.random()*3);for(let c=0;c<u;c++){const h=o<0?-1:1;La[i].push({x:s,y:l,vx:h*(.5+Math.random()*2)*(Math.random()<.5?-1:1),vy:-(1.5+Math.random()*2.5),life:18+Math.floor(Math.random()*14)})}oi[i]=30+Math.floor(Math.random()*50)}gg(e,La[i])}}}function lv(e,t,n,r,i){e.save(),e.strokeStyle=i?"rgba(205,224,244,0.42)":"rgba(210,224,238,0.3)",e.lineWidth=i?1:.7,e.lineCap="round";const a=i?.013:.007;for(const s of r){s.y+=s.v*a,s.y>1&&(s.y-=1,s.x=Math.random());const o=s.x*t,l=s.y*n;e.beginPath(),e.moveTo(o,l),e.lineTo(o,l+s.len),e.stroke()}e.restore()}function uv(e,t,n,r,i){e.save(),e.fillStyle="rgba(250,250,255,0.85)";for(const a of r){a.y+=a.v*.004;const s=(a.x+Math.sin(i*5e-4+a.phase)*.02)*t,o=a.y*n;a.y>1&&(a.y-=1),e.beginPath(),e.arc(s,o,a.r,0,Math.PI*2),e.fill()}e.restore()}function cv(e,t,n,r,i){const a=e.createLinearGradient(0,n*.4,0,n),s=pi(i.hor,[255,255,255],.3);a.addColorStop(0,Ki(s,0)),a.addColorStop(1,Ki(s,r)),e.fillStyle=a,e.fillRect(0,n*.4,t,n*.6)}let Ri=0,Vh=0;function dv(e,t,n,r,i){if(i>Vh&&(Ri=1,Vh=i+1400+Math.random()*2600),Ri*=.86,Ri<.02){Ri=0;return}if(e.fillStyle=`rgba(255,255,255,${Ri*.5})`,e.fillRect(0,0,t,n),Ri>.6){e.save(),e.strokeStyle="rgba(255,255,255,0.95)",e.lineWidth=2.2,e.shadowColor="rgba(220,230,255,0.9)",e.shadowBlur=22;let a=t*(.3+Math.random()*.4),s=0;for(e.beginPath(),e.moveTo(a,s);s<n*.6;)a+=(Math.random()-.5)*60,s+=24+Math.random()*30,e.lineTo(a,s);e.stroke(),e.restore()}}function hv(e,t,n,r){const i=e.getContext("2d");if(!i)return()=>{};const a=i,s=n;let o=0,l=0,u=1,c=Uh(1,1);const h=X5();let m=[],d=[],p=0,g=0,x=!0;const b=performance.now(),v=window.matchMedia("(prefers-reduced-motion: reduce)").matches;function E(){const I=s.getBoundingClientRect();if(u=Math.min(window.devicePixelRatio||1,2),o=Math.max(1,I.width),l=Math.max(1,I.height),e.width=Math.floor(o*u),e.height=Math.floor(l*u),e.style.width=o+"px",e.style.height=l+"px",a.setTransform(u,0,0,u,0,0),c=Uh(o,l),r.particles==="rain"&&m.length===0){const A=r.weather==="storm",R=A?140:70;for(let L=0;L<R;L++)m.push({x:Math.random(),y:Math.random(),len:A?12+Math.random()*14:6+Math.random()*8,v:A?.9+Math.random()*.4:.5+Math.random()*.3})}if(r.particles==="snow"&&d.length===0)for(let A=0;A<120;A++)d.push({x:Math.random(),y:Math.random(),r:.8+Math.random()*1.6,v:.5+Math.random()*.8,phase:Math.random()*Math.PI*2})}function N(){const I=t.scrollHeight-t.clientHeight;p=I>0?il(t.scrollTop/I,0,1):0}function k(I){if(!x)return;const A=p,R=v?0:(I-b)/1e3,L=G5(A,r.sky);Q5(a,L,o,l),Z5(a,A,c,o,l,R),ev(a,K5(A,o,l,.92,.08)),J5(a,Y5(A,o,l,.16,.88),r.sunTint),nv(a,A,h,o,l,I,r.cloudCover,L,r.weather==="storm"),r.particles==="rain"&&lv(a,o,l,m,r.weather==="storm"),r.particles==="snow"&&uv(a,o,l,d,I),r.fogAlpha>0&&cv(a,o,l,r.fogAlpha,L),r.lightning&&dv(a,o,l,!0,I),v||(g=requestAnimationFrame(k))}const S=()=>N(),_=new ResizeObserver(()=>{E(),N()});_.observe(s),E(),N();let C;if(v){let I=!1;C=()=>{N(),I||(I=!0,requestAnimationFrame(()=>{I=!1,k(performance.now())}))},t.addEventListener("scroll",C,{passive:!0}),k(performance.now())}else C=S,t.addEventListener("scroll",C,{passive:!0}),g=requestAnimationFrame(k);return()=>{x=!1,cancelAnimationFrame(g),_.disconnect(),t.removeEventListener("scroll",C)}}function fv(e,t,n,r,i,a){const s=()=>{Bi.length=0,Da.length=0,si.length=0,La.length=0,oi.length=0,js.length=0,ka.length=0;const v=e.getContext("2d");v&&v.clearRect(0,0,e.width,e.height)};if(s(),window.matchMedia("(prefers-reduced-motion: reduce)").matches)return()=>{};if(n.particles!=="rain"&&n.particles!=="snow")return()=>{};const l=e.getContext("2d");if(!l)return()=>{};const u=l;let c=0,h=0,m=1,d=0,p=!0;function g(){const v=t.getBoundingClientRect();m=Math.min(window.devicePixelRatio||1,2),c=Math.max(1,v.width),h=Math.max(1,v.height),e.width=Math.floor(c*m),e.height=Math.floor(h*m),e.style.width=c+"px",e.style.height=h+"px",u.setTransform(m,0,0,m,0,0)}function x(v){if(!p)return;u.clearRect(0,0,c,h);const E=r();if(ov(u,E,n),i){for(const N of i()){const k=3+Math.min(5,Math.floor(N.speed/3));for(let S=0;S<k;S++)js.push({x:N.x,y:N.y,vx:(Math.random()-.5)*3.2,vy:-(1.5+Math.random()*2.5),life:16+Math.floor(Math.random()*12)})}js.length>0&&gg(u,js)}if(a){for(const N of a()){const k=1+Math.min(2,Math.round(N.amount*40));for(let S=0;S<k;S++){const _=55+Math.floor(Math.random()*40);ka.push({x:N.x+(Math.random()-.5)*8,y:N.y+(Math.random()-.5)*6,vx:N.vx*.6+(Math.random()-.5)*.8,vy:N.vy*.6-Math.random()*.5,life:_,maxLife:_,r:1.2+Math.random()*2.2})}}for(;ka.length>240;)ka.shift();av(u,ka)}d=requestAnimationFrame(x)}const b=new ResizeObserver(g);return b.observe(t),g(),d=requestAnimationFrame(x),()=>{p=!1,cancelAnimationFrame(d),b.disconnect(),s()}}function mv(e){const t=$e(),[n,r]=w.useState("import"),[i,a]=w.useState("study"),s=w.useRef(null),o=w.useRef(null),l=Math.round(e.overallMastery*100),c=!z0(),h=w.useRef([]),m=w.useRef(L=>{h.current.push(...L),h.current.length>64&&h.current.splice(0,h.current.length-64)}).current,d=w.useRef([]),p=w.useRef(new Map),g=w.useRef(L=>{d.current.push(...L),d.current.length>96&&d.current.splice(0,d.current.length-96)}).current,x=e.sections.filter(L=>(L.world??"study")===i),b=e.sections.some(L=>L.world==="practice"),[v,E]=w.useState(null);w.useEffect(()=>{E(W5(e.courseId))},[e.courseId]);const N=v?mg[v]??null:null;w.useEffect(()=>(vh({nav:s.current,visible:n==="map",weather:(N==null?void 0:N.weather)??"clear"}),()=>{vh({visible:!1,nav:null})}),[n,N,s]);const[k,S]=w.useState(!1);w.useEffect(()=>{if(!e.selectedNodeId)return;const L=o.current;if(!L)return;const z=L.querySelector(`[data-node-id="${CSS.escape(e.selectedNodeId)}"]`);if(!z)return;const j=L.getBoundingClientRect(),B=z.getBoundingClientRect();(B.top<j.top+60||B.bottom>j.bottom-60)&&z.scrollIntoView({behavior:"smooth",block:"center"})},[e.selectedNodeId]);const _=w.useRef(null);w.useEffect(()=>{S(!1),e.courseId&&(_.current===null||_.current!==e.courseId)&&(r("map"),a("study")),!e.courseId&&_.current!==null&&(r("import"),a("study")),_.current=e.courseId},[e.courseId]);const[C,I]=w.useState(null),A=w.useRef({}),R=w.useRef(null);return w.useEffect(()=>{var B;const L=A.current,z={};let j=!1;for(const H of e.tree){const Y=((B=e.progressMap[H.id])==null?void 0:B.status)??"locked";z[H.id]=Y,L[H.id]==="locked"&&Y!=="locked"&&(j=!0)}j&&Object.keys(L).length>0&&fi("unlock"),A.current=z},[e.tree,e.progressMap]),f.jsxs("nav",{ref:s,className:`map-rail-scope relative h-full flex flex-col bg-surface-rail shrink-0 overflow-hidden ${e.fullWidth?"w-full":"w-[300px]"}`,"data-testid":"map-rail",children:[N&&f.jsxs(f.Fragment,{children:[f.jsx(gv,{scrollRef:o,navRef:s,preset:N}),f.jsx(xv,{scrollRef:o,navRef:s,preset:N,getImpacts:()=>h.current.splice(0),getFlakes:()=>d.current.splice(0),orbSnowRef:p})]}),f.jsxs("div",{className:"absolute top-0 left-0 right-0 z-40 px-2 pt-2 pb-2 pointer-events-none [&_button]:pointer-events-auto","data-testid":"map-rail-topbar",children:[f.jsxs("div",{className:"flex p-1 rounded-lg gap-1 mb-2",style:{background:"rgb(var(--surface-rail-rgb) / 0.55)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[f.jsxs("button",{onClick:()=>r("map"),"data-testid":"map-tab-map",className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n==="map"?"bg-brand/20 text-brand":"text-white/50 hover:text-white/80"}`,children:[f.jsx($0,{className:"w-3 h-3"})," ",t("map.tab.map")]}),f.jsxs("button",{onClick:()=>r("import"),"data-testid":"map-tab-import",className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n==="import"?"bg-brand/20 text-brand":"text-white/50 hover:text-white/80"}`,children:[f.jsx(ps,{className:"w-3 h-3"})," ",t("map.tab.import")]})]}),n==="map"&&f.jsxs("div",{className:"px-3 py-2 rounded-lg pointer-events-auto",style:{background:"rgb(var(--surface-rail-rgb) / 0.55)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("h2",{className:"text-body font-extrabold text-white truncate flex-1","data-tooltip":e.courseTitle??"",children:e.courseTitle??t("map.course.none")}),e.availableLanguages.length>0&&f.jsx(Ev,{available:e.availableLanguages,current:e.currentLocale,onChange:e.onLocaleChange}),e.courseId&&f.jsx("button",{onClick:L=>{const z=L.currentTarget.getBoundingClientRect();I({id:e.courseId,title:e.courseTitle??"",rect:z})},"data-testid":"course-delete-btn","aria-label":t("import.delete.current"),"data-tooltip":t("import.delete.current"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/40 hover:text-warning hover:bg-white/10 transition-colors",children:f.jsx(ng,{className:"w-3 h-3"})})]}),f.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[f.jsx("div",{className:"flex-1 h-2.5 bg-black/40 rounded-full overflow-hidden ring-1 ring-white/10",children:f.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${l>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,l)}%`}})}),f.jsxs("span",{className:"text-label font-extrabold tabular-nums text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]",children:[l,"%"]})]}),f.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5 text-caption",children:[f.jsxs("button",{onClick:()=>S(!0),"data-testid":"map-search-btn",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-white/5 ring-1 ring-white/10 hover:bg-white/10 transition-colors",children:[f.jsx(W0,{className:"w-3 h-3 text-white/50"}),f.jsx("span",{className:"font-bold text-white/60",children:t("map.search.label")})]}),f.jsxs("button",{onClick:e.onOpenReview,className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full transition-colors ${e.dueCount>0?"bg-review/20 ring-1 ring-review/30 hover:bg-review/30":"bg-white/5 ring-1 ring-white/10 hover:bg-white/10"}`,"data-testid":"map-review-badge",children:[f.jsx(or,{className:`w-3 h-3 ${e.dueCount>0?"text-review":"text-white/50"}`}),f.jsx("span",{className:`font-bold ${e.dueCount>0?"text-review":"text-white/60"}`,children:t("map.review.label")}),e.dueCount>0&&f.jsx("span",{className:"font-extrabold text-review tabular-nums",children:e.dueCount})]})]}),b&&f.jsxs("div",{className:"flex gap-1 mt-1.5 p-0.5 rounded-lg bg-black/30",children:[f.jsxs("button",{onClick:()=>a("study"),"data-testid":"world-tab-study",className:`flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-caption font-bold transition-colors ${i==="study"?"bg-brand/30 text-brand":"text-white/50 hover:text-white/80"}`,children:[f.jsx(or,{className:"w-3 h-3"})," ",t("map.world.study")]}),f.jsxs("button",{onClick:()=>a("practice"),"data-testid":"world-tab-practice",className:`flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-caption font-bold transition-colors ${i==="practice"?"bg-accent/30 text-accent":"text-white/50 hover:text-white/80"}`,children:[f.jsx(xs,{className:"w-3 h-3"})," ",t("map.world.practice")]})]})]})]}),f.jsx("div",{className:"absolute inset-0 overflow-hidden z-10",children:f.jsxs("div",{className:"flex h-full transition-transform duration-300",style:{transform:n==="map"?"translateX(0)":"translateX(-50%)",width:"200%"},children:[f.jsx("div",{className:"w-1/2 h-full relative",children:f.jsx("div",{ref:o,className:"map-path h-full overflow-y-auto overflow-x-hidden px-2 pt-48 pb-4","data-testid":"map-path",onPointerDown:L=>{R.current={x:L.clientX,y:L.clientY}},onClick:L=>{const z=R.current;R.current=null,!(!z||Math.hypot(L.clientX-z.x,L.clientY-z.y)>6)&&(L.target.closest("button, a, input, textarea, select")||V3(L.clientX,L.clientY))},children:f.jsxs("div",{className:`map-sky-content ${N?`env-${N.season} env-${N.weather}`:""}`,children:[e.streaming&&f.jsxs("div",{className:"mb-3 mx-1 px-3 py-2 rounded-xl bg-brand/10 border border-brand/30 flex items-center gap-2 text-label text-brand font-medium backdrop-blur-sm","data-testid":"streaming-notice",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.streaming.notice")]}),e.sections.length===0?e.courseTitle?f.jsxs("div",{className:"text-center text-label text-white/60 mt-8 px-4 flex items-center justify-center gap-2",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.generating")]}):f.jsxs("button",{onClick:()=>r("import"),className:"block w-full mt-8 mx-auto p-4 rounded-2xl border-2 border-dashed border-brand/40 hover:border-brand hover:bg-brand/5 transition-all text-center group","data-testid":"map-empty-cta",children:[f.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"🗺️"}),f.jsx("div",{className:"text-body font-bold text-white/90 mb-1",children:t("map.empty.cta.title")}),f.jsx("div",{className:"text-label text-white/60 leading-relaxed",children:t("map.empty.cta.desc")}),f.jsx("div",{className:"mt-2 text-caption text-brand font-bold",children:t("map.empty.cta.btn")})]}):x.length===0?f.jsx("div",{className:"text-center text-label text-white/60 mt-8 px-4",children:t(i==="practice"?"map.empty.practice":"map.generating")}):f.jsx("div",{className:"space-y-6 pt-2",children:x.map((L,z)=>f.jsx(bv,{section:L,sectionIndex:z,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,dueNodeIds:e.dueNodeIds,onJumpNode:e.onJumpNode,physics:c,physicsWeather:(N==null?void 0:N.weather)??"clear",scrollRef:o,navRef:s,onImpacts:m,onFlakes:g,orbSnowRef:p},L.id))})]})})}),f.jsx("div",{className:"w-1/2 h-full overflow-y-auto px-3 pt-20 pb-3 space-y-2.5",children:f.jsx(pv,{courses:e.courses,selectedCourseId:e.courseId,onSelectCourse:L=>{e.onSelectCourse(L),r("map")},onDeleteCourse:(L,z,j)=>I({id:L,title:z,rect:j}),onCoursesChanged:e.onCoursesChanged})})]})}),k&&e.courseId&&f.jsx(b5,{sections:e.sections,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onJump:L=>{a(L.world??"study"),S(!1),mc(null,null,L.id),e.onJumpNode(L.id)},onClose:()=>S(!1)}),C&&f.jsx(rl,{anchorRect:C.rect,message:`${C.title} — ${t("import.delete.confirm")}`,danger:!0,confirmLabel:t("import.delete"),testid:"course-delete-confirm",onConfirm:()=>{e.onDeleteCourse(C.id),I(null)},onCancel:()=>I(null)})]})}function pv({courses:e,selectedCourseId:t,onSelectCourse:n,onDeleteCourse:r,onCoursesChanged:i}){const a=$e(),[s,o]=w.useState("url"),[l,u]=w.useState(!1),[c,h]=w.useState(""),[m,d]=w.useState(""),p=w.useRef(null),g=w.useRef(null),x=w.useRef(null),[b,v]=w.useState(""),[E,N]=w.useState(""),[k,S]=w.useState(!1),[_,C]=w.useState(null),[I,A]=w.useState(null),[R,L]=w.useState(null),[z,j]=w.useState(null),[B,H]=w.useState([]),[,Y]=w.useState(0),V=w.useRef(null);w.useEffect(()=>{const de=ie.on("import:progress",pe=>{H(Ne=>{const Oe=/\d+\/\d+/.test(pe),ot=Ne[Ne.length-1];if(Oe&&ot&&ot.status==="working"){const ct=[...Ne];return ct[ct.length-1]={...ot,msg:pe},ct}const Be=Ne.map(ct=>ct.status==="working"?{...ct,status:"done"}:ct);return Be.push({msg:pe,status:"working",ts:Date.now()}),Be})}),he=setInterval(()=>Y(pe=>pe+1),1e3);return()=>{de(),clearInterval(he)}},[]),w.useEffect(()=>ie.on("import:done",he=>{S(!1),_n(!1),he.cancelled||W3(he.ok),L(he.ok?null:he.planId??null),he.ok?(A(`${a("import.success.folder")}: ${he.title??""}${he.reused?`(${a("import.success.reused")})`:""}`),j(he.courseId?{courseId:he.courseId,packable:he.packable??!1}:null),i()):he.cancelled?(H([]),C(null),A(a("import.cancelled"))):C(he.error??"导入失败")}),[i,a]),w.useEffect(()=>{const de=V.current;de&&(de.scrollTop=de.scrollHeight)},[B]);const Z=async()=>{if(!(!c.trim()||k)){C(null),A(null),H([]);try{await ie.importUrl(c.trim()),S(!0),_n(!0)}catch(de){C(de instanceof Error?de.message:String(de))}}},O=async()=>{if(!(!b.trim()||k)){C(null),A(null),H([]);try{await ie.importText({name:E.trim()||void 0,text:b.trim()}),S(!0),_n(!0)}catch(de){C(de instanceof Error?de.message:String(de))}}},X=async()=>{var he;if(k)return;if(C(null),A(null),H([]),!mr){(he=g.current)==null||he.click();return}await ie.importEpub().catch(pe=>(C(pe instanceof Error?pe.message:String(pe)),null))&&(S(!0),_n(!0))},ne=async de=>{if(!(!de||k)){C(null),A(null),H([]);try{const he=new Uint8Array(await de.arrayBuffer());let pe="";for(let Oe=0;Oe<he.length;Oe+=32768)pe+=String.fromCharCode(...he.subarray(Oe,Oe+32768));await ie.importEpub({fileName:de.name,contentBase64:btoa(pe)})&&S(!0),_n(!0)}catch(he){C(he instanceof Error?he.message:String(he))}}},P=async()=>{if(k)return;if(C(null),A(null),H([]),!mr){const he=m.trim();if(!he){C(a("import.folder.pathRequired"));return}try{await ie.importLocalFolder(he)&&S(!0),_n(!0)}catch(pe){C(pe instanceof Error?pe.message:String(pe))}return}await ie.importLocalFolder()&&(S(!0),_n(!0))},te=async()=>{var he;if(k)return;if(C(null),A(null),H([]),!mr){(he=p.current)==null||he.click();return}await ie.importPack().catch(pe=>(C(pe instanceof Error?pe.message:String(pe)),null))&&(S(!0),_n(!0))},Q=async de=>{if(!(!de||k)){C(null),A(null),H([]);try{const he=await de.text();await ie.importPack({fileName:de.name,content:he})&&S(!0),_n(!0)}catch(he){C(he instanceof Error?he.message:String(he))}}},K=async()=>{var he;if(k)return;if(C(null),A(null),H([]),!mr){(he=x.current)==null||he.click();return}await ie.importAudio().catch(pe=>(C(pe instanceof Error?pe.message:String(pe)),null))&&(S(!0),_n(!0))},ce=async de=>{if(!(!de||de.length===0||k)){C(null),A(null),H([]);try{const he=[];for(const Ne of Array.from(de)){const Oe=new Uint8Array(await Ne.arrayBuffer());let ot="";for(let Be=0;Be<Oe.length;Be+=32768)ot+=String.fromCharCode(...Oe.subarray(Be,Be+32768));he.push({fileName:Ne.name,contentBase64:btoa(ot)})}await ie.importAudio(he)&&S(!0),_n(!0)}catch(he){C(he instanceof Error?he.message:String(he))}}},le=async de=>{if(!k){C(null),H([]);try{await ie.importResume(de),S(!0),_n(!0)}catch(he){C(he instanceof Error?he.message:String(he))}}},ee=async de=>{try{const he=await ie.exportPack(de);he!=null&&he.content&&he.fileName?(Ce(he.fileName,he.content),A(a("import.pack.exported",{path:he.fileName}))):he!=null&&he.path&&A(a("import.pack.exported",{path:he.path}))}catch(he){C(he instanceof Error?he.message:String(he))}},Ce=(de,he)=>{const pe=new Blob([he],{type:"application/json"}),Ne=URL.createObjectURL(pe),Oe=document.createElement("a");Oe.href=Ne,Oe.download=de,Oe.click(),setTimeout(()=>URL.revokeObjectURL(Ne),5e3)};return f.jsxs(f.Fragment,{children:[e.length===0?f.jsxs("div",{className:"text-center py-10",children:[f.jsx("div",{className:"text-3xl mb-2 opacity-30",children:"📚"}),f.jsx("p",{className:"text-label text-white/45 leading-relaxed",children:a("import.empty")})]}):f.jsx("div",{className:"space-y-2","data-testid":"course-list",children:e.map(de=>{const he=de.id===t;return f.jsxs("div",{"data-testid":"course-row",className:`relative rounded-xl transition-all duration-150 group ${he?"bg-brand/12 ring-1 ring-brand/40":"bg-white/5 hover:bg-white/10 hover:-translate-y-0.5"}`,children:[f.jsx("button",{onClick:()=>n(de.id),className:"w-full text-left p-3",children:f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`text-body font-bold truncate ${he?"text-brand":"text-white/90"}`,children:de.title}),f.jsx("div",{className:"text-caption text-white/40 truncate mt-0.5",children:de.repoName})]}),he&&f.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-brand flex items-center justify-center",children:f.jsx(Tn,{className:"w-3 h-3 text-white"})})]})}),f.jsxs("div",{className:"absolute bottom-1.5 right-2 flex items-center gap-2.5 opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 focus-within:opacity-100 transition-opacity",children:[f.jsxs("button",{onClick:pe=>{pe.stopPropagation(),C(null),A(null),ie.exportPack(de.id).then(Ne=>{Ne!=null&&Ne.content&&Ne.fileName?(Ce(Ne.fileName,Ne.content),A(a("import.pack.exported",{path:Ne.fileName}))):Ne!=null&&Ne.path&&A(a("import.pack.exported",{path:Ne.path}))}).catch(Ne=>{C(Ne instanceof Error?Ne.message:String(Ne))})},"data-testid":"course-row-export",className:"text-caption text-white/40 hover:text-brand flex items-center gap-0.5",children:[f.jsx(Rh,{className:"w-2.5 h-2.5"})," ",a("import.export")]}),f.jsxs("button",{onClick:pe=>{pe.stopPropagation();const Ne=pe.currentTarget.getBoundingClientRect();r(de.id,de.title,Ne)},"data-testid":"course-row-delete",className:"text-caption text-white/40 hover:text-warning flex items-center gap-0.5",children:[f.jsx(ng,{className:"w-2.5 h-2.5"})," ",a("import.delete")]})]})]},de.id)})}),f.jsxs("div",{className:e.length>0?"mt-6":"",children:[f.jsxs("button",{onClick:()=>u(!l),className:`w-full flex items-center justify-center gap-1.5 py-3 rounded-xl border-2 border-dashed transition-all text-body font-bold ${l?"border-brand/40 bg-brand/8 text-brand":"border-white/20 hover:border-brand/50 hover:bg-brand/8 text-white/70 hover:text-brand"}`,children:[f.jsx(nl,{className:`w-4 h-4 transition-transform ${l?"rotate-45":""}`})," ",a("import.cta")]}),l&&f.jsxs("div",{className:"mt-3 space-y-3",children:[k?f.jsxs("div",{className:"rounded-xl bg-black/30 border border-brand/30 p-4","data-testid":"import-progress",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[f.jsx("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0"}),f.jsx("span",{className:"text-body font-bold text-white/90",children:a("import.progress.title")}),f.jsx("button",{onClick:()=>{ie.importCancel()},"data-testid":"import-cancel-btn",className:"ml-auto text-caption text-white/50 hover:text-warning transition-colors",children:a("import.progress.cancel")})]}),f.jsx("div",{className:"text-caption text-white/40 mb-2.5",children:a("import.progress.note")}),(s==="url"?c.trim():s==="markdown"&&E.trim())?f.jsx("div",{className:"text-caption text-white/40 font-mono truncate mb-2.5",children:s==="url"?c.trim():E.trim()}):null,f.jsx("div",{ref:V,className:"space-y-1.5 max-h-[40vh] overflow-y-auto pr-1",children:B.length===0?f.jsx("div",{className:"text-caption text-white/50 py-1",children:a("import.progress.starting")}):B.map((de,he)=>f.jsxs("div",{className:"flex items-start gap-1.5 text-caption",children:[de.status==="done"?f.jsx(Tn,{className:"w-3 h-3 text-brand shrink-0 mt-px"}):f.jsx("span",{className:"inline-block w-2.5 h-2.5 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0 mt-px"}),f.jsxs("span",{className:de.status==="done"?"text-white/40":"text-white/90",children:[de.msg,de.status==="working"&&f.jsxs("span",{className:"text-white/35 ml-1",children:["(",a("import.progress.elapsed",{s:Math.floor((Date.now()-de.ts)/1e3)}),")"]})]})]},he))})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"@container flex flex-wrap gap-1 p-1 bg-white/5 rounded-lg",children:[{k:"url",label:a("import.tab.url"),icon:Fy},{k:"markdown",label:a("import.tab.md"),icon:ps},{k:"folder",label:a("import.tab.folder"),icon:Ry},{k:"epub",label:a("import.tab.epub"),icon:or},{k:"audio",label:a("import.tab.audio"),icon:Fa},{k:"pack",label:a("import.tab.pack"),icon:Rh}].map(({k:de,label:he,icon:pe})=>f.jsxs("button",{onClick:()=>o(de),className:`min-w-[72px] flex-1 flex items-center justify-center gap-0.5 py-1.5 px-0.5 rounded-md font-bold transition-colors ${s===de?"bg-brand/15 text-brand":"text-white/50 hover:text-white/80"}`,children:[f.jsx(pe,{className:"w-3 h-3 shrink-0"}),f.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"clamp(0.75rem, 4cqi, 0.875rem)"},children:he})]},de))}),s==="url"?f.jsxs("section",{className:"space-y-2","data-testid":"import-url-section",children:[f.jsx("input",{type:"text",value:c,onChange:de=>h(de.target.value),placeholder:a("import.url.placeholder"),"data-testid":"repo-url-input",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),f.jsx("p",{className:"text-caption text-white/45 leading-relaxed",children:a("import.url.desc")}),f.jsx("button",{onClick:Z,disabled:!c.trim()||k,"data-testid":"import-url-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:a("import.btn.url")})]}):s==="markdown"?f.jsxs("section",{className:"space-y-2","data-testid":"import-md-section",children:[f.jsx("input",{type:"text",value:E,onChange:de=>N(de.target.value),placeholder:a("import.placeholder.name"),"data-testid":"md-name-input",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),f.jsx("textarea",{value:b,onChange:de=>v(de.target.value),placeholder:a("import.placeholder.md"),"data-testid":"md-text-input",rows:4,className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors resize-none"}),f.jsx("button",{onClick:O,disabled:!b.trim()||k,"data-testid":"import-md-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:a("import.btn.md")})]}):s==="folder"?f.jsxs("section",{className:"space-y-2","data-testid":"import-folder-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:a("import.folder.desc")}),!mr&&f.jsx("input",{type:"text",value:m,onChange:de=>d(de.target.value),placeholder:a("import.folder.pathPlaceholder"),"data-testid":"import-folder-path",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),f.jsx("button",{onClick:P,disabled:k||!mr&&!m.trim(),"data-testid":"import-folder-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:a("import.btn.folder")})]}):s==="epub"?f.jsxs("section",{className:"space-y-2","data-testid":"import-epub-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:a("import.epub.desc")}),!mr&&f.jsx("input",{ref:g,type:"file",accept:".epub,application/epub+zip",className:"hidden","data-testid":"import-epub-file",onChange:de=>{var he;ne((he=de.target.files)==null?void 0:he[0]),de.currentTarget.value=""}}),f.jsx("button",{onClick:X,disabled:k,"data-testid":"import-epub-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:a("import.btn.epub")})]}):s==="audio"?f.jsxs("section",{className:"space-y-2","data-testid":"import-audio-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:a("import.audio.desc")}),!mr&&f.jsx("input",{ref:x,type:"file",multiple:!0,accept:".wav,.mp3,.m4a,.flac,.aac,.ogg,.opus,audio/*",className:"hidden","data-testid":"import-audio-file",onChange:de=>{ce(de.target.files),de.currentTarget.value=""}}),f.jsx("button",{onClick:K,disabled:k,"data-testid":"import-audio-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:a("import.btn.audio")})]}):f.jsxs("section",{className:"space-y-2","data-testid":"import-pack-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:a("import.pack.desc")}),!mr&&f.jsx("input",{ref:p,type:"file",accept:".json,application/json",className:"hidden","data-testid":"import-pack-file",onChange:de=>{var he;Q((he=de.target.files)==null?void 0:he[0]),de.currentTarget.value=""}}),f.jsx("button",{onClick:te,disabled:k,"data-testid":"import-pack-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:a("import.btn.pack")})]})]}),_&&f.jsxs("div",{className:"border border-warning/40 text-warning-light text-label rounded-lg p-2 whitespace-pre-wrap","data-testid":"import-error",children:[_,R&&f.jsx("button",{onClick:()=>void le(R),disabled:k,"data-testid":"import-resume-btn",className:"block mt-1.5 text-label font-bold text-warning-light hover:text-warning underline underline-offset-2 disabled:opacity-40",children:a("import.error.resume")})]}),I&&f.jsxs("div",{className:"border border-brand/30 text-brand text-label rounded-lg p-2","data-testid":"import-success",children:[f.jsx(Tn,{className:"inline-block w-3.5 h-3.5 mr-1 align-[-3px]"}),I,(z==null?void 0:z.packable)&&f.jsx("button",{onClick:()=>void ee(z.courseId),disabled:k,"data-testid":"import-export-pack-btn",className:"block mt-1.5 text-label font-bold hover:underline underline-offset-2 disabled:opacity-40",children:a("import.pack.export")})]})]})]})]})}function gv({scrollRef:e,navRef:t,preset:n}){const r=w.useRef(null);return w.useEffect(()=>{const i=r.current,a=e.current,s=t.current;return!i||!a||!s?void 0:hv(i,a,s,n)},[e,t,n]),f.jsx("canvas",{ref:r,className:"map-sky-canvas","aria-hidden":"true"})}function xv({scrollRef:e,navRef:t,preset:n,getImpacts:r,getFlakes:i,orbSnowRef:a}){const s=w.useRef(null);return w.useEffect(()=>{const o=s.current,l=t.current,u=e.current;if(!o||!l||!u)return;let c=null,h=null;const m=()=>{c=null,h=null},d=new MutationObserver(m);d.observe(u,{childList:!0,subtree:!0}),window.addEventListener("resize",m);const g=fv(o,l,n,()=>{var v,E;c||(c=Array.from(u.querySelectorAll(".lesson-bubble")));const x=h??l.getBoundingClientRect();h=x;const b=[];for(const N of c){const k=N.getBoundingClientRect();if(k.bottom<x.top||k.top>x.bottom)continue;const S=(v=N.closest("[data-node-id]"))==null?void 0:v.getAttribute("data-node-id"),_=S?(E=a==null?void 0:a.current)==null?void 0:E.get(S):void 0;b.push({x:k.left-x.left+k.width/2,y:k.top-x.top+k.height/2,r:k.width/2,..._!==void 0?{snow:_}:{}})}return b},r,i);return()=>{g(),d.disconnect(),window.removeEventListener("resize",m)}},[e,t,n,r,i]),f.jsx("canvas",{ref:s,className:"map-orb-weather-canvas","aria-hidden":"true"})}function bv({section:e,sectionIndex:t,tree:n,progressMap:r,selectedNodeId:i,dueNodeIds:a,onJumpNode:s,physics:o,physicsWeather:l,scrollRef:u,navRef:c,onImpacts:h,onFlakes:m,orbSnowRef:d}){const p=n.filter(Q=>Q.parentId===e.id).sort((Q,K)=>Q.orderIdx-K.orderIdx),g=p.filter(Q=>Q.type==="lesson"),x=g.length>0&&g.every(Q=>{var K;return(((K=r[Q.id])==null?void 0:K.mastery)??0)>=ag}),b=w.useRef(null),[v,E]=w.useState(268);w.useEffect(()=>{if(!b.current)return;const Q=()=>{var le;const ce=((le=b.current)==null?void 0:le.clientWidth)??268;E(ce>0?ce:268)};Q();const K=new ResizeObserver(Q);return K.observe(b.current),()=>K.disconnect()},[]);const N=C5(p.length,v,e.id),k=N.height,S=110,_=76,C=w.useRef(null),I=w.useRef(new Map),A=w.useRef(0),R=w.useRef(null),L=w.useRef(0),z=p.map(Q=>Q.id).join(","),j=p.map(Q=>{var K;return(Q.type==="exam"?!x:(((K=r[Q.id])==null?void 0:K.status)??"locked")==="locked")?1:0}).join("");w.useEffect(()=>{var mt,Qe;if(!o||p.length===0||v<=0)return;const Q=b.current,K=u.current;if(!Q||!K)return;let ce;const le=p[p.length-1];if((le==null?void 0:le.type)==="exam"){const Pe=(Qe=(mt=Q.closest("section"))==null?void 0:mt.nextElementSibling)==null?void 0:Qe.querySelector(".map-signpost");Pe&&(ce={x:Ds(`${e.id}:next`,v),y:Pe.getBoundingClientRect().top-Q.getBoundingClientRect().top})}const ee=V5({nodes:N.nodes.map((Pe,oe)=>{const ge=p[oe];return{id:ge.id,x:Pe.x,y:Pe.y,isExam:ge.type==="exam",locked:B(ge),spawn:(()=>{const _e=I.current.get(ge.id);return _e?q5(_e,A.current,v):void 0})()}}),width:v,height:N.height+40,weather:l,anchorKnotX:Ds(`${e.id}:knot`,v),nextKnot:ce});C.current=ee,q3(e.id,ee,Q);const Ce=Q.querySelector("[data-next-knot]");Ce&&(ee.nextKnot?(Ce.setAttribute("cx",String(ee.nextKnot.x)),Ce.setAttribute("cy",String(ee.nextKnot.y))):Ce.setAttribute("opacity","0"));const de=Q.querySelector("[data-exam-rope]");de&&!ee.nextKnot&&de.setAttribute("opacity","0");const he=new Map;for(const Pe of Q.querySelectorAll("[data-node-id]"))Pe.dataset.nodeId&&he.set(Pe.dataset.nodeId,Pe);const pe=Array.from(Q.querySelectorAll("[data-rope]")),Ne=Array.from(Q.querySelectorAll("[data-pulse]")),Oe=Array.from(Q.querySelectorAll("[data-field]"));let ot=!0;const Be=new IntersectionObserver(Pe=>{for(const oe of Pe)ot=oe.isIntersecting},{root:K,rootMargin:"200px 0px 200px 0px"});Be.observe(Q);const ct=520,me=[];let Ue=0,dt=performance.now();const nt=Pe=>{var ze;Ue=requestAnimationFrame(nt);const oe=Math.min(50,Pe-dt);if(dt=Pe,!ot)return;ee.step(oe);for(const ye of ee.balls){const Re=he.get(ye.nodeId);Re&&(Re.style.transform=O5(ye.body.position.x-ye.layoutX,ye.body.position.y-ye.layoutY,ye.squash,ye.squashAngle)),ye.squash=P5(ye.squash,oe),(ze=d.current)==null||ze.set(ye.nodeId,ye.snow)}const ge=ye=>{if(ye==="__anchor")return ee.anchor;if(ye==="__next")return ee.nextKnot??ee.anchor;const Re=ee.ball(ye);if(Re)return{x:Re.body.position.x,y:Re.body.position.y+Ln*xr};const He=p.findIndex(en=>en.id===ye),ht=He>=0?N.nodes[He]:void 0;return ht?{x:ht.x,y:ht.y+Ln*xr}:{x:0,y:0}};for(let ye=0;ye<ee.links.length&&ye<pe.length;ye++){const Re=ee.links[ye],He=[ge(Re.from)];for(const ht of Re.particles)He.push({x:ht.position.x,y:ht.position.y});He.push(ge(Re.to)),pe[ye].setAttribute("d",D5(He))}for(let ye=0;ye<ee.balls.length&&ye<Oe.length;ye++){const Re=ee.balls[ye],He=Oe[ye];Re.field>.03?(He.setAttribute("cx",String(Re.body.position.x)),He.setAttribute("cy",String(Re.body.position.y)),He.setAttribute("r",String(Ln+4+Re.field*5)),He.setAttribute("opacity",String((.3*Re.field).toFixed(3)))):He.setAttribute("opacity","0")}const _e=ee.drainImpacts();for(const ye of _e)me.push({x:ye.x,y:ye.y,t0:Pe,s:Math.min(1,ye.speed/14)});for(let ye=me.length-1;ye>=0;ye--)Pe-me[ye].t0>ct&&me.splice(ye,1);for(let ye=0;ye<Ne.length;ye++){const Re=me[ye],He=Ne[ye];if(!Re){He.setAttribute("opacity","0");continue}const ht=(Pe-Re.t0)/ct;He.setAttribute("cx",String(Re.x)),He.setAttribute("cy",String(Re.y)),He.setAttribute("r",String(6+ht*(14+Re.s*14))),He.setAttribute("opacity",String(.55*(1-ht))),He.setAttribute("stroke-width",String(2+Re.s*1.5))}const Ae=ee.drainFlakes();if((_e.length>0||Ae.length>0)&&c.current){const ye=Q.getBoundingClientRect(),Re=c.current.getBoundingClientRect(),He=ht=>({x:ht.x+ye.left-Re.left,y:ht.y+ye.top-Re.top});_e.length>0&&h(_e.map(ht=>({...He(ht),speed:ht.speed}))),Ae.length>0&&m(Ae.map(ht=>({...He(ht),vx:ht.vx,vy:ht.vy,amount:ht.amount})))}};return Ue=requestAnimationFrame(nt),()=>{cancelAnimationFrame(Ue),Be.disconnect();for(const Pe of ee.balls)I.current.set(Pe.nodeId,{x:Pe.body.position.x,y:Pe.body.position.y,vx:Pe.body.velocity.x,vy:Pe.body.velocity.y});A.current=v,$3(e.id),ee.dispose(),C.current=null;for(const Pe of he.values())Pe.style.transform=""}},[o,v,z,j,e.id,l]);const B=Q=>{var K;return Q?Q.type==="exam"?!x:(((K=r[Q.id])==null?void 0:K.status)??"locked")==="locked":!0},H=(Q,K)=>{if(!(!C.current||Q.button!==0||B(p.find(ee=>ee.id===K))||!b.current)){try{Q.currentTarget.setPointerCapture(Q.pointerId)}catch{}L.current=0,R.current={track:{startX:Q.clientX,startY:Q.clientY},id:Q.pointerId,dragging:!1,nodeId:K}}},Y=Q=>{const K=R.current,ce=C.current;if(!K||!ce||Q.pointerId!==K.id)return;const le=b.current;if(!le||(!K.dragging&&jh(K.track,Q.clientX,Q.clientY)==="drag"&&(K.dragging=!0,Q.currentTarget.style.zIndex="40",ce.beginDrag(K.nodeId,Q.clientX-le.getBoundingClientRect().left,Q.clientY-le.getBoundingClientRect().top)),!K.dragging))return;const ee=le.getBoundingClientRect();ce.moveDrag(Q.clientX-ee.left,Q.clientY-ee.top)},V=Q=>{var ce;const K=R.current;if(!(!K||Q.pointerId!==K.id)){if((ce=C.current)==null||ce.endDrag(),Q.currentTarget.style.zIndex="",jh(K.track,Q.clientX,Q.clientY)==="drag")L.current=Date.now()+300;else{const le=p.find(ee=>ee.id===K.nodeId);le&&Date.now()>=L.current&&!B(le)&&(mc(Q.clientX,Q.clientY,le.id),s(le.id))}R.current=null}},Z=Q=>{const K=p[Q],ce=K?r[K.id]:void 0,le=(ce==null?void 0:ce.status)==="mastered"||(ce==null?void 0:ce.status)==="in_progress"||(ce==null?void 0:ce.status)==="available";return{stroke:le?"var(--brand)":"var(--ink-faint)",strokeWidth:le?4:2.5,strokeOpacity:le?.6:.5,strokeDasharray:le?"none":"3 7"}},O=N.nodes[0]?{x:Ds(`${e.id}:knot`,v),y:Ro}:{x:v/2,y:Ro},X=p[p.length-1],ne=(X==null?void 0:X.type)==="exam",P=N.nodes[N.nodes.length-1],te=ne&&P?{x:Ds(`${e.id}:next`,v),y:k+24}:void 0;return f.jsxs("section",{"data-testid":`map-section-${e.id.slice(0,8)}`,className:"py-3 px-2",children:[f.jsxs("div",{className:"map-signpost flex items-center gap-2 mb-3 px-2.5 py-1.5 rounded-lg shadow-sm",children:[f.jsx("span",{className:"w-6 h-6 rounded-full bg-gold text-neutral-900 text-caption font-extrabold flex items-center justify-center shrink-0 ring-2 ring-gold/40 shadow-sm",children:t+1}),f.jsx("span",{className:"text-label font-bold text-white truncate flex-1 drop-shadow-[0_1px_2px_rgba(0,0,0,0.7)]",children:e.title})]}),f.jsxs("div",{ref:b,className:"relative",style:{minHeight:k},children:[f.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{height:k,overflow:"visible"},children:o?f.jsxs(f.Fragment,{children:[N.nodes[0]&&f.jsx("circle",{cx:O.x,cy:O.y,r:3.5,fill:"#ffc800",opacity:.9}),N.nodes[0]&&f.jsx("path",{"data-rope":0,d:`M ${O.x} ${O.y} L ${N.nodes[0].x} ${N.nodes[0].y+Ln*xr}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:Z(0)}),N.segments.map((Q,K)=>f.jsx("path",{"data-rope":K+1,d:`M ${Q.from.x} ${Q.from.y+Ln*xr} L ${Q.to.x} ${Q.to.y+Ln*xr}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:Z(Q.index)},Q.index)),te&&P&&f.jsxs(f.Fragment,{children:[f.jsx("path",{"data-rope":N.segments.length+1,"data-exam-rope":!0,d:`M ${te.x} ${te.y} L ${P.x} ${P.y+Ln*xr}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:Z(p.length-1)}),f.jsx("circle",{"data-next-knot":!0,cx:te.x,cy:te.y,r:3.5,fill:"#ffc800",opacity:.9})]}),Array.from({length:8},(Q,K)=>f.jsx("circle",{"data-pulse":K,cx:0,cy:0,r:0,fill:"none",stroke:"white",opacity:0},K)),p.map((Q,K)=>f.jsx("circle",{"data-field":K,cx:0,cy:0,r:0,fill:"none",stroke:"#1cb0f6",strokeWidth:2,opacity:0},`f-${Q.id}`))]}):N.segments.map(Q=>{const K=yv(p[Q.index],r);return f.jsx("path",{d:N5(Q),stroke:K?"var(--brand)":"var(--ink-faint)",strokeWidth:K?4:2.5,strokeOpacity:K?.6:.5,fill:"none",strokeLinecap:"round",strokeDasharray:K?"none":"3 7",style:K?{pathLength:1,animation:"path-draw 600ms var(--ease-out-expo)"}:void 0},Q.index)})}),p.map((Q,K)=>{const ce=N.nodes[K];if(!ce)return null;const le=Tc(Q.id),ee=`${le%40/10}s`,Ce=`${5+le%30/10}s`;return f.jsx("div",{"data-node-id":Q.id,"data-noswipe":"",className:o?`absolute hover:z-30 will-change-transform ${B(Q)?"cursor-not-allowed":"cursor-grab active:cursor-grabbing"}`:"absolute balloon-bob hover:z-30",style:{left:ce.x-S/2,top:ce.y-_/2+10,width:S,...o?{touchAction:"pan-y"}:{"--bob-delay":ee,"--bob-duration":Ce}},onPointerDown:o?de=>H(de,Q.id):void 0,onPointerMove:o?Y:void 0,onPointerUp:o?V:void 0,onPointerCancel:o?V:void 0,children:f.jsx(vv,{lesson:Q,progress:r[Q.id],isSelected:Q.id===i,isDue:a.has(Q.id),chapterLessonsMastered:x,onClick:()=>{Date.now()<L.current||(mc(null,null,Q.id),s(Q.id))}})},Q.id)})]})]})}function yv(e,t){const n=e?t[e.id]:void 0;return(n==null?void 0:n.status)==="mastered"||(n==null?void 0:n.status)==="in_progress"||(n==null?void 0:n.status)==="available"}function vv({lesson:e,progress:t,isSelected:n,isDue:r,chapterLessonsMastered:i,onClick:a}){const s=$e(),o=(t==null?void 0:t.status)??"locked",l=(t==null?void 0:t.crownLevel)??0,u=e.type==="exam",c=Math.min(3,l),h=u?!i:o==="locked",m=u&&h,d=!u&&(o==="in_progress"||o==="mastered"),p=o==="mastered"?100:o==="in_progress"?Math.round(((t==null?void 0:t.mastery)??0)*100):0;return f.jsxs("div",{className:"group relative flex flex-col items-center w-full",children:[f.jsxs("button",{onClick:()=>!h&&a(),disabled:h,"data-testid":`${u?"exam-node":"map-node"}-${e.id.slice(0,8)}`,className:`group relative w-14 h-14 flex items-center justify-center text-2xl rounded-full transition-all duration-200 ${u?m?"lesson-bubble exam-bubble-locked":kv(l>0):wv(o)} ${h?"cursor-not-allowed":"cursor-pointer hover:scale-105"} ${n?"ring-4 ring-accent ring-offset-2 ring-offset-neutral-50 dark:ring-offset-neutral-950":""}`,title:void 0,"data-tooltip":m?`🔒 ${e.title}${s("node.locked.chapterHint")}`:u?`🎯 ${e.title}`:h?`🔒 ${e.title}`:r?`📖 ${e.title}${s("node.due.hint")}`:e.title,children:[d&&f.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90 pointer-events-none",viewBox:"0 0 56 56","aria-hidden":"true",children:[f.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"rgb(255 255 255 / 0.2)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:o==="mastered"?"#ffc800":"white",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${p/100*157} 157`,className:"transition-all duration-500"})]}),u?m?f.jsx("span",{"aria-label":"exam-locked",className:"relative z-10 opacity-60",children:"🔒"}):f.jsx($i,{"aria-label":"exam",className:"relative z-10 w-6 h-6 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.4)]",strokeWidth:2.5}):h?f.jsx("span",{"aria-label":"locked",className:"relative z-10 opacity-50",children:"🔒"}):o==="mastered"?f.jsx("span",{"aria-label":"mastered",className:"relative z-10 drop-shadow-lg crown-sparkle",children:"👑"}):o==="in_progress"?f.jsx(or,{"aria-label":"in-progress",className:"relative z-10 w-6 h-6 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.4)]",strokeWidth:2.5}):f.jsx("span",{"aria-label":"available",className:"relative z-10 drop-shadow",children:"⭐"}),r&&!h&&!u&&f.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-review text-white text-caption flex items-center justify-center font-bold border-2 border-neutral-50 dark:border-neutral-950",children:"!"})]}),u&&f.jsx("div",{className:"flex gap-0.5 mt-1","data-testid":`map-stars-${e.id.slice(0,8)}`,children:[0,1,2].map(g=>f.jsx("span",{className:`text-caption ${g<c?"text-gold":"text-white/25"}`,children:"★"},g))}),n&&f.jsx("div",{className:"mt-1 text-caption text-center leading-tight max-w-[120px] font-bold px-1.5 py-0.5 rounded-md bg-brand/90 text-white shadow-sm",children:e.title})]})}function wv(e){switch(e){case"locked":return"lesson-bubble lesson-bubble-locked";case"available":return"lesson-bubble lesson-bubble-available";case"in_progress":return"lesson-bubble lesson-bubble-in-progress";case"mastered":return"lesson-bubble lesson-bubble-mastered";default:return"lesson-bubble lesson-bubble-locked"}}function kv(e){return e?"lesson-bubble exam-bubble-passed":"lesson-bubble exam-bubble"}function Ev({available:e,current:t,onChange:n}){const r=$e(),[i,a]=w.useState(!1),s={en:"English","zh-CN":"中文","zh-TW":"繁體",ja:"日本語",ko:"한국어",fr:"Français",de:"Deutsch",es:"Español","pt-BR":"Português",ru:"Русский",it:"Italiano",ar:"العربية",hi:"हिन्दी",tr:"Türkçe",pl:"Polski",nl:"Nederlands",id:"Indonesia",vi:"Tiếng Việt",th:"ไทย",sv:"Svenska",fi:"Suomi"},o=t?s[t]??t:r("lang.original");return f.jsxs("div",{className:"relative shrink-0",children:[f.jsxs("button",{onClick:()=>a(!i),className:"flex items-center gap-1 px-1.5 py-0.5 rounded-md text-caption font-bold text-white/80 hover:text-white hover:bg-white/10 transition-colors","data-testid":"lang-switcher-btn",children:[f.jsx(Dy,{className:"w-3 h-3"}),o]}),i&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),f.jsxs("div",{className:"absolute top-full right-0 mt-1 z-50 bg-surface-0 rounded-lg shadow-elevated p-1 min-w-[100px] max-h-48 overflow-y-auto",children:[f.jsx("button",{"data-testid":"lang-option-original",onClick:()=>{n(null),a(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===null?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:r("lang.original")}),e.map(l=>f.jsx("button",{"data-testid":`lang-option-${l}`,onClick:()=>{n(l),a(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===l?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:s[l]??l},l))]})]})]})}const Tv=500,ei=8;function Sv(){const[e,t]=w.useState(null),[n,r]=w.useState({mode:"cursor",x:0,y:0}),[i,a]=w.useState({w:0,h:0}),s=w.useRef(null),o=w.useCallback(()=>window.matchMedia("(pointer: coarse)").matches,[]),l=w.useCallback(x=>{o()||r(b=>b.mode==="cursor"?{...b,x:x.clientX,y:x.clientY}:b)},[o]),u=w.useCallback(x=>{var E;if(o())return;const b=(E=x.target)==null?void 0:E.closest("[data-tooltip]"),v=b==null?void 0:b.getAttribute("data-tooltip");if(v){t(v),r({mode:"cursor",x:x.clientX,y:x.clientY});return}t(null)},[o]),c=w.useCallback(x=>{var v,E;if(o())return;((E=(v=x.target)==null?void 0:v.closest)==null?void 0:E.call(v,"[data-tooltip]"))&&t(null)},[o]);if(w.useEffect(()=>(document.addEventListener("mousemove",l,{passive:!0}),document.addEventListener("mouseover",u,{passive:!0}),document.addEventListener("mouseout",c,{passive:!0}),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseover",u),document.removeEventListener("mouseout",c)}),[l,u,c]),w.useEffect(()=>{let x=null;const b=()=>{x&&(clearTimeout(x),x=null)},v=S=>{var A;if(!o()||S.touches.length!==1)return b();const _=(A=S.target)==null?void 0:A.closest("[data-tooltip]"),C=_==null?void 0:_.getAttribute("data-tooltip");if(!C||!_)return b();const I=_;b(),x=setTimeout(()=>{I.isConnected&&(t(C),r({mode:"rect",x:0,y:0,rect:I.getBoundingClientRect()}))},Tv)},E=()=>{b(),t(S=>S&&null)},N=()=>b(),k=()=>{b(),t(null)};return document.addEventListener("touchstart",v,{passive:!0}),document.addEventListener("touchend",E,{passive:!0}),document.addEventListener("touchmove",N,{passive:!0}),document.addEventListener("touchcancel",k,{passive:!0}),()=>{b(),document.removeEventListener("touchstart",v),document.removeEventListener("touchend",E),document.removeEventListener("touchmove",N),document.removeEventListener("touchcancel",k)}},[o]),w.useLayoutEffect(()=>{s.current&&e&&a({w:s.current.offsetWidth,h:s.current.offsetHeight})},[e]),!e)return null;const h=window.innerWidth,m=window.innerHeight;let d,p,g;if(n.mode==="rect"&&n.rect){const x=n.rect;d=x.left+x.width/2-i.w/2,p=x.top-i.h-6,g="none",p<ei&&(p=x.bottom+6)}else d=n.x,p=n.y-6,g="translate(0, -100%)";return d=Math.min(Math.max(d,ei),Math.max(ei,h-i.w-ei)),p=Math.min(Math.max(p,ei),Math.max(ei,m-i.h-ei)),K0.createPortal(f.jsx("div",{ref:s,style:{position:"fixed",left:d,top:p,transform:g,zIndex:99999,pointerEvents:"none",visibility:i.w?"visible":"hidden",background:"rgb(var(--surface-0-rgb) / 0.92)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",color:"var(--ink)",border:"1px solid rgb(var(--border-rgb) / 0.5)",fontSize:"0.875rem",fontWeight:600,lineHeight:1.4,padding:"4px 10px",borderRadius:"8px",maxWidth:"260px",wordBreak:"break-word",boxShadow:"0 4px 12px rgb(var(--shadow-rgb) / 0.15)",whiteSpace:"normal"},children:e}),document.body)}function qh(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function xg(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Av=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nv={};function $h(e,t){return(Nv.jsx?Cv:Av).test(e)}const Mv=/[ \t\n\f\r]/g;function Iv(e){return typeof e=="object"?e.type==="text"?Wh(e.value):!1:Wh(e)}function Wh(e){return e.replace(Mv,"")===""}class bs{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}bs.prototype.normal={};bs.prototype.property={};bs.prototype.space=void 0;function bg(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new bs(n,r,t)}function is(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let _v=0;const Ke=Si(),Bt=Si(),Sc=Si(),ke=Si(),bt=Si(),gi=Si(),En=Si();function Si(){return 2**++_v}const Ac=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Bt,commaOrSpaceSeparated:En,commaSeparated:gi,number:ke,overloadedBoolean:Sc,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),tu=Object.keys(Ac);class Z0 extends vn{constructor(t,n,r,i){let a=-1;if(super(t,n),Gh(this,"space",i),typeof r=="number")for(;++a<tu.length;){const s=tu[a];Gh(this,tu[a],(r&Ac[s])===Ac[s])}}}Z0.prototype.defined=!0;function Gh(e,t,n){n&&(e[t]=n)}function ia(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Z0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[is(r)]=r,n[is(a.attribute)]=r}return new bs(t,n,e.space)}const yg=ia({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:bt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:ke,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:bt,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Bt,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vg(e,t){return t in e?e[t]:t}function wg(e,t){return vg(e,t.toLowerCase())}const Rv=ia({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gi,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alpha:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:bt,autoFocus:Ke,autoPlay:Ke,blocking:bt,capture:null,charSet:null,checked:Ke,cite:null,className:bt,closedBy:null,colorSpace:null,cols:ke,colSpan:ke,command:null,commandFor:null,content:null,contentEditable:Bt,controls:Ke,controlsList:bt,coords:ke|gi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Sc,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:bt,height:ke,hidden:Sc,high:ke,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:bt,itemRef:bt,itemScope:Ke,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:ke,pattern:null,ping:bt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:bt,required:Ke,reversed:Ke,rows:ke,rowSpan:ke,sandbox:bt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootCustomElementRegistry:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shadowRootSerializable:Ke,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Bt,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ke,disablePictureInPicture:Ke,disableRemotePlayback:Ke,exportParts:gi,part:bt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:wg}),Lv=ia({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:En,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:bt,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:gi,g2:gi,glyphName:gi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:En,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:En,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:En,rev:En,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:En,requiredFeatures:En,requiredFonts:En,requiredFormats:En,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:En,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:En,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:En,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vg}),kg=ia({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()}}),Eg=ia({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wg}),Tg=ia({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Dv={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"},Pv=/[A-Z]/g,Yh=/-[a-z]/g,Ov=/^data[-\w.:]+$/i;function ol(e,t){const n=is(t);let r=t,i=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ov.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Yh,Bv);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Yh.test(a)){let s=a.replace(Pv,jv);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Z0}return new i(r,t)}function jv(e){return"-"+e.toLowerCase()}function Bv(e){return e.charAt(1).toUpperCase()}const ys=bg([yg,Rv,kg,Eg,Tg],"html"),$r=bg([yg,Lv,kg,Eg,Tg],"svg");function Kh(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Sg(e){return e.join(" ").trim()}var Li={},nu,Xh;function Fv(){if(Xh)return nu;Xh=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
478
+ `,u="/",c="*",h="",m="comment",d="declaration";function p(x,b){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];b=b||{};var v=1,E=1;function N(j){var B=j.match(t);B&&(v+=B.length);var H=j.lastIndexOf(l);E=~H?j.length-H:E+j.length}function k(){var j={line:v,column:E};return function(B){return B.position=new S(j),I(),B}}function S(j){this.start=j,this.end={line:v,column:E},this.source=b.source}S.prototype.content=x;function _(j){var B=new Error(b.source+":"+v+":"+E+": "+j);if(B.reason=j,B.filename=b.source,B.line=v,B.column=E,B.source=x,!b.silent)throw B}function C(j){var B=j.exec(x);if(B){var H=B[0];return N(H),x=x.slice(H.length),B}}function I(){C(n)}function A(j){var B;for(j=j||[];B=R();)B!==!1&&j.push(B);return j}function R(){var j=k();if(!(u!=x.charAt(0)||c!=x.charAt(1))){for(var B=2;h!=x.charAt(B)&&(c!=x.charAt(B)||u!=x.charAt(B+1));)++B;if(B+=2,h===x.charAt(B-1))return _("End of comment missing");var H=x.slice(2,B-2);return E+=2,N(H),x=x.slice(B),E+=2,j({type:m,comment:H})}}function L(){var j=k(),B=C(r);if(B){if(R(),!C(i))return _("property missing ':'");var H=C(a),Y=j({type:d,property:g(B[0].replace(e,h)),value:H?g(H[0].replace(e,h)):h});return C(s),Y}}function z(){var j=[];A(j);for(var B;B=L();)B!==!1&&(j.push(B),A(j));return j}return I(),z()}function g(x){return x?x.replace(o,h):h}return nu=p,nu}var Qh;function zv(){if(Qh)return Li;Qh=1;var e=Li&&Li.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=n;const t=e(Fv());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const s=(0,t.default)(r),o=typeof i=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:c}=l;o?i(u,c,l):c&&(a=a||{},a[u]=c)}),a}return Li}var Ea={},Zh;function Hv(){if(Zh)return Ea;Zh=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||n.test(u)||e.test(u)},s=function(u,c){return c.toUpperCase()},o=function(u,c){return"".concat(c,"-")},l=function(u,c){return c===void 0&&(c={}),a(u)?u:(u=u.toLowerCase(),c.reactCompat?u=u.replace(i,o):u=u.replace(r,o),u.replace(t,s))};return Ea.camelCase=l,Ea}var Ta,Jh;function Uv(){if(Jh)return Ta;Jh=1;var e=Ta&&Ta.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(zv()),n=Hv();function r(i,a){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(o,l){o&&l&&(s[(0,n.camelCase)(o,a)]=l)}),s}return r.default=r,Ta=r,Ta}var Vv=Uv();const qv=F0(Vv),ll=Ag("end"),ur=Ag("start");function Ag(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Cg(e){const t=ur(e),n=ll(e);if(t&&n)return{start:t,end:n}}function Ha(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ef(e.position):"start"in e||"end"in e?ef(e):"line"in e||"column"in e?Cc(e):""}function Cc(e){return tf(e&&e.line)+":"+tf(e&&e.column)}function ef(e){return Cc(e&&e.start)+"-"+Cc(e&&e.end)}function tf(e){return e&&typeof e=="number"?e:1}class on extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?a.ruleId=r:(a.source=r.slice(0,l),a.ruleId=r.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Ha(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}on.prototype.file="";on.prototype.name="";on.prototype.reason="";on.prototype.message="";on.prototype.stack="";on.prototype.column=void 0;on.prototype.line=void 0;on.prototype.ancestors=void 0;on.prototype.cause=void 0;on.prototype.fatal=void 0;on.prototype.place=void 0;on.prototype.ruleId=void 0;on.prototype.source=void 0;const J0={}.hasOwnProperty,$v=new Map,Wv=/[A-Z]/g,Gv=new Set(["table","tbody","thead","tfoot","tr"]),Yv=new Set(["td","th"]),Ng="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Kv(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=r6(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");r=n6(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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"?$r:ys,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Mg(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Mg(e,t,n){if(t.type==="element")return Xv(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Qv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Jv(e,t,n);if(t.type==="mdxjsEsm")return Zv(e,t);if(t.type==="root")return e6(e,t,n);if(t.type==="text")return t6(e,t)}function Xv(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=$r,e.schema=i),e.ancestors.push(t);const a=_g(e,t.tagName,!1),s=i6(e,t);let o=td(e,t);return Gv.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!Iv(l):!0})),Ig(e,s,a,t),ed(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Qv(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}as(e,t.position)}function Zv(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);as(e,t.position)}function Jv(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=$r,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:_g(e,t.name,!0),s=a6(e,t),o=td(e,t);return Ig(e,s,a,t),ed(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function e6(e,t,n){const r={};return ed(r,td(e,t)),e.create(t,e.Fragment,r,n)}function t6(e,t){return t.value}function Ig(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ed(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function n6(e,t,n){return r;function r(i,a,s,o){const u=Array.isArray(s.children)?n:t;return o?u(a,s,o):u(a,s)}}function r6(e,t){return n;function n(r,i,a,s){const o=Array.isArray(a.children),l=ur(r);return t(i,a,s,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function i6(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&J0.call(t.properties,i)){const a=s6(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Yv.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function a6(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else as(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else as(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function td(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$v;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const l=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const o=Mg(e,a,s);o!==void 0&&n.push(o)}return n}function s6(e,t,n){const r=ol(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xg(n):Sg(n)),r.property==="style"){let i=typeof n=="object"?n:o6(e,String(n));return e.stylePropertyNameCase==="css"&&(i=l6(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Dv[r.property]||r.property:r.attribute,n]}}function o6(e,t){try{return qv(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new on("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ng+"#cannot-parse-style-attribute",i}}function _g(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=$h(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=$h(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return J0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);as(e)}function as(e,t){const n=new on("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=Ng+"#cannot-handle-mdx-estrees-without-createevaluater",n}function l6(e){const t={};let n;for(n in e)J0.call(e,n)&&(t[u6(n)]=e[n]);return t}function u6(e){let t=e.replace(Wv,c6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function c6(e){return"-"+e.toLowerCase()}const ru={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"]},d6={};function nd(e,t){const n=d6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Rg(e,r,i)}function Rg(e,t,n){if(h6(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 nf(e.children,t,n)}return Array.isArray(e)?nf(e,t,n):""}function nf(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Rg(e[i],t,n);return r.join("")}function h6(e){return!!(e&&typeof e=="object")}const rf=document.createElement("i");function rd(e){const t="&"+e+";";rf.innerHTML=t;const n=rf.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Sn(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function Dn(e,t){return e.length>0?(Sn(e,e.length,0,t),e):t}const af={}.hasOwnProperty;function Lg(e){const t={};let n=-1;for(;++n<e.length;)f6(t,e[n]);return t}function f6(e,t){let n;for(n in t){const i=(af.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){af.call(i,s)||(i[s]=[]);const o=a[s];m6(i[s],Array.isArray(o)?o:o?[o]:[])}}}function m6(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Sn(e,0,0,r)}function Dg(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)}function Gn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=Wr(/[A-Za-z]/),an=Wr(/[\dA-Za-z]/),p6=Wr(/[#-'*+\--9=?A-Z^-~]/);function Lo(e){return e!==null&&(e<32||e===127)}const Nc=Wr(/\d/),g6=Wr(/[\dA-Fa-f]/),x6=Wr(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const ul=Wr(new RegExp("\\p{P}|\\p{S}","u")),Ei=Wr(/\s/);function Wr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function aa(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&an(e.charCodeAt(n+1))&&an(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function st(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return ut(l)?(e.enter(n),o(l)):t(l)}function o(l){return ut(l)&&a++<i?(e.consume(l),o):(e.exit(n),t(l))}}const b6={tokenize:y6};function y6(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),st(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Fe(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const v6={tokenize:w6},sf={tokenize:k6};function w6(e){const t=this,n=[];let r=0,i,a,s;return o;function o(E){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,l,u)(E)}return u(E)}function l(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const N=t.events.length;let k=N,S;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){S=t.events[k][1].end;break}b(r);let _=N;for(;_<t.events.length;)t.events[_][1].end={...S},_++;return Sn(t.events,k+1,0,t.events.slice(N)),t.events.length=_,u(E)}return o(E)}function u(E){if(r===n.length){if(!i)return m(E);if(i.currentConstruct&&i.currentConstruct.concrete)return p(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(sf,c,h)(E)}function c(E){return i&&v(),b(r),m(E)}function h(E){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(E)}function m(E){return t.containerState={},e.attempt(sf,d,p)(E)}function d(E){return r++,n.push([t.currentConstruct,t.containerState]),m(E)}function p(E){if(E===null){i&&v(),b(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),g(E)}function g(E){if(E===null){x(e.exit("chunkFlow"),!0),b(0),e.consume(E);return}return Fe(E)?(e.consume(E),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(E),g)}function x(E,N){const k=t.sliceStream(E);if(N&&k.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(k),t.parser.lazy[E.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const _=t.events.length;let C=_,I,A;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(I){A=t.events[C][1].end;break}I=!0}for(b(r),S=_;S<t.events.length;)t.events[S][1].end={...A},S++;Sn(t.events,C+1,0,t.events.slice(_)),t.events.length=S}}function b(E){let N=n.length;for(;N-- >E;){const k=n[N];t.containerState=k[1],k[0].exit.call(t,e)}n.length=E}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function k6(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xi(e){if(e===null||wt(e)||Ei(e))return 1;if(ul(e))return 2}function cl(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Mc={name:"attention",resolveAll:E6,tokenize:T6};function E6(e,t){let n=-1,r,i,a,s,o,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};of(h,-l),of(m,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},a={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Dn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Dn(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=Dn(u,cl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Dn(u,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Dn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Sn(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T6(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xi(r);let a;return s;function s(l){return a=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===a)return e.consume(l),o;const u=e.exit("attentionSequence"),c=Xi(l),h=!c||c===2&&i||n.includes(l),m=!i||i===2&&c||n.includes(r);return u._open=!!(a===42?h:h&&(i||!m)),u._close=!!(a===42?m:m&&(c||!h)),t(l)}}function of(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const S6={name:"autolink",tokenize:A6};function A6(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(d){return hn(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||an(d)?(r=1,o(d)):u(d)}function o(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||an(d))&&r++<32?(e.consume(d),o):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Lo(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),c):p6(d)?(e.consume(d),u):n(d)}function c(d){return an(d)?h(d):n(d)}function h(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):m(d)}function m(d){if((d===45||an(d))&&r++<63){const p=d===45?m:h;return e.consume(d),p}return n(d)}}const vs={partial:!0,tokenize:C6};function C6(e,t,n){return r;function r(a){return ut(a)?st(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Fe(a)?t(a):n(a)}}const Pg={continuation:{tokenize:M6},exit:I6,name:"blockQuote",tokenize:N6};function N6(e,t,n){const r=this;return i;function i(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return ut(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function M6(e,t,n){const r=this;return i;function i(s){return ut(s)?st(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(Pg,t,n)(s)}}function I6(e){e.exit("blockQuote")}const Og={name:"characterEscape",tokenize:_6};function _6(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return x6(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const jg={name:"characterReference",tokenize:R6};function R6(e,t,n){const r=this;let i=0,a,s;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,s=an,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=g6,c):(e.enter("characterReferenceValue"),a=7,s=Nc,c(h))}function c(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return s===an&&!rd(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<a?(e.consume(h),c):n(h)}}const lf={partial:!0,tokenize:D6},uf={concrete:!0,name:"codeFenced",tokenize:L6};function L6(e,t,n){const r=this,i={partial:!0,tokenize:k};let a=0,s=0,o;return l;function l(S){return u(S)}function u(S){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,o=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===o?(s++,e.consume(S),c):s<3?n(S):(e.exit("codeFencedFenceSequence"),ut(S)?st(e,h,"whitespace")(S):h(S))}function h(S){return S===null||Fe(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(lf,g,N)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||Fe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(S)):ut(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),st(e,d,"whitespace")(S)):S===96&&S===o?n(S):(e.consume(S),m)}function d(S){return S===null||Fe(S)?h(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||Fe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(S)):S===96&&S===o?n(S):(e.consume(S),p)}function g(S){return e.attempt(i,N,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),b}function b(S){return a>0&&ut(S)?st(e,v,"linePrefix",a+1)(S):v(S)}function v(S){return S===null||Fe(S)?e.check(lf,g,N)(S):(e.enter("codeFlowValue"),E(S))}function E(S){return S===null||Fe(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),E)}function N(S){return e.exit("codeFenced"),t(S)}function k(S,_,C){let I=0;return A;function A(B){return S.enter("lineEnding"),S.consume(B),S.exit("lineEnding"),R}function R(B){return S.enter("codeFencedFence"),ut(B)?st(S,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):L(B)}function L(B){return B===o?(S.enter("codeFencedFenceSequence"),z(B)):C(B)}function z(B){return B===o?(I++,S.consume(B),z):I>=s?(S.exit("codeFencedFenceSequence"),ut(B)?st(S,j,"whitespace")(B):j(B)):C(B)}function j(B){return B===null||Fe(B)?(S.exit("codeFencedFence"),_(B)):C(B)}}}function D6(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const iu={name:"codeIndented",tokenize:O6},P6={partial:!0,tokenize:j6};function O6(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),st(e,a,"linePrefix",5)(u)}function a(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):Fe(u)?e.attempt(P6,s,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Fe(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function j6(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Fe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):st(e,a,"linePrefix",5)(s)}function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Fe(s)?i(s):n(s)}}const B6={name:"codeText",previous:z6,resolve:F6,tokenize:H6};function F6(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function z6(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function H6(e,t,n){let r=0,i,a;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(a=e.enter("codeTextSequence"),i=0,c(h)):Fe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Fe(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function c(h){return h===96?(e.consume(h),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",u(h))}}class U6{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 r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Sa(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Sa(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Sa(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);Sa(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Sa(this.left,n.reverse())}}}function Sa(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 Bg(e){const t={};let n=-1,r,i,a,s,o,l,u;const c=new U6(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,V6(c,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=c.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},o=c.slice(i,n),o.unshift(r),c.splice(i,n-i+1,o))}}return Sn(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function V6(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],u={};let c,h,m=-1,d=n,p=0,g=0;const x=[g];for(;d;){for(;e.get(++i)[1]!==d;);a.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),h&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=d,d=d.next}for(d=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(g=m+1,x.push(g),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):x.pop(),m=x.length;m--;){const b=o.slice(x[m],x[m+1]),v=a.pop();l.push([v,v+b.length-1]),e.splice(v,2,b)}for(l.reverse(),m=-1;++m<l.length;)u[p+l[m][0]]=p+l[m][1],p+=l[m][1]-l[m][0]-1;return u}const q6={resolve:W6,tokenize:G6},$6={partial:!0,tokenize:Y6};function W6(e){return Bg(e),e}function G6(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):Fe(o)?e.check($6,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Y6(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),st(e,a,"linePrefix")}function a(s){if(s===null||Fe(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Fg(e,t,n,r,i,a,s,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(b){return b===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(b),e.exit(a),m):b===null||b===32||b===41||Lo(b)?n(b):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(b))}function m(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(e.exit("chunkString"),e.exit(o),m(b)):b===null||b===60||Fe(b)?n(b):(e.consume(b),b===92?p:d)}function p(b){return b===60||b===62||b===92?(e.consume(b),d):d(b)}function g(b){return!c&&(b===null||b===41||wt(b))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(b)):c<u&&b===40?(e.consume(b),c++,g):b===41?(e.consume(b),c--,g):b===null||b===32||b===40||Lo(b)?n(b):(e.consume(b),b===92?x:g)}function x(b){return b===40||b===41||b===92?(e.consume(b),g):g(b)}}function zg(e,t,n,r,i,a){const s=this;let o=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(a),c}function c(d){return o>999||d===null||d===91||d===93&&!l||d===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(a),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):Fe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===null||d===91||d===93||Fe(d)||o++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!ut(d)),d===92?m:h)}function m(d){return d===91||d===92||d===93?(e.consume(d),o++,h):h(d)}}function Hg(e,t,n,r,i,a){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,l):n(m)}function l(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),u(m))}function u(m){return m===s?(e.exit(a),l(s)):m===null?n(m):Fe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),st(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(m))}function c(m){return m===s||m===null||Fe(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?h:c)}function h(m){return m===s||m===92?(e.consume(m),c):c(m)}}function Ua(e,t){let n;return r;function r(i){return Fe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?st(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const K6={name:"definition",tokenize:Q6},X6={partial:!0,tokenize:Z6};function Q6(e,t,n){const r=this;let i;return a;function a(d){return e.enter("definition"),s(d)}function s(d){return zg.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return i=Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return wt(d)?Ua(e,u)(d):u(d)}function u(d){return Fg(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(X6,h,h)(d)}function h(d){return ut(d)?st(e,m,"whitespace")(d):m(d)}function m(d){return d===null||Fe(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Z6(e,t,n){return r;function r(o){return wt(o)?Ua(e,i)(o):n(o)}function i(o){return Hg(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ut(o)?st(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Fe(o)?t(o):n(o)}}const J6={name:"hardBreakEscape",tokenize:e8};function e8(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Fe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const t8={name:"headingAtx",resolve:n8,tokenize:r8};function n8(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Sn(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function r8(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),a(c)}function a(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||wt(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Fe(c)?(e.exit("atxHeading"),t(c)):ut(c)?st(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||wt(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const i8=["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"],cf=["pre","script","style","textarea"],a8={concrete:!0,name:"htmlFlow",resolveTo:l8,tokenize:u8},s8={partial:!0,tokenize:d8},o8={partial:!0,tokenize:c8};function l8(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 u8(e,t,n){const r=this;let i,a,s,o,l;return u;function u(P){return c(P)}function c(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),h}function h(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),a=!0,g):P===63?(e.consume(P),i=3,r.interrupt?t:O):hn(P)?(e.consume(P),s=String.fromCharCode(P),x):n(P)}function m(P){return P===45?(e.consume(P),i=2,d):P===91?(e.consume(P),i=5,o=0,p):hn(P)?(e.consume(P),i=4,r.interrupt?t:O):n(P)}function d(P){return P===45?(e.consume(P),r.interrupt?t:O):n(P)}function p(P){const te="CDATA[";return P===te.charCodeAt(o++)?(e.consume(P),o===te.length?r.interrupt?t:L:p):n(P)}function g(P){return hn(P)?(e.consume(P),s=String.fromCharCode(P),x):n(P)}function x(P){if(P===null||P===47||P===62||wt(P)){const te=P===47,Q=s.toLowerCase();return!te&&!a&&cf.includes(Q)?(i=1,r.interrupt?t(P):L(P)):i8.includes(s.toLowerCase())?(i=6,te?(e.consume(P),b):r.interrupt?t(P):L(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):a?v(P):E(P))}return P===45||an(P)?(e.consume(P),s+=String.fromCharCode(P),x):n(P)}function b(P){return P===62?(e.consume(P),r.interrupt?t:L):n(P)}function v(P){return ut(P)?(e.consume(P),v):A(P)}function E(P){return P===47?(e.consume(P),A):P===58||P===95||hn(P)?(e.consume(P),N):ut(P)?(e.consume(P),E):A(P)}function N(P){return P===45||P===46||P===58||P===95||an(P)?(e.consume(P),N):k(P)}function k(P){return P===61?(e.consume(P),S):ut(P)?(e.consume(P),k):E(P)}function S(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),l=P,_):ut(P)?(e.consume(P),S):C(P)}function _(P){return P===l?(e.consume(P),l=null,I):P===null||Fe(P)?n(P):(e.consume(P),_)}function C(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||wt(P)?k(P):(e.consume(P),C)}function I(P){return P===47||P===62||ut(P)?E(P):n(P)}function A(P){return P===62?(e.consume(P),R):n(P)}function R(P){return P===null||Fe(P)?L(P):ut(P)?(e.consume(P),R):n(P)}function L(P){return P===45&&i===2?(e.consume(P),H):P===60&&i===1?(e.consume(P),Y):P===62&&i===4?(e.consume(P),X):P===63&&i===3?(e.consume(P),O):P===93&&i===5?(e.consume(P),Z):Fe(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(s8,ne,z)(P)):P===null||Fe(P)?(e.exit("htmlFlowData"),z(P)):(e.consume(P),L)}function z(P){return e.check(o8,j,ne)(P)}function j(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),B}function B(P){return P===null||Fe(P)?z(P):(e.enter("htmlFlowData"),L(P))}function H(P){return P===45?(e.consume(P),O):L(P)}function Y(P){return P===47?(e.consume(P),s="",V):L(P)}function V(P){if(P===62){const te=s.toLowerCase();return cf.includes(te)?(e.consume(P),X):L(P)}return hn(P)&&s.length<8?(e.consume(P),s+=String.fromCharCode(P),V):L(P)}function Z(P){return P===93?(e.consume(P),O):L(P)}function O(P){return P===62?(e.consume(P),X):P===45&&i===2?(e.consume(P),O):L(P)}function X(P){return P===null||Fe(P)?(e.exit("htmlFlowData"),ne(P)):(e.consume(P),X)}function ne(P){return e.exit("htmlFlow"),t(P)}}function c8(e,t,n){const r=this;return i;function i(s){return Fe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function d8(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(vs,t,n)}}const h8={name:"htmlText",tokenize:f8};function f8(e,t,n){const r=this;let i,a,s;return o;function o(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),l}function l(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),k):O===63?(e.consume(O),E):hn(O)?(e.consume(O),C):n(O)}function u(O){return O===45?(e.consume(O),c):O===91?(e.consume(O),a=0,p):hn(O)?(e.consume(O),v):n(O)}function c(O){return O===45?(e.consume(O),d):n(O)}function h(O){return O===null?n(O):O===45?(e.consume(O),m):Fe(O)?(s=h,Y(O)):(e.consume(O),h)}function m(O){return O===45?(e.consume(O),d):h(O)}function d(O){return O===62?H(O):O===45?m(O):h(O)}function p(O){const X="CDATA[";return O===X.charCodeAt(a++)?(e.consume(O),a===X.length?g:p):n(O)}function g(O){return O===null?n(O):O===93?(e.consume(O),x):Fe(O)?(s=g,Y(O)):(e.consume(O),g)}function x(O){return O===93?(e.consume(O),b):g(O)}function b(O){return O===62?H(O):O===93?(e.consume(O),b):g(O)}function v(O){return O===null||O===62?H(O):Fe(O)?(s=v,Y(O)):(e.consume(O),v)}function E(O){return O===null?n(O):O===63?(e.consume(O),N):Fe(O)?(s=E,Y(O)):(e.consume(O),E)}function N(O){return O===62?H(O):E(O)}function k(O){return hn(O)?(e.consume(O),S):n(O)}function S(O){return O===45||an(O)?(e.consume(O),S):_(O)}function _(O){return Fe(O)?(s=_,Y(O)):ut(O)?(e.consume(O),_):H(O)}function C(O){return O===45||an(O)?(e.consume(O),C):O===47||O===62||wt(O)?I(O):n(O)}function I(O){return O===47?(e.consume(O),H):O===58||O===95||hn(O)?(e.consume(O),A):Fe(O)?(s=I,Y(O)):ut(O)?(e.consume(O),I):H(O)}function A(O){return O===45||O===46||O===58||O===95||an(O)?(e.consume(O),A):R(O)}function R(O){return O===61?(e.consume(O),L):Fe(O)?(s=R,Y(O)):ut(O)?(e.consume(O),R):I(O)}function L(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,z):Fe(O)?(s=L,Y(O)):ut(O)?(e.consume(O),L):(e.consume(O),j)}function z(O){return O===i?(e.consume(O),i=void 0,B):O===null?n(O):Fe(O)?(s=z,Y(O)):(e.consume(O),z)}function j(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||wt(O)?I(O):(e.consume(O),j)}function B(O){return O===47||O===62||wt(O)?I(O):n(O)}function H(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Y(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),V}function V(O){return ut(O)?st(e,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):Z(O)}function Z(O){return e.enter("htmlTextData"),s(O)}}const id={name:"labelEnd",resolveAll:x8,resolveTo:b8,tokenize:y8},m8={tokenize:v8},p8={tokenize:w8},g8={tokenize:k8};function x8(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Sn(e,0,e.length,n),e}function b8(e,t){let n=e.length,r=0,i,a,s,o;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=Dn(o,e.slice(a+1,a+r+3)),o=Dn(o,[["enter",c,t]]),o=Dn(o,cl(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=Dn(o,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),o=Dn(o,e.slice(s+1)),o=Dn(o,[["exit",l,t]]),Sn(e,a,e.length,o),e}function y8(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return o;function o(m){return a?a._inactive?h(m):(s=r.parser.defined.includes(Gn(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(m8,c,s?c:h)(m):m===91?e.attempt(p8,c,s?u:h)(m):s?c(m):h(m)}function u(m){return e.attempt(g8,c,h)(m)}function c(m){return t(m)}function h(m){return a._balanced=!0,n(m)}}function v8(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return wt(h)?Ua(e,a)(h):a(h)}function a(h){return h===41?c(h):Fg(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return wt(h)?Ua(e,l)(h):c(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?Hg(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return wt(h)?Ua(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function w8(e,t,n){const r=this;return i;function i(o){return zg.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function k8(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const E8={name:"labelStartImage",resolveAll:id.resolveAll,tokenize:T8};function T8(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const S8={name:"labelStartLink",resolveAll:id.resolveAll,tokenize:A8};function A8(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const au={name:"lineEnding",tokenize:C8};function C8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),st(e,t,"linePrefix")}}const ho={name:"thematicBreak",tokenize:N8};function N8(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Fe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ut(u)?st(e,o,"whitespace")(u):o(u))}}const bn={continuation:{tokenize:R8},exit:D8,name:"list",tokenize:_8},M8={partial:!0,tokenize:P8},I8={partial:!0,tokenize:L8};function _8(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(d){const p=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Nc(d)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(ho,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return Nc(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(vs,r.interrupt?n:c,e.attempt(M8,m,h))}function c(d){return r.containerState.initialBlankLine=!0,a++,m(d)}function h(d){return ut(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),m):n(d)}function m(d){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function R8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(vs,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,st(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!ut(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(I8,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,st(e,e.attempt(bn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function L8(e,t,n){const r=this;return st(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function D8(e){e.exit(this.containerState.type)}function P8(e,t,n){const r=this;return st(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!ut(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const df={name:"setextUnderline",resolveTo:O8,tokenize:j8};function O8(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function j8(e,t,n){const r=this;let i;return a;function a(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),ut(u)?st(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Fe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const B8={tokenize:F8};function F8(e){const t=this,n=e.attempt(vs,r,e.attempt(this.parser.constructs.flowInitial,i,st(e,e.attempt(this.parser.constructs.flow,i,e.attempt(q6,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const z8={resolveAll:Vg()},H8=Ug("string"),U8=Ug("text");function Ug(e){return{resolveAll:Vg(e==="text"?V8:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,o);return s;function s(c){return u(c)?a(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),a(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=i[c];let m=-1;if(h)for(;++m<h.length;){const d=h[m];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Vg(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function V8(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 r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,o=0,l;for(;a--;){const u=i[a];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)l=!0,o++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const q8={42:bn,43:bn,45:bn,48:bn,49:bn,50:bn,51:bn,52:bn,53:bn,54:bn,55:bn,56:bn,57:bn,62:Pg},$8={91:K6},W8={[-2]:iu,[-1]:iu,32:iu},G8={35:t8,42:ho,45:[df,ho],60:a8,61:df,95:ho,96:uf,126:uf},Y8={38:jg,92:Og},K8={[-5]:au,[-4]:au,[-3]:au,33:E8,38:jg,42:Mc,60:[S6,h8],91:S8,92:[J6,Og],93:id,95:Mc,96:B6},X8={null:[Mc,z8]},Q8={null:[42,95]},Z8={null:[]},J8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Q8,contentInitial:$8,disable:Z8,document:q8,flow:G8,flowInitial:W8,insideSpan:X8,string:Y8,text:K8},Symbol.toStringTag,{value:"Module"}));function e7(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],o=[];const l={attempt:_(k),check:_(S),consume:v,enter:E,exit:N,interrupt:_(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:m,sliceStream:d,write:h};let c=t.tokenize.call(u,l);return t.resolveAll&&a.push(t),u;function h(R){return s=Dn(s,R),x(),s[s.length-1]!==null?[]:(C(t,0),u.events=cl(a,u.events,u),u.events)}function m(R,L){return n7(d(R),L)}function d(R){return t7(s,R)}function p(){const{_bufferIndex:R,_index:L,line:z,column:j,offset:B}=r;return{_bufferIndex:R,_index:L,line:z,column:j,offset:B}}function g(R){i[R.line]=R.column,A()}function x(){let R;for(;r._index<s.length;){const L=s[r._index];if(typeof L=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<L.length;)b(L.charCodeAt(r._bufferIndex));else b(L)}}function b(R){c=c(R)}function v(R){Fe(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,A()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=R}function E(R,L){const z=L||{};return z.type=R,z.start=p(),u.events.push(["enter",z,u]),o.push(z),z}function N(R){const L=o.pop();return L.end=p(),u.events.push(["exit",L,u]),L}function k(R,L){C(R,L.from)}function S(R,L){L.restore()}function _(R,L){return z;function z(j,B,H){let Y,V,Z,O;return Array.isArray(j)?ne(j):"tokenize"in j?ne([j]):X(j);function X(K){return ce;function ce(le){const ee=le!==null&&K[le],Ce=le!==null&&K.null,de=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return ne(de)(le)}}function ne(K){return Y=K,V=0,K.length===0?H:P(K[V])}function P(K){return ce;function ce(le){return O=I(),Z=K,K.partial||(u.currentConstruct=K),K.name&&u.parser.constructs.disable.null.includes(K.name)?Q():K.tokenize.call(L?Object.assign(Object.create(u),L):u,l,te,Q)(le)}}function te(K){return R(Z,O),B}function Q(K){return O.restore(),++V<Y.length?P(Y[V]):H}}}function C(R,L){R.resolveAll&&!a.includes(R)&&a.push(R),R.resolve&&Sn(u.events,L,u.events.length-L,R.resolve(u.events.slice(L),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function I(){const R=p(),L=u.previous,z=u.currentConstruct,j=u.events.length,B=Array.from(o);return{from:j,restore:H};function H(){r=R,u.previous=L,u.currentConstruct=z,u.events.length=j,o=B,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function t7(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function n7(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
479
+ `;break}case-3:{s=`\r
480
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function r7(e){const r={constructs:Lg([J8,...(e||{}).extensions||[]]),content:i(b6),defined:[],document:i(v6),flow:i(B8),lazy:{},string:i(H8),text:i(U8)};return r;function i(a){return s;function s(o){return e7(r,a,o)}}}function i7(e){for(;!Bg(e););return e}const hf=/[\0\t\n\r]/g;function a7(){let e=1,t="",n=!0,r;return i;function i(a,s,o){const l=[];let u,c,h,m,d;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(hf.lastIndex=h,u=hf.exec(a),m=u&&u.index!==void 0?u.index:a.length,d=a.charCodeAt(m),!u){t=a.slice(h);break}if(d===10&&h===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<m&&(l.push(a.slice(h,m)),e+=m-h),d){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const s7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function o7(e){return e.replace(s7,l7)}function l7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return Dg(n.slice(a?2:1),a?16:10)}return rd(n)||e}const qg={}.hasOwnProperty;function u7(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),c7(n)(i7(r7(n).document().write(a7()(e,t,!0))))}function c7(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(me),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(Oe),blockQuote:a(Ce),characterEscape:I,characterReference:I,codeFenced:a(de),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(de,s),codeText:a(he,s),codeTextData:I,data:I,codeFlowValue:I,definition:a(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(Ne),hardBreakEscape:a(ot),hardBreakTrailing:a(ot),htmlFlow:a(Be,s),htmlFlowData:I,htmlText:a(Be,s),htmlTextData:I,image:a(ct),label:s,link:a(me),listItem:a(dt),listItemValue:m,listOrdered:a(Ue,h),listUnordered:a(Ue),paragraph:a(nt),reference:P,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Oe),strong:a(mt),thematicBreak:a(Pe)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:ee,autolinkProtocol:le,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:K,characterReference:ce,codeFenced:l(x),codeFencedFence:g,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:A,codeIndented:l(b),codeText:l(B),codeTextData:A,data:A,definition:l(),definitionDestinationString:N,definitionLabelString:v,definitionTitleString:E,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(z),htmlFlowData:A,htmlText:l(j),htmlTextData:A,image:l(Y),label:Z,labelText:V,lineEnding:R,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:O,resourceTitleString:X,resource:ne,setextHeading:l(C),setextHeadingLineSequence:_,setextHeadingText:S,strong:l(),thematicBreak:l()}};$g(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let ge={type:"root",children:[]};const _e={stack:[ge],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:c,data:n},Ae=[];let ze=-1;for(;++ze<oe.length;)if(oe[ze][1].type==="listOrdered"||oe[ze][1].type==="listUnordered")if(oe[ze][0]==="enter")Ae.push(ze);else{const ye=Ae.pop();ze=i(oe,ye,ze)}for(ze=-1;++ze<oe.length;){const ye=t[oe[ze][0]];qg.call(ye,oe[ze][1].type)&&ye[oe[ze][1].type].call(Object.assign({sliceSerialize:oe[ze][2].sliceSerialize},_e),oe[ze][1])}if(_e.tokenStack.length>0){const ye=_e.tokenStack[_e.tokenStack.length-1];(ye[1]||ff).call(_e,void 0,ye[0])}for(ge.position={start:Nr(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Nr(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ge=t.transforms[ze](ge)||ge;return ge}function i(oe,ge,_e){let Ae=ge-1,ze=-1,ye=!1,Re,He,ht,en;for(;++Ae<=_e;){const jt=oe[Ae];switch(jt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{jt[0]==="enter"?ze++:ze--,en=void 0;break}case"lineEndingBlank":{jt[0]==="enter"&&(Re&&!en&&!ze&&!ht&&(ht=Ae),en=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:en=void 0}if(!ze&&jt[0]==="enter"&&jt[1].type==="listItemPrefix"||ze===-1&&jt[0]==="exit"&&(jt[1].type==="listUnordered"||jt[1].type==="listOrdered")){if(Re){let tn=Ae;for(He=void 0;tn--;){const Je=oe[tn];if(Je[1].type==="lineEnding"||Je[1].type==="lineEndingBlank"){if(Je[0]==="exit")continue;He&&(oe[He][1].type="lineEndingBlank",ye=!0),Je[1].type="lineEnding",He=tn}else if(!(Je[1].type==="linePrefix"||Je[1].type==="blockQuotePrefix"||Je[1].type==="blockQuotePrefixWhitespace"||Je[1].type==="blockQuoteMarker"||Je[1].type==="listItemIndent"))break}ht&&(!He||ht<He)&&(Re._spread=!0),Re.end=Object.assign({},He?oe[He][1].start:jt[1].end),oe.splice(He||Ae,0,["exit",Re,jt[2]]),Ae++,_e++}if(jt[1].type==="listItemPrefix"){const tn={type:"listItem",_spread:!1,start:Object.assign({},jt[1].start),end:void 0};Re=tn,oe.splice(Ae,0,["enter",tn,jt[2]]),Ae++,_e++,ht=void 0,en=!0}}}return oe[ge][1]._spread=ye,_e}function a(oe,ge){return _e;function _e(Ae){o.call(this,oe(Ae),Ae),ge&&ge.call(this,Ae)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(oe,ge,_e){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ge,_e||void 0]),oe.position={start:Nr(ge.start),end:void 0}}function l(oe){return ge;function ge(_e){oe&&oe.call(this,_e),u.call(this,_e)}}function u(oe,ge){const _e=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==oe.type&&(ge?ge.call(this,oe,Ae[0]):(Ae[1]||ff).call(this,oe,Ae[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Ha({start:oe.start,end:oe.end})+"): it’s not open");_e.position.end=Nr(oe.end)}function c(){return nd(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(oe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function d(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=oe}function p(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=oe}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/(\r?\n|\r)$/g,"")}function v(oe){const ge=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ge,_e.identifier=Gn(this.sliceSerialize(oe)).toLowerCase()}function E(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function N(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function k(oe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const _e=this.sliceSerialize(oe).length;ge.depth=_e}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function _(oe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function I(oe){const _e=this.stack[this.stack.length-1].children;let Ae=_e[_e.length-1];(!Ae||Ae.type!=="text")&&(Ae=Qe(),Ae.position={start:Nr(oe.start),end:void 0},_e.push(Ae)),this.stack.push(Ae)}function A(oe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(oe),ge.position.end=Nr(oe.end)}function R(oe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=ge.children[ge.children.length-1];_e.position.end=Nr(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(I.call(this,oe),A.call(this,oe))}function L(){this.data.atHardBreak=!0}function z(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function j(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function B(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function H(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Y(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function V(oe){const ge=this.sliceSerialize(oe),_e=this.stack[this.stack.length-2];_e.label=o7(ge),_e.identifier=Gn(ge).toLowerCase()}function Z(){const oe=this.stack[this.stack.length-1],ge=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Ae=oe.children;_e.children=Ae}else _e.alt=ge}function O(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function X(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function ne(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function te(oe){const ge=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ge,_e.identifier=Gn(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function Q(oe){this.data.characterReferenceType=oe.type}function K(oe){const ge=this.sliceSerialize(oe),_e=this.data.characterReferenceType;let Ae;_e?(Ae=Dg(ge,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=rd(ge);const ze=this.stack[this.stack.length-1];ze.value+=Ae}function ce(oe){const ge=this.stack.pop();ge.position.end=Nr(oe.end)}function le(oe){A.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(oe)}function ee(oe){A.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(oe)}function Ce(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ne(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function Be(){return{type:"html",value:""}}function ct(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function Ue(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function dt(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function nt(){return{type:"paragraph",children:[]}}function mt(){return{type:"strong",children:[]}}function Qe(){return{type:"text",value:""}}function Pe(){return{type:"thematicBreak"}}}function Nr(e){return{line:e.line,column:e.column,offset:e.offset}}function $g(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?$g(e,r):d7(e,r)}}function d7(e,t){let n;for(n in t)if(qg.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ff(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ha({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ha({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ha({start:t.start,end:t.end})+") is still open")}function h7(e){const t=this;t.parser=n;function n(r){return u7(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function f7(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 m7(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
481
+ `}]}function p7(e,t){const n=t.value?t.value+`
482
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function g7(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x7(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function b7(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=aa(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function y7(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 v7(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wg(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function w7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wg(e,t);const i={src:aa(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function k7(e,t){const n={src:aa(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function E7(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function T7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wg(e,t);const i={href:aa(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function S7(e,t){const n={href:aa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function A7(e,t,n){const r=e.all(t),i=n?C7(n):Gg(t),a={},s=[];if(typeof t.checked=="boolean"){const c=r[0];let h;c&&c.type==="element"&&c.tagName==="p"?h=c:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const c=r[o];(i||o!==0||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
483
+ `}),c.type==="element"&&c.tagName==="p"&&!i?s.push(...c.children):s.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
484
+ `});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function C7(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Gg(n[r])}return t}function Gg(e){const t=e.spread;return t??e.children.length>1}function N7(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function M7(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I7(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _7(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R7(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=ur(t.children[1]),l=ll(t.children[t.children.length-1]);o&&l&&(s.position={start:o,end:l}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function L7(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const h=t.children[l],m={},d=s?s[l]:void 0;d&&(m.align=d);let p={type:"element",tagName:a,properties:m,children:[]};h&&(p.children=e.all(h),e.patch(h,p),p=e.applyData(h,p)),u.push(p)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function D7(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mf=9,pf=32;function P7(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(gf(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(gf(t.slice(i),i>0,!1)),a.join("")}function gf(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===mf||a===pf;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===mf||a===pf;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function O7(e,t){const n={type:"text",value:P7(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function j7(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const B7={blockquote:f7,break:m7,code:p7,delete:g7,emphasis:x7,footnoteReference:b7,heading:y7,html:v7,imageReference:w7,image:k7,inlineCode:E7,linkReference:T7,link:S7,listItem:A7,list:N7,paragraph:M7,root:I7,strong:_7,table:R7,tableCell:D7,tableRow:L7,text:O7,thematicBreak:j7,toml:Bs,yaml:Bs,definition:Bs,footnoteDefinition:Bs};function Bs(){}const Yg=-1,dl=0,Va=1,Do=2,ad=3,sd=4,od=5,ld=6,Kg=7,Xg=8,Qg=typeof self=="object"?self:globalThis,xf=(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 Qg[e](t)},F7=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case dl:case Yg:return n(s,i);case Va:{const o=n([],i);for(const l of s)o.push(r(l));return o}case Do:{const o=n({},i);for(const[l,u]of s)o[r(l)]=r(u);return o}case ad:return n(new Date(s),i);case sd:{const{source:o,flags:l}=s;return n(new RegExp(o,l),i)}case od:{const o=n(new Map,i);for(const[l,u]of s)o.set(r(l),r(u));return o}case ld:{const o=n(new Set,i);for(const l of s)o.add(r(l));return o}case Kg:{const{name:o,message:l}=s;return n(typeof Qg[o]=="function"?xf(o,l):new Error(l),i)}case Xg:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(xf(a,s),i)};return r},bf=e=>F7(new Map,e)(0),li="",{toString:z7}={},{keys:H7}=Object,Aa=e=>{const t=typeof e;if(t!=="object"||!e)return[dl,t];const n=z7.call(e).slice(8,-1);switch(n){case"Array":return[Va,li];case"Object":return[Do,li];case"Date":return[ad,li];case"RegExp":return[sd,li];case"Map":return[od,li];case"Set":return[ld,li];case"DataView":return[Va,n]}return n.includes("Array")?[Va,n]:e instanceof Error?[Kg,e.name||"Error"]:[Do,n]},Fs=([e,t])=>e===dl&&(t==="function"||t==="symbol"),U7=(e,t,n,r)=>{const i=(s,o)=>{const l=r.push(s)-1;return n.set(o,l),l},a=s=>{if(n.has(s))return n.get(s);let[o,l]=Aa(s);switch(o){case dl:{let c=s;switch(l){case"bigint":o=Xg,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([Yg],s)}return i([o,c],s)}case Va:{if(l){let m=s;return l==="DataView"?m=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(m=new Uint8Array(s)),i([l,[...m]],s)}const c=[],h=i([o,c],s);for(const m of s)c.push(a(m));return h}case Do:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const c=[],h=i([o,c],s);for(const m of H7(s))(e||!Fs(Aa(s[m])))&&c.push([a(m),a(s[m])]);return h}case ad:return i([o,isNaN(s.getTime())?li:s.toISOString()],s);case sd:{const{source:c,flags:h}=s;return i([o,{source:c,flags:h}],s)}case od:{const c=[],h=i([o,c],s);for(const[m,d]of s)(e||!(Fs(Aa(m))||Fs(Aa(d))))&&c.push([a(m),a(d)]);return h}case ld:{const c=[],h=i([o,c],s);for(const m of s)(e||!Fs(Aa(m)))&&c.push(a(m));return h}}const{message:u}=s;return i([o,{name:l,message:u}],s)};return a},yf=(e,{json:t,lossy:n}={})=>{const r=[];return U7(!(t||n),!!t,new Map,r)(e),r},Ti=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bf(yf(e,t)):structuredClone(e):(e,t)=>bf(yf(e,t));function V7(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 q7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $7(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||V7,r=e.options.footnoteBackLabel||q7,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),h=String(u.identifier).toUpperCase(),m=aa(h.toLowerCase());let d=0;const p=[],g=e.footnoteCounts.get(h);for(;g!==void 0&&++d<=g;){p.length>0&&p.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=c[c.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...p)}else c.push(...p);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(c,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Ti(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
485
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
486
+ `}]}}const ws=(function(e){if(e==null)return K7;if(typeof e=="function")return hl(e);if(typeof e=="object")return Array.isArray(e)?W7(e):G7(e);if(typeof e=="string")return Y7(e);throw new Error("Expected function, string, or object as test")});function W7(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ws(e[n]);return hl(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function G7(e){const t=e;return hl(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Y7(e){return hl(t);function t(n){return n&&n.type===e}}function hl(e){return t;function t(n,r,i){return!!(X7(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function K7(){return!0}function X7(e){return e!==null&&typeof e=="object"&&"type"in e}const Zg=[],Q7=!0,Ic=!1,Jg="skip";function ud(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=ws(i),s=r?-1:1;o(e,void 0,[])();function o(l,u,c){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const d=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return m;function m(){let d=Zg,p,g,x;if((!t||a(l,u,c[c.length-1]||void 0))&&(d=Z7(n(l,c)),d[0]===Ic))return d;if("children"in l&&l.children){const b=l;if(b.children&&d[0]!==Jg)for(g=(r?b.children.length:-1)+s,x=c.concat(b);g>-1&&g<b.children.length;){const v=b.children[g];if(p=o(v,g,x)(),p[0]===Ic)return p;g=typeof p[1]=="number"?p[1]:g+s}}return d}}}function Z7(e){return Array.isArray(e)?e:typeof e=="number"?[Q7,e]:e==null?Zg:[e]}function fl(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),ud(e,a,o,i);function o(l,u){const c=u[u.length-1],h=c?c.children.indexOf(l):void 0;return s(l,h,c)}}const _c={}.hasOwnProperty,J7={};function ew(e,t){const n=t||J7,r=new Map,i=new Map,a=new Map,s={...B7,...n.handlers},o={all:u,applyData:nw,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:n,patch:tw,wrap:iw};return fl(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const h=c.type==="definition"?r:i,m=String(c.identifier).toUpperCase();h.has(m)||h.set(m,c)}}),o;function l(c,h){const m=c.type,d=o.handlers[m];if(_c.call(o.handlers,m)&&d)return d(o,c,h);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in c){const{children:g,...x}=c,b=Ti(x);return b.children=o.all(c),b}return Ti(c)}return(o.options.unknownHandler||rw)(o,c,h)}function u(c){const h=[];if("children"in c){const m=c.children;let d=-1;for(;++d<m.length;){const p=o.one(m[d],c);if(p){if(d&&m[d-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=vf(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=vf(g.value))}Array.isArray(p)?h.push(...p):h.push(p)}}}return h}}function tw(e,t){e.position&&(t.position=Cg(e))}function nw(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,Ti(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function rw(e,t){const n=t.data||{},r="value"in t&&!(_c.call(n,"hProperties")||_c.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iw(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
487
+ `});++r<e.length;)r&&n.push({type:"text",value:`
488
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
489
+ `}),n}function vf(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wf(e,t){const n=ew(e,t),r=n.one(e,void 0),i=$7(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
490
+ `},i),a}function aw(e,t){return e&&"run"in e?async function(n,r){const i=wf(n,{file:r,...t});await e.run(i,r)}:function(n,r){return wf(n,{file:r,...e||t})}}function kf(e){if(e)throw e}var su,Ef;function sw(){if(Ef)return su;Ef=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},a=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var c=e.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!h)return!1;var m;for(m in u);return typeof m>"u"||e.call(u,m)},s=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},o=function(u,c){if(c==="__proto__")if(e.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return su=function l(){var u,c,h,m,d,p,g=arguments[0],x=1,b=arguments.length,v=!1;for(typeof g=="boolean"&&(v=g,g=arguments[1]||{},x=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});x<b;++x)if(u=arguments[x],u!=null)for(c in u)h=o(g,c),m=o(u,c),g!==m&&(v&&m&&(a(m)||(d=i(m)))?(d?(d=!1,p=h&&i(h)?h:[]):p=h&&a(h)?h:{},s(g,{name:c,newValue:l(v,p,m)})):typeof m<"u"&&s(g,{name:c,newValue:m}));return g},su}var ow=sw();const ou=F0(ow);function Rc(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 lw(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(l,...u){const c=e[++a];let h=-1;if(l){s(l);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,c?uw(c,o)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function uw(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(i);try{l=e.apply(this,s)}catch(u){const c=u;if(o&&n)throw c;return i(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(s,...o){n||(n=!0,t(s,...o))}function a(s){i(null,s)}}const Qn={basename:cw,dirname:dw,extname:hw,join:fw,sep:"/"};function cw(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ks(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function dw(e){if(ks(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function hw(e){ks(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function fw(...e){let t=-1,n;for(;++t<e.length;)ks(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":mw(n)}function mw(e){ks(e);const t=e.codePointAt(0)===47;let n=pw(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pw(e,t){let n="",r=0,i=-1,a=0,s=-1,o,l;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function ks(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const gw={cwd:xw};function xw(){return"/"}function Lc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bw(e){if(typeof e=="string")e=new URL(e);else if(!Lc(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 yw(e)}function yw(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const lu=["history","path","basename","stem","extname","dirname"];class e2{constructor(t){let n;t?Lc(t)?n={path:t}:typeof t=="string"||vw(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":gw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<lu.length;){const a=lu[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)lu.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Qn.basename(this.path):void 0}set basename(t){cu(t,"basename"),uu(t,"basename"),this.path=Qn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qn.dirname(this.path):void 0}set dirname(t){Tf(this.basename,"dirname"),this.path=Qn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qn.extname(this.path):void 0}set extname(t){if(uu(t,"extname"),Tf(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=Qn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Lc(t)&&(t=bw(t)),cu(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qn.basename(this.path,this.extname):void 0}set stem(t){cu(t,"stem"),uu(t,"stem"),this.path=Qn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new on(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function uu(e,t){if(e&&e.includes(Qn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qn.sep+"`")}function cu(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Tf(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ww=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),kw={}.hasOwnProperty;class cd extends ww{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=lw()}copy(){const t=new cd;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ou(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fu("data",this.frozen),this.namespace[t]=n,this):kw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fu("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,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=zs(t),r=this.parser||this.Parser;return du("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),du("process",this.parser||this.Parser),hu("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const o=zs(t),l=r.parse(o);r.run(l,o,function(c,h,m){if(c||!h||!m)return u(c);const d=h,p=r.stringify(d,m);Sw(p)?m.value=p:m.result=p,u(c,m)});function u(c,h){c||!h?s(c):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),du("processSync",this.parser||this.Parser),hu("processSync",this.compiler||this.Compiler),this.process(t,i),Af("processSync","process",n),r;function i(a,s){n=!0,kf(a),r=s}}run(t,n,r){Sf(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,o){const l=zs(n);i.run(t,l,u);function u(c,h,m){const d=h||t;c?o(c):s?s(d):r(void 0,d,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Af("runSync","run",r),i;function a(s,o){kf(s),i=o,r=!0}}stringify(t,n){this.freeze();const r=zs(n),i=this.compiler||this.Compiler;return hu("stringify",i),Sf(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(fu("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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");o(u.plugins),u.settings&&(i.settings=ou(!0,i.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];a(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===u){m=h;break}if(m===-1)r.push([u,...c]);else if(c.length>0){let[d,...p]=c;const g=r[m][1];Rc(g)&&Rc(d)&&(d=ou(!0,g,d)),r[m]=[u,d,...p]}}}}const Ew=new cd().freeze();function du(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fu(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 Sf(e){if(!Rc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Af(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zs(e){return Tw(e)?e:new e2(e)}function Tw(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Sw(e){return typeof e=="string"||Aw(e)}function Aw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cf=[],Nf={allowDangerousHtml:!0},Nw=/^(https?|ircs?|mailto|xmpp)$/i,Mw=[{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:"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 t2(e){const t=Iw(e),n=_w(e);return Rw(t.runSync(t.parse(n),n),e)}function Iw(e){const t=e.rehypePlugins||Cf,n=e.remarkPlugins||Cf,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Nf}:Nf;return Ew().use(h7).use(n).use(aw,r).use(t)}function _w(e){const t=e.children||"",n=new e2;return typeof t=="string"&&(n.value=t),n}function Rw(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||Lw;for(const c of Mw)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+Cw+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),fl(e,u),Kv(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(c,h,m){if(c.type==="raw"&&m&&typeof h=="number")return s?m.children.splice(h,1):m.children[h]={type:"text",value:c.value},h;if(c.type==="element"){let d;for(d in ru)if(Object.hasOwn(ru,d)&&Object.hasOwn(c.properties,d)){const p=c.properties[d],g=ru[d];(g===null||g.includes(c.tagName))&&(c.properties[d]=l(String(p||""),d,c))}}if(c.type==="element"){let d=n?!n.includes(c.tagName):a?a.includes(c.tagName):!1;if(!d&&r&&typeof h=="number"&&(d=!r(c,h,m)),d&&m&&typeof h=="number")return o&&c.children?m.children.splice(h,1,...c.children):m.children.splice(h,1),h}}}function Lw(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Nw.test(e.slice(0,t))?e:""}function Mf(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Dw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Pw(e,t,n){const i=ws((n||{}).ignore||[]),a=Ow(t);let s=-1;for(;++s<a.length;)ud(e,"text",o);function o(u,c){let h=-1,m;for(;++h<c.length;){const d=c[h],p=m?m.children:void 0;if(i(d,p?p.indexOf(d):void 0,m))return;m=d}if(m)return l(u,c)}function l(u,c){const h=c[c.length-1],m=a[s][0],d=a[s][1];let p=0;const x=h.children.indexOf(u);let b=!1,v=[];m.lastIndex=0;let E=m.exec(u.value);for(;E;){const N=E.index,k={index:E.index,input:E.input,stack:[...c,u]};let S=d(...E,k);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?m.lastIndex=N+1:(p!==N&&v.push({type:"text",value:u.value.slice(p,N)}),Array.isArray(S)?v.push(...S):S&&v.push(S),p=N+E[0].length,b=!0),!m.global)break;E=m.exec(u.value)}return b?(p<u.value.length&&v.push({type:"text",value:u.value.slice(p)}),h.children.splice(x,1,...v)):v=[u],x+v.length}}function Ow(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 r=-1;for(;++r<n.length;){const i=n[r];t.push([jw(i[0]),Bw(i[1])])}return t}function jw(e){return typeof e=="string"?new RegExp(Dw(e),"g"):e}function Bw(e){return typeof e=="function"?e:function(){return e}}const mu="phrasing",pu=["autolink","link","image","label"];function Fw(){return{transforms:[Ww],enter:{literalAutolink:Hw,literalAutolinkEmail:gu,literalAutolinkHttp:gu,literalAutolinkWww:gu},exit:{literalAutolink:$w,literalAutolinkEmail:qw,literalAutolinkHttp:Uw,literalAutolinkWww:Vw}}}function zw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mu,notInConstruct:pu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mu,notInConstruct:pu},{character:":",before:"[ps]",after:"\\/",inConstruct:mu,notInConstruct:pu}]}}function Hw(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gu(e){this.config.enter.autolinkProtocol.call(this,e)}function Uw(e){this.config.exit.autolinkProtocol.call(this,e)}function Vw(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 qw(e){this.config.exit.autolinkEmail.call(this,e)}function $w(e){this.exit(e)}function Ww(e){Pw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Gw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Yw]],{ignore:["link","linkReference"]})}function Gw(e,t,n,r,i){let a="";if(!n2(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Kw(n)))return!1;const s=Xw(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function Yw(e,t,n,r){return!n2(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Kw(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 Xw(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Mf(e,"(");let a=Mf(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function n2(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ei(n)||ul(n))&&(!t||n!==47)}r2.peek=ak;function Qw(){this.buffer()}function Zw(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Jw(){this.buffer()}function ek(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function tk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nk(e){this.exit(e)}function rk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ik(e){this.exit(e)}function ak(){return"["}function r2(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function sk(){return{enter:{gfmFootnoteCallString:Qw,gfmFootnoteCall:Zw,gfmFootnoteDefinitionLabelString:Jw,gfmFootnoteDefinition:ek},exit:{gfmFootnoteCallString:tk,gfmFootnoteCall:nk,gfmFootnoteDefinitionLabelString:rk,gfmFootnoteDefinition:ik}}}function ok(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:r2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const o=a.createTracker(s);let l=o.move("[^");const u=a.enter("footnoteDefinition"),c=a.enter("label");return l+=o.move(a.safe(a.associationId(r),{before:l,after:"]"})),c(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
491
+ `:" ")+a.indentLines(a.containerFlow(r,o.current()),t?i2:lk))),u(),l}}function lk(e,t,n){return t===0?e:i2(e,t,n)}function i2(e,t,n){return(n?"":" ")+e}const uk=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];a2.peek=mk;function ck(){return{canContainEols:["delete"],enter:{strikethrough:hk},exit:{strikethrough:fk}}}function dk(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:uk}],handlers:{delete:a2}}}function hk(e){this.enter({type:"delete",children:[]},e)}function fk(e){this.exit(e)}function a2(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function mk(){return"~"}function pk(e){return e.length}function gk(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||pk,a=[],s=[],o=[],l=[];let u=0,c=-1;for(;++c<e.length;){const g=[],x=[];let b=-1;for(e[c].length>u&&(u=e[c].length);++b<e[c].length;){const v=xk(e[c][b]);if(n.alignDelimiters!==!1){const E=i(v);x[b]=E,(l[b]===void 0||E>l[b])&&(l[b]=E)}g.push(v)}s[c]=g,o[c]=x}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)a[h]=If(r[h]);else{const g=If(r);for(;++h<u;)a[h]=g}h=-1;const m=[],d=[];for(;++h<u;){const g=a[h];let x="",b="";g===99?(x=":",b=":"):g===108?x=":":g===114&&(b=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[h]-x.length-b.length);const E=x+"-".repeat(v)+b;n.alignDelimiters!==!1&&(v=x.length+v+b.length,v>l[h]&&(l[h]=v),d[h]=v),m[h]=E}s.splice(1,0,m),o.splice(1,0,d),c=-1;const p=[];for(;++c<s.length;){const g=s[c],x=o[c];h=-1;const b=[];for(;++h<u;){const v=g[h]||"";let E="",N="";if(n.alignDelimiters!==!1){const k=l[h]-(x[h]||0),S=a[h];S===114?E=" ".repeat(k):S===99?k%2?(E=" ".repeat(k/2+.5),N=" ".repeat(k/2-.5)):(E=" ".repeat(k/2),N=E):N=" ".repeat(k)}n.delimiterStart!==!1&&!h&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||h)&&b.push(" "),n.alignDelimiters!==!1&&b.push(E),b.push(v),n.alignDelimiters!==!1&&b.push(N),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||h!==u-1)&&b.push("|")}p.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return p.join(`
492
+ `)}function xk(e){return e==null?"":String(e)}function If(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}const _f={}.hasOwnProperty;function s2(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const o=r.handlers;if(i&&_f.call(i,e)){const l=String(i[e]);s=_f.call(o,l)?o[l]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function bk(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),yk);return i(),s}function yk(e,t,n){return">"+(n?"":" ")+e}function vk(e,t){return Rf(e,t.inConstruct,!0)&&!Rf(e,t.notInConstruct,!1)}function Rf(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Lf(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
493
+ `&&vk(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
494
+ `}function o2(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>s&&(s=a):a=1,i=r+t.length,r=n.indexOf(t,i);return s}function wk(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 kk(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 Ek(e,t,n,r){const i=kk(n),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(wk(e,n)){const h=n.enter("codeIndented"),m=n.indentLines(a,Tk);return h(),m}const o=n.createTracker(r),l=i.repeat(Math.max(o2(a,i)+1,3)),u=n.enter("codeFenced");let c=o.move(l);if(e.lang){const h=n.enter(`codeFencedLang${s}`);c+=o.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...o.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);c+=o.move(" "),c+=o.move(n.safe(e.meta,{before:c,after:`
495
+ `,encode:["`"],...o.current()})),h()}return c+=o.move(`
496
+ `),a&&(c+=o.move(a+`
497
+ `)),c+=o.move(l),u(),c}function Tk(e,t,n){return(n?"":" ")+e}function dd(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 Sk(e,t,n,r){const i=dd(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
498
+ `,...l.current()}))),o(),e.title&&(o=n.enter(`title${a}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),s(),u}function Ak(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 ss(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Po(e,t,n){const r=Xi(e),i=Xi(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}l2.peek=Ck;function l2(e,t,n,r){const i=Ak(n),a=n.enter("emphasis"),s=n.createTracker(r),o=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const u=l.charCodeAt(0),c=Po(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=ss(u)+l.slice(1));const h=l.charCodeAt(l.length-1),m=Po(r.after.charCodeAt(0),h,i);m.inside&&(l=l.slice(0,-1)+ss(h));const d=s.move(i);return a(),n.attentionEncodeSurroundingInfo={after:m.outside,before:c.outside},o+l+d}function Ck(e,t,n){return n.options.emphasis||"*"}function Nk(e,t){let n=!1;return fl(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ic}),!!((!e.depth||e.depth<3)&&nd(e)&&(t.options.setext||n))}function Mk(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Nk(e,n)){const c=n.enter("headingSetext"),h=n.enter("phrasing"),m=n.containerPhrasing(e,{...a.current(),before:`
499
+ `,after:`
500
+ `});return h(),c(),m+`
501
+ `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
502
+ `))+1))}const s="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");a.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
503
+ `,...a.current()});return/^[\t ]/.test(u)&&(u=ss(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),o(),u}u2.peek=Ik;function u2(e){return e.value||""}function Ik(){return"<"}c2.peek=_k;function c2(e,t,n,r){const i=dd(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${a}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),s(),u}function _k(){return"!"}d2.peek=Rk;function d2(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=c,a(),i==="full"||!u||u!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Rk(){return"!"}h2.peek=Lk;function h2(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],o=n.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function Lk(){return"`"}function f2(e,t){const n=nd(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))}m2.peek=Dk;function m2(e,t,n,r){const i=dd(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,l;if(f2(e,n)){const c=n.stack;n.stack=[],o=n.enter("autolink");let h=s.move("<");return h+=s.move(n.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),o(),n.stack=c,h}o=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${a}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),o(),u}function Dk(e,t,n){return f2(e,n)?"<":"["}p2.peek=Pk;function p2(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=c,a(),i==="full"||!u||u!==h?l+=o.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Pk(){return"["}function hd(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 Ok(e){const t=hd(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 jk(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 g2(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 Bk(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=e.ordered?jk(n):hd(n);const o=e.ordered?s==="."?")":".":Ok(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.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&&(l=!0),g2(n)===s&&c){let h=-1;for(;++h<e.children.length;){const m=e.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=o),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),u}function Fk(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 zk(e,t,n,r){const i=Fk(n);let a=n.bulletCurrent||hd(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),c);return l(),u;function c(h,m,d){return m?(d?"":" ".repeat(s))+h:(d?a:a+" ".repeat(s-a.length))+h}}function Hk(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(e,r);return a(),i(),s}const Uk=ws(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Vk(e,t,n,r){return(e.children.some(function(s){return Uk(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function qk(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}x2.peek=$k;function x2(e,t,n,r){const i=qk(n),a=n.enter("strong"),s=n.createTracker(r),o=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:o,...s.current()}));const u=l.charCodeAt(0),c=Po(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=ss(u)+l.slice(1));const h=l.charCodeAt(l.length-1),m=Po(r.after.charCodeAt(0),h,i);m.inside&&(l=l.slice(0,-1)+ss(h));const d=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:m.outside,before:c.outside},o+l+d}function $k(e,t,n){return n.options.strong||"*"}function Wk(e,t,n,r){return n.safe(e.value,r)}function Gk(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 Yk(e,t,n){const r=(g2(n)+(n.options.ruleSpaces?" ":"")).repeat(Gk(n));return n.options.ruleSpaces?r.slice(0,-1):r}const b2={blockquote:bk,break:Lf,code:Ek,definition:Sk,emphasis:l2,hardBreak:Lf,heading:Mk,html:u2,image:c2,imageReference:d2,inlineCode:h2,link:m2,linkReference:p2,list:Bk,listItem:zk,paragraph:Hk,root:Vk,strong:x2,text:Wk,thematicBreak:Yk};function Kk(){return{enter:{table:Xk,tableData:Df,tableHeader:Df,tableRow:Zk},exit:{codeText:Jk,table:Qk,tableData:xu,tableHeader:xu,tableRow:xu}}}function Xk(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 Qk(e){this.exit(e),this.data.inTable=void 0}function Zk(e){this.enter({type:"tableRow",children:[]},e)}function xu(e){this.exit(e)}function Df(e){this.enter({type:"tableCell",children:[]},e)}function Jk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,e9));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function e9(e,t){return t==="|"?t:e}function t9(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
504
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:l,tableRow:o}};function s(d,p,g,x){return u(c(d,g,x),d.align)}function o(d,p,g,x){const b=h(d,g,x),v=u([b]);return v.slice(0,v.indexOf(`
505
+ `))}function l(d,p,g,x){const b=g.enter("tableCell"),v=g.enter("phrasing"),E=g.containerPhrasing(d,{...x,before:a,after:a});return v(),b(),E}function u(d,p){return gk(d,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function c(d,p,g){const x=d.children;let b=-1;const v=[],E=p.enter("table");for(;++b<x.length;)v[b]=h(x[b],p,g);return E(),v}function h(d,p,g){const x=d.children;let b=-1;const v=[],E=p.enter("tableRow");for(;++b<x.length;)v[b]=l(x[b],d,p,g);return E(),v}function m(d,p,g){let x=b2.inlineCode(d,p,g);return g.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function n9(){return{exit:{taskListCheckValueChecked:Pf,taskListCheckValueUnchecked:Pf,paragraph:i9}}}function r9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:a9}}}function Pf(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function i9(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 r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function a9(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let l=b2.listItem(e,t,n,{...r,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+s}}function s9(){return[Fw(),sk(),ck(),Kk(),n9()]}function o9(e){return{extensions:[zw(),ok(e),dk(),t9(e),r9()]}}const l9={tokenize:m9,partial:!0},y2={tokenize:p9,partial:!0},v2={tokenize:g9,partial:!0},w2={tokenize:x9,partial:!0},u9={tokenize:b9,partial:!0},k2={name:"wwwAutolink",tokenize:h9,previous:T2},E2={name:"protocolAutolink",tokenize:f9,previous:S2},Er={name:"emailAutolink",tokenize:d9,previous:A2},cr={};function c9(){return{text:cr}}let ti=48;for(;ti<123;)cr[ti]=Er,ti++,ti===58?ti=65:ti===91&&(ti=97);cr[43]=Er;cr[45]=Er;cr[46]=Er;cr[95]=Er;cr[72]=[Er,E2];cr[104]=[Er,E2];cr[87]=[Er,k2];cr[119]=[Er,k2];function d9(e,t,n){const r=this;let i,a;return s;function s(h){return!Dc(h)||!A2.call(r,r.previous)||fd(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return Dc(h)?(e.consume(h),o):h===64?(e.consume(h),l):n(h)}function l(h){return h===46?e.check(u9,c,u)(h):h===45||h===95||an(h)?(a=!0,e.consume(h),l):c(h)}function u(h){return e.consume(h),i=!0,l}function c(h){return a&&i&&hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function h9(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!T2.call(r,r.previous)||fd(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l9,e.attempt(y2,e.attempt(v2,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function f9(e,t,n){const r=this;let i="",a=!1;return s;function s(h){return(h===72||h===104)&&S2.call(r,r.previous)&&!fd(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if(hn(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),l}return n(h)}function l(h){return h===47?(e.consume(h),a?u:(a=!0,l)):n(h)}function u(h){return h===null||Lo(h)||wt(h)||Ei(h)||ul(h)?n(h):e.attempt(y2,e.attempt(v2,c),n)(h)}function c(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function m9(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function p9(e,t,n){let r,i,a;return s;function s(u){return u===46||u===95?e.check(w2,l,o)(u):u===null||wt(u)||Ei(u)||u!==45&&ul(u)?l(u):(a=!0,e.consume(u),s)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!a?n(u):t(u)}}function g9(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(w2,t,a)(s):s===null||wt(s)||Ei(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function x9(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||wt(o)||Ei(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||wt(o)||Ei(o)?t(o):r(o)}function a(o){return hn(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):hn(o)?(e.consume(o),s):n(o)}}function b9(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return an(a)?n(a):t(a)}}function T2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||wt(e)}function S2(e){return!hn(e)}function A2(e){return!(e===47||Dc(e))}function Dc(e){return e===43||e===45||e===46||e===95||an(e)}function fd(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const y9={tokenize:C9,partial:!0};function v9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:T9,continuation:{tokenize:S9},exit:A9}},text:{91:{name:"gfmFootnoteCall",tokenize:E9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:w9,resolveTo:k9}}}}function w9(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const u=Gn(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function k9(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 r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function E9(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),l}function l(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(a>999||h===93&&!s||h===null||h===91||wt(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(Gn(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return wt(h)||(s=!0),a++,e.consume(h),h===92?c:u}function c(h){return h===91||h===92||h===93?(e.consume(h),a++,u):u(h)}}function T9(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(p)}function c(p){if(s>999||p===93&&!o||p===null||p===91||wt(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return a=Gn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return wt(p)||(o=!0),s++,e.consume(p),p===92?h:c}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}function m(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(a)||i.push(a),st(e,d,"gfmFootnoteDefinitionWhitespace")):n(p)}function d(p){return t(p)}}function S9(e,t,n){return e.check(vs,t,e.attempt(y9,t,n))}function A9(e){e.exit("gfmFootnoteDefinition")}function C9(e,t,n){const r=this;return st(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function N9(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},h={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},m=[["enter",c,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",h,o]],d=o.parser.constructs.insideSpan.null;d&&Sn(m,m.length,0,cl(d,s.slice(u+1,l),o)),Sn(m,m.length,0,[["exit",h,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",c,o]]),Sn(s,u-1,l-u+3,m),l=u+m.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function a(s,o,l){const u=this.previous,c=this.events;let h=0;return m;function m(p){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(p):(s.enter("strikethroughSequenceTemporary"),d(p))}function d(p){const g=Xi(u);if(p===126)return h>1?l(p):(s.consume(p),h++,d);if(h<2&&!n)return l(p);const x=s.exit("strikethroughSequenceTemporary"),b=Xi(p);return x._open=!b||b===2&&!!g,x._close=!g||g===2&&!!b,o(p)}}}class M9{constructor(){this.map=[]}add(t,n,r){I9(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function I9(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function _9(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function R9(){return{flow:{null:{name:"table",tokenize:L9,resolveAll:D9}}}}function L9(e,t,n){const r=this;let i=0,a=0,s;return o;function o(A){let R=r.events.length-1;for(;R>-1;){const j=r.events[R][1].type;if(j==="lineEnding"||j==="linePrefix")R--;else break}const L=R>-1?r.events[R][1].type:null,z=L==="tableHead"||L==="tableRow"?S:l;return z===S&&r.parser.lazy[r.now().line]?n(A):z(A)}function l(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(s=!0,a+=1),c(A)}function c(A){return A===null?n(A):Fe(A)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),d):n(A):ut(A)?st(e,c,"whitespace")(A):(a+=1,s&&(s=!1,i+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),s=!0,c):(e.enter("data"),h(A)))}function h(A){return A===null||A===124||wt(A)?(e.exit("data"),c(A)):(e.consume(A),A===92?m:h)}function m(A){return A===92||A===124?(e.consume(A),h):h(A)}function d(A){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(A):(e.enter("tableDelimiterRow"),s=!1,ut(A)?st(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):p(A))}function p(A){return A===45||A===58?x(A):A===124?(s=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),g):k(A)}function g(A){return ut(A)?st(e,x,"whitespace")(A):x(A)}function x(A){return A===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),b):A===45?(a+=1,b(A)):A===null||Fe(A)?N(A):k(A)}function b(A){return A===45?(e.enter("tableDelimiterFiller"),v(A)):k(A)}function v(A){return A===45?(e.consume(A),v):A===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(A))}function E(A){return ut(A)?st(e,N,"whitespace")(A):N(A)}function N(A){return A===124?p(A):A===null||Fe(A)?!s||i!==a?k(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):k(A)}function k(A){return n(A)}function S(A){return e.enter("tableRow"),_(A)}function _(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),_):A===null||Fe(A)?(e.exit("tableRow"),t(A)):ut(A)?st(e,_,"whitespace")(A):(e.enter("data"),C(A))}function C(A){return A===null||A===124||wt(A)?(e.exit("data"),_(A)):(e.consume(A),A===92?I:C)}function I(A){return A===92||A===124?(e.consume(A),C):C(A)}}function D9(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,u,c,h;const m=new M9;for(;++n<e.length;){const d=e[n],p=d[1];d[0]==="enter"?p.type==="tableHead"?(o=!1,l!==0&&(Of(m,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",c,t]])),i=p.type==="tableDelimiterRow"?2:c?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],h=Hs(m,t,a,i,void 0,h),a=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],h=Hs(m,t,a,i,void 0,h)),a=s,s=[a[1],n,0,0])):p.type==="tableHead"?(o=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,a[1]!==0?(s[0]=s[1],h=Hs(m,t,a,i,n,h)):s[1]!==0&&(h=Hs(m,t,s,i,n,h)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Of(m,t,l,u,c),m.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=_9(t.events,n))}return e}function Hs(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Fi(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const l=Fi(t.events,n[1]);if(a={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Fi(t.events,n[2]),c=Fi(t.events,n[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],d=t.events[n[3]];if(m[1].end=Object.assign({},d[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},Fi(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function Of(e,t,n,r,i){const a=[],s=Fi(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function Fi(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const P9={name:"tasklistCheck",tokenize:j9};function O9(){return{text:{91:P9}}}function j9(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),a)}function a(l){return wt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Fe(l)?t(l):ut(l)?e.check({tokenize:B9},t,n)(l):n(l)}}function B9(e,t,n){return st(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function F9(e){return Lg([c9(),v9(),N9(e),R9(),O9()])}const z9={};function C2(e){const t=this,n=e||z9,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(F9(n)),a.push(s9()),s.push(o9(n))}function H9(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:o,mathText:s,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function t(){this.buffer()}function n(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),c=this.stack[this.stack.length-1];c.type,this.exit(l),c.value=u;const h=c.data.hChildren[0];h.type,h.tagName,h.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function a(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function s(l){const u=this.resume(),c=this.stack[this.stack.length-1];c.type,this.exit(l),c.value=u,c.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function U9(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
506
+ `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(a,s,o,l){const u=a.value||"",c=o.createTracker(l),h="$".repeat(Math.max(o2(u,"$")+1,2)),m=o.enter("mathFlow");let d=c.move(h);if(a.meta){const p=o.enter("mathFlowMeta");d+=c.move(o.safe(a.meta,{after:`
507
+ `,before:d,encode:["$"],...c.current()})),p()}return d+=c.move(`
508
+ `),u&&(d+=c.move(u+`
509
+ `)),d+=c.move(h),m(),d}function r(a,s,o){let l=a.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const c="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let h=-1;for(;++h<o.unsafe.length;){const m=o.unsafe[h];if(!m.atBreak)continue;const d=o.compilePattern(m);let p;for(;p=d.exec(l);){let g=p.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(p.index+1)}}return c+l+c}function i(){return"$"}}const V9={tokenize:q9,concrete:!0,name:"mathFlow"},jf={tokenize:$9,partial:!0};function q9(e,t,n){const r=this,i=r.events[r.events.length-1],a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let s=0;return o;function o(v){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),l(v)}function l(v){return v===36?(e.consume(v),s++,l):s<2?n(v):(e.exit("mathFlowFenceSequence"),st(e,u,"whitespace")(v))}function u(v){return v===null||Fe(v)?h(v):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(v))}function c(v){return v===null||Fe(v)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),h(v)):v===36?n(v):(e.consume(v),c)}function h(v){return e.exit("mathFlowFence"),r.interrupt?t(v):e.attempt(jf,m,x)(v)}function m(v){return e.attempt({tokenize:b,partial:!0},x,d)(v)}function d(v){return(a?st(e,p,"linePrefix",a+1):p)(v)}function p(v){return v===null?x(v):Fe(v)?e.attempt(jf,m,x)(v):(e.enter("mathFlowValue"),g(v))}function g(v){return v===null||Fe(v)?(e.exit("mathFlowValue"),p(v)):(e.consume(v),g)}function x(v){return e.exit("mathFlow"),t(v)}function b(v,E,N){let k=0;return st(v,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function S(I){return v.enter("mathFlowFence"),v.enter("mathFlowFenceSequence"),_(I)}function _(I){return I===36?(k++,v.consume(I),_):k<s?N(I):(v.exit("mathFlowFenceSequence"),st(v,C,"whitespace")(I))}function C(I){return I===null||Fe(I)?(v.exit("mathFlowFence"),E(I)):N(I)}}}function $9(e,t,n){const r=this;return i;function i(s){return s===null?t(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function W9(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:G9,previous:Y9,name:"mathText"};function r(i,a,s){let o=0,l,u;return c;function c(g){return i.enter("mathText"),i.enter("mathTextSequence"),h(g)}function h(g){return g===36?(i.consume(g),o++,h):o<2&&!n?s(g):(i.exit("mathTextSequence"),m(g))}function m(g){return g===null?s(g):g===36?(u=i.enter("mathTextSequence"),l=0,p(g)):g===32?(i.enter("space"),i.consume(g),i.exit("space"),m):Fe(g)?(i.enter("lineEnding"),i.consume(g),i.exit("lineEnding"),m):(i.enter("mathTextData"),d(g))}function d(g){return g===null||g===32||g===36||Fe(g)?(i.exit("mathTextData"),m(g)):(i.consume(g),d)}function p(g){return g===36?(i.consume(g),l++,p):l===o?(i.exit("mathTextSequence"),i.exit("mathText"),a(g)):(u.type="mathTextData",d(g))}}}function G9(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="mathTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Y9(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function K9(e){return{flow:{36:V9},text:{36:W9(e)}}}const X9={};function N2(e){const t=this,n=e||X9,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(K9(n)),a.push(H9()),s.push(U9(n))}const Bf=/[#.]/g;function Q9(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){Bf.lastIndex=i;const o=Bf.exec(n),l=n.slice(i,o?o.index:n.length);l&&(a?a==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:s=l,i+=l.length),o&&(a=o[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function M2(e,t,n){const r=n?tE(n):void 0;function i(a,s,...o){let l;if(a==null){l={type:"root",children:[]};const u=s;o.unshift(u)}else{l=Q9(a,t);const u=l.tagName.toLowerCase(),c=r?r.get(u):void 0;if(l.tagName=c||u,Z9(s))o.unshift(s);else for(const[h,m]of Object.entries(s))J9(e,l.properties,h,m)}for(const u of o)Pc(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function Z9(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function J9(e,t,n,r){const i=ol(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=Kh(r):i.commaSeparated?a=qh(r):i.commaOrSpaceSeparated?a=Kh(qh(r).join(" ")):a=Ff(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?eE(r):String(r);if(Array.isArray(a)){const s=[];for(const o of a)s.push(Ff(i,i.property,o));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Pc(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Pc(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Pc(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Ff(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||is(n)===is(t)))return!0}return n}function eE(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function tE(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const nE=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],I2=M2(ys,"div"),_2=M2($r,"g",nE),ir={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rE(e,t){return R2(e,{})||{type:"root",children:[]}}function R2(e,t){const n=iE(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function iE(e,t){switch(e.nodeType){case 1:return lE(e,t);case 3:return sE(e);case 8:return oE(e);case 9:return zf(e,t);case 10:return aE();case 11:return zf(e,t);default:return}}function zf(e,t){return{type:"root",children:L2(e,t)}}function aE(){return{type:"doctype"}}function sE(e){return{type:"text",value:e.nodeValue||""}}function oE(e){return{type:"comment",value:e.nodeValue||""}}function lE(e,t){const n=e.namespaceURI,r=n===ir.svg?_2:I2,i=n===ir.html?e.tagName.toLowerCase():e.tagName,a=n===ir.html&&i==="template"?e.content:e,s=e.getAttributeNames(),o={};let l=-1;for(;++l<s.length;)o[s[l]]=e.getAttribute(s[l])||"";return r(i,o,L2(a,t))}function L2(e,t){const n=e.childNodes,r=[];let i=-1;for(;++i<n.length;){const a=R2(n[i],t);a!==void 0&&r.push(a)}return r}new DOMParser;function uE(e,t){const n=cE(e);return rE(n)}function cE(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const Hf=(function(e,t,n){const r=ws(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Ai=(function(e){if(e==null)return fE;if(typeof e=="string")return hE(e);if(typeof e=="object")return dE(e);if(typeof e=="function")return md(e);throw new Error("Expected function, string, or array as `test`")});function dE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ai(e[n]);return md(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function hE(e){return md(t);function t(n){return n.tagName===e}}function md(e){return t;function t(n,r,i){return!!(mE(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function fE(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function mE(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Uf=/\n/g,Vf=/[\t ]+/g,Oc=Ai("br"),qf=Ai(kE),pE=Ai("p"),$f=Ai("tr"),gE=Ai(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",wE,EE]),D2=Ai(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function xE(e,t){const n=t||{},r="children"in e?e.children:[],i=D2(e),a=j2(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...O2(e,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<r.length;)s.push(...P2(r[o],e,{whitespace:a,breakBefore:o?void 0:i,breakAfter:o<r.length-1?Oc(r[o+1]):i}));const l=[];let u;for(o=-1;++o<s.length;){const c=s[o];typeof c=="number"?u!==void 0&&c>u&&(u=c):c&&(u!==void 0&&u>-1&&l.push(`
510
+ `.repeat(u)||" "),u=-1,l.push(c))}return l.join("")}function P2(e,t,n){return e.type==="element"?bE(e,t,n):e.type==="text"?n.whitespace==="normal"?O2(e,n):yE(e):[]}function bE(e,t,n){const r=j2(e,n),i=e.children||[];let a=-1,s=[];if(gE(e))return s;let o,l;for(Oc(e)||$f(e)&&Hf(t,e,$f)?l=`
511
+ `:pE(e)?(o=2,l=2):D2(e)&&(o=1,l=1);++a<i.length;)s=s.concat(P2(i[a],e,{whitespace:r,breakBefore:a?void 0:o,breakAfter:a<i.length-1?Oc(i[a+1]):l}));return qf(e)&&Hf(t,e,qf)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function O2(e,t){const n=String(e.value),r=[],i=[];let a=0;for(;a<=n.length;){Uf.lastIndex=a;const l=Uf.exec(n),u=l&&"index"in l?l.index:n.length;r.push(vE(n.slice(a,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),a=u+1}let s=-1,o;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),o=void 0):r[s]?(typeof o=="number"&&i.push(o),i.push(r[s]),o=0):(s===0||s===r.length-1)&&i.push(0);return i}function yE(e){return[String(e.value)]}function vE(e,t,n){const r=[];let i=0,a;for(;i<e.length;){Vf.lastIndex=i;const s=Vf.exec(e);a=s?s.index:e.length,!i&&!a&&s&&!t&&r.push(""),i!==a&&r.push(e.slice(i,a)),i=s?a+s[0].length:a}return i!==a&&!n&&r.push(""),r.join(" ")}function j2(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function wE(e){return!!(e.properties||{}).hidden}function kE(e){return e.tagName==="td"||e.tagName==="th"}function EE(e){return e.tagName==="dialog"&&!(e.properties||{}).open}class Ee extends Error{constructor(t,n){var r="KaTeX parse error: "+t,i,a,s=n&&n.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var c;a+15<o.length?c=o.slice(a,a+15)+"…":c=o.slice(a),r+=u+l+c}super(r),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Ee.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}}var TE=/([A-Z])/g,SE=e=>e.replace(TE,"-$1").toLowerCase(),AE={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},CE=/[&><"']/g,sn=e=>String(e).replace(CE,t=>AE[t]),fo=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?fo(e.body[0]):e:e.type==="font"?fo(e.body):e,NE=new Set(["mathord","textord","atom"]),Tr=e=>NE.has(fo(e).type),ME=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},jc={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function IE(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function _E(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return IE(t)}function RE(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:_E(r)}class pd{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(jc)){var r=jc[n];r&&RE(this,n,t,r)}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(t,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new Ee("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i=="function")try{i=i(t,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=ME(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class Mr{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return er[LE[this.id]]}sub(){return er[DE[this.id]]}fracNum(){return er[PE[this.id]]}fracDen(){return er[OE[this.id]]}cramp(){return er[jE[this.id]]}text(){return er[BE[this.id]]}isTight(){return this.size>=2}}var gd=0,Oo=1,Wi=2,vr=3,os=4,On=5,Qi=6,fn=7,er=[new Mr(gd,0,!1),new Mr(Oo,0,!0),new Mr(Wi,1,!1),new Mr(vr,1,!0),new Mr(os,2,!1),new Mr(On,2,!0),new Mr(Qi,3,!1),new Mr(fn,3,!0)],LE=[os,On,os,On,Qi,fn,Qi,fn],DE=[On,On,On,On,fn,fn,fn,fn],PE=[Wi,vr,os,On,Qi,fn,Qi,fn],OE=[vr,vr,On,On,fn,fn,fn,fn],jE=[Oo,Oo,vr,vr,On,On,fn,fn],BE=[gd,Oo,Wi,vr,Wi,vr,Wi,vr],Xe={DISPLAY:er[gd],TEXT:er[Wi],SCRIPT:er[os],SCRIPTSCRIPT:er[Qi]},Bc=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function FE(e){for(var t=0;t<Bc.length;t++)for(var n=Bc[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var mo=[];Bc.forEach(e=>e.blocks.forEach(t=>mo.push(...t)));function B2(e){for(var t=0;t<mo.length;t+=2)if(e>=mo[t]&&e<=mo[t+1])return!0;return!1}var qt=e=>e+" "+e,Di=80,zE=function(t,n){return"M95,"+(622+t+n)+`
512
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
513
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
514
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
515
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
516
+ c69,-144,104.5,-217.7,106.5,-221
517
+ l`+t/2.075+" -"+t+`
518
+ c5.3,-9.3,12,-14,20,-14
519
+ H400000v`+(40+t)+`H845.2724
520
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
521
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
522
+ M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},HE=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
523
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
524
+ c340,-704.7,510.7,-1060.3,512,-1067
525
+ l`+t/2.084+" -"+t+`
526
+ c4.7,-7.3,11,-11,19,-11
527
+ H40000v`+(40+t)+`H1012.3
528
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
529
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
530
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
531
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
532
+ M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},UE=function(t,n){return"M983 "+(10+t+n)+`
533
+ l`+t/3.13+" -"+t+`
534
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
535
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
536
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
537
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
538
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
539
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
540
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
541
+ M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},VE=function(t,n){return"M424,"+(2398+t+n)+`
542
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
543
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
544
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
545
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
546
+ l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
547
+ v`+(40+t)+`H1014.6
548
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
549
+ c-2,6,-10,9,-24,9
550
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
551
+ h400000v`+(40+t)+"h-400000z"},qE=function(t,n){return"M473,"+(2713+t+n)+`
552
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
553
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
554
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
555
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
556
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
557
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
558
+ 606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},$E=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},WE=function(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
559
+ H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
560
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
561
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
562
+ 219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},GE=function(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=zE(n,Di);break;case"sqrtSize1":i=HE(n,Di);break;case"sqrtSize2":i=UE(n,Di);break;case"sqrtSize3":i=VE(n,Di);break;case"sqrtSize4":i=qE(n,Di);break;case"sqrtTall":i=WE(n,Di,r)}return i},YE=function(t,n){switch(t){case"⎜":return qt("M291 0 H417 V"+n+" H291z");case"∣":return qt("M145 0 H188 V"+n+" H145z");case"∥":return qt("M145 0 H188 V"+n+" H145z")+qt("M367 0 H410 V"+n+" H367z");case"⎟":return qt("M457 0 H583 V"+n+" H457z");case"⎢":return qt("M319 0 H403 V"+n+" H319z");case"⎥":return qt("M263 0 H347 V"+n+" H263z");case"⎪":return qt("M384 0 H504 V"+n+" H384z");case"⏐":return qt("M312 0 H355 V"+n+" H312z");case"‖":return qt("M257 0 H300 V"+n+" H257z")+qt("M478 0 H521 V"+n+" H478z");default:return""}},Wf={doubleleftarrow:`M262 157
563
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
564
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
565
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
566
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
567
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
568
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
569
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
570
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
571
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
572
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
573
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
574
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
575
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
576
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
577
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
578
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
579
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
580
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
581
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
582
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
583
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
584
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
585
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
586
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
587
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
588
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
589
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
590
+ 435 0h399565z`,leftgroupunder:`M400000 262
591
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
592
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
593
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
594
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
595
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
596
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
597
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
598
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
599
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
600
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
601
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
602
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
603
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
604
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
605
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
606
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
607
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
608
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:qt("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:qt("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:qt("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:qt("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
609
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
610
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
611
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:qt("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
612
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
613
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
614
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
615
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
616
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
617
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
618
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
619
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
620
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
621
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
622
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
623
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
624
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
625
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
626
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
627
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
628
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
629
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
630
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
631
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
632
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
633
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
634
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
635
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
636
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
637
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
638
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
639
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
640
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
641
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
642
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
643
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
644
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
645
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
646
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
647
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
648
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
649
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
650
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
651
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
652
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
653
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
654
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
655
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
656
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
657
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
658
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
659
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
660
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:qt("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:qt("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:qt("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
661
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
662
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
663
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
664
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
665
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
666
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
667
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
668
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
669
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
670
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
671
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
672
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
673
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
674
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
675
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
676
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
677
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
678
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
679
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
680
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
681
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
682
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
683
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
684
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
685
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
686
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
687
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
688
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
689
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
690
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
691
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
692
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
693
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
694
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
695
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
696
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
697
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
698
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
699
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
700
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
701
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
702
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
703
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
704
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
705
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
706
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
707
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
708
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
709
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
710
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
711
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
712
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
713
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
714
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
715
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
716
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
717
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
718
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
719
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
720
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
721
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
722
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
723
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
724
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
725
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
726
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
727
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
728
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
729
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
730
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
731
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
732
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
733
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},KE=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
734
+ H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
735
+ M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
736
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
737
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
738
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
739
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
740
+ M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
741
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
742
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
743
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
744
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
745
+ M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
746
+ M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
747
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
748
+ -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
749
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
750
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
751
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
752
+ l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
753
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
754
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
755
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
756
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
757
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
758
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
759
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
760
+ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
761
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function XE(e){return"toText"in e}class sa{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(XE(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Fc={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},QE={ex:!0,em:!0,mu:!0},F2=function(t){return typeof t!="string"&&(t=t.unit),t in Fc||t in QE||t==="ex"},_t=function(t,n){var r;if(t.unit in Fc)r=Fc[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,t.unit==="ex")r=i.fontMetrics().xHeight;else if(t.unit==="em")r=i.fontMetrics().quad;else throw new Ee("Invalid unit: '"+t.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},Se=function(t){return+t.toFixed(4)+"em"},Fr=function(t){return t.filter(n=>n).join(" ")},xd=function(t){var n="";for(var r of Object.keys(t)){var i=t[r];i!==void 0&&(n+=SE(r)+":"+i+";")}return n},z2=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},H2=function(t){var n=document.createElement(t);n.className=Fr(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n},ZE=/[\s"'>/=\x00-\x1f]/,U2=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+sn(Fr(this.classes))+'"');var r=xd(this.style);r&&(n+=' style="'+sn(r)+'"');for(var i of Object.keys(this.attributes)){if(ZE.test(i))throw new Ee("Invalid attribute name '"+i+"'");n+=" "+i+'="'+sn(this.attributes[i])+'"'}n+=">";for(var a=0;a<this.children.length;a++)n+=this.children[a].toMarkup();return n+="</"+t+">",n};class oa{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,z2.call(this,t,r,i),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return H2.call(this,"span")}toMarkup(){return U2.call(this,"span")}}class ml{constructor(t,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,z2.call(this,n,i),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return H2.call(this,"a")}toMarkup(){return U2.call(this,"a")}}class JE{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+sn(this.src)+'"'+(' alt="'+sn(this.alt)+'"'),n=xd(this.style);return n&&(t+=' style="'+sn(n)+'"'),t+="'/>",t}}var eT={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Nn{constructor(t,n,r,i,a,s,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=i||0,this.skew=a||0,this.width=s||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var u=FE(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=eT[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Se(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Fr(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=sn(Fr(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+Se(this.italic)+";"),r+=xd(this.style),r&&(t=!0,n+=' style="'+sn(r)+'"');var i=sn(this.text);return t?(n+=">",n+=i,n+="</span>",n):i}}class kr{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+sn(this.attributes[n])+'"';t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>",t}}class zr{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Wf[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+sn(this.alternate)+'"/>':'<path d="'+sn(Wf[this.pathName])+'"/>'}}class zc{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+sn(this.attributes[n])+'"';return t+="/>",t}}function tT(e){if(e instanceof Nn)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function nT(e){if(e instanceof oa)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var rT=e=>e instanceof oa||e instanceof ml||e instanceof sa,ar={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Us={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Gf={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function iT(e,t){ar[e]=t}function bd(e,t,n){if(!ar[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=ar[t][r];if(!i&&e[0]in Gf&&(r=Gf[e[0]].charCodeAt(0),i=ar[t][r]),!i&&n==="text"&&B2(r)&&(i=ar[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var bu={};function aT(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!bu[t]){var n=bu[t]={cssEmPerMu:Us.quad[t]/18};for(var r in Us)Us.hasOwnProperty(r)&&(n[r]=Us[r][t])}return bu[t]}var Ct={math:{},text:{}};function T(e,t,n,r,i,a){Ct[e][i]={font:t,group:n,replace:r},a&&r&&(Ct[e][r]=Ct[e][i])}var M="math",xe="text",D="main",$="ams",Nt="accent-token",De="bin",gn="close",la="inner",qe="mathord",Ut="op-token",Mn="open",Es="punct",W="rel",Sr="spacing",J="textord";T(M,D,W,"≡","\\equiv",!0);T(M,D,W,"≺","\\prec",!0);T(M,D,W,"≻","\\succ",!0);T(M,D,W,"∼","\\sim",!0);T(M,D,W,"⊥","\\perp");T(M,D,W,"⪯","\\preceq",!0);T(M,D,W,"⪰","\\succeq",!0);T(M,D,W,"≃","\\simeq",!0);T(M,D,W,"∣","\\mid",!0);T(M,D,W,"≪","\\ll",!0);T(M,D,W,"≫","\\gg",!0);T(M,D,W,"≍","\\asymp",!0);T(M,D,W,"∥","\\parallel");T(M,D,W,"⋈","\\bowtie",!0);T(M,D,W,"⌣","\\smile",!0);T(M,D,W,"⊑","\\sqsubseteq",!0);T(M,D,W,"⊒","\\sqsupseteq",!0);T(M,D,W,"≐","\\doteq",!0);T(M,D,W,"⌢","\\frown",!0);T(M,D,W,"∋","\\ni",!0);T(M,D,W,"∝","\\propto",!0);T(M,D,W,"⊢","\\vdash",!0);T(M,D,W,"⊣","\\dashv",!0);T(M,D,W,"∋","\\owns");T(M,D,Es,".","\\ldotp");T(M,D,Es,"⋅","\\cdotp");T(M,D,Es,"⋅","·");T(xe,D,J,"⋅","·");T(M,D,J,"#","\\#");T(xe,D,J,"#","\\#");T(M,D,J,"&","\\&");T(xe,D,J,"&","\\&");T(M,D,J,"ℵ","\\aleph",!0);T(M,D,J,"∀","\\forall",!0);T(M,D,J,"ℏ","\\hbar",!0);T(M,D,J,"∃","\\exists",!0);T(M,D,J,"∇","\\nabla",!0);T(M,D,J,"♭","\\flat",!0);T(M,D,J,"ℓ","\\ell",!0);T(M,D,J,"♮","\\natural",!0);T(M,D,J,"♣","\\clubsuit",!0);T(M,D,J,"℘","\\wp",!0);T(M,D,J,"♯","\\sharp",!0);T(M,D,J,"♢","\\diamondsuit",!0);T(M,D,J,"ℜ","\\Re",!0);T(M,D,J,"♡","\\heartsuit",!0);T(M,D,J,"ℑ","\\Im",!0);T(M,D,J,"♠","\\spadesuit",!0);T(M,D,J,"§","\\S",!0);T(xe,D,J,"§","\\S");T(M,D,J,"¶","\\P",!0);T(xe,D,J,"¶","\\P");T(M,D,J,"†","\\dag");T(xe,D,J,"†","\\dag");T(xe,D,J,"†","\\textdagger");T(M,D,J,"‡","\\ddag");T(xe,D,J,"‡","\\ddag");T(xe,D,J,"‡","\\textdaggerdbl");T(M,D,gn,"⎱","\\rmoustache",!0);T(M,D,Mn,"⎰","\\lmoustache",!0);T(M,D,gn,"⟯","\\rgroup",!0);T(M,D,Mn,"⟮","\\lgroup",!0);T(M,D,De,"∓","\\mp",!0);T(M,D,De,"⊖","\\ominus",!0);T(M,D,De,"⊎","\\uplus",!0);T(M,D,De,"⊓","\\sqcap",!0);T(M,D,De,"∗","\\ast");T(M,D,De,"⊔","\\sqcup",!0);T(M,D,De,"◯","\\bigcirc",!0);T(M,D,De,"∙","\\bullet",!0);T(M,D,De,"‡","\\ddagger");T(M,D,De,"≀","\\wr",!0);T(M,D,De,"⨿","\\amalg");T(M,D,De,"&","\\And");T(M,D,W,"⟵","\\longleftarrow",!0);T(M,D,W,"⇐","\\Leftarrow",!0);T(M,D,W,"⟸","\\Longleftarrow",!0);T(M,D,W,"⟶","\\longrightarrow",!0);T(M,D,W,"⇒","\\Rightarrow",!0);T(M,D,W,"⟹","\\Longrightarrow",!0);T(M,D,W,"↔","\\leftrightarrow",!0);T(M,D,W,"⟷","\\longleftrightarrow",!0);T(M,D,W,"⇔","\\Leftrightarrow",!0);T(M,D,W,"⟺","\\Longleftrightarrow",!0);T(M,D,W,"↦","\\mapsto",!0);T(M,D,W,"⟼","\\longmapsto",!0);T(M,D,W,"↗","\\nearrow",!0);T(M,D,W,"↩","\\hookleftarrow",!0);T(M,D,W,"↪","\\hookrightarrow",!0);T(M,D,W,"↘","\\searrow",!0);T(M,D,W,"↼","\\leftharpoonup",!0);T(M,D,W,"⇀","\\rightharpoonup",!0);T(M,D,W,"↙","\\swarrow",!0);T(M,D,W,"↽","\\leftharpoondown",!0);T(M,D,W,"⇁","\\rightharpoondown",!0);T(M,D,W,"↖","\\nwarrow",!0);T(M,D,W,"⇌","\\rightleftharpoons",!0);T(M,$,W,"≮","\\nless",!0);T(M,$,W,"","\\@nleqslant");T(M,$,W,"","\\@nleqq");T(M,$,W,"⪇","\\lneq",!0);T(M,$,W,"≨","\\lneqq",!0);T(M,$,W,"","\\@lvertneqq");T(M,$,W,"⋦","\\lnsim",!0);T(M,$,W,"⪉","\\lnapprox",!0);T(M,$,W,"⊀","\\nprec",!0);T(M,$,W,"⋠","\\npreceq",!0);T(M,$,W,"⋨","\\precnsim",!0);T(M,$,W,"⪹","\\precnapprox",!0);T(M,$,W,"≁","\\nsim",!0);T(M,$,W,"","\\@nshortmid");T(M,$,W,"∤","\\nmid",!0);T(M,$,W,"⊬","\\nvdash",!0);T(M,$,W,"⊭","\\nvDash",!0);T(M,$,W,"⋪","\\ntriangleleft");T(M,$,W,"⋬","\\ntrianglelefteq",!0);T(M,$,W,"⊊","\\subsetneq",!0);T(M,$,W,"","\\@varsubsetneq");T(M,$,W,"⫋","\\subsetneqq",!0);T(M,$,W,"","\\@varsubsetneqq");T(M,$,W,"≯","\\ngtr",!0);T(M,$,W,"","\\@ngeqslant");T(M,$,W,"","\\@ngeqq");T(M,$,W,"⪈","\\gneq",!0);T(M,$,W,"≩","\\gneqq",!0);T(M,$,W,"","\\@gvertneqq");T(M,$,W,"⋧","\\gnsim",!0);T(M,$,W,"⪊","\\gnapprox",!0);T(M,$,W,"⊁","\\nsucc",!0);T(M,$,W,"⋡","\\nsucceq",!0);T(M,$,W,"⋩","\\succnsim",!0);T(M,$,W,"⪺","\\succnapprox",!0);T(M,$,W,"≆","\\ncong",!0);T(M,$,W,"","\\@nshortparallel");T(M,$,W,"∦","\\nparallel",!0);T(M,$,W,"⊯","\\nVDash",!0);T(M,$,W,"⋫","\\ntriangleright");T(M,$,W,"⋭","\\ntrianglerighteq",!0);T(M,$,W,"","\\@nsupseteqq");T(M,$,W,"⊋","\\supsetneq",!0);T(M,$,W,"","\\@varsupsetneq");T(M,$,W,"⫌","\\supsetneqq",!0);T(M,$,W,"","\\@varsupsetneqq");T(M,$,W,"⊮","\\nVdash",!0);T(M,$,W,"⪵","\\precneqq",!0);T(M,$,W,"⪶","\\succneqq",!0);T(M,$,W,"","\\@nsubseteqq");T(M,$,De,"⊴","\\unlhd");T(M,$,De,"⊵","\\unrhd");T(M,$,W,"↚","\\nleftarrow",!0);T(M,$,W,"↛","\\nrightarrow",!0);T(M,$,W,"⇍","\\nLeftarrow",!0);T(M,$,W,"⇏","\\nRightarrow",!0);T(M,$,W,"↮","\\nleftrightarrow",!0);T(M,$,W,"⇎","\\nLeftrightarrow",!0);T(M,$,W,"△","\\vartriangle");T(M,$,J,"ℏ","\\hslash");T(M,$,J,"▽","\\triangledown");T(M,$,J,"◊","\\lozenge");T(M,$,J,"Ⓢ","\\circledS");T(M,$,J,"®","\\circledR");T(xe,$,J,"®","\\circledR");T(M,$,J,"∡","\\measuredangle",!0);T(M,$,J,"∄","\\nexists");T(M,$,J,"℧","\\mho");T(M,$,J,"Ⅎ","\\Finv",!0);T(M,$,J,"⅁","\\Game",!0);T(M,$,J,"‵","\\backprime");T(M,$,J,"▲","\\blacktriangle");T(M,$,J,"▼","\\blacktriangledown");T(M,$,J,"■","\\blacksquare");T(M,$,J,"⧫","\\blacklozenge");T(M,$,J,"★","\\bigstar");T(M,$,J,"∢","\\sphericalangle",!0);T(M,$,J,"∁","\\complement",!0);T(M,$,J,"ð","\\eth",!0);T(xe,D,J,"ð","ð");T(M,$,J,"╱","\\diagup");T(M,$,J,"╲","\\diagdown");T(M,$,J,"□","\\square");T(M,$,J,"□","\\Box");T(M,$,J,"◊","\\Diamond");T(M,$,J,"¥","\\yen",!0);T(xe,$,J,"¥","\\yen",!0);T(M,$,J,"✓","\\checkmark",!0);T(xe,$,J,"✓","\\checkmark");T(M,$,J,"ℶ","\\beth",!0);T(M,$,J,"ℸ","\\daleth",!0);T(M,$,J,"ℷ","\\gimel",!0);T(M,$,J,"ϝ","\\digamma",!0);T(M,$,J,"ϰ","\\varkappa");T(M,$,Mn,"┌","\\@ulcorner",!0);T(M,$,gn,"┐","\\@urcorner",!0);T(M,$,Mn,"└","\\@llcorner",!0);T(M,$,gn,"┘","\\@lrcorner",!0);T(M,$,W,"≦","\\leqq",!0);T(M,$,W,"⩽","\\leqslant",!0);T(M,$,W,"⪕","\\eqslantless",!0);T(M,$,W,"≲","\\lesssim",!0);T(M,$,W,"⪅","\\lessapprox",!0);T(M,$,W,"≊","\\approxeq",!0);T(M,$,De,"⋖","\\lessdot");T(M,$,W,"⋘","\\lll",!0);T(M,$,W,"≶","\\lessgtr",!0);T(M,$,W,"⋚","\\lesseqgtr",!0);T(M,$,W,"⪋","\\lesseqqgtr",!0);T(M,$,W,"≑","\\doteqdot");T(M,$,W,"≓","\\risingdotseq",!0);T(M,$,W,"≒","\\fallingdotseq",!0);T(M,$,W,"∽","\\backsim",!0);T(M,$,W,"⋍","\\backsimeq",!0);T(M,$,W,"⫅","\\subseteqq",!0);T(M,$,W,"⋐","\\Subset",!0);T(M,$,W,"⊏","\\sqsubset",!0);T(M,$,W,"≼","\\preccurlyeq",!0);T(M,$,W,"⋞","\\curlyeqprec",!0);T(M,$,W,"≾","\\precsim",!0);T(M,$,W,"⪷","\\precapprox",!0);T(M,$,W,"⊲","\\vartriangleleft");T(M,$,W,"⊴","\\trianglelefteq");T(M,$,W,"⊨","\\vDash",!0);T(M,$,W,"⊪","\\Vvdash",!0);T(M,$,W,"⌣","\\smallsmile");T(M,$,W,"⌢","\\smallfrown");T(M,$,W,"≏","\\bumpeq",!0);T(M,$,W,"≎","\\Bumpeq",!0);T(M,$,W,"≧","\\geqq",!0);T(M,$,W,"⩾","\\geqslant",!0);T(M,$,W,"⪖","\\eqslantgtr",!0);T(M,$,W,"≳","\\gtrsim",!0);T(M,$,W,"⪆","\\gtrapprox",!0);T(M,$,De,"⋗","\\gtrdot");T(M,$,W,"⋙","\\ggg",!0);T(M,$,W,"≷","\\gtrless",!0);T(M,$,W,"⋛","\\gtreqless",!0);T(M,$,W,"⪌","\\gtreqqless",!0);T(M,$,W,"≖","\\eqcirc",!0);T(M,$,W,"≗","\\circeq",!0);T(M,$,W,"≜","\\triangleq",!0);T(M,$,W,"∼","\\thicksim");T(M,$,W,"≈","\\thickapprox");T(M,$,W,"⫆","\\supseteqq",!0);T(M,$,W,"⋑","\\Supset",!0);T(M,$,W,"⊐","\\sqsupset",!0);T(M,$,W,"≽","\\succcurlyeq",!0);T(M,$,W,"⋟","\\curlyeqsucc",!0);T(M,$,W,"≿","\\succsim",!0);T(M,$,W,"⪸","\\succapprox",!0);T(M,$,W,"⊳","\\vartriangleright");T(M,$,W,"⊵","\\trianglerighteq");T(M,$,W,"⊩","\\Vdash",!0);T(M,$,W,"∣","\\shortmid");T(M,$,W,"∥","\\shortparallel");T(M,$,W,"≬","\\between",!0);T(M,$,W,"⋔","\\pitchfork",!0);T(M,$,W,"∝","\\varpropto");T(M,$,W,"◀","\\blacktriangleleft");T(M,$,W,"∴","\\therefore",!0);T(M,$,W,"∍","\\backepsilon");T(M,$,W,"▶","\\blacktriangleright");T(M,$,W,"∵","\\because",!0);T(M,$,W,"⋘","\\llless");T(M,$,W,"⋙","\\gggtr");T(M,$,De,"⊲","\\lhd");T(M,$,De,"⊳","\\rhd");T(M,$,W,"≂","\\eqsim",!0);T(M,D,W,"⋈","\\Join");T(M,$,W,"≑","\\Doteq",!0);T(M,$,De,"∔","\\dotplus",!0);T(M,$,De,"∖","\\smallsetminus");T(M,$,De,"⋒","\\Cap",!0);T(M,$,De,"⋓","\\Cup",!0);T(M,$,De,"⩞","\\doublebarwedge",!0);T(M,$,De,"⊟","\\boxminus",!0);T(M,$,De,"⊞","\\boxplus",!0);T(M,$,De,"⋇","\\divideontimes",!0);T(M,$,De,"⋉","\\ltimes",!0);T(M,$,De,"⋊","\\rtimes",!0);T(M,$,De,"⋋","\\leftthreetimes",!0);T(M,$,De,"⋌","\\rightthreetimes",!0);T(M,$,De,"⋏","\\curlywedge",!0);T(M,$,De,"⋎","\\curlyvee",!0);T(M,$,De,"⊝","\\circleddash",!0);T(M,$,De,"⊛","\\circledast",!0);T(M,$,De,"⋅","\\centerdot");T(M,$,De,"⊺","\\intercal",!0);T(M,$,De,"⋒","\\doublecap");T(M,$,De,"⋓","\\doublecup");T(M,$,De,"⊠","\\boxtimes",!0);T(M,$,W,"⇢","\\dashrightarrow",!0);T(M,$,W,"⇠","\\dashleftarrow",!0);T(M,$,W,"⇇","\\leftleftarrows",!0);T(M,$,W,"⇆","\\leftrightarrows",!0);T(M,$,W,"⇚","\\Lleftarrow",!0);T(M,$,W,"↞","\\twoheadleftarrow",!0);T(M,$,W,"↢","\\leftarrowtail",!0);T(M,$,W,"↫","\\looparrowleft",!0);T(M,$,W,"⇋","\\leftrightharpoons",!0);T(M,$,W,"↶","\\curvearrowleft",!0);T(M,$,W,"↺","\\circlearrowleft",!0);T(M,$,W,"↰","\\Lsh",!0);T(M,$,W,"⇈","\\upuparrows",!0);T(M,$,W,"↿","\\upharpoonleft",!0);T(M,$,W,"⇃","\\downharpoonleft",!0);T(M,D,W,"⊶","\\origof",!0);T(M,D,W,"⊷","\\imageof",!0);T(M,$,W,"⊸","\\multimap",!0);T(M,$,W,"↭","\\leftrightsquigarrow",!0);T(M,$,W,"⇉","\\rightrightarrows",!0);T(M,$,W,"⇄","\\rightleftarrows",!0);T(M,$,W,"↠","\\twoheadrightarrow",!0);T(M,$,W,"↣","\\rightarrowtail",!0);T(M,$,W,"↬","\\looparrowright",!0);T(M,$,W,"↷","\\curvearrowright",!0);T(M,$,W,"↻","\\circlearrowright",!0);T(M,$,W,"↱","\\Rsh",!0);T(M,$,W,"⇊","\\downdownarrows",!0);T(M,$,W,"↾","\\upharpoonright",!0);T(M,$,W,"⇂","\\downharpoonright",!0);T(M,$,W,"⇝","\\rightsquigarrow",!0);T(M,$,W,"⇝","\\leadsto");T(M,$,W,"⇛","\\Rrightarrow",!0);T(M,$,W,"↾","\\restriction");T(M,D,J,"‘","`");T(M,D,J,"$","\\$");T(xe,D,J,"$","\\$");T(xe,D,J,"$","\\textdollar");T(M,D,J,"%","\\%");T(xe,D,J,"%","\\%");T(M,D,J,"_","\\_");T(xe,D,J,"_","\\_");T(xe,D,J,"_","\\textunderscore");T(M,D,J,"∠","\\angle",!0);T(M,D,J,"∞","\\infty",!0);T(M,D,J,"′","\\prime");T(M,D,J,"△","\\triangle");T(M,D,J,"Γ","\\Gamma",!0);T(M,D,J,"Δ","\\Delta",!0);T(M,D,J,"Θ","\\Theta",!0);T(M,D,J,"Λ","\\Lambda",!0);T(M,D,J,"Ξ","\\Xi",!0);T(M,D,J,"Π","\\Pi",!0);T(M,D,J,"Σ","\\Sigma",!0);T(M,D,J,"Υ","\\Upsilon",!0);T(M,D,J,"Φ","\\Phi",!0);T(M,D,J,"Ψ","\\Psi",!0);T(M,D,J,"Ω","\\Omega",!0);T(M,D,J,"A","Α");T(M,D,J,"B","Β");T(M,D,J,"E","Ε");T(M,D,J,"Z","Ζ");T(M,D,J,"H","Η");T(M,D,J,"I","Ι");T(M,D,J,"K","Κ");T(M,D,J,"M","Μ");T(M,D,J,"N","Ν");T(M,D,J,"O","Ο");T(M,D,J,"P","Ρ");T(M,D,J,"T","Τ");T(M,D,J,"X","Χ");T(M,D,J,"¬","\\neg",!0);T(M,D,J,"¬","\\lnot");T(M,D,J,"⊤","\\top");T(M,D,J,"⊥","\\bot");T(M,D,J,"∅","\\emptyset");T(M,$,J,"∅","\\varnothing");T(M,D,qe,"α","\\alpha",!0);T(M,D,qe,"β","\\beta",!0);T(M,D,qe,"γ","\\gamma",!0);T(M,D,qe,"δ","\\delta",!0);T(M,D,qe,"ϵ","\\epsilon",!0);T(M,D,qe,"ζ","\\zeta",!0);T(M,D,qe,"η","\\eta",!0);T(M,D,qe,"θ","\\theta",!0);T(M,D,qe,"ι","\\iota",!0);T(M,D,qe,"κ","\\kappa",!0);T(M,D,qe,"λ","\\lambda",!0);T(M,D,qe,"μ","\\mu",!0);T(M,D,qe,"ν","\\nu",!0);T(M,D,qe,"ξ","\\xi",!0);T(M,D,qe,"ο","\\omicron",!0);T(M,D,qe,"π","\\pi",!0);T(M,D,qe,"ρ","\\rho",!0);T(M,D,qe,"σ","\\sigma",!0);T(M,D,qe,"τ","\\tau",!0);T(M,D,qe,"υ","\\upsilon",!0);T(M,D,qe,"ϕ","\\phi",!0);T(M,D,qe,"χ","\\chi",!0);T(M,D,qe,"ψ","\\psi",!0);T(M,D,qe,"ω","\\omega",!0);T(M,D,qe,"ε","\\varepsilon",!0);T(M,D,qe,"ϑ","\\vartheta",!0);T(M,D,qe,"ϖ","\\varpi",!0);T(M,D,qe,"ϱ","\\varrho",!0);T(M,D,qe,"ς","\\varsigma",!0);T(M,D,qe,"φ","\\varphi",!0);T(M,D,De,"∗","*",!0);T(M,D,De,"+","+");T(M,D,De,"−","-",!0);T(M,D,De,"⋅","\\cdot",!0);T(M,D,De,"∘","\\circ",!0);T(M,D,De,"÷","\\div",!0);T(M,D,De,"±","\\pm",!0);T(M,D,De,"×","\\times",!0);T(M,D,De,"∩","\\cap",!0);T(M,D,De,"∪","\\cup",!0);T(M,D,De,"∖","\\setminus",!0);T(M,D,De,"∧","\\land");T(M,D,De,"∨","\\lor");T(M,D,De,"∧","\\wedge",!0);T(M,D,De,"∨","\\vee",!0);T(M,D,J,"√","\\surd");T(M,D,Mn,"⟨","\\langle",!0);T(M,D,Mn,"∣","\\lvert");T(M,D,Mn,"∥","\\lVert");T(M,D,gn,"?","?");T(M,D,gn,"!","!");T(M,D,gn,"⟩","\\rangle",!0);T(M,D,gn,"∣","\\rvert");T(M,D,gn,"∥","\\rVert");T(M,D,W,"=","=");T(M,D,W,":",":");T(M,D,W,"≈","\\approx",!0);T(M,D,W,"≅","\\cong",!0);T(M,D,W,"≥","\\ge");T(M,D,W,"≥","\\geq",!0);T(M,D,W,"←","\\gets");T(M,D,W,">","\\gt",!0);T(M,D,W,"∈","\\in",!0);T(M,D,W,"","\\@not");T(M,D,W,"⊂","\\subset",!0);T(M,D,W,"⊃","\\supset",!0);T(M,D,W,"⊆","\\subseteq",!0);T(M,D,W,"⊇","\\supseteq",!0);T(M,$,W,"⊈","\\nsubseteq",!0);T(M,$,W,"⊉","\\nsupseteq",!0);T(M,D,W,"⊨","\\models");T(M,D,W,"←","\\leftarrow",!0);T(M,D,W,"≤","\\le");T(M,D,W,"≤","\\leq",!0);T(M,D,W,"<","\\lt",!0);T(M,D,W,"→","\\rightarrow",!0);T(M,D,W,"→","\\to");T(M,$,W,"≱","\\ngeq",!0);T(M,$,W,"≰","\\nleq",!0);T(M,D,Sr," ","\\ ");T(M,D,Sr," ","\\space");T(M,D,Sr," ","\\nobreakspace");T(xe,D,Sr," ","\\ ");T(xe,D,Sr," "," ");T(xe,D,Sr," ","\\space");T(xe,D,Sr," ","\\nobreakspace");T(M,D,Sr,"","\\nobreak");T(M,D,Sr,"","\\allowbreak");T(M,D,Es,",",",");T(M,D,Es,";",";");T(M,$,De,"⊼","\\barwedge",!0);T(M,$,De,"⊻","\\veebar",!0);T(M,D,De,"⊙","\\odot",!0);T(M,D,De,"⊕","\\oplus",!0);T(M,D,De,"⊗","\\otimes",!0);T(M,D,J,"∂","\\partial",!0);T(M,D,De,"⊘","\\oslash",!0);T(M,$,De,"⊚","\\circledcirc",!0);T(M,$,De,"⊡","\\boxdot",!0);T(M,D,De,"△","\\bigtriangleup");T(M,D,De,"▽","\\bigtriangledown");T(M,D,De,"†","\\dagger");T(M,D,De,"⋄","\\diamond");T(M,D,De,"⋆","\\star");T(M,D,De,"◃","\\triangleleft");T(M,D,De,"▹","\\triangleright");T(M,D,Mn,"{","\\{");T(xe,D,J,"{","\\{");T(xe,D,J,"{","\\textbraceleft");T(M,D,gn,"}","\\}");T(xe,D,J,"}","\\}");T(xe,D,J,"}","\\textbraceright");T(M,D,Mn,"{","\\lbrace");T(M,D,gn,"}","\\rbrace");T(M,D,Mn,"[","\\lbrack",!0);T(xe,D,J,"[","\\lbrack",!0);T(M,D,gn,"]","\\rbrack",!0);T(xe,D,J,"]","\\rbrack",!0);T(M,D,Mn,"(","\\lparen",!0);T(M,D,gn,")","\\rparen",!0);T(xe,D,J,"<","\\textless",!0);T(xe,D,J,">","\\textgreater",!0);T(M,D,Mn,"⌊","\\lfloor",!0);T(M,D,gn,"⌋","\\rfloor",!0);T(M,D,Mn,"⌈","\\lceil",!0);T(M,D,gn,"⌉","\\rceil",!0);T(M,D,J,"\\","\\backslash");T(M,D,J,"∣","|");T(M,D,J,"∣","\\vert");T(xe,D,J,"|","\\textbar",!0);T(M,D,J,"∥","\\|");T(M,D,J,"∥","\\Vert");T(xe,D,J,"∥","\\textbardbl");T(xe,D,J,"~","\\textasciitilde");T(xe,D,J,"\\","\\textbackslash");T(xe,D,J,"^","\\textasciicircum");T(M,D,W,"↑","\\uparrow",!0);T(M,D,W,"⇑","\\Uparrow",!0);T(M,D,W,"↓","\\downarrow",!0);T(M,D,W,"⇓","\\Downarrow",!0);T(M,D,W,"↕","\\updownarrow",!0);T(M,D,W,"⇕","\\Updownarrow",!0);T(M,D,Ut,"∐","\\coprod");T(M,D,Ut,"⋁","\\bigvee");T(M,D,Ut,"⋀","\\bigwedge");T(M,D,Ut,"⨄","\\biguplus");T(M,D,Ut,"⋂","\\bigcap");T(M,D,Ut,"⋃","\\bigcup");T(M,D,Ut,"∫","\\int");T(M,D,Ut,"∫","\\intop");T(M,D,Ut,"∬","\\iint");T(M,D,Ut,"∭","\\iiint");T(M,D,Ut,"∏","\\prod");T(M,D,Ut,"∑","\\sum");T(M,D,Ut,"⨂","\\bigotimes");T(M,D,Ut,"⨁","\\bigoplus");T(M,D,Ut,"⨀","\\bigodot");T(M,D,Ut,"∮","\\oint");T(M,D,Ut,"∯","\\oiint");T(M,D,Ut,"∰","\\oiiint");T(M,D,Ut,"⨆","\\bigsqcup");T(M,D,Ut,"∫","\\smallint");T(xe,D,la,"…","\\textellipsis");T(M,D,la,"…","\\mathellipsis");T(xe,D,la,"…","\\ldots",!0);T(M,D,la,"…","\\ldots",!0);T(M,D,la,"⋯","\\@cdots",!0);T(M,D,la,"⋱","\\ddots",!0);T(M,D,J,"⋮","\\varvdots");T(xe,D,J,"⋮","\\varvdots");T(M,D,Nt,"ˊ","\\acute");T(M,D,Nt,"ˋ","\\grave");T(M,D,Nt,"¨","\\ddot");T(M,D,Nt,"~","\\tilde");T(M,D,Nt,"ˉ","\\bar");T(M,D,Nt,"˘","\\breve");T(M,D,Nt,"ˇ","\\check");T(M,D,Nt,"^","\\hat");T(M,D,Nt,"⃗","\\vec");T(M,D,Nt,"˙","\\dot");T(M,D,Nt,"˚","\\mathring");T(M,D,qe,"","\\@imath");T(M,D,qe,"","\\@jmath");T(M,D,J,"ı","ı");T(M,D,J,"ȷ","ȷ");T(xe,D,J,"ı","\\i",!0);T(xe,D,J,"ȷ","\\j",!0);T(xe,D,J,"ß","\\ss",!0);T(xe,D,J,"æ","\\ae",!0);T(xe,D,J,"œ","\\oe",!0);T(xe,D,J,"ø","\\o",!0);T(xe,D,J,"Æ","\\AE",!0);T(xe,D,J,"Œ","\\OE",!0);T(xe,D,J,"Ø","\\O",!0);T(xe,D,Nt,"ˊ","\\'");T(xe,D,Nt,"ˋ","\\`");T(xe,D,Nt,"ˆ","\\^");T(xe,D,Nt,"˜","\\~");T(xe,D,Nt,"ˉ","\\=");T(xe,D,Nt,"˘","\\u");T(xe,D,Nt,"˙","\\.");T(xe,D,Nt,"¸","\\c");T(xe,D,Nt,"˚","\\r");T(xe,D,Nt,"ˇ","\\v");T(xe,D,Nt,"¨",'\\"');T(xe,D,Nt,"˝","\\H");T(xe,D,Nt,"◯","\\textcircled");var V2={"--":!0,"---":!0,"``":!0,"''":!0};T(xe,D,J,"–","--",!0);T(xe,D,J,"–","\\textendash");T(xe,D,J,"—","---",!0);T(xe,D,J,"—","\\textemdash");T(xe,D,J,"‘","`",!0);T(xe,D,J,"‘","\\textquoteleft");T(xe,D,J,"’","'",!0);T(xe,D,J,"’","\\textquoteright");T(xe,D,J,"“","``",!0);T(xe,D,J,"“","\\textquotedblleft");T(xe,D,J,"”","''",!0);T(xe,D,J,"”","\\textquotedblright");T(M,D,J,"°","\\degree",!0);T(xe,D,J,"°","\\degree");T(xe,D,J,"°","\\textdegree",!0);T(M,D,J,"£","\\pounds");T(M,D,J,"£","\\mathsterling",!0);T(xe,D,J,"£","\\pounds");T(xe,D,J,"£","\\textsterling",!0);T(M,$,J,"✠","\\maltese");T(xe,$,J,"✠","\\maltese");var Yf='0123456789/@."';for(var yu=0;yu<Yf.length;yu++){var Kf=Yf.charAt(yu);T(M,D,J,Kf,Kf)}var Xf='0123456789!@*()-=+";:?/.,';for(var vu=0;vu<Xf.length;vu++){var Qf=Xf.charAt(vu);T(xe,D,J,Qf,Qf)}var jo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var wu=0;wu<jo.length;wu++){var Vs=jo.charAt(wu);T(M,D,qe,Vs,Vs),T(xe,D,J,Vs,Vs)}T(M,$,J,"C","ℂ");T(xe,$,J,"C","ℂ");T(M,$,J,"H","ℍ");T(xe,$,J,"H","ℍ");T(M,$,J,"N","ℕ");T(xe,$,J,"N","ℕ");T(M,$,J,"P","ℙ");T(xe,$,J,"P","ℙ");T(M,$,J,"Q","ℚ");T(xe,$,J,"Q","ℚ");T(M,$,J,"R","ℝ");T(xe,$,J,"R","ℝ");T(M,$,J,"Z","ℤ");T(xe,$,J,"Z","ℤ");T(M,D,qe,"h","ℎ");T(xe,D,qe,"h","ℎ");var We;for(var cn=0;cn<jo.length;cn++){var Rt=jo.charAt(cn);We=String.fromCharCode(55349,56320+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56372+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56424+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56580+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56684+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56736+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56788+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56840+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56944+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),cn<26&&(We=String.fromCharCode(55349,56632+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We),We=String.fromCharCode(55349,56476+cn),T(M,D,qe,Rt,We),T(xe,D,J,Rt,We))}We="𝕜";T(M,D,qe,"k",We);T(xe,D,J,"k",We);for(var ni=0;ni<10;ni++){var Ir=ni.toString();We=String.fromCharCode(55349,57294+ni),T(M,D,qe,Ir,We),T(xe,D,J,Ir,We),We=String.fromCharCode(55349,57314+ni),T(M,D,qe,Ir,We),T(xe,D,J,Ir,We),We=String.fromCharCode(55349,57324+ni),T(M,D,qe,Ir,We),T(xe,D,J,Ir,We),We=String.fromCharCode(55349,57334+ni),T(M,D,qe,Ir,We),T(xe,D,J,Ir,We)}var Hc="ÐÞþ";for(var ku=0;ku<Hc.length;ku++){var qs=Hc.charAt(ku);T(M,D,qe,qs,qs),T(xe,D,J,qs,qs)}var Uc={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Zf={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Jf={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},sT={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},ci={mathClass:"",textClass:"",font:""},em={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},tm={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},nm={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Vc={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},qc={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},rm={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},$c={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},im=[Uc,Uc,Zf,Zf,Jf,Jf,sT,ci,ci,ci,em,em,tm,tm,nm,nm,Vc,Vc,qc,qc,rm,rm,ci,ci,$c,$c],oT=[Uc,ci,Vc,qc,$c],lT=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return im[i]}else if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return oT[a]}else{if(r===120485||r===120486)return im[0];if(120486<r&&r<120782)return ci;throw new Ee("Unsupported character: "+e)}},pl=function(t,n,r){if(Ct[r][t]){var i=Ct[r][t].replace;i&&(t=i)}return{value:t,metrics:bd(t,n,r)}},dn=function(t,n,r,i,a){var s=pl(t,n,r),o=s.metrics;t=s.value;var l;if(o){var u=o.italic;(r==="text"||i&&i.font==="mathit")&&(u=0),l=new Nn(t,o.height,o.depth,u,o.skew,o.width,a)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+r+"'")),l=new Nn(t,0,0,0,0,0,a);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var c=i.getColor();c&&(l.style.color=c)}return l},yd=function(t,n,r,i){return i===void 0&&(i=[]),r.font==="boldsymbol"&&pl(t,"Main-Bold",n).metrics?dn(t,"Main-Bold",n,r,i.concat(["mathbf"])):t==="\\"||Ct[n][t].font==="main"?dn(t,"Main-Regular",n,r,i):dn(t,"AMS-Regular",n,r,i.concat(["amsrm"]))},uT=function(t,n,r){return r!=="textord"&&pl(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},gl=function(t,n,r){var i=t.mode,a=t.text,s=["mord"],{font:o,fontFamily:l,fontWeight:u,fontShape:c}=n,h=i==="math"||i==="text"&&!!o,m=h?o:l,d="",p="";if(a.charCodeAt(0)===55349){var g=lT(a);d=g.font,p=g[i+"Class"]}if(d)return dn(a,d,i,n,s.concat(p));if(m){var x,b;if(m==="boldsymbol"){var v=uT(a,i,r);x=v.fontName,b=[v.fontClass]}else h?(x=Wc[o].fontName,b=[o]):(x=$s(l,u,c),b=[l,u,c]);if(pl(a,x,i).metrics)return dn(a,x,i,n,s.concat(b));if(V2.hasOwnProperty(a)&&x.slice(0,10)==="Typewriter"){for(var E=[],N=0;N<a.length;N++)E.push(dn(a[N],x,i,n,s.concat(b)));return Ar(E)}}if(r==="mathord")return dn(a,"Math-Italic",i,n,s.concat(["mathnormal"]));if(r==="textord"){var k=Ct[i][a]&&Ct[i][a].font;if(k==="ams"){var S=$s("amsrm",u,c);return dn(a,S,i,n,s.concat("amsrm",u,c))}else if(k==="main"||!k){var _=$s("textrm",u,c);return dn(a,_,i,n,s.concat(u,c))}else{var C=$s(k,u,c);return dn(a,C,i,n,s.concat(C,u,c))}}else throw new Error("unexpected type: "+r+" in makeOrd")},cT=(e,t)=>{if(Fr(e.classes)!==Fr(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},q2=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Nn&&r instanceof Nn&&cT(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},vd=function(t){for(var n=0,r=0,i=0,a=0;a<t.children.length;a++){var s=t.children[a];s.height>n&&(n=s.height),s.depth>r&&(r=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=i},ve=function(t,n,r,i){var a=new oa(t,n,r,i);return vd(a),a},Hr=(e,t,n,r)=>new oa(e,t,n,r),Zi=function(t,n,r){var i=ve([t],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=Se(i.height),i.maxFontSize=1,i},dT=function(t,n,r,i){var a=new ml(t,n,r,i);return vd(a),a},Ar=function(t){var n=new sa(t);return vd(n),n},Ji=function(t,n){return t instanceof sa?ve([],[t],n):t},hT=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,a=i,s=1;s<n.length;s++){var o=-n[s].shift-a-n[s].elem.depth,l=o-(n[s-1].elem.height+n[s-1].elem.depth);a=a+o,r.push({type:"kern",size:l}),r.push(n[s])}return{children:r,depth:i}}var u;if(t.positionType==="top"){for(var c=t.positionData,h=0;h<t.children.length;h++){var m=t.children[h];c-=m.type==="kern"?m.size:m.elem.height+m.elem.depth}u=c}else if(t.positionType==="bottom")u=-t.positionData;else{var d=t.children[0];if(d.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")u=-d.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")u=-d.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:u}},pt=function(t,n){for(var{children:r,depth:i}=hT(t),a=0,s=0;s<r.length;s++){var o=r[s];if(o.type==="elem"){var l=o.elem;a=Math.max(a,l.maxFontSize,l.height)}}a+=2;var u=ve(["pstrut"],[]);u.style.height=Se(a);for(var c=[],h=i,m=i,d=i,p=0;p<r.length;p++){var g=r[p];if(g.type==="kern")d+=g.size;else{var x=g.elem,b=g.wrapperClasses||[],v=g.wrapperStyle||{},E=ve(b,[u,x],void 0,v);E.style.top=Se(-a-d-x.depth),g.marginLeft&&(E.style.marginLeft=g.marginLeft),g.marginRight&&(E.style.marginRight=g.marginRight),c.push(E),d+=x.height+x.depth}h=Math.min(h,d),m=Math.max(m,d)}var N=ve(["vlist"],c);N.style.height=Se(m);var k;if(h<0){var S=ve([],[]),_=ve(["vlist"],[S]);_.style.height=Se(-h);var C=ve(["vlist-s"],[new Nn("​")]);k=[ve(["vlist-r"],[N,C]),ve(["vlist-r"],[_])]}else k=[ve(["vlist-r"],[N])];var I=ve(["vlist-t"],k);return k.length===2&&I.classes.push("vlist-t2"),I.height=m,I.depth=-h,I},$2=(e,t)=>{var n=ve(["mspace"],[],t),r=_t(e,t);return n.style.marginRight=Se(r),n},$s=(e,t,n)=>{var r,i;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?i="BoldItalic":t==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},Wc={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},W2={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},G2=function(t,n){var[r,i,a]=W2[t],s=new zr(r),o=new kr([s],{width:Se(i),height:Se(a),style:"width:"+Se(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Hr(["overlay"],[o],n);return l.height=a,l.style.height=Se(a),l.style.width=Se(i),l},It={number:3,unit:"mu"},ri={number:4,unit:"mu"},pr={number:5,unit:"mu"},fT={mord:{mop:It,mbin:ri,mrel:pr,minner:It},mop:{mord:It,mop:It,mrel:pr,minner:It},mbin:{mord:ri,mop:ri,mopen:ri,minner:ri},mrel:{mord:pr,mop:pr,mopen:pr,minner:pr},mopen:{},mclose:{mop:It,mbin:ri,mrel:pr,minner:It},mpunct:{mord:It,mop:It,mrel:pr,mopen:It,mclose:It,mpunct:It,minner:It},minner:{mord:It,mop:It,mbin:ri,mrel:pr,mopen:It,mpunct:It,minner:It}},mT={mord:{mop:It},mop:{mord:It,mop:It},mbin:{},mrel:{},mopen:{},mclose:{mop:It},mpunct:{},minner:{mop:It}},Y2={},Bo={},Fo={};function Le(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:s}=e,o={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)Y2[n[l]]=o;t&&(a&&(Bo[t]=a),s&&(Fo[t]=s))}function Ci(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Le({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var zo=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},zt=function(t){return t.type==="ordgroup"?t.body:[t]},pT=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),gT=new Set(["rightmost","mrel","mclose","mpunct"]),xT={display:Xe.DISPLAY,text:Xe.TEXT,script:Xe.SCRIPT,scriptscript:Xe.SCRIPTSCRIPT},bT={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},$t=function(t,n,r,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s<t.length;s++){var o=gt(t[s],n);if(o instanceof sa){var l=o.children;a.push(...l)}else a.push(o)}if(q2(a),!r)return a;var u=n;if(t.length===1){var c=t[0];c.type==="sizing"?u=n.havingSize(c.size):c.type==="styling"&&(u=n.havingStyle(xT[c.style]))}var h=ve([i[0]||"leftmost"],[],n),m=ve([i[1]||"rightmost"],[],n),d=r==="root";return Gc(a,(p,g)=>{var x=g.classes[0],b=p.classes[0];x==="mbin"&&gT.has(b)?g.classes[0]="mord":b==="mbin"&&pT.has(x)&&(p.classes[0]="mord")},{node:h},m,d),Gc(a,(p,g)=>{var x,b,v=Kc(g),E=Kc(p),N=v&&E?p.hasClass("mtight")?(x=mT[v])==null?void 0:x[E]:(b=fT[v])==null?void 0:b[E]:null;if(N)return $2(N,u)},{node:h},m,d),a},Gc=function(t,n,r,i,a){i&&t.push(i);for(var s=0;s<t.length;s++){var o=t[s],l=K2(o);if(l){Gc(l.children,n,r,null,a);continue}var u=!o.hasClass("mspace");if(u){var c=n(o,r.node);c&&(r.insertAfter?r.insertAfter(c):(t.unshift(c),s++))}u?r.node=o:a&&o.hasClass("newline")&&(r.node=ve(["leftmost"])),r.insertAfter=(h=>m=>{t.splice(h+1,0,m),s++})(s)}i&&t.pop()},K2=function(t){return t instanceof sa||t instanceof ml||t instanceof oa&&t.hasClass("enclosing")?t:null},Yc=function(t,n){var r=K2(t);if(r){var i=r.children;if(i.length){if(n==="right")return Yc(i[i.length-1],"right");if(n==="left")return Yc(i[0],"left")}}return t},Kc=function(t,n){if(!t)return null;n&&(t=Yc(t,n));var r=t.classes[0];return bT[r]||null},ls=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return ve(n.concat(r))},gt=function(t,n,r){if(!t)return ve();if(Bo[t.type]){var i=Bo[t.type](t,n);if(r&&n.size!==r.size){i=ve(n.sizingClasses(r),[i],n);var a=n.sizeMultiplier/r.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Ee("Got group of unknown type: '"+t.type+"'")};function Ws(e,t){var n=ve(["base"],e,t),r=ve(["strut"]);return r.style.height=Se(n.height+n.depth),n.depth&&(r.style.verticalAlign=Se(-n.depth)),n.children.unshift(r),n}function Xc(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=$t(e,t,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var a=[],s=[],o=0;o<r.length;o++)if(s.push(r[o]),r[o].hasClass("mbin")||r[o].hasClass("mrel")||r[o].hasClass("allowbreak")){for(var l=!1;o<r.length-1&&r[o+1].hasClass("mspace")&&!r[o+1].hasClass("newline");)o++,s.push(r[o]),r[o].hasClass("nobreak")&&(l=!0);l||(a.push(Ws(s,t)),s=[])}else r[o].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Ws(s,t)),s=[]),a.push(r[o]));s.length>0&&a.push(Ws(s,t));var u;n?(u=Ws($t(n,t,!0),t),u.classes=["tag"],a.push(u)):i&&a.push(i);var c=ve(["katex-html"],a);if(c.setAttribute("aria-hidden","true"),u){var h=u.children[0];h.style.height=Se(c.height+c.depth),c.depth&&(h.style.verticalAlign=Se(-c.depth))}return c}function X2(e){return new sa(e)}class Te{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Fr(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof Ht&&this.children[r+1]instanceof Ht){for(var i=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof Ht;)i+=this.children[++r].toText();t.appendChild(new Ht(i).toNode())}else t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=sn(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+sn(Fr(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Ht{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return sn(this.toText())}toText(){return this.text}}class Q2{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Se(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Se(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var yT=new Set(["\\imath","\\jmath"]),vT=new Set(["mrow","mtable"]),zn=function(t,n,r){return Ct[n][t]&&Ct[n][t].replace&&t.charCodeAt(0)!==55349&&!(V2.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Ct[n][t].replace),new Ht(t)},wd=function(t){return t.length===1?t[0]:new Te("mrow",t)},wT={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},kd=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,i=wT[n];if(i)return typeof i=="function"?i(e):i;var a=e.text;if(yT.has(a))return null;if(Ct[r][a]){var s=Ct[r][a].replace;s&&(a=s)}var o=Wc[n].fontName;return bd(a,o,r)?Wc[n].variant:null};function Eu(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Ht&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Ht&&n.text===","}else return!1}var In=function(t,n,r){if(t.length===1){var i=kt(t[0],n);return r&&i instanceof Te&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o<t.length;o++){var l=kt(t[o],n);if(l instanceof Te&&s instanceof Te){if(l.type==="mtext"&&s.type==="mtext"&&l.getAttribute("mathvariant")===s.getAttribute("mathvariant")){s.children.push(...l.children);continue}else if(l.type==="mn"&&s.type==="mn"){s.children.push(...l.children);continue}else if(Eu(l)&&s.type==="mn"){s.children.push(...l.children);continue}else if(l.type==="mn"&&Eu(s))l.children=[...s.children,...l.children],a.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(s.type==="mn"||Eu(s))){var u=l.children[0];u instanceof Te&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var c=s.children[0];if(c instanceof Ht&&c.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var h=l.children[0];h instanceof Ht&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Ur=function(t,n,r){return wd(In(t,n,r))},kt=function(t,n){if(!t)return new Te("mrow");if(Fo[t.type])return Fo[t.type](t,n);throw new Ee("Got group of unknown type: '"+t.type+"'")};function am(e,t,n,r,i){var a=In(e,n),s;a.length===1&&a[0]instanceof Te&&vT.has(a[0].type)?s=a[0]:s=new Te("mrow",a);var o=new Te("annotation",[new Ht(t)]);o.setAttribute("encoding","application/x-tex");var l=new Te("semantics",[s,o]),u=new Te("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var c=i?"katex":"katex-mathml";return ve([c],[u])}var kT=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],sm=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],om=function(t,n){return n.size<2?t:kT[t-1][n.size-1]};class br{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||br.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=sm[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new br(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:om(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:sm[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=om(br.BASESIZE,t);return this.size===n&&this.textSize===br.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==br.BASESIZE?["sizing","reset-size"+this.size,"size"+br.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=aT(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}br.BASESIZE=6;var Z2=function(t){return new br({style:t.displayMode?Xe.DISPLAY:Xe.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},J2=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=ve(r,[t])}return t},ET=function(t,n,r){var i=Z2(r),a;if(r.output==="mathml")return am(t,n,i,r.displayMode,!0);if(r.output==="html"){var s=Xc(t,i);a=ve(["katex"],[s])}else{var o=am(t,n,i,r.displayMode,!1),l=Xc(t,i);a=ve(["katex"],[o,l])}return J2(a,r)},TT=function(t,n,r){var i=Z2(r),a=Xc(t,i),s=ve(["katex"],[a]);return J2(s,r)},ST={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},xl=function(t){var n=new Te("mo",[new Ht(ST[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},AT={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},CT=new Set(["widehat","widecheck","widetilde","utilde"]),bl=function(t,n){function r(){var o=4e5,l=t.label.slice(1);if(CT.has(l)&&"base"in t){var u=t.base.type==="ordgroup"?t.base.body.length:1,c,h,m;if(u>5)l==="widehat"||l==="widecheck"?(c=420,o=2364,m=.42,h=l+"4"):(c=312,o=2340,m=.34,h="tilde4");else{var d=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][d],c=[0,239,300,360,420][d],m=[0,.24,.3,.3,.36,.42][d],h=l+d):(o=[0,600,1033,2339,2340][d],c=[0,260,286,306,312][d],m=[0,.26,.286,.3,.306,.34][d],h="tilde"+d)}var p=new zr(h),g=new kr([p],{width:"100%",height:Se(m),viewBox:"0 0 "+o+" "+c,preserveAspectRatio:"none"});return{span:Hr([],[g],n),minWidth:0,height:m}}else{var x=[],b=AT[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[v,E,N]=b,k=N/1e3,S=v.length,_,C;if(S===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');_=["hide-tail"],C=[b[3]]}else if(S===2)_=["halfarrow-left","halfarrow-right"],C=["xMinYMin","xMaxYMin"];else if(S===3)_=["brace-left","brace-center","brace-right"],C=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
762
+ `+S+" children.");for(var I=0;I<S;I++){var A=new zr(v[I]),R=new kr([A],{width:"400em",height:Se(k),viewBox:"0 0 "+o+" "+N,preserveAspectRatio:C[I]+" slice"}),L=Hr([_[I]],[R],n);if(S===1)return{span:L,minWidth:E,height:k};L.style.height=Se(k),x.push(L)}return{span:ve(["stretchy"],x,n),minWidth:E,height:k}}}var{span:i,minWidth:a,height:s}=r();return i.height=s,i.style.height=Se(s),a>0&&(i.style.minWidth=Se(a)),i},NT=function(t,n,r,i,a){var s,o=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){if(s=ve(["stretchy",n],[],a),n==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(n)&&u.push(new zc({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&u.push(new zc({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new kr(u,{width:"100%",height:Se(o)});s=Hr([],[c],a)}return s.height=o,s.style.height=Se(o),s},MT={bin:1,close:1,inner:1,open:1,punct:1,rel:1},IT={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function _T(e){return e in MT}function et(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function yl(e){var t=vl(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function vl(e){return e&&(e.type==="atom"||IT.hasOwnProperty(e.type))?e:null}var ex=e=>{if(e instanceof Nn)return e;if(rT(e)&&e.children.length===1)return ex(e.children[0])},Ed=(e,t)=>{var n,r,i;e&&e.type==="supsub"?(r=et(e.base,"accent"),n=r.base,e.base=n,i=nT(gt(e,t)),e.base=r):(r=et(e,"accent"),n=r.base);var a=gt(n,t.havingCrampedStyle()),s=r.isShifty&&Tr(n),o=0;if(s){var l,u;o=(l=(u=ex(a))==null?void 0:u.skew)!=null?l:0}var c=r.label==="\\c",h=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),m;if(r.isStretchy)m=bl(r,t),m=pt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Se(2*o)+")",marginLeft:Se(2*o)}:void 0}]});else{var d,p;r.label==="\\vec"?(d=G2("vec",t),p=W2.vec[1]):(d=gl({mode:r.mode,text:r.label},t,"textord"),d=tT(d),d.italic=0,p=d.width,c&&(h+=d.depth)),m=ve(["accent-body"],[d]);var g=r.label==="\\textcircled";g&&(m.classes.push("accent-full"),h=a.height);var x=o;g||(x-=p/2),m.style.left=Se(x),r.label==="\\textcircled"&&(m.style.top=".2em"),m=pt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:m}]})}var b=ve(["mord","accent"],[m],t);return i?(i.children[0]=b,i.height=Math.max(b.height,i.height),i.classes[0]="mord",i):b},tx=(e,t)=>{var n=e.isStretchy?xl(e.label):new Te("mo",[zn(e.label,e.mode)]),r=new Te("mover",[kt(e.base,t),n]);return r.setAttribute("accent","true"),r},RT=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Le({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=zo(t[0]),r=!RT.test(e.funcName),i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Ed,mathmlBuilder:tx});Le({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Ed,mathmlBuilder:tx});Le({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=gt(e.base,t),r=bl(e,t),i=e.label==="\\utilde"?.12:0,a=pt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return ve(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var n=xl(e.label),r=new Te("munder",[kt(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Gs=e=>{var t=new Te("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Le({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=Ji(gt(e.body,r,t),t),a=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;e.below&&(r=t.havingStyle(n.sub()),s=Ji(gt(e.below,r,t),t),s.classes.push(a+"-arrow-pad"));var o=bl(e,t),l=-t.fontMetrics().axisHeight+.5*o.height,u=-t.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||e.label==="\\xleftequilibrium")&&(u-=i.depth);var c;if(s){var h=-t.fontMetrics().axisHeight+s.height+.5*o.height+.111;c=pt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:h}]})}else c=pt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return ve(["mrel","x-arrow"],[c],t)},mathmlBuilder(e,t){var n=xl(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=Gs(kt(e.body,t));if(e.below){var a=Gs(kt(e.below,t));r=new Te("munderover",[n,a,i])}else r=new Te("mover",[n,i])}else if(e.below){var s=Gs(kt(e.below,t));r=new Te("munder",[n,s])}else r=Gs(),r=new Te("mover",[n,r]);return r}});function nx(e,t){var n=$t(e.body,t,!0);return ve([e.mclass],n,t)}function rx(e,t){var n,r=In(e.body,t);return e.mclass==="minner"?n=new Te("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new Te("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new Te("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Le({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:zt(i),isCharacterBox:Tr(i)}},htmlBuilder:nx,mathmlBuilder:rx});var wl=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Le({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:wl(t[0]),body:zt(t[1]),isCharacterBox:Tr(t[1])}}});Le({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],s;r!=="\\stackrel"?s=wl(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:zt(i)},l={type:"supsub",mode:a.mode,base:o,sup:r==="\\underset"?null:a,sub:r==="\\underset"?a:null};return{type:"mclass",mode:n.mode,mclass:s,body:[l],isCharacterBox:Tr(l)}},htmlBuilder:nx,mathmlBuilder:rx});Le({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:wl(t[0]),body:zt(t[0])}},htmlBuilder(e,t){var n=$t(e.body,t,!0),r=ve([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=In(e.body,t),r=new Te("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var LT={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},lm=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),um=e=>e.type==="textord"&&e.text==="@",DT=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function PT(e,t,n){var r=LT[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]),a={type:"atom",text:r,mode:"math",family:"rel"},s=n.callFunction("\\Big",[a],[]),o=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function OT(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Ee("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var s=t[a],o=lm(),l=0;l<s.length;l++)if(!um(s[l]))o.body.push(s[l]);else{r.push(o),l+=1;var u=yl(s[l]).text,c=new Array(2);if(c[0]={type:"ordgroup",mode:"math",body:[]},c[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(u))if("<>AV".includes(u))for(var h=0;h<2;h++){for(var m=!0,d=l+1;d<s.length;d++){if(DT(s[d],u)){m=!1,l=d;break}if(um(s[d]))throw new Ee("Missing a "+u+" character to complete a CD arrow.",s[d]);c[h].body.push(s[d])}if(m)throw new Ee("Missing a "+u+" character to complete a CD arrow.",s[l])}else throw new Ee('Expected one of "<>AV=|." after @',s[l]);var p=PT(u,c,e),g={type:"styling",body:[p],mode:"math",style:"display",resetFont:!0};r.push(g),o=lm()}a%2===0?r.push(o):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Le({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Ji(gt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Se(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Te("mrow",[kt(e.label,t)]);return n=new Te("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Te("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Le({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Ji(gt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Te("mrow",[kt(e.fragment,t)])}});Le({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=et(t[0],"ordgroup"),i=r.body,a="",s=0;s<i.length;s++){var o=et(i[s],"textord");a+=o.text}var l=parseInt(a),u;if(isNaN(l))throw new Ee("\\@char has non-numeric argument "+a);if(l<0||l>=1114111)throw new Ee("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:u}}});var ix=(e,t)=>{var n=$t(e.body,t.withColor(e.color),!1);return Ar(n)},ax=(e,t)=>{var n=In(e.body,t.withColor(e.color)),r=new Te("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Le({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=et(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:zt(i)}},htmlBuilder:ix,mathmlBuilder:ax});Le({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=et(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var a=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:a}},htmlBuilder:ix,mathmlBuilder:ax});Le({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:a,size:i&&et(i,"size").value}},htmlBuilder(e,t){var n=ve(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Se(_t(e.size,t)))),n},mathmlBuilder(e,t){var n=new Te("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Se(_t(e.size,t)))),n}});var Qc={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},sx=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ee("Expected a control sequence",e);return t},jT=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},ox=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Le({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Qc[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Qc[r.text]),et(t.parseFunction(),"internal");throw new Ee("Invalid token after macro prefix",r)}});Le({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Ee("Expected a control sequence",r);for(var a=0,s,o=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){s=t.gullet.future(),o[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ee('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Ee('Argument number "'+r.text+'" out of order');a++,o.push([])}else{if(r.text==="EOF")throw new Ee("Expected a macro definition");o[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},n===Qc[n]),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=sx(t.gullet.popToken());t.gullet.consumeSpaces();var i=jT(t);return ox(t,r,i,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=sx(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return ox(t,r,a,n==="\\\\globalfuture"),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var Pa=function(t,n,r){var i=Ct.math[t]&&Ct.math[t].replace,a=bd(i||t,n,r);if(!a)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return a},Td=function(t,n,r,i){var a=r.havingBaseStyle(n),s=ve(i.concat(a.sizingClasses(r)),[t],r),o=a.sizeMultiplier/r.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},lx=function(t,n,r){var i=n.havingBaseStyle(r),a=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Se(a),t.height-=a,t.depth+=a},BT=function(t,n,r,i,a,s){var o=dn(t,"Main-Regular",a,i),l=Td(o,n,i,s);return lx(l,i,n),l},FT=function(t,n,r,i){return dn(t,"Size"+n+"-Regular",r,i)},ux=function(t,n,r,i,a,s){var o=FT(t,n,a,i),l=Td(ve(["delimsizing","size"+n],[o],i),Xe.TEXT,i,s);return r&&lx(l,i,Xe.TEXT),l},Tu=function(t,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=ve(["delimsizinginner",i],[ve([],[dn(t,n,r)])]);return{type:"elem",elem:a}},Su=function(t,n,r){var i=ar["Size4-Regular"][t.charCodeAt(0)]?ar["Size4-Regular"][t.charCodeAt(0)][4]:ar["Size1-Regular"][t.charCodeAt(0)][4],a=new zr("inner",YE(t,Math.round(1e3*n))),s=new kr([a],{width:Se(i),height:Se(n),style:"width:"+Se(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),o=Hr([],[s],r);return o.height=n,o.style.height=Se(n),o.style.width=Se(i),{type:"elem",elem:o}},Zc=.008,Ys={type:"kern",size:-1*Zc},zT=new Set(["|","\\lvert","\\rvert","\\vert"]),HT=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),cx=function(t,n,r,i,a,s){var o,l,u,c,h="",m=0;o=u=c=t,l=null;var d="Size1-Regular";t==="\\uparrow"?u=c="⏐":t==="\\Uparrow"?u=c="‖":t==="\\downarrow"?o=u="⏐":t==="\\Downarrow"?o=u="‖":t==="\\updownarrow"?(o="\\uparrow",u="⏐",c="\\downarrow"):t==="\\Updownarrow"?(o="\\Uparrow",u="‖",c="\\Downarrow"):zT.has(t)?(u="∣",h="vert",m=333):HT.has(t)?(u="∥",h="doublevert",m=556):t==="["||t==="\\lbrack"?(o="⎡",u="⎢",c="⎣",d="Size4-Regular",h="lbrack",m=667):t==="]"||t==="\\rbrack"?(o="⎤",u="⎥",c="⎦",d="Size4-Regular",h="rbrack",m=667):t==="\\lfloor"||t==="⌊"?(u=o="⎢",c="⎣",d="Size4-Regular",h="lfloor",m=667):t==="\\lceil"||t==="⌈"?(o="⎡",u=c="⎢",d="Size4-Regular",h="lceil",m=667):t==="\\rfloor"||t==="⌋"?(u=o="⎥",c="⎦",d="Size4-Regular",h="rfloor",m=667):t==="\\rceil"||t==="⌉"?(o="⎤",u=c="⎥",d="Size4-Regular",h="rceil",m=667):t==="("||t==="\\lparen"?(o="⎛",u="⎜",c="⎝",d="Size4-Regular",h="lparen",m=875):t===")"||t==="\\rparen"?(o="⎞",u="⎟",c="⎠",d="Size4-Regular",h="rparen",m=875):t==="\\{"||t==="\\lbrace"?(o="⎧",l="⎨",c="⎩",u="⎪",d="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(o="⎫",l="⎬",c="⎭",u="⎪",d="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(o="⎧",c="⎩",u="⎪",d="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(o="⎫",c="⎭",u="⎪",d="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(o="⎧",c="⎭",u="⎪",d="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(o="⎫",c="⎩",u="⎪",d="Size4-Regular");var p=Pa(o,d,a),g=p.height+p.depth,x=Pa(u,d,a),b=x.height+x.depth,v=Pa(c,d,a),E=v.height+v.depth,N=0,k=1;if(l!==null){var S=Pa(l,d,a);N=S.height+S.depth,k=2}var _=g+E+N,C=Math.max(0,Math.ceil((n-_)/(k*b))),I=_+C*k*b,A=i.fontMetrics().axisHeight;r&&(A*=i.sizeMultiplier);var R=I/2-A,L=[];if(h.length>0){var z=I-g-E,j=Math.round(I*1e3),B=KE(h,Math.round(z*1e3)),H=new zr(h,B),Y=Se(m/1e3),V=Se(j/1e3),Z=new kr([H],{width:Y,height:V,viewBox:"0 0 "+m+" "+j}),O=Hr([],[Z],i);O.height=j/1e3,O.style.width=Y,O.style.height=V,L.push({type:"elem",elem:O})}else{if(L.push(Tu(c,d,a)),L.push(Ys),l===null){var X=I-g-E+2*Zc;L.push(Su(u,X,i))}else{var ne=(I-g-E-N)/2+2*Zc;L.push(Su(u,ne,i)),L.push(Ys),L.push(Tu(l,d,a)),L.push(Ys),L.push(Su(u,ne,i))}L.push(Ys),L.push(Tu(o,d,a))}var P=i.havingBaseStyle(Xe.TEXT),te=pt({positionType:"bottom",positionData:R,children:L});return Td(ve(["delimsizing","mult"],[te],P),Xe.TEXT,i,s)},Au=80,Cu=.08,Nu=function(t,n,r,i,a){var s=GE(t,i,r),o=new zr(t,s),l=new kr([o],{width:"400em",height:Se(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Hr(["hide-tail"],[l],a)},UT=function(t,n){var r=n.havingBaseSizing(),i=px("\\surd",t*r.sizeMultiplier,mx,r),a=r.sizeMultiplier,s=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),o,l,u,c,h;return i.type==="small"?(c=1e3+1e3*s+Au,t<1?a=1:t<1.4&&(a=.7),l=(1+s+Cu)/a,u=(1+s)/a,o=Nu("sqrtMain",l,c,s,n),o.style.minWidth="0.853em",h=.833/a):i.type==="large"?(c=(1e3+Au)*qa[i.size],u=(qa[i.size]+s)/a,l=(qa[i.size]+s+Cu)/a,o=Nu("sqrtSize"+i.size,l,c,s,n),o.style.minWidth="1.02em",h=1/a):(l=t+s+Cu,u=t+s,c=Math.floor(1e3*t+s)+Au,o=Nu("sqrtTall",l,c,s,n),o.style.minWidth="0.742em",h=1.056),o.height=u,o.style.height=Se(l),{span:o,advanceWidth:h,ruleWidth:(n.fontMetrics().sqrtRuleThickness+s)*a}},dx=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),VT=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),hx=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),qa=[0,1.2,1.8,2.4,3],fx=function(t,n,r,i,a){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),dx.has(t)||hx.has(t))return ux(t,n,!1,r,i,a);if(VT.has(t))return cx(t,qa[n],!1,r,i,a);throw new Ee("Illegal delimiter: '"+t+"'")},qT=[{type:"small",style:Xe.SCRIPTSCRIPT},{type:"small",style:Xe.SCRIPT},{type:"small",style:Xe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],$T=[{type:"small",style:Xe.SCRIPTSCRIPT},{type:"small",style:Xe.SCRIPT},{type:"small",style:Xe.TEXT},{type:"stack"}],mx=[{type:"small",style:Xe.SCRIPTSCRIPT},{type:"small",style:Xe.SCRIPT},{type:"small",style:Xe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],WT=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},px=function(t,n,r,i){for(var a=Math.min(2,3-i.style.size),s=a;s<r.length;s++){var o=r[s];if(o.type==="stack")break;var l=Pa(t,WT(o),"math"),u=l.height+l.depth;if(o.type==="small"){var c=i.havingBaseStyle(o.style);u*=c.sizeMultiplier}if(u>n)return o}return r[r.length-1]},Jc=function(t,n,r,i,a,s){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var o;hx.has(t)?o=qT:dx.has(t)?o=mx:o=$T;var l=px(t,n,o,i);return l.type==="small"?BT(t,l.style,r,i,a,s):l.type==="large"?ux(t,l.size,r,i,a,s):cx(t,n,r,i,a,s)},Mu=function(t,n,r,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,c=Math.max(n-o,r+o),h=Math.max(c/500*l,2*c-u);return Jc(t,h,!0,i,a,s)},cm={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},GT=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function dm(e){return"isMiddle"in e}function kl(e,t){var n=vl(e);if(n&&GT.has(n.text))return n;throw n?new Ee("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Ee("Invalid delimiter type '"+e.type+"'",e)}Le({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=kl(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:cm[e.funcName].size,mclass:cm[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?ve([e.mclass]):fx(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(zn(e.delim,e.mode));var n=new Te("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Se(qa[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function hm(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Le({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Ee("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:kl(t[0],e).text,color:n}}});Le({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=kl(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var a=et(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{hm(e);for(var n=$t(e.body,t,!0,["mopen","mclose"]),r=0,i=0,a=!1,s=0;s<n.length;s++){var o=n[s];dm(o)?a=!0:(r=Math.max(n[s].height,r),i=Math.max(n[s].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var l;if(e.left==="."?l=ls(t,["mopen"]):l=Mu(e.left,r,i,t,e.mode,["mopen"]),n.unshift(l),a)for(var u=1;u<n.length;u++){var c=n[u];if(dm(c)){var h=c.isMiddle;n[u]=Mu(h.delim,r,i,h.options,e.mode,[])}}var m;if(e.right===".")m=ls(t,["mclose"]);else{var d=e.rightColor?t.withColor(e.rightColor):t;m=Mu(e.right,r,i,d,e.mode,["mclose"])}return n.push(m),ve(["minner"],n,t)},mathmlBuilder:(e,t)=>{hm(e);var n=In(e.body,t);if(e.left!=="."){var r=new Te("mo",[zn(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var i=new Te("mo",[zn(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return wd(n)}});Le({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=kl(t[0],e);if(!e.parser.leftrightDepth)throw new Ee("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=ls(t,[]):(n=fx(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?zn("|","text"):zn(e.delim,e.mode),r=new Te("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var El=(e,t)=>{var n=Ji(gt(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,s,o=Tr(e.body);if(r==="sout")a=ve(["stretchy","sout"]),a.height=t.fontMetrics().defaultRuleThickness/i,s=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=_t({number:.6,unit:"pt"},t),u=_t({number:.35,unit:"ex"},t),c=t.havingBaseSizing();i=i/c.sizeMultiplier;var h=n.height+n.depth+l+u;n.style.paddingLeft=Se(h/2+l);var m=Math.floor(1e3*h*i),d=$E(m),p=new kr([new zr("phase",d)],{width:"400em",height:Se(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});a=Hr(["hide-tail"],[p],t),a.style.height=Se(h),s=n.depth+l+u}else{/cancel/.test(r)?o||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var g,x,b=0;/box/.test(r)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=t.fontMetrics().fboxsep+(r==="colorbox"?0:b),x=g):r==="angl"?(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),g=4*b,x=Math.max(0,.25-n.depth)):(g=o?.2:0,x=g),a=NT(n,r,g,x,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle="solid",a.style.borderWidth=Se(b)):r==="angl"&&b!==.049&&(a.style.borderTopWidth=Se(b),a.style.borderRightWidth=Se(b)),s=n.depth+x,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var v;if(e.backgroundColor)v=pt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:n,shift:0}]});else{var E=/cancel|phase/.test(r)?["svg-align"]:[];v=pt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:E}]})}return/cancel/.test(r)&&(v.height=n.height,v.depth=n.depth),/cancel/.test(r)&&!o?ve(["mord","cancel-lap"],[v],t):ve(["mord"],[v],t)},Tl=(e,t)=>{var n,r=new Te(e.label.includes("colorbox")?"mpadded":"menclose",[kt(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+Se(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Le({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=et(t[0],"color-token").color,s=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:El,mathmlBuilder:Tl});Le({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e,a=et(t[0],"color-token").color,s=et(t[1],"color-token").color,o=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:El,mathmlBuilder:Tl});Le({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Le({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:El,mathmlBuilder:Tl});Le({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:El,mathmlBuilder:Tl});Le({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var gx={};function dr(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:s}=e,o={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)gx[n[l]]=o;a&&(Bo[t]=a),s&&(Fo[t]=s)}var xx={};function F(e,t){xx[e]=t}class yn{constructor(t,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=r}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new yn(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class An{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new An(n,yn.range(this,t))}}function fm(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Sl=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Ee("{"+e.envName+"} can be used only in display mode.")},YT=new Set(["gather","gather*"]);function Sd(e){if(!e.includes("ed"))return!e.includes("*")}function Gr(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:c,maxNumCols:h,leqno:m}=t;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!s){var d=e.gullet.expandMacroAsText("\\arraystretch");if(d==null)s=1;else if(s=parseFloat(d),!s||s<0)throw new Ee("Invalid \\arraystretch: "+d)}e.gullet.beginGroup();var p=[],g=[p],x=[],b=[],v=l!=null?[]:void 0;function E(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function N(){v&&(e.gullet.macros.get("\\df@tag")?(v.push(e.subparse([new An("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):v.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(E(),b.push(fm(e));;){var k=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var S={type:"ordgroup",mode:e.mode,body:k};n&&(S={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[S]}),p.push(S);var _=e.fetch().text;if(_==="&"){if(h&&p.length===h){if(u||o)throw new Ee("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(_==="\\end"){N(),p.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(g.length>1||!c)&&g.pop(),b.length<g.length+1&&b.push([]);break}else if(_==="\\\\"){e.consume();var C=void 0;e.gullet.future().text!==" "&&(C=e.parseSizeGroup(!0)),x.push(C?C.value:null),N(),b.push(fm(e)),p=[],g.push(p),E()}else throw new Ee("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:s,body:g,cols:a,rowGaps:x,hskipBeforeAndAfter:r,hLinesBeforeRow:b,colSeparationType:o,tags:v,leqno:m}}function Ad(e){return e.slice(0,1)==="d"?"display":"text"}var hr=function(t,n){var r,i,a=t.body.length,s=t.hLinesBeforeRow,o=0,l=new Array(a),u=[],c=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),h=1/n.fontMetrics().ptPerEm,m=5*h;if(t.colSeparationType&&t.colSeparationType==="small"){var d=n.havingStyle(Xe.SCRIPT).sizeMultiplier;m=.2778*(d/n.sizeMultiplier)}var p=t.colSeparationType==="CD"?_t({number:3,unit:"ex"},n):12*h,g=3*h,x=t.arraystretch*p,b=.7*x,v=.3*x,E=0;function N(_e){for(var Ae=0;Ae<_e.length;++Ae)Ae>0&&(E+=.25),u.push({pos:E,isDashed:_e[Ae]})}for(N(s[0]),r=0;r<t.body.length;++r){var k=t.body[r],S=b,_=v;o<k.length&&(o=k.length);var C={cells:new Array(k.length),height:0,depth:0,pos:0};for(i=0;i<k.length;++i){var I=gt(k[i],n);_<I.depth&&(_=I.depth),S<I.height&&(S=I.height),C.cells[i]=I}var A=t.rowGaps[r],R=0;A&&(R=_t(A,n),R>0&&(R+=v,_<R&&(_=R),R=0)),t.addJot&&r<t.body.length-1&&(_+=g),C.height=S,C.depth=_,E+=S,C.pos=E,E+=_+R,l[r]=C,N(s[r+1])}var L=E/2+n.fontMetrics().axisHeight,z=t.cols||[],j=[],B,H,Y=[];if(t.tags&&t.tags.some(_e=>_e))for(r=0;r<a;++r){var V=l[r],Z=V.pos-L,O=t.tags[r],X=void 0;O===!0?X=ve(["eqn-num"],[],n):O===!1?X=ve([],[],n):X=ve([],$t(O,n,!0),n),X.depth=V.depth,X.height=V.height,Y.push({type:"elem",elem:X,shift:Z})}for(i=0,H=0;i<o||H<z.length;++i,++H){for(var ne,P=z[H],te=!0;((Q=P)==null?void 0:Q.type)==="separator";){var Q;if(te||(B=ve(["arraycolsep"],[]),B.style.width=Se(n.fontMetrics().doubleRuleSep),j.push(B)),P.separator==="|"||P.separator===":"){var K=P.separator==="|"?"solid":"dashed",ce=ve(["vertical-separator"],[],n);ce.style.height=Se(E),ce.style.borderRightWidth=Se(c),ce.style.borderRightStyle=K,ce.style.margin="0 "+Se(-c/2);var le=E-L;le&&(ce.style.verticalAlign=Se(-le)),j.push(ce)}else throw new Ee("Invalid separator type: "+P.separator);H++,P=z[H],te=!1}if(!(i>=o)){var ee=void 0;if(i>0||t.hskipBeforeAndAfter){var Ce,de;ee=(Ce=(de=P)==null?void 0:de.pregap)!=null?Ce:m,ee!==0&&(B=ve(["arraycolsep"],[]),B.style.width=Se(ee),j.push(B))}var he=[];for(r=0;r<a;++r){var pe=l[r],Ne=pe.cells[i];if(Ne){var Oe=pe.pos-L;Ne.depth=pe.depth,Ne.height=pe.height,he.push({type:"elem",elem:Ne,shift:Oe})}}var ot=pt({positionType:"individualShift",children:he}),Be=ve(["col-align-"+(((ne=P)==null?void 0:ne.align)||"c")],[ot]);if(j.push(Be),i<o-1||t.hskipBeforeAndAfter){var ct,me;ee=(ct=(me=P)==null?void 0:me.postgap)!=null?ct:m,ee!==0&&(B=ve(["arraycolsep"],[]),B.style.width=Se(ee),j.push(B))}}}var Ue=ve(["mtable"],j);if(u.length>0){for(var dt=Zi("hline",n,c),nt=Zi("hdashline",n,c),mt=[{type:"elem",elem:Ue,shift:0}];u.length>0;){var Qe=u.pop(),Pe=Qe.pos-L;Qe.isDashed?mt.push({type:"elem",elem:nt,shift:Pe}):mt.push({type:"elem",elem:dt,shift:Pe})}Ue=pt({positionType:"individualShift",children:mt})}if(Y.length===0)return ve(["mord"],[Ue],n);var oe=pt({positionType:"individualShift",children:Y}),ge=ve(["tag"],[oe],n);return Ar([Ue,ge])},KT={c:"center ",l:"left ",r:"right "},fr=function(t,n){for(var r=[],i=new Te("mtd",[],["mtr-glue"]),a=new Te("mtd",[],["mml-eqn-num"]),s=0;s<t.body.length;s++){for(var o=t.body[s],l=[],u=0;u<o.length;u++)l.push(new Te("mtd",[kt(o[u],n)]));t.tags&&t.tags[s]&&(l.unshift(i),l.push(i),t.leqno?l.unshift(a):l.push(a)),r.push(new Te("mtr",l))}var c=new Te("mtable",r),h=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);c.setAttribute("rowspacing",Se(h));var m="",d="";if(t.cols&&t.cols.length>0){var p=t.cols,g="",x=!1,b=0,v=p.length;p[0].type==="separator"&&(m+="top ",b=1),p[p.length-1].type==="separator"&&(m+="bottom ",v-=1);for(var E=b;E<v;E++){var N=p[E];N.type==="align"?(d+=KT[N.align],x&&(g+="none "),x=!0):N.type==="separator"&&x&&(g+=N.separator==="|"?"solid ":"dashed ",x=!1)}c.setAttribute("columnalign",d.trim()),/[sd]/.test(g)&&c.setAttribute("columnlines",g.trim())}if(t.colSeparationType==="align"){for(var k=t.cols||[],S="",_=1;_<k.length;_++)S+=_%2?"0em ":"1em ";c.setAttribute("columnspacing",S.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?c.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?c.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var C="",I=t.hLinesBeforeRow;m+=I[0].length>0?"left ":"",m+=I[I.length-1].length>0?"right ":"";for(var A=1;A<I.length-1;A++)C+=I[A].length===0?"none ":I[A][0]?"dashed ":"solid ";return/[sd]/.test(C)&&c.setAttribute("rowlines",C.trim()),m!==""&&(c=new Te("menclose",[c]),c.setAttribute("notation",m.trim())),t.arraystretch&&t.arraystretch<1&&(c=new Te("mstyle",[c]),c.setAttribute("scriptlevel","1")),c},bx=function(t,n){t.envName.includes("ed")||Sl(t);var r=[],i=t.envName.includes("at")?"alignat":"align",a=t.envName==="split",s=Gr(t.parser,{cols:r,addJot:!0,autoTag:a?void 0:Sd(t.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:t.parser.settings.leqno},"display"),o=0,l=0,u={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var c="",h=0;h<n[0].body.length;h++){var m=et(n[0].body[h],"textord");c+=m.text}o=Number(c),l=o*2}var d=!l;s.body.forEach(function(b){for(var v=1;v<b.length;v+=2){var E=et(b[v],"styling"),N=et(E.body[0],"ordgroup");N.body.unshift(u)}if(d)l<b.length&&(l=b.length);else{var k=b.length/2;if(o<k)throw new Ee("Too many math in a row: "+("expected "+o+", but got "+k),b[0])}});for(var p=0;p<l;++p){var g="r",x=0;p%2===1?g="l":p>0&&d&&(x=1),r[p]={type:"align",align:g,pregap:x,postgap:0}}return s.colSeparationType=d?"align":"alignat",s};dr({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=vl(t[0]),r=n?[t[0]]:et(t[0],"ordgroup").body,i=r.map(function(s){var o=yl(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Ee("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Gr(e.parser,a,Ad(e.envName))},htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new Ee("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var a=Gr(e.parser,r,Ad(e.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Gr(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=vl(t[0]),r=n?[t[0]]:et(t[0],"ordgroup").body,i=r.map(function(o){var l=yl(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ee("Unknown column alignment: "+u,o)});if(i.length>1)throw new Ee("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=Gr(e.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Ee("{subarray} can contain only one column");return s},htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Gr(e.parser,t,Ad(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:bx,htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){YT.has(e.envName)&&Sl(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Sd(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Gr(e.parser,t,"display")},htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:bx,htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Sl(e);var t={autoTag:Sd(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Gr(e.parser,t,"display")},htmlBuilder:hr,mathmlBuilder:fr});dr({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Sl(e),OT(e.parser)},htmlBuilder:hr,mathmlBuilder:fr});F("\\nonumber","\\gdef\\@eqnsw{0}");F("\\notag","\\nonumber");Le({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Ee(e.funcName+" valid only within array environment")}});var mm=gx;Le({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!=="ordgroup")throw new Ee("Invalid environment name",i);for(var a="",s=0;s<i.body.length;++s)a+=et(i.body[s],"textord").text;if(r==="\\begin"){if(!mm.hasOwnProperty(a))throw new Ee("No such environment: "+a,i);var o=mm[a],{args:l,optArgs:u}=n.parseArguments("\\begin{"+a+"}",o),c={mode:n.mode,envName:a,parser:n},h=o.handler(c,l,u);n.expect("\\end",!1);var m=n.nextToken,d=et(n.parseFunction(),"environment");if(d.name!==a)throw new Ee("Mismatch: \\begin{"+a+"} matched by \\end{"+d.name+"}",m);return h}return{type:"environment",mode:n.mode,name:a,nameGroup:i}}});var yx=(e,t)=>{var n=e.font,r=t.withFont(n);return gt(e.body,r)},vx=(e,t)=>{var n=e.font,r=t.withFont(n);return kt(e.body,r)},pm={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Le({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=zo(t[0]),a=r;return a in pm&&(a=pm[a]),{type:"font",mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:yx,mathmlBuilder:vx});Le({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:wl(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Tr(r)}}});Le({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,s=n.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:s}}},htmlBuilder:yx,mathmlBuilder:vx});var XT=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a;a=t.havingStyle(r);var s=gt(e.numer,a,t);if(e.continued){var o=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}a=t.havingStyle(i);var u=gt(e.denom,a,t),c,h,m;e.hasBarLine?(e.barSize?(h=_t(e.barSize,t),c=Zi("frac-line",t,h)):c=Zi("frac-line",t),h=c.height,m=c.height):(c=null,h=0,m=t.fontMetrics().defaultRuleThickness);var d,p,g;n.size===Xe.DISPLAY.size?(d=t.fontMetrics().num1,h>0?p=3*m:p=7*m,g=t.fontMetrics().denom1):(h>0?(d=t.fontMetrics().num2,p=m):(d=t.fontMetrics().num3,p=3*m),g=t.fontMetrics().denom2);var x;if(c){var v=t.fontMetrics().axisHeight;d-s.depth-(v+.5*h)<p&&(d+=p-(d-s.depth-(v+.5*h))),v-.5*h-(u.height-g)<p&&(g+=p-(v-.5*h-(u.height-g)));var E=-(v-.5*h);x=pt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:c,shift:E},{type:"elem",elem:s,shift:-d}]})}else{var b=d-s.depth-(u.height-g);b<p&&(d+=.5*(p-b),g+=.5*(p-b)),x=pt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:s,shift:-d}]})}a=t.havingStyle(n),x.height*=a.sizeMultiplier/t.sizeMultiplier,x.depth*=a.sizeMultiplier/t.sizeMultiplier;var N;n.size===Xe.DISPLAY.size?N=t.fontMetrics().delim1:n.size===Xe.SCRIPTSCRIPT.size?N=t.havingStyle(Xe.SCRIPT).fontMetrics().delim2:N=t.fontMetrics().delim2;var k,S;return e.leftDelim==null?k=ls(t,["mopen"]):k=Jc(e.leftDelim,N,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?S=ve([]):e.rightDelim==null?S=ls(t,["mclose"]):S=Jc(e.rightDelim,N,!0,t.havingStyle(n),e.mode,["mclose"]),ve(["mord"].concat(a.sizingClasses(t)),[k,ve(["mfrac"],[x]),S],t)},QT=(e,t)=>{var n=new Te("mfrac",[kt(e.numer,t),kt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=_t(e.barSize,t);n.setAttribute("linethickness",Se(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Te("mo",[new Ht(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(n),e.rightDelim!=null){var s=new Te("mo",[new Ht(e.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return wd(i)}return n},wx=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Le({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],s,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",c=null;return u||r.startsWith("\\d")?c="display":r.startsWith("\\t")&&(c="text"),wx({type:"genfrac",mode:n.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},c)},htmlBuilder:XT,mathmlBuilder:QT});Le({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});var gm=["display","text","script","scriptscript"],xm=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Le({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=zo(t[0]),s=a.type==="atom"&&a.family==="open"?xm(a.text):null,o=zo(t[1]),l=o.type==="atom"&&o.family==="close"?xm(o.text):null,u=et(t[2],"size"),c,h=null;u.isBlank?c=!0:(h=u.value,c=h.number>0);var m=null,d=t[3];if(d.type==="ordgroup"){if(d.body.length>0){var p=et(d.body[0],"textord");m=gm[Number(p.text)]}}else d=et(d,"textord"),m=gm[Number(d.text)];return wx({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:c,barSize:h,leftDelim:s,rightDelim:l},m)}});Le({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:et(t[0],"size").value,token:i}}});Le({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=et(t[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=t[2],o=a.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var kx=(e,t)=>{var n=t.style,r,i;e.type==="supsub"?(r=e.sup?gt(e.sup,t.havingStyle(n.sup()),t):gt(e.sub,t.havingStyle(n.sub()),t),i=et(e.base,"horizBrace")):i=et(e,"horizBrace");var a=gt(i.base,t.havingBaseStyle(Xe.DISPLAY)),s=bl(i,t),o;if(i.isOver?o=pt({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=pt({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),r){var l=ve(["minner",i.isOver?"mover":"munder"],[o],t);i.isOver?o=pt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=pt({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return ve(["minner",i.isOver?"mover":"munder"],[o],t)},ZT=(e,t)=>{var n=xl(e.label);return new Te(e.isOver?"mover":"munder",[kt(e.base,t),n])};Le({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:kx,mathmlBuilder:ZT});Le({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=et(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:zt(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=$t(e.body,t,!1);return dT(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Ur(e.body,t);return n instanceof Te||(n=new Te("mrow",[n])),n.setAttribute("href",e.href),n}});Le({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=et(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],a=0;a<r.length;a++){var s=r[a];s==="~"&&(s="\\textasciitilde"),i.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:zt(o)}}});Le({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:zt(t[0])}},htmlBuilder(e,t){var n=$t(e.body,t.withFont(""),!1);return Ar(n)},mathmlBuilder(e,t){return new Te("mrow",In(e.body,t.withFont("")))}});Le({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=et(t[0],"raw").string,s=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),c=0;c<u.length;c++){var h=u[c],m=h.indexOf("=");if(m<0)throw new Ee("\\htmlData key/value '"+h+"' missing equals sign");var d=h.slice(0,m),p=h.slice(m+1);l["data-"+d.trim()]=p}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(o)?{type:"html",mode:n.mode,attributes:l,body:zt(s)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=$t(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=ve(r,n,t);for(var a in e.attributes)a!=="class"&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>Ur(e.body,t)});Le({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:zt(t[0]),mathml:zt(t[1])}},htmlBuilder:(e,t)=>{var n=$t(e.html,t,!1);return Ar(n)},mathmlBuilder:(e,t)=>Ur(e.mathml,t)});var Iu=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Ee("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!F2(r))throw new Ee("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Le({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(n[0])for(var l=et(n[0],"raw").string,u=l.split(","),c=0;c<u.length;c++){var h=u[c].split("=");if(h.length===2){var m=h[1].trim();switch(h[0].trim()){case"alt":o=m;break;case"width":i=Iu(m);break;case"height":a=Iu(m);break;case"totalheight":s=Iu(m);break;default:throw new Ee("Invalid key: '"+h[0]+"' in \\includegraphics.")}}}var d=et(t[0],"url").url;return o===""&&(o=d,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:r.mode,alt:o,width:i,height:a,totalheight:s,src:d}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=_t(e.height,t),r=0;e.totalheight.number>0&&(r=_t(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=_t(e.width,t));var a={height:Se(n+r)};i>0&&(a.width=Se(i)),r>0&&(a.verticalAlign=Se(-r));var s=new JE(e.src,e.alt,a);return s.height=n,s.depth=r,s},mathmlBuilder:(e,t)=>{var n=new Te("mglyph",[]);n.setAttribute("alt",e.alt);var r=_t(e.height,t),i=0;if(e.totalheight.number>0&&(i=_t(e.totalheight,t)-r,n.setAttribute("valign",Se(-i))),n.setAttribute("height",Se(r+i)),e.width.number>0){var a=_t(e.width,t);n.setAttribute("width",Se(a))}return n.setAttribute("src",e.src),n}});Le({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=et(t[0],"size");if(n.settings.strict){var a=r[1]==="m",s=i.value.unit==="mu";a?(s||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):s&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return $2(e.dimension,t)},mathmlBuilder(e,t){var n=_t(e.dimension,t);return new Q2(n)}});Le({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=ve([],[gt(e.body,t)]),n=ve(["inner"],[n],t)):n=ve(["inner"],[gt(e.body,t)]);var r=ve(["fix"],[]),i=ve([e.alignment],[n,r],t),a=ve(["strut"]);return a.style.height=Se(i.height+i.depth),i.depth&&(a.style.verticalAlign=Se(-i.depth)),i.children.unshift(a),i=ve(["thinbox"],[i],t),ve(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Te("mpadded",[kt(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Le({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var a=n==="\\("?"\\)":"$",s=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:s}}});Le({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Ee("Mismatched "+e.funcName)}});var bm=(e,t)=>{switch(t.style.size){case Xe.DISPLAY.size:return e.display;case Xe.TEXT.size:return e.text;case Xe.SCRIPT.size:return e.script;case Xe.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Le({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:zt(t[0]),text:zt(t[1]),script:zt(t[2]),scriptscript:zt(t[3])}},htmlBuilder:(e,t)=>{var n=bm(e,t),r=$t(n,t,!1);return Ar(r)},mathmlBuilder:(e,t)=>{var n=bm(e,t);return Ur(n,t)}});var Ex=(e,t,n,r,i,a,s)=>{e=ve([],[e]);var o=n&&Tr(n),l,u;if(t){var c=gt(t,r.havingStyle(i.sup()),r);u={elem:c,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-c.depth)}}if(n){var h=gt(n,r.havingStyle(i.sub()),r);l={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}var m;if(u&&l){var d=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+s;m=pt({positionType:"bottom",positionData:d,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Se(-a)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Se(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var p=e.height-s;m=pt({positionType:"top",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Se(-a)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var g=e.depth+s;m=pt({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Se(a)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[m];if(l&&a!==0&&!o){var b=ve(["mspace"],[],r);b.style.marginRight=Se(a),x.unshift(b)}return ve(["mop","op-limits"],x,r)},Tx=new Set(["\\smallint"]),ua=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=et(e.base,"op"),i=!0):a=et(e,"op");var s=t.style,o=!1;s.size===Xe.DISPLAY.size&&a.symbol&&!Tx.has(a.name)&&(o=!0);var l,u;if(a.symbol){var c=o?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=dn(a.name,c,"math",t,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,h.length>0){var m=G2(h+"Size"+(o?"2":"1"),t);l=pt({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:m,shift:o?.08:0}]}),a.name="\\"+h,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var d=$t(a.body,t,!0);d.length===1&&d[0]instanceof Nn?(l=d[0],l.classes[0]="mop"):l=ve(["mop"],d,t)}else{for(var p=[],g=1;g<a.name.length;g++)p.push(yd(a.name[g],a.mode,t));l=ve(["mop"],p,t)}var x=0,b=0;if((l instanceof Nn||a.name==="\\oiint"||a.name==="\\oiiint")&&!a.suppressBaseShift){var v;x=(l.height-l.depth)/2-t.fontMetrics().axisHeight,b=(v=l.italic)!=null?v:0}return i?Ex(l,n,r,t,s,b,x):(x&&(l.style.position="relative",l.style.top=Se(x)),l)},Ts=(e,t)=>{var n;if(e.symbol)n=new Te("mo",[zn(e.name,e.mode)]),Tx.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Te("mo",In(e.body,t));else{n=new Te("mi",[new Ht(e.name.slice(1))]);var r=new Te("mo",[zn("⁡","text")]);e.parentIsSupSub?n=new Te("mrow",[n,r]):n=X2([n,r])}return n},JT={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Le({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=JT[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:ua,mathmlBuilder:Ts});Le({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:zt(r)}},htmlBuilder:ua,mathmlBuilder:Ts});var eS={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Le({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ua,mathmlBuilder:Ts});Le({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ua,mathmlBuilder:Ts});Le({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=eS[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:ua,mathmlBuilder:Ts});var Sx=(e,t)=>{var n,r,i=!1,a;e.type==="supsub"?(n=e.sup,r=e.sub,a=et(e.base,"operatorname"),i=!0):a=et(e,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(h=>{var m="text"in h?h.text:void 0;return typeof m=="string"?{type:"textord",mode:h.mode,text:m}:h}),l=$t(o,t.withFont("mathrm"),!0),u=0;u<l.length;u++){var c=l[u];c instanceof Nn&&(c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=ve(["mop"],l,t)}else s=ve(["mop"],[],t);return i?Ex(s,n,r,t,t.style,0,0):s},tS=(e,t)=>{for(var n=In(e.body,t.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof Q2))if(a instanceof Te)switch(a.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var s=a.children[0];a.children.length===1&&s instanceof Ht?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var o=n.map(c=>c.toText()).join("");n=[new Ht(o)]}var l=new Te("mi",n);l.setAttribute("mathvariant","normal");var u=new Te("mo",[zn("⁡","text")]);return e.parentIsSupSub?new Te("mrow",[l,u]):X2([l,u])};Le({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:zt(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Sx,mathmlBuilder:tS});F("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ci({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Ar($t(e.body,t,!1)):ve(["mord"],$t(e.body,t,!0),t)},mathmlBuilder(e,t){return Ur(e.body,t,!0)}});Le({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=gt(e.body,t.havingCrampedStyle()),r=Zi("overline-line",t),i=t.fontMetrics().defaultRuleThickness,a=pt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return ve(["mord","overline"],[a],t)},mathmlBuilder(e,t){var n=new Te("mo",[new Ht("‾")]);n.setAttribute("stretchy","true");var r=new Te("mover",[kt(e.body,t),n]);return r.setAttribute("accent","true"),r}});Le({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:zt(r)}},htmlBuilder:(e,t)=>{var n=$t(e.body,t.withPhantom(),!1);return Ar(n)},mathmlBuilder:(e,t)=>{var n=In(e.body,t);return new Te("mphantom",n)}});F("\\hphantom","\\smash{\\phantom{#1}}");Le({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ve(["inner"],[gt(e.body,t.withPhantom())]),r=ve(["fix"],[]);return ve(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=In(zt(e.body),t),r=new Te("mphantom",n),i=new Te("mpadded",[r]);return i.setAttribute("width","0px"),i}});Le({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=et(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=gt(e.body,t),r=_t(e.dy,t);return pt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Te("mpadded",[kt(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});Le({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Le({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],a=et(t[0],"size"),s=et(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&et(i,"size").value,width:a.value,height:s.value}},htmlBuilder(e,t){var n=ve(["mord","rule"],[],t),r=_t(e.width,t),i=_t(e.height,t),a=e.shift?_t(e.shift,t):0;return n.style.borderRightWidth=Se(r),n.style.borderTopWidth=Se(i),n.style.bottom=Se(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=_t(e.width,t),r=_t(e.height,t),i=e.shift?_t(e.shift,t):0,a=t.color&&t.getColor()||"black",s=new Te("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Se(n)),s.setAttribute("height",Se(r));var o=new Te("mpadded",[s]);return i>=0?o.setAttribute("height",Se(i)):(o.setAttribute("height",Se(i)),o.setAttribute("depth",Se(-i))),o.setAttribute("voffset",Se(i)),o}});function Ax(e,t,n){for(var r=$t(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var s=r[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[s+1]==="reset-size"+t.size&&(r[a].classes[s+1]="reset-size"+n.size),r[a].height*=i,r[a].depth*=i}return Ar(r)}var ym=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],nS=(e,t)=>{var n=t.havingSize(e.size);return Ax(e.body,n,t)};Le({type:"sizing",names:ym,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:ym.indexOf(r)+1,body:a}},htmlBuilder:nS,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=In(e.body,n),i=new Te("mstyle",r);return i.setAttribute("mathsize",Se(n.sizeMultiplier)),i}});Le({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,s=n[0]&&et(n[0],"ordgroup");if(s)for(var o,l=0;l<s.body.length;++l){var u=s.body[l];if(o=yl(u).text,o==="t")i=!0;else if(o==="b")a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=ve([],[gt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return ve(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var i=pt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return ve(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Te("mpadded",[kt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Le({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:"sqrt",mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=gt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Ji(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,a=i;t.style.id<Xe.TEXT.id&&(a=t.fontMetrics().xHeight);var s=i+a/4,o=n.height+n.depth+s+i,{span:l,ruleWidth:u,advanceWidth:c}=UT(o,t),h=l.height-u;h>n.height+n.depth+s&&(s=(s+h-n.height-n.depth)/2);var m=l.height-n.height-s-u;n.style.paddingLeft=Se(c);var d=pt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+m)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var p=t.havingStyle(Xe.SCRIPTSCRIPT),g=gt(e.index,p,t),x=.6*(d.height-d.depth),b=pt({positionType:"shift",positionData:-x,children:[{type:"elem",elem:g}]}),v=ve(["root"],[b]);return ve(["mord","sqrt"],[v,d],t)}else return ve(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Te("mroot",[kt(n,t),kt(r,t)]):new Te("msqrt",[kt(n,t)])}});var e0={display:Xe.DISPLAY,text:Xe.TEXT,script:Xe.SCRIPT,scriptscript:Xe.SCRIPTSCRIPT};function rS(e){return e in e0}Le({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),s=r.slice(1,r.length-5);if(!rS(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(e,t){var n=e0[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),Ax(e.body,r,t)},mathmlBuilder(e,t){var n=e0[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=In(e.body,r),a=new Te("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[e.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var iS=function(t,n){var r=t.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===Xe.DISPLAY.size||r.alwaysHandleSupSub);return i?ua:null}else if(r.type==="operatorname"){var a=r.alwaysHandleSupSub&&(n.style.size===Xe.DISPLAY.size||r.limits);return a?Sx:null}else{if(r.type==="accent")return Tr(r.base)?Ed:null;if(r.type==="horizBrace"){var s=!t.sub;return s===r.isOver?kx:null}else return null}else return null};Ci({type:"supsub",htmlBuilder(e,t){var n=iS(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,s=gt(r,t),o,l,u=t.fontMetrics(),c=0,h=0,m=r&&Tr(r);if(i){var d=t.havingStyle(t.style.sup());o=gt(i,d,t),m||(c=s.height-d.fontMetrics().supDrop*d.sizeMultiplier/t.sizeMultiplier)}if(a){var p=t.havingStyle(t.style.sub());l=gt(a,p,t),m||(h=s.depth+p.fontMetrics().subDrop*p.sizeMultiplier/t.sizeMultiplier)}var g;t.style===Xe.DISPLAY?g=u.sup1:t.style.cramped?g=u.sup3:g=u.sup2;var x=t.sizeMultiplier,b=Se(.5/u.ptPerEm/x),v=null;if(l){var E=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(s instanceof Nn||E){var N;v=Se(-((N=s.italic)!=null?N:0))}}var k;if(o&&l){c=Math.max(c,g,o.depth+.25*u.xHeight),h=Math.max(h,u.sub2);var S=u.defaultRuleThickness,_=4*S;if(c-o.depth-(l.height-h)<_){h=_-(c-o.depth)+l.height;var C=.8*u.xHeight-(c-o.depth);C>0&&(c+=C,h-=C)}var I=[{type:"elem",elem:l,shift:h,marginRight:b,marginLeft:v},{type:"elem",elem:o,shift:-c,marginRight:b}];k=pt({positionType:"individualShift",children:I})}else if(l){h=Math.max(h,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:v,marginRight:b}];k=pt({positionType:"shift",positionData:h,children:A})}else if(o)c=Math.max(c,g,o.depth+.25*u.xHeight),k=pt({positionType:"shift",positionData:-c,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var R=Kc(s,"right")||"mord";return ve([R],[s,ve(["msupsub"],[k])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type==="horizBrace"&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var a=[kt(e.base,t)];e.sub&&a.push(kt(e.sub,t)),e.sup&&a.push(kt(e.sup,t));var s;if(n)s=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&t.style===Xe.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Xe.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Xe.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Xe.DISPLAY)?s="munder":s="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(t.style===Xe.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||t.style===Xe.DISPLAY)?s="mover":s="msup"}return new Te(s,a)}});Ci({type:"atom",htmlBuilder(e,t){return yd(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Te("mo",[zn(e.text,e.mode)]);if(e.family==="bin"){var r=kd(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var Cx={mi:"italic",mn:"normal",mtext:"normal"};Ci({type:"mathord",htmlBuilder(e,t){return gl(e,t,"mathord")},mathmlBuilder(e,t){var n=new Te("mi",[zn(e.text,e.mode,t)]),r=kd(e,t)||"italic";return r!==Cx[n.type]&&n.setAttribute("mathvariant",r),n}});Ci({type:"textord",htmlBuilder(e,t){return gl(e,t,"textord")},mathmlBuilder(e,t){var n=zn(e.text,e.mode,t),r=kd(e,t)||"normal",i;return e.mode==="text"?i=new Te("mtext",[n]):/[0-9]/.test(e.text)?i=new Te("mn",[n]):e.text==="\\prime"?i=new Te("mo",[n]):i=new Te("mi",[n]),r!==Cx[i.type]&&i.setAttribute("mathvariant",r),i}});var _u={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ru={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ci({type:"spacing",htmlBuilder(e,t){if(Ru.hasOwnProperty(e.text)){var n=Ru[e.text].className||"";if(e.mode==="text"){var r=gl(e,t,"textord");return r.classes.push(n),r}else return ve(["mspace",n],[yd(e.text,e.mode,t)],t)}else{if(_u.hasOwnProperty(e.text))return ve(["mspace",_u[e.text]],[],t);throw new Ee('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Ru.hasOwnProperty(e.text))n=new Te("mtext",[new Ht(" ")]);else{if(_u.hasOwnProperty(e.text))return new Te("mspace");throw new Ee('Unknown type of space "'+e.text+'"')}return n}});var vm=()=>{var e=new Te("mtd",[]);return e.setAttribute("width","50%"),e};Ci({type:"tag",mathmlBuilder(e,t){var n=new Te("mtable",[new Te("mtr",[vm(),new Te("mtd",[Ur(e.body,t)]),vm(),new Te("mtd",[Ur(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var wm={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},km={"\\textbf":"textbf","\\textmd":"textmd"},aS={"\\textit":"textit","\\textup":"textup"},Em=(e,t)=>{var n=e.font;if(n){if(wm[n])return t.withTextFontFamily(wm[n]);if(km[n])return t.withTextFontWeight(km[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(aS[n])};Le({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:zt(i),font:r}},htmlBuilder(e,t){var n=Em(e,t),r=$t(e.body,n,!0);return ve(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Em(e,t);return Ur(e.body,n)}});Le({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=gt(e.body,t),r=Zi("underline-line",t),i=t.fontMetrics().defaultRuleThickness,a=pt({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return ve(["mord","underline"],[a],t)},mathmlBuilder(e,t){var n=new Te("mo",[new Ht("‾")]);n.setAttribute("stretchy","true");var r=new Te("munder",[kt(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});Le({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=gt(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return pt({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Te("mpadded",[kt(e.body,t)],["vcenter"]);return new Te("mrow",[n])}});Le({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Ee("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Tm(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var s=n[a];s==="~"&&(s="\\textasciitilde"),r.push(dn(s,"Typewriter-Regular",e.mode,i,["mord","texttt"]))}return ve(["mord","text"].concat(i.sizingClasses(t)),q2(r),i)},mathmlBuilder(e,t){var n=new Ht(Tm(e)),r=new Te("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Tm=e=>e.body.replace(/ /g,e.star?"␣":" "),Or=Y2,Nx=`[ \r
763
+ ]`,sS="\\\\[a-zA-Z@]+",oS="\\\\[^\uD800-\uDFFF]",lS="("+sS+")"+Nx+"*",uS=`\\\\(
764
+ |[ \r ]+
765
+ ?)[ \r ]*`,t0="[̀-ͯ]",cS=new RegExp(t0+"+$"),dS="("+Nx+"+)|"+(uS+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(t0+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(t0+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+lS)+("|"+oS+")");class Sm{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(dS,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new An("EOF",new yn(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new Ee("Unexpected character: '"+t[n]+"'",new An(t[n],new yn(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(`
766
+ `,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new An(i,new yn(this,n,this.tokenRegex.lastIndex))}}class hS{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ee("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var fS=xx;F("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});F("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});F("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});F("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});F("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});F("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");F("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Am={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};F("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Ee("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=Am[t.text],r==null||r>=n)throw new Ee("Invalid base-"+n+" digit "+t.text);for(var i;(i=Am[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return"\\@char{"+r+"}"});var Cd=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new Ee("\\newcommand's first argument must be a macro name");var a=i[0].text,s=e.isDefined(a);if(s&&!t)throw new Ee("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!n)throw new Ee("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ee("Invalid number of arguments: "+l);o=parseInt(l),i=e.consumeArg().tokens}return s&&r||e.macros.set(a,{tokens:i,numArgs:o}),""};F("\\newcommand",e=>Cd(e,!1,!0,!1));F("\\renewcommand",e=>Cd(e,!0,!1,!1));F("\\providecommand",e=>Cd(e,!0,!0,!0));F("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});F("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});F("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Or[n],Ct.math[n],Ct.text[n]),""});F("\\bgroup","{");F("\\egroup","}");F("~","\\nobreakspace");F("\\lq","`");F("\\rq","'");F("\\aa","\\r a");F("\\AA","\\r A");F("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");F("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");F("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");F("ℬ","\\mathscr{B}");F("ℰ","\\mathscr{E}");F("ℱ","\\mathscr{F}");F("ℋ","\\mathscr{H}");F("ℐ","\\mathscr{I}");F("ℒ","\\mathscr{L}");F("ℳ","\\mathscr{M}");F("ℛ","\\mathscr{R}");F("ℭ","\\mathfrak{C}");F("ℌ","\\mathfrak{H}");F("ℨ","\\mathfrak{Z}");F("\\Bbbk","\\Bbb{k}");F("\\llap","\\mathllap{\\textrm{#1}}");F("\\rlap","\\mathrlap{\\textrm{#1}}");F("\\clap","\\mathclap{\\textrm{#1}}");F("\\mathstrut","\\vphantom{(}");F("\\underbar","\\underline{\\text{#1}}");F("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');F("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");F("\\ne","\\neq");F("≠","\\neq");F("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");F("∉","\\notin");F("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");F("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");F("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");F("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");F("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");F("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");F("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");F("⟂","\\perp");F("‼","\\mathclose{!\\mkern-0.8mu!}");F("∌","\\notni");F("⌜","\\ulcorner");F("⌝","\\urcorner");F("⌞","\\llcorner");F("⌟","\\lrcorner");F("©","\\copyright");F("®","\\textregistered");F("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');F("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');F("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');F("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');F("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");F("⋮","\\vdots");F("\\varGamma","\\mathit{\\Gamma}");F("\\varDelta","\\mathit{\\Delta}");F("\\varTheta","\\mathit{\\Theta}");F("\\varLambda","\\mathit{\\Lambda}");F("\\varXi","\\mathit{\\Xi}");F("\\varPi","\\mathit{\\Pi}");F("\\varSigma","\\mathit{\\Sigma}");F("\\varUpsilon","\\mathit{\\Upsilon}");F("\\varPhi","\\mathit{\\Phi}");F("\\varPsi","\\mathit{\\Psi}");F("\\varOmega","\\mathit{\\Omega}");F("\\substack","\\begin{subarray}{c}#1\\end{subarray}");F("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");F("\\boxed","\\fbox{$\\displaystyle{#1}$}");F("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");F("\\implies","\\DOTSB\\;\\Longrightarrow\\;");F("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");F("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");F("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Cm={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},mS=new Set(["bin","rel"]);F("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Cm?t=Cm[n]:(n.slice(0,4)==="\\not"||n in Ct.math&&mS.has(Ct.math[n].group))&&(t="\\dotsb"),t});var Nd={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};F("\\dotso",function(e){var t=e.future().text;return t in Nd?"\\ldots\\,":"\\ldots"});F("\\dotsc",function(e){var t=e.future().text;return t in Nd&&t!==","?"\\ldots\\,":"\\ldots"});F("\\cdots",function(e){var t=e.future().text;return t in Nd?"\\@cdots\\,":"\\@cdots"});F("\\dotsb","\\cdots");F("\\dotsm","\\cdots");F("\\dotsi","\\!\\cdots");F("\\dotsx","\\ldots\\,");F("\\DOTSI","\\relax");F("\\DOTSB","\\relax");F("\\DOTSX","\\relax");F("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");F("\\,","\\tmspace+{3mu}{.1667em}");F("\\thinspace","\\,");F("\\>","\\mskip{4mu}");F("\\:","\\tmspace+{4mu}{.2222em}");F("\\medspace","\\:");F("\\;","\\tmspace+{5mu}{.2777em}");F("\\thickspace","\\;");F("\\!","\\tmspace-{3mu}{.1667em}");F("\\negthinspace","\\!");F("\\negmedspace","\\tmspace-{4mu}{.2222em}");F("\\negthickspace","\\tmspace-{5mu}{.277em}");F("\\enspace","\\kern.5em ");F("\\enskip","\\hskip.5em\\relax");F("\\quad","\\hskip1em\\relax");F("\\qquad","\\hskip2em\\relax");F("\\tag","\\@ifstar\\tag@literal\\tag@paren");F("\\tag@paren","\\tag@literal{({#1})}");F("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ee("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});F("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");F("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");F("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");F("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");F("\\newline","\\\\\\relax");F("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Mx=Se(ar["Main-Regular"][84][1]-.7*ar["Main-Regular"][65][1]);F("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Mx+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");F("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Mx+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");F("\\hspace","\\@ifstar\\@hspacer\\@hspace");F("\\@hspace","\\hskip #1\\relax");F("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");F("\\ordinarycolon",":");F("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");F("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');F("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');F("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');F("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');F("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');F("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');F("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');F("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');F("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');F("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');F("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');F("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');F("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');F("∷","\\dblcolon");F("∹","\\eqcolon");F("≔","\\coloneqq");F("≕","\\eqqcolon");F("⩴","\\Coloneqq");F("\\ratio","\\vcentcolon");F("\\coloncolon","\\dblcolon");F("\\colonequals","\\coloneqq");F("\\coloncolonequals","\\Coloneqq");F("\\equalscolon","\\eqqcolon");F("\\equalscoloncolon","\\Eqqcolon");F("\\colonminus","\\coloneq");F("\\coloncolonminus","\\Coloneq");F("\\minuscolon","\\eqcolon");F("\\minuscoloncolon","\\Eqcolon");F("\\coloncolonapprox","\\Colonapprox");F("\\coloncolonsim","\\Colonsim");F("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");F("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");F("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");F("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");F("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");F("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");F("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");F("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");F("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");F("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");F("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");F("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");F("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");F("\\nleqq","\\html@mathml{\\@nleqq}{≰}");F("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");F("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");F("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");F("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");F("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");F("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");F("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");F("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");F("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");F("\\imath","\\html@mathml{\\@imath}{ı}");F("\\jmath","\\html@mathml{\\@jmath}{ȷ}");F("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");F("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");F("⟦","\\llbracket");F("⟧","\\rrbracket");F("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");F("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");F("⦃","\\lBrace");F("⦄","\\rBrace");F("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");F("⦵","\\minuso");F("\\darr","\\downarrow");F("\\dArr","\\Downarrow");F("\\Darr","\\Downarrow");F("\\lang","\\langle");F("\\rang","\\rangle");F("\\uarr","\\uparrow");F("\\uArr","\\Uparrow");F("\\Uarr","\\Uparrow");F("\\N","\\mathbb{N}");F("\\R","\\mathbb{R}");F("\\Z","\\mathbb{Z}");F("\\alef","\\aleph");F("\\alefsym","\\aleph");F("\\Alpha","\\mathrm{A}");F("\\Beta","\\mathrm{B}");F("\\bull","\\bullet");F("\\Chi","\\mathrm{X}");F("\\clubs","\\clubsuit");F("\\cnums","\\mathbb{C}");F("\\Complex","\\mathbb{C}");F("\\Dagger","\\ddagger");F("\\diamonds","\\diamondsuit");F("\\empty","\\emptyset");F("\\Epsilon","\\mathrm{E}");F("\\Eta","\\mathrm{H}");F("\\exist","\\exists");F("\\harr","\\leftrightarrow");F("\\hArr","\\Leftrightarrow");F("\\Harr","\\Leftrightarrow");F("\\hearts","\\heartsuit");F("\\image","\\Im");F("\\infin","\\infty");F("\\Iota","\\mathrm{I}");F("\\isin","\\in");F("\\Kappa","\\mathrm{K}");F("\\larr","\\leftarrow");F("\\lArr","\\Leftarrow");F("\\Larr","\\Leftarrow");F("\\lrarr","\\leftrightarrow");F("\\lrArr","\\Leftrightarrow");F("\\Lrarr","\\Leftrightarrow");F("\\Mu","\\mathrm{M}");F("\\natnums","\\mathbb{N}");F("\\Nu","\\mathrm{N}");F("\\Omicron","\\mathrm{O}");F("\\plusmn","\\pm");F("\\rarr","\\rightarrow");F("\\rArr","\\Rightarrow");F("\\Rarr","\\Rightarrow");F("\\real","\\Re");F("\\reals","\\mathbb{R}");F("\\Reals","\\mathbb{R}");F("\\Rho","\\mathrm{P}");F("\\sdot","\\cdot");F("\\sect","\\S");F("\\spades","\\spadesuit");F("\\sub","\\subset");F("\\sube","\\subseteq");F("\\supe","\\supseteq");F("\\Tau","\\mathrm{T}");F("\\thetasym","\\vartheta");F("\\weierp","\\wp");F("\\Zeta","\\mathrm{Z}");F("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");F("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");F("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");F("\\bra","\\mathinner{\\langle{#1}|}");F("\\ket","\\mathinner{|{#1}\\rangle}");F("\\braket","\\mathinner{\\langle{#1}\\rangle}");F("\\Bra","\\left\\langle#1\\right|");F("\\Ket","\\left|#1\\right\\rangle");var Ix=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,s=t.macros.get("|"),o=t.macros.get("\\|");t.macros.beginGroup();var l=h=>m=>{e&&(m.macros.set("|",s),i.length&&m.macros.set("\\|",o));var d=h;if(!h&&i.length){var p=m.future();p.text==="|"&&(m.popToken(),d=!0)}return{tokens:d?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var u=t.consumeArg().tokens,c=t.expandTokens([...a,...u,...n]);return t.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};F("\\bra@ket",Ix(!1));F("\\bra@set",Ix(!0));F("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");F("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");F("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");F("\\angln","{\\angl n}");F("\\blue","\\textcolor{##6495ed}{#1}");F("\\orange","\\textcolor{##ffa500}{#1}");F("\\pink","\\textcolor{##ff00af}{#1}");F("\\red","\\textcolor{##df0030}{#1}");F("\\green","\\textcolor{##28ae7b}{#1}");F("\\gray","\\textcolor{gray}{#1}");F("\\purple","\\textcolor{##9d38bd}{#1}");F("\\blueA","\\textcolor{##ccfaff}{#1}");F("\\blueB","\\textcolor{##80f6ff}{#1}");F("\\blueC","\\textcolor{##63d9ea}{#1}");F("\\blueD","\\textcolor{##11accd}{#1}");F("\\blueE","\\textcolor{##0c7f99}{#1}");F("\\tealA","\\textcolor{##94fff5}{#1}");F("\\tealB","\\textcolor{##26edd5}{#1}");F("\\tealC","\\textcolor{##01d1c1}{#1}");F("\\tealD","\\textcolor{##01a995}{#1}");F("\\tealE","\\textcolor{##208170}{#1}");F("\\greenA","\\textcolor{##b6ffb0}{#1}");F("\\greenB","\\textcolor{##8af281}{#1}");F("\\greenC","\\textcolor{##74cf70}{#1}");F("\\greenD","\\textcolor{##1fab54}{#1}");F("\\greenE","\\textcolor{##0d923f}{#1}");F("\\goldA","\\textcolor{##ffd0a9}{#1}");F("\\goldB","\\textcolor{##ffbb71}{#1}");F("\\goldC","\\textcolor{##ff9c39}{#1}");F("\\goldD","\\textcolor{##e07d10}{#1}");F("\\goldE","\\textcolor{##a75a05}{#1}");F("\\redA","\\textcolor{##fca9a9}{#1}");F("\\redB","\\textcolor{##ff8482}{#1}");F("\\redC","\\textcolor{##f9685d}{#1}");F("\\redD","\\textcolor{##e84d39}{#1}");F("\\redE","\\textcolor{##bc2612}{#1}");F("\\maroonA","\\textcolor{##ffbde0}{#1}");F("\\maroonB","\\textcolor{##ff92c6}{#1}");F("\\maroonC","\\textcolor{##ed5fa6}{#1}");F("\\maroonD","\\textcolor{##ca337c}{#1}");F("\\maroonE","\\textcolor{##9e034e}{#1}");F("\\purpleA","\\textcolor{##ddd7ff}{#1}");F("\\purpleB","\\textcolor{##c6b9fc}{#1}");F("\\purpleC","\\textcolor{##aa87ff}{#1}");F("\\purpleD","\\textcolor{##7854ab}{#1}");F("\\purpleE","\\textcolor{##543b78}{#1}");F("\\mintA","\\textcolor{##f5f9e8}{#1}");F("\\mintB","\\textcolor{##edf2df}{#1}");F("\\mintC","\\textcolor{##e0e5cc}{#1}");F("\\grayA","\\textcolor{##f6f7f7}{#1}");F("\\grayB","\\textcolor{##f0f1f2}{#1}");F("\\grayC","\\textcolor{##e3e5e6}{#1}");F("\\grayD","\\textcolor{##d6d8da}{#1}");F("\\grayE","\\textcolor{##babec2}{#1}");F("\\grayF","\\textcolor{##888d93}{#1}");F("\\grayG","\\textcolor{##626569}{#1}");F("\\grayH","\\textcolor{##3b3e40}{#1}");F("\\grayI","\\textcolor{##21242c}{#1}");F("\\kaBlue","\\textcolor{##314453}{#1}");F("\\kaGreen","\\textcolor{##71B307}{#1}");var _x={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class pS{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new hS(fS,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new Sm(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new An("EOF",r.loc)),this.pushTokens(i),new An("",yn.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new Ee("Extra }",a)}else if(a.text==="EOF")throw new Ee("Unexpected end of input in a macro argument, expected '"+(t&&r?t[o]:"}")+"'",a);if(t&&r)if((s===0||s===1&&t[o]==="{")&&a.text===t[o]){if(++o,o===t.length){n.splice(-o,o);break}}else o=0}while(s!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Ee("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;i<r.length;i++){var a=this.popToken();if(r[i]!==a.text)throw new Ee("Use of the macro doesn't match its definition",a)}}for(var s=[],o=0;o<t;o++)s.push(this.consumeArg(n&&n[o+1]).tokens);return s}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Ee("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ee("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new Ee("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new Ee("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new An(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new Sm(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var c={tokens:l,numArgs:a};return c}return i}isDefined(t){return this.macros.has(t)||Or.hasOwnProperty(t)||Ct.math.hasOwnProperty(t)||Ct.text.hasOwnProperty(t)||_x.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Or.hasOwnProperty(t)&&!Or[t].primitive}}var Nm=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Ks=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Lu={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Mm={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let Rx=class Lx{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new pS(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Ee("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new An("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Lx.endOfExpression.has(i.text)||n&&i.text===n||t&&Or[i.text]&&Or[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i<t.length;i++){var a=t[i];if(a.type==="infix"){if(n!==-1)throw new Ee("only one infix operator per group",a.token);n=i,r=a.replaceWith}}if(n!==-1&&r){var s,o,l=t.slice(0,n),u=t.slice(n+1);l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l},u.length===1&&u[0].type==="ordgroup"?o=u[0]:o={type:"ordgroup",mode:this.mode,body:u};var c;return r==="\\\\abovefrac"?c=this.callFunction(r,[s,t[n],o],[]):c=this.callFunction(r,[s,o],[]),[c]}else return t}handleSupSubscript(t){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var i;do{var a;i=this.parseGroup(t)}while(((a=i)==null?void 0:a.type)==="internal");if(!i)throw new Ee("Expected group after '"+r+"'",n);return i}formatUnsupportedCmd(t){for(var n=[],r=0;r<t.length;r++)n.push({type:"textord",mode:"text",text:t[r]});var i={type:"text",mode:this.mode,body:n},a={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return a}parseAtom(t){var n=this.parseGroup("atom",t);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,i;;){this.consumeSpaces();var a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(n&&n.type==="op"){var s=a.text==="\\limits";n.limits=s,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=a.text==="\\limits");else throw new Ee("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(r)throw new Ee("Double superscript",a);r=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(i)throw new Ee("Double subscript",a);i=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(r)throw new Ee("Double superscript",a);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();this.fetch().text==="'";)l.push(o),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:l}}else if(Ks[a.text]){var u=Nm.test(a.text),c=[];for(c.push(new An(Ks[a.text])),this.consume();;){var h=this.fetch().text;if(!Ks[h]||Nm.test(h)!==u)break;c.unshift(new An(Ks[h])),this.consume()}var m=this.subparse(c);u?i={type:"ordgroup",mode:"math",body:m}:r={type:"ordgroup",mode:"math",body:m}}else break}return r||i?{type:"supsub",mode:this.mode,base:n,sup:r,sub:i}:n}parseFunction(t,n){var r=this.fetch(),i=r.text,a=Or[i];if(!a)return null;if(this.consume(),n&&n!=="atom"&&!a.allowedInArgument)throw new Ee("Got function '"+i+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!a.allowedInText)throw new Ee("Can't use function '"+i+"' in text mode",r);if(this.mode==="math"&&a.allowedInMath===!1)throw new Ee("Can't use function '"+i+"' in math mode",r);var{args:s,optArgs:o}=this.parseArguments(i,a);return this.callFunction(i,s,o,r,t)}callFunction(t,n,r,i,a){var s={funcName:t,parser:this,token:i,breakOnTokenText:a},o=Or[t];if(o&&o.handler)return o.handler(s,n,r);throw new Ee("No function handler for "+t)}parseArguments(t,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<r;s++){var o=n.argTypes&&n.argTypes[s],l=s<n.numOptionalArgs;("primitive"in n&&n.primitive&&o==null||n.type==="sqrt"&&s===1&&a[0]==null)&&(o="primitive");var u=this.parseGroupOfType("argument to '"+t+"'",o,l);if(l)a.push(u);else if(u!=null)i.push(u);else throw new Ee("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(t,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var i=this.parseArgumentGroup(r,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text",resetFont:!0}:null}case"raw":{var a=this.parseStringGroup("raw",r);return a!=null?{type:"raw",mode:"text",string:a.text}:null}case"primitive":{if(r)throw new Ee("A primitive argument cannot be optional");var s=this.parseGroup(t);if(s==null)throw new Ee("Expected group as "+t,this.fetch());return s}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new Ee("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var i="",a;(a=this.fetch()).text!=="EOF";)i+=a.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(t,n){for(var r=this.fetch(),i=r,a="",s;(s=this.fetch()).text!=="EOF"&&t.test(a+s.text);)i=s,a+=i.text,this.consume();if(a==="")throw new Ee("Invalid "+n+": '"+r.text+"'",r);return r.range(i,a)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new Ee("Invalid color: '"+n.text+"'",n);var i=r[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(t){var n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!i)throw new Ee("Invalid size: '"+n.text+"'",n);var a={number:+(i[1]+i[2]),unit:i[3]};if(!F2(a))throw new Ee("Invalid unit: '"+a.unit+"'",n);return{type:"size",mode:this.mode,value:a,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){var r=this.gullet.scanArgument(t);if(r==null)return null;var i=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:r.loc,body:a};return n&&this.switchMode(i),s}parseGroup(t,n){var r=this.fetch(),i=r.text,a;if(i==="{"||i==="\\begingroup"){this.consume();var s=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),l=this.fetch();this.expect(s),this.gullet.endGroup(),a={type:"ordgroup",mode:this.mode,loc:yn.range(r,l),body:o,semisimple:i==="\\begingroup"||void 0}}else if(a=this.parseFunction(n,t)||this.parseSymbol(),a==null&&i[0]==="\\"&&!_x.hasOwnProperty(i)){if(this.settings.throwOnError)throw new Ee("Undefined control sequence: "+i,r);a=this.formatUnsupportedCmd(i),this.consume()}return a}formLigatures(t){for(var n=t.length-1,r=0;r<n;++r){var i=t[r];if(i.type==="textord"){var a=i.text,s=t[r+1];if(!(!s||s.type!=="textord")){if(a==="-"&&s.text==="-"){var o=t[r+2];r+1<n&&o&&o.type==="textord"&&o.text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:yn.range(i,o),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:yn.range(i,s),text:"--"}),n-=1)}(a==="'"||a==="`")&&s.text===a&&(t.splice(r,2,{type:"textord",mode:"text",loc:yn.range(i,s),text:a+a}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),i=r.charAt(0)==="*";if(i&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new Ee(`\\verb assertion failed --
767
+ please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}Mm.hasOwnProperty(n[0])&&!Ct[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=Mm[n[0]]+n.slice(1));var a=cS.exec(n);a&&(n=n.substring(0,a.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var s;if(Ct[this.mode][n]){this.settings.strict&&this.mode==="math"&&Hc.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var o=Ct[this.mode][n].group,l=yn.range(t),u;_T(o)?u={type:"atom",mode:this.mode,family:o,loc:l,text:n}:u={type:o,mode:this.mode,loc:l,text:n},s=u}else if(n.charCodeAt(0)>=128)this.settings.strict&&(B2(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),s={type:"textord",mode:"text",loc:yn.range(t),text:n};else return null;if(this.consume(),a)for(var c=0;c<a[0].length;c++){var h=a[0][c];if(!Lu[h])throw new Ee("Unknown accent ' "+h+"'",t);var m=Lu[h][this.mode]||Lu[h].text;if(!m)throw new Ee("Accent "+h+" unsupported in "+this.mode+" mode",t);s={type:"accent",mode:this.mode,loc:yn.range(t),label:m,isStretchy:!1,isShifty:!0,base:s}}return s}};Rx.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Md=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Rx(t,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Ee("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new An("\\df@tag")])}]}return i},Dx=function(t,n,r){n.textContent="";var i=Id(t,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Dx=function(){throw new Ee("KaTeX doesn't work in quirks mode.")});var gS=function(t,n){var r=Id(t,n).toMarkup();return r},xS=function(t,n){var r=new pd(n);return Md(t,r)},Px=function(t,n,r){if(r.throwOnError||!(t instanceof Ee))throw t;var i=ve(["katex-error"],[new Nn(n)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+r.errorColor),i},Id=function(t,n){var r=new pd(n);try{var i=Md(t,r);return ET(i,t,r)}catch(a){return Px(a,t,r)}},bS=function(t,n){var r=new pd(n);try{var i=Md(t,r);return TT(i,t,r)}catch(a){return Px(a,t,r)}},yS="0.16.47",vS={Span:oa,Anchor:ml,SymbolNode:Nn,SvgNode:kr,PathNode:zr,LineNode:zc},Im={version:yS,render:Dx,renderToString:gS,ParseError:Ee,SETTINGS_SCHEMA:jc,__parse:xS,__renderToDomTree:Id,__renderToHTMLTree:bS,__setFontMetrics:iT,__defineSymbol:T,__defineFunction:Le,__defineMacro:F,__domTree:vS};const wS={},kS=[];function Ox(e){const t=e||wS;return function(n,r){ud(n,"element",function(i,a){const s=Array.isArray(i.properties.className)?i.properties.className:kS,o=s.includes("language-math"),l=s.includes("math-display"),u=s.includes("math-inline");let c=l;if(!o&&!l&&!u)return;let h=a[a.length-1],m=i;if(i.tagName==="code"&&o&&h&&h.type==="element"&&h.tagName==="pre"&&(m=h,h=a[a.length-2],c=!0),!h)return;const d=xE(m,{whitespace:"pre"});let p;try{p=Im.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(x){const b=x,v=b.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...a,i],cause:b,place:i.position,ruleId:v,source:"rehype-katex"});try{p=Im.renderToString(d,{...t,displayMode:c,strict:"ignore",throwOnError:!1})}catch{p=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(x)},children:[{type:"text",value:d}]}]}}typeof p=="string"&&(p=uE(p).children);const g=h.children.indexOf(m);return h.children.splice(g,1,...p),Jg})}}function ES(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let o=n[s];if(o===void 0){const l=_m(t,n[s-1]);o=l===-1?t.length+1:l+1,n[s]=o}if(o>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const o=n[n.length-1],l=_m(t,o),u=l===-1?t.length+1:l+1;if(o===u)break;n.push(u)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function _m(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
768
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const jx={}.hasOwnProperty,TS=Object.prototype;function SS(e,t){const n=t||{};return _d({file:n.file||void 0,location:!1,schema:n.space==="svg"?$r:ys,verbose:n.verbose||!1},e)}function _d(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},po(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Bx(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),s=ES(a),o=s.toPoint(0),l=s.toPoint(a.length);n.position={start:o,end:l}}return n}case"#documentType":{const r=t;return n={type:"doctype"},po(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},po(e,r,n),n}default:return n=AS(e,t),n}}function Bx(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=_d(e,t[n]);r.push(i)}return r}function AS(e,t){const n=e.schema;e.schema=t.namespaceURI===ir.svg?$r:ys;let r=-1;const i={};for(;++r<t.attrs.length;){const o=t.attrs[r],l=(o.prefix?o.prefix+":":"")+o.name;jx.call(TS,l)||(i[l]=o.value)}const s=(e.schema.space==="svg"?_2:I2)(t.tagName,i,Bx(e,t.childNodes));if(po(e,t,s),s.tagName==="template"){const o=t,l=o.sourceCodeLocation,u=l&&l.startTag&&Hi(l.startTag),c=l&&l.endTag&&Hi(l.endTag),h=_d(e,o.content);u&&c&&e.file&&(h.position={start:u.end,end:c.start}),s.content=h}return e.schema=n,s}function po(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=CS(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function CS(e,t,n){const r=Hi(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)jx.call(n.attrs,s)&&(a[ol(e.schema,s).property]=Hi(n.attrs[s]));n.startTag;const o=Hi(n.startTag),l=n.endTag?Hi(n.endTag):void 0,u={opening:o};l&&(u.closing=l),u.properties=a,t.data={position:u}}}return r}function Hi(e){const t=Rm({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Rm({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Rm(e){return e.line&&e.column?e:void 0}const NS={},MS={}.hasOwnProperty,Fx=s2("type",{handlers:{root:_S,element:OS,text:DS,comment:PS,doctype:LS}});function IS(e,t){const r=(t||NS).space;return Fx(e,r==="svg"?$r:ys)}function _S(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Rd(e.children,n,t),ca(e,n),n}function RS(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Rd(e.children,n,t),ca(e,n),n}function LS(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return ca(e,t),t}function DS(e){const t={nodeName:"#text",value:e.value,parentNode:null};return ca(e,t),t}function PS(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return ca(e,t),t}function OS(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=$r);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&MS.call(e.properties,a)){const l=jS(r,a,e.properties[a]);l&&i.push(l)}}const s=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:ir[s],childNodes:[],parentNode:null};return o.childNodes=Rd(e.children,o,r),ca(e,o),e.tagName==="template"&&e.content&&(o.content=RS(e.content,r)),o}function jS(e,t,n){const r=ol(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?xg(n):Sg(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=ir[r.space]}return i}function Rd(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=Fx(e[r],n);a.parentNode=t,i.push(a)}return i}function ca(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const BS=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],FS=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),At="�";var U;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(U||(U={}));const xn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function zx(e){return e>=55296&&e<=57343}function zS(e){return e>=56320&&e<=57343}function HS(e,t){return(e-55296)*1024+9216+t}function Hx(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Ux(e){return e>=64976&&e<=65007||FS.has(e)}var ue;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ue||(ue={}));const US=65536;class VS{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=US,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:a}=this,s=i+n,o=a+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(zS(n))return this.pos++,this._addGap(),HS(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,U.EOF;return this._err(ue.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,U.EOF;const r=this.html.charCodeAt(n);return r===U.CARRIAGE_RETURN?U.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,U.EOF;let t=this.html.charCodeAt(this.pos);return t===U.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,U.LINE_FEED):t===U.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,zx(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===U.LINE_FEED||t===U.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Hx(t)?this._err(ue.controlCharacterInInputStream):Ux(t)&&this._err(ue.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(at||(at={}));function Vx(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const qS=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),$S=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function WS(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=$S.get(e))!==null&&t!==void 0?t:e}var Yt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Yt||(Yt={}));const GS=32;var jr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(jr||(jr={}));function n0(e){return e>=Yt.ZERO&&e<=Yt.NINE}function YS(e){return e>=Yt.UPPER_A&&e<=Yt.UPPER_F||e>=Yt.LOWER_A&&e<=Yt.LOWER_F}function KS(e){return e>=Yt.UPPER_A&&e<=Yt.UPPER_Z||e>=Yt.LOWER_A&&e<=Yt.LOWER_Z||n0(e)}function XS(e){return e===Yt.EQUALS||KS(e)}var Gt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Gt||(Gt={}));var yr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(yr||(yr={}));class QS{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Gt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=yr.Strict}startEntity(t){this.decodeMode=t,this.state=Gt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Gt.EntityStart:return t.charCodeAt(n)===Yt.NUM?(this.state=Gt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Gt.NamedEntity,this.stateNamedEntity(t,n));case Gt.NumericStart:return this.stateNumericStart(t,n);case Gt.NumericDecimal:return this.stateNumericDecimal(t,n);case Gt.NumericHex:return this.stateNumericHex(t,n);case Gt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|GS)===Yt.LOWER_X?(this.state=Gt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Gt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(t.substr(n,a),i),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(n0(i)||YS(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(n0(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Yt.SEMI)this.consumed+=1;else if(this.decodeMode===yr.Strict)return 0;return this.emitCodePoint(WS(this.result),this.consumed),this.errors&&(t!==Yt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&jr.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=ZS(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===yr.Attribute&&(a===0||XS(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&jr.VALUE_LENGTH)>>14,a!==0){if(s===Yt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==yr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&jr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~jr.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Gt.NamedEntity:return this.result!==0&&(this.decodeMode!==yr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Gt.NumericDecimal:return this.emitNumericEntity(0,2);case Gt.NumericHex:return this.emitNumericEntity(0,3);case Gt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Gt.EntityStart:return 0}}}function ZS(e,t,n,r){const i=(t&jr.BRANCH_LENGTH)>>7,a=t&jr.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const l=r-a;return l<0||l>=i?-1:e[n+l]-1}let s=n,o=s+i-1;for(;s<=o;){const l=s+o>>>1,u=e[l];if(u<r)s=l+1;else if(u>r)o=l-1;else return e[l+i]}return-1}var be;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(be||(be={}));var xi;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(xi||(xi={}));var Pn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Pn||(Pn={}));var se;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(se||(se={}));var y;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(y||(y={}));const JS=new Map([[se.A,y.A],[se.ADDRESS,y.ADDRESS],[se.ANNOTATION_XML,y.ANNOTATION_XML],[se.APPLET,y.APPLET],[se.AREA,y.AREA],[se.ARTICLE,y.ARTICLE],[se.ASIDE,y.ASIDE],[se.B,y.B],[se.BASE,y.BASE],[se.BASEFONT,y.BASEFONT],[se.BGSOUND,y.BGSOUND],[se.BIG,y.BIG],[se.BLOCKQUOTE,y.BLOCKQUOTE],[se.BODY,y.BODY],[se.BR,y.BR],[se.BUTTON,y.BUTTON],[se.CAPTION,y.CAPTION],[se.CENTER,y.CENTER],[se.CODE,y.CODE],[se.COL,y.COL],[se.COLGROUP,y.COLGROUP],[se.DD,y.DD],[se.DESC,y.DESC],[se.DETAILS,y.DETAILS],[se.DIALOG,y.DIALOG],[se.DIR,y.DIR],[se.DIV,y.DIV],[se.DL,y.DL],[se.DT,y.DT],[se.EM,y.EM],[se.EMBED,y.EMBED],[se.FIELDSET,y.FIELDSET],[se.FIGCAPTION,y.FIGCAPTION],[se.FIGURE,y.FIGURE],[se.FONT,y.FONT],[se.FOOTER,y.FOOTER],[se.FOREIGN_OBJECT,y.FOREIGN_OBJECT],[se.FORM,y.FORM],[se.FRAME,y.FRAME],[se.FRAMESET,y.FRAMESET],[se.H1,y.H1],[se.H2,y.H2],[se.H3,y.H3],[se.H4,y.H4],[se.H5,y.H5],[se.H6,y.H6],[se.HEAD,y.HEAD],[se.HEADER,y.HEADER],[se.HGROUP,y.HGROUP],[se.HR,y.HR],[se.HTML,y.HTML],[se.I,y.I],[se.IMG,y.IMG],[se.IMAGE,y.IMAGE],[se.INPUT,y.INPUT],[se.IFRAME,y.IFRAME],[se.KEYGEN,y.KEYGEN],[se.LABEL,y.LABEL],[se.LI,y.LI],[se.LINK,y.LINK],[se.LISTING,y.LISTING],[se.MAIN,y.MAIN],[se.MALIGNMARK,y.MALIGNMARK],[se.MARQUEE,y.MARQUEE],[se.MATH,y.MATH],[se.MENU,y.MENU],[se.META,y.META],[se.MGLYPH,y.MGLYPH],[se.MI,y.MI],[se.MO,y.MO],[se.MN,y.MN],[se.MS,y.MS],[se.MTEXT,y.MTEXT],[se.NAV,y.NAV],[se.NOBR,y.NOBR],[se.NOFRAMES,y.NOFRAMES],[se.NOEMBED,y.NOEMBED],[se.NOSCRIPT,y.NOSCRIPT],[se.OBJECT,y.OBJECT],[se.OL,y.OL],[se.OPTGROUP,y.OPTGROUP],[se.OPTION,y.OPTION],[se.P,y.P],[se.PARAM,y.PARAM],[se.PLAINTEXT,y.PLAINTEXT],[se.PRE,y.PRE],[se.RB,y.RB],[se.RP,y.RP],[se.RT,y.RT],[se.RTC,y.RTC],[se.RUBY,y.RUBY],[se.S,y.S],[se.SCRIPT,y.SCRIPT],[se.SEARCH,y.SEARCH],[se.SECTION,y.SECTION],[se.SELECT,y.SELECT],[se.SOURCE,y.SOURCE],[se.SMALL,y.SMALL],[se.SPAN,y.SPAN],[se.STRIKE,y.STRIKE],[se.STRONG,y.STRONG],[se.STYLE,y.STYLE],[se.SUB,y.SUB],[se.SUMMARY,y.SUMMARY],[se.SUP,y.SUP],[se.TABLE,y.TABLE],[se.TBODY,y.TBODY],[se.TEMPLATE,y.TEMPLATE],[se.TEXTAREA,y.TEXTAREA],[se.TFOOT,y.TFOOT],[se.TD,y.TD],[se.TH,y.TH],[se.THEAD,y.THEAD],[se.TITLE,y.TITLE],[se.TR,y.TR],[se.TRACK,y.TRACK],[se.TT,y.TT],[se.U,y.U],[se.UL,y.UL],[se.SVG,y.SVG],[se.VAR,y.VAR],[se.WBR,y.WBR],[se.XMP,y.XMP]]);function da(e){var t;return(t=JS.get(e))!==null&&t!==void 0?t:y.UNKNOWN}const we=y,eA={[be.HTML]:new Set([we.ADDRESS,we.APPLET,we.AREA,we.ARTICLE,we.ASIDE,we.BASE,we.BASEFONT,we.BGSOUND,we.BLOCKQUOTE,we.BODY,we.BR,we.BUTTON,we.CAPTION,we.CENTER,we.COL,we.COLGROUP,we.DD,we.DETAILS,we.DIR,we.DIV,we.DL,we.DT,we.EMBED,we.FIELDSET,we.FIGCAPTION,we.FIGURE,we.FOOTER,we.FORM,we.FRAME,we.FRAMESET,we.H1,we.H2,we.H3,we.H4,we.H5,we.H6,we.HEAD,we.HEADER,we.HGROUP,we.HR,we.HTML,we.IFRAME,we.IMG,we.INPUT,we.LI,we.LINK,we.LISTING,we.MAIN,we.MARQUEE,we.MENU,we.META,we.NAV,we.NOEMBED,we.NOFRAMES,we.NOSCRIPT,we.OBJECT,we.OL,we.P,we.PARAM,we.PLAINTEXT,we.PRE,we.SCRIPT,we.SECTION,we.SELECT,we.SOURCE,we.STYLE,we.SUMMARY,we.TABLE,we.TBODY,we.TD,we.TEMPLATE,we.TEXTAREA,we.TFOOT,we.TH,we.THEAD,we.TITLE,we.TR,we.TRACK,we.UL,we.WBR,we.XMP]),[be.MATHML]:new Set([we.MI,we.MO,we.MN,we.MS,we.MTEXT,we.ANNOTATION_XML]),[be.SVG]:new Set([we.TITLE,we.FOREIGN_OBJECT,we.DESC]),[be.XLINK]:new Set,[be.XML]:new Set,[be.XMLNS]:new Set},r0=new Set([we.H1,we.H2,we.H3,we.H4,we.H5,we.H6]);se.STYLE,se.SCRIPT,se.XMP,se.IFRAME,se.NOEMBED,se.NOFRAMES,se.PLAINTEXT;var q;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(q||(q={}));const Ot={DATA:q.DATA,RCDATA:q.RCDATA,RAWTEXT:q.RAWTEXT,SCRIPT_DATA:q.SCRIPT_DATA,PLAINTEXT:q.PLAINTEXT,CDATA_SECTION:q.CDATA_SECTION};function tA(e){return e>=U.DIGIT_0&&e<=U.DIGIT_9}function Oa(e){return e>=U.LATIN_CAPITAL_A&&e<=U.LATIN_CAPITAL_Z}function nA(e){return e>=U.LATIN_SMALL_A&&e<=U.LATIN_SMALL_Z}function _r(e){return nA(e)||Oa(e)}function Lm(e){return _r(e)||tA(e)}function Xs(e){return e+32}function qx(e){return e===U.SPACE||e===U.LINE_FEED||e===U.TABULATION||e===U.FORM_FEED}function Dm(e){return qx(e)||e===U.SOLIDUS||e===U.GREATER_THAN_SIGN}function rA(e){return e===U.NULL?ue.nullCharacterReference:e>1114111?ue.characterReferenceOutsideUnicodeRange:zx(e)?ue.surrogateCharacterReference:Ux(e)?ue.noncharacterCharacterReference:Hx(e)||e===U.CARRIAGE_RETURN?ue.controlCharacterReference:null}class iA{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=q.DATA,this.returnState=q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new VS(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new QS(qS,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ue.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ue.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=rA(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:at.START_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:at.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Vx(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ue.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=da(t.tagName),t.type===at.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ue.endTagWithAttributes),t.selfClosing&&this._err(ue.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:at.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=qx(t)?at.WHITESPACE_CHARACTER:t===U.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(at.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?yr.Attribute:yr.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case q.DATA:{this._stateData(t);break}case q.RCDATA:{this._stateRcdata(t);break}case q.RAWTEXT:{this._stateRawtext(t);break}case q.SCRIPT_DATA:{this._stateScriptData(t);break}case q.PLAINTEXT:{this._statePlaintext(t);break}case q.TAG_OPEN:{this._stateTagOpen(t);break}case q.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case q.TAG_NAME:{this._stateTagName(t);break}case q.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case q.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case q.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case q.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case q.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case q.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case q.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case q.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case q.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case q.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case q.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case q.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case q.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case q.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case q.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case q.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case q.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case q.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case q.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case q.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case q.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case q.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case q.BOGUS_COMMENT:{this._stateBogusComment(t);break}case q.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case q.COMMENT_START:{this._stateCommentStart(t);break}case q.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case q.COMMENT:{this._stateComment(t);break}case q.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case q.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case q.COMMENT_END:{this._stateCommentEnd(t);break}case q.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case q.DOCTYPE:{this._stateDoctype(t);break}case q.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case q.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case q.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case q.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case q.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case q.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case q.CDATA_SECTION:{this._stateCdataSection(t);break}case q.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case q.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case q.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case q.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case U.LESS_THAN_SIGN:{this.state=q.TAG_OPEN;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitCodePoint(t);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case U.AMPERSAND:{this._startCharacterReference();break}case U.LESS_THAN_SIGN:{this.state=q.RCDATA_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(At);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case U.LESS_THAN_SIGN:{this.state=q.RAWTEXT_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(At);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case U.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(At);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(At);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(_r(t))this._createStartTagToken(),this.state=q.TAG_NAME,this._stateTagName(t);else switch(t){case U.EXCLAMATION_MARK:{this.state=q.MARKUP_DECLARATION_OPEN;break}case U.SOLIDUS:{this.state=q.END_TAG_OPEN;break}case U.QUESTION_MARK:{this._err(ue.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=q.BOGUS_COMMENT,this._stateBogusComment(t);break}case U.EOF:{this._err(ue.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ue.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=q.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(_r(t))this._createEndTagToken(),this.state=q.TAG_NAME,this._stateTagName(t);else switch(t){case U.GREATER_THAN_SIGN:{this._err(ue.missingEndTagName),this.state=q.DATA;break}case U.EOF:{this._err(ue.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ue.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=q.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=q.BEFORE_ATTRIBUTE_NAME;break}case U.SOLIDUS:{this.state=q.SELF_CLOSING_START_TAG;break}case U.GREATER_THAN_SIGN:{this.state=q.DATA,this.emitCurrentTagToken();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.tagName+=At;break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Oa(t)?Xs(t):t)}}_stateRcdataLessThanSign(t){t===U.SOLIDUS?this.state=q.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=q.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){_r(t)?(this.state=q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=q.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=q.BEFORE_ATTRIBUTE_NAME,!1;case U.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=q.SELF_CLOSING_START_TAG,!1;case U.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=q.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===U.SOLIDUS?this.state=q.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=q.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){_r(t)?(this.state=q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=q.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=q.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case U.SOLIDUS:{this.state=q.SCRIPT_DATA_END_TAG_OPEN;break}case U.EXCLAMATION_MARK:{this.state=q.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=q.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){_r(t)?(this.state=q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===U.HYPHEN_MINUS?(this.state=q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===U.HYPHEN_MINUS?(this.state=q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=q.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case U.HYPHEN_MINUS:{this.state=q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(At);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case U.HYPHEN_MINUS:{this.state=q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case U.HYPHEN_MINUS:{this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.GREATER_THAN_SIGN:{this.state=q.SCRIPT_DATA,this._emitChars(">");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_ESCAPED,this._emitChars(At);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===U.SOLIDUS?this.state=q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:_r(t)?(this._emitChars("<"),this.state=q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){_r(t)?(this.state=q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(xn.SCRIPT,!1)&&Dm(this.preprocessor.peek(xn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<xn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case U.HYPHEN_MINUS:{this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(At);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case U.HYPHEN_MINUS:{this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case U.HYPHEN_MINUS:{this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.GREATER_THAN_SIGN:{this.state=q.SCRIPT_DATA,this._emitChars(">");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(At);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===U.SOLIDUS?(this.state=q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(xn.SCRIPT,!1)&&Dm(this.preprocessor.peek(xn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<xn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.SOLIDUS:case U.GREATER_THAN_SIGN:case U.EOF:{this.state=q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case U.EQUALS_SIGN:{this._err(ue.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=q.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=q.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:case U.SOLIDUS:case U.GREATER_THAN_SIGN:case U.EOF:{this._leaveAttrName(),this.state=q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case U.EQUALS_SIGN:{this._leaveAttrName(),this.state=q.BEFORE_ATTRIBUTE_VALUE;break}case U.QUOTATION_MARK:case U.APOSTROPHE:case U.LESS_THAN_SIGN:{this._err(ue.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.name+=At;break}default:this.currentAttr.name+=String.fromCodePoint(Oa(t)?Xs(t):t)}}_stateAfterAttributeName(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.SOLIDUS:{this.state=q.SELF_CLOSING_START_TAG;break}case U.EQUALS_SIGN:{this.state=q.BEFORE_ATTRIBUTE_VALUE;break}case U.GREATER_THAN_SIGN:{this.state=q.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=q.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{this.state=q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this.state=q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingAttributeValue),this.state=q.DATA,this.emitCurrentTagToken();break}default:this.state=q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case U.QUOTATION_MARK:{this.state=q.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.value+=At;break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case U.APOSTROPHE:{this.state=q.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.value+=At;break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this._leaveAttrValue(),this.state=q.BEFORE_ATTRIBUTE_NAME;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=q.DATA,this.emitCurrentTagToken();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.value+=At;break}case U.QUOTATION_MARK:case U.APOSTROPHE:case U.LESS_THAN_SIGN:case U.EQUALS_SIGN:case U.GRAVE_ACCENT:{this._err(ue.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this._leaveAttrValue(),this.state=q.BEFORE_ATTRIBUTE_NAME;break}case U.SOLIDUS:{this._leaveAttrValue(),this.state=q.SELF_CLOSING_START_TAG;break}case U.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=q.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this._err(ue.missingWhitespaceBetweenAttributes),this.state=q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case U.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=q.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this._err(ue.unexpectedSolidusInTag),this.state=q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case U.GREATER_THAN_SIGN:{this.state=q.DATA,this.emitCurrentComment(n);break}case U.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.data+=At;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(xn.DASH_DASH,!0)?(this._createCommentToken(xn.DASH_DASH.length+1),this.state=q.COMMENT_START):this._consumeSequenceIfMatch(xn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(xn.DOCTYPE.length+1),this.state=q.DOCTYPE):this._consumeSequenceIfMatch(xn.CDATA_START,!0)?this.inForeignNode?this.state=q.CDATA_SECTION:(this._err(ue.cdataInHtmlContent),this._createCommentToken(xn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ue.incorrectlyOpenedComment),this._createCommentToken(2),this.state=q.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case U.HYPHEN_MINUS:{this.state=q.COMMENT_START_DASH;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptClosingOfEmptyComment),this.state=q.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=q.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{this.state=q.COMMENT_END;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptClosingOfEmptyComment),this.state=q.DATA,this.emitCurrentComment(n);break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=q.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{this.state=q.COMMENT_END_DASH;break}case U.LESS_THAN_SIGN:{n.data+="<",this.state=q.COMMENT_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.data+=At;break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case U.EXCLAMATION_MARK:{n.data+="!",this.state=q.COMMENT_LESS_THAN_SIGN_BANG;break}case U.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=q.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===U.HYPHEN_MINUS?this.state=q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=q.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===U.HYPHEN_MINUS?this.state=q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=q.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==U.GREATER_THAN_SIGN&&t!==U.EOF&&this._err(ue.nestedComment),this.state=q.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{this.state=q.COMMENT_END;break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=q.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case U.GREATER_THAN_SIGN:{this.state=q.DATA,this.emitCurrentComment(n);break}case U.EXCLAMATION_MARK:{this.state=q.COMMENT_END_BANG;break}case U.HYPHEN_MINUS:{n.data+="-";break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=q.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{n.data+="--!",this.state=q.COMMENT_END_DASH;break}case U.GREATER_THAN_SIGN:{this._err(ue.incorrectlyClosedComment),this.state=q.DATA,this.emitCurrentComment(n);break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=q.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=q.BEFORE_DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this.state=q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case U.EOF:{this._err(ue.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingWhitespaceBeforeDoctypeName),this.state=q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Oa(t))this._createDoctypeToken(String.fromCharCode(Xs(t))),this.state=q.DOCTYPE_NAME;else switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.NULL:{this._err(ue.unexpectedNullCharacter),this._createDoctypeToken(At),this.state=q.DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.EOF:{this._err(ue.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=q.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=q.AFTER_DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this.state=q.DATA,this.emitCurrentDoctype(n);break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.name+=At;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Oa(t)?Xs(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.state=q.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(xn.PUBLIC,!1)?this.state=q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(xn.SYSTEM,!1)?this.state=q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ue.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.QUOTATION_MARK:{this._err(ue.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ue.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=q.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{n.publicId="",this.state=q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.publicId="",this.state=q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=q.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case U.QUOTATION_MARK:{this.state=q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.publicId+=At;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case U.APOSTROPHE:{this.state=q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.publicId+=At;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case U.GREATER_THAN_SIGN:{this.state=q.DATA,this.emitCurrentDoctype(n);break}case U.QUOTATION_MARK:{this._err(ue.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ue.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.QUOTATION_MARK:{n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.QUOTATION_MARK:{this._err(ue.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ue.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=q.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.systemId="",this.state=q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=q.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case U.QUOTATION_MARK:{this.state=q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.systemId+=At;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case U.APOSTROPHE:{this.state=q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.systemId+=At;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=q.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=q.DATA;break}case U.NULL:{this._err(ue.unexpectedNullCharacter);break}case U.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case U.RIGHT_SQUARE_BRACKET:{this.state=q.CDATA_SECTION_BRACKET;break}case U.EOF:{this._err(ue.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===U.RIGHT_SQUARE_BRACKET?this.state=q.CDATA_SECTION_END:(this._emitChars("]"),this.state=q.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case U.GREATER_THAN_SIGN:{this.state=q.DATA;break}case U.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=q.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(U.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Lm(this.preprocessor.peek(1))?q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Lm(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===U.SEMICOLON&&this._err(ue.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const $x=new Set([y.DD,y.DT,y.LI,y.OPTGROUP,y.OPTION,y.P,y.RB,y.RP,y.RT,y.RTC]),Pm=new Set([...$x,y.CAPTION,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]),Ho=new Set([y.APPLET,y.CAPTION,y.HTML,y.MARQUEE,y.OBJECT,y.TABLE,y.TD,y.TEMPLATE,y.TH]),aA=new Set([...Ho,y.OL,y.UL]),sA=new Set([...Ho,y.BUTTON]),Om=new Set([y.ANNOTATION_XML,y.MI,y.MN,y.MO,y.MS,y.MTEXT]),jm=new Set([y.DESC,y.FOREIGN_OBJECT,y.TITLE]),oA=new Set([y.TR,y.TEMPLATE,y.HTML]),lA=new Set([y.TBODY,y.TFOOT,y.THEAD,y.TEMPLATE,y.HTML]),uA=new Set([y.TABLE,y.TEMPLATE,y.HTML]),cA=new Set([y.TD,y.TH]);class dA{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=y.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===y.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===be.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==be.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(r0,be.HTML)}popUntilTableCellPopped(){this.popUntilPopped(cA,be.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(uA,be.HTML)}clearBackToTableBodyContext(){this.clearBackTo(lA,be.HTML)}clearBackToTableRowContext(){this.clearBackTo(oA,be.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===y.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===y.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case be.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case be.SVG:{if(jm.has(i))return!1;break}case be.MATHML:{if(Om.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ho)}hasInListItemScope(t){return this.hasInDynamicScope(t,aA)}hasInButtonScope(t){return this.hasInDynamicScope(t,sA)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case be.HTML:{if(r0.has(n))return!0;if(Ho.has(n))return!1;break}case be.SVG:{if(jm.has(n))return!1;break}case be.MATHML:{if(Om.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===be.HTML)switch(this.tagIDs[n]){case t:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===be.HTML)switch(this.tagIDs[t]){case y.TBODY:case y.THEAD:case y.TFOOT:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===be.HTML)switch(this.tagIDs[n]){case t:return!0;case y.OPTION:case y.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&$x.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Pm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Pm.has(this.currentTagId);)this.pop()}}const Du=3;var tr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(tr||(tr={}));const Bm={type:tr.Marker};class hA{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const l=this.entries[o];if(l.type===tr.Marker)break;const{element:u}=l;if(this.treeAdapter.getTagName(u)===a&&this.treeAdapter.getNamespaceURI(u)===s){const c=this.treeAdapter.getAttrList(u);c.length===i&&r.push({idx:o,attrs:c})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Du)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Du)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const o=r[s];o.attrs.every(l=>i.get(l.name)===l.value)&&(a+=1,a>=Du&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Bm)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:tr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:tr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Bm);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===tr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===tr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===tr.Element&&n.element===t)}}const Rr={createDocument(){return{nodeName:"#document",mode:Pn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Rr.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Rr.isTextNode(n)){n.value+=t;return}}Rr.appendChild(e,Rr.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Rr.isTextNode(r)?r.value+=t:Rr.insertBefore(e,Rr.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Wx="html",fA="about:legacy-compat",mA="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Gx=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],pA=[...Gx,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],gA=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Yx=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],xA=[...Yx,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Fm(e,t){return t.some(n=>e.startsWith(n))}function bA(e){return e.name===Wx&&e.publicId===null&&(e.systemId===null||e.systemId===fA)}function yA(e){if(e.name!==Wx)return Pn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===mA)return Pn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),gA.has(n))return Pn.QUIRKS;let r=t===null?pA:Gx;if(Fm(n,r))return Pn.QUIRKS;if(r=t===null?Yx:xA,Fm(n,r))return Pn.LIMITED_QUIRKS}return Pn.NO_QUIRKS}const zm={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},vA="definitionurl",wA="definitionURL",kA=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),EA=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:be.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:be.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:be.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:be.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:be.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:be.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:be.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:be.XML}],["xml:space",{prefix:"xml",name:"space",namespace:be.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:be.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:be.XMLNS}]]),TA=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),SA=new Set([y.B,y.BIG,y.BLOCKQUOTE,y.BODY,y.BR,y.CENTER,y.CODE,y.DD,y.DIV,y.DL,y.DT,y.EM,y.EMBED,y.H1,y.H2,y.H3,y.H4,y.H5,y.H6,y.HEAD,y.HR,y.I,y.IMG,y.LI,y.LISTING,y.MENU,y.META,y.NOBR,y.OL,y.P,y.PRE,y.RUBY,y.S,y.SMALL,y.SPAN,y.STRONG,y.STRIKE,y.SUB,y.SUP,y.TABLE,y.TT,y.U,y.UL,y.VAR]);function AA(e){const t=e.tagID;return t===y.FONT&&e.attrs.some(({name:r})=>r===xi.COLOR||r===xi.SIZE||r===xi.FACE)||SA.has(t)}function Kx(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===vA){e.attrs[t].name=wA;break}}function Xx(e){for(let t=0;t<e.attrs.length;t++){const n=kA.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Ld(e){for(let t=0;t<e.attrs.length;t++){const n=EA.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function CA(e){const t=TA.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=da(e.tagName))}function NA(e,t){return t===be.MATHML&&(e===y.MI||e===y.MO||e===y.MN||e===y.MS||e===y.MTEXT)}function MA(e,t,n){if(t===be.MATHML&&e===y.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===xi.ENCODING){const i=n[r].value.toLowerCase();return i===zm.TEXT_HTML||i===zm.APPLICATION_XML}}return t===be.SVG&&(e===y.FOREIGN_OBJECT||e===y.DESC||e===y.TITLE)}function IA(e,t,n,r){return(!r||r===be.HTML)&&MA(e,t,n)||(!r||r===be.MATHML)&&NA(e,t)}const _A="hidden",RA=8,LA=3;var G;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(G||(G={}));const DA={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Qx=new Set([y.TABLE,y.TBODY,y.TFOOT,y.THEAD,y.TR]),Hm={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Rr,onParseError:null};class Um{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=G.INITIAL,this.originalInsertionMode=G.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Hm,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new iA(this.options,this),this.activeFormattingElements=new hA(this.treeAdapter),this.fragmentContextID=r?da(this.treeAdapter.getTagName(r)):y.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new dA(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Hm,...n};t??(t=r.treeAdapter.createElement(se.TEMPLATE,be.HTML,[]));const i=r.treeAdapter.createElement("documentmock",be.HTML,[]),a=new this(r,i,t);return a.fragmentContextID===y.TEMPLATE&&a.tmplInsertionModeStack.unshift(G.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const a=(i=t.location)!==null&&i!==void 0?i:DA,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(t,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===be.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,be.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=G.TEXT}switchToPlaintextParsing(){this.insertionMode=G.TEXT,this.originalInsertionMode=G.IN_BODY,this.tokenizer.state=Ot.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===se.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==be.HTML))switch(this.fragmentContextID){case y.TITLE:case y.TEXTAREA:{this.tokenizer.state=Ot.RCDATA;break}case y.STYLE:case y.XMP:case y.IFRAME:case y.NOEMBED:case y.NOFRAMES:case y.NOSCRIPT:{this.tokenizer.state=Ot.RAWTEXT;break}case y.SCRIPT:{this.tokenizer.state=Ot.SCRIPT_DATA;break}case y.PLAINTEXT:{this.tokenizer.state=Ot.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,be.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,be.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(se.HTML,be.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,y.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:u,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),a=n.type===at.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===y.SVG&&this.treeAdapter.getTagName(n)===se.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===be.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===y.MGLYPH||t.tagID===y.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,be.HTML)}_processToken(t){switch(t.type){case at.CHARACTER:{this.onCharacter(t);break}case at.NULL_CHARACTER:{this.onNullCharacter(t);break}case at.COMMENT:{this.onComment(t);break}case at.DOCTYPE:{this.onDoctype(t);break}case at.START_TAG:{this._processStartTag(t);break}case at.END_TAG:{this.onEndTag(t);break}case at.EOF:{this.onEof(t);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return IA(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===tr.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=G.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(y.P),this.openElements.popUntilTagNamePopped(y.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case y.TR:{this.insertionMode=G.IN_ROW;return}case y.TBODY:case y.THEAD:case y.TFOOT:{this.insertionMode=G.IN_TABLE_BODY;return}case y.CAPTION:{this.insertionMode=G.IN_CAPTION;return}case y.COLGROUP:{this.insertionMode=G.IN_COLUMN_GROUP;return}case y.TABLE:{this.insertionMode=G.IN_TABLE;return}case y.BODY:{this.insertionMode=G.IN_BODY;return}case y.FRAMESET:{this.insertionMode=G.IN_FRAMESET;return}case y.SELECT:{this._resetInsertionModeForSelect(t);return}case y.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case y.HTML:{this.insertionMode=this.headElement?G.AFTER_HEAD:G.BEFORE_HEAD;return}case y.TD:case y.TH:{if(t>0){this.insertionMode=G.IN_CELL;return}break}case y.HEAD:{if(t>0){this.insertionMode=G.IN_HEAD;return}break}}this.insertionMode=G.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===y.TEMPLATE)break;if(r===y.TABLE){this.insertionMode=G.IN_SELECT_IN_TABLE;return}}this.insertionMode=G.IN_SELECT}_isElementCausesFosterParenting(t){return Qx.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case y.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===be.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case y.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return eA[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){cN(this,t);return}switch(this.insertionMode){case G.INITIAL:{Ca(this,t);break}case G.BEFORE_HTML:{$a(this,t);break}case G.BEFORE_HEAD:{Wa(this,t);break}case G.IN_HEAD:{Ga(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Ya(this,t);break}case G.AFTER_HEAD:{Ka(this,t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:{Jx(this,t);break}case G.TEXT:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{Pu(this,t);break}case G.IN_TABLE_TEXT:{ab(this,t);break}case G.IN_COLUMN_GROUP:{Uo(this,t);break}case G.AFTER_BODY:{Vo(this,t);break}case G.AFTER_AFTER_BODY:{go(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){uN(this,t);return}switch(this.insertionMode){case G.INITIAL:{Ca(this,t);break}case G.BEFORE_HTML:{$a(this,t);break}case G.BEFORE_HEAD:{Wa(this,t);break}case G.IN_HEAD:{Ga(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Ya(this,t);break}case G.AFTER_HEAD:{Ka(this,t);break}case G.TEXT:{this._insertCharacters(t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{Pu(this,t);break}case G.IN_COLUMN_GROUP:{Uo(this,t);break}case G.AFTER_BODY:{Vo(this,t);break}case G.AFTER_AFTER_BODY:{go(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){i0(this,t);return}switch(this.insertionMode){case G.INITIAL:case G.BEFORE_HTML:case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_TEMPLATE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{i0(this,t);break}case G.IN_TABLE_TEXT:{Na(this,t);break}case G.AFTER_BODY:{HA(this,t);break}case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{UA(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case G.INITIAL:{VA(this,t);break}case G.BEFORE_HEAD:case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:{this._err(t,ue.misplacedDoctype);break}case G.IN_TABLE_TEXT:{Na(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ue.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?dN(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{Ca(this,t);break}case G.BEFORE_HTML:{qA(this,t);break}case G.BEFORE_HEAD:{WA(this,t);break}case G.IN_HEAD:{Kn(this,t);break}case G.IN_HEAD_NO_SCRIPT:{KA(this,t);break}case G.AFTER_HEAD:{QA(this,t);break}case G.IN_BODY:{ln(this,t);break}case G.IN_TABLE:{ea(this,t);break}case G.IN_TABLE_TEXT:{Na(this,t);break}case G.IN_CAPTION:{GC(this,t);break}case G.IN_COLUMN_GROUP:{Od(this,t);break}case G.IN_TABLE_BODY:{Nl(this,t);break}case G.IN_ROW:{Ml(this,t);break}case G.IN_CELL:{XC(this,t);break}case G.IN_SELECT:{lb(this,t);break}case G.IN_SELECT_IN_TABLE:{ZC(this,t);break}case G.IN_TEMPLATE:{eN(this,t);break}case G.AFTER_BODY:{nN(this,t);break}case G.IN_FRAMESET:{rN(this,t);break}case G.AFTER_FRAMESET:{aN(this,t);break}case G.AFTER_AFTER_BODY:{oN(this,t);break}case G.AFTER_AFTER_FRAMESET:{lN(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?hN(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case G.INITIAL:{Ca(this,t);break}case G.BEFORE_HTML:{$A(this,t);break}case G.BEFORE_HEAD:{GA(this,t);break}case G.IN_HEAD:{YA(this,t);break}case G.IN_HEAD_NO_SCRIPT:{XA(this,t);break}case G.AFTER_HEAD:{ZA(this,t);break}case G.IN_BODY:{Cl(this,t);break}case G.TEXT:{jC(this,t);break}case G.IN_TABLE:{us(this,t);break}case G.IN_TABLE_TEXT:{Na(this,t);break}case G.IN_CAPTION:{YC(this,t);break}case G.IN_COLUMN_GROUP:{KC(this,t);break}case G.IN_TABLE_BODY:{a0(this,t);break}case G.IN_ROW:{ob(this,t);break}case G.IN_CELL:{QC(this,t);break}case G.IN_SELECT:{ub(this,t);break}case G.IN_SELECT_IN_TABLE:{JC(this,t);break}case G.IN_TEMPLATE:{tN(this,t);break}case G.AFTER_BODY:{db(this,t);break}case G.IN_FRAMESET:{iN(this,t);break}case G.AFTER_FRAMESET:{sN(this,t);break}case G.AFTER_AFTER_BODY:{go(this,t);break}}}onEof(t){switch(this.insertionMode){case G.INITIAL:{Ca(this,t);break}case G.BEFORE_HTML:{$a(this,t);break}case G.BEFORE_HEAD:{Wa(this,t);break}case G.IN_HEAD:{Ga(this,t);break}case G.IN_HEAD_NO_SCRIPT:{Ya(this,t);break}case G.AFTER_HEAD:{Ka(this,t);break}case G.IN_BODY:case G.IN_TABLE:case G.IN_CAPTION:case G.IN_COLUMN_GROUP:case G.IN_TABLE_BODY:case G.IN_ROW:case G.IN_CELL:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:{rb(this,t);break}case G.TEXT:{BC(this,t);break}case G.IN_TABLE_TEXT:{Na(this,t);break}case G.IN_TEMPLATE:{cb(this,t);break}case G.AFTER_BODY:case G.IN_FRAMESET:case G.AFTER_FRAMESET:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{Pd(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===U.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case G.IN_HEAD:case G.IN_HEAD_NO_SCRIPT:case G.AFTER_HEAD:case G.TEXT:case G.IN_COLUMN_GROUP:case G.IN_SELECT:case G.IN_SELECT_IN_TABLE:case G.IN_FRAMESET:case G.AFTER_FRAMESET:{this._insertCharacters(t);break}case G.IN_BODY:case G.IN_CAPTION:case G.IN_CELL:case G.IN_TEMPLATE:case G.AFTER_BODY:case G.AFTER_AFTER_BODY:case G.AFTER_AFTER_FRAMESET:{Zx(this,t);break}case G.IN_TABLE:case G.IN_TABLE_BODY:case G.IN_ROW:{Pu(this,t);break}case G.IN_TABLE_TEXT:{ib(this,t);break}}}}function PA(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):nb(e,t),n}function OA(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function jA(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,s=i;s!==n;a++,s=i){i=e.openElements.getCommonAncestor(s);const o=e.activeFormattingElements.getElementEntry(s),l=o&&a>=LA;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(s)):(s=BA(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function BA(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function FA(e,t,n){const r=e.treeAdapter.getTagName(t),i=da(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===y.TEMPLATE&&a===be.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function zA(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Dd(e,t){for(let n=0;n<RA;n++){const r=PA(e,t);if(!r)break;const i=OA(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=jA(e,i,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&FA(e,s,a),zA(e,i,r)}}function i0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function HA(e,t){e._appendCommentNode(t,e.openElements.items[0])}function UA(e,t){e._appendCommentNode(t,e.document)}function Pd(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function VA(e,t){e._setDocumentType(t);const n=t.forceQuirks?Pn.QUIRKS:yA(t);bA(t)||e._err(t,ue.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=G.BEFORE_HTML}function Ca(e,t){e._err(t,ue.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Pn.QUIRKS),e.insertionMode=G.BEFORE_HTML,e._processToken(t)}function qA(e,t){t.tagID===y.HTML?(e._insertElement(t,be.HTML),e.insertionMode=G.BEFORE_HEAD):$a(e,t)}function $A(e,t){const n=t.tagID;(n===y.HTML||n===y.HEAD||n===y.BODY||n===y.BR)&&$a(e,t)}function $a(e,t){e._insertFakeRootElement(),e.insertionMode=G.BEFORE_HEAD,e._processToken(t)}function WA(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.HEAD:{e._insertElement(t,be.HTML),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD;break}default:Wa(e,t)}}function GA(e,t){const n=t.tagID;n===y.HEAD||n===y.BODY||n===y.HTML||n===y.BR?Wa(e,t):e._err(t,ue.endTagWithoutMatchingOpenElement)}function Wa(e,t){e._insertFakeElement(se.HEAD,y.HEAD),e.headElement=e.openElements.current,e.insertionMode=G.IN_HEAD,e._processToken(t)}function Kn(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.TITLE:{e._switchToTextParsing(t,Ot.RCDATA);break}case y.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ot.RAWTEXT):(e._insertElement(t,be.HTML),e.insertionMode=G.IN_HEAD_NO_SCRIPT);break}case y.NOFRAMES:case y.STYLE:{e._switchToTextParsing(t,Ot.RAWTEXT);break}case y.SCRIPT:{e._switchToTextParsing(t,Ot.SCRIPT_DATA);break}case y.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=G.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(G.IN_TEMPLATE);break}case y.HEAD:{e._err(t,ue.misplacedStartTagForHeadElement);break}default:Ga(e,t)}}function YA(e,t){switch(t.tagID){case y.HEAD:{e.openElements.pop(),e.insertionMode=G.AFTER_HEAD;break}case y.BODY:case y.BR:case y.HTML:{Ga(e,t);break}case y.TEMPLATE:{Ni(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function Ni(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==y.TEMPLATE&&e._err(t,ue.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ue.endTagWithoutMatchingOpenElement)}function Ga(e,t){e.openElements.pop(),e.insertionMode=G.AFTER_HEAD,e._processToken(t)}function KA(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.BASEFONT:case y.BGSOUND:case y.HEAD:case y.LINK:case y.META:case y.NOFRAMES:case y.STYLE:{Kn(e,t);break}case y.NOSCRIPT:{e._err(t,ue.nestedNoscriptInHead);break}default:Ya(e,t)}}function XA(e,t){switch(t.tagID){case y.NOSCRIPT:{e.openElements.pop(),e.insertionMode=G.IN_HEAD;break}case y.BR:{Ya(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function Ya(e,t){const n=t.type===at.EOF?ue.openElementsLeftAfterEof:ue.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=G.IN_HEAD,e._processToken(t)}function QA(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.BODY:{e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=G.IN_BODY;break}case y.FRAMESET:{e._insertElement(t,be.HTML),e.insertionMode=G.IN_FRAMESET;break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{e._err(t,ue.abandonedHeadElementChild),e.openElements.push(e.headElement,y.HEAD),Kn(e,t),e.openElements.remove(e.headElement);break}case y.HEAD:{e._err(t,ue.misplacedStartTagForHeadElement);break}default:Ka(e,t)}}function ZA(e,t){switch(t.tagID){case y.BODY:case y.HTML:case y.BR:{Ka(e,t);break}case y.TEMPLATE:{Ni(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function Ka(e,t){e._insertFakeElement(se.BODY,y.BODY),e.insertionMode=G.IN_BODY,Al(e,t)}function Al(e,t){switch(t.type){case at.CHARACTER:{Jx(e,t);break}case at.WHITESPACE_CHARACTER:{Zx(e,t);break}case at.COMMENT:{i0(e,t);break}case at.START_TAG:{ln(e,t);break}case at.END_TAG:{Cl(e,t);break}case at.EOF:{rb(e,t);break}}}function Zx(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Jx(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function JA(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function eC(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function tC(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,be.HTML),e.insertionMode=G.IN_FRAMESET)}function nC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function rC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&r0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,be.HTML)}function iC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function aC(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),n||(e.formElement=e.openElements.current))}function sC(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===y.LI&&i===y.LI||(n===y.DD||n===y.DT)&&(i===y.DD||i===y.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==y.ADDRESS&&i!==y.DIV&&i!==y.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function oC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.tokenizer.state=Ot.PLAINTEXT}function lC(e,t){e.openElements.hasInScope(y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1}function uC(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(se.A);n&&(Dd(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cC(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function dC(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(y.NOBR)&&(Dd(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function hC(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function fC(e,t){e.treeAdapter.getDocumentMode(e.document)!==Pn.QUIRKS&&e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=G.IN_TABLE}function eb(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function tb(e){const t=Vx(e,xi.TYPE);return t!=null&&t.toLowerCase()===_A}function mC(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),tb(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function pC(e,t){e._appendElement(t,be.HTML),t.ackSelfClosing=!0}function gC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function xC(e,t){t.tagName=se.IMG,t.tagID=y.IMG,eb(e,t)}function bC(e,t){e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ot.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=G.TEXT}function yC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ot.RAWTEXT)}function vC(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ot.RAWTEXT)}function Vm(e,t){e._switchToTextParsing(t,Ot.RAWTEXT)}function wC(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===G.IN_TABLE||e.insertionMode===G.IN_CAPTION||e.insertionMode===G.IN_TABLE_BODY||e.insertionMode===G.IN_ROW||e.insertionMode===G.IN_CELL?G.IN_SELECT_IN_TABLE:G.IN_SELECT}function kC(e,t){e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function EC(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,be.HTML)}function TC(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(y.RTC),e._insertElement(t,be.HTML)}function SC(e,t){e._reconstructActiveFormattingElements(),Kx(t),Ld(t),t.selfClosing?e._appendElement(t,be.MATHML):e._insertElement(t,be.MATHML),t.ackSelfClosing=!0}function AC(e,t){e._reconstructActiveFormattingElements(),Xx(t),Ld(t),t.selfClosing?e._appendElement(t,be.SVG):e._insertElement(t,be.SVG),t.ackSelfClosing=!0}function qm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function ln(e,t){switch(t.tagID){case y.I:case y.S:case y.B:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.SMALL:case y.STRIKE:case y.STRONG:{cC(e,t);break}case y.A:{uC(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{rC(e,t);break}case y.P:case y.DL:case y.OL:case y.UL:case y.DIV:case y.DIR:case y.NAV:case y.MAIN:case y.MENU:case y.ASIDE:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.DETAILS:case y.ADDRESS:case y.ARTICLE:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{nC(e,t);break}case y.LI:case y.DD:case y.DT:{sC(e,t);break}case y.BR:case y.IMG:case y.WBR:case y.AREA:case y.EMBED:case y.KEYGEN:{eb(e,t);break}case y.HR:{gC(e,t);break}case y.RB:case y.RTC:{EC(e,t);break}case y.RT:case y.RP:{TC(e,t);break}case y.PRE:case y.LISTING:{iC(e,t);break}case y.XMP:{yC(e,t);break}case y.SVG:{AC(e,t);break}case y.HTML:{JA(e,t);break}case y.BASE:case y.LINK:case y.META:case y.STYLE:case y.TITLE:case y.SCRIPT:case y.BGSOUND:case y.BASEFONT:case y.TEMPLATE:{Kn(e,t);break}case y.BODY:{eC(e,t);break}case y.FORM:{aC(e,t);break}case y.NOBR:{dC(e,t);break}case y.MATH:{SC(e,t);break}case y.TABLE:{fC(e,t);break}case y.INPUT:{mC(e,t);break}case y.PARAM:case y.TRACK:case y.SOURCE:{pC(e,t);break}case y.IMAGE:{xC(e,t);break}case y.BUTTON:{lC(e,t);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{hC(e,t);break}case y.IFRAME:{vC(e,t);break}case y.SELECT:{wC(e,t);break}case y.OPTION:case y.OPTGROUP:{kC(e,t);break}case y.NOEMBED:case y.NOFRAMES:{Vm(e,t);break}case y.FRAMESET:{tC(e,t);break}case y.TEXTAREA:{bC(e,t);break}case y.NOSCRIPT:{e.options.scriptingEnabled?Vm(e,t):qm(e,t);break}case y.PLAINTEXT:{oC(e,t);break}case y.COL:case y.TH:case y.TD:case y.TR:case y.HEAD:case y.FRAME:case y.TBODY:case y.TFOOT:case y.THEAD:case y.CAPTION:case y.COLGROUP:break;default:qm(e,t)}}function CC(e,t){if(e.openElements.hasInScope(y.BODY)&&(e.insertionMode=G.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function NC(e,t){e.openElements.hasInScope(y.BODY)&&(e.insertionMode=G.AFTER_BODY,db(e,t))}function MC(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function IC(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(y.FORM):n&&e.openElements.remove(n))}function _C(e){e.openElements.hasInButtonScope(y.P)||e._insertFakeElement(se.P,y.P),e._closePElement()}function RC(e){e.openElements.hasInListItemScope(y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(y.LI),e.openElements.popUntilTagNamePopped(y.LI))}function LC(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function DC(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function PC(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function OC(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(se.BR,y.BR),e.openElements.pop(),e.framesetOk=!1}function nb(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==y.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,s))break}}function Cl(e,t){switch(t.tagID){case y.A:case y.B:case y.I:case y.S:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.NOBR:case y.SMALL:case y.STRIKE:case y.STRONG:{Dd(e,t);break}case y.P:{_C(e);break}case y.DL:case y.UL:case y.OL:case y.DIR:case y.DIV:case y.NAV:case y.PRE:case y.MAIN:case y.MENU:case y.ASIDE:case y.BUTTON:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.ADDRESS:case y.ARTICLE:case y.DETAILS:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.LISTING:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{MC(e,t);break}case y.LI:{RC(e);break}case y.DD:case y.DT:{LC(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{DC(e);break}case y.BR:{OC(e);break}case y.BODY:{CC(e,t);break}case y.HTML:{NC(e,t);break}case y.FORM:{IC(e);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{PC(e,t);break}case y.TEMPLATE:{Ni(e,t);break}default:nb(e,t)}}function rb(e,t){e.tmplInsertionModeStack.length>0?cb(e,t):Pd(e,t)}function jC(e,t){var n;t.tagID===y.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function BC(e,t){e._err(t,ue.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Pu(e,t){if(e.openElements.currentTagId!==void 0&&Qx.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=G.IN_TABLE_TEXT,t.type){case at.CHARACTER:{ab(e,t);break}case at.WHITESPACE_CHARACTER:{ib(e,t);break}}else Ss(e,t)}function FC(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,be.HTML),e.insertionMode=G.IN_CAPTION}function zC(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=G.IN_COLUMN_GROUP}function HC(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.COLGROUP,y.COLGROUP),e.insertionMode=G.IN_COLUMN_GROUP,Od(e,t)}function UC(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=G.IN_TABLE_BODY}function VC(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.TBODY,y.TBODY),e.insertionMode=G.IN_TABLE_BODY,Nl(e,t)}function qC(e,t){e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function $C(e,t){tb(t)?e._appendElement(t,be.HTML):Ss(e,t),t.ackSelfClosing=!0}function WC(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,be.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ea(e,t){switch(t.tagID){case y.TD:case y.TH:case y.TR:{VC(e,t);break}case y.STYLE:case y.SCRIPT:case y.TEMPLATE:{Kn(e,t);break}case y.COL:{HC(e,t);break}case y.FORM:{WC(e,t);break}case y.TABLE:{qC(e,t);break}case y.TBODY:case y.TFOOT:case y.THEAD:{UC(e,t);break}case y.INPUT:{$C(e,t);break}case y.CAPTION:{FC(e,t);break}case y.COLGROUP:{zC(e,t);break}default:Ss(e,t)}}function us(e,t){switch(t.tagID){case y.TABLE:{e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode());break}case y.TEMPLATE:{Ni(e,t);break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:Ss(e,t)}}function Ss(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Al(e,t),e.fosterParentingEnabled=n}function ib(e,t){e.pendingCharacterTokens.push(t)}function ab(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Na(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ss(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const sb=new Set([y.CAPTION,y.COL,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]);function GC(e,t){const n=t.tagID;sb.has(n)?e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,ea(e,t)):ln(e,t)}function YC(e,t){const n=t.tagID;switch(n){case y.CAPTION:case y.TABLE:{e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_TABLE,n===y.TABLE&&us(e,t));break}case y.BODY:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:Cl(e,t)}}function Od(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.COL:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.TEMPLATE:{Kn(e,t);break}default:Uo(e,t)}}function KC(e,t){switch(t.tagID){case y.COLGROUP:{e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case y.TEMPLATE:{Ni(e,t);break}case y.COL:break;default:Uo(e,t)}}function Uo(e,t){e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=G.IN_TABLE,e._processToken(t))}function Nl(e,t){switch(t.tagID){case y.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,be.HTML),e.insertionMode=G.IN_ROW;break}case y.TH:case y.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(se.TR,y.TR),e.insertionMode=G.IN_ROW,Ml(e,t);break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,ea(e,t));break}default:ea(e,t)}}function a0(e,t){const n=t.tagID;switch(t.tagID){case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE);break}case y.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE,us(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:case y.TR:break;default:us(e,t)}}function Ml(e,t){switch(t.tagID){case y.TH:case y.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,be.HTML),e.insertionMode=G.IN_CELL,e.activeFormattingElements.insertMarker();break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,Nl(e,t));break}default:ea(e,t)}}function ob(e,t){switch(t.tagID){case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY);break}case y.TABLE:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,a0(e,t));break}case y.TBODY:case y.TFOOT:case y.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=G.IN_TABLE_BODY,a0(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:break;default:us(e,t)}}function XC(e,t){const n=t.tagID;sb.has(n)?(e.openElements.hasInTableScope(y.TD)||e.openElements.hasInTableScope(y.TH))&&(e._closeTableCell(),Ml(e,t)):ln(e,t)}function QC(e,t){const n=t.tagID;switch(n){case y.TD:case y.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=G.IN_ROW);break}case y.TABLE:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),ob(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:break;default:Cl(e,t)}}function lb(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case y.OPTGROUP:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case y.HR:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.INPUT:case y.KEYGEN:case y.TEXTAREA:case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),t.tagID!==y.SELECT&&e._processStartTag(t));break}case y.SCRIPT:case y.TEMPLATE:{Kn(e,t);break}}}function ub(e,t){switch(t.tagID){case y.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===y.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===y.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop();break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop();break}case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode());break}case y.TEMPLATE:{Ni(e,t);break}}}function ZC(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e._processStartTag(t)):lb(e,t)}function JC(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ub(e,t)}function eN(e,t){switch(t.tagID){case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{Kn(e,t);break}case y.CAPTION:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.tmplInsertionModeStack[0]=G.IN_TABLE,e.insertionMode=G.IN_TABLE,ea(e,t);break}case y.COL:{e.tmplInsertionModeStack[0]=G.IN_COLUMN_GROUP,e.insertionMode=G.IN_COLUMN_GROUP,Od(e,t);break}case y.TR:{e.tmplInsertionModeStack[0]=G.IN_TABLE_BODY,e.insertionMode=G.IN_TABLE_BODY,Nl(e,t);break}case y.TD:case y.TH:{e.tmplInsertionModeStack[0]=G.IN_ROW,e.insertionMode=G.IN_ROW,Ml(e,t);break}default:e.tmplInsertionModeStack[0]=G.IN_BODY,e.insertionMode=G.IN_BODY,ln(e,t)}}function tN(e,t){t.tagID===y.TEMPLATE&&Ni(e,t)}function cb(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Pd(e,t)}function nN(e,t){t.tagID===y.HTML?ln(e,t):Vo(e,t)}function db(e,t){var n;if(t.tagID===y.HTML){if(e.fragmentContext||(e.insertionMode=G.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===y.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Vo(e,t)}function Vo(e,t){e.insertionMode=G.IN_BODY,Al(e,t)}function rN(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.FRAMESET:{e._insertElement(t,be.HTML);break}case y.FRAME:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.NOFRAMES:{Kn(e,t);break}}}function iN(e,t){t.tagID===y.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==y.FRAMESET&&(e.insertionMode=G.AFTER_FRAMESET))}function aN(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.NOFRAMES:{Kn(e,t);break}}}function sN(e,t){t.tagID===y.HTML&&(e.insertionMode=G.AFTER_AFTER_FRAMESET)}function oN(e,t){t.tagID===y.HTML?ln(e,t):go(e,t)}function go(e,t){e.insertionMode=G.IN_BODY,Al(e,t)}function lN(e,t){switch(t.tagID){case y.HTML:{ln(e,t);break}case y.NOFRAMES:{Kn(e,t);break}}}function uN(e,t){t.chars=At,e._insertCharacters(t)}function cN(e,t){e._insertCharacters(t),e.framesetOk=!1}function hb(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==be.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function dN(e,t){if(AA(t))hb(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===be.MATHML?Kx(t):r===be.SVG&&(CA(t),Xx(t)),Ld(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function hN(e,t){if(t.tagID===y.P||t.tagID===y.BR){hb(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===be.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}se.AREA,se.BASE,se.BASEFONT,se.BGSOUND,se.BR,se.COL,se.EMBED,se.FRAME,se.HR,se.IMG,se.INPUT,se.KEYGEN,se.LINK,se.META,se.PARAM,se.SOURCE,se.TRACK,se.WBR;const fN=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,mN=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),$m={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function fb(e,t){const n=TN(e),r=s2("type",{handlers:{root:pN,element:gN,text:xN,comment:pb,doctype:bN,raw:vN},unknown:wN}),i={parser:n?new Um($m):Um.getFragmentParser(void 0,$m),handle(o){r(o,i)},stitches:!1,options:t||{}};r(e,i),ha(i,ur());const a=n?i.parser.document:i.parser.getFragment(),s=SS(a,{file:i.options.file});return i.stitches&&fl(s,"comment",function(o,l,u){const c=o;if(c.value.stitch&&u&&l!==void 0){const h=u.children;return h[l]=c.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function mb(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function pN(e,t){mb(e.children,t)}function gN(e,t){kN(e,t),mb(e.children,t),EN(e,t)}function xN(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:at.CHARACTER,chars:e.value,location:As(e)};ha(t,ur(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function bN(e,t){const n={type:at.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:As(e)};ha(t,ur(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function yN(e,t){t.stitches=!0;const n=SN(e);if("children"in e&&"children"in n){const r=fb({type:"root",children:e.children},t.options);n.children=r.children}pb({type:"comment",value:{stitch:n}},t)}function pb(e,t){const n=e.value,r={type:at.COMMENT,data:n,location:As(e)};ha(t,ur(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function vN(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,gb(t,ur(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(fN,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function wN(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))yN(n,t);else{let r="";throw mN.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function ha(e,t){gb(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ot.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function gb(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function kN(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ot.PLAINTEXT)return;ha(t,ur(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ir.html;i===ir.html&&n==="svg"&&(i=ir.svg);const a=IS({...e,children:[]},{space:i===ir.svg?"svg":"html"}),s={type:at.START_TAG,tagName:n,tagID:da(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:As(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function EN(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&BS.includes(n)||t.parser.tokenizer.state===Ot.PLAINTEXT)return;ha(t,ll(e));const r={type:at.END_TAG,tagName:n,tagID:da(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:As(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ot.RCDATA||t.parser.tokenizer.state===Ot.RAWTEXT||t.parser.tokenizer.state===Ot.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ot.DATA)}function TN(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function As(e){const t=ur(e)||{line:void 0,column:void 0,offset:void 0},n=ll(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function SN(e){return"children"in e?Ti({...e,children:[]}):Ti(e)}function xb(e){return function(t,n){return fb(t,{...e,file:n})}}const ii=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Xa={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...ii,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...ii],h2:[["className","sr-only"]],img:[...ii,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...ii,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...ii],table:[...ii],ul:[...ii,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Dr={}.hasOwnProperty;function AN(e,t){let n={type:"root",children:[]};const r={schema:t?{...Xa,...t}:Xa,stack:[]},i=bb(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function bb(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return CN(e,n);case"doctype":return NN(e,n);case"element":return MN(e,n);case"root":return IN(e,n);case"text":return _N(e,n)}}}function CN(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Cs(a,t),a}}function NN(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Cs(n,t),n}}function MN(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=yb(e,t.children),i=RN(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Dr.call(e.schema.ancestors,n))){const o=e.schema.ancestors[n];let l=-1;for(a=!1;++l<o.length;)e.stack.includes(o[l])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const s={type:"element",tagName:n,properties:i,children:r};return Cs(s,t),s}function IN(e,t){const r={type:"root",children:yb(e,t.children)};return Cs(r,t),r}function _N(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Cs(r,t),r}function yb(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=bb(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function RN(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Dr.call(r,n)?r[n]:void 0,s=r&&Dr.call(r,"*")?r["*"]:void 0,o=t&&typeof t=="object"?t:{},l={};let u;for(u in o)if(Dr.call(o,u)){const c=o[u];let h=Wm(e,Gm(a,u),u,c);h==null&&(h=Wm(e,Gm(s,u),u,c)),h!=null&&(l[u]=h)}if(i&&Dr.call(i,n)){const c=i[n];for(u in c)Dr.call(c,u)&&!Dr.call(l,u)&&(l[u]=c[u])}return l}function Wm(e,t,n,r){return t?Array.isArray(r)?LN(e,t,n,r):vb(e,t,n,r):void 0}function LN(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const s=vb(e,t,n,r[i]);(typeof s=="number"||typeof s=="string")&&a.push(s)}return a}function vb(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&DN(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const s=t[a];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){i=!0;break}}else if(s===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function DN(e,t,n){const r=e.schema.protocols&&Dr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),s=i.indexOf("?"),o=i.indexOf("#"),l=i.indexOf("/");if(a<0||l>-1&&a>l||s>-1&&a>s||o>-1&&a>o)return!0;let u=-1;for(;++u<r.length;){const c=r[u];if(a===c.length&&i.slice(0,c.length)===c)return!0}return!1}function Cs(e,t){const n=Cg(t);t.data&&(e.data=Ti(t.data)),n&&(e.position=n)}function Gm(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function wb(e){return function(t){return AN(t,e)}}var U1;const kb={...Xa,protocols:{...Xa.protocols,src:[...((U1=Xa.protocols)==null?void 0:U1.src)??["http","https","mailto"],"data"]}};function PN({retry:e}){const t=$e();return f.jsxs("div",{className:"text-body text-warning p-4 flex items-start gap-2",children:[f.jsx(wr,{className:"w-4 h-4 shrink-0 mt-0.5"}),f.jsxs("span",{children:[t("error.renderFailed")," ",f.jsx("button",{className:"underline ml-1",onClick:e,children:t("error.retry")})]})]})}class ON extends w.Component{constructor(){super(...arguments);Hl(this,"state",{error:null});Hl(this,"retry",()=>this.setState({error:null}))}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary caught]",n,r.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.retry):f.jsx(PN,{error:this.state.error,retry:this.retry}):this.props.children}}function jN({nodeId:e,onRated:t}){const n=$e(),[r,i]=w.useState(!1),[a,s]=w.useState(!1),o=async l=>{if(!(r||a)){i(!0);try{await ie.recordReview(e,l),s(!0),t==null||t(),fi(l>=4?"correct":"wrong")}catch{}finally{i(!1)}}};return a?f.jsx("div",{className:"text-center text-body text-brand py-2","data-testid":"self-rated",children:n("review.selfrated")}):f.jsxs("div",{className:"border-t border-[var(--border-faint)] pt-3 mt-3","data-testid":"self-rating",children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2 text-center",children:n("review.selfrate.title")}),f.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[f.jsxs("button",{onClick:()=>o(1),disabled:r,"data-testid":"rate-again",className:"py-2 rounded-lg border border-warning/40 text-warning hover:bg-warning/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[f.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.again")}),f.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.again.hint")})]}),f.jsxs("button",{onClick:()=>o(4),disabled:r,"data-testid":"rate-remembered",className:"py-2 rounded-lg border border-accent/40 text-accent hover:bg-accent/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[f.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.remembered")}),f.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.remembered.hint")})]}),f.jsxs("button",{onClick:()=>o(5),disabled:r,"data-testid":"rate-mastered",className:"py-2 rounded-lg border border-brand/40 text-brand hover:bg-brand/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[f.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.mastered")}),f.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.mastered.hint")})]})]})]})}function cs(e,t,n){const r=[];let i="";const a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(o){const l=o.parentElement;if(!l)return NodeFilter.FILTER_REJECT;const u=l.tagName;return u==="SCRIPT"||u==="STYLE"||l.closest(".katex-html")||l.closest(".katex-mathml")&&!l.closest("annotation")||!(n!=null&&n.includeMarks)&&l.closest("mark.lookatstudy-underline")||t&&!l.closest(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let s;for(;s=a.nextNode();){const o=s,l=o.textContent??"",u=i.length;i+=l,r.push({node:o,start:u,end:i.length})}return{text:i,nodes:r}}function Eb(e,t){const n=Ym(e.startContainer,e.startOffset,t,"start"),r=Ym(e.endContainer,e.endOffset,t,"end");return n==null||r==null||r<=n?null:{start:n,end:r}}function Ym(e,t,n,r){var i,a,s;if(e.nodeType===Node.TEXT_NODE){for(const o of n.nodes)if(o.node===e)return o.start+Math.min(t,((i=o.node.textContent)==null?void 0:i.length)??0);return r==="start"?((a=n.nodes[0])==null?void 0:a.start)??null:((s=n.nodes[n.nodes.length-1])==null?void 0:s.end)??null}if(e instanceof Element){const o=Array.from(e.childNodes);if(r==="end"){for(let u=t;u<o.length;u++){const c=Tb(o[u],n);if(c!=null)return c}const l=n.nodes[n.nodes.length-1];return l?l.end:null}else{for(let u=t;u>=0;u--){const c=Sb(o[u],n);if(c!=null)return c}const l=n.nodes[0];return l?l.start:null}}return null}function Tb(e,t){if(e.nodeType===Node.TEXT_NODE){for(const n of t.nodes)if(n.node===e)return n.start;return null}if(e instanceof Element)for(const n of e.childNodes){const r=Tb(n,t);if(r!=null)return r}return null}function Sb(e,t){if(e.nodeType===Node.TEXT_NODE){for(const n of t.nodes)if(n.node===e)return n.end;return null}if(e instanceof Element){let n=null;for(const r of e.childNodes){const i=Sb(r,t);i!=null&&(n=i)}return n}return null}function Ab(e,t,n){var o,l,u,c;if(n<=t)return null;let r=null,i=0,a=null,s=0;for(const h of e.nodes)if(!r&&t>=h.start&&t<h.end&&(r=h.node,i=t-h.start),!a&&n>h.start&&n<=h.end&&(a=h.node,s=n-h.start),r&&a)break;if(!r&&e.nodes.length>0){const h=e.nodes[e.nodes.length-1];r=h.node,i=((o=h.node.textContent)==null?void 0:o.length)??0}if(!a&&e.nodes.length>0){const h=e.nodes[e.nodes.length-1];a=h.node,s=((l=h.node.textContent)==null?void 0:l.length)??0}if(!r||!a)return null;try{const h=document.createRange();return h.setStart(r,Math.min(i,((u=r.textContent)==null?void 0:u.length)??0)),h.setEnd(a,Math.min(s,((c=a.textContent)==null?void 0:c.length)??0)),h}catch{return null}}function Cb(e,t){e.querySelectorAll("mark.lookatstudy-underline").forEach(a=>{const s=a.parentNode;if(s){for(;a.firstChild;)s.insertBefore(a.firstChild,a);s.removeChild(a)}}),e.normalize();const n=new Map;if(t.length===0)return n;const r=cs(e),i=[];for(const a of t){const s=BN(r.text,a.text,a.surrounding);s>=0&&i.push({noteId:a.noteId,start:s,end:s+a.text.length})}i.sort((a,s)=>s.start-a.start);for(const a of i){const s=Ab(r,a.start,a.end);if(!s)continue;const o=FN(s,a.noteId);o&&n.set(a.noteId,o)}return n}function BN(e,t,n){if(!t)return-1;let r=e.indexOf(t);if(r<0){const i=t.replace(/\s+/g," ").trim();if(r=e.replace(/\s+/g," ").indexOf(i),r<0)return-1;const s=t.slice(0,Math.min(15,t.length));return e.indexOf(s)}if(n&&n.length>5){const i=e.indexOf(n.slice(0,20));if(i>=0){let a=r,s=Math.abs(r-i),o=r+1;for(;;){const l=e.indexOf(t,o);if(l<0)break;const u=Math.abs(l-i);u<s&&(a=l,s=u),o=l+1}return a}}return r}function FN(e,t){const n="color: inherit; background: transparent; border-bottom: 2px solid rgb(34, 197, 94); padding-bottom: 1px;",r=document.createElement("mark");return r.className="lookatstudy-underline",r.dataset.noteId=t,r.style.cssText=n,Nb(e,r)}function Nb(e,t){var n;if(e.startContainer===e.endContainer&&e.startContainer.nodeType===Node.TEXT_NODE)try{return e.surroundContents(t),t}catch{}try{const r=[],i=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode(o){return e.intersectsNode(o)&&(o===e.startContainer||o===e.endContainer||e.intersectsNode(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let a;for(;a=i.nextNode();)r.push(a);if(r.length===0)return null;let s=null;for(const o of r){let l=o;if(o===e.startContainer&&e.startOffset>0&&(l=o.splitText(e.startOffset)),o===e.endContainer||l===e.endContainer){const c=l===e.endContainer?e.endOffset:e.endOffset-(o===e.startContainer?e.startOffset:0);c<l.textContent.length&&l.splitText(c)}if(!l.textContent)continue;const u=s?t.cloneNode(!1):t;(n=l.parentNode)==null||n.insertBefore(u,l),u.appendChild(l),s||(s=u)}return s}catch{return null}}const Mb="cp-reading-mark",Ib="cp-reading";function bi(e){var n;const t=CSS;try{(n=t.highlights)==null||n.delete(Ib)}catch{}jd=null,e.querySelectorAll(`.${Mb}`).forEach(r=>{const i=r.parentNode;if(i){for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}}),e.normalize()}const zN=/[0-9A-Za-z\u00C0-\u024F\u0370-\u03FF\u0400-\u04FF\u4E00-\u9FFF\u3040-\u30FF\uAC00-\uD7AF]/,HN=`「『(([【<《"'“‘`,UN=`。』」))]】>》"'”’!!??…,,、;;::`;function _b(e){const t=e.codePointAt(0);let n=e;return t>=65281&&t<=65374&&(n=String.fromCharCode(t-65248)),zN.test(n)?n.toLowerCase():null}function VN(e){let t="";const n=[];for(let r=0;r<e.length;r++){const i=_b(e[r]);i!==null&&(t+=i,n.push(r))}return{canon:t,map:n}}function qN(e,t){if(t<=0)return 0;let n=0,r=e.length;for(;n<r;){const i=n+r>>1;e[i]<t?n=i+1:r=i}return n}function Km(e,t,n){const{canon:r,map:i}=VN(e),a=t.trim().split(/\s+/).map(p=>[...p].map(_b).filter(Boolean).join("")).filter(p=>p.length>0);if(a.length===0||r.length===0){const p=t.trim();if(!p)return null;const g=e.indexOf(p,Math.max(0,n));return g>=0?{start:g,end:g+p.length}:null}const s=qN(i,Math.max(0,n)),o=a.join("");let l=-1,u=-1;const c=r.indexOf(o,s);if(c>=0)l=c,u=c+o.length-1;else{let p=s;for(const g of a){const x=r.indexOf(g,p);if(x<0)return null;l<0&&(l=x),u=x+g.length-1,p=u+1}if(l<0||u-l+1>o.length*3+40)return null}if(u>=i.length||l<0)return null;let h=i[l],m=i[u]+1;const d=n>0?n:0;for(let p=0;p<3&&h-1>=d&&HN.includes(e[h-1]);p++)h--;for(let p=0;p<4&&m<e.length&&UN.includes(e[m]);p++)m++;return{start:h,end:m}}const s0=new WeakMap;function Rb(e){s0.delete(e)}function Lb(e,t,n){bi(e);const r=t.trim();if(!r)return null;const i=cs(e,n==null?void 0:n.within,{includeMarks:!0}),a=s0.get(e)??0;let s=Km(i.text,r,a);if(!s&&a>0&&(s=Km(i.text,r,0)),!s)return null;s0.set(e,s.end);const o=Ab(i,s.start,s.end);if(!o)return null;const l=CSS;if(typeof Highlight<"u"&&l.highlights)try{return l.highlights.set(Ib,new Highlight(o)),jd=o,o}catch{}const u=document.createElement("span");return u.className=Mb,Nb(o,u)?o:null}let jd=null;function $N(){return jd}function Db(e,t){var s,o,l;const n=e.getClientRects(),r=n.length>0&&n[0].height>0?n[0]:(s=e.startContainer.parentElement??e.startContainer)==null?void 0:s.getBoundingClientRect();if(!r||r.height<=0)return;if(!t){(l=(o=e.startContainer.parentElement??e.startContainer)==null?void 0:o.scrollIntoView)==null||l.call(o,{behavior:"smooth",block:"center"});return}const i=t.getBoundingClientRect();if(r.top>=i.top+48&&r.bottom<=i.bottom-48)return;const a=t.scrollTop+(r.top+r.height/2)-(i.top+i.height/2);t.scrollTo({top:Math.max(0,a),behavior:"smooth"})}let xo=null,o0=null;function WN(e){xo=e,o0=(e==null?void 0:e.textContent)??null}function GN(){if(YN(xo))return xo;if(o0){for(const e of document.querySelectorAll("mark.lookatstudy-underline"))if(e.textContent===o0)return xo=e,e}return null}function YN(e){return!!e&&e.isConnected}function Pb(e){e.scrollIntoView({behavior:"smooth",block:"center"}),e.style.transition="background 0.3s, border-bottom-color 0.3s, border-bottom-width 0.3s",e.style.background="rgba(250, 204, 21, 0.35)",e.style.borderBottom="4px solid rgb(34, 197, 94)",setTimeout(()=>{e.style.color="inherit",e.style.background="transparent",e.style.borderBottom="2px solid rgb(34, 197, 94)"},1500)}function Ob(e){const t=[];let n=!1;for(const r of e.split(`
769
+ `)){if(/^[ \t]*(?:```|~~~)/.test(r)){t.push(r),n=!n;continue}t.push(n?r:r.replace(/\\\[|\\\]|\\\(|\\\)/g,i=>i==="\\["||i==="\\]"?"$$":"$"))}return t.join(`
770
+ `)}const bo=new Set(["。","!","?","!","?",";",";","…"]),KN=new Set([",",",","、",":",":"," "," "]),XN=/[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}]/u;function Xm(e){return e!=null&&XN.test(String.fromCodePoint(e))}const QN=/(?:[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}](?:\uFE0F|\u200D[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}]|[\u{1F3FB}-\u{1F3FF}])*)$/u,l0=new Set(["”",'"',"」","』","》",")","】","])".slice(0,1)]);function ZN(e){let t=e;return t=t.replace(/\r\n?/g,`
771
+ `),t=t.replace(/(?:^|\n)[ \t]*(?:```|~~~)[^\n]*\n[\s\S]*?(?:\n[ \t]*(?:```|~~~)[^\n]*|\n?$)/g,`
772
+ `),t=t.replace(/`[^`\n]*`/g,""),t=t.replace(/!\[[^\]]*\]\([^)\n]*\)/g,""),t=t.replace(/\[([^\]]+)\]\([^)\n]*\)/g,"$1"),t=t.replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm,""),t=t.replace(/^[ \t]*(?:[-*+]|\d+\.)[ \t]+/gm,""),t=t.replace(/^[ \t]*>[ \t]?/gm,""),t=t.replace(/\|/g," "),t=t.replace(/^[ \t]*[-: ]{3,}[ \t]*$/gm,""),t=t.replace(/(\*\*|__)(.*?)\1/g,"$2"),t=t.replace(new RegExp("(?<![*\\w])(\\*|_)(?!\\s)(.+?)(?<!\\s)\\1(?![*\\w])","g"),"$2"),t=t.replace(/~~(.+?)~~/g,"$1"),t=t.replace(/\n{3,}/g,`
773
+
774
+ `),t.trim()}function JN(e){return eM(ZN(e),{flush:!0}).sentences}function jb(e,t){if(t<0||t>=e.length)return"";let n=t;for(;n>0&&!tM(e[n-1]??"");)n--;const r=[];for(let i=n;i<=t;i++){const a=e[i];a&&a.trim()&&r.push(a)}return r.join(" ")}function eM(e,t={}){const n=Math.max(8,t.maxBuffer??120),r=t.flush??!1,i=[],a=e.length;let s=0,o=0,l=-1;const u=h=>{const m=e.slice(s,h).trim();m&&i.push(m),s=h,l=-1};for(;o<a;){const h=e[o],m=e.codePointAt(o);if(Xm(m)){let d=o+(m>65535?2:1);for(;d<a;){const p=e.codePointAt(d),g=p>65535?2:1;if(p===65039||p===8205||p>=127995&&p<=127999||Xm(p)){d+=g;continue}break}u(d),o=d;continue}if(h===`
775
+ `){const d=e.slice(s,o+1).replace(/[^\S\n]+$/,"");d.trim()&&i.push(d),s=o+1,l=-1,o++;continue}if(bo.has(h)){let d=o+1;for(;d<a&&(bo.has(e[d])||l0.has(e[d]));)d++;u(d),o=d;continue}if(h==="."){const d=o>0?e[o-1]:"",p=o+1<a?e[o+1]:"";if((p===""||/\s/.test(p))&&!/\d/.test(d)){let g=o+1;for(;g<a&&(l0.has(e[g])||bo.has(e[g]));)g++;u(g),o=g;continue}}if(KN.has(h)&&(l=o),o-s+1>n)if(l>s){const d=l;u(d),s=d+1}else{u(o+1),o++;continue}o++}const c=e.slice(s).trim();return r&&c&&i.push(c),{sentences:i,rest:r?"":c}}function tM(e){if(/\n\s*$/.test(e))return!0;const t=e.trimEnd();if(!t)return!0;let n=t.length-1;for(;n>=0&&l0.has(t[n]);)n--;if(n<0)return!0;const r=t[n];return bo.has(r)||r==="."||r===`
776
+ `?!0:QN.test(t)}function Bb(e,t,n,r,i){const s=r??e,o=s.top+s.height/2;return!i&&s.right+8+n<=t?{left:s.right+8,top:o,transform:"translate(0, -50%)"}:!i&&e.left-8-n>=0?{left:e.left-8,top:o,transform:"translate(-100%, -50%)"}:{left:Math.min(Math.max(e.left,0),Math.max(0,t-n)),top:s.bottom+8,transform:"translate(0, 0)"}}function Il({title:e,onClose:t,children:n}){const r=$e(),i=w.useRef(null);return ra(i,!0),w.useEffect(()=>{const a=s=>{s.key==="Escape"&&t()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),K0.createPortal(f.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/80","data-testid":"diagram-viewer-modal","data-noswipe":"",role:"dialog","aria-modal":"true","aria-label":e,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:a=>a.stopPropagation(),children:[f.jsx("h3",{className:"text-body font-bold text-white truncate",children:e}),f.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[f.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:r("artifact.viewer.hint")}),f.jsx("button",{onClick:t,"data-testid":"diagram-viewer-close","aria-label":r("action.close"),"data-tooltip":r("action.close"),className:"text-white/70 hover:text-white w-9 h-9 flex items-center justify-center rounded-lg hover:bg-white/10 transition-colors",children:f.jsx(Fn,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:t,children:f.jsx("div",{ref:i,className:"h-full w-full",onClick:a=>a.stopPropagation(),children:n})})]}),document.body)}function nM(e,t,n,r,i=24){if(e<=0||t<=0||n<=0||r<=0)return 1;const a=Math.min((n-i*2)/e,(r-i*2)/t,1);return Math.max(.02,a)}function rM(e,t,n,r,i=24){const a=nM(e,t,n,r,i);return{scale:a,x:(n-e*a)/2,y:(r-t*a)/2}}function iM(e,t,n,r){return{scale:e.scale*t,x:n-(n-e.x)*t,y:r-(r-e.y)*t}}function ja(e,t,n,r,i,a=64){const s=t*e.scale,o=n*e.scale;let{x:l,y:u}=e;return s<=r?l=(r-s)/2:l=Math.min(Math.max(l,r-s-a),a),o<=i?u=(i-o)/2:u=Math.min(Math.max(u,i-o-a),a),{x:l,y:u,scale:e.scale}}function aM(e,t,n,r,i){const a=e.scale*t,s=Math.min(Math.max(a,i.min),i.max)/e.scale;return s===1?e:ja(iM(e,s,n,r),i.contentW,i.contentH,i.viewW,i.viewH)}const Qm=.05,Zm=4,Qs=1.25;function fa({children:e,grid:t=!0,testid:n}){const r=$e(),i=w.useRef(null),a=w.useRef(null),[s,o]=w.useState({x:0,y:0,scale:1}),[l,u]=w.useState(null),[c,h]=w.useState(!1),m=w.useRef("mouse"),d=w.useRef(!0),p=w.useRef({pointers:new Map,pinchBase:null,lastMid:null,panning:!1,moved:!1}),g=w.useRef(null),x=w.useCallback(()=>{const C=i.current,I=a.current;return{min:Qm,max:Zm,contentW:(I==null?void 0:I.offsetWidth)??0,contentH:(I==null?void 0:I.offsetHeight)??0,viewW:(C==null?void 0:C.clientWidth)??0,viewH:(C==null?void 0:C.clientHeight)??0}},[]),b=w.useCallback(()=>{const C=x();!C.contentW||!C.viewW||(o(rM(C.contentW,C.contentH,C.viewW,C.viewH)),d.current=!0)},[x]);w.useEffect(()=>{const C=i.current,I=a.current;if(!C||!I)return;const A=()=>{u({w:I.offsetWidth,h:I.offsetHeight}),b()};A();const R=new ResizeObserver(A);return R.observe(I),R.observe(C),()=>R.disconnect()},[b]);const v=w.useCallback((C,I,A)=>{const R=x(),L=I??R.viewW/2,z=A??R.viewH/2;o(j=>aM(j,C,L,z,R)),d.current=!1},[x]),E=w.useCallback(C=>{var R,L;if((L=(R=C.target).closest)!=null&&L.call(R,"[data-testid=canvas-zoom-controls]"))return;const I=C.currentTarget;try{I.setPointerCapture(C.pointerId)}catch{}const A=p.current;if(m.current=C.pointerType,A.pointers.size===0&&h(!0),A.pointers.set(C.pointerId,{x:C.clientX,y:C.clientY}),A.pointers.size===2){const[z,j]=[...A.pointers.values()];A.pinchBase={dist:Math.hypot(z.x-j.x,z.y-j.y),factorAcc:1},A.lastMid={x:(z.x+j.x)/2,y:(z.y+j.y)/2},A.panning=!1}else A.pointers.size===1&&(A.panning=!0,A.moved=!1,A.lastMid={x:C.clientX,y:C.clientY})},[]),N=w.useCallback(C=>{const I=p.current;if(!I.pointers.has(C.pointerId))return;I.pointers.set(C.pointerId,{x:C.clientX,y:C.clientY});const A=i.current;if(!A)return;const R=A.getBoundingClientRect();if(I.pointers.size>=2&&I.pinchBase){const[L,z]=[...I.pointers.values()],j=Math.hypot(L.x-z.x,L.y-z.y),B={x:(L.x+z.x)/2,y:(L.y+z.y)/2};if(I.pinchBase.dist>0){const H=j/I.pinchBase.dist/I.pinchBase.factorAcc;I.pinchBase.factorAcc*=H,v(H,B.x-R.left,B.y-R.top)}if(I.lastMid){const H=B.x-I.lastMid.x,Y=B.y-I.lastMid.y,V=x();o(Z=>ja({...Z,x:Z.x+H,y:Z.y+Y},V.contentW,V.contentH,V.viewW,V.viewH))}I.lastMid=B;return}if(I.panning&&I.lastMid){const L=C.clientX-I.lastMid.x,z=C.clientY-I.lastMid.y;Math.abs(L)+Math.abs(z)>2&&(I.moved=!0);const j=x();o(B=>ja({...B,x:B.x+L,y:B.y+z},j.contentW,j.contentH,j.viewW,j.viewH)),I.lastMid={x:C.clientX,y:C.clientY}}},[x,v]),k=w.useCallback(C=>{const I=p.current,A=I.pointers.size===1;if(I.pointers.delete(C.pointerId),I.pointers.size<2&&(I.pinchBase=null),I.pointers.size===0){if(I.panning=!1,I.lastMid=null,h(!1),A&&!I.moved&&C.pointerType!=="mouse"){const R=performance.now(),L=g.current;if(L&&R-L.t<320&&Math.hypot(C.clientX-L.x,C.clientY-L.y)<32){const z=x();d.current?(o(ja({x:(z.viewW-z.contentW)/2,y:Math.max(24,(z.viewH-z.contentH)/2),scale:1},z.contentW,z.contentH,z.viewW,z.viewH)),d.current=!1):b(),g.current=null}else g.current={t:R,x:C.clientX,y:C.clientY}}}else if(I.pointers.size===1){const R=[...I.pointers.values()][0];I.lastMid={x:R.x,y:R.y},I.panning=!0}},[x,b]),S=w.useCallback(C=>{var A;C.preventDefault();const I=(A=i.current)==null?void 0:A.getBoundingClientRect();I&&v(C.deltaY<0?Qs:1/Qs,C.clientX-I.left,C.clientY-I.top)},[v]),_=w.useCallback(()=>{if(m.current!=="mouse")return;const C=x();d.current?(o(ja({x:(C.viewW-C.contentW)/2,y:Math.max(24,(C.viewH-C.contentH)/2),scale:1},C.contentW,C.contentH,C.viewW,C.viewH)),d.current=!1):b()},[x,b]);return f.jsxs("div",{ref:i,"data-testid":n,"data-noswipe":"",className:`relative h-full w-full overflow-hidden select-none touch-none ${t?"canvas-grid":""}`,style:{touchAction:"none"},onPointerDown:E,onPointerMove:N,onPointerUp:k,onPointerCancel:k,onWheel:S,onDoubleClick:_,children:[f.jsx("div",{ref:a,className:`absolute top-0 left-0 canvas-stage-gesture ${c?"":"motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out"}`,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`,transformOrigin:"0 0"},children:e}),f.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-0.5 p-1 rounded-xl bg-surface-0/90 backdrop-blur border border-[var(--border)] shadow-elevated","data-testid":"canvas-zoom-controls",children:[f.jsx("button",{onClick:()=>v(1/Qs),disabled:s.scale<=Qm+1e-6,"aria-label":r("artifact.zoomOut"),"data-tooltip":r("artifact.zoomOut"),"data-testid":"canvas-zoom-out",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong disabled:opacity-30 disabled:pointer-events-none transition-colors",children:f.jsx(Vy,{className:"w-4 h-4"})}),f.jsxs("span",{className:"text-label font-bold tabular-nums text-ink-muted min-w-[3.25rem] text-center select-none","data-testid":"canvas-zoom-pct",children:[Math.round(s.scale*100),"%"]}),f.jsx("button",{onClick:()=>v(Qs),disabled:s.scale>=Zm-1e-6,"aria-label":r("artifact.zoomIn"),"data-tooltip":r("artifact.zoomIn"),"data-testid":"canvas-zoom-in",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong disabled:opacity-30 disabled:pointer-events-none transition-colors",children:f.jsx(nl,{className:"w-4 h-4"})}),f.jsx("button",{onClick:b,"aria-label":r("artifact.canvas.fit"),"data-tooltip":r("artifact.canvas.fit"),"data-testid":"canvas-zoom-fit",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong transition-colors",children:f.jsx(gs,{className:"w-4 h-4"})})]}),f.jsx("span",{"data-testid":"canvas-natural-size",className:"hidden",children:l?`${l.w}x${l.h}`:""})]})}function Zn(e,t=13){let n=0;for(const r of e)n+=/[\u2e80-\u9fff\uf900-\ufaff\uff00-\uffef\u3000-\u303f]/.test(r)?t:t*.58;return n}const Pi=118;function sM(e){if(Zn(e)<=Pi)return[e];const t=[];for(let l=0;l<e.length;l++)/[\s/\-—·]/.test(e[l]??"")&&t.push(l);const n=e.length/2;let r=-1,i=1/0;for(const l of t){const u=Math.abs(l+1-n);u<i&&(i=u,r=l)}let a,s;if(r>=0)a=e.slice(0,r+1).trim(),s=e.slice(r+1).trim();else{let l=0,u=0;for(const c of e)if(l+=Zn(c),u++,l>=Zn(e)/2)break;a=e.slice(0,u),s=e.slice(u)}if(Zn(a)<=Pi&&Zn(s)<=Pi)return[a,s];const o=l=>{let u="";for(const c of l){if(Zn(u+c+"…")>Pi)break;u+=c}return u+"…"};return[Zn(a)>Pi?o(a):a,Zn(s)>Pi?o(s):s]}function Fb(e,t){const n=sM(e),r=t?14:13,i=Math.max(...n.map(l=>Zn(l,r))),a=t?30:24,s=17,o=t?18:14;return{width:Math.min(t?200:180,Math.max(t?92:76,i+a)),height:o+n.length*s,lines:n}}function oM(e,t,n){const r=new Set(e.map(i=>i.id));if(Array.isArray(n)&&n.length>0){const i=new Set,a=[];for(const s of n){if(!s||typeof s.id!="string"||!s.id)continue;const o=Array.isArray(s.nodeIds)?[...new Set(s.nodeIds.filter(l=>typeof l=="string"&&r.has(l)&&!i.has(l)))]:[];o.length<2||(o.forEach(l=>i.add(l)),a.push({id:s.id,label:typeof s.label=="string"&&s.label?s.label:"分组",nodeIds:o}))}if(a.length>0&&!(a.length===1&&i.size===e.length&&e.length>2))return{groups:a,fallback:!1}}return{groups:lM(e,t),fallback:!0}}function lM(e,t){if(e.length<4)return[];const n=new Map(e.map((h,m)=>[h.id,m])),r=new Map;for(const h of e)r.set(h.id,[]);const i=new Set;for(const h of t){if(!n.has(h.from)||!n.has(h.to)||h.from===h.to)continue;const m=[h.from,h.to].sort().join("→");i.has(m)||(i.add(m),r.get(h.from).push(h.to),r.get(h.to).push(h.from))}const a=[...e].sort((h,m)=>{const d=r.get(h.id).length,p=r.get(m.id).length;return d!==p?p-d:(n.get(h.id)??0)-(n.get(m.id)??0)}),s=Math.min(3,Math.max(1,Math.ceil(e.length/4))),o=a.slice(0,s).filter(h=>{var m;return(((m=r.get(h.id))==null?void 0:m.length)??0)>0});if(o.length===0)return[];const l=new Map;o.forEach((h,m)=>l.set(h.id,m));const u=o.map(h=>h.id);for(;u.length;){const h=u.shift(),m=l.get(h);for(const d of r.get(h)??[])l.has(d)||(l.set(d,m),u.push(d))}const c=[];return o.forEach((h,m)=>{const d=e.filter(p=>l.get(p.id)===m).map(p=>p.id);d.length<2||c.push({id:`grp-${h.id}`,label:h.label.length<=5?`${h.label}相关`:h.label,nodeIds:d})}),c}const yo=34;function uM(e,t,n){var h;const r=new Set(e.map(m=>m.id)),i=new Map;for(const m of e)i.set(m.id,0);const a=new Set,s=[];for(const m of t){if(!r.has(m.from)||!r.has(m.to)||m.from===m.to)continue;const d=[m.from,m.to].sort().join("→");a.has(d)||(a.add(d),s.push(m),i.set(m.from,i.get(m.from)+1),i.set(m.to,i.get(m.to)+1))}let o=((h=e[0])==null?void 0:h.id)??"";for(const m of e)(i.get(m.id)??0)>(i.get(o)??0)&&(o=m.id);const l=new Map;for(const m of n)for(const d of m.nodeIds)r.has(d)&&!l.has(d)&&l.set(d,m.id);const u=m=>{const d=Fb(m.label,m.id===o||(i.get(m.id)??0)>=4);return{id:m.id,width:Math.ceil(d.width),height:Math.ceil(d.height)}},c=[];for(const m of n){const d=m.nodeIds.filter(p=>l.get(p)===m.id&&r.has(p));d.length!==0&&c.push({id:`g:${m.id}`,layoutOptions:{"elk.padding":`[top=${yo},left=14,bottom=12,right=14]`},children:d.map(p=>u(e.find(g=>g.id===p)))})}for(const m of e)l.has(m.id)||c.push(u(m));return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":"34","elk.spacing.edgeNode":"26","elk.spacing.componentComponent":"48","elk.layered.spacing.nodeNodeBetweenLayers":"56"},children:c,edges:s.map((m,d)=>({id:`e${d}`,sources:[m.from],targets:[m.to]}))}}function cM(e){if(e.length===0)return{x:0,y:0};if(e.length===1)return e[0];const t=[];let n=0;for(let i=1;i<e.length;i++){const a=Math.hypot(e[i].x-e[i-1].x,e[i].y-e[i-1].y);t.push(a),n+=a}let r=n/2;for(let i=0;i<t.length;i++){if(r<=t[i]||i===t.length-1){const a=t[i]===0?0:r/t[i];return{x:e[i].x+(e[i+1].x-e[i].x)*a,y:e[i].y+(e[i+1].y-e[i].y)*a}}r-=t[i]}return e[e.length-1]}function dM(e,t,n,r,i,a){var x;const s=new Map(t.map(b=>[b.id,b])),o=new Map;r.forEach((b,v)=>o.set(b.id,v%5));const l=new Map(r.map(b=>[b.id,b])),u=new Map;for(const b of r)for(const v of b.nodeIds)u.has(v)||u.set(v,b.id);const c=[],h=[],m=[],d=new Map([["root",{x:0,y:0}]]),p=[],g=(b,v,E,N)=>{var k;for(const S of b.children??[]){const _=v+(S.x??0),C=E+(S.y??0);if((k=S.children)!=null&&k.length){const I=S.id.startsWith("g:")?S.id.slice(2):S.id,A=l.get(I);h.push({id:I,label:(A==null?void 0:A.label)??"分组",x:_,y:C,w:S.width??0,h:S.height??0,colorIdx:o.get(I)??0}),d.set(S.id,{x:_,y:C}),g(S,_,C,I)}else{const I=s.get(S.id);if(!I)continue;const A=Fb(I.label,I.id===a),R=u.get(I.id)??null;c.push({id:I.id,x:_,y:C,w:S.width??Math.ceil(A.width),h:S.height??Math.ceil(A.height),lines:A.lines,hub:I.id===a,groupId:N,colorIdx:R!=null?o.get(R)??0:-1})}}for(const S of b.edges??[])p.push({e:S,fallback:{x:v,y:E}})};g(e,0,0,null);for(const{e:b,fallback:v}of p){const E=(x=b.sections)==null?void 0:x[0];if(!E)continue;const N=(b.container!=null?d.get(b.container):void 0)??v,k=[E.startPoint,...E.bendPoints??[],E.endPoint].map(C=>({x:C.x+N.x,y:C.y+N.y})),S=Number(b.id.slice(1)),_=n[S];_&&m.push({from:_.from,to:_.to,label:_.label,pts:k,labelPt:_.label?cM(k):null})}return{width:Math.ceil(e.width??0),height:Math.ceil(e.height??0),nodes:c,groups:h,edges:m,hubId:a,groupsFallback:i}}let Jm=null;function hM(){return Jm??(Jm=Ye(()=>import("./elk.bundled-DjGexDyy.js").then(e=>e.e),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>{const t=e,n=t.default??t;return new n})),Jm}async function fM(e,t,n){const r=oM(e,t,n),i=uM(e,t,r.groups),a=mM(e,t),o=await(await hM()).layout(i);return dM(o,e,t,r.groups,r.fallback,a)}function mM(e,t){var s;const n=new Set(e.map(o=>o.id)),r=new Map;for(const o of e)r.set(o.id,0);const i=new Set;for(const o of t){if(!n.has(o.from)||!n.has(o.to)||o.from===o.to)continue;const l=[o.from,o.to].sort().join("→");i.has(l)||(i.add(l),r.set(o.from,r.get(o.from)+1),r.set(o.to,r.get(o.to)+1))}let a=((s=e[0])==null?void 0:s.id)??"";for(const o of e)(r.get(o.id)??0)>(r.get(a)??0)&&(a=o.id);return a}const Zs=.4,Ou=2.5,Js=.2;function pM(e){return e.map((t,n)=>`${n===0?"M":"L"} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`).join(" ")}function ju({layout:e}){return f.jsxs("svg",{width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[f.jsx("defs",{children:f.jsx("marker",{id:"cm-arrow",viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:6.5,markerHeight:6.5,orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-ink-faint"})})}),e.groups.map((t,n)=>f.jsxs("g",{className:"cm-enter",style:{animationDelay:`${n*60}ms`},children:[f.jsx("rect",{x:t.x,y:t.y,width:t.w,height:t.h,rx:14,className:"cm-group-box",style:{fill:`var(--cm-c${t.colorIdx}-fill)`,stroke:`var(--cm-c${t.colorIdx}-line)`}}),f.jsx("rect",{x:t.x,y:t.y,width:t.w,height:yo,rx:14,className:"cm-group-head",style:{fill:`var(--cm-c${t.colorIdx}-line)`}}),f.jsx("rect",{x:t.x,y:t.y+yo/2,width:t.w,height:yo/2,className:"cm-group-head",style:{fill:`var(--cm-c${t.colorIdx}-line)`}}),f.jsx("text",{x:t.x+14,y:t.y+22,fontSize:12,fontWeight:600,fill:`var(--cm-c${t.colorIdx}-line)`,"data-testid":"conceptmap-group-label",children:t.label})]},`g-${t.id}`)),e.edges.map((t,n)=>{const r=t.label?{width:Zn(t.label,12)+16,height:19}:null;return f.jsxs("g",{className:"cm-enter",style:{animationDelay:`${(e.groups.length+1)*60+n*30}ms`},children:[f.jsx("path",{d:pM(t.pts),className:"fill-none stroke-ink-faint/80",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),t.label&&r&&t.labelPt&&f.jsxs("g",{children:[f.jsx("rect",{x:t.labelPt.x-r.width/2,y:t.labelPt.y-r.height/2,width:r.width,height:r.height,rx:r.height/2,className:"fill-surface-0/95 stroke-[var(--border-faint)]",strokeWidth:1}),f.jsx("text",{x:t.labelPt.x,y:t.labelPt.y+3.5,textAnchor:"middle",fontSize:12,className:"fill-ink-muted font-medium",style:{paintOrder:"stroke"},stroke:"var(--surface-0)",strokeWidth:3,children:t.label})]})]},`e-${n}`)}),e.nodes.map((t,n)=>{const r=t.colorIdx>=0?`var(--cm-c${t.colorIdx}-fill)`:"var(--surface-3)",i=t.colorIdx>=0?`var(--cm-c${t.colorIdx}-line)`:"var(--border)",a=t.hub?14:13;return f.jsxs("g",{className:"cm-enter",style:{animationDelay:`${(e.groups.length+2)*60+n*35}ms`},children:[f.jsx("rect",{x:t.x,y:t.y,width:t.w,height:t.h,rx:t.hub?12:10,fill:r,stroke:i,strokeWidth:t.hub?1.8:1.4}),t.lines.map((s,o)=>f.jsx("text",{x:t.x+t.w/2,y:t.y+t.h/2+(o-(t.lines.length-1)/2)*17+4.5,textAnchor:"middle",fontSize:a,className:t.hub?"fill-ink-strong font-bold":"fill-ink",children:s},o))]},t.id)})]})}function gM({data:e,variant:t="card"}){const n=e,r=$e(),i=w.useMemo(()=>JSON.stringify({n:n.nodes,e:n.edges,g:n.groups??null}),[n.nodes,n.edges,n.groups]),[a,s]=w.useState(null);w.useEffect(()=>{let x=!0;return s(null),fM(n.nodes,n.edges,n.groups??null).then(b=>{x&&s(b)}).catch(()=>{}),()=>{x=!1}},[i]);const[o,l]=w.useState(1),[u,c]=w.useState(!1),h=w.useRef(null);w.useEffect(()=>{const x=h.current;if(!x||!a)return;const b=()=>{const E=(x.clientWidth-16)/a.width;E<1&&l(Math.max(Zs,+E.toFixed(2)))};b();const v=new ResizeObserver(b);return v.observe(x),()=>v.disconnect()},[a==null?void 0:a.width,a]);const m=w.useCallback(()=>l(x=>Math.min(Ou,+(x+Js).toFixed(2))),[]),d=w.useCallback(()=>l(x=>Math.max(Zs,+(x-Js).toFixed(2))),[]),p=w.useCallback(()=>l(1),[]),g=w.useCallback(x=>{if(!x.ctrlKey&&!x.metaKey)return;x.preventDefault();const b=x.deltaY>0?-Js:Js;l(v=>Math.min(Ou,Math.max(Zs,+(v+b).toFixed(2))))},[]);return t==="canvas"?f.jsx("div",{"data-testid":"conceptmap-canvas-content",children:a?f.jsx(ju,{layout:a}):f.jsx("div",{style:{minWidth:320,minHeight:160}})}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[f.jsx(G0,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),f.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[f.jsx("button",{onClick:d,disabled:o<=Zs,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomOut"),children:"−"}),f.jsxs("button",{onClick:p,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 text-caption font-bold tabular-nums",title:r("artifact.zoomReset"),children:[Math.round(o*100),"%"]}),f.jsx("button",{onClick:m,disabled:o>=Ou,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomIn"),children:"+"})]}),f.jsx("button",{onClick:()=>c(!0),"data-testid":"conceptmap-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:f.jsx(gs,{className:"w-3.5 h-3.5"})})]})]}),f.jsx("div",{ref:h,onClick:()=>c(!0),onWheel:g,className:"bg-surface-0/40 rounded-lg p-2 overflow-auto min-h-[160px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"conceptmap-render-area","data-noswipe":"",children:a?f.jsx("div",{style:{width:a.width*o,height:a.height*o,margin:"0 auto"},children:f.jsx("div",{style:{transform:`scale(${o})`,transformOrigin:"top left",width:a.width,height:a.height},children:f.jsx(ju,{layout:a})})}):f.jsx("div",{className:"h-[152px] flex items-center justify-center text-caption text-ink-muted","data-testid":"conceptmap-loading",children:"…"})}),f.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:f.jsx("span",{children:r("artifact.conceptmap.stats",{nodes:n.nodes.length,edges:n.edges.length})})}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(wr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]}),u&&f.jsx(Il,{title:n.title,onClose:()=>c(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(fa,{testid:"conceptmap-modal-stage",children:a?f.jsx(ju,{layout:a}):f.jsx("div",{className:"min-w-[320px] min-h-[160px]"})})})})]})}function xM(e,t){const{correct:n,total:r}=e,i=r>0&&n===r,a=r>0&&n<r,s=t!=null&&t>=d5,o=t!=null&&t>=h5;return a?[{id:"explain-wrong"},{id:"retry"}]:i&&s?[{id:"next-topic"},{id:"go-deeper"}]:i&&o?[{id:"mark-mastered",advancesMastery:!0},{id:"next-topic"},{id:"go-deeper"}]:[{id:"go-deeper"},{id:"retry"}]}const bM="ls-quiz-progress:";function yM(e){const t=e.questions.map(r=>`${r.prompt}|${(r.options??[]).join("/")}#${r.answer??""}`).join(`
777
+ `);let n=2166136261;for(let r=0;r<t.length;r++)n^=t.charCodeAt(r),n=Math.imul(n,16777619);return`${bM}${(n>>>0).toString(36)}`}function vM(e){var t,n;try{const r=localStorage.getItem(e);if(!r)return null;const i=JSON.parse(r);return typeof(i==null?void 0:i.current)=="number"&&i.current>=0&&typeof((t=i==null?void 0:i.score)==null?void 0:t.correct)=="number"&&typeof((n=i==null?void 0:i.score)==null?void 0:n.total)=="number"?i:null}catch{return null}}function wM(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const kM={"explain-wrong":{icon:Cy,labelKey:"quiz.action.explainWrong",message:"我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。"},retry:{icon:za,labelKey:"quiz.action.retry",message:"再来一组类似的题巩固一下。"},"go-deeper":{icon:bc,labelKey:"quiz.action.goDeeper",message:"这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。"},"mark-mastered":{icon:Wn,labelKey:"quiz.action.markMastered",message:"这课我觉得掌握了,帮我确认一下——出个综合题检验,通过了就标记为掌握。"},"next-topic":{icon:gc,labelKey:"quiz.action.nextTopic",message:"进入下一个知识点。"}};function EM({data:e,onAnswered:t,quizMastery:n,onPickAction:r,onQuizCompleted:i}){const a=e,s=$e(),o=w.useMemo(()=>yM(a),[a]),l=w.useMemo(()=>vM(o),[o]),[u,c]=w.useState((l==null?void 0:l.current)??0),[h,m]=w.useState(null),[d,p]=w.useState(!1),[g,x]=w.useState((l==null?void 0:l.score)??{correct:0,total:0}),b=w.useRef([]);w.useEffect(()=>{wM(o,{current:u,score:g})},[o,u,g]);const[v,E]=w.useState(!1);if(u>=a.questions.length){const C=!!r&&!i;if(i)return f.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[f.jsx("div",{className:"text-2xl mb-2",children:g.correct===g.total?"🎉":"📚"}),f.jsx("div",{className:"text-body font-bold text-ink",children:s("quiz.scoreSummary",{correct:g.correct,total:g.total})}),v?f.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"quiz-hook-sent",children:s("quiz.hook.sent")}):f.jsx("button",{onClick:()=>{E(!0),i({title:a.title??"",correct:g.correct,total:g.total,detail:[...b.current]})},"data-testid":"quiz-hook-finish",className:"btn-3d-brand mt-3 px-5 py-2 text-body",children:s("quiz.hook.finish")})]});const I=C?xM(g,n??null):[];return f.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[f.jsx("div",{className:"text-2xl mb-2",children:g.correct===g.total?"🎉":"📚"}),f.jsx("div",{className:"text-body font-bold text-ink",children:s("quiz.scoreSummary",{correct:g.correct,total:g.total})}),f.jsx("div",{className:"text-label text-ink-muted mt-1",children:g.correct===g.total?s("quiz.allCorrectHint"):s("quiz.tryAgainHint")}),I.length>0&&f.jsxs("div",{className:"mt-3 space-y-2 text-left","data-testid":"quiz-next-actions",children:[f.jsx("div",{className:"text-label text-ink-muted",children:s("quiz.action.nextPrompt")}),I.map((A,R)=>{const L=kM[A.id],z=L.icon;return f.jsxs("button",{onClick:()=>r==null?void 0:r(L.message),"data-testid":`quiz-action-${A.id}`,className:`${R===0?"btn-3d-brand":"btn-3d-neutral"} w-full py-2 text-body flex items-center justify-center gap-1.5`,children:[f.jsx(z,{className:"w-4 h-4"}),s(L.labelKey)]},A.id)})]})]})}const N=a.questions[u],k=d&&h===N.answer,S=()=>{if(h===null)return;p(!0);const C=h===N.answer;x(I=>({correct:I.correct+(C?1:0),total:I.total+1})),t==null||t(N,h,C),b.current.push({prompt:N.prompt,chosen:N.options[h]??"?",answerText:N.options[N.answer]??"?",correct:C}),fi(C?"correct":"wrong")},_=()=>{u===a.questions.length-1&&i&&!v&&(E(!0),i({title:a.title??"",correct:g.correct,total:g.total,detail:[...b.current]})),c(C=>C+1),m(null),p(!1)};return f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-quiz",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(q0,{className:"w-4 h-4 text-brand"}),f.jsx("span",{className:"text-label font-bold text-brand",children:s("quiz.questionProgress",{cur:u+1,total:a.questions.length})})]}),f.jsx("span",{className:"text-label text-ink-muted",children:s("quiz.answeredCorrect",{n:g.correct})})]}),f.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:N.prompt}),f.jsx("div",{className:"space-y-2 mb-3",children:N.options.map((C,I)=>{const A=h===I,R=d&&I===N.answer,L=d&&A&&!R;return f.jsxs("button",{onClick:()=>!d&&m(I),disabled:d,"data-testid":`quiz-option-${I}`,className:`w-full text-left text-body p-2.5 rounded-lg border-2 font-medium transition-colors ${R?"border-brand bg-brand/10 text-brand animate-answer-correct":L?"border-warning bg-warning/10 text-warning animate-answer-wrong":A?"border-accent bg-accent/10 text-accent":"border-[var(--border)] text-ink-muted hover:border-[var(--border)]"} ${d?"cursor-default":"cursor-pointer"}`,children:[f.jsx("span",{className:"font-bold mr-2",children:String.fromCharCode(65+I)}),C,R&&f.jsx("span",{className:"float-right",children:f.jsx(Tn,{className:"w-4 h-4 inline-block"})}),L&&f.jsx("span",{className:"float-right",children:f.jsx(Fn,{className:"w-4 h-4 inline-block"})})]},I)})}),d&&f.jsxs("div",{className:`rounded-lg p-3 mb-3 text-body leading-relaxed animate-artifact-render ${k?"bg-brand/10 border border-brand/30 text-brand":"bg-warning/10 border border-warning/30 text-warning"}`,"data-testid":"quiz-explanation",children:[f.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[k?f.jsx(Tn,{className:"w-4 h-4"}):f.jsx(Fn,{className:"w-4 h-4"}),f.jsx("span",{children:s(k?"quiz.correct":"quiz.wrong")})]}),f.jsx("div",{className:"text-ink-muted",children:N.explanation})]}),d?f.jsx("button",{onClick:_,"data-testid":"quiz-next",className:"btn-3d-brand w-full py-2 text-body",children:u+1<a.questions.length?s("exercise.next"):s("quiz.finish")}):f.jsx("button",{onClick:S,disabled:h===null,"data-testid":"quiz-submit",className:"btn-3d-brand w-full py-2 text-body disabled:opacity-40",children:s("exercise.submit")}),a.warnings&&a.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(wr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:a.warnings.join("; ")})]})]})}function zb({data:e,variant:t="card"}){const n=e,r=$e(),[i,a]=w.useState(!1),s=f.jsxs("table",{className:"text-body",style:{width:"max-content",minWidth:"100%"},children:[f.jsx("thead",{children:f.jsx("tr",{className:"bg-surface-3/60",children:n.headers.map((o,l)=>f.jsx("th",{className:`px-3 py-2.5 text-left font-bold border-b border-[var(--border)] ${l===0?"text-ink-strong":"text-ink"}`,children:o},l))})}),f.jsx("tbody",{children:n.rows.map((o,l)=>f.jsx("tr",{className:l%2===0?"bg-surface-0/40":"",children:o.map((u,c)=>f.jsx("td",{className:`px-3 py-2.5 border-b border-[var(--border-faint)] align-top leading-relaxed ${c===0?"font-bold text-ink-strong whitespace-nowrap bg-surface-1/40":"text-ink-muted"}`,style:c===0?void 0:{maxWidth:260,overflowWrap:"anywhere"},children:u},c))},l))})]});return t==="canvas"?f.jsx("div",{className:"w-fit","data-testid":"comparetable-canvas-content",children:s}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-compare-table",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(tg,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),f.jsx("button",{onClick:()=>a(!0),"data-testid":"comparetable-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:f.jsx(gs,{className:"w-3.5 h-3.5"})})]}),f.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--border-faint)]",onClick:()=>a(!0),style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:s}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(wr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]}),i&&f.jsx(Il,{title:n.title,onClose:()=>a(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(fa,{testid:"comparetable-modal-stage",children:f.jsx("div",{className:"p-2 surface-card",children:f.jsx(zb,{data:e,variant:"canvas"})})})})})]})}function TM(e){const t=e.split(`
778
+ `);for(let n=0;n<t.length;n++){const r=t[n]??"",i=r.trim();if(!(!i||i.startsWith("%%")))return/^flowchart-elk\b/i.test(i)?e:/^(flowchart|graph)\b/i.test(i)?(t[n]=r.replace(/^(\s*)(flowchart|graph)\b/i,"$1flowchart-elk"),t.join(`
779
+ `)):e}return e}let vo=null;function SM(){return vo||(vo=Ye(()=>import("./mermaid.core-CmjrekXI.js").then(e=>e.aW),__vite__mapDeps([4,1,2,5,6]),import.meta.url).then(async e=>{const t=e.default,{default:n}=await Ye(async()=>{const{default:r}=await import("./mermaid-layout-elk.core-C4McJve2.js").then(i=>i.m);return{default:r}},[],import.meta.url);return t.registerLayoutLoaders(n),t.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:AM(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),t})),vo}function AM(){const e=(n,r)=>{if(typeof document>"u")return r;const i=getComputedStyle(document.documentElement).getPropertyValue(n).trim();return i?`rgb(${i})`:r};return{background:"transparent",fontFamily:typeof document<"u"&&getComputedStyle(document.body).fontFamily||"ui-sans-serif, system-ui, sans-serif",fontSize:"14px",primaryColor:e("--surface-3-rgb","rgb(42 43 46)"),primaryBorderColor:e("--border-rgb","rgb(37 38 41)"),primaryTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),secondaryColor:e("--surface-2-rgb","rgb(32 33 36)"),secondaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),secondaryTextColor:e("--ink-rgb","rgb(245 245 250)"),tertiaryColor:e("--surface-1-rgb","rgb(24 25 27)"),tertiaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),tertiaryTextColor:e("--ink-rgb","rgb(245 245 250)"),lineColor:e("--ink-faint-rgb","rgb(117 117 126)"),textColor:e("--ink-rgb","rgb(245 245 250)"),edgeLabelBackground:e("--surface-0-rgb","rgb(12 13 15)"),clusterBkg:e("--surface-1-rgb","rgb(24 25 27)"),clusterBorder:e("--border-faint-rgb","rgb(26 26 29)"),nodeBorder:e("--border-rgb","rgb(37 38 41)"),mainBkg:e("--surface-3-rgb","rgb(42 43 46)"),nodeTextColor:e("--ink-rgb","rgb(245 245 250)"),arrowheadColor:e("--ink-faint-rgb","rgb(117 117 126)"),actorBkg:e("--surface-3-rgb","rgb(42 43 46)"),actorBorder:e("--border-rgb","rgb(37 38 41)"),actorTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),activationBkgColor:e("--surface-3-rgb","rgb(42 43 46)"),activationBorderColor:e("--border-rgb","rgb(37 38 41)"),signalColor:e("--ink-rgb","rgb(245 245 250)"),signalTextColor:e("--ink-rgb","rgb(245 245 250)"),labelBoxBkgColor:e("--surface-2-rgb","rgb(32 33 36)"),labelBoxBorderColor:e("--border-rgb","rgb(37 38 41)"),labelTextColor:e("--ink-rgb","rgb(245 245 250)"),loopTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),noteBkgColor:"rgb(255 200 0 / 0.12)",noteBorderColor:"rgb(255 200 0 / 0.4)",noteTextColor:e("--ink-rgb","rgb(245 245 250)")}}typeof window<"u"&&window.addEventListener("theme-changed",()=>{vo=null});async function CM(e,t){const n=await SM(),r=TM(t);try{await n.parse(r)}catch(a){throw new Error(`mermaid 语法校验失败: ${a instanceof Error?a.message:String(a)}`)}const{svg:i}=await n.render(e,r);if(i.includes('aria-roledescription="error"')||i.includes('class="error-text"')||i.includes("Syntax error"))throw new Error("mermaid 渲染失败(语法错误或节点 label 含未转义特殊字符)");return i}function ep(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(36)}const Bu=.3,Fu=3,eo=.2;function Hb({data:e,variant:t="card"}){const n=e,r=$e(),i={flowchart:r("artifact.diagram.flowchart"),sequence:r("artifact.diagram.sequence"),state:r("artifact.diagram.state")},a=w.useId().replace(/[:]/g,"_"),[s,o]=w.useState({status:"loading"}),[l,u]=w.useState(()=>{try{return sessionStorage.getItem(`mmdfix:${n.mermaid.length}:${ep(n.mermaid)}`)??n.mermaid}catch{return n.mermaid}}),[c,h]=w.useState(!1),[m,d]=w.useState(!1),[p,g]=w.useState(0);w.useEffect(()=>{const L=()=>g(z=>z+1);return window.addEventListener("theme-changed",L),()=>window.removeEventListener("theme-changed",L)},[]);const[x,b]=w.useState(null),[v,E]=w.useState(1),[N,k]=w.useState(!1);w.useEffect(()=>{let L=!1;return o({status:"loading"}),b(null),CM(`mmd-${a}`,l).then(z=>{if(!L&&(o({status:"rendered",svg:z}),l!==n.mermaid))try{sessionStorage.setItem(`mmdfix:${n.mermaid.length}:${ep(n.mermaid)}`,l)}catch{}}).catch(z=>{L||(console.error("[MermaidArtifact] render failed:",z),o({status:"error",message:z instanceof Error?z.message:String(z)}))}),()=>{L=!0}},[l,a,p,n.mermaid]),w.useEffect(()=>{var L;s.status!=="error"||c||(h(!0),l===n.mermaid&&(L=window.api)!=null&&L.repairMermaidDiagram&&(d(!0),window.api.repairMermaidDiagram({mermaid:l,errorMessage:s.message,diagramType:n.diagramType}).then(z=>{z.ok&&z.mermaid.trim()&&u(z.mermaid)}).catch(()=>{}).finally(()=>d(!1))))},[s,c,l,n.mermaid,n.diagramType]);const S=`https://mermaid.live/edit#${encodeURIComponent(l)}`,_=w.useCallback(()=>E(L=>Math.min(Fu,+(L+eo).toFixed(2))),[]),C=w.useCallback(()=>E(L=>Math.max(Bu,+(L-eo).toFixed(2))),[]),I=w.useCallback(()=>E(1),[]),A=w.useCallback(L=>{if(!L.ctrlKey&&!L.metaKey)return;L.preventDefault();const z=L.deltaY>0?-eo:eo;E(j=>Math.min(Fu,Math.max(Bu,+(j+z).toFixed(2))))},[]),R=s.status==="rendered"?f.jsx("div",{ref:L=>{var z;if(L&&!x){const j=L.querySelector("svg");if(j){const B=j.getBoundingClientRect(),H=(z=j.viewBox)==null?void 0:z.baseVal,Y=H&&H.width?H.width:B.width,V=H&&H.height?H.height:B.height;Y>0&&V>0&&b({width:Y,height:V})}}},style:{width:(x==null?void 0:x.width)??void 0,height:(x==null?void 0:x.height)??void 0},dangerouslySetInnerHTML:{__html:s.svg},"data-testid":"mermaid-svg"}):null;return t==="canvas"?f.jsx("div",{"data-testid":"mermaid-canvas-content",children:R}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[f.jsx(o5,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),f.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-accent/15 text-accent shrink-0",children:i[n.diagramType]??n.diagramType})]}),f.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.status==="rendered"&&f.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[f.jsx("button",{onClick:C,disabled:v<=Bu,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),f.jsxs("button",{onClick:I,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 text-caption font-bold tabular-nums",title:r("artifact.zoomReset"),"data-testid":"mermaid-zoom-reset",children:[Math.round(v*100),"%"]}),f.jsx("button",{onClick:_,disabled:v>=Fu,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomIn"),"data-testid":"mermaid-zoom-in",children:"+"})]}),s.status==="rendered"&&f.jsx("button",{onClick:()=>k(!0),"data-testid":"mermaid-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:f.jsx(gs,{className:"w-3.5 h-3.5"})})]}),f.jsx("button",{onClick:()=>window.open(S,"_blank"),className:"text-caption text-accent hover:underline font-bold shrink-0","data-testid":"mermaid-open-live",title:r("artifact.mermaid.openLive"),children:"mermaid.live ↗"})]}),f.jsxs("div",{onClick:()=>{s.status==="rendered"&&k(!0)},onWheel:A,className:"bg-surface-0/40 rounded-lg p-3 overflow-auto min-h-[120px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"mermaid-render-area","data-noswipe":"",children:[s.status==="loading"&&f.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),f.jsx("span",{children:r("artifact.mermaid.rendering")})]}),s.status==="rendered"&&f.jsx("div",{style:{width:x?x.width*v:"auto",height:x?x.height*v:"auto",margin:"0 auto"},children:f.jsx("div",{style:{transform:`scale(${v})`,transformOrigin:"top left"},children:R})}),s.status==="error"&&m&&f.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-repairing",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),f.jsx("span",{children:r("artifact.mermaid.repairing")})]}),s.status==="error"&&!m&&f.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[f.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[f.jsx(wr,{className:"w-4 h-4 shrink-0"}),f.jsx("span",{children:r("artifact.mermaid.renderFailed")})]}),f.jsx("pre",{className:"text-label bg-surface-1/60 rounded p-2 overflow-x-auto text-ink-muted font-mono text-left",children:l}),f.jsx("div",{className:"text-caption text-ink-muted mt-2",children:r("artifact.mermaid.errorPrefix",{msg:s.message})})]})]}),s.status==="rendered"&&f.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:f.jsx("span",{children:r("artifact.mermaid.hint")})}),N&&s.status==="rendered"&&f.jsx(Il,{title:n.title,onClose:()=>k(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(fa,{testid:"mermaid-modal-stage",children:f.jsx(Hb,{data:e,variant:"canvas"})})})}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(wr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]})]})}const Ub={typescript:()=>Ye(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),tsx:()=>Ye(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),javascript:()=>Ye(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),jsx:()=>Ye(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),python:()=>Ye(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),go:()=>Ye(()=>import("./go-C27-OAKa.js"),[],import.meta.url),rust:()=>Ye(()=>import("./rust-B1yitclQ.js"),[],import.meta.url),java:()=>Ye(()=>import("./java-CylS5w8V.js"),[],import.meta.url),c:()=>Ye(()=>import("./c-BIGW1oBm.js"),[],import.meta.url),cpp:()=>Ye(()=>import("./cpp-DddhVWhK.js"),__vite__mapDeps([7,8]),import.meta.url),csharp:()=>Ye(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url),ruby:()=>Ye(()=>import("./ruby-B6QtyW_S.js"),__vite__mapDeps([9,10,11,12,13,14,15,16,17,18,19,7,8,20,21,22]),import.meta.url),php:()=>Ye(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([23,10,11,12,13,14,15,24]),import.meta.url),swift:()=>Ye(()=>import("./swift-C2oV4EkX.js"),[],import.meta.url),kotlin:()=>Ye(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url),lua:()=>Ye(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([21,8]),import.meta.url),r:()=>Ye(()=>import("./r-Cf5RLm7j.js"),[],import.meta.url),shellscript:()=>Ye(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url),sql:()=>Ye(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),html:()=>Ye(()=>import("./html-pp8916En.js"),__vite__mapDeps([10,11,12]),import.meta.url),css:()=>Ye(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),scss:()=>Ye(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([25,12]),import.meta.url),xml:()=>Ye(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([13,14]),import.meta.url),json:()=>Ye(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),yaml:()=>Ye(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url),toml:()=>Ye(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),ini:()=>Ye(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url),markdown:()=>Ye(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),dockerfile:()=>Ye(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),makefile:()=>Ye(()=>import("./makefile-CHLpvVh8.js"),[],import.meta.url),diff:()=>Ye(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),graphql:()=>Ye(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([16,11,17,18,19]),import.meta.url),latex:()=>Ye(()=>import("./latex-B2nUCzCX.js"),__vite__mapDeps([26,27]),import.meta.url),vue:()=>Ye(()=>import("./vue-CHlpWS_5.js"),__vite__mapDeps([28,12,11,17,24,10]),import.meta.url)},tp={js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",py:"python",python3:"python",rb:"ruby",golang:"go",rs:"rust",cs:"csharp",kt:"kotlin",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",console:"shellscript",yml:"yaml",md:"markdown",gfm:"markdown",docker:"dockerfile",tex:"latex",plaintext:"",txt:"",text:""};function NM(e){const t=e.trim().toLowerCase();return t?t in tp?tp[t]||null:t in Ub?t:null:null}let Ma=null;const np=new Set;function Bd(){return Ma||(Ma=(async()=>{const[e,t,n,r]=await Promise.all([Ye(()=>import("./core-Drxo65nc.js"),__vite__mapDeps([29,1,2]),import.meta.url),Ye(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),Ye(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),Ye(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url)]);return e.createHighlighterCore({themes:[n.default,r.default],langs:[],engine:t.createJavaScriptRegexEngine({forgiving:!0})})})(),Ma.catch(()=>{Ma=null})),Ma}async function Vb(e){const t=NM(e);if(!t)return null;if(np.has(t))return t;const n=Ub[t];if(!n)return null;const r=await Bd(),i=await n();return await r.loadLanguage(i),np.add(t),t}async function MM(e,t){try{const n=await Vb(t);return n?(await Bd()).codeToHtml(e,{lang:n,themes:{light:"github-light",dark:"github-dark"},defaultColor:"dark"}):null}catch{return null}}const IM=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");async function _M(e,t){try{const n=await Vb(t);return n?(await Bd()).codeToTokens(e,{lang:n,theme:"github-dark"}).tokens.map(a=>a.map(s=>`<span style="color:${s.color}">${IM(s.content)}</span>`).join("")):null}catch{return null}}function qb({data:e,variant:t="card"}){const n=e,r=$e(),[i,a]=w.useState(null),[s,o]=w.useState(!1),l=w.useRef([]),u=w.useRef([]),c=n.code.split(`
780
+ `),[h,m]=w.useState(null);w.useEffect(()=>{let b=!0;return _M(n.code,n.language).then(v=>{b&&v&&m(v)}),()=>{b=!1}},[n.code,n.language]);const d=b=>{if(i===null)return!1;const v=n.annotations[i];return v&&b>=v.lineStart&&b<=v.lineEnd},p=b=>{const v=i===b?null:b;if(a(v),v!==null){const E=n.annotations[v],N=(s?u:l).current[E.lineStart-1];N==null||N.scrollIntoView({behavior:"smooth",block:"center"})}},g=b=>f.jsx("div",{className:"bg-neutral-950 rounded-lg overflow-hidden border border-neutral-800 max-h-[420px] overflow-y-auto",children:f.jsx("pre",{className:"text-label font-mono leading-relaxed overflow-x-auto",children:f.jsx("code",{children:c.map((v,E)=>{const N=E+1;return f.jsxs("div",{ref:k=>{b.current[E]=k},className:`flex ${d(N)?"bg-brand/15":""}`,children:[f.jsx("span",{className:"select-none text-neutral-600 pr-3 pl-3 text-right w-10 shrink-0 border-r border-neutral-800 tabular-nums",children:N}),h&&h[E]!=null?f.jsx("span",{className:"pl-3 whitespace-pre text-neutral-200","data-testid":"walk-shiki-line",dangerouslySetInnerHTML:{__html:h[E]||" "}}):f.jsx("span",{className:"text-neutral-200 pl-3 whitespace-pre",children:v||" "})]},E)})})})}),x=f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted",children:r("artifact.codewalk.sectionLabel")}),n.annotations.map((b,v)=>f.jsxs("button",{onClick:()=>p(v),"data-testid":`annotation-${v}`,className:`w-full text-left p-2.5 rounded-lg border transition-colors ${i===v?"border-brand bg-brand/10":"border-[var(--border-faint)] hover:border-[var(--border)]"}`,children:[f.jsx("div",{className:"text-caption font-bold text-brand mb-0.5",children:b.lineEnd!==b.lineStart?r("artifact.codewalk.lineRange",{a:b.lineStart,b:b.lineEnd}):r("artifact.codewalk.lineSingle",{n:b.lineStart})}),f.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:b.note})]},v))]});return t==="canvas"?f.jsx("div",{className:"w-fit","data-testid":"codewalk-canvas-content",children:g(u)}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-code-walkthrough",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Y1,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),f.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-surface-3 text-ink-muted font-mono shrink-0",children:n.language})]}),f.jsx("button",{onClick:()=>o(!0),"data-testid":"codewalk-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:f.jsx(gs,{className:"w-3.5 h-3.5"})})]}),f.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[f.jsx("div",{onClick:()=>{s||o(!0)},style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:g(l)}),x]}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(wr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]}),s&&f.jsx(Il,{title:n.title,onClose:()=>o(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(fa,{testid:"codewalk-modal-stage",children:f.jsx(qb,{data:e,variant:"canvas"})})})})]})}function RM({data:e,onPickAction:t}){const n=e,r=$e(),[i,a]=w.useState(null),s=o=>{i||(a(o.id),t==null||t(`${r("guess.pickedPrefix")}${o.label}`))};return f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-guess",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(Iy,{className:"w-4 h-4 text-accent"}),f.jsx("span",{className:"text-label font-bold text-accent",children:r("guess.header")})]}),f.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:n.prompt}),f.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-2",children:n.options.map(o=>{const l=i===o.id,u=i!==null;return f.jsxs("button",{onClick:()=>s(o),disabled:u,"data-testid":`guess-option-${o.id}`,className:`text-body p-2.5 rounded-lg border-2 font-medium transition-colors text-left flex items-center justify-between gap-2 ${l?"border-accent bg-accent/10 text-accent":u?"border-[var(--border-faint)] text-ink-faint cursor-default":"border-[var(--border)] text-ink-muted hover:border-accent hover:text-accent cursor-pointer"}`,children:[f.jsx("span",{children:o.label}),l&&f.jsx(Tn,{className:"w-4 h-4 shrink-0"})]},o.id)})}),i&&f.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"guess-picked-hint",children:r("guess.waitReveal")}),n.warnings&&n.warnings.length>0&&f.jsx("div",{className:"mt-2 text-caption text-warning","data-testid":"artifact-warnings",children:n.warnings.join("; ")})]})}function Fd({data:e,onQuizAnswered:t,quizMastery:n,onPickAction:r,onQuizCompleted:i,variant:a="card"}){const s=e;if(!s||!s.artifactType)return f.jsx(rp,{data:e});switch(s.artifactType){case"concept_map":return f.jsx(gM,{data:e,variant:a});case"quiz":return f.jsx(EM,{data:e,onAnswered:t,quizMastery:n,onPickAction:r,onQuizCompleted:i});case"compare_table":return f.jsx(zb,{data:e,variant:a});case"diagram":return f.jsx(Hb,{data:e,variant:a});case"code_walkthrough":return f.jsx(qb,{data:e,variant:a});case"guess":return f.jsx(RM,{data:e,onPickAction:r});default:return f.jsx(rp,{data:e})}}function rp({data:e}){var n;const t=$e();return f.jsxs("div",{className:"surface-card p-4 text-body text-ink-muted","data-testid":"artifact-unknown",children:[f.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[f.jsx(eg,{className:"w-4 h-4"}),t("artifact.unknownHeader")]}),f.jsx("pre",{className:"text-caption overflow-x-auto text-ink-muted",children:(n=JSON.stringify(e,null,2))==null?void 0:n.slice(0,200)})]})}const u0="lookatstudy-tts-settings-changed";function c0(e){const t=n=>{const r=n.toLowerCase();return r==="zh-cn"||r==="zh_cn"||r==="zh"?0:r.startsWith("zh")?1:2};return[...e].sort((n,r)=>t(n.lang)-t(r.lang)||n.lang.localeCompare(r.lang)||n.name.localeCompare(r.name))}function ip(e,t){if(e.length===0)return null;const n=t==null?void 0:t.trim();if(n){const a=e.find(s=>s.name===n);if(a)return a}const r=c0(e.filter(a=>a.default));return r.length>0&&LM(r[0].lang)?r[0]:c0(e)[0]??null}function LM(e){return e.toLowerCase().startsWith("zh")}function DM(e){return`${e.name} · ${e.lang}`}const PM=[["\\leq","小于等于"],["\\le","小于等于"],["\\geq","大于等于"],["\\ge","大于等于"],["\\neq","不等于"],["\\ne","不等于"],["\\approx","约等于"],["\\equiv","恒等于"],["\\pm","正负"],["\\times","乘以"],["\\cdot","点乘"],["\\div","除以"],["\\to","趋于"],["\\rightarrow","趋于"],["\\Rightarrow","推出"],["\\infty","无穷"],["\\sum","求和"],["\\prod","连乘"],["\\int","积分"],["\\lim","极限"],["\\log","对数"],["\\ln","自然对数"],["\\exp","指数"],["\\in","属于"],["\\subset","包含于"],["\\cup","并"],["\\cap","交"],["\\forall","任意"],["\\exists","存在"],["\\partial","偏导"],["\\nabla","梯度"],["\\angle","角"],["\\degree","度"],["\\cdots","点点点"],["\\ldots","点点点"]],OM={alpha:"阿尔法",beta:"贝塔",gamma:"伽马",delta:"德尔塔",epsilon:"艾普西隆",zeta:"泽塔",eta:"伊塔",theta:"西塔",iota:"约塔",kappa:"卡帕",lambda:"拉姆达",mu:"缪",nu:"纽",xi:"克西",pi:"派",rho:"柔",sigma:"西格马",tau:"陶",phi:"斐",chi:"凯",psi:"普西",omega:"欧米伽"};function jM(e,t){if(e[t]!=="{")return null;let n=0;for(let r=t;r<e.length;r++)if(e[r]==="{")n++;else if(e[r]==="}"&&(n--,n===0))return{body:e.slice(t+1,r),end:r+1};return null}function Ia(e,t){const n=jM(e,t);return n||{body:e[t]??"",end:t+1}}function BM(e){let t=e;t=t.replace(/\\(?:left|right|displaystyle|limits)\b/g," "),t=t.replace(/\\[,;!\s]|\\quad|\\qquad|~/g," ");for(let n=0;n<12;n++){let r=t;r=r.replace(/\\[dt]?frac(?![A-Za-z])/g,"\\frac");{let i;for(;(i=r.indexOf("\\frac"))>=0;){const a=Ia(r,i+5),s=Ia(r,a.end);r=r.slice(0,i)+`${a.body} 分之 ${s.body} `+r.slice(s.end)}}{let i;for(;(i=r.indexOf("\\binom"))>=0;){const a=Ia(r,i+6),s=Ia(r,a.end);r=r.slice(0,i)+`${a.body} 取 ${s.body} `+r.slice(s.end)}}r=r.replace(/\\sqrt\s*\[( {[^{}]*} |[^\s\\]+)\s*\]\s*/g,(i,a)=>`${a.trim()} 次根号 `);{let i;for(;(i=r.indexOf("\\sqrt"))>=0;){const a=Ia(r,i+5);r=r.slice(0,i)+`根号 ${a.body} `+r.slice(a.end)}}if(r=r.replace(/\\(?:mathbf|mathbb|mathrm|mathit|boldsymbol|text|operatorname)\s*/g,i=>i.startsWith("\\text")?"":" "),r===t){t=r;break}t=r}for(let n=0;n<8;n++){const r=t.replace(/(\\frac|[\w)\]}]|\s)\s*\^\s*(\{[^{}]*\}|[^\s])|(\\frac|[\w)\]}]| )\s*_\s*(\{[^{}]*\}|[^\s])/g,(i,a,s,o,l)=>s!==void 0?`${a} 的 ${s.replace(/[{}]/g,"")} 次方`:`${o} 下标 ${l.replace(/[{}]/g,"")}`);if(r===t)break;t=r}for(const[n,r]of PM)t=t.split(n).join(` ${r} `);return t=t.replace(/\\([A-Za-z]+)\b/g,(n,r)=>` ${OM[r]??r} `),t=t.replace(/[{}]/g," "),t.replace(/\s+/g," ").trim()}function FM(e){return e.replace(/\$\$([^$]+)\$\$|\$([^$]+)\$/g,(t,n,r)=>{const i=BM(n??r??"");return i?` ${i} `:""})}const ap=new WeakMap;let $b=null;function zu(e){$b=e}function zM(){return $b}const Wb=1024;function Gb(e){let t=ap.get(e);return t||(t=e.createAnalyser(),t.fftSize=Wb,t.smoothingTimeConstant=.55,ap.set(e,t)),t}function HM(e,t){try{const n=Gb(e);t.connect(n),n.connect(e.destination)}catch{try{t.connect(e.destination)}catch{}}}const Gi=1024,sp=512,UM=3500,VM=7500,qM=.3,$M=.16,WM=1400,GM=2800,to=70,Yb=new Float64Array(Gi);for(let e=0;e<Gi;e++)Yb[e]=.5*(1-Math.cos(2*Math.PI*e/(Gi-1)));function YM(e,t){const n=e.length;for(let r=1,i=0;r<n;r++){let a=n>>1;for(;i&a;a>>=1)i^=a;if(i|=a,r<i){const s=e[r];e[r]=e[i],e[i]=s;const o=t[r];t[r]=t[i],t[i]=o}}for(let r=2;r<=n;r<<=1){const i=-2*Math.PI/r,a=Math.cos(i),s=Math.sin(i),o=r>>1;for(let l=0;l<n;l+=r){let u=1,c=0;for(let h=0;h<o;h++){const m=e[l+h],d=t[l+h],p=e[l+h+o],g=t[l+h+o],x=p*u-g*c,b=p*c+g*u;e[l+h]=m+x,t[l+h]=d+b,e[l+h+o]=m-x,t[l+h+o]=d-b;const v=u*a-c*s;c=u*s+c*a,u=v}}}}function KM(e,t){const n=e.length;let r=0;const i=new Float64Array(n),a=new Float64Array(n);for(let g=0;g<n;g++){const x=e[g];r+=Math.abs(x),i[g]=x*Yb[g]}YM(i,a);const s=n>>1,o=t/n,l=new Float64Array(s);let u=0,c=0,h=0,m=0,d=0,p=0;for(let g=0;g<s;g++){const x=g*o;if(x>=t/2-o)break;const b=Math.hypot(i[g],a[g])/s;l[g]=b,u+=b,x>=UM&&x<VM&&(c+=b),x>=wh.lo&&x<wh.hi?(h+=b,m+=b*x):x>=kh.lo&&x<kh.hi&&(d+=b,p+=b*x)}return{level:n>0?Math.min(1,r/n/.22):0,f1:h>0?m/h:400,f2:d>0?p/d:800,hfRatio:u>0?c/u:0}}function XM(e,t){return e.level<=G3?"closed":e.hfRatio>=qM?"SS":e.hfRatio>=$M&&e.level<.45?"FV":t==="closed"&&e.f2>=WM&&e.f2<=GM?"L":Y3(e.f1,e.f2,e.level)}function QM(e,t){const n=[],r=(c,h,m,d)=>{if(h<=0)return;const p=n[n.length-1];if(p&&p.viseme===m&&Math.abs(p.t+p.dur-c)<1e-9){p.dur+=h,p.level=Math.max(p.level,d);return}n.push({t:c,dur:h,viseme:m,level:d})};if(e.length<Gi)return{cues:[{t:0,dur:Math.max(0,e.length/t),viseme:"closed",level:0}],duration:Math.max(0,e.length/t)};let i="closed";const a=sp/t;for(let c=0;c+Gi<=e.length;c+=sp){const h=e.subarray(c,c+Gi),m=KM(h,t),d=XM(m,i);r(c/t,a,d,m.level),i=d}const s=e.length/t,o=n.length>0?n[n.length-1].t+n[n.length-1].dur:0;o<s-1e-9&&r(o,s-o,"closed",0);const l=n[0];if(l&&l.viseme!=="closed")if(l.dur<=to/1e3)l.viseme="closed";else{const c=Math.min(l.dur*.5,to/1e3);l.dur-=c,l.t+=c,n.unshift({t:0,dur:c,viseme:"closed",level:0})}const u=n[n.length-1];if(u&&u.viseme!=="closed"){const c=Math.min(u.dur*.5,to/1e3);u.dur-=c,n.push({t:u.t+u.dur,dur:c,viseme:"closed",level:0})}for(let c=n.length-1;c>=1;c--){const h=n[c];if(h.viseme!=="closed"&&h.dur<to/1e3){const m=n[c-1];m.dur+=h.dur,n.splice(c,1)}}return{cues:n,duration:s}}function ZM(e){const t=[...e].filter(i=>i.dur>0&&Number.isFinite(i.t)).sort((i,a)=>i.t-a.t),n=[];let r=0;for(const i of t){const a=Math.max(0,i.t/1e3),s=i.dur/1e3;a>r+1e-9&&n.push({t:r,dur:a-r,viseme:"closed",level:0});const o=n[n.length-1];o&&o.viseme===i.viseme&&Math.abs(o.t+o.dur-a)<1e-9?(o.dur+=s,o.level=Math.max(o.level,Math.min(1,Math.max(0,i.level)))):n.push({t:a,dur:s,viseme:i.viseme,level:Math.min(1,Math.max(0,i.level))}),r=a+s}return{cues:n,duration:r}}function JM(e,t){const n=e.cues;if(n.length===0||t<0)return null;let r=0,i=n.length-1;for(;r<i;){const s=r+i+1>>1;n[s].t<=t?r=s:i=s-1}const a=n[r];return t<=a.t+a.dur+1e-9?a:null}function Kb(){const[e,t]=w.useState(null),[n,r]=w.useState(null),[i,a]=w.useState(null),[s,o]=w.useState([]),l=w.useRef([]),[u,c]=w.useState(null),[h,m]=w.useState(!1),d=w.useRef(null),p=w.useRef(new Map),g=w.useRef(new Map),x=w.useRef(0),b=w.useRef(!1),v=w.useRef([]),E=w.useRef(0),N=w.useRef(0),k=w.useRef(!1),S=w.useRef(null),_=w.useRef(0),C=w.useRef(null),I=w.useRef(null),A=w.useRef(null);A.current||(A.current=()=>{const V=I.current,Z=typeof window<"u"?window.speechSynthesis:void 0;if(!V||V.stopped||!Z)return;if(V.i>=V.sentences.length){I.current=null,S.current=null,t(null),r(null),a(null);return}const O=V.i,X=FM(V.sentences[O]),ne=new SpeechSynthesisUtterance(X);V.voice&&(ne.voice=V.voice,ne.lang=V.voice.lang),ne.rate=V.rate,ne.onstart=()=>{!I.current||I.current.stopped||a({index:O,total:V.sentences.length,text:X})};const P=()=>{var te;!I.current||I.current.stopped||(I.current.i+=1,(te=A.current)==null||te.call(A))};ne.onend=P,ne.onerror=P,Z.speak(ne)});const R=w.useCallback((V,Z)=>{var P;if(typeof window>"u"||!("speechSynthesis"in window)){c("engine-unavailable");return}const O=JN(Z);if(O.length===0){c("empty-text");return}l.current=O.slice(),o(O.slice()),_.current=O.length,r({index:0,total:O.length,text:O[0]??""});const X=C.current,ne=ip(window.speechSynthesis.getVoices(),(X==null?void 0:X.systemVoice)??null);I.current={messageId:V,sentences:O,i:0,stopped:!1,voice:ne,rate:op(X==null?void 0:X.speed)},window.speechSynthesis.cancel(),(P=A.current)==null||P.call(A)},[]),L=()=>{if(!d.current){const V=window.AudioContext??window.webkitAudioContext;d.current=new V}return d.current.resume(),d.current},z=w.useCallback(()=>{k.current&&N.current>=E.current&&!b.current&&(S.current=null,t(null),r(null),a(null))},[]),j=w.useCallback(()=>{const V=d.current;if(!V||b.current)return;const Z=p.current.get(x.current);if(!Z){z();return}const O=x.current;p.current.delete(O),b.current=!0,a({index:O,total:_.current,text:l.current[O]??""}),x.current+=1;const X=V.createBufferSource();X.buffer=Z,HM(V,X),zu({ctx:V,timeline:g.current.get(O)??null,startedAtCtxTime:V.currentTime,analyser:Gb(V)}),X.onended=()=>{N.current+=1,b.current=!1,zu(null),j()},v.current.push(X),X.start()},[z]),B=w.useCallback(()=>{for(const V of v.current)try{V.onended=null,V.stop()}catch{}v.current=[],p.current.clear(),g.current.clear(),zu(null),b.current=!1,E.current=0,N.current=0,k.current=!1,S.current=null,x.current=0,_.current=0,l.current=[],o([]),t(null),r(null),a(null),I.current&&(I.current.stopped=!0,I.current=null),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()},[]),H=w.useCallback(()=>{B(),window.api.ttsStop().catch(()=>{})},[B]),Y=w.useCallback((V,Z)=>{var O;if(S.current===V){H();return}if(B(),window.dispatchEvent(new CustomEvent("lookatstudy-speech-start",{detail:V})),c(null),S.current=V,E.current=0,N.current=0,k.current=!1,x.current=0,_.current=0,t(V),r({index:0,total:0,text:""}),((O=C.current)==null?void 0:O.engine)==="system"){R(V,Z);return}L(),window.api.ttsSpeak(Z,V).then(X=>{if(X.ok){X.firstUse&&m(!0);return}B(),X.reason!=="empty-text"&&c(X.reason)}).catch(()=>B())},[R,H,B]);return w.useEffect(()=>{const V=window.api.on("speech:ttsAudio",X=>{if(X.messageId!==S.current)return;const ne=L();E.current+=1,_.current=X.sentenceTotal,r({index:X.sentenceIndex,total:X.sentenceTotal,text:X.sentence??""}),X.sentence!=null&&(l.current[X.sentenceIndex]=X.sentence,o(l.current.slice())),ne.decodeAudioData(X.wavBytes).then(P=>{var te;if(X.messageId===S.current){p.current.set(X.sentenceIndex,P);try{const Q=(te=X.visemeCues)!=null&&te.length?ZM(X.visemeCues):QM(eI(P),P.sampleRate);Q&&g.current.set(X.sentenceIndex,Q)}catch{}j()}},()=>{X.messageId===S.current&&(E.current-=1,j())})}),Z=window.api.on("speech:ttsDone",X=>{X.messageId===S.current&&(k.current=!0,z())}),O=window.api.on("speech:ttsError",()=>B());return()=>{V(),Z(),O()}},[z,j,B]),w.useEffect(()=>B,[B]),w.useEffect(()=>{const V=Z=>{const O=Z.detail;S.current&&O!==S.current&&B()};return window.addEventListener("lookatstudy-speech-start",V),()=>window.removeEventListener("lookatstudy-speech-start",V)},[B]),w.useEffect(()=>{let V=!0;const Z=()=>{Promise.all([window.api.getSetting("tts_engine"),window.api.getSetting("tts_system_voice"),window.api.getSetting("tts_speed")]).then(([O,X,ne])=>{V&&(C.current={engine:(O??"").trim(),systemVoice:X??null,speed:op(ne)})}).catch(()=>{})};return Z(),window.addEventListener(u0,Z),()=>{V=!1,window.removeEventListener(u0,Z)}},[]),w.useEffect(()=>{if(typeof window>"u"||!("speechSynthesis"in window))return;const V=()=>{var O;const Z=I.current;!Z||Z.voice||(Z.voice=ip(window.speechSynthesis.getVoices(),((O=C.current)==null?void 0:O.systemVoice)??null))};return window.speechSynthesis.addEventListener("voiceschanged",V),()=>window.speechSynthesis.removeEventListener("voiceschanged",V)},[]),w.useEffect(()=>{K3(e!==null)},[e]),{speakingMessageId:e,speakingSentence:n,playingSentence:i,streamTexts:s,failReason:u,clearFailReason:()=>c(null),onlineNotice:h,clearOnlineNotice:()=>m(!1),speak:Y,stop:H}}function eI(e){if(e.numberOfChannels===1)return e.getChannelData(0);const t=e.getChannelData(0),n=e.getChannelData(1),r=new Float32Array(t.length);for(let i=0;i<t.length;i++)r[i]=(t[i]+n[i])/2;return r}function op(e){const t=typeof e=="number"?e:Number.parseFloat(e??"");return Number.isFinite(t)?Math.min(2,Math.max(.5,t)):1}const Xb=w.createContext(null);let tI=0;const nI={default:4e3,success:4e3,info:4e3,warning:5e3,error:6e3},rI={default:null,success:f.jsx(Wn,{className:"w-4 h-4 text-brand shrink-0"}),error:f.jsx(xc,{className:"w-4 h-4 text-warning shrink-0"}),warning:f.jsx(wr,{className:"w-4 h-4 text-review shrink-0"}),info:f.jsx(jy,{className:"w-4 h-4 text-accent shrink-0"})};function iI({children:e}){const[t,n]=w.useState([]),r=w.useCallback(s=>{n(o=>o.filter(l=>l.id!==s))},[]),i=w.useCallback(s=>{n(o=>o.map(l=>l.id===s?{...l,exiting:!0}:l))},[]),a=w.useCallback((s,o)=>{const l=++tI,u=(o==null?void 0:o.severity)??"default",c=(o==null?void 0:o.duration)??nI[u],h={id:l,message:s,action:o==null?void 0:o.action,duration:c,severity:u,exiting:!1};n(m=>[...m,h]),window.setTimeout(()=>i(l),c)},[i]);return f.jsxs(Xb.Provider,{value:{show:a},children:[e,f.jsx("div",{className:"fixed top-14 left-1/2 -translate-x-1/2 z-[100] flex flex-col items-center gap-2 pointer-events-none",role:"region","aria-live":"polite","aria-label":"Notifications",children:t.map(s=>f.jsx(aI,{item:s,onAction:()=>{s.action.onClick(),i(s.id)},onDismiss:()=>i(s.id),onExitDone:()=>r(s.id)},s.id))})]})}function aI({item:e,onAction:t,onDismiss:n,onExitDone:r}){const i=$e(),a=rI[e.severity];return f.jsxs("div",{className:`pointer-events-auto flex items-center gap-2.5 pl-4 pr-2 py-2 rounded-full bg-surface-0 text-ink-strong text-body shadow-elevated max-w-md ${e.exiting?"toast-exit":"toast-enter"}`,"data-testid":`toast-${e.id}`,"data-severity":e.severity,onAnimationEnd:e.exiting?r:void 0,children:[a,f.jsx("span",{className:"flex-1",children:e.message}),e.action&&f.jsx("button",{onClick:t,className:"text-brand font-bold text-body hover:underline shrink-0 px-1.5 py-1 rounded transition-colors hover:bg-brand/10","data-testid":`toast-action-${e.id}`,children:e.action.label}),f.jsx("button",{onClick:n,className:"text-ink-muted hover:text-ink-strong shrink-0 w-6 h-6 flex items-center justify-center rounded transition-colors hover:bg-surface-3","aria-label":i("action.close"),children:f.jsx(Fn,{className:"w-3.5 h-3.5"})})]})}function zd(){const e=w.useContext(Xb);return e||{show:()=>{}}}function sI(e){const t=Array.isArray(e)?e[0]:e,n=(t==null?void 0:t.props)??{},r=/language-(\w+)/.exec(n.className??""),i=n.children,a=typeof i=="string"?i:Array.isArray(i)?i.join(""):"";return{lang:(r==null?void 0:r[1])??"",text:a}}function Qb({children:e,...t}){const n=$e(),[r,i]=w.useState(!1),[a,s]=w.useState(null),{lang:o,text:l}=sI(e);w.useEffect(()=>{let c=!0;if(l)return MM(l.replace(/\n$/,""),o).then(h=>{c&&h&&s(h)}),()=>{c=!1}},[l]);const u=()=>{var c;(c=navigator.clipboard)==null||c.writeText(l).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})};return f.jsxs("div",{className:"relative group my-3","data-testid":"md-codeblock",children:[f.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-1 border border-b-0 border-[var(--border-faint)] rounded-t-md",children:[f.jsx("span",{className:"text-caption font-mono text-ink-faint uppercase tracking-wider",children:o||"code"}),f.jsx("button",{onClick:u,"aria-label":n("chat.copy"),className:"text-caption text-ink-muted hover:text-brand transition-colors opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 inline-flex items-center gap-1","data-testid":"md-copy",children:r?f.jsxs(f.Fragment,{children:[f.jsx(Tn,{className:"w-3 h-3 inline"}),n("chat.copied")]}):f.jsxs(f.Fragment,{children:[f.jsx(My,{className:"w-3 h-3 inline"}),n("chat.copy")]})})]}),a?f.jsx("div",{className:"md-shiki","data-testid":"md-shiki",dangerouslySetInnerHTML:{__html:a}}):f.jsx("pre",{...t,className:"!mt-0 !rounded-t-none !border-t-0",children:e})]})}function oI(e){const t=[];let n=null,r=0;for(const i of e.split(`
781
+ `)){const a=/^(\s*)(`{3,}|~{3,})/.exec(i);if(n==null){if(a){n=(a[2]??"")[0]??"`",r=(a[2]??"").length,t.push(`${a[1]??""}- 代码块`);continue}t.push(i)}else new RegExp(`^\\s*\\${n==="~"?"~":"`"}{${r},}\\s*$`).test(i)&&(n=null)}return t.join(`
782
+ `).replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/<!--[\s\S]*?-->/g,"")}function lI(){if(typeof document>"u")return["#58cc02","#1cb0f6","#ffc800","#a67cd8","#ff7a00"];const e=getComputedStyle(document.documentElement),t=(n,r)=>{const i=e.getPropertyValue(n).trim();return i?`rgb(${i})`:r};return[t("--brand-rgb","#58cc02"),t("--accent-rgb","#1cb0f6"),t("--gold-rgb","#ffc800"),"#a67cd8",t("--warning-rgb","#ff7a00")]}function uI({markdown:e}){const t=$e(),n=w.useRef(null),r=w.useRef(null),[i,a]=w.useState(!1),s=oI(e);return w.useEffect(()=>{let o=!1;return(async()=>{try{const[{Transformer:l},{Markmap:u}]=await Promise.all([Ye(()=>import("./index-yzG6be5R.js"),__vite__mapDeps([30,31,1,2]),import.meta.url),Ye(()=>import("./index-H1bePBGl.js"),__vite__mapDeps([32,31,5,33,34,35,36]),import.meta.url)]),c=n.current;if(!c||o)return;if(!r.current){const m=lI();r.current=u.create(c,{autoFit:!1,duration:0,pan:!1,zoom:!1,initialExpandLevel:2,maxWidth:260,spacingVertical:10,spacingHorizontal:96,paddingX:12,color:d=>{var p;return m[(((p=d.state)==null?void 0:p.depth)??0)%m.length]??m[0]}})}const{root:h}=new l().transform(s);r.current.setData(h),r.current.fit()}catch{o||a(!0)}})(),()=>{o=!0}},[s]),i?f.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2 my-4",children:[f.jsx(U0,{className:"w-4 h-4"}),t("notebook.content.render_failed")]}):f.jsx("div",{"data-testid":"mindmap-view",className:"mindmap-view h-[68vh] min-h-[420px] my-2",children:f.jsx(fa,{grid:!0,testid:"mindmap-stage",children:f.jsx("div",{className:"w-[1280px] h-[760px]",children:f.jsx("svg",{ref:n,className:"w-full h-full block"})})})})}const cI={concept_map:G0,quiz:q0,compare_table:tg,diagram:Ly,code_walkthrough:Y1},dI=new Set(["concept_map","quiz","compare_table","diagram","code_walkthrough"]);function hI(e,t){return dI.has(t)?e(`artifact.type.${t}`):e("artifact.type.unknown")}function fI({selectedNode:e,items:t,loading:n,forceTab:r,canvasArtifact:i,isReviewing:a,onReviewDone:s,onUserTabChange:o,onRemove:l,onTogglePin:u,onRecordQuizResult:c,onSaveContentNote:h,onUpdateNoteComment:m,onJumpToSource:d,onQuoteToChat:p,locale:g}){var _;const x=$e(),[b,v]=w.useState("content"),E=r??b,N=C=>{v(C),o==null||o()},k=e?t.filter(C=>C.nodeId===e.id):[],S=w.useRef(null);return w.useEffect(()=>{var C;(C=S.current)==null||C.scrollTo({top:0})},[e==null?void 0:e.id]),f.jsxs("div",{className:"relative h-full flex flex-col bg-surface-2","data-testid":"notebook-panel",children:[f.jsx("div",{className:"px-3 pt-3 pb-1 shrink-0","data-testid":"notebook-tabs",children:f.jsxs("div",{className:"flex p-1 rounded-lg gap-1 bg-ink/[0.08]",role:"tablist","aria-label":"Notebook",children:[f.jsx(qu,{label:x("notebook.tab.explain"),icon:or,active:E==="content",onClick:()=>N("content"),testid:"tab-content"}),f.jsx(qu,{label:x("notebook.tab.notes"),icon:qy,active:E==="notes",onClick:()=>{N("notes"),V1()},testid:"tab-notes",badge:k.length>0?String(k.length):void 0}),f.jsx(qu,{label:x("notebook.tab.board"),icon:Vl,active:E==="board",onClick:()=>N("board"),testid:"tab-board"})]})}),f.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 animate-tab-slide",ref:S,role:"tabpanel",children:E==="board"?f.jsx("div",{className:"h-full flex flex-col","data-testid":"board-tab-content",children:i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"px-4 pt-3 pb-2 shrink-0 flex items-center gap-2 min-w-0",children:[f.jsx(Vl,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("span",{className:"text-label font-bold text-ink truncate",children:((_=i.output)==null?void 0:_.title)??i.toolName})]}),f.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",children:f.jsx("div",{className:"h-full rounded-xl overflow-hidden bg-surface-0/60 border border-[var(--border-faint)]",children:f.jsx(fa,{testid:"board-canvas-stage",children:f.jsx(Fd,{data:i.output,variant:"canvas"})})})})]}):f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[f.jsx(Vl,{className:"w-10 h-10 mb-3 text-ink-muted opacity-30"}),f.jsx("div",{className:"text-body text-ink-muted max-w-sm leading-relaxed",children:x("notebook.board.empty")})]})}):f.jsx(f.Fragment,{children:f.jsx("div",{className:"mx-auto w-full max-w-[960px] min-h-full flex flex-col",children:E==="content"?f.jsx(mI,{selectedNode:e,contentNotes:k.filter(C=>C.artifactType==="user_note"&&C.sourceAnchor),onQuoteToChat:p,onSaveContentNote:h,locale:g,isReviewing:a,onReviewDone:s}):f.jsx(pI,{items:k,loading:n,selectedNode:e,onRemove:l,onTogglePin:u,onRecordQuizResult:c,onUpdateNoteComment:m,onJumpToSource:d})})})},E)]})}function mI({selectedNode:e,contentNotes:t,onQuoteToChat:n,onSaveContentNote:r,locale:i,isReviewing:a,onReviewDone:s}){const o=$e(),l=zd(),u=Kb();w.useEffect(()=>{if(u.failReason){const H=u.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":u.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":u.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":u.failReason==="edge-failed"?"chat.speech.edge_failed":"chat.speech.model_missing";l.show(o(H),{severity:"warning"}),u.clearFailReason()}else u.onlineNotice&&(l.show(o("chat.speech.edge_disclosed"),{severity:"info"}),u.clearOnlineNotice())},[u.failReason,u.onlineNotice,l,o,u]);const c=w.useRef(u.stop);c.current=u.stop;const h=e?`content-${e.id}`:null;w.useEffect(()=>()=>{c.current()},[h]);const[m,d]=w.useState(null),[p,g]=w.useState(!1),[x,b]=w.useState(!1),[v,E]=w.useState(!1),[N,k]=w.useState([]),[S,_]=w.useState(null),C=w.useRef(null),I=w.useRef(null),A=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches;w.useEffect(()=>{if(!e){d(null),b(!1);return}let H=!1;return g(!0),b(!1),ie.getNodeContent(e.id,i??void 0).then(Y=>{H||d(Y)}).catch(()=>{H||(d(null),b(!0))}).finally(()=>{H||g(!1)}),()=>{H=!0}},[e==null?void 0:e.id,i]),w.useEffect(()=>{if(!e){k([]);return}let H=!1;return ie.listAssetsByNode(e.id).then(Y=>{H||k(Y)}).catch(()=>{H||k([])}),()=>{H=!0}},[e==null?void 0:e.id]),w.useEffect(()=>{if(!m||!C.current)return;const H=[];for(const V of t)try{const Z=JSON.parse(V.sourceAnchor);if(Z.type==="content"){const O=JSON.parse(V.data).text??"";O&&H.push({noteId:V.id,text:O,surrounding:Z.surroundingText})}}catch{}const Y=setTimeout(()=>{I.current&&Cb(I.current,H)},80);return()=>clearTimeout(Y)},[m,t]),w.useEffect(()=>{const H=Y=>{var O;const V=Y.detail;if(!V)return;const Z=(O=I.current)==null?void 0:O.querySelector(`mark[data-note-id="${V}"]`);Z&&Pb(Z)};return window.addEventListener("lookatstudy-jump-to-note",H),()=>window.removeEventListener("lookatstudy-jump-to-note",H)},[]);const R=u.speakingMessageId===h&&u.playingSentence!=null?u.playingSentence.index:null;w.useEffect(()=>{const H=I.current;if(!H)return;if(R==null){bi(H);return}const Y=jb(u.streamTexts,R);if(!Y)return;R===0&&Rb(H);const V=setTimeout(()=>{const Z=Lb(H,Y);Z&&Db(Z,H.closest(".overflow-y-auto"))},30);return()=>clearTimeout(V)},[R,u.streamTexts,h]),w.useEffect(()=>{R==null&&I.current&&bi(I.current)},[R]);const L=w.useRef(!1);L.current=R!=null,w.useEffect(()=>()=>{L.current&&bi(document.body)},[]);const z=w.useCallback(()=>{var ee;if(!n&&!r)return;const H=window.getSelection(),Y=(H==null?void 0:H.toString().trim())??"";if(Y.length<2||Y.length>500){_(null);return}const V=H==null?void 0:H.getRangeAt(0);if(!V||!((ee=C.current)!=null&&ee.contains(V.commonAncestorContainer))){_(null);return}const Z=V.getBoundingClientRect(),O=C.current.getBoundingClientRect(),X=I.current;let ne=null;if(X&&X.contains(V.commonAncestorContainer)){const Ce=cs(X);ne=Eb(V,Ce)}const P=X?cs(X).text:Y,te=ne?ne.start:P.indexOf(Y),Q=te>=0?P.slice(Math.max(0,te-30),te+Y.length+30):Y,K=V.getClientRects(),ce=K.length?K[K.length-1]:Z,le=Bb({left:Z.left-O.left,top:Z.top-O.top,right:Z.right-O.left,bottom:Z.bottom-O.top,width:Z.width,height:Z.height},O.width,n?A?190:150:A?140:100,{left:ce.left-O.left,top:ce.top-O.top,right:ce.right-O.left,bottom:ce.bottom-O.top,width:ce.width,height:ce.height},A);_({x:le.left,y:le.top,transform:le.transform,text:Y,surrounding:Q,offsets:ne??void 0})},[n,r,A]);w.useEffect(()=>{const H=A?600:250;let Y=null,V=null,Z=!1;const O=()=>{var te;return(((te=window.getSelection())==null?void 0:te.toString().trim().length)??0)>=2},X=()=>{O()?(V&&(clearTimeout(V),V=null),_(te=>te&&null),Y&&clearTimeout(Y),Y=setTimeout(()=>{Y=null,!Z&&O()&&z()},H)):V||(V=setTimeout(()=>_(te=>te&&null),250))},ne=te=>{var K;const Q=te.target;(K=Q==null?void 0:Q.closest)!=null&&K.call(Q,"[data-selection-popover]")||(Z=!0)},P=()=>{Z=!1,Y&&(clearTimeout(Y),Y=null),!V&&O()&&z()};return document.addEventListener("selectionchange",X),window.addEventListener("pointerdown",ne,!0),window.addEventListener("pointerup",P,!0),window.addEventListener("pointercancel",P,!0),()=>{document.removeEventListener("selectionchange",X),window.removeEventListener("pointerdown",ne,!0),window.removeEventListener("pointerup",P,!0),window.removeEventListener("pointercancel",P,!0),Y&&clearTimeout(Y),V&&clearTimeout(V)}},[z]);const j=w.useCallback(()=>{var Y;if(!S||!n)return;const H=S.text.length>200?S.text.slice(0,200)+"…":S.text;n(o("notebook.quote.template",{text:H})),_(null),(Y=window.getSelection())==null||Y.removeAllRanges()},[S,n,o]),B=w.useCallback(()=>{var Y,V,Z;if(!S||!r||!e)return;const H=S.text.length>200?S.text.slice(0,200)+"…":S.text;r(H,{type:"content",surroundingText:S.surrounding,startOffset:(Y=S.offsets)==null?void 0:Y.start,endOffset:(V=S.offsets)==null?void 0:V.end}),V1(),setTimeout(()=>{var ne;const O=(ne=I.current)==null?void 0:ne.querySelectorAll("mark.lookatstudy-underline"),X=O&&O.length>0?O[O.length-1]:null;X&&WN(X)},200),_(null),(Z=window.getSelection())==null||Z.removeAllRanges()},[S,r,e]);return e?f.jsxs("div",{className:"p-5 relative","data-testid":"node-content",ref:C,children:[!p&&!x&&m&&f.jsxs("div",{className:"sticky top-0 z-20 flex justify-end gap-2 -mt-2 pointer-events-none",children:[f.jsx("button",{onClick:()=>E(H=>!H),"data-tooltip":o("notebook.mindmap.toggle"),"aria-label":o("notebook.mindmap.toggle"),"aria-pressed":v,"data-testid":"node-content-mindmap",className:`pointer-events-auto shrink-0 rounded-full p-2 bg-surface-2 shadow-elevated transition-colors ${v?"text-accent":"text-ink-muted hover:text-ink-strong"}`,children:f.jsx(U0,{className:"w-4 h-4"})}),f.jsx("button",{onClick:()=>u.speak(h??"content",m),"data-tooltip":u.speakingMessageId===h?o("chat.speech.stop"):o("chat.speech.read_aloud_node"),"aria-label":u.speakingMessageId===h?o("chat.speech.stop"):o("chat.speech.read_aloud_node"),"data-testid":u.speakingMessageId===h?"node-content-speak-active":"node-content-speak",className:`pointer-events-auto shrink-0 rounded-full p-2 bg-surface-2 shadow-elevated transition-colors ${u.speakingMessageId===h?"text-brand animate-pulse":"text-ink-muted hover:text-ink-strong"}`,children:u.speakingMessageId===h?f.jsx(Y0,{className:"w-4 h-4"}):f.jsx(rg,{className:"w-4 h-4"})})]}),f.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-1",children:e.type==="section"?o("notebook.node_type.section"):e.type==="concept"?o("notebook.node_type.concept"):o("notebook.node_type.lesson")}),f.jsx("div",{className:"flex items-start justify-between gap-3 mb-4",children:f.jsx("h2",{className:"text-title font-extrabold text-ink-strong tracking-tight","data-testid":"node-content-title",children:e.title})}),p?f.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),o("notebook.content.loading")]}):x?f.jsxs("div",{className:"text-body text-warning",children:[o("notebook.content.load_failed"),f.jsx("button",{className:"underline ml-1",onClick:()=>{b(!1),g(!0),ie.getNodeContent(e.id,i??void 0).then(d).catch(()=>b(!0)).finally(()=>g(!1))},children:o("notebook.content.retry")})]}):m?v?f.jsx(uI,{markdown:m}):f.jsx(ON,{fallback:(H,Y)=>f.jsxs("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto",children:[f.jsx("div",{className:"text-body text-warning mb-2",children:o("notebook.content.render_failed")}),f.jsxs("pre",{className:"text-caption text-ink-muted whitespace-pre-wrap break-words bg-surface-1 p-3 rounded",children:[m.slice(0,500),m.length>500?`
783
+ `+o("notebook.content.truncated"):""]}),f.jsx("div",{className:"flex gap-2 mt-2",children:f.jsx("button",{className:"text-caption underline text-accent",onClick:Y,children:o("notebook.content.retry_render")})})]}),children:f.jsx("div",{ref:I,className:"prose prose-sm max-w-[80ch] leading-relaxed break-words overflow-x-auto [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_img]:max-w-full [&_video]:max-w-full [&_iframe]:max-w-full select-text",children:f.jsx(t2,{remarkPlugins:[C2,N2],rehypePlugins:[xb,[wb,kb],Ox],urlTransform:H=>H,components:{pre({children:H,...Y}){return f.jsx(Qb,{...Y,children:H})},a({children:H,...Y}){return f.jsx("a",{...Y,target:"_blank",rel:"noopener noreferrer",children:H})},img({src:H,alt:Y,...V}){return f.jsx(gI,{src:H,alt:Y,assets:N,...V})},table({children:H}){return f.jsx("div",{className:"overflow-x-auto my-4",children:f.jsx("table",{children:H})})}},children:Ob(m)})})},`${e.id}-${i??"orig"}`):f.jsx("div",{className:"text-body text-ink-muted",children:o("notebook.content.empty")}),N.length>0&&f.jsxs("div",{className:"mt-6 pt-4 border-t border-[var(--border-faint)]",children:[f.jsxs("div",{className:"text-label font-bold text-ink-muted mb-2 flex items-center gap-1",children:[f.jsx(Oy,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:o("notebook.images.heading",{n:N.length})})]}),f.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:N.map(H=>f.jsx(xI,{asset:H},H.id))})]}),S&&f.jsxs("div",{"data-selection-popover":!0,style:{left:S.x,top:S.y,transform:S.transform},className:"absolute z-20 flex items-center gap-0.5 msg-enter whitespace-nowrap",children:[n&&f.jsxs("button",{onClick:j,"data-testid":"quote-to-chat-btn","aria-label":o("notebook.quote.ask"),className:"px-2 py-1.5 rounded-lg bg-brand text-white text-label font-bold shadow-elevated flex items-center gap-1 hover:bg-brand-light transition-colors",children:[f.jsx(J1,{className:"w-3 h-3"}),o("notebook.quote.ask")]}),f.jsxs("button",{onClick:B,"data-testid":"save-note-btn","aria-label":o("notebook.quote.add_note"),className:"px-2 py-1.5 rounded-lg bg-accent text-white text-label font-bold shadow-elevated flex items-center gap-1 hover:brightness-110 transition",title:o("notebook.quote.save_note.title"),children:[f.jsx(ns,{className:"w-3.5 h-3.5"}),o("notebook.quote.add_note")]})]}),e.sourcePath&&f.jsx("div",{className:"mt-6 pt-3 border-t border-[var(--border-faint)] text-label text-ink-muted",children:o("notebook.source.label",{path:e.sourcePath})}),f.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-accent/5 border border-accent/20 text-body text-ink-muted flex items-start gap-1.5",children:[f.jsx(Mo,{className:"w-3.5 h-3.5 shrink-0 mt-0.5 text-accent"}),f.jsx("span",{children:o("notebook.quote.hint")})]}),a&&e&&f.jsx(jN,{nodeId:e.id,onRated:s})]}):f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[f.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),f.jsx("div",{className:"text-body text-ink-muted max-w-xs",children:o("notebook.empty.select_node")})]})}function pI({items:e,loading:t,selectedNode:n,onRemove:r,onTogglePin:i,onRecordQuizResult:a,onUpdateNoteComment:s,onJumpToSource:o}){const l=$e();if(!n)return f.jsx(lp,{message:l("notebook.empty.notes.title"),icon:"📓"});if(t)return f.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 text-body text-ink-muted",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),l("notebook.empty.notes.title")]});const u=e.filter(g=>["concept_map","compare_table","diagram","code_walkthrough"].includes(g.artifactType)),c=e.filter(g=>g.artifactType==="user_note"),h=e.filter(g=>g.artifactType==="quiz"),m=e.length,d=h.filter(g=>g.lastResult==="correct").length,p=h.filter(g=>g.lastResult==="wrong").length;return m===0?f.jsx(lp,{message:l("notebook.empty.no_notes_message"),icon:"🧩"}):f.jsxs("div",{className:"p-4 space-y-3","data-testid":"notes-list",children:[f.jsx(Hu,{title:l("notebook.zone.understand"),icon:f.jsx(G0,{className:"w-4 h-4"}),subtitle:l("notebook.zone.understand.subtitle"),count:u.length,testid:"zone-understand",defaultOpen:!1,children:u.length===0?f.jsx(Uu,{hint:l("notebook.zone.understand.empty_hint")}):u.map(g=>f.jsx(Vu,{item:g,onRemove:r,onTogglePin:i,onRecordQuizResult:a,onUpdateNoteComment:s,onJumpToSource:o},g.id))}),f.jsx(Hu,{title:l("notebook.zone.note"),icon:f.jsx(ns,{className:"w-4 h-4"}),subtitle:l("notebook.zone.note.subtitle"),count:c.length,testid:"zone-note",defaultOpen:!1,children:c.length===0?f.jsx(Uu,{hint:l("notebook.zone.note.empty_hint")}):c.map(g=>f.jsx(Vu,{item:g,onRemove:r,onTogglePin:i,onRecordQuizResult:a,onUpdateNoteComment:s,onJumpToSource:o},g.id))}),f.jsx(Hu,{title:l("notebook.zone.practice"),icon:f.jsx(q0,{className:"w-4 h-4"}),subtitle:h.length>0?l("notebook.zone.practice.subtitle_stats",{total:h.length,correct:d,wrong:p}):l("notebook.zone.practice.subtitle_empty"),count:h.length,testid:"zone-practice",defaultOpen:!1,children:h.length===0?f.jsx(Uu,{hint:l("notebook.zone.practice.empty_hint")}):h.map(g=>f.jsx(Vu,{item:g,onRemove:r,onTogglePin:i,onRecordQuizResult:a,onUpdateNoteComment:s,onJumpToSource:o},g.id))})]})}function Hu({title:e,icon:t,subtitle:n,count:r,testid:i,defaultOpen:a=!0,children:s}){const[o,l]=w.useState(a),u=w.useRef(!0),c=w.useRef(r);return w.useEffect(()=>{if(u.current){u.current=!1,c.current=r;return}r>c.current&&l(!0),c.current=r},[r]),f.jsxs("section",{className:"rounded-xl bg-surface-1 overflow-hidden","data-testid":i,children:[f.jsxs("button",{onClick:()=>l(h=>!h),"aria-expanded":o,className:"w-full flex items-center gap-2 px-3 py-2.5 bg-surface-1/50 hover:bg-surface-3/60 transition-colors text-left","data-testid":`${i}-toggle`,children:[f.jsx(V0,{className:`w-4 h-4 text-ink-muted transition-transform duration-200 ease-out-back ${o?"":"-rotate-90"}`}),f.jsx("span",{className:"text-body text-ink-strong flex items-center",children:t}),f.jsx("span",{className:"text-body font-bold text-ink",children:e}),f.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded-full bg-brand/15 text-brand",children:r}),f.jsx("span",{className:"text-label text-ink-muted ml-auto truncate",children:n})]}),f.jsx("div",{className:"grid transition-all duration-200 ease-out-expo",style:{gridTemplateRows:o?"1fr":"0fr"},children:f.jsx("div",{className:"overflow-hidden",children:f.jsx("div",{className:"p-3 space-y-3",children:s})})})]})}function Uu({hint:e}){return f.jsx("div",{className:"text-center py-3 text-body text-ink-muted",children:e})}function Vu({item:e,onRemove:t,onTogglePin:n,onRecordQuizResult:r,onUpdateNoteComment:i,onJumpToSource:a}){const s=$e(),[o,l]=w.useState(!1),[u,c]=w.useState(e.notes??""),h=w.useCallback((E,N,k)=>{e.nodeId&&ie.recordQuizAnswer(e.nodeId,k).catch(()=>{}),r(e.id,k)},[e.nodeId,e.id,r]),m=e.artifactType==="user_note";let d="",p=null;if(m){try{d=JSON.parse(e.data).text??""}catch{d=e.title??""}try{e.sourceAnchor&&(p=JSON.parse(e.sourceAnchor))}catch{p=null}}let g=null;if(!m)try{g=JSON.parse(e.data)}catch{g=null}const x=new Date(e.createdAt),b=`${x.getMonth()+1}/${x.getDate()} ${x.getHours().toString().padStart(2,"0")}:${x.getMinutes().toString().padStart(2,"0")}`;if(m){const E=e.notes&&e.notes.trim().length>0?e.notes:null,N=()=>{c(E??""),l(!0)},k=()=>{c(E??""),l(!1)},S=()=>{i==null||i(e.id,u),l(!1)};return f.jsx("div",{className:`bg-surface-2 rounded-lg p-3 relative ${e.pinned?"ring-1 ring-brand/40 bg-brand/5":""}`,"data-testid":`canvas-item-${e.id.slice(0,8)}`,children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(Ky,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body text-ink leading-relaxed whitespace-pre-wrap",children:d}),i&&o?f.jsxs("div",{className:"mt-2 space-y-1.5","data-testid":`note-comment-edit-${e.id.slice(0,8)}`,children:[f.jsx("textarea",{value:u,onChange:_=>c(_.target.value),rows:2,placeholder:s(E?"notebook.note.comment.ph_edit":"notebook.note.comment.ph_new"),className:"w-full text-label leading-relaxed p-2 rounded-md border border-[var(--border-faint)] bg-surface-0 text-ink resize-none focus:outline-none focus:border-brand","data-testid":`note-comment-textarea-${e.id.slice(0,8)}`}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("button",{onClick:S,className:"inline-flex items-center gap-1 text-caption font-bold text-white bg-brand hover:bg-brand/90 px-2 py-0.5 rounded","data-testid":`note-comment-save-${e.id.slice(0,8)}`,children:[f.jsx(Tn,{className:"w-3 h-3"})," ",s("notebook.action.save")]}),f.jsxs("button",{onClick:k,className:"inline-flex items-center gap-1 text-caption text-ink-muted hover:text-ink","data-testid":`note-comment-cancel-${e.id.slice(0,8)}`,children:[f.jsx(Fn,{className:"w-3 h-3"})," ",s("notebook.action.cancel")]})]})]}):E?f.jsxs("div",{className:"mt-2 px-2.5 py-1.5 rounded-lg bg-ink/5",children:[f.jsx("div",{className:"text-label text-ink-muted italic leading-relaxed whitespace-pre-wrap",children:E}),i&&f.jsxs("button",{onClick:N,className:"mt-1 inline-flex items-center gap-0.5 text-caption text-ink-muted hover:text-accent","data-testid":`note-comment-edit-btn-${e.id.slice(0,8)}`,title:s("notebook.note.edit_comment"),children:[f.jsx(ns,{className:"w-2.5 h-2.5"})," ",s("notebook.note.edit_comment")]})]}):i?f.jsxs("button",{onClick:N,className:"mt-2 inline-flex items-center gap-0.5 text-caption text-ink-muted hover:text-accent","data-testid":`note-comment-add-${e.id.slice(0,8)}`,title:s("notebook.note.add_comment"),children:[f.jsx(ns,{className:"w-2.5 h-2.5"})," ",s("notebook.note.add_comment")]}):null,p&&a&&f.jsx("button",{onClick:()=>a(p,d,e.id),className:"mt-2 inline-flex items-center gap-1 text-caption text-accent hover:underline font-bold","data-testid":`note-source-${e.id.slice(0,8)}`,children:p.type==="content"?f.jsxs(f.Fragment,{children:[f.jsx(or,{className:"w-3 h-3"}),s("notebook.source.jump_content")]}):f.jsxs(f.Fragment,{children:[f.jsx(J1,{className:"w-3 h-3"}),s("notebook.source.jump_chat")]})}),f.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[f.jsx("span",{className:"text-caption text-ink-muted",children:b}),f.jsx("button",{onClick:()=>t(e.id),className:"text-caption text-ink-muted hover:text-warning","data-testid":`canvas-delete-${e.id.slice(0,8)}`,title:s("notebook.note.delete"),children:f.jsx(yc,{className:"w-3 h-3"})})]})]})]})})}const v=cI[e.artifactType]??eg;return f.jsxs("div",{className:`bg-surface-2 rounded-lg p-3 relative ${e.pinned?"ring-1 ring-brand/40 bg-brand/5":""}`,"data-testid":`canvas-item-${e.id.slice(0,8)}`,children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[f.jsx("span",{className:"text-body inline-flex items-center text-ink-strong",children:f.jsx(v,{className:"w-4 h-4"})}),f.jsx("span",{className:"text-label font-bold text-ink-muted flex-1 truncate",children:e.title??hI(s,e.artifactType)}),e.artifactType==="quiz"&&e.lastResult&&f.jsx("span",{className:`text-caption font-bold px-1.5 py-0.5 rounded-full ${e.lastResult==="correct"?"bg-brand/15 text-brand":"bg-warning/15 text-warning"}`,"data-testid":`quiz-result-${e.id.slice(0,8)}`,children:e.lastResult==="correct"?s("notebook.quiz.last_correct"):s("notebook.quiz.last_wrong")}),e.pinned?f.jsxs("span",{className:"text-caption text-brand font-bold flex items-center gap-0.5",children:[f.jsx(Lh,{className:"w-2.5 h-2.5"}),s("notebook.note.pinned")]}):null,f.jsx("button",{onClick:()=>n(e.id),className:"text-caption text-ink-muted hover:text-brand","data-testid":`canvas-pin-${e.id.slice(0,8)}`,title:e.pinned?s("notebook.note.unpin"):s("notebook.note.pin"),children:f.jsx(Lh,{className:"w-3 h-3"})}),f.jsx("button",{onClick:()=>t(e.id),className:"text-caption text-ink-muted hover:text-warning","data-testid":`canvas-delete-${e.id.slice(0,8)}`,title:s("notebook.note.delete"),children:f.jsx(yc,{className:"w-3 h-3"})})]}),f.jsx("div",{className:"text-label",children:g?f.jsx(Fd,{data:g,onQuizAnswered:h}):f.jsx("div",{className:"text-ink-muted",children:s("notebook.artifact.broken")})}),f.jsx("div",{className:"text-caption text-ink-muted mt-2",children:b})]})}function lp({message:e,icon:t}){return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6","data-testid":"empty-notebook",children:[f.jsx("div",{className:"text-4xl mb-3 opacity-30",children:t}),f.jsx("div",{className:"text-body text-ink-muted max-w-xs leading-relaxed",children:e})]})}function qu({label:e,icon:t,active:n,onClick:r,testid:i,badge:a}){return f.jsxs("button",{onClick:r,"data-testid":i,role:"tab","aria-selected":n,className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n?"bg-brand/20 text-brand":"text-ink-muted hover:text-ink-strong"}`,children:[f.jsx(t,{className:"w-3 h-3"}),f.jsx("span",{children:e}),a&&f.jsx("span",{className:`text-caption px-1.5 py-0.5 rounded-full font-bold ${n?"bg-brand/30 text-brand":"bg-ink/10 text-ink-faint"}`,children:a})]})}function gI({src:e,alt:t,assets:n,...r}){const[i,a]=w.useState(null),s=e??"",o=w.useMemo(()=>{if(!s||s.startsWith("http")||s.startsWith("data:"))return null;const u=s.split("/").pop()??s;return n.find(c=>{var h;return(h=c.sourcePath)==null?void 0:h.endsWith(u)})??n.find(c=>c.filename===u)??null},[s,n]);if(w.useEffect(()=>{if(!o){a(null);return}let u=!1;return ie.getAssetDataUrl(o.id).then(c=>{u||a(c)}),()=>{u=!0}},[o]),!s)return null;const l=i??s;return f.jsx("img",{src:l,alt:t??"","data-asset-id":o==null?void 0:o.id,className:"rounded-lg max-w-full h-auto my-3",loading:"lazy",...r})}function xI({asset:e}){const t=$e(),[n,r]=w.useState(null),[i,a]=w.useState(!1);return w.useEffect(()=>{let s=!1;return ie.getAssetDataUrl(e.id).then(o=>{s||r(o)}),()=>{s=!0}},[e.id]),f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>a(!0),className:"block rounded-lg overflow-hidden bg-ink/5 dark:bg-ink/10 hover:ring-2 hover:ring-accent transition-all",title:e.altText??e.filename,children:n?f.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"w-full h-24 object-cover",loading:"lazy"}):f.jsx("div",{className:"w-full h-24 flex items-center justify-center text-ink-faint text-caption",children:t("notebook.asset.loading")})}),i&&n&&f.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-8 cursor-pointer",onClick:()=>a(!1),children:[f.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg"}),f.jsx("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white","aria-label":t("action.close"),onClick:s=>{s.stopPropagation(),a(!1)},children:f.jsx(Fn,{className:"w-6 h-6"})})]})]})}function bI(e){const[t,n]=w.useState([]),[r,i]=w.useState(!0),a=w.useCallback(async()=>{if(!e){n([]),i(!1);return}try{const p=await ie.canvasList(e);n(p)}catch{n([])}finally{i(!1)}},[e]);w.useEffect(()=>{a()},[a]);const s=w.useCallback(async p=>{if(!e)return null;try{const g=await ie.canvasSave({...p,courseId:e});return n(x=>x.some(b=>b.id===g.id)?x:[g,...x]),g}catch{return null}},[e]),o=w.useCallback(async p=>{if(!e)return null;try{const g=await ie.canvasSaveUserNote({...p,courseId:e});return n(x=>[g,...x]),g}catch{return null}},[e]),l=w.useCallback(async(p,g)=>{try{const x=await ie.canvasRecordQuizResult(p,g);return x&&n(b=>b.map(v=>v.id===p?x:v)),x}catch{return null}},[]),u=w.useCallback(async(p,g)=>{try{const x=await ie.canvasUpdateUserNoteComment(p,g);return x&&n(b=>b.map(v=>v.id===p?x:v)),x}catch{return null}},[]),c=w.useCallback(async p=>{try{await ie.canvasDelete(p),n(g=>g.filter(x=>x.id!==p))}catch{}},[]),h=w.useCallback(async p=>{try{const g=await ie.canvasTogglePin(p);g&&n(x=>x.map(v=>v.id===p?g:v).sort((v,E)=>E.pinned!==v.pinned?E.pinned-v.pinned:E.createdAt.localeCompare(v.createdAt)))}catch{}},[]),m=w.useCallback(p=>p===null?t:t.filter(g=>g.nodeId===p),[t]),d=w.useCallback((p,g)=>{const x=p===null?t:t.filter(b=>b.nodeId===p);return g==="note"?x.filter(b=>b.artifactType==="user_note"):g==="practice"?x.filter(b=>b.artifactType==="quiz"):x.filter(b=>["concept_map","compare_table","diagram","code_walkthrough"].includes(b.artifactType))},[t]);return{items:t,loading:r,reload:a,save:s,saveUserNote:o,recordQuizResult:l,updateUserNoteComment:u,remove:c,togglePin:h,byNode:m,byZone:d}}const up={small:16,medium:17,large:18},cp="lookatstudy-font-size",yI="medium";function vI(){const[e,t]=w.useState(()=>{if(typeof localStorage<"u"){const r=localStorage.getItem(cp);if(r&&r in up)return r}return yI});w.useEffect(()=>{document.documentElement.style.fontSize=`${up[e]}px`,localStorage.setItem(cp,e)},[e]);const n=w.useCallback(r=>{t(i=>{const a=["small","medium","large"],s=a.indexOf(i),o=r==="up"?Math.min(s+1,a.length-1):Math.max(s-1,0);return a[o]})},[]);return{size:e,bump:n}}const $u=new Map;function wI({ref_:e,onOpen:t}){const n=$e(),[r,i]=w.useState(e.previewUrl??(e.file?$u.get(e.file)??null:null));return w.useEffect(()=>{if(r||!e.file)return;let a=!1;return(async()=>{const s=$u.get(e.file);if(s){a||i(s);return}const o=await ie.getAttachmentDataUrl(e.file);o&&!a&&($u.set(e.file,o),i(o))})(),()=>{a=!0}},[e.file,r]),r?f.jsx("button",{type:"button",onClick:()=>t(r),"aria-label":n("chat.attach.preview",{name:e.name}),className:"w-24 h-24 rounded-lg overflow-hidden border border-[var(--border)] hover:border-accent transition-colors shrink-0",children:f.jsx("img",{src:r,alt:e.name,className:"w-full h-full object-cover"})}):f.jsx("div",{className:"w-24 h-24 rounded-lg bg-ink/[0.06] flex items-center justify-center text-caption text-ink-faint",title:e.name,children:e.name.slice(0,8)})}function kI({src:e,name:t,onClose:n}){return w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n]),f.jsxs("div",{role:"dialog","aria-label":t,className:"fixed inset-0 z-[70] bg-black/80 flex items-center justify-center p-8 cursor-zoom-out animate-[toast-enter_.15s_ease-out]",onClick:n,"data-testid":"attachment-lightbox",children:[f.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain rounded-lg shadow-elevated"}),f.jsx("button",{type:"button","aria-label":"close",onClick:n,className:"absolute top-4 right-4 w-9 h-9 rounded-full bg-white/10 hover:bg-white/20 text-white flex items-center justify-center transition-colors",children:f.jsx(Fn,{className:"w-4 h-4"})})]})}function EI({parts:e}){const t=$e(),[n,r]=w.useState(null),i=e.filter(o=>o.type==="attachment").map(o=>o.attachment);if(i.length===0)return null;const a=i.filter(o=>o.kind==="image"),s=i.filter(o=>o.kind==="text");return f.jsxs("div",{className:"flex flex-col gap-1.5 mb-1","data-testid":"message-attachments",children:[a.length>0&&f.jsx("div",{className:"flex gap-1.5 flex-wrap",children:a.map((o,l)=>f.jsx(wI,{ref_:o,onOpen:u=>r({src:u,name:o.name})},o.file??o.previewUrl??`${o.name}:${l}`))}),s.length>0&&f.jsx("div",{className:"flex gap-1.5 flex-wrap",children:s.map((o,l)=>f.jsxs("span",{"data-tooltip":t("chat.attach.textChip"),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-ink/[0.06] text-caption text-ink-muted",children:[f.jsx(ps,{className:"w-3 h-3 shrink-0"}),f.jsx("span",{className:"truncate max-w-[12rem]",children:o.name})]},`${o.name}:${l}`))}),n&&f.jsx(kI,{src:n.src,name:n.name,onClose:()=>r(null)})]})}function TI({messages:e,streaming:t,onApplyProposal:n,onRejectProposal:r,summary:i,onStartLearning:a,agentReady:s=!0,onGotoSettings:o,hasNode:l=!0,selectedNodeId:u,threadId:c,onSaveChatNote:h,chatNotes:m,onPickQuizAction:d,onQuizCompleted:p,cardMode:g=!1}){const x=$e(),b=zd(),v=Kb();w.useEffect(()=>{if(v.failReason){const V=v.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":v.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":v.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":v.failReason==="edge-failed"?"chat.speech.edge_failed":v.failReason==="custom-provider-missing"?"chat.speech.custom_provider_missing":"chat.speech.model_missing";b.show(x(V),{severity:"warning"}),v.clearFailReason()}},[v.failReason,b,x,v]),w.useEffect(()=>{v.onlineNotice&&(b.show(x("chat.speech.edge_disclosed"),{severity:"info"}),v.clearOnlineNotice())},[v.onlineNotice,b,x,v]);const E=w.useCallback((V,Z,O)=>{u&&ie.recordQuizAnswer(u,O,V.kc).catch(()=>{})},[u]),[N,k]=w.useState(null);w.useEffect(()=>{if(!u){k(null);return}let V=!1;const Z=()=>ie.getProgress(u).then(X=>{V||k((X==null?void 0:X.mastery)??null)}).catch(()=>{});Z();const O=ie.on("state:changed",X=>{X==="mastery"&&Z()});return()=>{V=!0,O()}},[u]);const S=w.useRef(null),_=w.useRef(!0),[C,I]=w.useState(!1);w.useEffect(()=>{const V=Z=>{const O=Z.detail;if(!(O!=null&&O.msgId))return;const X=document.querySelector(`[data-msg-id="${O.msgId}"]`);X&&(X.scrollIntoView({behavior:"smooth",block:"center"}),X.classList.add("ring-2","ring-accent","rounded-lg"),setTimeout(()=>X.classList.remove("ring-2","ring-accent","rounded-lg"),2500))};return window.addEventListener("lookatstudy-highlight-message",V),()=>window.removeEventListener("lookatstudy-highlight-message",V)},[]),w.useEffect(()=>{if(t||!S.current||!m||m.length===0)return;const V=setTimeout(()=>{if(!S.current)return;const Z=new Map;for(const O of m)try{const X=JSON.parse(O.sourceAnchor);if(X.type==="chat"&&X.msgId){const ne=JSON.parse(O.data).text??"";if(ne){const P=Z.get(X.msgId)??[];P.push({noteId:O.id,text:ne}),Z.set(X.msgId,P)}}}catch{}for(const[O,X]of Z){const ne=S.current.querySelector(`[data-msg-id="${O}"]`);ne&&Cb(ne,X)}},150);return()=>clearTimeout(V)},[e,m,t]),w.useEffect(()=>{const V=Z=>{var ne;const O=Z.detail;if(!O)return;const X=(ne=S.current)==null?void 0:ne.querySelector(`mark[data-note-id="${O}"]`);X&&Pb(X)};return window.addEventListener("lookatstudy-jump-to-chat-note",V),()=>window.removeEventListener("lookatstudy-jump-to-chat-note",V)},[]);const[A,R]=w.useState(null),L=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,z=w.useCallback(()=>{if(!h||!c)return;const V=window.getSelection(),Z=(V==null?void 0:V.toString().trim())??"";if(Z.length<2||Z.length>500){R(null);return}const O=V==null?void 0:V.getRangeAt(0);if(!O){R(null);return}const X=S.current;if(!(X!=null&&X.contains(O.commonAncestorContainer))){R(null);return}let ne=O.commonAncestorContainer,P=null;for(;ne&&ne!==X;){if(ne instanceof HTMLElement&&ne.dataset.msgId){P=ne;break}ne=ne.parentNode}if(!P){R(null);return}const te=P.dataset.msgId,Q=cs(P),K=Eb(O,Q),ce=O.getBoundingClientRect(),le=X.getBoundingClientRect(),ee=O.getClientRects(),Ce=ee.length?ee[ee.length-1]:ce,de=Bb({left:ce.left-le.left,top:ce.top-le.top,right:ce.right-le.left,bottom:ce.bottom-le.top,width:ce.width,height:ce.height},le.width,L?150:110,{left:Ce.left-le.left,top:Ce.top-le.top,right:Ce.right-le.left,bottom:Ce.bottom-le.top,width:Ce.width,height:Ce.height},L);R({x:de.left,y:de.top,transform:de.transform,text:Z,msgId:te,startOffset:K==null?void 0:K.start,endOffset:K==null?void 0:K.end})},[h,c,L]);w.useEffect(()=>{const V=L?600:250;let Z=null,O=null,X=!1;const ne=()=>{var K;return(((K=window.getSelection())==null?void 0:K.toString().trim().length)??0)>=2},P=()=>{ne()?(O&&(clearTimeout(O),O=null),R(K=>K&&null),Z&&clearTimeout(Z),Z=setTimeout(()=>{Z=null,!X&&ne()&&z()},V)):O||(O=setTimeout(()=>R(K=>K&&null),250))},te=K=>{var le;const ce=K.target;(le=ce==null?void 0:ce.closest)!=null&&le.call(ce,"[data-selection-popover]")||(X=!0)},Q=()=>{X=!1,Z&&(clearTimeout(Z),Z=null),!O&&ne()&&z()};return document.addEventListener("selectionchange",P),window.addEventListener("pointerdown",te,!0),window.addEventListener("pointerup",Q,!0),window.addEventListener("pointercancel",Q,!0),()=>{document.removeEventListener("selectionchange",P),window.removeEventListener("pointerdown",te,!0),window.removeEventListener("pointerup",Q,!0),window.removeEventListener("pointercancel",Q,!0),Z&&clearTimeout(Z),O&&clearTimeout(O)}},[z]);const j=w.useCallback(()=>{var Z;if(!A||!h)return;const V=A.text.length>200?A.text.slice(0,200)+"…":A.text;h(V,A.msgId,A.startOffset,A.endOffset),R(null),(Z=window.getSelection())==null||Z.removeAllRanges()},[A,h]),B=w.useCallback(()=>{const V=S.current;if(!V)return;const Z=V.scrollHeight-V.scrollTop-V.clientHeight<80;_.current=Z,I(O=>O===!Z?O:!Z)},[]);w.useEffect(()=>{if(!_.current)return;const V=S.current;V&&(V.scrollTop=V.scrollHeight)},[e,t]);const H=e.length>0&&e[e.length-1].role==="user";w.useEffect(()=>{if(!H)return;_.current=!0,I(!1);const V=S.current;V&&(V.scrollTop=V.scrollHeight)},[H]);const Y=w.useCallback(()=>{const V=S.current;V&&(V.scrollTop=V.scrollHeight,_.current=!0,I(!1))},[]);return f.jsxs("div",{className:"relative flex-1 min-h-0",children:[f.jsxs("div",{ref:S,onScroll:B,className:`h-full overflow-y-auto px-3 py-4 space-y-2 relative ${g?"":"px-5 py-6 space-y-6"}`,"data-testid":"chat-stream",children:[e.length===0&&f.jsx("div",{className:"mt-10 mx-auto max-w-md","data-testid":"chat-empty-state",children:l?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"text-center mb-4",children:[f.jsx("div",{className:"text-4xl mb-2 opacity-30",children:"📖"}),f.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:x("chat.empty.greeting")}),f.jsx("div",{className:"text-ink-muted text-label",children:x("chat.empty.overview")})]}),i?f.jsxs("div",{className:"surface-card p-4 mb-4",children:[f.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-2",children:x("chat.empty.summary.title")}),f.jsx("div",{className:"text-body text-ink-muted leading-relaxed whitespace-pre-wrap",children:i})]}):f.jsx("div",{className:"surface-card p-4 mb-4 text-center",children:f.jsx("div",{className:"text-body text-ink-muted",children:x("chat.empty.summary.none")})}),s?f.jsx(f.Fragment,{children:a&&f.jsxs("button",{onClick:a,disabled:t,"data-testid":"start-learning-btn",className:"btn-3d-brand w-full py-3 text-body font-bold flex items-center justify-center gap-2 disabled:opacity-40",children:[f.jsx(Xy,{className:"w-4 h-4"}),f.jsx("span",{children:x("chat.empty.start")})]})}):f.jsxs("div",{className:"surface-card p-4 mb-2","data-testid":"keyless-card",children:[f.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:x("chat.empty.keyless.title")}),f.jsx("div",{className:"text-label text-ink-muted mb-3",children:x("chat.empty.keyless.desc")}),f.jsxs("button",{onClick:o,className:"btn-3d-brand w-full py-2 text-body font-bold flex items-center justify-center gap-2",children:[f.jsx(Io,{className:"w-4 h-4"}),f.jsx("span",{children:x("chat.empty.keyless.btn")})]})]})]}):f.jsxs("div",{className:"text-center mt-16","data-testid":"no-node-selected",children:[f.jsx("div",{className:"text-5xl mb-3 opacity-25",children:"🗺️"}),f.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:x("chat.empty.no_node.title")}),f.jsx("div",{className:"text-body text-ink-muted max-w-xs mx-auto",children:x("chat.empty.no_node.desc")})]})}),e.map(V=>f.jsx("div",{className:g?"":"contents",children:f.jsx("div",{className:g&&V.role==="assistant"?"surface-card p-4 rounded-2xl shadow-card":void 0,children:f.jsx(SI,{msg:V,onApplyProposal:n,onRejectProposal:r,onQuizAnswered:E,quizMastery:N,onPickAction:d,onQuizCompleted:p,speakingMessageId:v.speakingMessageId,speakingSentence:v.speakingSentence,playingSentence:v.playingSentence,streamTexts:v.streamTexts,onSpeak:v.speak})})},V.id)),t&&f.jsxs("div",{className:"flex items-center gap-1.5 text-body text-brand",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]}),C&&e.length>0&&f.jsxs("button",{onClick:Y,"data-testid":"scroll-to-bottom","aria-label":x("chat.scroll.bottom"),title:x("chat.scroll.bottom"),className:"absolute bottom-4 right-4 w-9 h-9 rounded-full bg-ink-strong text-surface-0 shadow-elevated flex items-center justify-center hover:scale-105 active:scale-95 transition-transform msg-enter",children:[f.jsx(V0,{className:"w-5 h-5"}),t&&f.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 bg-brand rounded-full border-2 border-[var(--ink-strong)] animate-pulse"})]}),A&&f.jsxs("button",{onClick:j,"data-testid":"save-chat-note-btn","data-selection-popover":!0,style:{left:A.x,top:A.y,transform:A.transform},className:"absolute z-20 px-3 py-1.5 rounded-lg bg-brand text-white text-body font-bold shadow-elevated flex items-center gap-1 hover:bg-brand-light transition msg-enter whitespace-nowrap",title:x("chat.note.add.title"),children:[f.jsx(ns,{className:"w-3 h-3"})," ",x("chat.note.add")]})]})}function dp(e){const t=[];for(const n of e)if(n.role==="assistant")for(let r=0;r<n.parts.length;r++){const i=n.parts[r];i.type==="tool-call"&&i.state==="output-available"&&i.output&&typeof i.output=="object"&&"artifactType"in i.output&&t.push({id:`${n.id}-${r}`,toolName:i.toolName,output:i.output})}return t}function SI({msg:e,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:r,quizMastery:i,onPickAction:a,onQuizCompleted:s,speakingMessageId:o,speakingSentence:l,playingSentence:u,streamTexts:c,onSpeak:h}){const m=$e(),d=w.useRef(null),p=e.parts.map(v=>v.type==="text"?v.text:"").join("").trim(),g=o===e.id,x=g&&u!=null?u.index:null;w.useEffect(()=>{const v=d.current;if(!v)return;if(x==null){bi(v);return}const E=jb(c??[],x);if(!E)return;x===0&&Rb(v);const N=setTimeout(()=>{const k=Lb(v,E,{within:'[data-testid="part-text"]'});k&&Db(k,v.closest(".overflow-y-auto"))},30);return()=>clearTimeout(N)},[x,c]),w.useEffect(()=>{x==null&&d.current&&bi(d.current)},[x]);const b=w.useRef(!1);return b.current=x!=null,w.useEffect(()=>()=>{b.current&&bi(document.body)},[]),e.role==="user"?f.jsx("div",{className:"msg-enter flex justify-end","data-testid":"msg-user","data-msg-id":e.id,children:f.jsxs("div",{className:"max-w-[85%] bg-ink/[0.04] rounded-2xl rounded-br-md px-4 py-2.5",children:[f.jsx(EI,{parts:e.parts}),f.jsx("div",{className:"font-medium text-ink-strong whitespace-pre-wrap select-text text-body",children:e.displayText??e.parts.map((v,E)=>v.type==="text"?f.jsx("span",{children:v.text},E):null)})]})}):f.jsxs("div",{className:"msg-enter",ref:d,"data-testid":"msg-assistant","data-msg-id":e.id,children:[f.jsx("div",{className:"min-w-0 space-y-2.5",children:e.parts.map((v,E)=>f.jsx(AI,{part:v,msgId:e.id,toolCallIdx:E,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:r,quizMastery:i,onPickAction:a,onQuizCompleted:s},E))}),h&&p&&f.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[f.jsx("button",{onClick:()=>h(e.id,p),"data-testid":g?"speech-stop-btn":"speech-speak-btn","aria-label":m(g?"chat.speech.stop":"chat.speech.speak"),title:m(g?"chat.speech.stop":"chat.speech.speak"),className:`w-7 h-7 rounded-lg flex items-center justify-center transition ${g?"bg-brand/15 text-brand":"text-ink-muted hover:bg-ink/[0.06] hover:text-ink"}`,children:g?f.jsx(Y0,{className:"w-3.5 h-3.5"}):f.jsx(rg,{className:"w-4 h-4"})}),g&&l&&l.total>0&&f.jsx("span",{className:"text-caption text-ink-muted",children:m("chat.speech.progress").replace("{n}",String(l.index+1)).replace("{total}",String(l.total))})]})]})}function AI({part:e,msgId:t,toolCallIdx:n,onApplyProposal:r,onRejectProposal:i,onQuizAnswered:a,quizMastery:s,onPickAction:o,onQuizCompleted:l}){if(e.type==="text")return f.jsx("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed break-words [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_img]:max-w-full [&_video]:max-w-full [&_iframe]:max-w-full select-text","data-testid":"part-text",children:f.jsx(t2,{remarkPlugins:[C2,N2],rehypePlugins:[xb,[wb,kb],Ox],urlTransform:d=>d,components:MI,children:Ob(e.text)})});if(e.type==="reasoning")return f.jsx(CI,{text:e.text});if(e.type!=="tool-call")return null;const{toolName:u,state:c,output:h,error:m}=e;return f.jsx(NI,{toolName:u,state:c,output:h,error:m,msgId:t,toolCallIdx:n,onApplyProposal:r,onRejectProposal:i,onQuizAnswered:a,quizMastery:s,onPickAction:o,onQuizCompleted:l})}function CI({text:e}){const t=$e(),[n,r]=w.useState(!1);return f.jsxs("div",{className:"rounded-lg bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-reasoning",children:[f.jsxs("button",{onClick:()=>r(i=>!i),className:"w-full flex items-center justify-between px-3 py-1.5 text-label font-bold text-ink-muted hover:text-ink-strong transition-colors",children:[f.jsxs("span",{children:[n?"▾":"▸"," ",t("chat.reasoning.label")]}),f.jsx("span",{className:"text-ink-muted font-normal",children:t("chat.reasoning.chars",{n:e.length})})]}),n&&f.jsx("div",{className:"px-3 pb-2.5 text-label text-ink-muted whitespace-pre-wrap leading-relaxed border-t border-[var(--border-faint)]/60 pt-2",children:e})]})}function NI({toolName:e,state:t,output:n,error:r,msgId:i,toolCallIdx:a,onApplyProposal:s,onRejectProposal:o,onQuizAnswered:l,quizMastery:u,onPickAction:c,onQuizCompleted:h}){const m=$e(),p=(e==="record_answer"||e==="mark_mastered")&&t==="output-available"&&typeof n=="object"&&n!==null?n:null;if(p!=null&&p.proposalId){const b=p.status;return b==="applied"?f.jsxs("div",{className:"proposal-card rounded-xl border border-gold/30 bg-gold/5 p-3 flex items-center gap-2","data-testid":"part-proposal",children:[f.jsx(Wn,{className:"w-4 h-4 text-gold shrink-0"}),f.jsx("span",{className:"text-body font-bold text-ink",children:m("chat.proposal.applied")})]}):b==="rejected"?f.jsxs("div",{className:"proposal-card rounded-xl border border-ink/10 bg-ink/5 p-3 flex items-center gap-2","data-testid":"part-proposal",children:[f.jsx(Ny,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("span",{className:"text-body text-ink-muted",children:m("chat.proposal.rejected")})]}):f.jsxs("div",{className:"proposal-card relative rounded-xl border border-brand/30 bg-brand/5 overflow-hidden","data-testid":"part-proposal",children:[f.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-brand"}),f.jsxs("div",{className:"pl-4 pr-3 py-3",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[f.jsx("span",{className:"flex items-center justify-center w-7 h-7 rounded-lg bg-brand/15 text-brand shrink-0",children:f.jsx(Z1,{className:"w-4 h-4"})}),f.jsx("span",{className:"text-lead font-bold text-ink",children:m("chat.proposal.mastered.title")})]}),p.message&&f.jsx("div",{className:"text-body text-ink mb-2 leading-relaxed",children:p.message}),f.jsx("div",{className:"text-caption text-ink-muted mb-3",children:m("chat.proposal.mastered.hint")}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("button",{onClick:()=>s==null?void 0:s(p.proposalId,i,a),"data-testid":"proposal-apply",className:"btn-3d-brand px-4 py-1.5 text-body",children:[f.jsx(Tn,{className:"w-3.5 h-3.5 inline"}),m("chat.proposal.confirm")]}),f.jsx("button",{onClick:()=>o==null?void 0:o(p.proposalId,i,a),"data-testid":"proposal-reject",className:"btn-3d-neutral px-4 py-1.5 text-body",children:m("chat.proposal.later")})]})]})]})}if(t==="output-available"&&n&&typeof n=="object"&&"artifactType"in n){const b=n.artifactType;return f.jsx("div",{className:"my-1 max-w-full","data-testid":`inline-artifact-${b}`,"data-tool":e,children:f.jsx(Fd,{data:n,onQuizAnswered:l,quizMastery:u,onPickAction:c,onQuizCompleted:h})})}const x=II(e,m);return f.jsx("div",{className:"inline-flex items-center gap-1.5 text-label px-2.5 py-1 rounded-md bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-tool","data-tool":e,"data-state":t,children:t==="input-available"?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsxs("span",{className:"text-ink-muted",children:[x,"…"]})]}):t==="output-error"?f.jsxs(f.Fragment,{children:[f.jsx(ki,{className:"w-3.5 h-3.5 text-warning shrink-0"}),f.jsxs("span",{className:"text-warning",children:[x,": ",r]})]}):f.jsxs(f.Fragment,{children:[f.jsx(xs,{className:"w-3.5 h-3.5 text-ink-faint shrink-0"}),f.jsx("span",{className:"text-ink-muted",children:x})]})})}const MI={pre({children:e,...t}){return f.jsx(Qb,{...t,children:e})},a({children:e,...t}){return f.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})},table({children:e}){return f.jsx("div",{className:"overflow-x-auto my-4",children:f.jsx("table",{children:e})})}};function II(e,t){return{get_node_info:t("chat.tool.get_node_info"),record_answer:t("chat.tool.record_answer"),mark_mastered:t("chat.tool.mark_mastered"),show_concept_map:t("chat.tool.show_concept_map"),generate_quiz:t("chat.tool.generate_quiz"),compare_table:t("chat.tool.compare_table"),draw_diagram:t("chat.tool.draw_diagram"),show_code_walkthrough:t("chat.tool.show_code_walkthrough")}[e]??e}const Qa={maxPerMessage:4,maxImageBytes:5*1024*1024,maxTextBytes:256*1024},_I=new Set(["txt","md","markdown","rst","org","adoc","log","csv","tsv","json","yaml","yml","toml","ini","env","py","js","mjs","cjs","ts","tsx","jsx","go","rs","java","c","h","cpp","hpp","cs","rb","sh","bash","zsh","ps1","sql","html","htm","css","scss","vue","svelte","kt","swift","php","lua","r","dart","scala","clj","ex","exs","erl","hs","ml","jl","m","mm","pl","vb","bat","dockerfile"]);function hp(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"":e.slice(t+1).toLowerCase()}function RI(e,t,n){return t&&t.startsWith("image/")||["png","jpg","jpeg","webp","gif","bmp"].includes(hp(e))?n>Qa.maxImageBytes?{ok:!1,reason:"tooLargeImage"}:{ok:!0,kind:"image"}:_I.has(hp(e))?n>Qa.maxTextBytes?{ok:!1,reason:"tooLargeText"}:{ok:!0,kind:"text"}:{ok:!1,reason:"unsupported"}}function LI(e,t){const n=e.length,r=n*2,i=new ArrayBuffer(44+r),a=new DataView(i),s=(l,u)=>{for(let c=0;c<u.length;c++)a.setUint8(l+c,u.charCodeAt(c))};s(0,"RIFF"),a.setUint32(4,36+r,!0),s(8,"WAVE"),s(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,t*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),s(36,"data"),a.setUint32(40,r,!0);let o=44;for(let l=0;l<n;l++){const u=e[l]<=-1?-1:e[l]>=1?1:e[l];a.setInt16(o,Math.round(u*32767),!0),o+=2}return i}function DI(e,t){const n=Math.floor(e.length/t),r=new Float32Array(n);for(let i=0;i<n;i++){const a=i*t,s=Math.floor(a),o=a-s,l=e[s]??0,u=e[s+1]??l;r[i]=l+(u-l)*o}return r}function PI(e,t,n={}){if(e.length===0||e.length!==t.length)return e;const r=n.threshold??.012;let i=0;for(;i<e.length-1&&t[i]<r;)i+=1;let a=e.length;for(;a>i+1&&t[a-1]<r;)a-=1;return e.slice(i,a)}function OI(e={}){const t=e.rmsThreshold??.015,n=e.minSpeechMs??300,r=e.silenceMs??1200,i=e.maxMs??6e4,a=e.autoStop!==!1;let s=null,o=0,l=null,u=null,c=!1;return{feed(h,m){s==null&&(s=m);const d=u==null?0:Math.max(0,m-u);if(u=m,h>=t)o+=d,o>=n&&(c=!0,l=m);else if(a&&c&&l!=null&&m-l>=r)return"auto-stop";return a&&m-s>=i?"auto-stop":"listening"},hadSpeech(){return c}}}const Wu=16e3;function jI(e,t={}){const[n,r]=w.useState(!1),[i,a]=w.useState(!1),[s,o]=w.useState(0),[l,u]=w.useState(null),[c,h]=w.useState(null),m=w.useRef(null),d=w.useRef(null),p=w.useRef(null),g=w.useRef([]),x=w.useRef([]),b=w.useRef(!1),v=w.useRef(null),E=w.useRef(0),N=w.useRef(e);N.current=e;const k=w.useRef(t);k.current=t;const S=w.useRef(!1),_=w.useRef(!1),C=w.useCallback(()=>{var z,j,B;b.current=!1,(z=p.current)==null||z.disconnect(),p.current=null,(j=d.current)==null||j.getTracks().forEach(H=>H.stop()),d.current=null,(B=m.current)==null||B.close().catch(()=>{}),m.current=null,g.current=[],x.current=[],v.current=null,o(0)},[]),I=w.useCallback(()=>{var ne;const z=g.current,j=x.current,B=((ne=v.current)==null?void 0:ne.hadSpeech())??!1;g.current=[],x.current=[];let H=0;for(const P of z)H+=P.length;if(C(),r(!1),H===0)return;if(!B){h("no-speech");return}const Y=PI(z,j);let V=0;for(const P of Y)V+=P.length;const Z=new Float32Array(V);let O=0;for(const P of Y)Z.set(P,O),O+=P.length;const X=LI(Z,Wu);a(!0),h(null),window.api.asrTranscribe(X,k.current.locale).then(P=>{P.ok?N.current(P.text):h(P.reason)}).catch(()=>h("asr-failed")).finally(()=>a(!1))},[C]),A=w.useCallback(()=>{b.current&&I()},[I]),R=w.useCallback(()=>{b.current||S.current||(u(null),S.current=!0,(async()=>{var z;try{if(((z=navigator.mediaDevices)==null?void 0:z.getUserMedia)==null){u(window.isSecureContext?"mic-unavailable":"mic-insecure-context");return}const j=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),B=window.AudioContext??window.webkitAudioContext;let H;try{H=new B({sampleRate:Wu})}catch{H=new B}m.current=H,d.current=j,b.current=!0,v.current=OI({autoStop:k.current.autoStop!==!1});const Y=H.createMediaStreamSource(j),V=H.createScriptProcessor(4096,1,1);p.current=V;const Z=H.sampleRate/Wu;V.onaudioprocess=X=>{var ce;if(!b.current)return;const ne=X.inputBuffer.getChannelData(0),P=Z===1?new Float32Array(ne):DI(ne,Z);g.current.push(P);let te=0;for(let le=0;le<P.length;le++)te+=P[le]*P[le];const Q=Math.sqrt(te/P.length);x.current.push(Q),E.current=E.current*.7+Q*.3,o(Math.min(1,E.current*8)),X3(Math.min(1,E.current*8)),((ce=v.current)==null?void 0:ce.feed(Q,performance.now()))==="auto-stop"&&b.current&&I()},Y.connect(V);const O=H.createGain();O.gain.value=0,V.connect(O),O.connect(H.destination),r(!0),_.current&&(_.current=!1,I())}catch(j){C(),r(!1),u(j instanceof Error?j.message:String(j))}finally{S.current=!1}})())},[C,I]),L=w.useCallback(()=>{b.current?A():S.current&&(_.current=!0)},[A]);return w.useEffect(()=>()=>{b.current&&C()},[C]),{listening:n,transcribing:i,level:s,startError:l,transcribeError:c,clearTranscribeError:()=>h(null),beginHold:R,endHold:L}}function BI({onGotoSettings:e}){var g;const t=$e(),[n,r]=w.useState(!1),[i,a]=w.useState(null),[s,o]=w.useState(""),[l,u]=w.useState(""),c=w.useRef(null),h=w.useCallback(async()=>{var x,b;try{const[v,E,N,k]=await Promise.all([ie.getProviderPresets(),ie.listCustomProviders(),ie.getSetting("active_provider"),ie.getSetting("active_model")]),S=N??"glm",_=await Promise.all(v.map(async z=>await ie.getSetting(z.apiKeySetting)!=null)),C=new Set;v.forEach((z,j)=>{(_[j]||z.id===S)&&C.add(z.id)});const I=[],A=(z,j,B)=>{for(const H of B)I.push({providerId:z,providerLabel:j,modelId:H.id,modelLabel:H.label,vision:(H.capabilities??[]).includes("vision"),contextWindow:H.contextWindow})};for(const z of v)C.has(z.id)&&A(z.id,z.label,z.models);const R=E.filter(z=>z.kind==="llm");for(const z of R)A(z.id,z.label,z.models);const L=k??"";if(L&&!I.some(z=>z.providerId===S&&z.modelId===L)){const z=((x=v.find(j=>j.id===S))==null?void 0:x.label)??((b=R.find(j=>j.id===S))==null?void 0:b.label)??S;I.unshift({providerId:S,providerLabel:z,modelId:L,modelLabel:L,vision:!0,contextWindow:null})}a(I),o(S),u(L)}catch{a([])}},[]);w.useEffect(()=>{h();const x=()=>void h();return window.addEventListener("llm-config-changed",x),()=>window.removeEventListener("llm-config-changed",x)},[h]),w.useEffect(()=>{if(!n)return;const x=v=>{var E;v.target instanceof Node&&((E=c.current)==null?void 0:E.contains(v.target))!==!0&&r(!1)},b=v=>{v.key==="Escape"&&r(!1)};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",b)}},[n]);const m=async x=>{if(r(!1),!(x.providerId===s&&x.modelId===l))try{await ie.setSetting("active_provider",x.providerId),await ie.setSetting("active_model",x.modelId),o(x.providerId),u(x.modelId),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},d=((g=i==null?void 0:i.find(x=>x.providerId===s&&x.modelId===l))==null?void 0:g.modelLabel)??l??t("model.picker.label"),p=[];for(const x of i??[]){const b=p[p.length-1];b&&b.label===x.providerLabel?b.rows.push(x):p.push({label:x.providerLabel,rows:[x]})}return f.jsxs("div",{ref:c,className:"relative","data-testid":"composer-model",children:[f.jsxs("button",{type:"button",onClick:()=>r(!n),"aria-haspopup":"menu","aria-expanded":n,"data-tooltip":t("model.picker.label"),"data-testid":"composer-model-trigger",className:"flex items-center gap-1 max-w-[13rem] px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[f.jsx(Ty,{className:"w-3 h-3 shrink-0 coarse-only","aria-hidden":!0}),f.jsx("span",{className:"truncate tb-label",children:d}),f.jsx(G1,{className:`w-3 h-3 shrink-0 tb-chevron transition-transform ${n?"":"rotate-180"}`})]}),n&&f.jsxs("div",{role:"menu","aria-label":t("model.picker.label"),"data-testid":"composer-model-menu",className:"absolute bottom-full right-0 mb-1.5 z-50 w-64 max-h-72 overflow-y-auto bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] py-1.5",children:[p.length===0&&f.jsx("div",{className:"px-3 py-2 text-caption text-ink-faint",children:t("model.picker.noneConfigured")}),p.map(x=>f.jsxs("div",{role:"group","aria-label":x.label,children:[f.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-caption font-bold text-ink-faint",children:x.label}),x.rows.map(b=>{const v=b.providerId===s&&b.modelId===l;return f.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,onClick:()=>void m(b),className:`w-full flex items-center gap-1.5 px-3 py-1.5 text-left transition-colors ${v?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[f.jsx(Tn,{className:`w-3.5 h-3.5 shrink-0 ${v?"opacity-100":"opacity-0"}`}),f.jsx("span",{className:"flex-1 truncate text-label",children:b.modelLabel}),b.vision&&f.jsx(_y,{className:"w-3 h-3 shrink-0 text-ink-faint","aria-label":t("model.picker.vision")})]},`${b.providerId}:${b.modelId}`)})]},x.label)),f.jsx("div",{className:"border-t border-[var(--border)] mt-1 pt-1",children:f.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{r(!1),e()},className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-left text-label text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[f.jsx(e5,{className:"w-3.5 h-3.5"}),t("model.picker.manage")]})})]})]})}const d0=5.5,fp=2*Math.PI*d0,Oi=["system","node","learner","history","draft"],mp={system:"bg-accent",node:"bg-brand",learner:"bg-gold",history:"bg-ink/50",draft:"bg-exam"};function FI({info:e,historyTokens:t,draftTokens:n}){const r=$e(),[i,a]=w.useState(!1),s=w.useRef(null);if(w.useEffect(()=>{!(e!=null&&e.contextWindow)&&i&&a(!1)},[e==null?void 0:e.contextWindow,i]),w.useEffect(()=>{if(!i)return;const m=p=>{var g;p.target instanceof Node&&((g=s.current)==null?void 0:g.contains(p.target))!==!0&&a(!1)},d=p=>{p.key==="Escape"&&a(!1)};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",d)}},[i]),!e)return null;const o={system:e.systemTokens,node:e.nodeTokens,learner:e.learnerTokens,history:t,draft:n},l=Oi.reduce((m,d)=>m+o[d],0),u=u5(l,e.contextWindow),c=u!==null&&u>=85,h=c5(Oi.map(m=>o[m]),u??0);return f.jsxs("span",{ref:s,className:"relative inline-flex items-center","data-testid":"composer-context",children:[f.jsxs("button",{type:"button",onClick:()=>a(!i),disabled:e.contextWindow===null,"aria-label":r("context.aria",{p:u!==null?`${u}%`:_i(l)}),"aria-haspopup":"dialog","aria-expanded":i,"data-testid":"composer-context-trigger","data-tooltip":e.contextWindow===null?`${r("context.label")} ~${_i(l)} · ${r("context.unknownWindow")}`:r("context.aria",{p:`${u}%`}),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${c?"text-warning":"text-ink-muted"} hover:bg-ink/[0.06] disabled:hover:bg-transparent`,children:[f.jsxs("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0,className:"shrink-0",children:[f.jsx("circle",{cx:"7",cy:"7",r:d0,fill:"none",strokeWidth:"2",className:"stroke-ink/20"}),f.jsx("circle",{cx:"7",cy:"7",r:d0,fill:"none",strokeWidth:"2",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${fp*(u??100)/100} ${fp}`,transform:"rotate(-90 7 7)"})]}),u!==null?f.jsxs("span",{className:"tb-label",children:[u,"%"]}):f.jsxs("span",{className:"tb-label",children:["~",_i(l)]})]}),i&&e.contextWindow!==null&&f.jsxs("div",{role:"dialog","aria-label":r("context.label"),"data-testid":"composer-context-panel",className:"absolute bottom-full right-0 mb-1.5 z-50 w-64 bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] p-3",children:[f.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[f.jsx("span",{className:"text-label font-bold text-ink-strong",children:r("context.label")}),f.jsxs("span",{className:`text-caption ${c?"text-warning":"text-ink-muted"}`,children:[r("context.approx")," ",_i(l)," / ",_i(e.contextWindow)]})]}),f.jsx("div",{className:"flex h-2 rounded-full overflow-hidden bg-ink/10 mb-2",role:"img","aria-label":`${u}%`,children:Oi.map(m=>h[Oi.indexOf(m)]>0?f.jsx("div",{className:mp[m],style:{width:`${h[Oi.indexOf(m)]}%`}},m):null)}),f.jsx("dl",{className:"space-y-1",children:Oi.map(m=>f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("dt",{className:"flex items-center gap-1.5 text-caption text-ink-muted",children:[f.jsx("span",{className:`w-2 h-2 rounded-sm ${mp[m]}`,"aria-hidden":!0}),r(`context.${m}`)]}),f.jsxs("dd",{className:"text-caption text-ink-strong tabular-nums",children:["~",_i(o[m])]})]},m))})]})]})}const h0={glm:{fast:e=>{e.thinking={type:"disabled"},e.reasoning_effort="low"},deep:e=>{e.thinking={type:"enabled"}}},qwen:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}},siliconcloud:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}}};function zI(e,t,n){if(e==="openai"||e in h0)return e;const r=(t??"").toLowerCase(),i=(n??"").toLowerCase();return r.includes("bigmodel.cn")||r.includes("z.ai")||i.startsWith("glm")?"glm":r.includes("dashscope")||i.startsWith("qwen")?"qwen":r.includes("siliconflow")?"siliconcloud":e}function HI(e,t,n){return t==="anthropic"||t==="google"||e==="openai"||e in h0?!0:zI(e,n==null?void 0:n.baseUrl,n==null?void 0:n.model)in h0}const Gu=[{value:"",labelKey:"effort.auto.label",descKey:"effort.auto.desc"},{value:"fast",labelKey:"effort.fast.label",descKey:"effort.fast.desc"},{value:"deep",labelKey:"effort.deep.label",descKey:"effort.deep.desc"}];function UI(){const e=$e(),[t,n]=w.useState(!1),[r,i]=w.useState(""),[a,s]=w.useState(!0),o=w.useRef(null),l=w.useRef(null),[u,c]=w.useState("right"),[h,m]=w.useState(0),d=w.useRef(0),[p,g]=w.useState(0);w.useLayoutEffect(()=>{if(!t){g(0),d.current=0,m(0);return}const E=l.current;if(!E)return;const N=E.getBoundingClientRect(),k=N.left-d.current,S=N.right-d.current,_=window.innerWidth;if(p===0){if(k<8&&S<=_-8){c("left"),g(1);return}if(S>_-8&&k>=8){c("right"),g(1);return}g(1)}const C=Math.min(0,_-8-S)+Math.max(0,8-k);C!==d.current&&(d.current=C,m(C))},[t,p]);const x=w.useCallback(async()=>{var E;try{const[N,k,S,_,C]=await Promise.all([ie.getSetting("active_provider"),ie.getSetting("reasoning_effort"),ie.getProviderPresets(),ie.listCustomProviders(),ie.getSetting("active_model")]),I=N??"glm",A=_.find(z=>z.id===I),R=((E=S.find(z=>z.id===I))==null?void 0:E.protocol)??(A==null?void 0:A.protocol)??"openai-compatible";s(HI(I,R,{baseUrl:A==null?void 0:A.baseUrl,model:C??(A==null?void 0:A.defaultModel)}));const L=k??"";i(L==="fast"||L==="deep"?L:"")}catch{s(!1)}},[]);w.useEffect(()=>{x();const E=()=>void x();return window.addEventListener("llm-config-changed",E),()=>window.removeEventListener("llm-config-changed",E)},[x]),w.useEffect(()=>{if(!t)return;const E=k=>{var S;k.target instanceof Node&&((S=o.current)==null?void 0:S.contains(k.target))!==!0&&n(!1)},N=k=>{k.key==="Escape"&&n(!1)};return document.addEventListener("pointerdown",E),document.addEventListener("keydown",N),()=>{document.removeEventListener("pointerdown",E),document.removeEventListener("keydown",N)}},[t]);const b=async E=>{if(n(!1),E!==r){i(E);try{await ie.setSetting("reasoning_effort",E)}catch{i(r)}}},v=Gu.find(E=>E.value===r)??Gu[0];return f.jsxs("div",{ref:o,className:"relative","data-testid":"composer-effort",children:[f.jsxs("button",{type:"button",onClick:()=>!!a&&n(!t),disabled:!a,"aria-haspopup":"menu","aria-expanded":t,"data-testid":"composer-effort-trigger","data-tooltip":e(a?"effort.label":"effort.unsupported"),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${r?"text-accent":"text-ink-muted"} ${a?"hover:text-ink-strong hover:bg-ink/[0.06]":"opacity-40 cursor-not-allowed"}`,children:[f.jsx(U0,{className:"w-3 h-3 shrink-0"}),f.jsx("span",{className:"truncate tb-label",children:e(v.labelKey)}),f.jsx(G1,{className:`w-3 h-3 shrink-0 tb-chevron transition-transform ${t?"":"rotate-180"}`})]}),t&&f.jsx("div",{ref:l,role:"menu","aria-label":e("effort.label"),"data-testid":"composer-effort-menu",style:{transform:h?`translateX(${h}px)`:void 0},className:`absolute bottom-full ${u==="right"?"right-0":"left-0"} mb-1.5 z-50 w-60 max-w-[calc(100vw-1.5rem)] bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] py-1.5`,children:Gu.map(E=>{const N=E.value===r;return f.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":N,onClick:()=>void b(E.value),className:`w-full flex items-start gap-1.5 px-3 py-1.5 text-left transition-colors ${N?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[f.jsx(Tn,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${N?"opacity-100":"opacity-0"}`}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-label font-bold",children:e(E.labelKey)}),f.jsx("span",{className:"block text-caption text-ink-faint",children:e(E.descKey)})]})]},E.value||"auto")})})]})}function VI(e){const t=Math.floor(e/1e3),n=Math.floor(t/60);return`${String(n).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function qI({view:e,level:t,text:n,onTextChange:r,onSend:i,onRerecord:a,errorMessage:s,sendDisabled:o}){const l=$e(),[u,c]=w.useState(0),h=w.useRef(performance.now());return w.useEffect(()=>{h.current=performance.now(),c(0)},[e]),w.useEffect(()=>{if(e!=="recording")return;const m=window.setInterval(()=>c(performance.now()-h.current),250);return()=>window.clearInterval(m)},[e]),f.jsxs("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-20 rounded-2xl bg-surface-0 shadow-elevated p-4 flex flex-col gap-3",role:"status","aria-live":"polite","data-testid":e==="recording"?"voice-panel-recording":e==="transcribing"?"voice-panel-transcribing":e==="review"?"voice-panel-review":"voice-panel-error",children:[e==="recording"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"w-11 h-11 shrink-0 rounded-full bg-warning/15 text-warning flex items-center justify-center",children:f.jsx(Fa,{className:"w-5 h-5 animate-pulse"})}),f.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center justify-between text-label text-ink-muted",children:[f.jsx("span",{children:l("chat.speech.recording_hint")}),f.jsx("span",{className:"tabular-nums",children:VI(u)})]}),f.jsx("span",{className:"block h-2 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":"voice-level",children:f.jsx("span",{className:"block h-full bg-warning transition-[width] duration-100",style:{width:`${Math.round(Math.min(1,t)*100)}%`}})})]})]}),e==="transcribing"&&f.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-body text-ink-muted",children:[f.jsx(zy,{className:"w-4 h-4 animate-spin"}),f.jsx("span",{children:l("chat.speech.transcribing")})]}),e==="review"&&f.jsxs(f.Fragment,{children:[f.jsx("textarea",{value:n,onChange:m=>r(m.target.value),autoFocus:!0,rows:4,"data-testid":"voice-result-text",className:"w-full bg-ink/[0.05] text-body text-ink-strong rounded-xl px-3 py-2 resize-none focus:outline-none focus:bg-ink/[0.08]"}),f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:a,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body",children:l("chat.speech.rerecord")}),f.jsxs("button",{type:"button",onClick:i,disabled:o,"data-testid":"voice-send",className:"btn-3d-brand px-4 py-1.5 text-body flex items-center gap-1.5 disabled:opacity-40",children:[f.jsx(Jy,{className:"w-3.5 h-3.5"}),l("chat.send")]})]})]}),e==="error"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-body text-warning py-1",children:s??l("chat.speech.asr_failed")}),f.jsx("div",{className:"flex items-center justify-end",children:f.jsxs("button",{type:"button",onClick:a,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body flex items-center gap-1.5",children:[f.jsx(za,{className:"w-3.5 h-3.5"}),l("chat.speech.retry")]})})]})]})}const $I={direct:"soul.direct",guide:"soul.guide",practice:"soul.practice"},WI={direct:or,guide:K1,practice:Py},GI={direct:"soul.direct.desc",guide:"soul.guide.desc",practice:"soul.practice.desc"},YI=["image/png","image/jpeg","image/webp","image/gif",".txt",".md",".markdown",".rst",".org",".adoc",".log",".csv",".tsv",".json",".yaml",".yml",".toml",".ini",".py",".js",".mjs",".cjs",".ts",".tsx",".jsx",".go",".rs",".java",".c",".h",".cpp",".hpp",".cs",".rb",".sh",".sql",".html",".css",".scss",".vue",".svelte",".kt",".swift",".php"].join(",");let pp=0;function KI({nodeId:e,agentReady:t,streaming:n,souls:r,activeSoul:i,starterPrompts:a,onPickSoul:s,onSend:o,onStop:l,onLogFriction:u,onGotoSettings:c,insertText:h,historyTokens:m}){const d=$e(),p=lg(),[g,x]=w.useState(""),[b,v]=w.useState([]),[E,N]=w.useState(null),[k,S]=w.useState(null),[_,C]=w.useState(!1),I=w.useRef(null),A=w.useRef(0),[R,L]=w.useState(!0);w.useEffect(()=>{ie.getSetting("asr_auto_stop").then(me=>L(me!=="0"))},[]);const[z,j]=w.useState(!1);w.useEffect(()=>(Eh(z),()=>Eh(!1)),[z]);const[B,H]=w.useState(""),[Y,V]=w.useState(!1),[Z,O]=w.useState(null),X=jI(me=>{H(me),V(!0)},{locale:p,autoStop:R}),ne=X.startError??X.transcribeError;w.useEffect(()=>{if(!ne)return;O(d(ne==="no-speech"?"chat.speech.no_speech":ne==="model-missing"?"chat.speech.asr_model_missing":ne==="engine-unavailable"?"chat.speech.engine_unavailable":ne==="custom-provider-missing"?"chat.speech.custom_provider_missing":ne==="groq-key-missing"?"chat.speech.groq_key_missing":ne==="azure-key-missing"?"chat.speech.azure_stt_key_missing":ne==="azure-region-missing"?"chat.speech.azure_stt_region_missing":ne==="mic-insecure-context"?"chat.speech.asr_insecure_context":ne==="mic-unavailable"?"chat.speech.asr_start_fail":"chat.speech.asr_failed")),X.clearTranscribeError()},[ne,X,d]);const P=Z?"error":X.listening?"recording":X.transcribing?"transcribing":Y?"review":"idle",te=(me,Ue,dt)=>{Q3(),o(me,Ue,dt)},Q=w.useCallback(()=>{H(""),V(!1),O(null)},[]),K=w.useCallback(()=>{j(!1),Q()},[Q]),ce=()=>{const me=B.trim();!me||n||!e||(te(me),K())};w.useEffect(()=>{h&&x(me=>me.trim()?`${me}
784
+
785
+ ${h}`:h)},[h]),w.useEffect(()=>{if(!e){S(null);return}let me=!1;(async()=>{try{const dt=await ie.getContextUsage(e,p);me||S(dt)}catch{me||S(null)}})();const Ue=()=>{ie.getContextUsage(e,p).then(dt=>{me||S(dt)}).catch(()=>{})};return window.addEventListener("llm-config-changed",Ue),()=>{me=!0,window.removeEventListener("llm-config-changed",Ue)}},[e,p]),w.useEffect(()=>{if(!E)return;const me=setTimeout(()=>N(null),3e3);return()=>clearTimeout(me)},[E]);const le=w.useRef(new Set);w.useEffect(()=>()=>{for(const me of le.current)URL.revokeObjectURL(me)},[]);const ee=w.useCallback(me=>{v(Ue=>{const dt=Ue.find(nt=>nt.id===me);return dt!=null&&dt.previewUrl&&(URL.revokeObjectURL(dt.previewUrl),le.current.delete(dt.previewUrl)),Ue.filter(nt=>nt.id!==me)})},[]),Ce=w.useCallback(async me=>{if(me.length===0)return;const Ue=Qa.maxPerMessage-b.length;if(Ue<=0){N(d("chat.attach.tooMany",{n:Qa.maxPerMessage}));return}const dt=me.length>Ue?me.slice(0,Ue):me;me.length>Ue&&N(d("chat.attach.tooMany",{n:Qa.maxPerMessage}));const nt=[],mt=[];for(const Qe of dt){const Pe=RI(Qe.name,Qe.type,Qe.size);if(!Pe.ok){N(Pe.reason==="unsupported"?d("chat.attach.unsupported",{name:Qe.name}):Pe.reason==="tooLargeImage"?d("chat.attach.tooLargeImage",{name:Qe.name}):d("chat.attach.tooLargeText",{name:Qe.name}));continue}if(Pe.kind==="image"){if((k==null?void 0:k.visionCapable)===!1){N(d("chat.attach.visionUnsupported"));continue}const oe=await new Promise(_e=>{const Ae=new FileReader;Ae.onload=()=>{const ze=Ae.result;_e(typeof ze=="string"?ze.slice(ze.indexOf(",")+1):null)},Ae.onerror=()=>_e(null),Ae.readAsDataURL(Qe)});if(oe===null)continue;const ge=URL.createObjectURL(Qe);mt.push(ge),nt.push({id:++pp,kind:"image",name:Qe.name,mime:Qe.type||"image/png",size:Qe.size,previewUrl:ge,base64:oe})}else try{const oe=await Qe.text();nt.push({id:++pp,kind:"text",name:Qe.name,mime:Qe.type||"text/plain",size:Qe.size,text:oe})}catch{}}if(nt.length>0){for(const Qe of mt)le.current.add(Qe);v(Qe=>[...Qe,...nt])}else for(const Qe of mt)URL.revokeObjectURL(Qe)},[b.length,k==null?void 0:k.visionCapable,d]),de=me=>{const Ue=me.trim();if(n||!e||!Ue&&b.length===0)return;const dt=Ue||X0("chat.attach.imageOnlyText"),nt=b.map(mt=>({kind:mt.kind,name:mt.name,mime:mt.mime,size:mt.size,data:mt.kind==="image"?mt.base64??"":mt.text??"",...mt.kind==="image"&&mt.previewUrl?{previewUrl:mt.previewUrl}:{}}));te(dt,void 0,nt.length>0?nt:void 0),x(""),v([])},he=()=>de(g),pe=me=>{n||(te(me.message,me.label),me.frictionCategory&&(u==null||u(me.frictionCategory,null)))},Ne=me=>{const Ue=Array.from(me.clipboardData.files??[]);Ue.length>0&&(me.preventDefault(),Ce(Ue))},Oe=me=>{me.dataTransfer.types.includes("Files")&&(me.preventDefault(),A.current+=1,C(!0))},ot=me=>{me.dataTransfer.types.includes("Files")&&(A.current=Math.max(0,A.current-1),A.current===0&&C(!1))},Be=me=>{me.dataTransfer.types.includes("Files")&&(me.preventDefault(),A.current=0,C(!1),Ce(Array.from(me.dataTransfer.files??[])))},ct=w.useMemo(()=>ig(g),[g]);return t?f.jsxs("div",{className:"px-5 pb-4 pt-1 shrink-0","data-testid":"composer",children:[!z&&a.length>0&&e&&f.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-2","data-testid":"starter-prompts",children:a.map((me,Ue)=>f.jsx("button",{onClick:()=>pe(me),disabled:n,"data-testid":`starter-prompt-${Ue}`,"data-tooltip":me.hint??me.label,className:"shrink-0 whitespace-nowrap px-2.5 py-1 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors disabled:opacity-30",children:me.label},Ue))}),f.jsx("div",{className:`composer-card relative rounded-2xl transition-colors px-3 pt-2 pb-1.5 ${_?"bg-accent/10 ring-1 ring-accent":"bg-ink/[0.05] focus-within:bg-ink/[0.07]"}`,onDragEnter:Oe,onDragOver:me=>{me.dataTransfer.types.includes("Files")&&me.preventDefault()},onDragLeave:ot,onDrop:Be,"data-testid":"composer-card",children:z?f.jsxs(f.Fragment,{children:[P!=="idle"&&f.jsx(qI,{view:P,level:X.level,text:B,onTextChange:H,onSend:ce,onRerecord:Q,errorMessage:Z,sendDisabled:n||!e||!B.trim()}),f.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[f.jsxs("span",{className:"flex items-center gap-1.5 text-label text-ink-muted font-medium",children:[f.jsx(Fa,{className:"w-3.5 h-3.5 text-accent"}),d("chat.speech.dictation")]}),f.jsxs("button",{type:"button",onClick:K,"data-tooltip":d("chat.speech.back_to_keyboard"),"aria-label":d("chat.speech.back_to_keyboard"),"data-testid":"voice-keyboard-toggle",className:"touch-lift flex items-center gap-1 px-2 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[f.jsx(By,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:d("chat.speech.keyboard")})]})]}),f.jsxs("button",{type:"button",onPointerDown:me=>{me.preventDefault(),X.beginHold()},onPointerUp:X.endHold,onPointerLeave:X.endHold,onPointerCancel:X.endHold,onContextMenu:me=>me.preventDefault(),disabled:!e||P!=="idle","data-testid":X.listening?"voice-hold-btn-active":"voice-hold-btn",className:`w-full py-5 rounded-xl text-lead font-bold flex items-center justify-center gap-2 transition-all touch-none select-none disabled:opacity-40 ${X.listening?"bg-accent/25 text-accent scale-[0.99]":"bg-accent/10 text-accent hover:bg-accent/20 active:bg-accent/25 active:scale-[0.99]"}`,children:[f.jsx(Fa,{className:"w-5 h-5"}),X.listening?d("chat.speech.release_to_stop"):d("chat.speech.hold_to_talk")]})]}):f.jsxs(f.Fragment,{children:[r.length>0&&f.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto mb-1","data-testid":"soul-picker",children:[f.jsx("span",{className:"text-body text-ink-faint shrink-0",children:d("chat.soul.label")}),r.map(me=>{const Ue=i===me.name,dt=WI[me.name]??K1,nt=d(GI[me.name]??"soul.direct.desc");return f.jsxs("button",{onClick:()=>s(me.name),"data-testid":`soul-pill-${me.name}`,"data-tooltip":nt,className:`shrink-0 flex items-center gap-1 px-2 py-0.5 rounded-full text-body font-medium transition-colors ${Ue?"bg-brand/15 text-brand":"text-ink-muted hover:text-ink-strong hover:bg-ink/5"}`,children:[f.jsx(dt,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:d($I[me.name]??"soul.direct")})]},me.id)})]}),b.length>0&&f.jsxs("div",{className:"flex gap-1.5 flex-wrap mb-1.5","data-testid":"composer-attachments",children:[(k==null?void 0:k.visionBridgeModel)&&b.some(me=>me.kind==="image")&&f.jsxs("div",{className:"w-full flex items-center gap-1 text-caption text-ink-muted","data-testid":"vision-bridge-chip",children:[f.jsx(Zy,{className:"w-3.5 h-3.5 shrink-0"}),f.jsx("span",{children:d("chat.attach.bridgeChip",{model:k.visionBridgeModel})})]}),b.map(me=>me.kind==="image"?f.jsxs("div",{className:"relative w-16 h-16 shrink-0",children:[f.jsx("img",{src:me.previewUrl,alt:me.name,className:"w-16 h-16 object-cover rounded-lg border border-[var(--border)]"}),f.jsx("button",{type:"button",onClick:()=>ee(me.id),"aria-label":d("chat.attach.remove",{name:me.name}),className:"touch-target-sm absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-ink/70 hover:bg-warning text-white flex items-center justify-center transition-colors",children:f.jsx(Fn,{className:"w-3 h-3"})})]},me.id):f.jsxs("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-1 rounded-full bg-ink/[0.08] text-caption text-ink-strong",children:[f.jsx(ps,{className:"w-3 h-3 shrink-0 text-ink-faint"}),f.jsx("span",{className:"truncate max-w-[10rem]",children:me.name}),f.jsx("button",{type:"button",onClick:()=>ee(me.id),"aria-label":d("chat.attach.remove",{name:me.name}),className:"touch-target-sm w-4 h-4 rounded-full hover:bg-ink/20 flex items-center justify-center text-ink-muted hover:text-warning transition-colors",children:f.jsx(Fn,{className:"w-2.5 h-2.5"})})]},me.id))]}),E&&f.jsx("div",{className:"text-caption text-warning pb-1",role:"status","data-testid":"composer-notice",children:E}),f.jsxs("div",{className:"flex gap-2 items-end",children:[f.jsx("textarea",{value:g,onChange:me=>x(me.target.value),onFocus:()=>Th(!0),onBlur:()=>Th(!1),onKeyDown:me=>{me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),he())},onPaste:Ne,placeholder:d(e?"chat.input.placeholder":"chat.input.no_node"),disabled:n||!e,rows:2,"data-testid":"chat-input",className:"flex-1 bg-transparent text-ink-strong text-body rounded-lg px-1 py-1 resize-none focus:outline-none disabled:opacity-40 placeholder:text-ink-faint"}),n?f.jsx("button",{onClick:l,"data-testid":"chat-stop",className:"btn-icon-3d-warning shrink-0 w-9 h-9",title:d("chat.stop"),"aria-label":d("chat.stop"),children:f.jsx(Y0,{className:"w-3.5 h-3.5 fill-current"})}):f.jsx("button",{onClick:he,disabled:n||!g.trim()&&b.length===0||!e,"data-testid":"chat-send",className:"btn-icon-3d-brand shrink-0 w-9 h-9",title:d("chat.send"),"aria-label":d("chat.send"),children:f.jsx(ky,{className:"w-4 h-4"})})]}),f.jsxs("div",{className:"composer-toolbar flex flex-wrap items-center justify-between gap-x-0.5 gap-y-1 mt-0.5",children:[f.jsx("button",{type:"button",onClick:()=>{Q(),j(!0)},disabled:!e,"data-tooltip":d("chat.speech.dictation"),"aria-label":d("chat.speech.dictation"),"data-testid":"composer-mic",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors disabled:opacity-50",children:f.jsx(Fa,{className:"w-3.5 h-3.5"})}),f.jsx("button",{type:"button",onClick:()=>{var me;return(me=I.current)==null?void 0:me.click()},"data-tooltip":d("chat.attach.add"),"aria-label":d("chat.attach.add"),"data-testid":"composer-attach",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:f.jsx(Gy,{className:"w-3 h-3"})}),f.jsx("input",{ref:I,type:"file",multiple:!0,accept:YI,className:"hidden",onChange:me=>{Ce(Array.from(me.target.files??[])),me.target.value=""}}),f.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-0.5",children:[f.jsx(UI,{}),f.jsx(FI,{info:k,historyTokens:m,draftTokens:ct}),f.jsx(BI,{onGotoSettings:c})]})]})]})})]}):f.jsx("div",{className:"px-5 pb-4 shrink-0","data-testid":"composer-nokey",children:f.jsxs("div",{className:"flex items-center justify-center gap-3 py-3 text-body text-ink-muted",children:[f.jsx("span",{children:d("chat.no_key.short")}),f.jsx("button",{onClick:c,className:"text-brand hover:underline font-bold",children:d("chat.no_key.cta")})]})})}const gp={viseme:"closed",open:0};function XI(e){const[t,n]=w.useState(gp);return w.useEffect(()=>{if(!e){n(gp);return}const r=new Uint8Array(256),i=new Uint8Array(Wb/2);let a=0,s="",o=null,l=0;const u=()=>{const c=zM();if(c){let h,m;if(c.timeline&&c.timeline.cues.length>0){const g=Math.max(0,c.ctx.currentTime-c.startedAtCtxTime),x=JM(c.timeline,g);h=(x==null?void 0:x.viseme)??"closed",m=(x==null?void 0:x.level)??0}else if(c.analyser){const g=c.analyser;g.getByteTimeDomainData(r),g.getByteFrequencyData(i);const x=Z3(r,i,g.context.sampleRate,g.fftSize);h=x.viseme,h!==s.split(":")[0]?(h==="closed"||h===o?h===o&&l++:(o=h,l=1),h!=="closed"&&!(h===o&&l>=2)&&(h=s.split(":")[0]||"closed")):(o=null,l=0),m=x.level}else h="closed",m=0;const d=J3(h,m),p=h+":"+d;p!==s&&(s=p,n({viseme:h,open:d}))}a=requestAnimationFrame(u)};return a=requestAnimationFrame(u),()=>cancelAnimationFrame(a)},[e]),t}const QI=22,ZI=35e-5,xp=.012,bp=.12,yp=.3,JI=16.667,Yu=12,e_=3.2,vp=56,ji=.6;function t_(e,t,n,r,i=0,a=0){let s=0,o=0;for(const u of r){const c=e-u.x,h=t-u.y,m=Math.hypot(c,h),d=u.r+n,p=d+vp;if(m>=p)continue;if(m<1e-4){o-=ji;continue}const g=c/m,x=h/m,b=Math.min(1.6,Math.max(0,1-(m-d)/vp)),v=i*g+a*x,E=v<0?1+Math.min(1.6,-v/4):1;s+=g*ji*b*E,o+=x*ji*b*E}const l=Math.hypot(s,o);return l>ji*2&&(s=s/l*ji*2,o=o/l*ji*2),{x:s,y:o}}function n_(e,t,n,r=34){const i=n*.001;return{x:e.x+Math.sin(i*.31+t*2.1)*r,y:e.y+Math.sin(i*.47+t*4.7)*(r*.55)+Math.sin(i*1.7+t)*4}}function r_(e,t,n,r,i=JI){const a=Math.max(64,i*i),s=f0((n.x-e.x)*xp-t.x*bp,yp),o=f0((n.y-e.y)*xp-t.y*bp,yp);return{fx:s*r/a,fy:o*r/a-r*.001}}function f0(e,t){return e>t?t:e<-t?-t:e}function i_(e,t,n,r,i,a,s,o,l,u){const c=e-a,h=t-s,m=Math.hypot(c,h),d=i+u;if(m>=d||m<1e-4)return null;const p=c/m,g=h/m,x=n-o,b=r-l,v=x*p+b*g,E=d-m,N=v<0?-v*.9:0;return{nx:p,ny:g,dvx:p*(E*.55+N*.85),dvy:g*(E*.55+N*.85),bfx:-p*N*.02,bfy:-g*N*.02,hitSpeed:-v}}function a_(e,t){return Math.hypot(e,t)<.35?0:f0(e*.06,.5)}function s_(e,t,n,r=0){const i=[.14,.32,.5,.68,.86],a=[.38,.5,.62],s=(r%15+15)%15;let o={x:e*.5,y:t*.5},l=-1/0;for(let u=0;u<15;u++){const c=(s+u)%15,h=e*i[c%5],m=t*a[Math.floor(c/5)];let d=1/0;for(const p of n){const g=Math.hypot(h-p.x,m-p.y)-p.r;g<d&&(d=g)}d>l+1e-9&&(l=d,o={x:h,y:m})}return o}function o_(e,t,n=220){let r=null,i=n;for(const a of t){const s=Math.hypot(a.x-e.x,a.y-e.y);s<i&&(i=s,r={x:a.x,y:a.y})}return r}function l_(e){const t=e.radius??QI,{Bodies:n,Body:r,Composite:i,Engine:a}=Pr,s=a.create();s.gravity.y=1,s.positionIterations=4,s.velocityIterations=3;const o=n.circle(e.width*.7,120,t,{restitution:.55,friction:.02,frictionAir:.028,density:ZI});i.add(s.world,o);const l=240;let u=[];const c=(d,p)=>{for(const x of u)i.remove(s.world,x);const g=(x,b,v,E)=>n.rectangle(x,b,v,E,{isStatic:!0,restitution:.5});u=[g(-l/2,p/2-160,l,p+640),g(d+l/2,p/2-160,l,p+640),g(d/2,p+l/2,d+l*2,l),g(d/2,-320-l/2,d+l*2,l)];for(const x of u)i.add(s.world,x)};c(e.width,e.height);let h=0,m=e.width;return{body:o,resize(d,p){m=d,c(d,p)},step(d,p,g,x,b){const v=x<h;a.update(s,Math.min(33,Math.max(8,d)));let E=!1;if(!v&&p){const z=b!=null&&b.settle?{x:p.x,y:p.y+Math.sin(x*.0012)*2}:n_(p,Math.floor(x/4200),x),j=Math.max(64,d*d),B=r_({x:o.position.x,y:o.position.y},{x:o.velocity.x,y:o.velocity.y},z,o.mass,d),H=t_(o.position.x,o.position.y,t,g,o.velocity.x,o.velocity.y);r.applyForce(o,o.position,{x:B.fx+H.x*o.mass/j,y:B.fy+H.y*o.mass/j}),r.setAngularVelocity(o,o.angularVelocity-o.angle*.06-o.angularVelocity*.08)}{const z=o.velocity,j=Math.hypot(z.x,z.y);j>Yu&&r.setVelocity(o,{x:z.x/j*Yu,y:z.y/j*Yu})}let N=0,k=0,S=0,_=0,C=0;for(const z of g){const j=i_(o.position.x,o.position.y,o.velocity.x,o.velocity.y,t,z.x,z.y,z.vx,z.vy,z.r);j&&(k+=j.nx*Math.min(4,j.dvx),S+=j.ny*Math.min(4,j.dvy),_+=j.dvx*.9,C+=j.dvy*.9,z.isStatic||z.push(j.bfx,j.bfy),j.hitSpeed>N&&(N=j.hitSpeed))}const I=Math.hypot(k,S);I>4&&(k=k/I*4,S=S/I*4);const A=Math.hypot(_,C);A>7&&(_=_/A*7,C=C/A*7),(I>0||A>0)&&(r.setPosition(o,{x:o.position.x+k,y:o.position.y+S}),r.setVelocity(o,{x:o.velocity.x+_,y:o.velocity.y+C})),N>=e_&&!v&&(h=x+900,E=!0);const R=o.position;R.x<t&&(r.setPosition(o,{x:t,y:R.y}),o.velocity.x<0&&r.setVelocity(o,{x:-o.velocity.x*.5,y:o.velocity.y})),R.x>m-t&&(r.setPosition(o,{x:m-t,y:R.y}),o.velocity.x>0&&r.setVelocity(o,{x:-o.velocity.x*.5,y:o.velocity.y}));const L=b==null?void 0:b.ceilY;return L!==void 0&&R.y<L+t&&(r.setPosition(o,{x:R.x,y:L+t}),o.velocity.y<0&&r.setVelocity(o,{x:o.velocity.x,y:-o.velocity.y*.5})),E},dizzyRemaining(d){return Math.max(0,h-d)},throwDizzy(d){h=d+900},dispose(){i.clear(s.world,!1),a.clear(s)}}}const kn={rail:76,chat:96,notebook:120};function wp(){const t=document.querySelector('[data-testid="composer-card"]')??document.querySelector('[data-testid="composer"]')??document.querySelector('[data-testid="composer-nokey"]');if(!t)return null;const n=t.getBoundingClientRect();return{x:n.right-78,y:n.top-44}}function u_(){const e=document.querySelector('[data-testid="notebook-panel"]');if(!e)return null;const t=e.getBoundingClientRect();return{x:t.right-64,y:t.top+84}}function c_({courseId:e}){const t=w.useSyncExternalStore(q1,pc),n=XI(t.state.talking),r=z0(),[i,a]=w.useState(!1),[s,o]=w.useState(null),[l,u]=w.useState("rail"),c=w.useRef("rail"),h=w.useRef(null),[m,d]=w.useState(!1),p=w.useRef(!1),g=w.useRef(null),x=w.useRef(null),b=w.useRef(null),v=w.useRef(null),E=w.useRef(t.state.zone),N=w.useRef(!1),k=w.useRef(0),S=w.useRef(null),[_,C]=w.useState(null),I=w.useRef(0),A=w.useRef(null),R=w.useRef(null),L=w.useRef(0),z=w.useRef(null),j=w.useRef(0),B=w.useRef({pane:"rail",bucket:-1}),H=w.useRef(null),Y=w.useRef(null);w.useEffect(()=>{var ne,P,te;if(l===E.current||(E.current=l,r))return;a(!0),(P=(ne=g.current)==null?void 0:ne.animate)==null||P.call(ne,[{transform:"scale(1, 1)"},{transform:"scale(1.08, 0.86)",offset:.3},{transform:"scale(0.96, 1.1)",offset:.65},{transform:"scale(1, 1)"}],{duration:620,easing:"cubic-bezier(0.2, 1.4, 0.4, 1)",composite:"add"}),(te=g.current)==null||te.classList.add("cp-takeoff"),setTimeout(()=>{var Q;return(Q=g.current)==null?void 0:Q.classList.remove("cp-takeoff")},650);const X=[setTimeout(()=>a(!1),950),setTimeout(()=>{var K;const Q=g.current;!Q||l==="rail"||(ey(),(K=Q.animate)==null||K.call(Q,[{transform:"scale(1, 1)"},{transform:"scale(1.07, 0.88)",offset:.42},{transform:"scale(0.98, 1.03)",offset:.72},{transform:"scale(1, 1)"}],{duration:280,easing:"ease-out",composite:"add"}))},940)];return()=>{for(const Q of X)clearTimeout(Q)}},[l,r]),w.useEffect(()=>{if(!e)return;let X=!0;return window.api.getDashboard(e).then(ne=>{var K,ce;if(!X)return;const P=(K=ne==null?void 0:ne.frictionByNode)==null?void 0:K[0];if(!(P!=null&&P.nodeId))return;Y.current=P.nodeId;const te=Ch(),Q=(ce=te.nav)==null?void 0:ce.getBoundingClientRect();if(Q)for(const{island:le,container:ee}of te.sections.values()){const Ce=le.ball(P.nodeId);if(!Ce)continue;const de=ee.getBoundingClientRect(),he=de.left-Q.left+Ce.body.position.x,pe=de.top-Q.top+Ce.body.position.y;R.current={x:he,y:Math.max(40,pe-92)},L.current=performance.now()+8e3,setTimeout(()=>{X&&Nh()},1200);return}}).catch(()=>{}),()=>{X=!1}},[e]),w.useEffect(()=>{const X=ne=>{const P=ne.detail,te=Y.current;P!=="mastery"||!te||!e||window.api.getDashboard(e).then(Q=>{var ce;((ce=Q==null?void 0:Q.frictionByNode)==null?void 0:ce.some(le=>le.nodeId===te))||(Y.current=null,L.current=0,ny())}).catch(()=>{})};return window.addEventListener("companion-state-changed",X),()=>window.removeEventListener("companion-state-changed",X)},[e]),w.useEffect(()=>{const X=P=>{const te=z.current;if(!te)return;const Q=performance.now(),K=Math.max(8,Q-te.t);z.current={x:P.clientX,y:P.clientY,vx:(P.clientX-te.x)/K*16.7,vy:(P.clientY-te.y)/K*16.7,t:Q}},ne=()=>{const P=z.current;if(!P)return;z.current=null;const te=Math.hypot(P.vx,P.vy),Q=x.current;Q&&te>=2.5&&(Pr.Body.setVelocity(Q.body,{x:P.vx*.9,y:P.vy*.9}),Q.throwDizzy(performance.now())),Sh(!1,te)};return window.addEventListener("pointermove",X,{passive:!0}),window.addEventListener("pointerup",ne,{passive:!0}),window.addEventListener("pointercancel",ne,{passive:!0}),()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",ne),window.removeEventListener("pointercancel",ne)}},[]),w.useEffect(()=>{if(!t.enabledLoaded||!t.enabled||t.petMode)return;const X=g.current;if(!X)return;let ne=0,P=performance.now(),te=0,Q=0,K=0,ce=-1e9,le=null,ee=null,Ce=0,de=0;const he=pe=>{var Je,Kr,ae,rt,Tt,nn,Xn,Cr;ne=requestAnimationFrame(he);const Ne=Math.min(50,pe-P);P=pe;const Oe=Ch(),ot=Oe.nav,Be=(ot==null?void 0:ot.getBoundingClientRect())??null,ct=pc().state,me=!!z.current,Ue=!!Be&&Be.width>40&&(Oe.visible||ct.importing);pe-ce>150&&(ce=pe,le=((Je=document.querySelector('[data-testid="chat-panel"]'))==null?void 0:Je.getBoundingClientRect())??null,ee=((Kr=document.querySelector('[data-testid="notebook-panel"]'))==null?void 0:Kr.getBoundingClientRect())??null,Ce=((ae=document.querySelector("header.app-header"))==null?void 0:ae.getBoundingClientRect().bottom)??0,de=((rt=document.querySelector('[data-testid="map-rail-topbar"]'))==null?void 0:rt.getBoundingClientRect().bottom)??0);const dt=le,nt=ee,mt=()=>Math.max(Ce,de)-((Be==null?void 0:Be.top)??0),Qe=Math.floor(pe/iy);if(B.current.bucket!==Qe){const Ge=[];if(Ue&&Ge.push("rail"),dt&&Ge.push("chat"),nt&&Ge.push("notebook"),B.current={pane:ry(B.current.pane,Qe,Ge),bucket:Qe},Ue&&ct.zone==="roam"){const tt=document.querySelector('[data-testid="map-review-badge"]'),Dt=!!tt&&tt.className.includes("bg-review/20");let St=null;for(const{island:Ze,container:it}of Oe.sections.values()){const un=Ze.balls.find(ft=>!ft.body.isStatic);if(un){const ft=it.getBoundingClientRect();St={x:ft.left+un.body.position.x,y:ft.top+un.body.position.y};break}}const Kt=L.current>pe?R.current:null,lt=ly(Qe,{hasReview:Dt,hasNext:!!St,hasFriction:!!Kt});if(lt==="review"&&tt){const Ze=tt.getBoundingClientRect();H.current={kind:lt,until:pe+Ul,pos:{x:Ze.right+44,y:Ze.bottom+64},fired:!1},B.current.pane="rail"}else lt==="inspect"&&St?(H.current={kind:lt,until:pe+Ul,pos:{x:St.x+34,y:St.y-66},fired:!1},B.current.pane="rail"):lt==="friction"&&Kt&&(H.current={kind:lt,until:pe+Ul,pos:{x:Kt.x,y:Kt.y},fired:!1},B.current.pane="rail")}}const Pe=H.current&&pe<H.current.until?H.current:null;H.current&&!Pe&&(H.current=null);const oe=uy();if(oe&&oe.seq!==k.current&&!ct.examActive){k.current=oe.seq;let Ge=oe.x,tt=oe.y;if((Ge==null||tt==null)&&Ue)for(const{island:Dt,container:St}of Oe.sections.values()){const Kt=Dt.ball(oe.nodeId);if(Kt){const lt=St.getBoundingClientRect();Ge=lt.left+Kt.body.position.x,tt=lt.top+Kt.body.position.y;break}}Ue&&Ge!=null&&tt!=null?(S.current={nodeId:oe.nodeId,x:Ge,y:tt,until:pe+2400,fired:!1,fly:!0},C({until:pe+2400})):(S.current={nodeId:oe.nodeId,x:0,y:0,until:pe+1600,fired:!0,fly:!1},C({until:pe+1600}))}const ge=!!S.current&&pe<S.current.until;if(S.current&&!ge&&(S.current=null,C(null)),ge&&S.current&&!S.current.fired){const Ge=S.current;if(Ge.fired=!0,Ge.fly&&Be)for(const{island:tt}of Oe.sections.values()){const Dt=tt.ball(Ge.nodeId);if(Dt&&!Dt.body.isStatic){Pr.Body.applyForce(Dt.body,Dt.body.position,{x:.0035,y:-.005});break}}}const _e=cy();if(_e&&_e.seq!==I.current&&!ct.examActive&&(I.current=_e.seq,Ue&&Be)){const Ge=mt();A.current={x:Math.min(Be.width-44,Math.max(44,_e.x-Be.left)),y:Math.min(Be.height-44,Math.max(Ge+52,_e.y-Be.top)),until:pe+3200}}const Ae=!!A.current&&pe<A.current.until;A.current&&!Ae&&(A.current=null);const ze=$N(),ye=ze?ze.startContainer.parentElement??null:null;let Re=null,He=B.current.pane;const ht=ct.examActive?(Tt=document.querySelector('[data-testid="exam-timer"]'))==null?void 0:Tt.getBoundingClientRect():void 0;if(ht){x.current=null,z.current=null,He="chat";const Ge={x:Math.min(ht.right+64,window.innerWidth-70),y:Math.min(ht.bottom+56,window.innerHeight-90)},tt=b.current??Ge;Re=Hn(tt,Ge,Ne,ya),K=Math.max(-.15,Math.min(.15,(Re.x-tt.x)*.008))}else if(me){const Ge=z.current;x.current=null,Re={x:Ge.x,y:Ge.y},K=Math.max(-.5,Math.min(.5,Ge.vx*.04)),He=c.current}else if(ye&&ze){const Ge=ye.closest('[data-testid="notebook-panel"], [data-testid="chat-stream"]'),tt=Ge==null?void 0:Ge.getBoundingClientRect(),Dt=ze.getClientRects(),St=[];for(let ft=0;ft<Dt.length;ft++){const Mt=Dt[ft];Mt.width>1&&Mt.height>1&&St.push({left:Mt.left,right:Mt.right,top:Mt.top,bottom:Mt.bottom})}const Kt=St.length?St[St.length-1]:null,lt=St.length?St[0]:null,Ze=ze.getBoundingClientRect(),it=!!(Ge!=null&&Ge.closest('[data-testid="chat-stream"]')),un=it?kn.chat:kn.notebook;if(He=it?"chat":"notebook",tt&&(Kt||Ze.width>0)){const ft=Ah({left:Ze.left,right:Ze.right,top:Ze.top,bottom:Ze.bottom},tt,un,{first:lt??void 0,last:Kt??void 0},St),Mt={dir:ft.dir,pane:He};if((((nn=h.current)==null?void 0:nn.dir)!==Mt.dir||((Xn=h.current)==null?void 0:Xn.pane)!==Mt.pane)&&(h.current=Mt,o(Mt)),p.current!==ft.occluding&&(p.current=ft.occluding,d(ft.occluding)),r)Re=ft,K=0;else{const Wt=b.current??{x:ft.x,y:ft.y};Re=Hn(Wt,ft,Ne,sy,110),K=ft.dir==="left"?-.07:ft.dir==="right"?.07:0}}else{h.current!==null&&(h.current=null,o(null)),p.current&&(p.current=!1,d(!1));const ft=tt?{left:tt.left,top:tt.top,right:tt.right,bottom:tt.bottom}:{left:8,top:8,right:window.innerWidth-8,bottom:window.innerHeight-8},Mt=Jr(ft,un,pe),Wt=b.current??{x:Mt.x,y:Mt.y};Re=Hn(Wt,Mt,Ne,va,140),K=Math.max(-.25,Math.min(.25,(Re.x-Wt.x)*.01))}}else{h.current!==null&&(h.current=null,o(null)),p.current&&(p.current=!1,d(!1));const Ge=ct.pose==="writing"?GN():null,tt=ct.zone,Dt=Ge?Ge.closest('[data-testid="notebook-panel"], [data-testid="chat-stream"]'):null,St=Ge==null?void 0:Ge.getBoundingClientRect(),Kt=!!(Dt&&St&&St.width>0);if(Ge&&Kt){const lt=Dt,Ze=lt.getBoundingClientRect(),it=St,un=!!lt.closest('[data-testid="chat-stream"]');He=un?"chat":"notebook";{const ft=Ah(it,Ze,un?kn.chat:kn.notebook);if(x.current=null,r)Re=ft,K=0;else{const Mt=b.current??{x:ft.x,y:ft.y};Re=Hn(Mt,ft,Ne,ya),K=.08}}}else if(tt==="chat"&&wp()){x.current=null,He="chat";const lt=wp();if(r)Re=lt,K=0;else{const Ze=ay("chat",pe),it=b.current??{x:lt.x,y:lt.y};Re=Hn(it,{x:lt.x+Ze.x,y:lt.y+Ze.y},Ne,ya),K=Math.max(-.35,Math.min(.35,(Re.x-it.x)*.014))}}else if(tt==="notebook"&&nt)if(x.current=null,He="notebook",r)Re=u_()??{x:nt.left+nt.width/2,y:nt.top+120},K=0;else{const lt=Jr(nt,kn.notebook,pe),Ze=b.current??{x:lt.x,y:lt.y};Re=Hn(Ze,lt,Ne,ya),K=Math.max(-.3,Math.min(.3,(Re.x-Ze.x)*.012))}else if(Ue&&(ge||Ae||tt==="rail"||tt==="roam"&&(B.current.pane==="rail"||Pe))){const lt=Be.width,Ze=Be.height;if(He="rail",r)Re={x:Be.left+lt*.5,y:Be.top+Ze*.5},K=0;else{if((lt!==te||Ze!==Q)&&(te=lt,Q=Ze,(Cr=x.current)==null||Cr.resize(lt,Ze),R.current=null),!x.current){x.current=l_({width:lt,height:Ze});const Xt=b.current;Xt&&Pr.Body.setPosition(x.current.body,{x:Math.min(lt-30,Math.max(30,Xt.x-Be.left)),y:Math.min(Ze-30,Math.max(30,Xt.y-Be.top))})}const it=x.current,un=[],ft=[];for(const{island:Xt,container:Xr}of Oe.sections.values()){const Qr=Xr.getBoundingClientRect();if(Qr.bottom<Be.top-120||Qr.top>Be.bottom+120)continue;const ba=Qr.left-Be.left,Ii=Qr.top-Be.top;for(const Qt of Xt.balls)un.push({x:ba+Qt.body.position.x,y:Ii+Qt.body.position.y,vx:Qt.body.velocity.x,vy:Qt.body.velocity.y,r:Ln,isStatic:Qt.body.isStatic,push:(Zr,jl)=>Pr.Body.applyForce(Qt.body,Qt.body.position,{x:Zr,y:jl})}),ft.push({x:ba+Qt.body.position.x,y:Ii+Qt.body.position.y-Ln-20});for(const Qt of Xt.links)for(const Zr of Qt.particles)ft.push({x:ba+Zr.position.x,y:Ii+Zr.position.y-8})}const Mt=tt==="roam";let Wt=R.current,Mi=!1;if(Ae&&A.current)Wt={x:A.current.x+28,y:A.current.y-52},Mi=!1;else if(ge&&S.current&&S.current.fly)Wt={x:S.current.x-Be.left+34,y:S.current.y-Be.top-46},Mi=!1;else if(Pe)Wt={x:Pe.pos.x-Be.left,y:Pe.pos.y-Be.top},Pe.fired||(Pe.fired=!0,Nh());else if(Mt){const Xt=Jr(Be,kn.rail,pe);Wt={x:Xt.x-Be.left,y:Xt.y-Be.top}}else{if(ct.mode==="veil"){const Xt=o_({x:it.body.position.x,y:it.body.position.y},ft,220);Xt&&(Wt=Xt,Mi=!0)}(!Wt||pe>L.current)&&(R.current=s_(lt,Ze,un,Math.floor(pe/1e3)),L.current=pe+3e3,Wt=R.current)}const Rs=it.step(Ne,Wt,ct.mode==="veil"&&!Mt?[]:un,pe,{settle:Mi,ceilY:mt()});if(Rs&&!N.current&&oy(),N.current=Rs||it.dizzyRemaining(pe)>0,it.dizzyRemaining(pe)===0){const Xt=hg(Oe.weather);if(Xt.wind>=.3){const Xr=it.body.mass;Pr.Body.applyForce(it.body,it.body.position,{x:dg(it.body.position.x,it.body.position.y,pe)*Xt.wind*cg*Xr*2.2,y:0})}(Oe.weather==="rain"||Oe.weather==="storm")&&ct.mode!=="veil"&&pe>j.current&&(j.current=pe+6e3+Math.random()*4e3,X.classList.add("cp-shiver"),setTimeout(()=>X.classList.remove("cp-shiver"),460))}const rn=it.body.position,xa={x:Be.left+rn.x,y:Be.top+rn.y},Pt=b.current??xa;Re=Hn(Pt,xa,Ne,ya),K=it.body.angle+a_(it.body.velocity.x,it.body.velocity.y)}}else{x.current=null;const lt=B.current.pane;if(lt==="chat"&&dt){He="chat";const Ze=Jr(dt,kn.chat,pe),it=b.current??{x:Ze.x,y:Ze.y};Re=Hn(it,Ze,Ne,va,140),K=Math.max(-.25,Math.min(.25,(Re.x-it.x)*.01))}else if(lt==="notebook"&&nt){He="notebook";const Ze=Jr(nt,kn.notebook,pe),it=b.current??{x:Ze.x,y:Ze.y};Re=Hn(it,Ze,Ne,va,140),K=Math.max(-.25,Math.min(.25,(Re.x-it.x)*.01))}else if(Ue){He="rail";const Ze=Jr(Be,kn.rail,pe),it=b.current??{x:Ze.x,y:Ze.y};Re=Hn(it,Ze,Ne,va,140),K=Math.max(-.25,Math.min(.25,(Re.x-it.x)*.01))}else{He="chat";const Ze=Jr({left:8,top:8,right:window.innerWidth-8,bottom:window.innerHeight-8},kn.chat,pe),it=b.current??{x:Ze.x,y:Ze.y};Re=Hn(it,Ze,Ne,va,140),K=Math.max(-.25,Math.min(.25,(Re.x-it.x)*.008))}}}if(c.current!==He&&(c.current=He,u(He)),!Re){X.style.opacity="0",b.current=null,v.current=null;return}b.current=Re;const en=X.offsetWidth||kn[He],jt=He==="rail"?Math.max(Ce,de):Ce;Re.y<jt+en/2+10&&(Re.y=jt+en/2+10),X.style.transform=`translate3d(${(Re.x-en/2).toFixed(1)}px, ${(Re.y-en/2).toFixed(1)}px, 0) rotate(${(K*57.2958).toFixed(1)}deg)`;const tn=v.current;if(tn){const Ge=Re.x-tn.x,tt=Re.y-tn.y,St=Math.hypot(Ge,tt)/Math.max(1,Ne);if(X.style.setProperty("--cp-speed",Math.min(1,St/.45).toFixed(3)),St>.02){const Kt=(Math.atan2(tt,Ge)*57.2958+90+360)%360;X.style.setProperty("--cp-thrust-deg",Kt.toFixed(1)+"deg")}}v.current={x:Re.x,y:Re.y}};return ne=requestAnimationFrame(he),()=>{var pe;cancelAnimationFrame(ne),(pe=x.current)==null||pe.dispose(),x.current=null}},[t.enabledLoaded,t.enabled,t.petMode,r]);const V=w.useRef(0);if(w.useEffect(()=>{const X=g.current;if(!X||t.state.keySeq===V.current||t.state.examActive)return;V.current=t.state.keySeq,X.classList.remove("cp-keypress"),X.offsetWidth,X.classList.add("cp-keypress");const ne=setTimeout(()=>X.classList.remove("cp-keypress"),160);return()=>clearTimeout(ne)},[t.state.keySeq]),!t.enabledLoaded||!t.enabled||t.petMode)return null;const Z=i?"flying":t.state.typing?"typing":_||(s==null?void 0:s.dir)==="left"?"point":(s==null?void 0:s.dir)==="right"?"pointr":(s==null?void 0:s.dir)==="up"?"pointu":(s==null?void 0:s.dir)==="down"?"pointd":t.state.pose,O=s?kn[s.pane]:kn[l];return f.jsx("div",{ref:g,className:`cp-creature fixed left-0 top-0 z-40 will-change-transform ${t.state.mode==="veil"?"cp-veil":""} ${m?"cp-occluding":""} ${t.state.grabbed?"cp-grabbed":""}`,"data-testid":"companion-creature","data-zone":t.state.zone==="roam"?l:t.state.zone,"data-mode":t.state.mode,children:f.jsx($1,{form:t.form,expression:t.state.expression,screenKey:t.state.typing?t.state.lastKey??(t.state.lastKeyKind==="enter"?"→":t.state.lastKeyKind==="back"?"⌫":null):null,keyFlash:t.state.typing&&t.state.lastKey==null&&(t.state.lastKeyKind==="enter"||t.state.lastKeyKind==="back"),coreLit:t.state.correctStreak>=3,noteTick:Date.now()<t.state.noteTickUntil,pose:Z,viseme:n.viseme,openScale:n.open,energyRatio:t.energyRatio,streakLit:t.streakLit,size:O,interactive:!0,ariaLabel:"companion",onPoke:ty,onGrab:(X,ne)=>{z.current||(z.current={x:X,y:ne,vx:0,vy:0,t:performance.now()},Sh(!0))},haloBadge:t.halo,testid:"companion-mascot",keySeq:t.state.keySeq,keySide:t.state.keySide})})}function Ku(e,t=4){const n=(e.match(/[\u2E80-\u9FFF\uF900-\uFAFF\uFF00-\uFFEF]/g)??[]).length,r=(e.match(/[A-Za-z]+/g)??[]).length;let i=45+Math.ceil(n/5)+Math.ceil(r/3)+Math.max(0,t)*8;return e.includes("```")&&(i+=25),/\$\$?[^$\n]+\$\$?/.test(e)&&(i+=25),Math.max(60,Math.min(300,Math.round(i)))}function d_(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function h_(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function kp(e,t){const n=Array.from({length:e},(r,i)=>i);for(let r=e-1;r>0;r--){const i=Math.floor(t()*(r+1)),a=n[r];n[r]=n[i],n[i]=a}return n}function f_(e,t){const n=h_(d_(t)),r=kp(e.length,n),i={};for(const a of e)i[a.id]=kp(Math.max(1,a.optionCount),n);return{questionOrder:r,optionPerms:i}}function m_(e,t){const n=e[t];return String(n??t)}function p_({stars:e}){return f.jsx("div",{className:"flex gap-1","aria-label":`${e} stars`,children:[1,2,3].map(t=>f.jsx(i5,{className:`w-7 h-7 ${t<=e?"text-gold fill-gold":"text-ink/20"}`},t))})}function g_({examNode:e,locale:t,onExamCompleted:n,onSessionChange:r,paused:i}){const a=$e(),[s,o]=w.useState("loading"),[l,u]=w.useState(null),[c,h]=w.useState([]),[m,d]=w.useState(null),[p,g]=w.useState(0),[x,b]=w.useState(null),[v,E]=w.useState(null),[N,k]=w.useState(""),[S,_]=w.useState(0),[C,I]=w.useState(null),A=w.useRef({}),R=w.useRef(null),L=w.useRef(null),z=w.useRef(null),j=m?c[m.questionOrder[p]]??null:null,B=j&&m?m.optionPerms[j.id]??[]:[],H=(j==null?void 0:j.options)??[],Y=B.length===H.length?B:H.map((P,te)=>te);w.useEffect(()=>(Mh(!0),()=>Mh(!1)),[]),w.useEffect(()=>{let P=!1;return o("loading"),k(""),E(null),u(null),(async()=>{try{const te=await ie.examGetStatus(e.id);if(P)return;u(te),h(te.exercises),te.status==="generating"?o("generating"):te.status==="failed"?(k(te.error??a("exam.errorEmpty")),o("failed")):te.status==="ready"?te.latestAttempt&&te.latestAttempt.finishedAt?(E({correctCount:te.latestAttempt.correctCount,totalCount:te.latestAttempt.totalCount,stars:te.latestAttempt.stars,bestStars:te.bestStars,terminated:te.latestAttempt.terminated,perQuestion:te.latestAttempt.perQuestion??[]}),o("result")):o("ready"):(o("generating"),ie.examPrepare(e.id,t??null).catch(()=>{}))}catch(te){P||(k(te instanceof Error?te.message:String(te)),o("failed"))}})(),()=>{P=!0}},[e.id]),w.useEffect(()=>ie.on("exam:status",te=>{te.nodeId===e.id&&(te.status==="ready"?ie.examGetStatus(e.id).then(Q=>{u(Q),h(Q.exercises),o(K=>K==="generating"?Q.latestAttempt?"result":"ready":K)}).catch(()=>{}):te.status==="failed"?(k(te.error??a("exam.errorEmpty")),o("failed")):(u(Q=>Q&&{...Q,...te}),o(Q=>Q==="loading"?"generating":Q)))}),[e.id]);const V=w.useCallback(async()=>{var P,te,Q;try{const K=await ie.examStartAttempt(e.id),ce=f_(K.exercises.map(le=>{var ee;return{id:le.id,optionCount:((ee=le.options)==null?void 0:ee.length)??0}}),K.attemptId);h(K.exercises),R.current=K.attemptId,d(ce),A.current={},g(0),b(null),E(null),L.current=null,o("answering"),_(Ku(((P=K.exercises[ce.questionOrder[0]])==null?void 0:P.prompt)??"",((Q=(te=K.exercises[ce.questionOrder[0]])==null?void 0:te.options)==null?void 0:Q.length)??4))}catch(K){k(K instanceof Error?K.message:String(K)),o("failed")}},[e.id]),Z=w.useCallback(()=>{I(null),E(null),o("generating"),u(P=>P&&{...P,status:"generating",done:0,total:0}),ie.examRegenerate(e.id,t??null).then(P=>{P.status==="failed"&&(k(P.error??a("exam.errorEmpty")),o("failed"))}).catch(P=>{k(P instanceof Error?P.message:String(P)),o("failed")})},[e.id,t,a]),O=f.jsxs(f.Fragment,{children:[f.jsxs("button",{className:"btn-3d-neutral px-4 py-1.5 text-body","data-testid":"exam-regen-btn",onClick:P=>I(P.currentTarget.getBoundingClientRect()),children:[f.jsx(za,{className:"w-3.5 h-3.5 inline"}),a("exam.regenerate")]}),C&&f.jsx(rl,{anchorRect:C,message:a("exam.regenerate.confirmMsg"),confirmLabel:a("exam.regenerate"),onConfirm:Z,onCancel:()=>I(null)})]});w.useEffect(()=>{var P,te;s!=="answering"||!j||L.current!==j.id&&(_(Ku(j.prompt,((P=j.options)==null?void 0:P.length)??4)),b(null),(te=z.current)==null||te.scrollTo({top:0}))},[p,s]),w.useEffect(()=>{if(s!=="answering"||i)return;const P=setInterval(()=>{_(te=>te>0?te-1:0)},1e3);return()=>clearInterval(P)},[s,i]);const X=w.useCallback(P=>{const te=j;if(!te||s!=="answering"||L.current===te.id)return;L.current=te.id;const Q=P===null?"":m_(Y,P),K={...A.current,[te.id]:Q};A.current=K,R.current&&ie.examRecordAnswer(e.id,R.current,te.id,Q).catch(()=>{}),p+1<c.length?g(p+1):(o("submitting"),(async()=>{try{const ce=await ie.examSubmitAttempt(e.id,R.current,K);E({correctCount:ce.correctCount,totalCount:ce.totalCount,stars:ce.stars,bestStars:ce.bestStars,terminated:ce.terminated,perQuestion:ce.perQuestion}),o("result"),n==null||n(),ce.stars>=1&&fi("exam-pass")}catch(ce){k(ce instanceof Error?ce.message:String(ce)),o("failed")}})())},[j,s,Y,p,c.length,e.id,n]),ne=w.useCallback(()=>{x!==null&&X(x)},[x,X]);if(w.useEffect(()=>{s!=="answering"||S>0||i||X(x)},[S,s,i]),w.useEffect(()=>{const P=async()=>{if(R.current)try{await ie.examSubmitAttempt(e.id,R.current,A.current,{terminated:!0}),n==null||n()}catch{}},te=s==="answering"||s==="submitting";return r==null||r(te?{active:!0,terminate:P}:{active:!1,terminate:null}),()=>r==null?void 0:r({active:!1,terminate:null})},[s,e.id,n,r]),s==="loading")return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-loading",children:[f.jsx($i,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]});if(s==="generating"){const P=(l==null?void 0:l.done)??0,te=(l==null?void 0:l.total)??0,Q=te>0?Math.round(P/te*100):0;return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-generating",children:[f.jsx($i,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),f.jsx("div",{className:"text-title font-bold text-ink mb-2",children:a("exam.generating.title")}),f.jsx("div",{className:"text-body text-ink-muted mb-4",children:a("exam.generating.stage")}),f.jsx("div",{className:"w-56 h-2.5 rounded-full bg-ink/10 overflow-hidden mb-2",role:"progressbar","aria-valuenow":Q,"aria-valuemin":0,"aria-valuemax":100,children:f.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.max(4,Q)}%`}})}),f.jsx("div",{className:"text-label text-ink-muted tabular-nums mb-6",children:te>0?a("exam.generating.kcProgress",{done:P,total:te}):a("exam.generating.preparing")}),f.jsx("div",{className:"text-caption text-ink-muted max-w-xs text-center",children:a("exam.generating.canLeave")})]})}if(s==="failed")return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 text-center","data-testid":"exam-error",children:[f.jsx(xc,{className:"w-10 h-10 text-warning mb-3"}),f.jsx("div",{className:"text-body font-bold text-ink mb-1",children:a("exam.errorTitle")}),f.jsx("div",{className:"text-body text-ink-muted mb-4 max-w-xs break-words",children:N||a("exam.errorEmpty")}),f.jsxs("button",{className:"btn-3d-brand px-4 py-1.5 text-body",onClick:()=>{o("generating"),ie.examPrepare(e.id,t??null).catch(()=>{})},children:[f.jsx(za,{className:"w-3.5 h-3.5 inline"}),a("exam.failed.retry")]})]});if(s==="ready"&&l){const P=l.exercises.reduce((Q,K)=>{var ce;return Q+Ku(K.prompt,((ce=K.options)==null?void 0:ce.length)??4)},0),te=Math.max(1,Math.round(P/60));return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-ready",children:[f.jsx("div",{className:"w-14 h-14 rounded-full bg-brand/15 flex items-center justify-center mb-4",children:f.jsx($i,{className:"w-7 h-7 text-brand"})}),f.jsx("div",{className:"text-hero font-extrabold text-ink mb-1",children:a("exam.ready.title")}),f.jsx("div",{className:"text-body text-ink-muted mb-3 text-center",children:e.title}),f.jsx("div",{className:"text-label text-ink-muted mb-8",children:a("exam.ready.meta",{q:l.questionCount,kc:l.kcCount,min:te})}),f.jsxs("div",{className:"flex flex-col items-center gap-3",children:[f.jsxs("button",{className:"btn-3d-brand px-6 py-2 text-lead",onClick:V,"data-testid":"exam-start-btn",children:[a("exam.start"),f.jsx(gc,{className:"w-4 h-4 inline ml-1"})]}),O]})]})}if(s==="answering"||s==="submitting"){if(!j)return null;const P=S<=10;return f.jsxs("div",{className:"flex-1 flex flex-col min-h-0","data-testid":"exam-answering",children:[f.jsxs("div",{className:"px-6 pt-6 w-full max-w-2xl mx-auto shrink-0",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("div",{className:"text-label text-ink-muted tabular-nums",children:a("exam.q.progress",{i:p+1,n:c.length})}),f.jsxs("div",{className:`flex items-center gap-1 text-label font-bold tabular-nums transition-colors ${P?"text-warning":"text-ink"}`,"data-testid":"exam-timer",children:[f.jsx(a5,{className:"w-3.5 h-3.5"}),Math.floor(S/60),":",String(S%60).padStart(2,"0")]})]}),f.jsx("div",{className:"w-full h-1.5 rounded-full bg-ink/10 overflow-hidden mb-6",children:f.jsx("div",{className:"h-full bg-accent transition-all duration-300",style:{width:`${p/c.length*100}%`}})})]}),f.jsxs("div",{ref:z,className:"flex-1 min-h-0 overflow-y-auto px-6 pb-6 w-full max-w-2xl mx-auto",children:[j.kcTitle&&f.jsxs("div",{className:"inline-flex items-center gap-1 text-caption text-accent bg-accent/10 rounded-full px-2.5 py-1 mb-3 self-start",children:[f.jsx(Mo,{className:"w-3 h-3"}),j.kcTitle]}),f.jsx("div",{className:"text-lead text-ink leading-relaxed mb-6 whitespace-pre-wrap break-words",children:j.prompt}),f.jsx("div",{className:"flex flex-col gap-2.5",children:Y.map((te,Q)=>f.jsx("button",{onClick:()=>b(Q),"data-testid":`exam-option-${Q}`,className:`text-left px-4 py-3 rounded-xl border transition-all duration-150 ${x===Q?"border-accent bg-accent/15 text-ink":"border-ink/10 bg-ink/5 text-ink hover:border-ink/25"}`,children:f.jsx("span",{className:"text-body break-words",children:H[te]})},te))}),f.jsx("div",{className:"mt-6 flex justify-end",children:s==="submitting"?f.jsx("div",{className:"text-body text-ink-muted",children:a("exam.submitting")}):f.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body disabled:opacity-40 disabled:cursor-not-allowed",disabled:x===null,onClick:ne,"data-testid":"exam-next-btn",children:[p+1<c.length?a("exam.q.next"):a("exam.q.submit"),f.jsx(gc,{className:"w-3.5 h-3.5 inline ml-1"})]})})]})]})}if(s==="result"&&v){const P=v.totalCount>0?Math.round(v.correctCount/v.totalCount*100):0,te=new Map;for(const K of v.perQuestion){const ce=K.kcTitle??"";if(!ce)continue;const le=te.get(ce)??{correct:0,total:0};le.total++,K.correct&&le.correct++,te.set(ce,le)}const Q=new Map(c.map(K=>[K.id,K]));return f.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-2xl w-full mx-auto","data-testid":"exam-result",children:[f.jsxs("div",{className:"flex flex-col items-center mb-6",children:[f.jsx(p_,{stars:v.stars}),f.jsx("div",{className:"text-hero font-extrabold text-ink mt-3",children:a("exam.result.score",{correct:v.correctCount,total:v.totalCount})}),f.jsx("div",{className:"text-body text-ink-muted mt-1",children:a("exam.result.accuracy",{pct:P})}),f.jsxs("div",{className:"flex items-center gap-3 text-label text-ink-muted mt-2",children:[f.jsx("span",{children:a("exam.result.best",{stars:v.bestStars})}),l&&l.attemptCount>1&&f.jsx("span",{children:a("exam.result.attempts",{n:l.attemptCount})})]})]}),v.terminated&&f.jsxs("div",{className:"rounded-xl border border-warning/40 bg-warning/10 px-4 py-3 mb-6 flex items-center gap-2",children:[f.jsx(xc,{className:"w-4 h-4 text-warning shrink-0"}),f.jsx("span",{className:"text-body text-ink",children:a("exam.terminated.banner")})]}),te.size>0&&f.jsxs("div",{className:"mb-8",children:[f.jsx("div",{className:"text-title font-bold text-ink mb-3",children:a("exam.result.kcBreakdown")}),f.jsx("div",{className:"flex flex-col gap-2",children:[...te.entries()].map(([K,ce])=>{const ee=(ce.total>0?ce.correct/ce.total:0)<.6;return f.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 rounded-xl bg-ink/5","data-testid":"exam-kc-row",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Mo,{className:"w-3.5 h-3.5 text-accent shrink-0"}),f.jsx("span",{className:"text-body text-ink truncate",children:K})]}),f.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[ee&&f.jsx("span",{className:"text-caption text-warning",children:a("exam.result.weakKc")}),f.jsxs("span",{className:"text-label text-ink-muted tabular-nums",children:[ce.correct,"/",ce.total]})]})]},K)})})]}),f.jsxs("div",{className:"mb-8",children:[f.jsx("div",{className:"text-title font-bold text-ink mb-3",children:a("exam.result.review")}),f.jsx("div",{className:"flex flex-col gap-2",children:v.perQuestion.map((K,ce)=>{const le=Q.get(K.exerciseId),ee=K.options??(le==null?void 0:le.options)??null,Ce=K.prompt??(le==null?void 0:le.prompt)??`#${ce+1}`,de=he=>ee&&he!==""&&ee[Number(he)]!==void 0?ee[Number(he)]:he;return f.jsx("div",{className:"px-4 py-3 rounded-xl bg-ink/5","data-testid":"exam-review-row",children:f.jsxs("div",{className:"flex items-start gap-2",children:[K.correct?f.jsx(Tn,{className:"w-4 h-4 text-brand shrink-0 mt-0.5"}):f.jsx(Fn,{className:`w-4 h-4 shrink-0 mt-0.5 ${K.answered?"text-warning":"text-ink-muted"}`}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-body text-ink mb-1",children:Ce}),f.jsx("div",{className:"text-caption text-ink-muted",children:K.answered?K.correct?f.jsx("span",{className:"text-brand",children:a("exam.result.correctLabel")}):f.jsxs(f.Fragment,{children:[a("exam.result.yourAnswer"),":",de(K.userAnswer),f.jsx("span",{className:"mx-1",children:"·"}),a("exam.result.correctAnswer"),":",de(K.correctAnswer)]}):a("exam.result.unanswered")}),K.explanation&&f.jsx("div",{className:"text-caption text-ink-muted mt-1 leading-relaxed",children:K.explanation})]})]})},K.exerciseId)})})]}),f.jsxs("div",{className:"flex justify-center items-center gap-3 pb-4",children:[f.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body",onClick:V,"data-testid":"exam-retry-btn",children:[f.jsx(za,{className:"w-3.5 h-3.5 inline"}),a("exam.retryExam")]}),O]})]})}return null}const x_=[{id:"explain_simple",icon:Mo,labelKey:"command.explain_simple",group:"command.group.node",requiresNode:!0},{id:"quiz_3",icon:ps,labelKey:"command.quiz_3",group:"command.group.node",requiresNode:!0},{id:"concept_map",icon:$0,labelKey:"command.concept_map",group:"command.group.node",requiresNode:!0},{id:"compare_prev",icon:Sy,labelKey:"command.compare_prev",group:"command.group.node",requiresNode:!0},{id:"socratic",icon:Z1,labelKey:"command.socratic",group:"command.group.mode"},{id:"exam_mode",icon:$i,labelKey:"command.exam_mode",group:"command.group.mode"}],b_=["command.group.node","command.group.mode","command.group.nav"];function y_({onClose:e,onPick:t,hasNode:n}){const r=$e(),[i,a]=w.useState(""),[s,o]=w.useState(0),l=w.useRef(null),u=w.useRef(null);w.useEffect(()=>{var d;(d=l.current)==null||d.focus()},[]),ra(u,!0);const h=x_.filter(d=>r(d.labelKey).toLowerCase().includes(i.toLowerCase())).filter(d=>!d.requiresNode||n),m=d=>{d.key==="ArrowDown"?(d.preventDefault(),o(p=>Math.min(p+1,h.length-1))):d.key==="ArrowUp"?(d.preventDefault(),o(p=>Math.max(p-1,0))):d.key==="Enter"&&h[s]&&(d.preventDefault(),t(h[s].id))};return f.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh] px-4","data-testid":"command-palette",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),f.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":r("command.footer.hint"),className:"relative w-full max-w-lg bg-surface-0 rounded-xl shadow-elevated overflow-hidden",children:[f.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border-faint)]",children:[f.jsx(W0,{className:"w-4 h-4 text-ink-faint"}),f.jsx("input",{ref:l,value:i,onChange:d=>{a(d.target.value),o(0)},onKeyDown:m,placeholder:r("command.placeholder"),className:"flex-1 bg-transparent text-body text-ink-strong placeholder:text-ink-faint focus:outline-none","data-testid":"command-input"}),f.jsx("kbd",{className:"text-caption text-ink-faint px-1.5 py-0.5 rounded border border-[var(--border-faint)]",children:"ESC"})]}),f.jsx("div",{className:"max-h-80 overflow-y-auto py-2","data-testid":"command-list",children:h.length===0?f.jsx("div",{className:"px-4 py-6 text-center text-body text-ink-faint",children:r(n?"command.empty.node":"command.empty.nonode")}):b_.map(d=>{const p=h.filter(g=>g.group===d);return p.length===0?null:f.jsxs("div",{children:[f.jsx("div",{className:"px-4 pt-2 pb-1 text-caption font-bold text-ink-faint uppercase tracking-wider",children:r(d)}),p.map(g=>{const x=h.indexOf(g),b=g.icon;return f.jsxs("button",{onClick:()=>t(g.id),onMouseEnter:()=>o(x),"data-testid":`command-${g.id}`,className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${x===s?"bg-brand/10 text-brand":"text-ink-muted hover:bg-surface-1 hover:bg-surface-3/50"}`,children:[f.jsx(b,{className:"w-4 h-4 shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"text-body font-medium flex-1",children:r(g.labelKey)})]},g.id)})]},d)})}),f.jsxs("div",{className:"px-4 py-2 border-t border-[var(--border-faint)] flex items-center justify-between text-caption text-ink-faint",children:[f.jsx("span",{children:r("command.footer.hint")}),f.jsx("span",{children:r("command.footer.keys")})]})]})]})}const _a="bg-ink/[0.04] text-ink-strong text-label rounded-lg border border-transparent focus:border-accent focus:bg-ink/[0.06] transition-colors placeholder:text-ink-faint";function qo({kind:e,showProtocol:t=!0,testPrefix:n="custom",titleKey:r="settings.custom.form_title",modelPhKey:i="settings.custom.model_ph",testOverride:a,onSaved:s,onCancel:o}){const l=$e(),[u,c]=w.useState(""),[h,m]=w.useState("openai-compatible"),[d,p]=w.useState(""),[g,x]=w.useState(""),[b,v]=w.useState(""),[E,N]=w.useState(!1),[k,S]=w.useState(!1),[_,C]=w.useState(null),I=async()=>{if(!(!d.trim()||!b.trim()||k)){S(!0),C(null);try{const R=a?await a({baseUrl:d.trim(),apiKey:g.trim(),model:b.trim()}):await ie.testCustomProvider({label:u||l("settings.custom.test_label"),protocol:h,baseUrl:d.trim(),apiKey:g.trim()||void 0,defaultModel:b.trim()});C({ok:R.ok,detail:R.detail})}catch(R){C({ok:!1,detail:R instanceof Error?R.message:String(R)})}finally{S(!1)}}},A=async()=>{if(!(!u.trim()||!d.trim()||!b.trim()))try{const R=await ie.createCustomProvider({label:u.trim(),kind:e,protocol:t?h:"openai-compatible",baseUrl:d.trim(),apiKey:g.trim()||void 0,defaultModel:b.trim(),vision:e==="llm"?E:void 0});s(R)}catch{}};return f.jsxs("div",{className:"space-y-2.5","data-testid":`${n}-provider-form`,children:[f.jsx("div",{className:"text-label font-bold text-ink-strong",children:l(r)}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"text",value:u,onChange:R=>c(R.target.value),placeholder:l("settings.custom.label_ph"),"data-testid":`${n}-label`,className:`${_a} flex-1 px-2.5 py-1.5`}),t&&f.jsxs("select",{value:h,onChange:R=>m(R.target.value),"data-testid":`${n}-protocol`,className:`${_a} px-2 py-1.5`,children:[f.jsx("option",{value:"openai-compatible",children:l("settings.proto.openai")}),f.jsx("option",{value:"anthropic",children:"Anthropic"}),f.jsx("option",{value:"google",children:"Google"})]})]}),f.jsx("input",{type:"text",value:d,onChange:R=>p(R.target.value),placeholder:l("settings.custom.baseurl_ph"),"data-testid":`${n}-baseurl`,className:`${_a} w-full px-2.5 py-1.5 font-mono`}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"text",value:b,onChange:R=>v(R.target.value),placeholder:l(i),"data-testid":`${n}-model`,className:`${_a} flex-1 px-2.5 py-1.5 font-mono`}),f.jsx("input",{type:"password",value:g,onChange:R=>x(R.target.value),placeholder:l("settings.custom.apikey_ph"),"data-testid":`${n}-apikey`,className:`${_a} flex-1 px-2.5 py-1.5`})]}),e==="llm"&&f.jsxs("label",{className:"inline-flex items-center gap-2 text-label cursor-pointer select-none","data-testid":`${n}-vision`,children:[f.jsx("input",{type:"checkbox",checked:E,onChange:R=>N(R.target.checked),className:"w-4 h-4 rounded accent-brand"}),f.jsx("span",{className:"text-ink-strong",children:l("settings.custom.vision")}),f.jsx("span",{className:"text-ink-faint",children:l("settings.custom.visionHint")})]}),_&&f.jsxs("div",{className:`text-label rounded p-2 inline-flex items-start gap-1.5 ${_.ok?"bg-brand/10 text-brand":"bg-warning/10 text-warning"}`,children:[_.ok?f.jsx(Wn,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}):f.jsx(ki,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:_.detail})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{onClick:()=>void I(),disabled:!d.trim()||!b.trim()||k,"data-testid":`${n}-test`,className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:l(k?"settings.testing":"settings.test")}),f.jsx("button",{onClick:()=>void A(),disabled:!u.trim()||!d.trim()||!b.trim(),"data-testid":`${n}-save`,className:"btn-3d-brand px-3 py-1.5 text-label disabled:opacity-40",children:l("settings.custom.save")}),o&&f.jsx("button",{onClick:o,className:"text-label text-ink-muted hover:text-ink-strong px-3 py-1.5 transition-colors",children:l("action.cancel")})]})]})}const Zb="lookatstudy-theme",Ep="auto",Jb="(prefers-color-scheme: dark)";function Xu(){return typeof window>"u"||window.matchMedia(Jb).matches?"dark":"light"}function v_(){if(typeof localStorage>"u")return Ep;const e=localStorage.getItem(Zb);return e==="auto"||e==="light"||e==="dark"?e:Ep}function Qu(e){const t=document.documentElement;t.classList.remove("dark","light"),t.classList.add(e),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{resolved:e}}))}function w_(){const[e,t]=w.useState(()=>v_()),[n,r]=w.useState(()=>e==="auto"?Xu():e),i=w.useCallback(a=>{t(a),localStorage.setItem(Zb,a);const s=a==="auto"?Xu():a;r(s),Qu(s)},[]);return w.useEffect(()=>{if(e!=="auto")return;const a=window.matchMedia(Jb),s=o=>{const l=o.matches?"dark":"light";r(l),Qu(l)};return a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[e]),w.useEffect(()=>{const a=e==="auto"?Xu():e;r(a),Qu(a)},[e]),{mode:e,resolved:n,setMode:i}}function no(){window.dispatchEvent(new Event(u0))}const rr="bg-surface-1 text-ink text-body rounded-lg border border-[var(--border)] focus:border-brand focus:outline-none transition-colors placeholder:text-ink-faint",qn="bg-surface-3 text-ink-muted hover:bg-surface-3 hover:bg-surface-3 hover:text-ink-strong",$n="bg-brand text-white shadow-sm";function Et(e){return e?"px-4 py-3.5 border-t border-[var(--border-faint)]":"px-4 py-3.5"}function k_(){const e=$e(),[t,n]=w.useState([]),[r,i]=w.useState([]),[a,s]=w.useState("glm"),[o,l]=w.useState(""),[u,c]=w.useState(""),[h,m]=w.useState(null),[d,p]=w.useState(!1),[g,x]=w.useState(null),[b,v]=w.useState(!1),[E,N]=w.useState(!1),[k,S]=w.useState([]),[_,C]=w.useState(!1),[I,A]=w.useState(null),[R,L]=w.useState(null),[z,j]=w.useState(""),[B,H]=w.useState(!1),Y=w_(),V=async ee=>{if(K)try{await ie.updateCustomProvider(K.id,{vision:ee}),await O()}catch{}},Z=async()=>{C(!0),A(null);try{const ee=await ie.discoverModels();ee.ok&&ee.models?S(ee.models):A(ee.error||e("settings.discover_failed"))}catch(ee){A(ee instanceof Error?ee.message:String(ee))}finally{C(!1)}},O=w.useCallback(async()=>{try{const[ee,Ce,de,he]=await Promise.all([ie.getProviderPresets(),ie.listCustomProviders(),ie.getSetting("active_provider"),ie.getSetting("active_model")]);n(ee),i(Ce);const pe=de??"glm";if(s(pe),pe.startsWith("custom-")){const Ne=Ce.find(Oe=>Oe.id===pe);m(Ne!=null&&Ne.hasApiKey?e("settings.key.configured"):null)}else{const Ne=ee.find(Oe=>Oe.id===pe);if(Ne){const Oe=await ie.getSetting(Ne.apiKeySetting);m(Oe?`${Oe.slice(0,4)}…${Oe.slice(-4)}`:null)}}if(pe.startsWith("custom-")){const Ne=Ce.find(Oe=>Oe.id===pe);l(he??(Ne==null?void 0:Ne.defaultModel)??"")}else{const Ne=ee.find(Oe=>Oe.id===pe);l(he??(Ne==null?void 0:Ne.defaultModel)??"")}}catch(ee){console.error("[SettingsView] load() failed:",ee)}},[e]);w.useEffect(()=>{O()},[O]);const X=async ee=>{s(ee),x(null),c("");const Ce=t.find(de=>de.id===ee);if(Ce){const de=await ie.getSetting(Ce.apiKeySetting);m(de?`${de.slice(0,4)}…${de.slice(-4)}`:null),l(o||Ce.defaultModel)}},ne=async()=>{v(!1);try{if(await ie.setSetting("active_provider",a),await ie.setSetting("active_model",o),u.trim()){const ee=t.find(Ce=>Ce.id===a);ee&&(await ie.setSetting(ee.apiKeySetting,u.trim()),m(`${u.trim().slice(0,4)}…${u.trim().slice(-4)}`),c(""))}v(!0),setTimeout(()=>v(!1),2e3),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},P=async()=>{p(!0),x(null);try{const ee=await ie.testLlmConnection();x(ee)}catch(ee){x({ok:!1,detail:ee instanceof Error?ee.message:String(ee),errorKind:"unknown"})}finally{p(!1)}},te=async ee=>{await ie.setSetting("active_provider",ee.id),await ie.setSetting("active_model",ee.defaultModel),s(ee.id),l(ee.defaultModel),N(!1),await O(),window.dispatchEvent(new Event("llm-config-changed"))},Q=async ee=>{try{await ie.deleteCustomProvider(ee),a===ee&&(await ie.setSetting("active_provider","glm"),s("glm")),await O()}catch{}},K=a.startsWith("custom-")?r.find(ee=>ee.id===a):null;w.useEffect(()=>{if(!K)return;const ee=K.models.find(Ce=>Ce.id===o);j(ee!=null&&ee.contextWindow?String(ee.contextWindow):"")},[K,o]);const ce=async()=>{var pe,Ne;if(!K)return;const ee=z.trim().replace(/[,\s_]/g,""),Ce=/^(\d+)([km]?)$/i.exec(ee);if(ee!==""&&!Ce)return;const de=((pe=Ce==null?void 0:Ce[2])==null?void 0:pe.toLowerCase())==="k"?1e3:((Ne=Ce==null?void 0:Ce[2])==null?void 0:Ne.toLowerCase())==="m"?1e6:1,he=ee===""||!Ce?null:Math.max(1,Math.round(parseInt(Ce[1],10)*de));H(!0);try{const Oe=K.models.map(ot=>ot.id===o?{...ot,contextWindow:he}:ot);await ie.updateCustomProvider(K.id,{models:Oe}),await O(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}finally{H(!1)}},le=a.startsWith("custom-")?null:t.find(ee=>ee.id===a);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"px-5 pt-5 space-y-6",children:[f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.ai")}),f.jsxs("div",{className:"surface-card overflow-hidden",children:[f.jsxs("div",{className:Et(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.provider")}),f.jsxs("div",{className:"flex flex-wrap gap-1.5","data-testid":"provider-grid",children:[t.map(ee=>f.jsx("button",{onClick:()=>X(ee.id),"data-testid":`provider-card-${ee.id}`,"aria-pressed":a===ee.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors ${a===ee.id?$n:qn}`,children:ee.label},ee.id)),r.filter(ee=>ee.kind==="llm").map(ee=>f.jsxs("button",{onClick:()=>X(ee.id),"data-testid":`provider-card-${ee.id}`,"aria-pressed":a===ee.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors inline-flex items-center gap-1 ${a===ee.id?$n:qn}`,children:[f.jsx(xs,{className:"w-3.5 h-3.5","aria-hidden":"true"}),ee.label]},ee.id)),f.jsxs("button",{onClick:()=>N(ee=>!ee),"data-testid":"add-custom-provider",className:"px-3 py-1.5 rounded-lg text-label whitespace-nowrap inline-flex items-center gap-1 border border-dashed border-[var(--border)] text-ink-muted hover:border-ink-muted hover:text-ink-strong transition-colors",children:[f.jsx(nl,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.add_custom")]})]})]}),E&&f.jsx("div",{className:"px-4 py-3.5 bg-surface-1 border-t border-[var(--border-faint)]",children:f.jsx(qo,{kind:"llm",testPrefix:"custom",onSaved:ee=>void te(ee),onCancel:()=>N(!1)})}),r.length>0&&a.startsWith("custom-")&&f.jsx("div",{className:Et(!0),children:f.jsx("button",{onClick:ee=>{const Ce=ee.currentTarget.getBoundingClientRect(),de=r.find(he=>he.id===a);de&&L({id:de.id,label:de.label,rect:Ce})},className:"text-label text-warning hover:underline",children:e("settings.delete_custom")})}),le&&f.jsxs(f.Fragment,{children:[le.baseUrl&&f.jsxs("div",{className:Et(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),f.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:le.baseUrl})]}),f.jsxs("div",{className:Et(!0),children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),f.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[f.jsxs("select",{value:o,onChange:ee=>l(ee.target.value),"data-testid":"model-select",className:`${rr} flex-1 px-2.5 py-1.5`,children:[le.models.map(ee=>f.jsx("option",{value:ee.id,children:ee.id},ee.id)),a==="openrouter"&&k.map(ee=>f.jsx("option",{value:ee.id,children:ee.id},ee.id))]}),a==="openrouter"&&f.jsxs("button",{onClick:Z,disabled:_,"data-testid":"discover-models-btn",className:"text-label text-accent hover:underline disabled:opacity-40 whitespace-nowrap inline-flex items-center gap-1",children:[f.jsx(Qy,{className:`w-3.5 h-3.5 ${_?"animate-spin":""}`,"aria-hidden":"true"}),e(_?"settings.discovering":"settings.refresh")]})]})]}),I&&f.jsx("div",{className:"text-label text-warning mt-1.5 ml-[68px]",children:I})]}),f.jsx("div",{className:Et(!0),children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.apikey")}),f.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[h&&f.jsxs("span",{className:"text-label text-brand shrink-0 inline-flex items-center gap-1",children:[f.jsx(Wn,{className:"w-3.5 h-3.5","aria-hidden":"true"}),h]}),f.jsx("input",{type:"password",value:u,onChange:ee=>c(ee.target.value),placeholder:e(h?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"settings-key-input",className:`${rr} flex-1 px-2.5 py-1.5`}),f.jsx("a",{href:le.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-label text-brand hover:underline whitespace-nowrap",children:e("settings.key.get")})]})]})}),f.jsx("div",{className:Et(!0),children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:P,disabled:d,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(d?"settings.testing":"settings.test")}),g&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${g.ok?"text-brand":"text-warning"}`,children:[g.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(ki,{className:"w-4 h-4","aria-hidden":"true"}),g.detail]})]})})]}),K&&!le&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Et(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),f.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:K.baseUrl})]}),f.jsx("div",{className:Et(!0),children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),K.models.length>1?f.jsx("select",{value:o,onChange:ee=>l(ee.target.value),"data-testid":"model-select-custom",className:`${rr} flex-1 px-2.5 py-1.5`,children:K.models.map(ee=>f.jsx("option",{value:ee.id,children:ee.id},ee.id))}):f.jsx("input",{type:"text",value:o,onChange:ee=>l(ee.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"model-input-custom",className:`${rr} flex-1 px-2.5 py-1.5 font-mono`})]})}),f.jsxs("div",{className:Et(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.custom.windowLabel")}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"text",inputMode:"numeric",value:z,onChange:ee=>j(ee.target.value),placeholder:e("settings.custom.windowPh"),"data-testid":"context-window-input",className:`${rr} flex-1 px-2.5 py-1.5 font-mono tabular-nums`}),f.jsx("button",{onClick:ce,disabled:B,"data-testid":"context-window-save",className:"btn-3d-neutral px-3 py-1.5 text-label shrink-0 disabled:opacity-40",children:e("settings.custom.save")})]}),f.jsx("div",{className:"text-caption text-ink-faint mt-1",children:e("settings.custom.windowHint")})]}),f.jsx("div",{className:Et(!0),children:f.jsxs("label",{className:"inline-flex items-center gap-2 text-label cursor-pointer select-none","data-testid":"custom-vision-toggle",children:[f.jsx("input",{type:"checkbox",checked:K.vision,onChange:ee=>void V(ee.target.checked),className:"w-4 h-4 rounded accent-brand"}),f.jsx("span",{className:"text-ink-strong",children:e("settings.custom.vision")}),f.jsx("span",{className:"text-ink-faint",children:e("settings.custom.visionHint")})]})}),f.jsx("div",{className:Et(!0),children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:P,disabled:d,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(d?"settings.testing":"settings.test")}),g&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${g.ok?"text-brand":"text-warning"}`,children:[g.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(ki,{className:"w-4 h-4","aria-hidden":"true"}),g.detail]})]})})]})]})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.vision")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(T_,{activeProvider:a,activeModel:o,presets:t,customProviders:r})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.speech")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(M_,{})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.memory")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(S_,{})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.companion")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(A_,{})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.appearance")}),f.jsxs("div",{className:"surface-card overflow-hidden",children:[f.jsxs("div",{className:Et(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.theme")}),f.jsx("div",{className:"flex gap-2",children:[{mode:"auto",label:e("settings.theme.auto")},{mode:"light",label:e("settings.theme.light")},{mode:"dark",label:e("settings.theme.dark")}].map(({mode:ee,label:Ce})=>f.jsx("button",{onClick:()=>Y.setMode(ee),"data-testid":`theme-${ee}`,"aria-pressed":Y.mode===ee,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Y.mode===ee?$n:qn}`,children:Ce},ee))}),f.jsx("p",{className:"text-label text-ink-muted mt-2",children:Y.mode==="auto"?e("settings.theme.following",{mode:e(`settings.theme.${Y.resolved}`)}):null})]}),f.jsxs("div",{className:Et(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.interface_lang")}),f.jsx("div",{className:"flex gap-2",children:["zh-CN","en"].map(ee=>f.jsx("button",{onClick:()=>f5(ee),"data-testid":`lang-${ee}`,"aria-pressed":Yi()===ee,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Yi()===ee?$n:qn}`,children:ee==="zh-CN"?"中文":"English"},ee))})]}),f.jsxs("div",{className:Et(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.import_lang")}),f.jsx(E_,{})]})]})]})]}),f.jsxs("div",{className:"sticky bottom-0 px-5 py-3 bg-surface-0 border-t border-[var(--border)] flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-label text-ink-muted",children:e("settings.footer.hint")}),f.jsxs("button",{onClick:ne,"data-testid":"settings-save",className:"btn-3d-brand px-5 py-2 text-body inline-flex items-center gap-1.5",children:[b&&f.jsx(Tn,{className:"w-4 h-4","aria-hidden":"true"}),e(b?"settings.saved_text":"settings.footer.save")]})]}),R&&f.jsx(rl,{anchorRect:R.rect,message:e("settings.delete_custom_confirm",{name:R.label}),danger:!0,confirmLabel:e("action.delete"),testid:"custom-provider-delete-confirm",onConfirm:()=>{Q(R.id),L(null)},onCancel:()=>L(null)})]})}function E_(){const[e,t]=w.useState("en"),[n,r]=w.useState(!1);w.useEffect(()=>{ie.getSetting("pref_lang").then(s=>{s&&t(s),r(!0)})},[]);const i=async s=>{t(s),await ie.setSetting("pref_lang",s)},a=[{code:"en",label:"English"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"}];return n?f.jsx("div",{className:"flex gap-2","data-testid":"pref-lang-options",children:a.map(s=>f.jsx("button",{onClick:()=>i(s.code),"data-testid":`pref-lang-${s.code}`,"aria-pressed":e===s.code,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${e===s.code?$n:qn}`,children:s.label},s.code))}):null}function T_({activeProvider:e,activeModel:t,presets:n,customProviders:r}){const i=$e(),[a,s]=w.useState(!1),[o,l]=w.useState(!1),[u,c]=w.useState(""),[h,m]=w.useState(!1),[d,p]=w.useState(!1),[g,x]=w.useState(null),[b,v]=w.useState(!1);w.useEffect(()=>{Promise.all([ie.getSetting("flag_multimodal_import"),ie.getSetting("vision_provider_override"),ie.getSetting("vision_model_override"),ie.getSetting("flag_math_vision")]).then(([R,L,z])=>{s(R==="true"),c(L??""),v(z==="true"),l(!0)})},[]);const E=async()=>{const R=!a;s(R),await ie.setSetting("flag_multimodal_import",String(R))},N=async()=>{const R=!b;v(R),await ie.setSetting("flag_math_vision",String(R))},k=async R=>{await ie.setSetting("vision_provider_override",R.id),await ie.setSetting("vision_model_override",R.defaultModel),c(R.id),m(!1)},S=async()=>{await ie.setSetting("vision_provider_override",""),await ie.setSetting("vision_model_override",""),c(""),m(!1)},_=async()=>{if(!d){p(!0),x(null);try{const R=await ie.testLlmConnection({vision:!0});x({ok:R.ok,detail:R.detail})}catch(R){x({ok:!1,detail:R instanceof Error?R.message:String(R)})}finally{p(!1)}}},C=r.filter(R=>R.kind==="vision"),I=u.startsWith("custom-")?r.find(R=>R.id===u):null,A=u&&!u.startsWith("custom-")?n.find(R=>R.id===u):null;return o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[f.jsx(yi,{checked:a,onChange:E,label:i("settings.multimodal.toggle"),testid:"multimodal-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:i("settings.multimodal.toggle")}),f.jsx("div",{className:"text-label text-ink-muted",children:i("settings.multimodal.toggle.desc")})]})]}),f.jsxs("div",{className:"px-4 py-3.5 border-t border-[var(--border-faint)] space-y-3",children:[f.jsxs("div",{className:"text-label text-ink-muted bg-ink/5 rounded-lg p-3",children:[f.jsx("div",{className:"font-medium mb-1",children:i("settings.multimodal.current_model",{model:t||i("settings.multimodal.not_selected")})}),f.jsx("div",{children:e.startsWith("custom-")?i("settings.multimodal.hint_custom"):i("settings.multimodal.hint_preset")})]}),f.jsxs("div",{className:"bg-ink/5 rounded-lg p-3",children:[f.jsx("div",{className:"text-label font-medium text-ink-muted mb-2",children:i("settings.multimodal.override_title")}),f.jsx("div",{className:"text-caption text-ink-muted mb-2",children:i("settings.multimodal.override_bridge_hint")}),f.jsxs("div",{className:"space-y-3 mt-1",children:[I&&f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[f.jsx(xs,{className:"w-3.5 h-3.5 text-ink-faint shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"font-medium text-ink-strong",children:I.label}),f.jsx("code",{className:"text-ink-faint font-mono break-all",children:I.defaultModel}),f.jsx("span",{className:"text-ink-faint break-all min-w-0",children:I.baseUrl})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{onClick:()=>void _(),disabled:d,"data-testid":"vision-override-test",className:"btn-3d-neutral px-4 py-1.5 text-label disabled:opacity-50",children:i(d?"settings.testing":"settings.multimodal.test_override")}),f.jsx("button",{onClick:()=>m(R=>!R),className:"text-label text-accent hover:underline",children:i("settings.multimodal.replace_custom")}),f.jsx("button",{onClick:()=>void S(),className:"text-label text-ink-muted hover:text-ink-strong",children:i("settings.multimodal.stop_override")}),g&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${g.ok?"text-brand":"text-warning"}`,children:[g.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(ki,{className:"w-4 h-4","aria-hidden":"true"}),g.detail]})]})]}),A&&f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[f.jsx("span",{className:"text-ink-muted",children:i("settings.multimodal.legacy_preset",{label:A.label})}),f.jsx("button",{onClick:()=>void S(),className:"text-label text-ink-muted hover:text-ink-strong underline",children:i("settings.multimodal.stop_override")})]}),!I&&!A&&f.jsxs(f.Fragment,{children:[C.map(R=>f.jsxs("button",{onClick:()=>void k(R),className:"w-full text-left px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-3 transition-colors","data-testid":`vision-pick-${R.id}`,children:[f.jsx("span",{className:"text-label font-medium text-ink-strong",children:R.label}),f.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:R.defaultModel})]},R.id)),(h||C.length===0)&&f.jsx(qo,{kind:"vision",testPrefix:"vision-custom",titleKey:"settings.custom.form_title_vision",modelPhKey:"settings.custom.model_ph_vision",onSaved:R=>void k(R),onCancel:()=>m(!1)}),C.length>0&&f.jsx("button",{onClick:()=>m(R=>!R),className:"text-label text-accent hover:underline",children:i(h?"action.cancel":"settings.custom.new")})]})]})]}),f.jsxs("div",{className:"bg-ink/5 rounded-lg p-3 flex items-center gap-3",children:[f.jsx(yi,{checked:b,onChange:N,label:i("settings.mathvision.toggle"),testid:"math-vision-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-label font-medium text-ink-strong",children:i("settings.mathvision.toggle")}),f.jsx("div",{className:"text-caption text-ink-muted",children:i("settings.mathvision.desc")})]})]})]})]}):null}function S_(){const e=$e(),[t,n]=w.useState(!1),[r,i]=w.useState(!1);w.useEffect(()=>{ie.getSetting("flag_memory_system").then(s=>{n(s==="true"),i(!0)})},[]);const a=async()=>{const s=!t;n(s),await ie.setSetting("flag_memory_system",String(s))};return r?f.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[f.jsx(yi,{checked:t,onChange:a,label:e("settings.memory.toggle"),testid:"memory-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.memory.toggle")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.memory.toggle.desc")})]})]}):null}function A_(){const e=$e(),[t,n]=w.useState(!0),[r,i]=w.useState(!1),a=w.useSyncExternalStore(q1,pc),[s,o]=w.useState(!0),[l,u]=w.useState(!1),c=typeof window<"u"&&!!window.__lookatstudyWeb;w.useEffect(()=>{ie.getSetting("companion_enabled").then(g=>{n(g!=="false"&&g!=="0"),i(!0)}),ie.getSetting("companion_sfx").then(g=>{o(g!=="false"&&g!=="0")}),ie.getSetting("companion_pet_mode").then(g=>{u(g==="1")})},[]);const h=async()=>{const g=!t;n(g),await ie.setSetting("companion_enabled",String(g)),window.dispatchEvent(new Event("companion-config-changed"))},m=async()=>{const g=!s;o(g),await ie.setSetting("companion_sfx",String(g)),window.dispatchEvent(new Event("companion-config-changed"))},d=async()=>{const g=!l;u(g),await ie.setSetting("companion_pet_mode",g?"1":"0"),window.dispatchEvent(new Event("companion-config-changed"))},p=async g=>{g!==a.form&&(await ie.setSetting("companion_form",g),window.dispatchEvent(new Event("companion-config-changed")))};return r?f.jsxs("div",{className:"px-4 py-3.5 flex flex-col gap-4",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(yi,{checked:t,onChange:h,label:e("settings.companion.toggle"),testid:"companion-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.companion.toggle")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.companion.toggle.desc")})]})]}),t&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(yi,{checked:s,onChange:m,label:e("settings.companion.sfx"),testid:"companion-sfx-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.companion.sfx")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.companion.sfx.desc")})]})]}),!c&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(yi,{checked:l,onChange:d,label:e("settings.companion.pet"),testid:"companion-pet-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.companion.pet")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.companion.pet.desc")})]})]}),f.jsxs("div",{children:[f.jsx("div",{className:"text-label text-ink-muted mb-2",children:e("settings.companion.form")}),f.jsx("div",{className:"grid grid-cols-5 gap-2",role:"radiogroup","aria-label":e("settings.companion.form"),children:dy.map(g=>{const x=a.form===g;return f.jsxs("button",{type:"button",role:"radio","aria-checked":x,"data-testid":`companion-form-${g}`,onClick:()=>{p(g)},className:`flex flex-col items-center gap-0.5 rounded-xl p-1.5 border motion-safe:transition-colors
786
+ ${x?"border-[var(--accent)] bg-surface-2 shadow-card":"border-[var(--border-faint)] hover:bg-surface-2"}`,title:e(`companion.form.${g}.desc`),children:[f.jsx($1,{form:g,expression:"happy",pose:"float",size:64}),f.jsx("span",{className:`text-label ${x?"text-ink-strong font-medium":"text-ink-muted"}`,children:e(`companion.form.${g}.name`)})]},g)})})]})]})]}):null}function yi({checked:e,onChange:t,label:n,testid:r}){return f.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n,onClick:t,"data-testid":r,className:`relative w-12 h-6 rounded-full transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/60 focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface-2)] ${e?"bg-brand":"bg-ink/20 hover:bg-ink/25"}`,children:f.jsx("span",{className:`absolute left-0.5 top-1/2 -translate-y-1/2 w-5 h-5 rounded-full bg-white shadow transition-transform ${e?"translate-x-6":""}`})})}const C_=[{id:"zh-CN-XiaoxiaoNeural",label:"zh-CN · 晓晓(女)"},{id:"zh-CN-XiaoyiNeural",label:"zh-CN · 晓伊(女)"},{id:"zh-CN-YunxiNeural",label:"zh-CN · 云希(男)"},{id:"zh-CN-YunyangNeural",label:"zh-CN · 云扬(男·新闻)"},{id:"zh-CN-liaoning-XiaobeiNeural",label:"zh-CN · 晓北(女·东北)"},{id:"zh-CN-shaanxi-XiaoniNeural",label:"zh-CN · 晓妮(女·陕西)"},{id:"en-US-AriaNeural",label:"en-US · Aria(女)"},{id:"en-US-GuyNeural",label:"en-US · Guy(男)"},{id:"en-US-JennyNeural",label:"en-US · Jenny(女)"}],N_=[{sid:"45",label:"zf_xiaobei(女)"},{sid:"46",label:"zf_xiaoni(女)"},{sid:"47",label:"zf_xiaoxiao(女)"},{sid:"48",label:"zf_xiaoyi(女·默认)"},{sid:"49",label:"zm_yunjian(男)"},{sid:"50",label:"zm_yunxi(男)"},{sid:"51",label:"zm_yunxia(男)"},{sid:"52",label:"zm_yunyang(男)"}];function M_(){const e=$e(),[t,n]=w.useState([]),[r,i]=w.useState(null),[a,s]=w.useState(null),[o,l]=w.useState(null),[u,c]=w.useState(null),[h,m]=w.useState("edge"),[d,p]=w.useState("zh-CN-XiaoxiaoNeural"),[g,x]=w.useState("48"),[b,v]=w.useState("1.0"),[E,N]=w.useState(""),[k,S]=w.useState(""),[_,C]=w.useState([]),I=typeof window<"u"&&"speechSynthesis"in window,[A,R]=w.useState("local"),[L,z]=w.useState("asr-whisper-turbo"),[j,B]=w.useState(!0),[H,Y]=w.useState([]),[V,Z]=w.useState(!1),[O,X]=w.useState(!1),[ne,P]=w.useState(!1),[te,Q]=w.useState(!1),[K,ce]=w.useState(!1),[le,ee]=w.useState(null),[Ce,de]=w.useState(!1),[he,pe]=w.useState(null),[Ne,Oe]=w.useState(null),ot=w.useCallback(()=>{ie.listCustomProviders().then(ae=>Y(ae.filter(rt=>rt.kind==="tts"||rt.kind==="asr"))).catch(()=>{})},[]);w.useEffect(()=>{Promise.all([ie.getSetting("tts_engine"),ie.getSetting("tts_voice_edge"),ie.getSetting("tts_sid_local"),ie.getSetting("tts_speed"),ie.getSetting("tts_custom_voice"),ie.getSetting("tts_system_voice"),ie.getSetting("asr_engine"),ie.getSetting("asr_local_model"),ie.getSetting("asr_auto_stop")]).then(([ae,rt,Tt,nn,Xn,Cr,Ge,tt,Dt])=>{ae&&m(ae),rt&&p(rt),Tt&&x(Tt),nn&&v(nn),Xn&&N(Xn),Cr&&S(Cr),Ge&&R(Ge),(tt==="asr-whisper-turbo"||tt==="asr-whisper-small")&&z(tt),B(Dt!=="0")}),ot()},[ot]),w.useEffect(()=>{if(typeof window>"u"||!("speechSynthesis"in window))return;const ae=()=>C(c0(window.speechSynthesis.getVoices()));return ae(),window.speechSynthesis.addEventListener("voiceschanged",ae),()=>window.speechSynthesis.removeEventListener("voiceschanged",ae)},[]);const Be=w.useCallback(()=>{window.api.getSpeechModelStatus().then(ae=>n(ae)).catch(()=>{})},[]);w.useEffect(()=>(Be(),window.api.on("speech:modelProgress",rt=>{l({id:rt.id,pct:Math.floor(rt.progress*100),label:rt.currentFile?rt.currentFile.split("/").pop()??"":""})})),[Be]);const ct=ae=>{s(null),i(ae),l({id:ae,pct:0,label:""}),window.api.ensureSpeechModel(ae).then(()=>{i(null),l(null),Be()}).catch(rt=>{i(null),l(null),s(rt instanceof Error?rt.message:String(rt)),Be()})},me=ae=>{i(ae),c(null),window.api.deleteSpeechModel(ae).then(Be).catch(rt=>s(rt instanceof Error?rt.message:String(rt))).finally(()=>i(null))},Ue=ae=>e(ae==="tts-kokoro"?"settings.speech.model.tts":ae==="asr-whisper-turbo"?"settings.speech.model.asr_turbo":"settings.speech.model.asr_small"),dt=ae=>e(ae==="asr-whisper-turbo"?"settings.speech.model.turbo_short":"settings.speech.model.small_short"),nt=ae=>ae.startsWith("asr-whisper")?e("settings.speech.license_mit"):e("settings.speech.license"),mt=ae=>e(ae==="ready"?"settings.speech.state.ready":ae==="error"?"settings.speech.state.error":"settings.speech.state.absent"),Qe=ae=>{var rt;return((rt=t.find(Tt=>Tt.id===ae))==null?void 0:rt.state)??"absent"},Pe=ae=>{m(ae),ee(null),ie.setSetting("tts_engine",ae),no()},oe=ae=>{S(ae),ie.setSetting("tts_system_voice",ae),no()},ge=ae=>{R(ae),pe(null),ie.setSetting("asr_engine",ae)},_e=H.filter(ae=>ae.kind==="tts"),Ae=H.filter(ae=>ae.kind==="asr"),ze=h.startsWith("custom-")?_e.find(ae=>ae.id===h)??null:null,ye=A.startsWith("custom-")?Ae.find(ae=>ae.id===A)??null:null,Re=h==="azure",He=A==="groq",ht=A==="azure",en=async()=>{if(!(!ze||K)){ce(!0),ee(null);try{ee(await ie.testCustomTts({providerId:ze.id}))}catch(ae){ee({ok:!1,detail:ae instanceof Error?ae.message:String(ae)})}finally{ce(!1)}}},jt=async()=>{if(!(!ye||Ce)){de(!0),pe(null);try{pe(await ie.testCustomAsr({providerId:ye.id}))}catch(ae){pe({ok:!1,detail:ae instanceof Error?ae.message:String(ae)})}finally{de(!1)}}},tn=async(ae,rt)=>{Oe(null);try{await ie.deleteCustomProvider(ae),rt==="tts"&&h===ae&&Pe("edge"),rt==="asr"&&A===ae&&ge("local"),ot()}catch{}},Je=ae=>{const rt=t.find(nn=>nn.id===ae),Tt=(rt==null?void 0:rt.state)??"absent";return f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-label font-medium text-ink-strong truncate",children:Ue(ae)}),f.jsxs("div",{className:"text-caption text-ink-muted",children:[mt(Tt)," · ",nt(ae)]}),r===ae&&(o==null?void 0:o.id)===ae&&f.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":`speech-dl-bar-${ae}`,children:f.jsx("div",{className:"h-full bg-brand transition-all",style:{width:`${o.pct}%`}})}),r===ae&&(o==null?void 0:o.id)===ae&&f.jsxs("div",{className:"text-caption text-ink-faint mt-0.5","data-testid":`speech-dl-pct-${ae}`,children:[o.pct,"%",o.label?` · ${o.label}`:""]})]}),Tt==="ready"?u===ae?f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"text-caption text-warning",children:e("settings.speech.confirm_del")}),f.jsx("button",{onClick:()=>me(ae),className:"text-label text-warning hover:underline","data-testid":`speech-del-confirm-${ae}`,children:e("settings.speech.delete")}),f.jsx("button",{onClick:()=>c(null),className:"text-label text-ink-muted hover:text-ink-strong",children:e("action.cancel")})]}):f.jsx("button",{onClick:()=>c(ae),disabled:r===ae,className:"text-label text-ink-muted hover:text-warning disabled:opacity-40","data-testid":`speech-del-${ae}`,children:e("settings.speech.delete")}):f.jsx("button",{onClick:()=>ct(ae),disabled:r!=null||Tt==="downloading",className:"btn-3d-brand px-3 py-1 text-label disabled:opacity-40","data-testid":`speech-dl-${ae}`,children:e(r===ae||Tt==="downloading"?"settings.speech.downloading":"settings.speech.download")})]},ae)},Kr=(ae,rt,Tt,nn,Xn)=>f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[f.jsx(xs,{className:"w-3.5 h-3.5 text-ink-faint shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"font-medium text-ink-strong",children:ae.label}),f.jsx("code",{className:"text-ink-faint font-mono break-all",children:ae.defaultModel}),f.jsx("span",{className:"text-ink-faint break-all min-w-0",children:ae.baseUrl}),ae.hasApiKey&&f.jsxs("span",{className:"text-brand shrink-0 inline-flex items-center gap-0.5",children:[f.jsx(Wn,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.speech.key_saved")]})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.jsx("button",{onClick:()=>void Xn(),disabled:Tt,className:"btn-3d-neutral px-3 py-1 text-label disabled:opacity-40","data-testid":`${rt}-custom-test`,children:e(Tt?"settings.testing":"settings.test")}),Ne===ae.id?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-caption text-warning",children:e("settings.speech.confirm_del_custom")}),f.jsx("button",{onClick:()=>void tn(ae.id,rt),className:"text-label text-warning hover:underline","data-testid":`${rt}-custom-del-confirm`,children:e("settings.speech.delete")}),f.jsx("button",{onClick:()=>Oe(null),className:"text-label text-ink-muted hover:text-ink-strong",children:e("action.cancel")})]}):f.jsx("button",{onClick:()=>Oe(ae.id),className:"text-label text-ink-muted hover:text-warning","data-testid":`${rt}-custom-del`,children:e("settings.speech.delete")}),nn&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${nn.ok?"text-brand":"text-warning"}`,children:[nn.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(ki,{className:"w-4 h-4","aria-hidden":"true"}),nn.detail]})]})]});return f.jsxs("div",{"data-testid":"settings-speech",children:[f.jsxs("div",{className:Et(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.tts_title")}),f.jsxs("div",{className:"flex gap-2 flex-wrap",children:[f.jsx("button",{onClick:()=>{Pe("edge"),Z(!1),P(!1)},"data-testid":"tts-engine-edge","aria-pressed":h==="edge",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h==="edge"?$n:qn}`,children:e("settings.speech.engine.edge")}),f.jsxs("button",{onClick:()=>{Pe("local"),Z(!1),P(!1)},"data-testid":"tts-engine-local","aria-pressed":h==="local",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h==="local"?$n:qn}`,children:[e("settings.speech.engine.local"),Qe("tts-kokoro")!=="ready"?` · ${e("settings.speech.state.absent")}`:""]}),f.jsx("button",{onClick:()=>{Pe("system"),Z(!1),P(!1)},disabled:!I,"data-testid":"tts-engine-system","aria-pressed":h==="system",title:I?void 0:e("settings.speech.engine.system_unavailable"),className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h==="system"?$n:qn} ${I?"":"opacity-40 cursor-not-allowed"}`,children:e("settings.speech.engine.system")}),f.jsx("button",{onClick:()=>{Z(ae=>!ae),V||P(!1)},"data-testid":"tts-engine-custom","aria-pressed":h.startsWith("custom-")||V,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h.startsWith("custom-")||V?$n:qn}`,children:e("settings.speech.engine.custom")}),Re&&f.jsxs("button",{disabled:!0,"data-testid":"tts-engine-azure",className:"px-4 py-2 rounded-xl text-body font-bold opacity-50 cursor-not-allowed",children:["Azure · ",e("settings.speech.legacy")]})]}),h==="edge"&&f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.engine.edge_note")})]}),h==="edge"&&f.jsxs("div",{className:Et(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsx("select",{value:d,onChange:ae=>{p(ae.target.value),ie.setSetting("tts_voice_edge",ae.target.value)},"data-testid":"tts-voice-select",className:`${rr} w-full min-w-0 px-2.5 py-1.5`,children:C_.map(ae=>f.jsx("option",{value:ae.id,children:ae.label},ae.id))})]}),h==="local"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Et(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsx("select",{value:g,onChange:ae=>{x(ae.target.value),ie.setSetting("tts_sid_local",ae.target.value)},"data-testid":"tts-sid-select",className:`${rr} w-full min-w-0 px-2.5 py-1.5`,children:N_.map(ae=>f.jsx("option",{value:ae.sid,children:ae.label},ae.sid))})]}),f.jsx("div",{className:Et(!1),children:Je("tts-kokoro")})]}),h==="system"&&f.jsx(f.Fragment,{children:f.jsxs("div",{className:Et(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsxs("select",{value:k,onChange:ae=>oe(ae.target.value),"data-testid":"tts-system-voice-select",className:`${rr} w-full min-w-0 px-2.5 py-1.5`,children:[f.jsx("option",{value:"",children:e("settings.speech.voice_auto")}),_.map(ae=>f.jsx("option",{value:ae.name,children:DM(ae)},ae.voiceURI))]}),f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.engine.system_note")})]})}),V&&f.jsx("div",{className:Et(!1),children:f.jsxs("div",{className:"space-y-3",children:[ze&&Kr(ze,"tts",K,le,en),ze&&f.jsxs("div",{children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsx("input",{type:"text",value:E,onChange:ae=>N(ae.target.value),onBlur:()=>void ie.setSetting("tts_custom_voice",E.trim()),placeholder:e("settings.speech.custom_voice_ph"),"data-testid":"tts-custom-voice",className:`${rr} w-full min-w-0 px-2.5 py-1.5 font-mono`})]}),!ze&&_e.map(ae=>f.jsxs("button",{onClick:()=>Pe(ae.id),className:"w-full text-left px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-3 transition-colors","data-testid":`tts-pick-${ae.id}`,children:[f.jsx("span",{className:"text-label font-medium text-ink-strong",children:ae.label}),f.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:ae.defaultModel})]},ae.id)),(ne||!ze&&_e.length===0)&&f.jsx(qo,{kind:"tts",showProtocol:!1,testPrefix:"tts-custom",titleKey:"settings.custom.form_title_tts",modelPhKey:"settings.custom.model_ph_tts",testOverride:ae=>ie.testCustomTts({baseUrl:ae.baseUrl,apiKey:ae.apiKey||void 0,model:ae.model}),onSaved:ae=>{Pe(ae.id),P(!1),ot()},onCancel:()=>P(!1)}),(ze||_e.length>0)&&f.jsx("button",{onClick:()=>P(ae=>!ae),className:"text-label text-accent hover:underline",children:e(ne?"action.cancel":"settings.custom.new")})]})}),f.jsx("div",{className:Et(!0),children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.speed")}),f.jsx("input",{type:"range",min:"0.5",max:"2",step:"0.05",value:b,onChange:ae=>v(ae.target.value),onPointerUp:()=>{ie.setSetting("tts_speed",b),no()},onKeyUp:()=>{ie.setSetting("tts_speed",b),no()},"data-testid":"tts-speed-range",className:"flex-1 min-w-0 accent-[var(--brand)]"}),f.jsxs("span",{className:"text-label text-ink-muted tabular-nums w-10 text-right","data-testid":"tts-speed-value",children:[Number(b).toFixed(2),"x"]})]})}),f.jsxs("div",{className:Et(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.asr_title")}),f.jsxs("div",{className:"flex gap-2 flex-wrap",children:[f.jsx("button",{onClick:()=>{ge("local"),X(!1),Q(!1)},"data-testid":"asr-engine-local","aria-pressed":A==="local",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${A==="local"?$n:qn}`,children:e("settings.speech.asr_engine.local")}),f.jsx("button",{onClick:()=>{X(ae=>!ae),O||Q(!1)},"data-testid":"asr-engine-custom","aria-pressed":A.startsWith("custom-")||O,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${A.startsWith("custom-")||O?$n:qn}`,children:e("settings.speech.engine.custom")}),He&&f.jsxs("button",{disabled:!0,"data-testid":"asr-engine-groq",className:"px-4 py-2 rounded-xl text-body font-bold opacity-50 cursor-not-allowed",children:["Groq · ",e("settings.speech.legacy")]}),ht&&f.jsxs("button",{disabled:!0,"data-testid":"asr-engine-azure",className:"px-4 py-2 rounded-xl text-body font-bold opacity-50 cursor-not-allowed",children:["Azure · ",e("settings.speech.legacy")]})]}),A==="local"?f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_engine.local_note")}):A.startsWith("custom-")&&f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_engine.custom_note")})]}),A==="local"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Et(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.model")}),f.jsx("select",{value:L,onChange:ae=>{z(ae.target.value),ie.setSetting("asr_local_model",ae.target.value)},"data-testid":"asr-model-select",className:`${rr} w-full min-w-0 px-2.5 py-1.5`,children:["asr-whisper-turbo","asr-whisper-small"].map(ae=>f.jsxs("option",{value:ae,children:[dt(ae)," · ",mt(Qe(ae))]},ae))})]}),f.jsx("div",{className:Et(!1),children:Je(L)})]}),O&&f.jsx("div",{className:Et(!1),children:f.jsxs("div",{className:"space-y-3",children:[ye&&Kr(ye,"asr",Ce,he,jt),!ye&&Ae.map(ae=>f.jsxs("button",{onClick:()=>ge(ae.id),className:"w-full text-left px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-3 transition-colors","data-testid":`asr-pick-${ae.id}`,children:[f.jsx("span",{className:"text-label font-medium text-ink-strong",children:ae.label}),f.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:ae.defaultModel})]},ae.id)),(te||!ye&&Ae.length===0)&&f.jsx(qo,{kind:"asr",showProtocol:!1,testPrefix:"asr-custom",titleKey:"settings.custom.form_title_asr",modelPhKey:"settings.custom.model_ph_asr",testOverride:ae=>ie.testCustomAsr({baseUrl:ae.baseUrl,apiKey:ae.apiKey||void 0,model:ae.model}),onSaved:ae=>{ge(ae.id),Q(!1),ot()},onCancel:()=>Q(!1)}),(ye||Ae.length>0)&&f.jsx("button",{onClick:()=>Q(ae=>!ae),className:"text-label text-accent hover:underline",children:e(te?"action.cancel":"settings.custom.new")})]})}),f.jsxs("div",{className:Et(!0),children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(yi,{checked:j,onChange:()=>{const ae=!j;B(ae),ie.setSetting("asr_auto_stop",ae?"1":"0")},label:e("settings.speech.asr_auto_stop"),testid:"asr-auto-stop-toggle"}),f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.speech.asr_auto_stop")})]}),f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_ux_note")})]}),a&&f.jsx("div",{className:"px-4 py-3 text-label text-warning break-all",role:"alert",children:a==="engine-unavailable"?e("chat.speech.engine_unavailable"):a})]})}function I_(e,t){if(t.type==="text"){const n=e[e.length-1];return n&&n.type==="text"?[...e.slice(0,-1),{type:"text",text:n.text+t.text}]:[...e,{type:"text",text:t.text}]}if(t.type==="reasoning"){const n=e[e.length-1];return n&&n.type==="reasoning"?[...e.slice(0,-1),{type:"reasoning",text:n.text+t.text}]:[...e,{type:"reasoning",text:t.text}]}if(t.type==="tool-start")return[...e,{type:"tool-call",toolName:t.toolName,state:"input-available"}];if(t.type==="tool-result"){let n=-1;for(let r=e.length-1;r>=0;r--){const i=e[r];if(i.type==="tool-call"&&i.toolName===t.toolName&&i.state==="input-available"){n=r;break}}return n<0?e:e.map((r,i)=>i===n?{...r,state:"output-available",output:t.output}:r)}if(t.type==="tool-error"){let n=-1;for(let r=e.length-1;r>=0;r--){const i=e[r];if(i.type==="tool-call"&&i.toolName===t.toolName&&i.state==="input-available"){n=r;break}}return n<0?e:e.map((r,i)=>i===n?{...r,state:"output-error",error:t.error}:r)}return e}let __=0;const ro=()=>`msg-v2-${++__}`;function R_(e){if(!e)return null;try{const t=JSON.parse(e);return!Array.isArray(t)||t.length===0?null:t.every(r=>typeof r=="object"&&r!==null&&typeof r.type=="string")?t:null}catch{return null}}function L_(e,t){const[n,r]=w.useState([]),[i,a]=w.useState(!1),s=w.useRef(null);w.useEffect(()=>{if(!e){r([]),a(!1),s.current=null;return}let m=!1;return(async()=>{try{const d=await ie.threadGetMessages(e);if(m)return;r(d.map(p=>{const g=R_(p.partsJson);return{id:p.id,role:p.role,parts:g??[{type:"text",text:p.content}],...p.displayText?{displayText:p.displayText}:{}}}))}catch{m||r([])}})(),()=>{m=!0}},[e]),w.useEffect(()=>ie.on("chat:part",d=>{const g=s.current;r(x=>{let b=g,v=x;if(!(b&&x.some(k=>k.id===b))){const k=x[x.length-1];k&&k.role==="assistant"?b=k.id:(b=ro(),v=[...x,{id:b,role:"assistant",parts:[]}])}const N=b;return v.map(k=>k.id===N?{...k,parts:I_(k.parts,d)}:k)})}),[]),w.useEffect(()=>ie.on("chat:done",(d,p)=>{a(!1),s.current=null,p&&(p.userMessageId||p.assistantMessageId)&&r(g=>{let x=-1,b=-1;for(let v=g.length-1;v>=0&&(g[v].role==="user"&&x===-1&&(x=v),g[v].role==="assistant"&&b===-1&&(b=v),!(x!==-1&&b!==-1));v--);return g.map((v,E)=>E===x&&p.userMessageId?{...v,id:p.userMessageId}:E===b&&p.assistantMessageId?{...v,id:p.assistantMessageId}:v)})}),[]),w.useEffect(()=>ie.on("chat:error",d=>{a(!1),s.current=null,r(p=>[...p,{id:ro(),role:"assistant",parts:[{type:"text",text:`⚠️ ${d}`}]}])}),[]);const o=w.useCallback(async(m,d,p,g)=>{const x=d??e;if(!x||i||!m.trim())return;const b=m.trim(),v={id:ro(),role:"user",parts:[...(g??[]).map(E=>({type:"attachment",attachment:{kind:E.kind,name:E.name,mime:E.mime,size:E.size,...E.previewUrl?{previewUrl:E.previewUrl}:{}}})),{type:"text",text:b}],...p?{displayText:p}:{}};r(E=>[...E,v]),a(!0),s.current=null;try{await ie.agentChatThread(x,b,p,t??null,g)}catch(E){a(!1),r(N=>[...N,{id:ro(),role:"assistant",parts:[{type:"text",text:`⚠️ ${E instanceof Error?E.message:String(E)}`}]}])}},[e,i,t]),l=w.useCallback(async()=>{if(!(!e||!i)){try{await ie.abortAgentChatThread(e)}catch{}a(!1),s.current=null}},[e,i]),u=w.useCallback(()=>{r([])},[]);w.useEffect(()=>{const m=d=>{const p=d.detail;if(typeof p!="string")return;const x={explain_simple:{msg:"用大白话给我讲讲这一节的核心概念",labelKey:"command.explain_simple"},quiz_3:{msg:"出 3 道练习题考考我",labelKey:"command.quiz_3"},compare_prev:{msg:"把这一节和上一节做个对比表",labelKey:"command.compare_prev"},concept_map:{msg:"画个概念图帮我理清这一节的知识结构",labelKey:"command.concept_map"},socratic:{msg:"切换到苏格拉底模式,用提问引导我思考",labelKey:"command.socratic"},exam_mode:{msg:"切换到考试冲刺模式,出有难度的题",labelKey:"command.exam_mode"}}[p];x&&o(x.msg,void 0,X0(x.labelKey))};return window.addEventListener("lookatstudy-command",m),()=>window.removeEventListener("lookatstudy-command",m)},[o]);const c=w.useCallback((m,d,p)=>{r(g=>g.map(x=>{if(x.id!==m)return x;const b=[...x.parts],v=b[d];return v&&v.type==="tool-call"&&(b[d]={...v,output:{...typeof v.output=="object"&&v.output?v.output:{},status:p?"applied":"rejected"}}),{...x,parts:b}}))},[]),h=w.useCallback(m=>{r(m)},[]);return{messages:n,streaming:i,send:o,stop:l,clear:u,markProposalStatus:c,setMessagesForNode:h}}const io=(e,t=60)=>e.length>t?e.slice(0,t)+"…":e;function D_(e,t){return t("quiz.hook.label",{correct:e.correct,total:e.total})}function P_(e,t){const n=e.detail.map((i,a)=>i.correct?t("quiz.hook.lineOk",{n:a+1,prompt:io(i.prompt)}):t("quiz.hook.lineWrong",{n:a+1,prompt:io(i.prompt),chosen:io(i.chosen,30),answer:io(i.answerText,30)})),r=e.title?`《${e.title}》`:"";return t("quiz.hook.message",{title:r,correct:e.correct,total:e.total})+(n.length?`
787
+ `+n.join(`
788
+ `):"")}function O_(e,t){const[n,r]=w.useState([]),[i,a]=w.useState(null),s=w.useCallback(async()=>{if(!e||!t){r([]),a(null);return}try{const g=(await ie.threadList(e,"active")).filter(x=>x.focusNodeId===t);r(g),g.length>0?a(g[0].id):a(null)}catch{r([]),a(null)}},[e,t]);w.useEffect(()=>{s()},[s]);const o=w.useCallback(async p=>{if(!e||!t)return null;try{const g=await ie.threadCreate({...p,courseId:e,focusNodeId:t});return r(x=>[g,...x]),a(g.id),g}catch{return null}},[e,t]),l=w.useCallback(async(p,g)=>{try{const x=await ie.threadUpdate(p,g);return x&&(x.status==="archived"?(r(b=>b.filter(v=>v.id!==p)),a(b=>{var E;return b!==p?b:((E=n.filter(N=>N.id!==p)[0])==null?void 0:E.id)??null})):r(b=>b.map(v=>v.id===p?x:v))),x}catch{return null}},[n]),u=w.useCallback(async p=>{try{await ie.threadDelete(p),r(g=>g.filter(x=>x.id!==p)),a(g=>{var b;return g!==p?g:((b=n.filter(v=>v.id!==p)[0])==null?void 0:b.id)??null})}catch{}},[n]),c=w.useCallback(p=>{const g=n.find(x=>x.id===p)??null;return g?(r(x=>x.filter(b=>b.id!==p)),a(x=>{var v;return x!==p?x:((v=n.filter(E=>E.id!==p)[0])==null?void 0:v.id)??null}),g):null},[n]),h=w.useCallback(p=>{r(g=>[p,...g.filter(x=>x.id!==p.id)]),a(p.id)},[]),m=w.useCallback(async(p,g)=>{if(!e||!t)return null;if(i)return i;const x=await o({title:(g??p).trim()});return(x==null?void 0:x.id)??null},[e,t,i,o]),d=n.find(p=>p.id===i)??null;return{threads:n,activeId:i,activeThread:d,setActiveId:a,reload:s,create:o,update:l,remove:u,removeWithUndo:c,restore:h,ensureThreadForSend:m}}function j_({threads:e,activeThread:t,focusNodeTitle:n,onPickThread:r,onCreate:i,onRename:a,onArchive:s,onDelete:o}){const l=$e(),[u,c]=w.useState(null),[h,m]=w.useState(null),[d,p]=w.useState(null),[g,x]=w.useState(""),[b,v]=w.useState(null),E=w.useRef(null);w.useEffect(()=>{const _=C=>{E.current&&!E.current.contains(C.target)&&(c(null),m(null))};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);const N=(_,C)=>{_.stopPropagation();const I=_.currentTarget.getBoundingClientRect(),A=Math.max(8,I.right-128),R=I.bottom+4;m({top:R,left:A}),c(u===C?null:C)},k=_=>{p(_.id),x(_.title??""),c(null),m(null)},S=()=>{d&&g.trim()&&a(d,g.trim()),p(null)};return e.length===0?f.jsxs("div",{className:"px-4 py-2 shrink-0 flex items-center gap-2 text-label bg-surface-1 opacity-60","data-testid":"thread-switcher-empty",children:[f.jsx("span",{className:"w-1 h-1 rounded-full bg-brand shrink-0"}),f.jsx("span",{className:"text-ink-muted truncate flex-1",children:n??l("thread.empty.no_node")}),f.jsx("span",{className:"text-caption text-ink-muted shrink-0",children:l("thread.empty.hint")})]}):f.jsxs("div",{className:"shrink-0 bg-surface-1","data-testid":"thread-switcher",children:[f.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-thin px-3 py-1.5 opacity-70 hover:opacity-100 transition-opacity",children:[e.map(_=>{const C=_.id===(t==null?void 0:t.id),I=d===_.id;return f.jsxs("div",{className:`group relative flex items-center gap-1.5 px-2 py-0.5 cursor-pointer whitespace-nowrap transition-colors shrink-0 rounded ${C?"text-ink-strong":"text-ink-muted hover:text-ink-strong"}`,onClick:()=>!I&&r(_.id),"data-testid":`thread-tab-${_.id.slice(0,8)}`,children:[f.jsx("span",{className:`w-1 h-1 rounded-full shrink-0 transition-opacity ${C?"bg-brand opacity-100":"bg-[var(--border)] opacity-0 group-hover:opacity-60"}`}),I?f.jsx("input",{value:g,onChange:A=>x(A.target.value),onKeyDown:A=>{A.key==="Enter"&&S(),A.key==="Escape"&&p(null)},onBlur:S,onClick:A=>A.stopPropagation(),autoFocus:!0,className:"bg-surface-0 text-ink-strong text-label rounded px-1.5 py-0.5 border border-brand focus:outline-none focus:ring-2 focus:ring-brand/20 w-28","data-testid":"thread-rename-input"}):f.jsx("span",{className:`text-label max-w-[120px] truncate ${C?"font-semibold":"font-normal"}`,"data-tooltip":_.title||l("toast.threadDefault"),children:_.title||l("toast.threadDefault")}),!I&&f.jsx("button",{onClick:A=>N(A,_.id),className:"flex items-center justify-center w-4 h-4 rounded text-ink-muted hover:text-ink-strong hover:bg-ink/5 opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 transition-all","data-testid":`thread-gear-${_.id.slice(0,8)}`,title:l("thread.actions.label"),"aria-label":l("thread.actions.label"),children:f.jsx(Io,{className:"w-3 h-3"})})]},_.id)}),f.jsx("button",{onClick:i,className:"flex items-center justify-center w-6 h-6 ml-1 rounded text-ink-muted hover:text-brand hover:bg-ink/5 transition-colors shrink-0","data-testid":"thread-new",title:l("thread.new.label"),"aria-label":l("thread.new.label"),children:f.jsx(nl,{className:"w-3.5 h-3.5"})})]}),u&&h&&(()=>{const _=e.find(C=>C.id===u);return _?f.jsxs("div",{ref:E,style:{position:"fixed",top:h.top,left:h.left},className:"z-50 w-32 bg-surface-0 rounded-lg shadow-pop py-1 border border-[var(--border-faint)]","data-testid":`thread-menu-${_.id.slice(0,8)}`,onClick:C=>C.stopPropagation(),children:[f.jsxs("button",{onClick:()=>k(_),className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-ink-muted hover:bg-surface-1 hover:bg-surface-3 hover:text-ink-strong transition-colors",children:[f.jsx(r5,{className:"w-3 h-3"}),l("thread.menu.rename")]}),f.jsxs("button",{onClick:()=>{s(_.id),c(null),m(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-ink-muted hover:bg-surface-1 hover:bg-surface-3 hover:text-ink-strong transition-colors",children:[f.jsx(wy,{className:"w-3 h-3"}),l("thread.menu.archive")]}),f.jsxs("button",{onClick:C=>{const I=C.currentTarget.getBoundingClientRect();v({id:_.id,title:_.title??l("toast.threadDefault"),rect:I}),c(null),m(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-warning hover:bg-warning/10 transition-colors",children:[f.jsx(yc,{className:"w-3 h-3"}),l("action.delete")]})]}):null})(),b&&f.jsx(rl,{anchorRect:b.rect,message:l("thread.delete.confirm",{name:b.title}),danger:!0,confirmLabel:l("action.delete"),testid:"thread-delete-confirm",onConfirm:()=>{o(b.id),v(null)},onCancel:()=>v(null)})]})}const B_=1240,F_=920;function z_(e){return e>=B_?1:e>=F_?2:3}function H_(e){return e==="rail"?"rail":"notebook"}function U_(e,t,n){if(Math.abs(t)<60||Math.abs(t)<Math.abs(n)*1.6)return null;const r=["rail","chat","notebook"],i=r.indexOf(e)+(t<0?1:-1);return i>=0&&i<r.length?r[i]:null}function V_(e){return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}function q_(){return z_(typeof window>"u"?$_:window.innerWidth)}const $_=99999;function W_(){return w.useSyncExternalStore(V_,q_,()=>1)}const Hd=w.createContext({});function Ud(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const G_=typeof window<"u",$o=G_?w.useLayoutEffect:w.useEffect,_l=w.createContext(null);function Vd(e,t){e.indexOf(t)===-1&&e.push(t)}function Wo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const lr=(e,t,n)=>n>t?t:n<e?e:n;let Rl=()=>{};const Vr={},e4=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),t4=e=>typeof e=="object"&&e!==null,n4=e=>/^0[^.\s]+$/u.test(e);function r4(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bn=e=>e,Ns=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ds=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class qd{constructor(){this.subscriptions=[]}add(t){return Vd(this.subscriptions,t),()=>Wo(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const s=this.subscriptions[a];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Cn=e=>e*1e3,jn=e=>e/1e3,i4=(e,t)=>t?e*(1e3/t):0,a4=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Y_=1e-7,K_=12;function X_(e,t,n,r,i){let a,s,o=0;do s=t+(n-t)/2,a=a4(s,r,i)-e,a>0?n=s:t=s;while(Math.abs(a)>Y_&&++o<K_);return s}function Ms(e,t,n,r){if(e===t&&n===r)return Bn;const i=a=>X_(a,0,1,e,n);return a=>a===0||a===1?a:a4(i(a),t,r)}const s4=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,o4=e=>t=>1-e(1-t),l4=Ms(.33,1.53,.69,.99),$d=o4(l4),u4=s4($d),c4=e=>e>=1?1:(e*=2)<1?.5*$d(e):.5*(2-Math.pow(2,-10*(e-1))),Wd=e=>1-Math.sin(Math.acos(e)),d4=o4(Wd),h4=s4(Wd),Q_=Ms(.42,0,1,1),Z_=Ms(0,0,.58,1),f4=Ms(.42,0,.58,1),J_=e=>Array.isArray(e)&&typeof e[0]!="number",m4=e=>Array.isArray(e)&&typeof e[0]=="number",eR={linear:Bn,easeIn:Q_,easeInOut:f4,easeOut:Z_,circIn:Wd,circInOut:h4,circOut:d4,backIn:$d,backInOut:u4,backOut:l4,anticipate:c4},tR=e=>typeof e=="string",Tp=e=>{if(m4(e)){Rl(e.length===4);const[t,n,r,i]=e;return Ms(t,n,r,i)}else if(tR(e))return eR[e];return e},ao=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function nR(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){a.has(u)&&(l.schedule(u),e()),u(s)}const l={schedule:(u,c=!1,h=!1)=>{const d=h&&r?t:n;return c&&a.add(u),d.add(u),u},cancel:u=>{n.delete(u),a.delete(u)},process:u=>{if(s=u,r){i=!0;return}r=!0;const c=t;t=n,n=c,t.forEach(o),t.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const rR=40;function p4(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,s=ao.reduce((E,N)=>(E[N]=nR(a),E),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:m,render:d,postRender:p}=s,g=()=>{const E=Vr.useManualTiming,N=E?i.timestamp:performance.now();n=!1,E||(i.delta=r?1e3/60:Math.max(Math.min(N-i.timestamp,rR),1)),i.timestamp=N,i.isProcessing=!0,o.process(i),l.process(i),u.process(i),c.process(i),h.process(i),m.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))},x=()=>{n=!0,r=!0,i.isProcessing||e(g)};return{schedule:ao.reduce((E,N)=>{const k=s[N];return E[N]=(S,_=!1,C=!1)=>(n||x(),k.schedule(S,_,C)),E},{}),cancel:E=>{for(let N=0;N<ao.length;N++)s[ao[N]].cancel(E)},state:i,steps:s}}const{schedule:vt,cancel:qr,state:Zt,steps:Zu}=p4(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bn,!0);let wo;function iR(){wo=void 0}const mn={now:()=>(wo===void 0&&mn.set(Zt.isProcessing||Vr.useManualTiming?Zt.timestamp:performance.now()),wo),set:e=>{wo=e,queueMicrotask(iR)}},g4=e=>t=>typeof t=="string"&&t.startsWith(e),x4=g4("--"),aR=g4("var(--"),Gd=e=>aR(e)?sR.test(e.split("/*")[0].trim()):!1,sR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sp(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ma={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},hs={...ma,transform:e=>lr(0,1,e)},so={...ma,default:1},Za=e=>Math.round(e*1e5)/1e5,Yd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function oR(e){return e==null}const lR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Kd=(e,t)=>n=>!!(typeof n=="string"&&lR.test(n)&&n.startsWith(e)||t&&!oR(n)&&Object.prototype.hasOwnProperty.call(n,t)),b4=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,s,o]=r.match(Yd);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},uR=e=>lr(0,255,e),Ju={...ma,transform:e=>Math.round(uR(e))},di={test:Kd("rgb","red"),parse:b4("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ju.transform(e)+", "+Ju.transform(t)+", "+Ju.transform(n)+", "+Za(hs.transform(r))+")"};function cR(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const m0={test:Kd("#"),parse:cR,transform:di.transform},Is=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),gr=Is("deg"),sr=Is("%"),je=Is("px"),dR=Is("vh"),hR=Is("vw"),Ap={...sr,parse:e=>sr.parse(e)/100,transform:e=>sr.transform(e*100)},Ui={test:Kd("hsl","hue"),parse:b4("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+sr.transform(Za(t))+", "+sr.transform(Za(n))+", "+Za(hs.transform(r))+")"},Ft={test:e=>di.test(e)||m0.test(e)||Ui.test(e),parse:e=>di.test(e)?di.parse(e):Ui.test(e)?Ui.parse(e):m0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?di.transform(e):Ui.transform(e),getAnimatableNone:e=>{const t=Ft.parse(e);return t.alpha=0,Ft.transform(t)}},fR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mR(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yd))==null?void 0:t.length)||0)+(((n=e.match(fR))==null?void 0:n.length)||0)>0}const y4="number",v4="color",pR="var",gR="var(",Cp="${}",xR=/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 ta(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const o=t.replace(xR,l=>(Ft.test(l)?(r.color.push(a),i.push(v4),n.push(Ft.parse(l))):l.startsWith(gR)?(r.var.push(a),i.push(pR),n.push(l)):(r.number.push(a),i.push(y4),n.push(parseFloat(l))),++a,Cp)).split(Cp);return{values:n,split:o,indexes:r,types:i}}function bR(e){return ta(e).values}function w4({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){const s=t[a];s===y4?i+=Za(r[a]):s===v4?i+=Ft.transform(r[a]):i+=r[a]}return i}}function yR(e){return w4(ta(e))}const vR=e=>typeof e=="number"?0:Ft.test(e)?Ft.getAnimatableNone(e):e,wR=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:vR(e);function kR(e){const t=ta(e);return w4(t)(t.values.map((r,i)=>wR(r,t.split[i])))}const Yn={test:mR,parse:bR,createTransformer:yR,getAnimatableNone:kR};function ec(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 ER({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,s=0;if(!t)i=a=s=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;i=ec(l,o,e+1/3),a=ec(l,o,e),s=ec(l,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}function Go(e,t){return n=>n>0?t:e}const yt=(e,t,n)=>e+(t-e)*n,tc=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},TR=[m0,di,Ui],SR=e=>TR.find(t=>t.test(e));function Np(e){const t=SR(e);if(!t)return!1;let n=t.parse(e);return t===Ui&&(n=ER(n)),n}const Mp=(e,t)=>{const n=Np(e),r=Np(t);if(!n||!r)return Go(e,t);const i={...n};return a=>(i.red=tc(n.red,r.red,a),i.green=tc(n.green,r.green,a),i.blue=tc(n.blue,r.blue,a),i.alpha=yt(n.alpha,r.alpha,a),di.transform(i))},p0=new Set(["none","hidden"]);function AR(e,t){return p0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function CR(e,t){return n=>yt(e,t,n)}function Xd(e){return typeof e=="number"?CR:typeof e=="string"?Gd(e)?Go:Ft.test(e)?Mp:IR:Array.isArray(e)?k4:typeof e=="object"?Ft.test(e)?Mp:NR:Go}function k4(e,t){const n=[...e],r=n.length,i=e.map((a,s)=>Xd(a)(a,t[s]));return a=>{for(let s=0;s<r;s++)n[s]=i[s](a);return n}}function NR(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Xd(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function MR(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],s=e.indexes[a][r[a]],o=e.values[s]??0;n[i]=o,r[a]++}return n}const IR=(e,t)=>{const n=Yn.createTransformer(t),r=ta(e),i=ta(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?p0.has(e)&&!i.values.length||p0.has(t)&&!r.values.length?AR(e,t):Ns(k4(MR(r,i),i.values),n):Go(e,t)};function E4(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?yt(e,t,n):Xd(e)(e,t)}const _R=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>vt.update(t,n),stop:()=>qr(t),now:()=>Zt.isProcessing?Zt.timestamp:mn.now()}},T4=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Yo=2e4;function Qd(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Yo;)t+=n,r=e.next(t);return t>=Yo?1/0:t}function RR(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Qd(r),Yo);return{type:"keyframes",ease:a=>r.next(i*a).value/t,duration:jn(i)}}const Lt={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 g0(e,t){return e*Math.sqrt(1-t*t)}const LR=12;function DR(e,t,n){let r=n;for(let i=1;i<LR;i++)r=r-e(r)/t(r);return r}const nc=.001;function PR({duration:e=Lt.duration,bounce:t=Lt.bounce,velocity:n=Lt.velocity,mass:r=Lt.mass}){let i,a,s=1-t;s=lr(Lt.minDamping,Lt.maxDamping,s),e=lr(Lt.minDuration,Lt.maxDuration,jn(e)),s<1?(i=u=>{const c=u*s,h=c*e,m=c-n,d=g0(u,s),p=Math.exp(-h);return nc-m/d*p},a=u=>{const h=u*s*e,m=h*n+n,d=Math.pow(s,2)*Math.pow(u,2)*e,p=Math.exp(-h),g=g0(Math.pow(u,2),s);return(-i(u)+nc>0?-1:1)*((m-d)*p)/g}):(i=u=>{const c=Math.exp(-u*e),h=(u-n)*e+1;return-nc+c*h},a=u=>{const c=Math.exp(-u*e),h=(n-u)*(e*e);return c*h});const o=5/e,l=DR(i,a,o);if(e=Cn(e),isNaN(l))return{stiffness:Lt.stiffness,damping:Lt.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const OR=["duration","bounce"],jR=["stiffness","damping","mass"];function Ip(e,t){return t.some(n=>e[n]!==void 0)}function BR(e){let t={velocity:Lt.velocity,stiffness:Lt.stiffness,damping:Lt.damping,mass:Lt.mass,isResolvedFromDuration:!1,...e};if(!Ip(e,jR)&&Ip(e,OR))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*lr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Lt.mass,stiffness:i,damping:a}}else{const n=PR({...e,velocity:0});t={...t,...n,mass:Lt.mass},t.isResolvedFromDuration=!0}return t}function Ko(e=Lt.visualDuration,t=Lt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:h,velocity:m,isResolvedFromDuration:d}=BR({...n,velocity:-jn(n.velocity||0)}),p=m||0,g=u/(2*Math.sqrt(l*c)),x=s-a,b=jn(Math.sqrt(l/c)),v=Math.abs(x)<5;r||(r=v?Lt.restSpeed.granular:Lt.restSpeed.default),i||(i=v?Lt.restDelta.granular:Lt.restDelta.default);let E,N,k,S,_,C;if(g<1)k=g0(b,g),S=(p+g*b*x)/k,E=A=>{const R=Math.exp(-g*b*A);return s-R*(S*Math.sin(k*A)+x*Math.cos(k*A))},_=g*b*S+x*k,C=g*b*x-S*k,N=A=>Math.exp(-g*b*A)*(_*Math.sin(k*A)+C*Math.cos(k*A));else if(g===1){E=R=>s-Math.exp(-b*R)*(x+(p+b*x)*R);const A=p+b*x;N=R=>Math.exp(-b*R)*(b*A*R-p)}else{const A=b*Math.sqrt(g*g-1);E=j=>{const B=Math.exp(-g*b*j),H=Math.min(A*j,300);return s-B*((p+g*b*x)*Math.sinh(H)+A*x*Math.cosh(H))/A};const R=(p+g*b*x)/A,L=g*b*R-x*A,z=g*b*x-R*A;N=j=>{const B=Math.exp(-g*b*j),H=Math.min(A*j,300);return B*(L*Math.sinh(H)+z*Math.cosh(H))}}const I={calculatedDuration:d&&h||null,velocity:A=>Cn(N(A)),next:A=>{if(!d&&g<1){const L=Math.exp(-g*b*A),z=Math.sin(k*A),j=Math.cos(k*A),B=s-L*(S*z+x*j),H=Cn(L*(_*z+C*j));return o.done=Math.abs(H)<=r&&Math.abs(s-B)<=i,o.value=o.done?s:B,o}const R=E(A);if(d)o.done=A>=h;else{const L=Cn(N(A));o.done=Math.abs(L)<=r&&Math.abs(s-R)<=i}return o.value=o.done?s:R,o},toString:()=>{const A=Math.min(Qd(I),Yo),R=T4(L=>I.next(A*L).value,A,30);return A+"ms "+R},toTransition:()=>{}};return I}Ko.applyToOptions=e=>{const t=RR(e,100,Ko);return e.ease=t.ease,e.duration=Cn(t.duration),e.type="keyframes",e};const FR=5;function S4(e,t,n){const r=Math.max(t-FR,0);return i4(n-e(r),t-r)}function x0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:s,min:o,max:l,restDelta:u=.5,restSpeed:c}){const h=e[0],m={done:!1,value:h},d=C=>o!==void 0&&C<o||l!==void 0&&C>l,p=C=>o===void 0?l:l===void 0||Math.abs(o-C)<Math.abs(l-C)?o:l;let g=n*t;const x=h+g,b=s===void 0?x:s(x);b!==x&&(g=b-h);const v=C=>-g*Math.exp(-C/r),E=C=>b+v(C),N=C=>{const I=v(C),A=E(C);m.done=Math.abs(I)<=u,m.value=m.done?b:A};let k,S;const _=C=>{d(m.value)&&(k=C,S=Ko({keyframes:[m.value,p(m.value)],velocity:S4(E,C,m.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:C=>{let I=!1;return!S&&k===void 0&&(I=!0,N(C),_(C)),k!==void 0&&C>=k?S.next(C-k):(!I&&N(C),m)}}}function zR(e,t,n){const r=[],i=n||Vr.mix||E4,a=e.length-1;for(let s=0;s<a;s++){let o=i(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||Bn:t;o=Ns(l,o)}r.push(o)}return r}function HR(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(Rl(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=zR(t,r,i),l=o.length,u=c=>{if(s&&c<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(c<e[h+1]);h++);const m=ds(e[h],e[h+1],c);return o[h](m)};return n?c=>u(lr(e[0],e[a-1],c)):u}function UR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ds(0,t,r);e.push(yt(n,1,i))}}function VR(e){const t=[0];return UR(t,e.length-1),t}function qR(e,t){return e.map(n=>n*t)}function $R(e,t){return e.map(()=>t||f4).splice(0,e.length-1)}function Ja({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=J_(r)?r.map(Tp):Tp(r),a={done:!1,value:t[0]},s=qR(n&&n.length===t.length?n:VR(t),e),o=HR(s,t,{ease:Array.isArray(i)?i:$R(t,i)});return{calculatedDuration:e,next:l=>(a.value=o(l),a.done=l>=e,a)}}const WR=e=>e!==null;function Ll(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(WR),o=i<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!o||r===void 0?a[o]:r}const GR={decay:x0,inertia:x0,tween:Ja,keyframes:Ja,spring:Ko};function A4(e){typeof e.type=="string"&&(e.type=GR[e.type])}class Zd{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 YR=e=>e/100;class Xo extends Zd{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=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==mn.now()&&this.tick(mn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;A4(t);const{type:n=Ja,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=t;let{keyframes:o}=t;const l=n||Ja;l!==Ja&&typeof o[0]!="number"&&(this.mixKeyframes=Ns(YR,E4(o[0],o[1])),o=[0,100]);const u=l({...t,keyframes:o});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...o].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=Qd(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}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:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:m,repeatDelay:d,type:p,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let E=this.currentTime,N=r;if(h){const C=Math.min(this.currentTime,i)/o;let I=Math.floor(C),A=C%1;!A&&C>=1&&(A=1),A===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(m==="reverse"?(A=1-A,d&&(A-=d/o)):m==="mirror"&&(N=s)),E=lr(0,1,A)*o}let k;v?(this.delayState.value=c[0],k=this.delayState):k=N.next(E),a&&!v&&(k.value=a(k.value));let{done:S}=k;!v&&l!==null&&(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return _&&p!==x0&&(k.value=Ll(c,this.options,x,this.speed)),g&&g(k.value),_&&this.finish(),k}then(t,n){return this.finished.then(t,n)}get duration(){return jn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+jn(t)}get time(){return jn(this.currentTime)}set time(t){t=Cn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return S4(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(mn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=jn(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=_R,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(a=(i=this.options).onPlay)==null||a.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(mn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}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){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function KR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const hi=e=>e*180/Math.PI,b0=e=>{const t=hi(Math.atan2(e[1],e[0]));return y0(t)},XR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:b0,rotateZ:b0,skewX:e=>hi(Math.atan(e[1])),skewY:e=>hi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},y0=e=>(e=e%360,e<0&&(e+=360),e),_p=b0,Rp=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Lp=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),QR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Rp,scaleY:Lp,scale:e=>(Rp(e)+Lp(e))/2,rotateX:e=>y0(hi(Math.atan2(e[6],e[5]))),rotateY:e=>y0(hi(Math.atan2(-e[2],e[0]))),rotateZ:_p,rotate:_p,skewX:e=>hi(Math.atan(e[4])),skewY:e=>hi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function v0(e){return e.includes("scale")?1:0}function w0(e,t){if(!e||e==="none")return v0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=QR,i=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=XR,i=o}if(!i)return v0(t);const a=r[t],s=i[1].split(",").map(JR);return typeof a=="function"?a(s):s[a]}const ZR=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return w0(n,t)};function JR(e){return parseFloat(e.trim())}const pa=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ga=new Set([...pa,"pathRotation"]),Dp=e=>e===ma||e===je,eL=new Set(["x","y","z"]),tL=pa.filter(e=>!eL.has(e));function nL(e){const t=[];return tL.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Br={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>w0(t,"x"),y:(e,{transform:t})=>w0(t,"y")};Br.translateX=Br.x;Br.translateY=Br.y;const vi=new Set;let k0=!1,E0=!1,T0=!1;function C4(){if(E0){const e=Array.from(vi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=nL(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,s])=>{var o;(o=r.getValue(a))==null||o.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}E0=!1,k0=!1,vi.forEach(e=>e.complete(T0)),vi.clear()}function N4(){vi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(E0=!0)})}function rL(){T0=!0,N4(),C4(),T0=!1}class Jd{constructor(t,n,r,i,a,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(vi.add(this),k0||(k0=!0,vt.read(N4),vt.resolveKeyframes(C4))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),s=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const o=r.readValue(n,s);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=s),i&&a===void 0&&i.set(t[0])}KR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),vi.delete(this)}cancel(){this.state==="scheduled"&&(vi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const iL=e=>e.startsWith("--");function M4(e,t,n){iL(t)?e.style.setProperty(t,n):e.style[t]=n}const aL={};function I4(e,t){const n=r4(e);return()=>aL[t]??n()}const sL=I4(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),_4=I4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ba=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Pp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ba([0,.65,.55,1]),circOut:Ba([.55,0,1,.45]),backIn:Ba([.31,.01,.66,-.59]),backOut:Ba([.33,1.53,.69,.99])};function R4(e,t){if(e)return typeof e=="function"?_4()?T4(e,t):"ease-out":m4(e)?Ba(e):Array.isArray(e)?e.map(n=>R4(n,t)||Pp.easeOut):Pp[e]}function oL(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:s="loop",ease:o="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const h=R4(o,i);Array.isArray(h)&&(c.easing=h);const m={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(c,m)}function L4(e){return typeof e=="function"&&"applyToOptions"in e}function lL({type:e,...t}){return L4(e)&&_4()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class D4 extends Zd{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:a,allowFlatten:s=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=s,this.options=t,Rl(typeof t.type!="string");const u=lL(t);this.animation=oL(n,r,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const c=Ll(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(c),M4(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}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(){var n,r,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return jn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+jn(t)}get time(){return jn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Cn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&sL()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Bn):i(this)}}const P4={anticipate:c4,backInOut:u4,circInOut:h4};function uL(e){return e in P4}function cL(e){typeof e.ease=="string"&&uL(e.ease)&&(e.ease=P4[e.ease])}const rc=10;class dL extends D4{constructor(t){cL(t),A4(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:a,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const o=new Xo({...s,autoplay:!1}),l=Math.max(rc,mn.now()-this.startTime),u=lr(0,rc,l-rc),c=o.sample(l).value,{name:h}=this.options;a&&h&&M4(a,h,c),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,c,u),o.stop()}}const Op=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Yn.test(e)||e==="0")&&!e.startsWith("url("));function hL(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 fL(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],s=Op(i,t),o=Op(a,t);return!s||!o?!1:hL(e)||(n==="spring"||L4(n))&&r}function S0(e){e.duration=0,e.type="keyframes"}const O4=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),mL=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function pL(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&mL.test(e[t]))return!0;return!1}const gL=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),xL=r4(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function bL(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:s,keyframes:o}=e,l=(h=t==null?void 0:t.owner)==null?void 0:h.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:c}=t.owner.getProps();return xL()&&n&&(O4.has(n)||gL.has(n)&&pL(o))&&(n!=="transform"||!c)&&!u&&!r&&i!=="mirror"&&a!==0&&s!=="inertia"}const yL=40;class vL extends Zd{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",keyframes:o,name:l,motionValue:u,element:c,...h}){var p;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=mn.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:s,name:l,motionValue:u,element:c,...h},d=(c==null?void 0:c.KeyframeResolver)||Jd;this.keyframeResolver=new d(o,(g,x,b)=>this.onKeyframesResolved(g,x,m,!b),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,n,r,i){var b,v;this.keyframeResolver=void 0;const{name:a,type:s,velocity:o,delay:l,isHandoff:u,onUpdate:c}=r;this.resolvedAt=mn.now();let h=!0;fL(t,a,s,o)||(h=!1,(Vr.instantAnimations||!l)&&(c==null||c(Ll(t,r,n))),t[0]=t[t.length-1],S0(r),r.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>yL?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},p=h&&!u&&bL(d),g=(v=(b=d.motionValue)==null?void 0:b.owner)==null?void 0:v.current;let x;if(p)try{x=new dL({...d,element:g})}catch{x=new Xo(d)}else x=new Xo(d);x.finished.then(()=>{this.notifyFinished()}).catch(Bn),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),rL()),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(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function j4(e,t,n,r=0,i=1){const a=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),s=e.size,o=(s-1)*r;return typeof n=="function"?n(a,s):i===1?a*r:o-a*r}const jp=30,wL=e=>!isNaN(parseFloat(e));class kL{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const i=mn.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=mn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wL(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 qd);const r=this.events[t].add(n);return t==="change"?()=>{r(),vt.read(()=>{this.events.change.getSize()||this.stop()})}:r}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,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.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=mn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>jp)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,jp);return i4(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(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function na(e,t){return new kL(e,t)}function B4(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function eh(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?B4(n,e):n}const EL={type:"spring",stiffness:500,damping:25,restSpeed:10},TL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),SL={type:"keyframes",duration:.8},AL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},CL=(e,{keyframes:t})=>t.length>2?SL:ga.has(e)?e.startsWith("scale")?TL(t[1]):EL:AL,NL=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ML(e){for(const t in e)if(!NL.has(t))return!0;return!1}const th=(e,t,n,r={},i,a)=>s=>{const o=eh(r,e)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Cn(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:m=>{t.set(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:a?void 0:i};ML(o)||Object.assign(c,CL(e,c)),c.duration&&(c.duration=Cn(c.duration)),c.repeatDelay&&(c.repeatDelay=Cn(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(S0(c),c.delay===0&&(h=!0)),(Vr.instantAnimations||Vr.skipAnimations||i!=null&&i.shouldSkipAnimations||o.skipAnimations)&&(h=!0,S0(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,h&&!a&&t.get()!==void 0){const m=Ll(c.keyframes,o);if(m!==void 0){vt.update(()=>{c.onUpdate(m),c.onComplete()});return}}return o.isSync?new Xo(c):new vL(c)},IL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _L(e){const t=IL.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function F4(e,t,n=1){const[r,i]=_L(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const s=a.trim();return e4(s)?parseFloat(s):s}return Gd(i)?F4(i,t,n+1):i}function Bp(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function nh(e,t,n,r){if(typeof t=="function"){const[i,a]=Bp(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=Bp(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function wi(e,t,n){const r=e.getProps();return nh(r,t,n!==void 0?n:r.custom,e)}const z4=new Set(["width","height","top","left","right","bottom",...pa]),A0=e=>Array.isArray(e);function RL(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,na(n))}function LL(e){return A0(e)?e[e.length-1]||0:e}function DL(e,t){const n=wi(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const s in a){const o=LL(a[s]);RL(e,s,o)}}const Jt=e=>!!(e&&e.getVelocity);function PL(e){return!!(Jt(e)&&e.add)}function C0(e,t){const n=e.getValue("willChange");if(PL(n))return n.add(t);if(!n&&Vr.WillChange){const r=new Vr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function rh(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const OL="framerAppearId",H4="data-"+rh(OL);function U4(e){return e.props[H4]}function jL({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function V4(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:s,...o}=t;const l=e.getDefaultTransition();a=a?B4(a,l):l;const u=a==null?void 0:a.reduceMotion,c=a==null?void 0:a.skipAnimations;r&&(a=r);const h=[],m=i&&e.animationState&&e.animationState.getState()[i],d=a==null?void 0:a.path;d&&d.animateVisualElement(e,o,a,n,h);for(const p in o){const g=e.getValue(p,e.latestValues[p]??null),x=o[p];if(x===void 0||m&&jL(m,p))continue;const b={delay:n,...eh(a||{},p)};c&&(b.skipAnimations=!0);const v=g.get();if(v!==void 0&&!g.isAnimating()&&!Array.isArray(x)&&x===v&&!b.velocity){vt.update(()=>g.set(x));continue}let E=!1;if(window.MotionHandoffAnimation){const S=U4(e);if(S){const _=window.MotionHandoffAnimation(S,p,vt);_!==null&&(b.startTime=_,E=!0)}}C0(e,p);const N=u??e.shouldReduceMotion;g.start(th(p,g,x,N&&z4.has(p)?{type:!1}:b,e,E));const k=g.animation;k&&h.push(k)}if(s){const p=()=>vt.update(()=>{s&&DL(e,s)});h.length?Promise.all(h).then(p):p()}return h}function N0(e,t,n={}){var l;const r=wi(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const a=r?()=>Promise.all(V4(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:m}=i;return BL(e,t,u,c,h,m,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[u,c]=o==="beforeChildren"?[a,s]:[s,a];return u().then(()=>c())}else return Promise.all([a(),s(n.delay)])}function BL(e,t,n=0,r=0,i=0,a=1,s){const o=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),o.push(N0(l,t,{...s,delay:n+(typeof r=="function"?0:r)+j4(e.variantChildren,l,r,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}function FL(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>N0(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=N0(e,t,n);else{const i=typeof t=="function"?wi(e,t,n.custom):t;r=Promise.all(V4(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const zL={test:e=>e==="auto",parse:e=>e},q4=e=>t=>t.test(e),$4=[ma,je,sr,gr,hR,dR,zL],Fp=e=>$4.find(q4(e));function HL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||n4(e):!0}const UL=new Set(["brightness","contrast","saturate","opacity"]);function VL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yd)||[];if(!r)return e;const i=n.replace(r,"");let a=UL.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const qL=/\b([a-z-]*)\(.*?\)/gu,M0={...Yn,getAnimatableNone:e=>{const t=e.match(qL);return t?t.map(VL).join(" "):e}},I0={...Yn,getAnimatableNone:e=>{const t=Yn.parse(e);return Yn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},zp={...ma,transform:Math.round},$L={rotate:gr,pathRotation:gr,rotateX:gr,rotateY:gr,rotateZ:gr,scale:so,scaleX:so,scaleY:so,scaleZ:so,skew:gr,skewX:gr,skewY:gr,distance:je,translateX:je,translateY:je,translateZ:je,x:je,y:je,z:je,perspective:je,transformPerspective:je,opacity:hs,originX:Ap,originY:Ap,originZ:je},Qo={borderWidth:je,borderTopWidth:je,borderRightWidth:je,borderBottomWidth:je,borderLeftWidth:je,borderRadius:je,borderTopLeftRadius:je,borderTopRightRadius:je,borderBottomRightRadius:je,borderBottomLeftRadius:je,width:je,maxWidth:je,height:je,maxHeight:je,top:je,right:je,bottom:je,left:je,inset:je,insetBlock:je,insetBlockStart:je,insetBlockEnd:je,insetInline:je,insetInlineStart:je,insetInlineEnd:je,padding:je,paddingTop:je,paddingRight:je,paddingBottom:je,paddingLeft:je,paddingBlock:je,paddingBlockStart:je,paddingBlockEnd:je,paddingInline:je,paddingInlineStart:je,paddingInlineEnd:je,margin:je,marginTop:je,marginRight:je,marginBottom:je,marginLeft:je,marginBlock:je,marginBlockStart:je,marginBlockEnd:je,marginInline:je,marginInlineStart:je,marginInlineEnd:je,fontSize:je,backgroundPositionX:je,backgroundPositionY:je,...$L,zIndex:zp,fillOpacity:hs,strokeOpacity:hs,numOctaves:zp},WL={...Qo,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:M0,WebkitFilter:M0,mask:I0,WebkitMask:I0},W4=e=>WL[e],GL=new Set([M0,I0]);function G4(e,t){let n=W4(e);return GL.has(n)||(n=Yn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const YL=new Set(["auto","none","0"]);function KL(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!YL.has(a)&&ta(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=G4(n,i)}class XL extends Jd{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),Gd(h))){const m=F4(h,n.current);m!==void 0&&(t[c]=m),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!z4.has(r)||t.length!==2)return;const[i,a]=t,s=Fp(i),o=Fp(a),l=Sp(i),u=Sp(a);if(l!==u&&Br[r]){this.needsMeasurement=!0;return}if(s!==o)if(Dp(s)&&Dp(o))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else Br[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||HL(t[i]))&&r.push(i);r.length&&KL(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Br[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var o;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,s=r[a];r[a]=Br[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const ih=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Y4(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const _0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ko(e){return t4(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:ah}=p4(queueMicrotask,!1),Vn={x:!1,y:!1};function K4(){return Vn.x||Vn.y}function QL(e){return e==="x"||e==="y"?Vn[e]?null:(Vn[e]=!0,()=>{Vn[e]=!1}):Vn.x||Vn.y?null:(Vn.x=Vn.y=!0,()=>{Vn.x=Vn.y=!1})}function X4(e,t){const n=Y4(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function ZL(e){return!(e.pointerType==="touch"||K4())}function JL(e,t,n={}){const[r,i,a]=X4(e,n);return r.forEach(s=>{let o=!1,l=!1,u;const c=()=>{s.removeEventListener("pointerleave",p)},h=x=>{u&&(u(x),u=void 0),c()},m=x=>{o=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),l&&(l=!1,h(x))},d=()=>{o=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},p=x=>{if(x.pointerType!=="touch"){if(o){l=!0;return}h(x)}},g=x=>{if(!ZL(x))return;l=!1;const b=t(s,x);typeof b=="function"&&(u=b,s.addEventListener("pointerleave",p,i))};s.addEventListener("pointerenter",g,i),s.addEventListener("pointerdown",d,i)}),a}const Q4=(e,t)=>t?e===t?!0:Q4(e,t.parentElement):!1,sh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,eD=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function tD(e){return eD.has(e.tagName)||e.isContentEditable===!0}const nD=new Set(["INPUT","SELECT","TEXTAREA"]);function rD(e){return nD.has(e.tagName)||e.isContentEditable===!0}const Eo=new WeakSet;function Hp(e){return t=>{t.key==="Enter"&&e(t)}}function ic(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const iD=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Hp(()=>{if(Eo.has(n))return;ic(n,"down");const i=Hp(()=>{ic(n,"up")}),a=()=>ic(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Up(e){return sh(e)&&!K4()}const Vp=new WeakSet;function aD(e,t,n={}){const[r,i,a]=X4(e,n),s=o=>{const l=o.currentTarget;if(!Up(o)||Vp.has(o))return;Eo.add(l),n.stopPropagation&&Vp.add(o);const u=t(l,o),c={...i,capture:!0},h=(p,g)=>{window.removeEventListener("pointerup",m,c),window.removeEventListener("pointercancel",d,c),Eo.has(l)&&Eo.delete(l),Up(p)&&typeof u=="function"&&u(p,{success:g})},m=p=>{h(p,l===window||l===document||n.useGlobalTarget||Q4(l,p.target))},d=p=>{h(p,!1)};window.addEventListener("pointerup",m,c),window.addEventListener("pointercancel",d,c)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",s,i),ko(o)&&(o.addEventListener("focus",u=>iD(u,i)),!tD(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),a}function oh(e){return t4(e)&&"ownerSVGElement"in e}const To=new WeakMap;let Lr;const Z4=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:oh(r)&&"getBBox"in r?r.getBBox()[t]:r[n],sD=Z4("inline","width","offsetWidth"),oD=Z4("block","height","offsetHeight");function lD({target:e,borderBoxSize:t}){var n;(n=To.get(e))==null||n.forEach(r=>{r(e,{get width(){return sD(e,t)},get height(){return oD(e,t)}})})}function uD(e){e.forEach(lD)}function cD(){typeof ResizeObserver>"u"||(Lr=new ResizeObserver(uD))}function dD(e,t){Lr||cD();const n=Y4(e);return n.forEach(r=>{let i=To.get(r);i||(i=new Set,To.set(r,i)),i.add(t),Lr==null||Lr.observe(r)}),()=>{n.forEach(r=>{const i=To.get(r);i==null||i.delete(t),i!=null&&i.size||Lr==null||Lr.unobserve(r)})}}const So=new Set;let Vi;function hD(){Vi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};So.forEach(t=>t(e))},window.addEventListener("resize",Vi)}function fD(e){return So.add(e),Vi||hD(),()=>{So.delete(e),!So.size&&typeof Vi=="function"&&(window.removeEventListener("resize",Vi),Vi=void 0)}}function qp(e,t){return typeof e=="function"?fD(e):dD(e,t)}function mD(e){return oh(e)&&e.tagName==="svg"}const pD=[...$4,Ft,Yn],gD=e=>pD.find(q4(e)),$p=()=>({translate:0,scale:1,origin:0,originPoint:0}),qi=()=>({x:$p(),y:$p()}),Wp=()=>({min:0,max:0}),Vt=()=>({x:Wp(),y:Wp()}),xD=new WeakMap;function Dl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function fs(e){return typeof e=="string"||Array.isArray(e)}const lh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],uh=["initial",...lh];function Pl(e){return Dl(e.animate)||uh.some(t=>fs(e[t]))}function J4(e){return!!(Pl(e)||e.variants)}function bD(e,t,n){for(const r in t){const i=t[r],a=n[r];if(Jt(i))e.addValue(r,i);else if(Jt(a))e.addValue(r,na(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,na(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const R0={current:null},e3={current:!1},yD=typeof window<"u";function vD(){if(e3.current=!0,!!yD)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>R0.current=e.matches;e.addEventListener("change",t),t()}else R0.current=!1}const Gp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zo={};function t3(e){Zo=e}function wD(){return Zo}class kD{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:s,visualState:o},l={}){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=Jd,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 d=mn.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,vt.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!s,this.isControllingVariants=Pl(n),this.isVariantNode=J4(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in m){const p=m[d];u[d]!==void 0&&Jt(p)&&p.set(u[d])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,xD.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((i,a)=>this.bindToMotionValue(a,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(e3.current||vD(),this.shouldReduceMotion=R0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),qr(this.notifyUpdate),qr(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.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&&O4.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:o,times:l,ease:u,duration:c}=n.accelerate,h=new D4({element:this.current,name:t,keyframes:o,times:l,ease:u,duration:Cn(c)}),m=s(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=ga.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&vt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a&&a()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Zo){const n=Zo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Vt()}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 r=0;r<Gp.length;r++){const i=Gp[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,s=t[a];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=bD(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 r=this.values.get(t);n!==r&&(r&&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 r=this.values.get(t);return r===void 0&&n!==void 0&&(r=na(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(e4(r)||n4(r))?r=parseFloat(r):!gD(r)&&Yn.test(n)&&(r=G4(t,n)),this.setBaseTarget(t,Jt(r)?r.get():r)),Jt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=nh(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Jt(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ah.render(this.render)}}class n3 extends kD{constructor(){super(...arguments),this.KeyframeResolver=XL}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Yr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function r3({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ED({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function TD(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ac(e){return e===void 0||e===1}function L0({scale:e,scaleX:t,scaleY:n}){return!ac(e)||!ac(t)||!ac(n)}function ui(e){return L0(e)||i3(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function i3(e){return Yp(e.x)||Yp(e.y)}function Yp(e){return e&&e!=="0%"}function Jo(e,t,n){const r=e-n,i=t*r;return n+i}function Kp(e,t,n,r,i){return i!==void 0&&(e=Jo(e,i,r)),Jo(e,n,r)+t}function D0(e,t=0,n=1,r,i){e.min=Kp(e.min,t,n,r,i),e.max=Kp(e.max,t,n,r,i)}function a3(e,{x:t,y:n}){D0(e.x,t.translate,t.scale,t.originPoint),D0(e.y,n.translate,n.scale,n.originPoint)}const Xp=.999999999999,Qp=1.0000000000001;function SD(e,t,n,r=!1){var o;const i=n.length;if(!i)return;t.x=t.y=1;let a,s;for(let l=0;l<i;l++){a=n[l],s=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(nr(e.x,-a.scroll.offset.x),nr(e.y,-a.scroll.offset.y)),s&&(t.x*=s.x.scale,t.y*=s.y.scale,a3(e,s)),r&&ui(a.latestValues)&&Ao(e,a.latestValues,(o=a.layout)==null?void 0:o.layoutBox))}t.x<Qp&&t.x>Xp&&(t.x=1),t.y<Qp&&t.y>Xp&&(t.y=1)}function nr(e,t){e.min+=t,e.max+=t}function Zp(e,t,n,r,i=.5){const a=yt(e.min,e.max,i);D0(e,t,n,a,r)}function Jp(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Ao(e,t,n){const r=n??e;Zp(e.x,Jp(t.x,r.x),t.scaleX,t.scale,t.originX),Zp(e.y,Jp(t.y,r.y),t.scaleY,t.scale,t.originY)}function s3(e,t){return r3(TD(e.getBoundingClientRect(),t))}function AD(e,t,n){const r=s3(e,n),{scroll:i}=t;return i&&(nr(r.x,i.offset.x),nr(r.y,i.offset.y)),r}const CD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ND=pa.length;function MD(e,t,n){let r="",i=!0;for(let s=0;s<ND;s++){const o=pa[s],l=e[o];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(o.startsWith("scale")?1:0);else{const c=parseFloat(l);u=o.startsWith("scale")?c===1:c===0}if(!u||n){const c=_0(l,Qo[o]);if(!u){i=!1;const h=CD[o]||o;r+=`${h}(${c}) `}n&&(t[o]=c)}}const a=e.pathRotation;return a&&(i=!1,r+=`rotate(${_0(a,Qo.pathRotation)}) `),r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function ch(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let s=!1,o=!1;for(const l in t){const u=t[l];if(ga.has(l)){s=!0;continue}else if(x4(l)){i[l]=u;continue}else{const c=_0(u,Qo[l]);l.startsWith("origin")?(o=!0,a[l]=c):r[l]=c}}if(t.transform||(s||n?r.transform=MD(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;r.transformOrigin=`${l} ${u} ${c}`}}function o3(e,{style:t,vars:n},r,i){const a=e.style;let s;for(s in t)a[s]=t[s];i==null||i.applyProjectionStyles(a,r);for(s in n)a.setProperty(s,n[s])}function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ra={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(je.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),r=e1(e,t.target.y);return`${n}% ${r}%`}},ID={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Yn.parse(e);if(i.length>5)return r;const a=Yn.createTransformer(e),s=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=o,i[1+s]/=l;const u=yt(o,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),a(i)}},P0={borderRadius:{...Ra,applyTo:[...ih]},borderTopLeftRadius:Ra,borderTopRightRadius:Ra,borderBottomLeftRadius:Ra,borderBottomRightRadius:Ra,boxShadow:ID};function l3(e,{layout:t,layoutId:n}){return ga.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!P0[e]||e==="opacity")}function dh(e,t,n){var s;const r=e.style,i=t==null?void 0:t.style,a={};if(!r)return a;for(const o in r)(Jt(r[o])||i&&Jt(i[o])||l3(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(a[o]=r[o]);return a}function _D(e){return window.getComputedStyle(e)}class RD extends n3{constructor(){super(...arguments),this.type="html",this.renderInstance=o3}mount(t){Rl(!!t.style),super.mount(t)}readValueFromInstance(t,n){var r;if(ga.has(n))return(r=this.projection)!=null&&r.isProjecting?v0(n):ZR(t,n);{const i=_D(t),a=(x4(n)?i.getPropertyValue(n):i[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return s3(t,n)}build(t,n,r){ch(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return dh(t,n,r)}}const LD={offset:"stroke-dashoffset",array:"stroke-dasharray"},DD={offset:"strokeDashoffset",array:"strokeDasharray"};function PD(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?LD:DD;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const u3=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function c3(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:s=0,...o},l,u,c){if(ch(e,o,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;for(const d of u3)h[d]!==void 0&&(m[d]=h[d],delete h[d]);(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&PD(h,i,a,s,!1)}const d3=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"]),h3=e=>typeof e=="string"&&e.toLowerCase()==="svg";function OD(e,t,n,r){o3(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(d3.has(i)?i:rh(i),t.attrs[i])}function f3(e,t,n){const r=dh(e,t,n);for(const i in e)if(Jt(e[i])||Jt(t[i])){const a=pa.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}class jD extends n3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Vt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ga.has(n)){const r=W4(n);return r&&r.default||0}if(u3.includes(n)){const i=getComputedStyle(t)[n];if(typeof i=="string"&&i)return i.trim()}return n=d3.has(n)?n:rh(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return f3(t,n,r)}build(t,n,r){c3(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){OD(t,n,r,i)}mount(t){this.isSVGTag=h3(t.tagName),super.mount(t)}}const BD=uh.length;function m3(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?m3(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<BD;n++){const r=uh[n],i=e.props[r];(fs(i)||i===!1)&&(t[r]=i)}return t}function p3(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const FD=[...lh].reverse(),zD=lh.length;function HD(e){return t=>Promise.all(t.map(({animation:n,options:r})=>FL(e,n,r)))}function UD(e){let t=HD(e),n=t1(),r=!0,i=!1;const a=u=>(c,h)=>{var d;const m=wi(e,h,u==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){const{transition:p,transitionEnd:g,...x}=m;c={...c,...x,...g}}return c};function s(u){t=u(e)}function o(u){const{props:c}=e,h=m3(e.parent)||{},m=[],d=new Set;let p={},g=1/0;for(let b=0;b<zD;b++){const v=FD[b],E=n[v],N=c[v]!==void 0?c[v]:h[v],k=fs(N),S=v===u?E.isActive:null;S===!1&&(g=b);let _=N===h[v]&&N!==c[v]&&k;if(_&&(r||i)&&e.manuallyAnimateOnMount&&(_=!1),E.protectedKeys={...p},!E.isActive&&S===null||!N&&!E.prevProp||Dl(N)||typeof N=="boolean")continue;if(v==="exit"&&E.isActive&&S!==!0){E.prevResolvedValues&&(p={...p,...E.prevResolvedValues});continue}const C=VD(E.prevProp,N);let I=C||v===u&&E.isActive&&!_&&k||b>g&&k,A=!1;const R=Array.isArray(N)?N:[N];let L=R.reduce(a(v),{});S===!1&&(L={});const{prevResolvedValues:z={}}=E,j={...z,...L},B=V=>{I=!0,d.has(V)&&(A=!0,d.delete(V)),E.needsAnimating[V]=!0;const Z=e.getValue(V);Z&&(Z.liveStyle=!1)};for(const V in j){const Z=L[V],O=z[V];if(p.hasOwnProperty(V))continue;let X=!1;A0(Z)&&A0(O)?X=!p3(Z,O)||C:X=Z!==O,X?Z!=null?B(V):d.add(V):Z!==void 0&&d.has(V)?B(V):E.protectedKeys[V]=!0}E.prevProp=N,E.prevResolvedValues=L,E.isActive&&(p={...p,...L}),(r||i)&&e.blockInitialAnimation&&(I=!1);const H=_&&C;I&&(!H||A)&&m.push(...R.map(V=>{const Z={type:v};if(typeof V=="string"&&(r||i)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:O}=e,X=wi(O,V);if(O.enteringChildren&&X){const{delayChildren:ne}=X.transition||{};Z.delay=j4(O.enteringChildren,e,ne)}}return{animation:V,options:Z}}))}if(d.size){const b={};if(typeof c.initial!="boolean"){const v=wi(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(b.transition=v.transition)}d.forEach(v=>{const E=e.getBaseTarget(v),N=e.getValue(v);N&&(N.liveStyle=!0),b[v]=E??null}),m.push({animation:b})}let x=!!m.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,i=!1,x?t(m):Promise.resolve()}function l(u,c){var m;if(n[u].isActive===c)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(u,c)}),n[u].isActive=c;const h=o(u);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=t1(),i=!0}}}function VD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!p3(t,e):!1}function ai(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function t1(){return{animate:ai(!0),whileInView:ai(),whileHover:ai(),whileTap:ai(),whileDrag:ai(),whileFocus:ai(),exit:ai()}}function O0(e,t){e.min=t.min,e.max=t.max}function Un(e,t){O0(e.x,t.x),O0(e.y,t.y)}function n1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const g3=1e-4,qD=1-g3,$D=1+g3,x3=.01,WD=0-x3,GD=0+x3;function pn(e){return e.max-e.min}function YD(e,t,n){return Math.abs(e-t)<=n}function r1(e,t,n,r=.5){e.origin=r,e.originPoint=yt(t.min,t.max,e.origin),e.scale=pn(n)/pn(t),e.translate=yt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=qD&&e.scale<=$D||isNaN(e.scale))&&(e.scale=1),(e.translate>=WD&&e.translate<=GD||isNaN(e.translate))&&(e.translate=0)}function es(e,t,n,r){r1(e.x,t.x,n.x,r?r.originX:void 0),r1(e.y,t.y,n.y,r?r.originY:void 0)}function i1(e,t,n,r=0){const i=r?yt(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+pn(t)}function KD(e,t,n,r){i1(e.x,t.x,n.x,r==null?void 0:r.x),i1(e.y,t.y,n.y,r==null?void 0:r.y)}function a1(e,t,n,r=0){const i=r?yt(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+pn(t)}function el(e,t,n,r){a1(e.x,t.x,n.x,r==null?void 0:r.x),a1(e.y,t.y,n.y,r==null?void 0:r.y)}function s1(e,t,n,r,i){return e-=t,e=Jo(e,1/n,r),i!==void 0&&(e=Jo(e,1/i,r)),e}function XD(e,t=0,n=1,r=.5,i,a=e,s=e){if(sr.test(t)&&(t=parseFloat(t),t=yt(s.min,s.max,t/100)-s.min),typeof t!="number")return;let o=yt(a.min,a.max,r);e===a&&(o-=t),e.min=s1(e.min,t,n,o,i),e.max=s1(e.max,t,n,o,i)}function o1(e,t,[n,r,i],a,s){XD(e,t[n],t[r],t[i],t.scale,a,s)}const QD=["x","scaleX","originX"],ZD=["y","scaleY","originY"];function l1(e,t,n,r){o1(e.x,t,QD,n?n.x:void 0,r?r.x:void 0),o1(e.y,t,ZD,n?n.y:void 0,r?r.y:void 0)}function u1(e){return e.translate===0&&e.scale===1}function b3(e){return u1(e.x)&&u1(e.y)}function c1(e,t){return e.min===t.min&&e.max===t.max}function JD(e,t){return c1(e.x,t.x)&&c1(e.y,t.y)}function d1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function y3(e,t){return d1(e.x,t.x)&&d1(e.y,t.y)}function h1(e){return pn(e.x)/pn(e.y)}function f1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Jn(e){return[e("x"),e("y")]}function eP(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||a||s)&&(r=`translate3d(${i}px, ${a}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,pathRotation:h,rotateX:m,rotateY:d,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),d&&(r+=`rotateY(${d}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const tP=ih.length,m1=e=>typeof e=="string"?parseFloat(e):e,p1=e=>typeof e=="number"||je.test(e);function nP(e,t,n,r,i,a){i?(e.opacity=yt(0,n.opacity??1,rP(r)),e.opacityExit=yt(t.opacity??1,0,iP(r))):a&&(e.opacity=yt(t.opacity??1,n.opacity??1,r));for(let s=0;s<tP;s++){const o=ih[s];let l=g1(t,o),u=g1(n,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||p1(l)===p1(u)?(e[o]=Math.max(yt(m1(l),m1(u),r),0),(sr.test(u)||sr.test(l))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=yt(t.rotate||0,n.rotate||0,r))}function g1(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const rP=v3(0,.5,d4),iP=v3(.5,.95,Bn);function v3(e,t,n){return r=>r<e?0:r>t?1:n(ds(e,t,r))}function aP(e,t,n){const r=Jt(e)?e:na(e);return r.start(th("",r,t,n)),r.animation}function ms(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const sP=(e,t)=>e.depth-t.depth;class oP{constructor(){this.children=[],this.isDirty=!1}add(t){Vd(this.children,t),this.isDirty=!0}remove(t){Wo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sP),this.isDirty=!1,this.children.forEach(t)}}function lP(e,t){const n=mn.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(qr(r),e(a-t))};return vt.setup(r,!0),()=>qr(r)}function Co(e){return Jt(e)?e.get():e}class uP{constructor(){this.members=[]}add(t){Vd(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(Wo(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Wo(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){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,n){var i;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=r.options,{layoutDependency:s}=t.options;(a===void 0||a!==s)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,a,s;(r=(n=t.options).onExitComplete)==null||r.call(n),(s=(i=t.resumingFrom)==null?void 0:(a=i.options).onExitComplete)==null||s.call(a)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const No={hasAnimatedSinceResize:!0,hasEverUpdated:!1},sc=["","X","Y","Z"],cP=1e3;let dP=0;function oc(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function w3(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=U4(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",vt,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&w3(r)}function k3({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},o=t==null?void 0:t()){this.id=dP++,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(mP),this.nodes.forEach(vP),this.nodes.forEach(wP),this.nodes.forEach(pP)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new oP)}addEventListener(s,o){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new qd),this.eventHandlers.get(s).add(o)}notifyListeners(s,...o){const l=this.eventHandlers.get(s);l&&l.notify(...o)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=oh(s)&&!mD(s),this.instance=s;const{layoutId:o,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),e){let c,h=0;const m=()=>this.root.updateBlockedByResize=!1;vt.read(()=>{h=window.innerWidth}),e(s,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=lP(m,250),No.hasAnimatedSinceResize&&(No.hasAnimatedSinceResize=!1,this.nodes.forEach(y1)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||AP,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=u.getProps(),b=!this.targetLayout||!y3(this.targetLayout,d),v=!h&&m;if(this.options.layoutRoot||this.resumeFrom||v||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const E={...eh(p,"layout"),onPlay:g,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E),this.setAnimationOrigin(c,v,E.path)}else h||y1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qr(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(kP),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&w3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(xP),this.nodes.forEach(x1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(b1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(bP),this.nodes.forEach(yP),this.nodes.forEach(hP),this.nodes.forEach(fP)):this.nodes.forEach(b1),this.clearAllSnapshots();const o=mn.now();Zt.delta=lr(0,1e3/60,o-Zt.timestamp),Zt.timestamp=o,Zt.isProcessing=!0,Zu.update.process(Zt),Zu.preRender.process(Zt),Zu.render.process(Zt),Zt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ah.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(gP),this.sharedNodes.forEach(EP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,vt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!pn(this.snapshot.measuredBox.x)&&!pn(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Vt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(o=!1),o&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!b3(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&this.instance&&(o||ui(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return s&&(l=this.removeTransform(l)),CP(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:s}=this.options;if(!s)return Vt();const o=s.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(NP))){const{scroll:c}=this.root;c&&(nr(o.x,c.offset.x),nr(o.y,c.offset.y))}return o}removeElementScroll(s){var l;const o=Vt();if(Un(o,s),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:m}=c;c!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&Un(o,s),nr(o.x,h.offset.x),nr(o.y,h.offset.y))}return o}applyTransform(s,o=!1,l){var c,h;const u=l||Vt();Un(u,s);for(let m=0;m<this.path.length;m++){const d=this.path[m];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(nr(u.x,-d.scroll.offset.x),nr(u.y,-d.scroll.offset.y)),ui(d.latestValues)&&Ao(u,d.latestValues,(c=d.layout)==null?void 0:c.layoutBox)}return ui(this.latestValues)&&Ao(u,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),u}removeTransform(s){var l;const o=Vt();Un(o,s);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!ui(c.latestValues))continue;let h;c.instance&&(L0(c.latestValues)&&c.updateSnapshot(),h=Vt(),Un(h,c.measurePageBox())),l1(o,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,h)}return ui(this.latestValues)&&l1(o,this.latestValues),o}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Zt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var d;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=Zt.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Vt(),this.targetWithTransforms=Vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),KD(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Un(this.target,this.layout.layoutBox),a3(this.target,this.targetDelta)):Un(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||L0(this.parent.latestValues)||i3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,o,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Vt(),this.relativeTargetOrigin=Vt(),el(this.relativeTargetOrigin,o,l,this.options.layoutAnchor||void 0),Un(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const s=this.getLead(),o=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Zt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;Un(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;SD(this.layoutCorrected,this.treeScale,this.path,o),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Vt());const{target:d}=s;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(n1(this.prevProjectionDelta.x,this.projectionDelta.x),n1(this.prevProjectionDelta.y,this.projectionDelta.y)),es(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!f1(this.projectionDelta.x,this.prevProjectionDelta.x)||!f1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qi(),this.projectionDelta=qi(),this.projectionDeltaWithTransform=qi()}setAnimationOrigin(s,o=!1,l){const u=this.snapshot,c=u?u.latestValues:{},h={...this.latestValues},m=qi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const d=Vt(),p=u?u.source:void 0,g=this.layout?this.layout.source:void 0,x=p!==g,b=this.getStack(),v=!b||b.members.length<=1,E=!!(x&&!v&&this.options.crossfade===!0&&!this.path.some(SP));this.animationProgress=0;let N;const k=l==null?void 0:l.interpolateProjection(s);this.mixTargetDelta=S=>{const _=S/1e3,C=k==null?void 0:k(_);C?(m.x.translate=C.x,m.x.scale=yt(s.x.scale,1,_),m.x.origin=s.x.origin,m.x.originPoint=s.x.originPoint,m.y.translate=C.y,m.y.scale=yt(s.y.scale,1,_),m.y.origin=s.y.origin,m.y.originPoint=s.y.originPoint):(v1(m.x,s.x,_),v1(m.y,s.y,_)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(el(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),TP(this.relativeTarget,this.relativeTargetOrigin,d,_),N&&JD(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=Vt()),Un(N,this.relativeTarget)),x&&(this.animationValues=h,nP(h,c,this.latestValues,_,E,v)),C&&C.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=C.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var o,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(qr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vt.update(()=>{No.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=na(0)),this.motionValue.jump(0,!1),this.currentAnimation=aP(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),s.onUpdate&&s.onUpdate(c)},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(cP),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:c}=s;if(!(!o||!l||!u)){if(this!==s&&this.layout&&u&&E3(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Vt();const h=pn(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+h;const m=pn(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+m}Un(o,l),Ao(o,c),es(this.projectionDeltaWithTransform,this.layoutCorrected,o,c)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new uP),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&oc("z",s,u,this.animationValues);for(let c=0;c<sc.length;c++)oc(`rotate${sc[c]}`,s,u,this.animationValues),oc(`skew${sc[c]}`,s,u,this.animationValues);s.render();for(const c in u)s.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);s.scheduleRender()}applyProjectionStyles(s,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Co(o==null?void 0:o.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Co(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ui(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=eP(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),s.transform=h;const{x:m,y:d}=this.projectionDelta;s.transformOrigin=`${m.origin*100}% ${d.origin*100}% 0`,u.animationValues?s.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:s.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in P0){if(c[p]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:b}=P0[p],v=h==="none"?c[p]:g(c[p],u);if(x){const E=x.length;for(let N=0;N<E;N++)s[x[N]]=v}else b?this.options.visualElement.renderState.vars[p]=v:s[p]=v}this.options.layoutId&&(s.pointerEvents=u===this?Co(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var o;return(o=s.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(x1),this.root.sharedNodes.clear()}}}function hP(e){e.updateLayout()}function fP(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,s=t.source!==e.layout.source;if(a==="size")Jn(h=>{const m=s?t.measuredBox[h]:t.layoutBox[h],d=pn(m);m.min=r[h].min,m.max=m.min+d});else if(a==="x"||a==="y"){const h=a==="x"?"y":"x";O0(s?t.measuredBox[h]:t.layoutBox[h],r[h])}else E3(a,t.layoutBox,r)&&Jn(h=>{const m=s?t.measuredBox[h]:t.layoutBox[h],d=pn(r[h]);m.max=m.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+d)});const o=qi();es(o,r,t.layoutBox);const l=qi();s?es(l,e.applyTransform(i,!0),t.measuredBox):es(l,r,t.layoutBox);const u=!b3(o);let c=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:d}=h;if(m&&d){const p=e.options.layoutAnchor||void 0,g=Vt();el(g,t.layoutBox,m.layoutBox,p);const x=Vt();el(x,r,d.layoutBox,p),y3(g,x)||(c=!0),h.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function mP(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 pP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function gP(e){e.clearSnapshot()}function x1(e){e.clearMeasurements()}function xP(e){e.isLayoutDirty=!0,e.updateLayout()}function b1(e){e.isLayoutDirty=!1}function bP(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function yP(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function y1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function vP(e){e.resolveTargetDelta()}function wP(e){e.calcProjection()}function kP(e){e.resetSkewAndRotation()}function EP(e){e.removeLeadSnapshot()}function v1(e,t,n){e.translate=yt(t.translate,0,n),e.scale=yt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function w1(e,t,n,r){e.min=yt(t.min,n.min,r),e.max=yt(t.max,n.max,r)}function TP(e,t,n,r){w1(e.x,t.x,n.x,r),w1(e.y,t.y,n.y,r)}function SP(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const AP={duration:.45,ease:[.4,0,.1,1]},k1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),E1=k1("applewebkit/")&&!k1("chrome/")?Math.round:Bn;function T1(e){e.min=E1(e.min),e.max=E1(e.max)}function CP(e){T1(e.x),T1(e.y)}function E3(e,t,n){return e==="position"||e==="preserve-aspect"&&!YD(h1(t),h1(n),.2)}function NP(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const MP=k3({attachResizeListener:(e,t)=>ms(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),lc={current:void 0},T3=k3({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lc.current){const e=new MP({});e.mount(window),e.setOptions({layoutScroll:!0}),lc.current=e}return lc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),hh=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function S1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function IP(...e){return t=>{let n=!1;const r=e.map(i=>{const a=S1(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():S1(e[i],null)}}}}function _P(...e){return w.useCallback(IP(...e),e)}class RP extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(ko(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=ko(r)&&r.offsetWidth||0,a=ko(r)&&r.offsetHeight||0,s=getComputedStyle(n),o=this.props.sizeRef.current;o.height=parseFloat(s.height),o.width=parseFloat(s.width),o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left,o.bottom=a-o.height-o.top,o.direction=s.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function LP({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){var m;const s=w.useId(),o=w.useRef(null),l=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=w.useContext(hh),c=a!==!1?((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref):void 0,h=_P(o,c);return w.useInsertionEffect(()=>{const{width:d,height:p,top:g,left:x,right:b,bottom:v,direction:E}=l.current;if(t||a===!1||!o.current||!d||!p)return;const N=E==="rtl",k=n==="left"?N?`right: ${b}`:`left: ${x}`:N?`left: ${x}`:`right: ${b}`,S=r==="bottom"?`bottom: ${v}`:`top: ${g}`;o.current.dataset.motionPopId=s;const _=document.createElement("style");u&&(_.nonce=u);const C=i??document.head;return C.appendChild(_),_.sheet&&_.sheet.insertRule(`
789
+ [data-motion-pop-id="${s}"] {
790
+ position: absolute !important;
791
+ width: ${d}px !important;
792
+ height: ${p}px !important;
793
+ ${k}px !important;
794
+ ${S}px !important;
795
+ }
796
+ `),()=>{var I;(I=o.current)==null||I.removeAttribute("data-motion-pop-id"),C.contains(_)&&C.removeChild(_)}},[t]),f.jsx(RP,{isPresent:t,childRef:o,sizeRef:l,pop:a,children:a===!1?e:w.cloneElement(e,{ref:h})})}const DP=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s,anchorX:o,anchorY:l,root:u})=>{const c=Ud(PP),h=w.useId(),m=w.useRef(n),d=w.useRef(r);$o(()=>{m.current=n,d.current=r});let p=!0,g=w.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:x=>{c.set(x,!0);for(const b of c.values())if(!b)return;r&&r()},register:x=>(c.set(x,!1),()=>{var b;c.delete(x),!m.current&&!c.size&&((b=d.current)==null||b.call(d))})}),[n,c,r]);return a&&p&&(g={...g}),w.useMemo(()=>{c.forEach((x,b)=>c.set(b,!1))},[n]),w.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=f.jsx(LP,{pop:s==="popLayout",isPresent:n,anchorX:o,anchorY:l,root:u,children:e}),f.jsx(_l.Provider,{value:g,children:e})};function PP(){return new Map}function S3(e=!0){const t=w.useContext(_l);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=w.useId();w.useEffect(()=>{if(e)return i(a)},[e]);const s=w.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,s]:[!0]}const oo=e=>e.key||"";function A1(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const OP=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:s=!1,anchorX:o="left",anchorY:l="top",root:u})=>{const[c,h]=S3(s),m=w.useMemo(()=>A1(e),[e]),d=s&&!c?[]:m.map(oo),p=w.useRef(!0),g=w.useRef(m),x=Ud(()=>new Map),b=w.useRef(new Set),[v,E]=w.useState(m),[N,k]=w.useState(m);$o(()=>{s&&!c&&!N.length&&(h==null||h())},[c,s,N.length,h]),$o(()=>{p.current=!1,g.current=m;for(let C=0;C<N.length;C++){const I=oo(N[C]);d.includes(I)?(x.delete(I),b.current.delete(I)):x.get(I)!==!0&&x.set(I,!1)}},[N,d.length,d.join("-")]);const S=[];if(m!==v){let C=[...m];for(let I=0;I<N.length;I++){const A=N[I],R=oo(A);d.includes(R)||(C.splice(I,0,A),S.push(A))}return a==="wait"&&S.length&&(C=S),k(A1(C)),E(m),null}const{forceRender:_}=w.useContext(Hd);return f.jsx(f.Fragment,{children:N.map(C=>{const I=oo(C),A=s&&!c?!1:m===N||d.includes(I),R=()=>{if(b.current.has(I))return;if(x.has(I))b.current.add(I),x.set(I,!0);else return;let L=!0;x.forEach(z=>{z||(L=!1)}),L&&(_==null||_(),k(g.current),s&&(h==null||h()),r&&r())};return f.jsx(DP,{isPresent:A,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:u,onExitComplete:A?void 0:R,anchorX:o,anchorY:l,children:C},I)})})},A3=w.createContext({strict:!1}),C1={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 N1=!1;function jP(){if(N1)return;const e={};for(const t in C1)e[t]={isEnabled:n=>C1[t].some(r=>!!n[r])};t3(e),N1=!0}function C3(){return jP(),wD()}function BP(e){const t=C3();for(const n in e)t[n]={...t[n],...e[n]};t3(t)}const Ol=w.createContext({});function FP(e,t){if(Pl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||fs(n)?n:void 0,animate:fs(r)?r:void 0}}return e.inherit!==!1?t:{}}function zP(e){const{initial:t,animate:n}=FP(e,w.useContext(Ol));return w.useMemo(()=>({initial:t,animate:n}),[M1(t),M1(n)])}function M1(e){return Array.isArray(e)?e.join(" "):e}const fh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function N3(e,t,n){for(const r in t)!Jt(t[r])&&!l3(r,n)&&(e[r]=t[r])}function HP({transformTemplate:e},t){return w.useMemo(()=>{const n=fh();return ch(n,t,e),Object.assign({},n.vars,n.style)},[t])}function UP(e,t){const n=e.style||{},r={};return N3(r,n,e),Object.assign(r,HP(e,t)),r}function VP(e,t){const n={},r=UP(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const M3=()=>({...fh(),attrs:{}});function qP(e,t,n,r){const i=w.useMemo(()=>{const a=M3();return c3(a,t,h3(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};N3(a,e.style,e),i.style={...a,...i.style}}return i}const $P=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 tl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$P.has(e)}function WP(e,t){return e.startsWith("on")?!tl(e):(t==null?void 0:t(e))??!tl(e)}function GP(e,t,n,r){const i={};for(const a in e)a==="values"&&typeof e.values=="object"||Jt(e[a])||(WP(a,r)||n===!0&&tl(a)||!t&&!tl(a)||e.draggable&&a.startsWith("onDrag"))&&(i[a]=e[a]);return i}const YP=["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 mh(e){return typeof e!="string"||e.includes("-")?!1:!!(YP.indexOf(e)>-1||/[A-Z]/u.test(e))}function KP(e,t,n,{latestValues:r},i,a=!1,s,o){const u=(s??mh(e)?qP:VP)(t,r,i,e),c=GP(t,typeof e=="string",a,o),h=e!==w.Fragment?{...c,...u,ref:n}:{},{children:m}=t,d=w.useMemo(()=>Jt(m)?m.get():m,[m]);return w.createElement(e,{...h,children:d})}function XP({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:QP(n,r,i,e),renderState:t()}}function QP(e,t,n,r){const i={},a=r(e,{});for(const m in a)i[m]=Co(a[m]);let{initial:s,animate:o}=e;const l=Pl(e),u=J4(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),o===void 0&&(o=t.animate));let c=n?n.initial===!1:!1;c=c||s===!1;const h=c?o:s;if(h&&typeof h!="boolean"&&!Dl(h)){const m=Array.isArray(h)?h:[h];for(let d=0;d<m.length;d++){const p=nh(e,m[d]);if(p){const{transitionEnd:g,transition:x,...b}=p;for(const v in b){let E=b[v];if(Array.isArray(E)){const N=c?E.length-1:0;E=E[N]}E!==null&&(i[v]=E)}for(const v in g)i[v]=g[v]}}}return i}const I3=e=>(t,n)=>{const r=w.useContext(Ol),i=w.useContext(_l),a=()=>XP(e,t,r,i);return n?a():Ud(a)},ZP=I3({scrapeMotionValuesFromProps:dh,createRenderState:fh}),JP=I3({scrapeMotionValuesFromProps:f3,createRenderState:M3}),eO=Symbol.for("motionComponentSymbol");function tO(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const i=w.useRef(null);return w.useCallback(a=>{var o;a&&((o=e.onMount)==null||o.call(e,a)),t&&(a?t.mount(a):t.unmount());const s=r.current;if(typeof s=="function")if(a){const l=s(a);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):s(a);else s&&(s.current=a)},[t])}const _3=w.createContext({});function zi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function nO(e,t,n,r,i,a){var E,N;const{visualElement:s}=w.useContext(Ol),o=w.useContext(A3),l=w.useContext(_l),u=w.useContext(hh),c=u.reducedMotion,h=u.skipAnimations,m=w.useRef(null),d=w.useRef(!1);r=r||o.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:a}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const p=m.current,g=w.useContext(_3);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&rO(m.current,n,i,g);const x=w.useRef(!1);w.useInsertionEffect(()=>{p&&x.current&&p.update(n,l)});const b=n[H4],v=w.useRef(!!b&&typeof window<"u"&&!((E=window.MotionHandoffIsComplete)!=null&&E.call(window,b))&&((N=window.MotionHasOptimisedAnimation)==null?void 0:N.call(window,b)));return $o(()=>{d.current=!0,p&&(x.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),v.current&&p.animationState&&p.animationState.animateChanges())}),w.useEffect(()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,b)}),v.current=!1),p.enteringChildren=void 0)}),p}function rO(e,t,n,r){const{layoutId:i,layout:a,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:R3(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!s||o&&zi(o),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}function R3(e){if(e)return e.options.allowProjection!==!1?e.projection:R3(e.parent)}function uc(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&BP(r);const a=n?n==="svg":mh(e),s=a?JP:ZP;function o(u,c){let h;const m={...w.useContext(hh),...u,layoutId:iO(u)},{isStatic:d,isValidProp:p}=m,g=zP(u),x=s(u,d);if(!d&&typeof window<"u"){aO();const b=sO(m);h=b.MeasureLayout,g.visualElement=nO(e,x,m,i,b.ProjectionNode,a)}return f.jsxs(Ol.Provider,{value:g,children:[h&&g.visualElement?f.jsx(h,{visualElement:g.visualElement,...m}):null,KP(e,u,tO(x,g.visualElement,c),x,d,t,a,p)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=w.forwardRef(o);return l[eO]=e,l}function iO({layoutId:e}){const t=w.useContext(Hd).id;return t&&e!==void 0?t+"-"+e:e}function aO(e,t){w.useContext(A3).strict}function sO(e){const t=C3(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function oO(e,t){if(typeof Proxy>"u")return uc;const n=new Map,r=(a,s)=>uc(a,s,e,t),i=(a,s)=>r(a,s);return new Proxy(i,{get:(a,s)=>s==="create"?r:(n.has(s)||n.set(s,uc(s,void 0,e,t)),n.get(s))})}const lO=(e,t)=>t.isSVG??mh(e)?new jD(t):new RD(t,{allowProjection:e!==w.Fragment});class uO extends Yr{constructor(t){super(t),t.animationState||(t.animationState=UD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Dl(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(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let cO=0;class dO extends Yr{constructor(){super(...arguments),this.id=cO++,this.isExitComplete=!1}update(){var a;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:s,custom:o}=this.node.getProps();if(typeof s=="string"||typeof s=="object"&&s!==null&&!Array.isArray(s)){const l=wi(this.node,s,o);if(l){const{transition:u,transitionEnd:c,...h}=l;for(const m in h)(a=this.node.getValue(m))==null||a.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.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 hO={animation:{Feature:uO},exit:{Feature:dO}};function _s(e){return{point:{x:e.pageX,y:e.pageY}}}const fO=e=>t=>sh(t)&&e(t,_s(t));function ts(e,t,n,r){return ms(e,t,fO(n),r)}const L3=({current:e})=>e?e.ownerDocument.defaultView:null,I1=(e,t)=>Math.abs(e-t);function mO(e,t){const n=I1(e.x,t.x),r=I1(e.y,t.y);return Math.sqrt(n**2+r**2)}const _1=new Set(["auto","scroll"]);class D3{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:s=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=lo(this.lastRawMoveEventInfo,this.transformPagePoint));const p=cc(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=mO(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;const{point:b}=p,{timestamp:v}=Zt;this.history.push({...b,timestamp:v});const{onStart:E,onMove:N}=this.handlers;g||(E&&E(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=lo(g,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=cc(p.type==="pointercancel"?this.lastMoveEventInfo:lo(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(p,E),b&&b(p,E)},!sh(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const l=_s(t),u=lo(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=Zt;this.history=[{...c,timestamp:h}];const{onSessionStart:m}=n;m&&m(t,cc(u,this.history));const d={passive:!0,capture:!0};this.removeListeners=Ns(ts(this.contextWindow,"pointermove",this.handlePointerMove,d),ts(this.contextWindow,"pointerup",this.handlePointerUp,d),ts(this.contextWindow,"pointercancel",this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(_1.has(r.overflowX)||_1.has(r.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 r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:i.x-n.x,y:i.y-n.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,i),vt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qr(this.updatePoint)}}function lo(e,t){return t?{point:t(e.point)}:e}function R1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cc({point:e},t){return{point:e,delta:R1(e,P3(t)),offset:R1(e,pO(t)),velocity:gO(t,.1)}}function pO(e){return e[0]}function P3(e){return e[e.length-1]}function gO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=P3(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Cn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Cn(t)*2&&(r=e[1]);const a=jn(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const s={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function xO(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?yt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?yt(n,e,r.max):Math.min(e,n)),e}function L1(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 bO(e,{top:t,left:n,bottom:r,right:i}){return{x:L1(e.x,n,i),y:L1(e.y,t,r)}}function D1(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function yO(e,t){return{x:D1(e.x,t.x),y:D1(e.y,t.y)}}function vO(e,t){let n=.5;const r=pn(e),i=pn(t);return i>r?n=ds(t.min,t.max-r,e.min):r>i&&(n=ds(e.min,e.max-i,t.min)),lr(0,1,n)}function wO(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 j0=.35;function kO(e=j0){return e===!1?e=0:e===!0&&(e=j0),{x:P1(e,"left","right"),y:P1(e,"top","bottom")}}function P1(e,t,n){return{min:O1(e,t),max:O1(e,n)}}function O1(e,t){return typeof e=="number"?e:e[t]||0}const EO=new WeakMap;class TO{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=Vt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=h=>{n&&this.snapToCursor(_s(h).point),this.stopAnimation()},s=(h,m)=>{const{drag:d,dragPropagation:p,onDragStart:g}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=QL(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Jn(b=>{let v=this.getAxisMotionValue(b).get()||0;if(sr.test(v)){const{projection:E}=this.visualElement;if(E&&E.layout){const N=E.layout.layoutBox[b];N&&(v=pn(N)*(parseFloat(v)/100))}}this.originPoint[b]=v}),g&&vt.update(()=>g(h,m),!1,!0),C0(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:g,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:b}=m;if(p&&this.currentDirection===null){this.currentDirection=AO(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),x&&vt.update(()=>x(h,m),!1,!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new D3(t,{onSessionStart:a,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:L3(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&vt.postRender(()=>o(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&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,r){const{drag:i}=this.getProps();if(!r||!uo(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=xO(s,this.constraints[t],this.elastic[t])),a.set(s)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,i=this.constraints;t&&zi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=bO(r.layoutBox,t):this.constraints=!1,this.elastic=kO(n),i!==this.constraints&&!zi(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Jn(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=wO(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zi(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const a=AD(r,i.root,this.visualElement.getTransformPagePoint());let s=yO(i.layout.layoutBox,a);if(n){const o=n(ED(s));this.hasMutatedConstraints=!!o,o&&(s=r3(o))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Jn(c=>{if(!uo(c,n,this.currentDirection))return;let h=l&&l[c]||{};(s===!0||s===c)&&(h={min:0,max:0});const m=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return C0(this.visualElement,t),r.start(th(t,r,0,n,this.visualElement,!1))}stopAnimation(){Jn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Jn(n=>{const{drag:r}=this.getProps();if(!uo(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:o}=i.layout.layoutBox[n],l=a.get()||0;a.set(t[n]-yt(s,o,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zi(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Jn(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const l=o.get();i[s]=vO({min:l,max:l},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Jn(s=>{if(!uo(s,t,null))return;const o=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];o.set(yt(l,u,i[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;EO.set(this.visualElement,this);const t=this.visualElement.current,n=ts(t,"pointerdown",u=>{const{drag:c,dragListener:h=!0}=this.getProps(),m=u.target,d=m!==t&&rD(m);c&&h&&!d&&this.start(u)});let r;const i=()=>{const{dragConstraints:u}=this.getProps();zi(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=SO(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,s=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),vt.read(i);const o=ms(window,"resize",()=>this.scalePositionWithinConstraints()),l=a.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Jn(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:s=j0,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:s,dragMomentum:o}}}function j1(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function SO(e,t,n){const r=qp(e,j1(n)),i=qp(t,j1(n));return()=>{r(),i()}}function uo(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function AO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class CO extends Yr{constructor(t){super(t),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new TO(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 dc=e=>(t,n)=>{e&&vt.update(()=>e(t,n),!1,!0)};class NO extends Yr{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(t){this.session=new D3(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:L3(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:dc(t),onStart:dc(n),onMove:dc(r),onEnd:(a,s)=>{delete this.session,i&&vt.postRender(()=>i(a,s))}}}mount(){this.removePointerDownListener=ts(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 hc=!1;class MO extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),hc&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),No.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:s}=r;return s&&(s.isPresent=a,t.layoutDependency!==n&&s.setOptions({...s.options,layoutDependency:n}),hc=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==a?s.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?s.promote():s.relegate()||vt.postRender(()=>{const o=s.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ah.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;hc=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function O3(e){const[t,n]=S3(),r=w.useContext(Hd);return f.jsx(MO,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(_3),isPresent:t,safeToRemove:n})}const IO={pan:{Feature:NO},drag:{Feature:CO,ProjectionNode:T3,MeasureLayout:O3}};function B1(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=r[i];a&&vt.postRender(()=>a(t,_s(t)))}class _O extends Yr{mount(){const{current:t}=this.node;t&&(this.unmount=JL(t,(n,r)=>(B1(this.node,r,"Start"),i=>B1(this.node,i,"End"))))}unmount(){}}class RO extends Yr{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=Ns(ms(this.node.current,"focus",()=>this.onFocus()),ms(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function F1(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=r[i];a&&vt.postRender(()=>a(t,_s(t)))}class LO extends Yr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=aD(t,(i,a)=>(F1(this.node,a,"Start"),(s,{success:o})=>F1(this.node,s,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const B0=new WeakMap,fc=new WeakMap,DO=e=>{const t=B0.get(e.target);t&&t(e)},PO=e=>{e.forEach(DO)};function OO({root:e,...t}){const n=e||document;fc.has(n)||fc.set(n,{});const r=fc.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(PO,{root:e,...t})),r[i]}function jO(e,t,n){const r=OO(t);return B0.set(e,n),r.observe(e),()=>{B0.delete(e),r.unobserve(e)}}const BO={some:0,all:1};class FO extends Yr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:BO[i]},o=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),d=c?h:m;d&&d(u)};this.stopObserver=jO(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(zO(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function zO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const HO={inView:{Feature:FO},tap:{Feature:LO},focus:{Feature:RO},hover:{Feature:_O}},UO={layout:{ProjectionNode:T3,MeasureLayout:O3}},VO={...hO,...HO,...IO,...UO},qO=oO(VO,lO),$O=qO;function WO(e){switch(e){case"correct":return{Icon:Wn,color:"var(--brand)"};case"wrong":return{Icon:ki,color:"var(--warning)"};case"mastery":case"level-up":return{Icon:X1,color:"var(--gold)"};case"unlock":return{Icon:bc,color:"var(--brand)"};case"streak":return{Icon:Q1,color:"var(--review)"};case"energy-full":return{Icon:vc,color:"var(--brand)"};case"exam-pass":return{Icon:Ey,color:"var(--exam)"};case"lesson-complete":return{Icon:s5,color:"var(--gold)"};default:return{Icon:bc,color:"var(--brand)"}}}function GO(){const e=z0(),t=w.useRef(null),n=w.useRef([]),r=w.useRef(0),[i,a]=w.useState(null);return w.useEffect(()=>{if(e)return;const s=t.current;if(!s)return;const o=s.getContext("2d");if(!o)return;const l=()=>{const m=Math.min(window.devicePixelRatio||1,2);s.width=window.innerWidth*m,s.height=window.innerHeight*m,s.style.width=window.innerWidth+"px",s.style.height=window.innerHeight+"px",o.setTransform(m,0,0,m,0,0)};l(),window.addEventListener("resize",l);const u=()=>{o.clearRect(0,0,window.innerWidth,window.innerHeight);const m=n.current;for(let d=m.length-1;d>=0;d--){const p=m[d];if(p.x+=p.vx,p.y+=p.vy,p.vy+=.25,p.vx*=.99,p.rot+=p.vr,p.life--,p.life<=0){m.splice(d,1);continue}const g=Math.min(1,p.life/p.maxLife);o.save(),o.globalAlpha=g,o.translate(p.x,p.y),o.rotate(p.rot),o.fillStyle=p.color,p.shape==="circle"?(o.beginPath(),o.arc(0,0,p.size,0,Math.PI*2),o.fill()):o.fillRect(-p.size/2,-p.size/2,p.size,p.size*.6),o.restore()}r.current=m.length>0?requestAnimationFrame(u):0},h=Ih(m=>{var b,v;const d=hy(m.kind),p=Math.round(d.particles*(m.intensity??1)),g=((b=m.origin)==null?void 0:b.x)??window.innerWidth/2,x=((v=m.origin)==null?void 0:v.y)??window.innerHeight/2;for(let E=0;E<p;E++){const N=Math.PI*2*E/p+Math.random()*.3,k=3+Math.random()*6,S=d.durationMs/16*(.7+Math.random()*.5);n.current.push({x:g,y:x,vx:Math.cos(N)*k,vy:Math.sin(N)*k-2,life:S,maxLife:S,color:d.colors[E%d.colors.length],size:4+Math.random()*5,rot:Math.random()*Math.PI,vr:(Math.random()-.5)*.3,shape:Math.random()<.5?"rect":"circle"})}r.current===0&&(r.current=requestAnimationFrame(u))});return()=>{h(),window.removeEventListener("resize",l),r.current&&cancelAnimationFrame(r.current),r.current=0,n.current=[]}},[e]),w.useEffect(()=>{if(!e)return;let s=0;return Ih(l=>{const u=++s;a({kind:l.kind,id:u}),setTimeout(()=>{u===s&&a(null)},600)})},[e]),e?f.jsx(OP,{children:i&&(()=>{const{Icon:s,color:o}=WO(i.kind);return f.jsx($O.div,{className:"fixed inset-0 pointer-events-none z-[60] flex items-center justify-center","aria-hidden":"true",initial:{opacity:0},animate:{opacity:.45},exit:{opacity:0},transition:{duration:.2},children:f.jsx(s,{className:"w-24 h-24",color:o,strokeWidth:1.5})},i.id)})()}):f.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none z-[60]","aria-hidden":"true"})}const z1=["direct","guide","practice"];function YO(){const e=$e(),[t,n]=w.useState([]),[r,i]=w.useState([]),[a,s]=w.useState({}),[o,l]=w.useState(null),[u,c]=w.useState(null),[h,m]=w.useState(null),[d,p]=w.useState(null),g=w.useCallback(re=>{p(re instanceof Error?re.message:String(re)),console.error(re)},[]),[x,b]=w.useState([]),[v,E]=w.useState(null),[N,k]=w.useState([]),[S,_]=w.useState(null),[C,I]=w.useState("map"),[A,R]=w.useState(null),[L,z]=w.useState(new Set),[j,B]=w.useState(null),H=w.useRef({active:!1,terminate:null}),[Y,V]=w.useState({open:!1,pendingAction:null}),Z=w.useRef(null),[O,X]=w.useState(null),[ne,P]=w.useState(!1),[te,Q]=w.useState(!0),[K,ce]=w.useState(!0),le=W_(),[ee,Ce]=w.useState("notebook"),[de,he]=w.useState("chat"),pe=w.useRef(de);pe.current=de;const Ne=w.useRef(le);w.useEffect(()=>{Ne.current!==le&&(le===1?(Q(!0),ce(!0)):le===2&&Ne.current===3&&Ce(H_(pe.current)),Ne.current=le)},[le]);const Oe=le===3?de==="rail":le===2?ee==="rail":te,ot=le===3?de==="notebook":le===2?ee==="notebook":K,Be=le!==3||de==="chat",ct=()=>{le===1?Q(re=>!re):le===2?Ce(re=>re==="rail"?"notebook":"rail"):he(re=>re==="rail"?"chat":"rail")},me=()=>{le===1?ce(re=>!re):le===2?Ce(re=>re==="notebook"?"rail":"notebook"):he(re=>re==="notebook"?"chat":"notebook")},Ue=w.useRef(null),dt=re=>{var Me,Ve;if(le!==3)return;const fe=re.touches[0];Ue.current={x:fe.clientX,y:fe.clientY,multi:re.touches.length>1,noswipe:!!((Ve=(Me=re.target).closest)!=null&&Ve.call(Me,"[data-noswipe]"))}},nt=re=>{const fe=Ue.current;if(Ue.current=null,!fe||fe.multi||fe.noswipe||le!==3)return;const Me=re.changedTouches[0],Ve=U_(pe.current,Me.clientX-fe.x,Me.clientY-fe.y);Ve&&he(Ve)},[mt,Qe]=w.useState(!1),[Pe,oe]=w.useState(null),[ge,_e]=w.useState([]),Ae=O_(h,j),ze=lg(),ye=L_(Ae.activeId,ze);w.useEffect(()=>{fy(ye.streaming)},[ye.streaming]);const[Re,He]=w.useState(""),ht=w.useCallback(re=>{He(re)},[]),en=w.useCallback((re,fe,Me)=>{if(re.type==="content"){if(X("content"),Me){const Ve=xt=>{document.querySelector(`mark[data-note-id="${Me}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-note",{detail:Me})):xt>0&&setTimeout(()=>Ve(xt-1),150)};setTimeout(()=>Ve(10),100)}}else if(re.threadId!==Ae.activeId&&Ae.setActiveId(re.threadId),Me){const Ve=xt=>{document.querySelector(`mark[data-note-id="${Me}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-chat-note",{detail:Me})):xt>0&&setTimeout(()=>Ve(xt-1),150)};setTimeout(()=>Ve(10),120)}},[Ae]),[jt,tn]=w.useState(null);w.useEffect(()=>{if(!j){tn(null);return}let re=!1;return ie.getNodeSummary(j,ze).then(fe=>{re||tn(fe)}).catch(()=>{re||tn(null)}),()=>{re=!0}},[j,ze]);const Je=w.useMemo(()=>r.find(re=>re.id===j)??null,[r,j]),Kr=w.useMemo(()=>ge.map(re=>({...re,label:e(`starter.${re.key}.label`),hint:e(`starter.${re.key}.hint`),message:e(`starter.${re.key}.message`,{title:(Je==null?void 0:Je.title)??""})})),[ge,Je,e]),ae=w.useRef(null),rt=w.useCallback(()=>{var re;Je&&((re=ae.current)==null||re.call(ae,e("chat.action.startLearningPrompt",{title:Je.title}),e("chat.action.startLearning",{title:Je.title})))},[Je,e]),Tt=w.useCallback(async()=>{try{const[re,fe,Me,Ve,xt,wn]=await Promise.all([ie.listCourses(),ie.getStreak(),ie.listSouls(),ie.getActiveSoul(),ie.getXpStatus(),ie.getDueReviews()]);n(re),l(fe),k(Me),c(xt),_(Ve),z(new Set(wn)),h&&!re.some(F3=>F3.id===h)&&(m(null),B(null),i([]),s({}),R(null),b([]),E(null))}catch(re){p(re instanceof Error?re.message:String(re))}},[h]);w.useEffect(()=>{Tt()},[Tt]);const nn=w.useCallback(async()=>{try{oe(await ie.isAgentReady())}catch{oe({ready:!1,missing:e("error.checkReadyFailed")})}},[e]);w.useEffect(()=>{nn();const re=()=>nn();return window.addEventListener("llm-config-changed",re),()=>window.removeEventListener("llm-config-changed",re)},[nn]);const Xn=w.useRef(0),Cr=w.useRef(0);w.useEffect(()=>{Xn.current=(u==null?void 0:u.todayXp)??0},[u]),w.useEffect(()=>{Cr.current=(o==null?void 0:o.currentStreak)??0},[o]);const Ge=w.useCallback(async()=>{const re=r.filter(Ve=>Ve.type==="lesson"||Ve.type==="exam"),fe=await Promise.all(re.map(async Ve=>{const xt=await ie.getProgress(Ve.id);return[Ve.id,xt]})),Me={};for(const[Ve,xt]of fe)xt&&(Me[Ve]=xt);s(Me)},[r]);w.useEffect(()=>ie.on("state:changed",fe=>{fe==="xp"?ie.getXpStatus().then(Me=>{c(Me),Xn.current<100&&Me.todayXp>=100&&fi("energy-full")}).catch(()=>{}):fe==="streak"?ie.getStreak().then(Me=>{l(Me),Me.currentStreak>Cr.current&&fi("streak")}).catch(()=>{}):fe==="mastery"&&(fi("mastery"),Tt(),Ge())}),[Tt,Ge]),w.useEffect(()=>{h&&(ie.getCourseLanguages(h).then(b).catch(()=>b([])),ie.getCourseLanguage(h).then(E).catch(()=>E(null)))},[h]),w.useEffect(()=>{h&&(ie.getCourseTree(h,v??void 0).then(async re=>{i(re);const fe=re.filter(xt=>xt.type==="lesson"||xt.type==="exam"),Me=await Promise.all(fe.map(async xt=>{const wn=await ie.getProgress(xt.id);return[xt.id,wn]})),Ve={};for(const[xt,wn]of Me)wn&&(Ve[xt]=wn);s(Ve)}).catch(g),ie.getDashboard(h).then(R).catch(g))},[h,v,g]),w.useEffect(()=>{if(!j){_e([]);return}ie.getStarterPrompts(j).then(_e).catch(()=>_e([]))},[j]),w.useEffect(()=>{const re=fe=>{if(fe.key==="Escape"&&Ae.activeId&&(ie.abortAgentChatThread(Ae.activeId).catch(()=>{}),P(!1),Qe(!1)),(fe.ctrlKey||fe.metaKey)&&fe.key==="k"&&(fe.preventDefault(),Qe(Me=>!Me)),(fe.ctrlKey||fe.metaKey)&&fe.key==="b"&&(fe.preventDefault(),ct()),(fe.ctrlKey||fe.metaKey)&&fe.key==="Tab"){if(fe.preventDefault(),H.current.active)return;const Me=Ae.threads;if(Me.length>1){const Ve=Me.findIndex(wn=>wn.id===Ae.activeId),xt=fe.shiftKey?(Ve-1+Me.length)%Me.length:(Ve+1)%Me.length;Ae.setActiveId(Me[xt].id)}}(!fe.target||!fe.target.matches("input, textarea, select"))&&(fe.key==="1"&&I("map"),fe.key==="2"&&I("import"),fe.key==="s"&&(fe.ctrlKey||fe.metaKey)&&(fe.preventDefault(),P(!0)))};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[j]);const tt=w.useCallback(async re=>{var fe;try{if(re.type==="exam"){B(re.id),X("content");return}if(((fe=a[re.id])==null?void 0:fe.status)==="locked"){B(null);return}await ie.markNodeAttempted(re.id);const Me=await ie.getStreak();await Ge(),l(Me),B(re.id),X("content"),zl(!1)}catch(Me){g(Me)}},[a,Ge,g]),Dt=w.useCallback(re=>{if(H.current.active){V({open:!0,pendingAction:re});return}re()},[]),St=w.useCallback(re=>{if(H.current.active&&re.id!==j){V({open:!0,pendingAction:()=>void tt(re)});return}tt(re)},[tt,j]),Kt=w.useCallback(re=>{H.current=re},[]),lt=w.useCallback(async()=>{const re=Y.pendingAction;V({open:!1,pendingAction:null});const fe=H.current;if(H.current={active:!1,terminate:null},fe.active&&fe.terminate)try{await fe.terminate()}catch{}re==null||re()},[Y.pendingAction]);ra(Z,Y.open),w.useEffect(()=>{if(!Y.open)return;const re=fe=>{fe.key==="Escape"&&V({open:!1,pendingAction:null})};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[Y.open]);const Ze=async re=>{try{await ie.setActiveSoul(re),_(re)}catch(fe){g(fe)}},it=w.useCallback(async(re,fe,Me)=>{try{await ie.applyProposal(re),ye.markProposalStatus(fe,Me,!0)}catch(Ve){g(Ve)}},[ye,g]),un=w.useCallback(async(re,fe,Me)=>{try{await ie.rejectProposal(re),ye.markProposalStatus(fe,Me,!1)}catch(Ve){g(Ve)}},[ye,g]),ft=t.find(re=>re.id===h),Mt=w.useMemo(()=>{const re=new Set(r.map(fe=>fe.id));return new Set([...L].filter(fe=>re.has(fe)))},[L,r]),Wt=Mt.size,Mi=w.useMemo(()=>r.filter(re=>re.type==="section").sort((re,fe)=>re.orderIdx-fe.orderIdx),[r]),Rs=w.useMemo(()=>{const re=z1.map(Me=>N.find(Ve=>Ve.name===Me)).filter(Me=>!!Me),fe=N.filter(Me=>!z1.includes(Me.name));return[...re,...fe]},[N]),rn=bI(h),xa=vI(),Pt=zd();w.useEffect(()=>ie.on("exam:status",fe=>{if(fe.status!=="ready"||fe.nodeId===j)return;const Me=r.find(Ve=>Ve.id===fe.nodeId);Me&&Pt.show(e("exam.ready.toast",{title:Me.title}),{duration:4e3})}),[j,r,Pt,e]);const Xt=w.useCallback(async re=>{const fe=t.find(Me=>Me.id===re);try{await ie.deleteCourse(re),Pt.show(e("import.deleted",{title:(fe==null?void 0:fe.title)??re}),{duration:3e3}),Tt()}catch(Me){g(Me)}},[t,Tt,g,Pt,e]),Xr=w.useCallback(async(re,fe,Me)=>{if(!re.trim()||ye.streaming)return;if(!Ae.activeId){const xt=await Ae.ensureThreadForSend(re,fe);if(xt){ye.send(re,xt,fe,Me);return}Pt.show(e("toast.threadCreateFailed"));return}const Ve=Ae.activeThread;Ve&&!Ve.title&&Ae.update(Ve.id,{title:(fe??re).trim()}),ye.send(re,void 0,fe,Me)},[ye,Ae,Pt,e]),Qr=w.useRef(ye.streaming);Qr.current=ye.streaming;const ba=w.useCallback(re=>{const fe=P_(re,e),Me=D_(re,e),Ve=xt=>{var wn;if(!Qr.current){(wn=ae.current)==null||wn.call(ae,fe,Me);return}xt>0&&setTimeout(()=>Ve(xt-1),2e3)};Ve(10)},[e]);ae.current=Xr;const Ii=new Set(["concept_map","diagram","compare_table","code_walkthrough"]),Qt=w.useMemo(()=>{const re=dp(ye.messages).filter(Me=>{var Ve;return Ii.has(((Ve=Me.output)==null?void 0:Ve.artifactType)??"")});if(re.length)return re[re.length-1];const fe=rn.items.filter(Me=>Ii.has(Me.artifactType)).map(Me=>{try{return{id:Me.id,toolName:Me.artifactType,output:JSON.parse(Me.data)}}catch{return null}}).filter(Me=>Me!==null);return fe.length?fe[fe.length-1]:null},[ye.messages,rn.items]),Zr=w.useRef(new Set);w.useEffect(()=>{!Qt||Zr.current.has(Qt.id)||(Zr.current.add(Qt.id),ye.streaming&&X("board"))},[Qt,ye.streaming]);const jl=w.useMemo(()=>ye.messages.reduce((re,fe)=>re+fe.parts.reduce((Me,Ve)=>Ve.type==="text"?Me+ig(Ve.text):Me,0),0),[ye.messages]),ph=w.useRef(!1);w.useEffect(()=>{Wt>0&&!ph.current&&(ph.current=!0,Pt.show(e("review.nudge",{n:Wt}),{duration:4e3}))},[Wt,Pt,e]);const gh=w.useMemo(()=>dp(ye.messages),[ye.messages]),xh=w.useRef(new Set);w.useEffect(()=>{for(const re of gh){const fe=re.output;if(!fe||!fe.artifactType)continue;const Me=`${fe.artifactType}:${JSON.stringify(fe)}`;xh.current.has(Me)||(xh.current.add(Me),rn.save({nodeId:j,artifactType:fe.artifactType,title:fe.title??null,data:fe}),Pt.show(e("toast.artifactSaved"),{duration:3e3}))}},[gh,rn,j,Pt,e]),w.useEffect(()=>{C!=="map"&&X(null)},[C]);const[B3,Bl]=w.useState(!1),[Fl,zl]=w.useState(!1),bh=(Je==null?void 0:Je.type)==="exam";return w.useEffect(()=>{bh&&window.dispatchEvent(new CustomEvent("companion-exam-enter"))},[bh]),w.useEffect(()=>{my(Fl)},[Fl]),f.jsxs("div",{className:"h-[var(--app-height,100vh)] flex flex-col bg-surface-1 text-neutral-900 dark:text-neutral-100 overflow-hidden",children:[f.jsx(XO,{streak:o,xp:u,fontSize:xa.size,onFontBump:xa.bump,onOpenSettings:()=>P(!0),leftVisible:Oe,rightVisible:ot,onToggleLeft:ct,onToggleRight:me,tier:le,bottomBar:le===3?f.jsx("nav",{className:"inline-flex items-center gap-0.5 p-0.5 rounded-lg bg-ink/5 ring-1 ring-inset ring-[var(--border)]","data-testid":"t3-pane-switcher",role:"tablist","aria-label":e("pane.switcher"),children:[{k:"rail",icon:$0,label:e("pane.map"),testid:"t3-btn-rail"},{k:"chat",icon:Uy,label:e("pane.chat"),testid:"t3-btn-chat"},{k:"notebook",icon:Yy,label:e("pane.notes"),testid:"t3-btn-notebook"}].map(({k:re,icon:fe,label:Me,testid:Ve})=>f.jsx("button",{role:"tab","aria-selected":de===re,"aria-label":Me,"data-testid":Ve,"data-tooltip":Me,onClick:()=>he(re),className:`w-8 h-7 flex items-center justify-center rounded-md transition-colors ${de===re?"bg-brand/20 text-brand":"text-ink-muted active:bg-ink/10"}`,children:f.jsx(fe,{className:"w-4 h-4"})},re))}):void 0}),d&&f.jsx(JO,{message:d,onClose:()=>p(null)}),f.jsxs("div",{className:"flex-1 flex min-h-0 min-w-0",onTouchStart:dt,onTouchEnd:nt,children:[Oe&&f.jsx(mv,{fullWidth:le===3,view:C,onViewChange:I,courseTitle:(ft==null?void 0:ft.title)??null,courseId:h,courses:t,sections:Mi,tree:r,progressMap:a,selectedNodeId:j,dueCount:Wt,dueNodeIds:Mt,overallMastery:(A==null?void 0:A.overallMastery)??0,streak:(o==null?void 0:o.currentStreak)??0,streaming:ye.streaming,onJumpNode:re=>{if(ye.streaming)return;const fe=r.find(Me=>Me.id===re);fe&&St(fe),le===3&&he("chat")},onOpenReview:()=>Bl(!0),onSelectCourse:re=>Dt(()=>{m(re),Tt()}),onDeleteCourse:re=>Dt(()=>{Xt(re)}),onCoursesChanged:()=>{Tt()},availableLanguages:x,currentLocale:v,onLocaleChange:async re=>{h&&(await ie.setCourseLanguage(h,re),E(re))}}),f.jsxs(f.Fragment,{children:[Be&&f.jsx("div",{className:"relative flex flex-col h-full bg-surface-1 shrink-0 min-w-0 motion-safe:transition-[width] motion-safe:duration-200",style:le===3?{flex:1}:ot?{width:"clamp(480px, 36vw, 800px)"}:{flex:1},"data-testid":"chat-panel",children:h?(Je==null?void 0:Je.type)==="exam"?f.jsx(g_,{examNode:Je,locale:ze,onSessionChange:Kt,paused:Y.open,onExamCompleted:()=>{ie.getProgress(Je.id).then(re=>{re&&s(fe=>({...fe,[Je.id]:re}))})}}):f.jsxs(f.Fragment,{children:[f.jsx(j_,{threads:Ae.threads,activeThread:Ae.activeThread,focusNodeTitle:(Je==null?void 0:Je.title)??null,onPickThread:re=>{ye.streaming||Ae.setActiveId(re)},onCreate:()=>{ye.streaming||(Ae.create({title:null}),Pt.show(e("toast.threadCreated")))},onRename:(re,fe)=>{Ae.update(re,{title:fe}),Pt.show(e("toast.threadRenamed"))},onArchive:re=>{Ae.update(re,{status:"archived"}),Pt.show(e("toast.threadArchived"),{duration:5e3,action:{label:e("action.undo"),onClick:()=>Ae.update(re,{status:"active"})}})},onDelete:re=>{const fe=Ae.removeWithUndo(re);fe&&(Pt.show(`${e("toast.threadDeleted")}${fe.title?`「${fe.title}」`:""}`,{duration:5e3,action:{label:e("action.undo"),onClick:()=>{Ae.restore(fe),Pt.show(e("toast.restored"))}}}),setTimeout(()=>{ie.threadDelete(fe.id).catch(()=>{})},5500))}}),f.jsx(TI,{messages:ye.messages,streaming:ye.streaming,onApplyProposal:it,onRejectProposal:un,summary:jt,onStartLearning:Pe!=null&&Pe.ready?rt:void 0,agentReady:(Pe==null?void 0:Pe.ready)??!1,onGotoSettings:()=>P(!0),hasNode:!!Je,selectedNodeId:j,threadId:Ae.activeId,onPickQuizAction:re=>{Xr(re)},onQuizCompleted:ba,cardMode:le===3,chatNotes:rn.items.filter(re=>re.artifactType==="user_note"&&re.sourceAnchor),onSaveChatNote:(re,fe,Me,Ve)=>{!Je||!Ae.activeId||(rn.saveUserNote({nodeId:Je.id,text:re,sourceType:"chat",sourceAnchor:{type:"chat",threadId:Ae.activeId,msgId:fe,startOffset:Me,endOffset:Ve}}),Pt.show(e("toast.noteSaved"),{duration:2e3}))}}),f.jsx(KI,{nodeId:j,agentReady:(Pe==null?void 0:Pe.ready)??!1,streaming:ye.streaming,souls:Rs,activeSoul:S,starterPrompts:ye.messages.length>0?Kr:[],onPickSoul:Ze,onSend:Xr,onStop:ye.stop,onLogFriction:j?(re,fe)=>{ie.logFriction(j,re,fe),Pt.show(e("chat.friction.saved"),{duration:2500})}:void 0,onGotoSettings:()=>P(!0),insertText:Re,historyTokens:jl})]}):f.jsx("div",{className:"flex-1 flex items-center justify-center px-6","data-testid":"chat-no-course",children:f.jsxs("div",{className:"text-center max-w-sm",children:[f.jsx("div",{className:"text-5xl mb-4 opacity-30",children:"📚"}),f.jsx("div",{className:"text-title font-bold text-ink mb-2",children:e("course.empty.title")}),f.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:e("course.empty.desc")})]})})}),ot&&f.jsx("main",{className:le===3?"flex-1 min-w-0 bg-surface-2":"flex-1 min-w-[440px] bg-surface-2","data-testid":le===3?"notebook-pane-full":void 0,children:f.jsx(fI,{selectedNode:Je,items:rn.items,loading:rn.loading,forceTab:O,canvasArtifact:Qt,onUserTabChange:()=>X(null),onRemove:re=>{rn.remove(re),Pt.show(e("toast.noteDeleted"))},onTogglePin:re=>{rn.togglePin(re)},onRecordQuizResult:(re,fe)=>{rn.recordQuizResult(re,fe)},onUpdateNoteComment:(re,fe)=>{rn.updateUserNoteComment(re,fe)},onSaveContentNote:(re,fe)=>{Je&&(rn.saveUserNote({nodeId:Je.id,text:re,sourceType:"content",sourceAnchor:fe}),Pt.show(e("toast.noteSaved"),{duration:2e3}))},onJumpToSource:en,onQuoteToChat:ht,locale:v,isReviewing:Fl,onReviewDone:()=>zl(!1)})})]})]}),ne&&f.jsx(QO,{onClose:()=>P(!1)}),B3&&f.jsx(ZO,{onClose:()=>Bl(!1),tree:r,dashboard:A,progressMap:a,onPickNode:re=>{Dt(()=>{B(re),X("content"),Bl(!1),zl(!0)})}}),Y.open&&f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50","data-testid":"exam-leave-modal",children:f.jsxs("div",{ref:Z,className:"w-[min(400px,90vw)] rounded-2xl bg-surface-0 p-6 shadow-elevated border border-warning/40",role:"dialog","aria-modal":"true","aria-label":e("exam.leave.title"),children:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(wr,{className:"w-5 h-5 text-warning shrink-0"}),f.jsx("span",{className:"text-title font-bold text-ink",children:e("exam.leave.title")})]}),f.jsx("div",{className:"text-body text-ink-muted mb-5 leading-relaxed",children:e("exam.leave.message")}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{className:"btn-3d-neutral px-4 py-1.5 text-body",onClick:()=>V({open:!1,pendingAction:null}),"data-testid":"exam-leave-cancel",children:e("exam.leave.cancel")}),f.jsx("button",{className:"btn-3d-brand px-4 py-1.5 text-body",style:{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"},onClick:()=>void lt(),"data-testid":"exam-leave-confirm",children:e("exam.leave.confirm")})]})]})}),mt&&f.jsx(y_,{onClose:()=>Qe(!1),onPick:re=>{Qe(!1),KO(re)},hasNode:!!j}),f.jsx(Sv,{}),f.jsx(GO,{}),f.jsx(c_,{courseId:h})]})}function KO(e){window.dispatchEvent(new CustomEvent("lookatstudy-command",{detail:e}))}function XO({streak:e,xp:t,fontSize:n,onFontBump:r,onOpenSettings:i,leftVisible:a,rightVisible:s,onToggleLeft:o,onToggleRight:l,tier:u,bottomBar:c}){const h=$e();return c?f.jsx("header",{className:"app-header shrink-0",children:f.jsxs("div",{className:"flex items-center h-12 px-4",children:[f.jsx("div",{className:"flex-1 flex items-center min-w-0",children:t&&f.jsxs("div",{className:"flex items-center gap-1 shrink-0","data-testid":"xp-bar",title:h("header.energy"),children:[f.jsx(vc,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),f.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]})}),c,f.jsx("div",{className:"flex-1 flex items-center justify-end",children:f.jsx("button",{onClick:i,"data-testid":"header-settings","aria-label":h("header.settings"),className:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300 w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-200 dark:hover:bg-neutral-800/50 transition-colors",title:h("header.settings"),children:f.jsx(Io,{className:"w-4 h-4"})})})]})}):f.jsx("header",{className:"app-header shrink-0 flex flex-col",children:f.jsxs("div",{className:"flex items-center pt-2.5 pb-3 px-6 justify-between",children:[f.jsx("div",{className:"flex items-center gap-2 min-w-0",children:f.jsxs("h1",{className:"text-body font-extrabold tracking-tight text-neutral-900 dark:text-neutral-100 select-none min-w-0 truncate",children:["Lookat",f.jsx("span",{className:"text-brand",children:"Study"})]})}),f.jsxs("div",{className:"flex items-center gap-3",children:[u!==3&&f.jsxs("div",{className:"flex items-center gap-0.5",children:[f.jsx("button",{onClick:o,"data-testid":"layout-toggle-left",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${a?"text-neutral-500 hover:bg-neutral-200 dark:text-neutral-300 dark:hover:bg-neutral-800":"text-neutral-600 bg-neutral-200 dark:bg-neutral-800"}`,title:h("header.toggleLeft"),children:f.jsx($y,{className:"w-4 h-4"})}),f.jsx("button",{onClick:l,"data-testid":"layout-toggle-right",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${s?"text-neutral-500 hover:bg-neutral-200 dark:text-neutral-300 dark:hover:bg-neutral-800":"text-neutral-600 bg-neutral-200 dark:bg-neutral-800"}`,title:h("header.toggleRight"),children:f.jsx(Wy,{className:"w-4 h-4"})})]}),u!==3&&f.jsxs("div",{className:"flex items-center gap-0.5","data-testid":"font-size-control",children:[f.jsx("button",{onClick:()=>r("down"),disabled:n==="small","data-testid":"font-smaller",className:"text-label w-7 h-7 flex items-center justify-center rounded-md text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 hover:bg-ink/5 disabled:opacity-20 disabled:cursor-not-allowed transition-colors",title:h("header.font.smaller"),children:"A-"}),f.jsx("button",{onClick:()=>r("up"),disabled:n==="large","data-testid":"font-larger",className:"text-body w-7 h-7 flex items-center justify-center rounded-md text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 hover:bg-ink/5 disabled:opacity-20 disabled:cursor-not-allowed transition-colors",title:h("header.font.larger"),children:"A+"})]}),t&&f.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"xp-bar",title:h("header.energy"),children:[f.jsx(vc,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),f.jsx("div",{className:"w-16 h-2 bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.min(100,Math.max(3,t.todayXp))}%`}})}),f.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]}),t&&f.jsx("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-brand/10","data-testid":"level-badge",title:h("header.level.title"),children:f.jsxs("span",{className:"text-label font-bold text-brand",children:["Lv.",t.level]})}),e&&f.jsx(ej,{streak:e}),f.jsx("button",{onClick:i,"data-testid":"header-settings",className:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300 w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-200 dark:hover:bg-neutral-800/50 transition-colors",title:h("header.settings"),children:f.jsx(Io,{className:"w-4 h-4"})})]})]})})}function QO({onClose:e}){const t=$e(),n=w.useRef(null);return ra(n,!0),f.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"settings-drawer",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),f.jsxs("div",{ref:n,role:"dialog","aria-modal":"true","aria-label":t("settings.title"),className:"relative w-full max-w-lg h-full bg-surface-0 border-l border-[var(--border)] shadow-elevated flex flex-col",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[f.jsx("h2",{className:"text-body font-bold",children:t("settings.title")}),f.jsx("button",{onClick:e,"data-testid":"settings-close","aria-label":t("action.close"),className:"text-ink-muted hover:text-ink-strong w-8 h-8 flex items-center justify-center rounded-lg hover:bg-surface-3",children:"✕"})]}),f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(k_,{})})]})]})}function ZO({onClose:e,tree:t,onPickNode:n,dashboard:r,progressMap:i}){const a=$e(),s=w.useRef(null);ra(s,!0);const[o,l]=w.useState([]);w.useEffect(()=>{ie.getAllSrsItems().then(E=>l(E)).catch(()=>l([]))},[]);const u=w.useMemo(()=>new Map(o.map(E=>[E.nodeId,E])),[o]),c=w.useMemo(()=>{const E=new Map(t.map(k=>[k.id,k])),N=o.filter(k=>E.has(k.nodeId));return{overdue:N.filter(k=>k.overdue),short:N.filter(k=>!k.overdue&&k.intervalDays>0&&k.intervalDays<=7),long:N.filter(k=>!k.overdue&&k.intervalDays>7),inactive:N.filter(k=>k.repetitions===0&&!k.overdue)}},[o,t]),h=w.useMemo(()=>t.filter(N=>N.type==="section"&&(N.world??"study")==="study").sort((N,k)=>N.orderIdx-k.orderIdx).map(N=>({section:N,lessons:t.filter(k=>k.parentId===N.id&&k.type==="lesson").sort((k,S)=>k.orderIdx-S.orderIdx)})),[t]),m=w.useMemo(()=>{const E=new Map;for(const N of(r==null?void 0:r.sections)??[])E.set(N.sectionId,N.avgMastery);return E},[r]),d=w.useMemo(()=>t.filter(E=>{var k;const N=(k=i[E.id])==null?void 0:k.status;return E.type==="lesson"&&(E.world??"study")==="study"&&(N==="in_progress"||N==="mastered")}),[t,i]),[p,g]=w.useState(new Set),x=E=>g(N=>{const k=new Set(N);return k.has(E)?k.delete(E):k.add(E),k}),b=E=>{const N=u.get(E);return N?N.overdue?{color:"bg-review",title:a("review.quadrant.overdue")}:N.intervalDays>0&&N.intervalDays<=7?{color:"bg-gold",title:a("review.quadrant.short")}:N.intervalDays>7?{color:"bg-brand",title:a("review.quadrant.long")}:null:null},v=c.overdue.length>0;return f.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"review-drawer",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),f.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":a("review.title"),className:"relative w-full max-w-md h-full bg-surface-0 border-l border-[var(--border)] shadow-elevated flex flex-col",children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[f.jsxs("h2",{className:"text-body font-bold flex items-center gap-1.5",children:[f.jsx(or,{className:"w-4 h-4","aria-hidden":"true"})," ",a("review.title")]}),f.jsx("button",{onClick:e,"data-testid":"review-close","aria-label":a("action.close"),className:"text-ink-muted hover:text-ink-strong w-8 h-8 flex items-center justify-center rounded-lg hover:bg-surface-3",children:"✕"})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5","data-testid":"review-panel",children:[d.length>0&&f.jsxs("button",{onClick:()=>{const E=d[Math.floor(Math.random()*d.length)];E&&n(E.id)},"data-testid":"review-interleave",className:"btn-3d-neutral w-full py-2.5 text-body flex items-center justify-center gap-1.5",children:[f.jsx(n5,{className:"w-4 h-4"}),a("review.interleave")]}),o.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:a("review.srsHint")}),f.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:[{items:c.overdue,label:a("review.quadrant.overdue"),dot:"bg-review"},{items:c.short,label:a("review.quadrant.short"),dot:"bg-gold"},{items:c.long,label:a("review.quadrant.long"),dot:"bg-brand"},{items:c.inactive,label:a("review.quadrant.inactive"),dot:"bg-ink-faint"}].filter(E=>E.items.length>0).map(E=>f.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-surface-3",children:[f.jsx("span",{className:`w-2 h-2 rounded-full ${E.dot}`}),f.jsx("span",{className:"text-label text-ink-muted",children:E.label}),f.jsx("span",{className:"text-label font-extrabold text-ink-strong tabular-nums",children:E.items.length})]},E.label))}),v&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-label text-ink-faint mb-1.5",children:a("review.overdueQuickHint")}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.overdue.slice(0,8).map(E=>{const N=t.find(k=>k.id===E.nodeId);return N?f.jsx("button",{onClick:()=>n(E.nodeId),"data-testid":`review-overdue-${E.nodeId.slice(0,8)}`,className:"px-2 py-1 rounded-full bg-review/10 ring-1 ring-review/20 text-label text-review font-bold hover:bg-review/20 transition-colors truncate max-w-[140px]",children:N.title},E.nodeId):null})})]})]}),h.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:a("review.myProgress")}),f.jsx("div",{className:"space-y-1",children:h.map(({section:E,lessons:N})=>{const k=Math.round((m.get(E.id)??0)*100),S=p.has(E.id),_=N.filter(C=>{var A;const I=(A=i[C.id])==null?void 0:A.status;return I==="in_progress"||I==="mastered"});return f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>x(E.id),className:"w-full flex items-center gap-2 p-2 rounded-lg hover:bg-surface-3 transition-colors",children:[S?f.jsx(V0,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}):f.jsx(Ay,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}),f.jsx("span",{className:"text-body text-ink-strong font-bold truncate flex-1 text-left",children:E.title}),_.length>0&&f.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[f.jsx("div",{className:"w-16 h-1.5 bg-surface-3 rounded-full overflow-hidden",children:f.jsx("div",{className:`h-full rounded-full ${k>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,k)}%`}})}),f.jsxs("span",{className:"text-label tabular-nums text-ink-muted w-8 text-right",children:[k,"%"]})]})]}),S&&f.jsx("div",{className:"ml-5 mt-0.5 mb-1 space-y-0.5","data-testid":"review-lesson-list",children:N.length===0?f.jsx("div",{className:"text-label text-ink-faint py-1.5 pl-1",children:"—"}):N.map(C=>{const I=i[C.id],A=I?Math.round((I.mastery??0)*100):null,R=b(C.id),L=(I==null?void 0:I.status)==="in_progress"||(I==null?void 0:I.status)==="mastered";return f.jsxs("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors ${(R==null?void 0:R.color)==="bg-review"?"bg-review/8":"hover:bg-surface-3"}`,children:[R?f.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${R.color} shrink-0`,title:R.title}):f.jsx("span",{className:"w-1.5 h-1.5 shrink-0"}),f.jsx("span",{className:`text-label truncate flex-1 ${L?"text-ink-strong":"text-ink-faint"}`,children:C.title}),A!==null&&f.jsxs("span",{className:"text-label tabular-nums text-ink-muted shrink-0 w-8 text-right",children:[A,"%"]}),L&&f.jsx("button",{onClick:()=>n(C.id),"data-testid":`review-lesson-${C.id.slice(0,8)}`,className:"shrink-0 px-2 py-0.5 rounded-md bg-brand/15 text-brand text-caption font-bold hover:bg-brand/25 transition-colors",children:a("review.reviewLesson")})]},C.id)})})]},E.id)})})]}),r&&r.frictionByNode.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-caption font-bold text-review uppercase tracking-wider mb-1.5",children:a("dashboard.mini.struggle")}),r.frictionByNode.map(E=>f.jsxs("button",{onClick:()=>n(E.nodeId),className:"flex items-center gap-2 py-0.5 w-full text-left hover:bg-surface-3 rounded px-1",children:[f.jsxs("span",{className:"text-label text-review font-bold tabular-nums",children:[E.count,"×"]}),f.jsx("span",{className:"text-label text-ink-strong truncate flex-1",children:E.title})]},E.nodeId))]}),d.length===0&&o.length===0&&h.length===0&&f.jsxs("div",{className:"text-center py-16","data-testid":"review-empty",children:[f.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),f.jsx("div",{className:"text-body text-ink-muted",children:a("review.empty.title")}),f.jsx("div",{className:"text-label text-ink-faint mt-1",children:a("review.empty.desc")})]})]})]})]})}function JO({message:e,onClose:t}){const n=$e();return f.jsxs("div",{role:"alert","data-testid":"error-banner",className:"px-4 py-2 border-b border-warning-tint-border text-warning text-body flex items-center justify-between",style:{backgroundColor:"var(--warning-tint)"},children:[f.jsxs("span",{children:["⚠️ ",e]}),f.jsx("button",{className:"ml-3 underline text-warning-light",onClick:t,children:n("action.close")})]})}function ej({streak:e}){const t=$e();return f.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-full border border-review/20",style:{backgroundColor:"var(--review-tint)"},"data-testid":"streak-badge",title:t("streak.title",{n:e.currentStreak,m:e.longestStreak}),children:[f.jsx(Q1,{className:"w-4 h-4 text-review flame-flicker"}),f.jsx("span",{className:"text-body font-extrabold text-review",children:e.currentStreak}),e.freezeCount>0&&f.jsxs("span",{className:"flex items-center gap-0.5 ml-0.5","data-testid":"freeze-badge",title:t("streak.freeze.title",{n:e.freezeCount}),children:[f.jsx(t5,{className:"w-3 h-3 text-review/80","aria-hidden":"true"}),f.jsx("span",{className:"text-label font-bold text-review/80",children:e.freezeCount})]})]})}window.addEventListener("error",e=>{var t;console.error("[FATAL renderer error]",((t=e.error)==null?void 0:t.stack)||e.message)});window.addEventListener("unhandledrejection",e=>{var t;console.error("[FATAL unhandled rejection]",((t=e.reason)==null?void 0:t.stack)||e.reason)});function tj({rejected:e}){const t=navigator.language.startsWith("zh"),[n,r]=H0.useState(""),i=a=>{a.preventDefault();const s=n.trim();if(!s)return;const o=s.includes("token=")?new URL(s).searchParams.get("token")??"":s;o&&Ye(async()=>{const{setWebToken:l}=await import("./api-web-DeJFZI02.js");return{setWebToken:l}},[],import.meta.url).then(({setWebToken:l})=>l(o))};return f.jsx("div",{className:"min-h-[var(--app-height,100vh)] bg-[#0e2a12] flex items-center justify-center p-6",children:f.jsxs("form",{onSubmit:i,className:"w-full max-w-sm text-center",children:[f.jsx("div",{className:"text-4xl mb-3",children:"🎈"}),f.jsx("h1",{className:"text-title font-bold text-white mb-1",children:"LookatStudy"}),f.jsx("p",{className:"text-label text-white/55 leading-relaxed mb-5",children:t?"连接本机学习服务:粘贴启动时打印的令牌或整条链接":"Connect to your study server — paste the token or the full link printed at startup"}),e&&f.jsx("p",{className:"text-label text-warning-light mb-3",children:t?"上次的令牌被拒绝了,请重新输入":"Previous token was rejected, please re-enter"}),f.jsx("input",{type:"text",value:n,onChange:a=>r(a.target.value),placeholder:t?"访问令牌":"access token",autoFocus:!0,className:"w-full bg-black/30 text-white placeholder:text-white/30 text-body font-mono rounded-lg px-3 py-2.5 border border-white/20 focus:border-brand focus:outline-none transition-colors mb-3"}),f.jsx("button",{type:"submit",disabled:!n.trim(),className:"btn-3d-brand w-full px-3 py-2.5 text-body disabled:opacity-40",children:t?"连接":"Connect"}),f.jsx("p",{className:"text-caption text-white/40 leading-relaxed mt-5",children:t?"令牌在服务启动日志里,形如 http://127.0.0.1:17890/?token=…,也可以直接打开那个链接。":"The token is in the server startup log, like http://127.0.0.1:17890/?token=… — opening that link directly works too."})]})})}const j3=py.createRoot(document.getElementById("root"));function nj(){j3.render(f.jsx(H0.StrictMode,{children:f.jsx(iI,{children:f.jsx(YO,{})})}))}function H1(e){j3.render(f.jsx(H0.StrictMode,{children:f.jsx(tj,{rejected:e})}))}async function rj(){const{installAppHeight:e}=await Ye(async()=>{const{installAppHeight:t}=await import("./app-height-D5bf5z0g.js");return{installAppHeight:t}},[],import.meta.url);if(e(),!window.api){const t=await Ye(()=>import("./api-web-DeJFZI02.js"),[],import.meta.url);if(window.addEventListener(t.TOKEN_REJECTED_EVENT,()=>H1(!0)),!t.hasWebToken()){H1(!1);return}try{await t.installWebApi()}catch(n){console.error("[boot] web api 安装失败:",n)}}nj()}rj();export{Ye as _,xg as a,Sg as b,Mf as c,BS as d,ol as f,ys as h,$r as s,Iv as w,s2 as z};