@coffer-org/web 7.4.2 → 8.0.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 (725) hide show
  1. package/dist/assets/ChatWidget-CLPg1SxK.js +90 -0
  2. package/dist/assets/DiagnosticsPage-DHIekD7O.js +1 -0
  3. package/dist/assets/GeoMap-D1ITCEvC.js +4 -0
  4. package/dist/assets/GeoMap-DvTUgzRd.css +661 -0
  5. package/dist/assets/NewRecordView-ypC2MiHy.js +1 -0
  6. package/dist/assets/PluginSettingsPage-CgEPe_jp.js +1 -0
  7. package/dist/assets/ScanSummary-BRELNnQZ.js +1 -0
  8. package/dist/assets/SettingsPage-CBdCKDm9.js +3 -0
  9. package/dist/assets/ThemeSwitcher-DoDwMSvt.js +21 -0
  10. package/dist/assets/api-CtTqq37J.js +1 -0
  11. package/dist/assets/auth-context-B7spbfSH.js +1 -0
  12. package/dist/assets/check-DSh5VTB0.js +6 -0
  13. package/dist/assets/compat-nvzWPAqF.js +1 -0
  14. package/dist/assets/createLucideIcon-0HK7VRhx.js +46 -0
  15. package/dist/assets/data-size-B_xeY3eQ.js +1 -0
  16. package/dist/assets/ical-BRrjpmRX.js +8 -0
  17. package/dist/assets/ilamy-view-CF9TS3xK.js +97 -0
  18. package/dist/assets/index-CBgj-dC3.css +10528 -0
  19. package/dist/assets/index-wtYuweqc.js +33 -0
  20. package/dist/assets/instance-CqF1ziBF.js +1 -0
  21. package/dist/assets/list-cache-DR8308dv.js +1 -0
  22. package/dist/assets/plugin-label-4X6iMcoh.js +1 -0
  23. package/dist/assets/preload-helper-DxWiKyOd.js +1 -0
  24. package/dist/assets/rolldown-runtime-B-1-B7_t.js +1 -0
  25. package/dist/assets/rotate-ccw-Cbig43Yp.js +21 -0
  26. package/dist/assets/rule-form-DY07mdut.js +1 -0
  27. package/dist/assets/schemas-Ddd48n1f.js +64 -0
  28. package/dist/assets/search-C7459FQa.js +6 -0
  29. package/dist/assets/src--TsXaQH2.js +1 -0
  30. package/dist/assets/src-B1GPEuhd.js +1 -0
  31. package/dist/assets/src-B2K2G_F62.js +1 -0
  32. package/dist/assets/src-BPc81uCu2.js +1 -0
  33. package/dist/assets/src-BXuWmEvN.js +1 -0
  34. package/dist/assets/src-BtrXVtpQ2.js +1 -0
  35. package/dist/assets/src-C12PVUBK.js +1 -0
  36. package/dist/assets/src-C1J8QrZx2.js +1 -0
  37. package/dist/assets/src-CLxiQy4N.js +1 -0
  38. package/dist/assets/src-CZlLKZuO.js +1 -0
  39. package/dist/assets/src-CgOvTEkQ.js +8 -0
  40. package/dist/assets/src-Chqh1dE0.js +1 -0
  41. package/dist/assets/src-Cma6wMwh2.js +1 -0
  42. package/dist/assets/src-CsBQ3OG5.js +1 -0
  43. package/dist/assets/src-CtRwEwa_2.js +1 -0
  44. package/dist/assets/src-CxZwGvOe.js +1 -0
  45. package/dist/assets/src-Cy8ITNFQ.js +1 -0
  46. package/dist/assets/src-CzL8eh1F.js +6 -0
  47. package/dist/assets/src-DHGaQhKT.js +1 -0
  48. package/dist/assets/src-DkeTKoaX.js +1 -0
  49. package/dist/assets/src-DotMprHS.js +6 -0
  50. package/dist/assets/src-DsJtEHxm.js +2 -0
  51. package/dist/assets/src-DvgJTIq7.js +1 -0
  52. package/dist/assets/src-KzYtcixM.js +1 -0
  53. package/dist/assets/src-YvA87f32.js +1 -0
  54. package/dist/assets/src-bO9mBc4E.js +1 -0
  55. package/dist/assets/src-nwl88J0b.js +4 -0
  56. package/dist/assets/task_details-3QyVdhd4.js +1 -0
  57. package/dist/assets/ui-BFQOH3UM.js +66 -0
  58. package/dist/assets/ui-C0deEcCk2.js +1 -0
  59. package/dist/assets/ui-C3DdDmuH.js +11 -0
  60. package/dist/assets/ui-CdfnLrpu.js +1 -0
  61. package/dist/assets/ui-vendor-Dz7FZUpP.js +41 -0
  62. package/dist/assets/x-Tw9OswUb.js +6 -0
  63. package/dist/index.html +101 -30
  64. package/dist-vendor/assets/MarkdownEditor-DEp3OKtv.js +191 -0
  65. package/dist-vendor/assets/Separator-BMm-ftCU.js +1 -0
  66. package/dist-vendor/assets/ae-CZRtWSox.svg +6 -0
  67. package/dist-vendor/assets/ae-CnWpkG7H.svg +6 -0
  68. package/dist-vendor/assets/ag-B50eCdjH.svg +14 -0
  69. package/dist-vendor/assets/ag-C8MykuG2.svg +14 -0
  70. package/dist-vendor/assets/ai-BhrGqTjA.svg +29 -0
  71. package/dist-vendor/assets/ai-Dmedkf4v.svg +29 -0
  72. package/dist-vendor/assets/al-10QRkakw.svg +5 -0
  73. package/dist-vendor/assets/al-CxA7yomf.svg +5 -0
  74. package/dist-vendor/assets/am-Brwuaa2u.svg +5 -0
  75. package/dist-vendor/assets/am-DMt4_dd4.svg +5 -0
  76. package/dist-vendor/assets/ao-CAGuVnyg.svg +13 -0
  77. package/dist-vendor/assets/ao-tXuRa6vm.svg +13 -0
  78. package/dist-vendor/assets/aq-CF5jO-0h.svg +5 -0
  79. package/dist-vendor/assets/aq-UDjN-zV6.svg +5 -0
  80. package/dist-vendor/assets/ar-Be8Ju1cG.svg +32 -0
  81. package/dist-vendor/assets/ar-NyCpd6W6.svg +32 -0
  82. package/dist-vendor/assets/asean-CmuWHvfA.svg +13 -0
  83. package/dist-vendor/assets/asean-WMtZ-US_.svg +13 -0
  84. package/dist-vendor/assets/at-D-LsLSdx.svg +4 -0
  85. package/dist-vendor/assets/at-DGA_6m5E.svg +4 -0
  86. package/dist-vendor/assets/au-DAHDIuPI.svg +8 -0
  87. package/dist-vendor/assets/au-kL8f0uMB.svg +8 -0
  88. package/dist-vendor/assets/ax-DvLIy84U.svg +18 -0
  89. package/dist-vendor/assets/ax-wECm_RRW.svg +18 -0
  90. package/dist-vendor/assets/az-Bk-bYNxy.svg +8 -0
  91. package/dist-vendor/assets/az-z2IthT8Q.svg +8 -0
  92. package/dist-vendor/assets/ba-CiiOt6u0.svg +12 -0
  93. package/dist-vendor/assets/ba-WdDiSMvP.svg +12 -0
  94. package/dist-vendor/assets/bb-DC5IaaX4.svg +6 -0
  95. package/dist-vendor/assets/bb-DJxbaxmT.svg +6 -0
  96. package/dist-vendor/assets/bd-BF9t1-60.svg +4 -0
  97. package/dist-vendor/assets/bd-DvPoLH3C.svg +4 -0
  98. package/dist-vendor/assets/be-CLLkK3PN.svg +7 -0
  99. package/dist-vendor/assets/be-Dtq4MkQz.svg +7 -0
  100. package/dist-vendor/assets/bf-DCbfaYlw.svg +7 -0
  101. package/dist-vendor/assets/bf-YclsoDuF.svg +7 -0
  102. package/dist-vendor/assets/bg-GUQenraa.svg +5 -0
  103. package/dist-vendor/assets/bg-cWragUdK.svg +5 -0
  104. package/dist-vendor/assets/bh-BQqEGq6F.svg +4 -0
  105. package/dist-vendor/assets/bh-DgfmyT2n.svg +4 -0
  106. package/dist-vendor/assets/bi-C8Dazs_i.svg +15 -0
  107. package/dist-vendor/assets/bi-CRmKY6RQ.svg +15 -0
  108. package/dist-vendor/assets/bj-14PhO9bM.svg +14 -0
  109. package/dist-vendor/assets/bj-BOF1aYv0.svg +14 -0
  110. package/dist-vendor/assets/bl-4CI2YcwX.svg +5 -0
  111. package/dist-vendor/assets/bl-Ci30-2xD.svg +7 -0
  112. package/dist-vendor/assets/bq-BYpdxEeT.svg +5 -0
  113. package/dist-vendor/assets/bq-SWpsjb2t.svg +5 -0
  114. package/dist-vendor/assets/bs-7Gd_oriM.svg +13 -0
  115. package/dist-vendor/assets/bs-CcXnDJaD.svg +13 -0
  116. package/dist-vendor/assets/bv-Jqog7euh.svg +13 -0
  117. package/dist-vendor/assets/bv-wM9JLv4R.svg +13 -0
  118. package/dist-vendor/assets/bw-DOFTOZyN.svg +7 -0
  119. package/dist-vendor/assets/bw-n5ZaAnGL.svg +7 -0
  120. package/dist-vendor/assets/by-C621sBpd.svg +18 -0
  121. package/dist-vendor/assets/by-u4o0VQKP.svg +18 -0
  122. package/dist-vendor/assets/ca-B8J8Wc6a.svg +4 -0
  123. package/dist-vendor/assets/ca-PYUrLVUV.svg +4 -0
  124. package/dist-vendor/assets/cc-BNT6Xjzk.svg +19 -0
  125. package/dist-vendor/assets/cc-Bl3UDHUt.svg +19 -0
  126. package/dist-vendor/assets/cd-BGclsrP6.svg +5 -0
  127. package/dist-vendor/assets/cd-CwCQH0-t.svg +12 -0
  128. package/dist-vendor/assets/cefta-2dDBYygd.svg +13 -0
  129. package/dist-vendor/assets/cefta-CdOByeeI.svg +13 -0
  130. package/dist-vendor/assets/cf-CvgcTRoz.svg +15 -0
  131. package/dist-vendor/assets/cf-DRetLmp-.svg +15 -0
  132. package/dist-vendor/assets/cg-CwIyG6SE.svg +12 -0
  133. package/dist-vendor/assets/cg-DxMYgdKd.svg +12 -0
  134. package/dist-vendor/assets/ch-Do8WoVrp.svg +9 -0
  135. package/dist-vendor/assets/ch-sfriZoF1.svg +9 -0
  136. package/dist-vendor/assets/chunk-KS7C4IRE-CUOVp-bd.js +34 -0
  137. package/dist-vendor/assets/ci-C8Q8IYTn.svg +7 -0
  138. package/dist-vendor/assets/ci-Cn5asHD7.svg +7 -0
  139. package/dist-vendor/assets/ck-DfXMUOTo.svg +9 -0
  140. package/dist-vendor/assets/ck-VjQ-vT4C.svg +9 -0
  141. package/dist-vendor/assets/cl-B2rf9gTF.svg +13 -0
  142. package/dist-vendor/assets/cl-BgYYb4qP.svg +13 -0
  143. package/dist-vendor/assets/cm-B0XEK3Gu.svg +15 -0
  144. package/dist-vendor/assets/cm-D4yjdmKT.svg +15 -0
  145. package/dist-vendor/assets/cn-DifnnI3t.svg +11 -0
  146. package/dist-vendor/assets/cn-sZmOitVP.svg +11 -0
  147. package/dist-vendor/assets/co-BRjxMuCM.svg +7 -0
  148. package/dist-vendor/assets/co-DV591zMm.svg +7 -0
  149. package/dist-vendor/assets/collection-diff-DfAYCE5v.js +64 -0
  150. package/dist-vendor/assets/cp-K_ay05Q_.svg +7 -0
  151. package/dist-vendor/assets/cp-k6oDAflT.svg +7 -0
  152. package/dist-vendor/assets/cr-BlYVN-_Q.svg +7 -0
  153. package/dist-vendor/assets/cr-CcuKkUIo.svg +7 -0
  154. package/dist-vendor/assets/cu-Bd4PmZCn.svg +13 -0
  155. package/dist-vendor/assets/cu-L6XVZNgo.svg +13 -0
  156. package/dist-vendor/assets/currencies-DKBTq4hu.js +1 -0
  157. package/dist-vendor/assets/cv-BYvkBxIi.svg +13 -0
  158. package/dist-vendor/assets/cv-CPsfcOfk.svg +13 -0
  159. package/dist-vendor/assets/cw-BbrnximR.svg +14 -0
  160. package/dist-vendor/assets/cw-DDrVSims.svg +14 -0
  161. package/dist-vendor/assets/cx-DpYD6n6U.svg +15 -0
  162. package/dist-vendor/assets/cx-zaaWd3zl.svg +15 -0
  163. package/dist-vendor/assets/cz-CgTuLLXv.svg +5 -0
  164. package/dist-vendor/assets/cz-WWBC5Aeb.svg +5 -0
  165. package/dist-vendor/assets/de-B-2o-4Z9.svg +5 -0
  166. package/dist-vendor/assets/de-D365bacb.svg +5 -0
  167. package/dist-vendor/assets/dist-BKeCzqrc.js +1 -0
  168. package/dist-vendor/assets/dj-C7tvpAUy.svg +13 -0
  169. package/dist-vendor/assets/dj-hp_BwbmO.svg +13 -0
  170. package/dist-vendor/assets/dk-2cglAULc.svg +5 -0
  171. package/dist-vendor/assets/dk-DmS9BCZB.svg +5 -0
  172. package/dist-vendor/assets/dz-Dytc1TFu.svg +5 -0
  173. package/dist-vendor/assets/dz-EwXBYPv9.svg +5 -0
  174. package/dist-vendor/assets/ee-B0tgUOEC.svg +5 -0
  175. package/dist-vendor/assets/ee-DufrxGIR.svg +5 -0
  176. package/dist-vendor/assets/eh-0awM4TVj.svg +16 -0
  177. package/dist-vendor/assets/eh-CsiwG8bE.svg +11 -0
  178. package/dist-vendor/assets/er-Cn365Y3V.svg +13 -0
  179. package/dist-vendor/assets/er-X83uml6t.svg +8 -0
  180. package/dist-vendor/assets/es-ct-CVyhLp7O.svg +4 -0
  181. package/dist-vendor/assets/es-ct-DdzobtBd.svg +4 -0
  182. package/dist-vendor/assets/es-pv-CO3NM2SE.svg +5 -0
  183. package/dist-vendor/assets/es-pv-DMotQiZd.svg +5 -0
  184. package/dist-vendor/assets/esm-DcxdDKtK.js +1 -0
  185. package/dist-vendor/assets/esm-DjwVeARy.js +23 -0
  186. package/dist-vendor/assets/esm-YFvMvTG9.css +1 -0
  187. package/dist-vendor/assets/et-DwdlzOIx.svg +14 -0
  188. package/dist-vendor/assets/et-cfPInayI.svg +14 -0
  189. package/dist-vendor/assets/eu-BE2G-Ars.svg +28 -0
  190. package/dist-vendor/assets/eu-Brdgz8ab.svg +28 -0
  191. package/dist-vendor/assets/fi-Brjq_KK6.svg +5 -0
  192. package/dist-vendor/assets/fi-DWUIkfjL.svg +5 -0
  193. package/dist-vendor/assets/flag-icons-CjdqQPWt.css +1 -0
  194. package/dist-vendor/assets/fm-B4Z83GL0.svg +11 -0
  195. package/dist-vendor/assets/fm-DwHuWFwM.svg +11 -0
  196. package/dist-vendor/assets/fo-ClIne8bc.svg +12 -0
  197. package/dist-vendor/assets/fo-DFjwyWur.svg +12 -0
  198. package/dist-vendor/assets/fr-C1eGzDWr.svg +5 -0
  199. package/dist-vendor/assets/fr-DVvUyOqI.svg +5 -0
  200. package/dist-vendor/assets/ga-BklUhLH_.svg +7 -0
  201. package/dist-vendor/assets/ga-CgNkrnfv.svg +7 -0
  202. package/dist-vendor/assets/gb-DSer7Jgn.svg +7 -0
  203. package/dist-vendor/assets/gb-DTXiLQoe.svg +7 -0
  204. package/dist-vendor/assets/gb-eng-C8iDhGHN.svg +5 -0
  205. package/dist-vendor/assets/gb-eng-DTHmDHq3.svg +5 -0
  206. package/dist-vendor/assets/gb-sct-D5L2FKKv.svg +4 -0
  207. package/dist-vendor/assets/gb-sct-fW5q01ek.svg +4 -0
  208. package/dist-vendor/assets/gd-CO-whzUe.svg +27 -0
  209. package/dist-vendor/assets/gd-m2vU81NR.svg +27 -0
  210. package/dist-vendor/assets/ge-B2RiL-Ih.svg +6 -0
  211. package/dist-vendor/assets/ge-DFOl98HB.svg +6 -0
  212. package/dist-vendor/assets/gf-DFQqfs-j.svg +5 -0
  213. package/dist-vendor/assets/gf-DWl5zcw0.svg +5 -0
  214. package/dist-vendor/assets/gg-jdOQS2nU.svg +9 -0
  215. package/dist-vendor/assets/gg-vhR8-Yxm.svg +9 -0
  216. package/dist-vendor/assets/gh-6yUjim7M.svg +6 -0
  217. package/dist-vendor/assets/gh-r3LP_X7q.svg +6 -0
  218. package/dist-vendor/assets/gi-BJKE9SzW.svg +32 -0
  219. package/dist-vendor/assets/gi-ZBwZ45zU.svg +32 -0
  220. package/dist-vendor/assets/gl-CHaBnMib.svg +4 -0
  221. package/dist-vendor/assets/gl-D6qP-fnE.svg +4 -0
  222. package/dist-vendor/assets/gm-Bu99atwn.svg +14 -0
  223. package/dist-vendor/assets/gm-DI7EpeCC.svg +9 -0
  224. package/dist-vendor/assets/gn-1dJNy9oQ.svg +7 -0
  225. package/dist-vendor/assets/gn-kt7YA1XT.svg +7 -0
  226. package/dist-vendor/assets/gp-BqGRs8a4.svg +5 -0
  227. package/dist-vendor/assets/gp-DNyt_wTA.svg +5 -0
  228. package/dist-vendor/assets/gr-C5PU0p9p.svg +16 -0
  229. package/dist-vendor/assets/gr-COThnT__.svg +16 -0
  230. package/dist-vendor/assets/group-field-DVQnXOEH.js +4 -0
  231. package/dist-vendor/assets/gw-BTWe96TV.svg +15 -0
  232. package/dist-vendor/assets/gw-D249VY33.svg +13 -0
  233. package/dist-vendor/assets/gy-CcVYUM2E.svg +9 -0
  234. package/dist-vendor/assets/gy-Dl6DrQIH.svg +9 -0
  235. package/dist-vendor/assets/hk-CUNIaSX0.svg +8 -0
  236. package/dist-vendor/assets/hk-omO_-Nil.svg +8 -0
  237. package/dist-vendor/assets/hm-Dh6t_Tj3.svg +8 -0
  238. package/dist-vendor/assets/hm-fgV6xItx.svg +8 -0
  239. package/dist-vendor/assets/hn-CRjyS_bm.svg +18 -0
  240. package/dist-vendor/assets/hn-GhlpqqjC.svg +18 -0
  241. package/dist-vendor/assets/hu-7Q5wwIIi.svg +7 -0
  242. package/dist-vendor/assets/hu-Bm8S5mAU.svg +7 -0
  243. package/dist-vendor/assets/i18next-HF060SlA.js +1 -0
  244. package/dist-vendor/assets/ic-CSo4d8tH.svg +7 -0
  245. package/dist-vendor/assets/ic-tiZZSA7Y.svg +7 -0
  246. package/dist-vendor/assets/id-CJiY5UnY.svg +4 -0
  247. package/dist-vendor/assets/id-DiSP6Fmm.svg +4 -0
  248. package/dist-vendor/assets/ie-ChAXClx3.svg +7 -0
  249. package/dist-vendor/assets/ie-DhxI4aJv.svg +7 -0
  250. package/dist-vendor/assets/il-CeFQotKl.svg +14 -0
  251. package/dist-vendor/assets/il-_56OEGLa.svg +14 -0
  252. package/dist-vendor/assets/in-BrINBvML.svg +25 -0
  253. package/dist-vendor/assets/in-Cdwu6Bq7.svg +25 -0
  254. package/dist-vendor/assets/index.dom-CA5INa_J.js +1 -0
  255. package/dist-vendor/assets/input-CbheVI3-.js +1 -0
  256. package/dist-vendor/assets/iq-CZIXYTmc.svg +10 -0
  257. package/dist-vendor/assets/iq-Dp8HDzo2.svg +10 -0
  258. package/dist-vendor/assets/is-CZjefTNV.svg +12 -0
  259. package/dist-vendor/assets/is-Cdq2ElPF.svg +12 -0
  260. package/dist-vendor/assets/it-Br7q0Zh6.svg +7 -0
  261. package/dist-vendor/assets/it-lvp2tGC_.svg +7 -0
  262. package/dist-vendor/assets/jm-CItSr3iX.svg +8 -0
  263. package/dist-vendor/assets/jm-CLL-w5oS.svg +8 -0
  264. package/dist-vendor/assets/jo-BAF1FGbm.svg +16 -0
  265. package/dist-vendor/assets/jo-CiGTAWEd.svg +16 -0
  266. package/dist-vendor/assets/jp-B5RfAVGb.svg +11 -0
  267. package/dist-vendor/assets/jp-BIMmfxpO.svg +11 -0
  268. package/dist-vendor/assets/jsx-runtime-By8HlURe.js +1 -0
  269. package/dist-vendor/assets/ke-C8foqndp.svg +23 -0
  270. package/dist-vendor/assets/ke-b02kYgZN.svg +23 -0
  271. package/dist-vendor/assets/km-B5tqtGG7.svg +16 -0
  272. package/dist-vendor/assets/km-D0jmlyBf.svg +16 -0
  273. package/dist-vendor/assets/kn-CHJJOZkG.svg +14 -0
  274. package/dist-vendor/assets/kn-DVPxDkNY.svg +14 -0
  275. package/dist-vendor/assets/kp-BsOq20Ii.svg +15 -0
  276. package/dist-vendor/assets/kp-CrDKzoxe.svg +15 -0
  277. package/dist-vendor/assets/kr-BCXH1Hao.svg +24 -0
  278. package/dist-vendor/assets/kr-KUIaWHQD.svg +17 -0
  279. package/dist-vendor/assets/kw-CIaYkhdM.svg +13 -0
  280. package/dist-vendor/assets/kw-fSBzmd30.svg +13 -0
  281. package/dist-vendor/assets/la-CuJflhIW.svg +12 -0
  282. package/dist-vendor/assets/la-cXlqIhGg.svg +12 -0
  283. package/dist-vendor/assets/lb-BSjpYEoo.svg +15 -0
  284. package/dist-vendor/assets/lb-DqFaKN7K.svg +15 -0
  285. package/dist-vendor/assets/lc-CNvab8Ae.svg +8 -0
  286. package/dist-vendor/assets/lc-DoQpaup4.svg +8 -0
  287. package/dist-vendor/assets/lr-B84vu3Ds.svg +14 -0
  288. package/dist-vendor/assets/lr-Zj2ZOITC.svg +14 -0
  289. package/dist-vendor/assets/ls-5Xk3Mxq5.svg +8 -0
  290. package/dist-vendor/assets/ls-B-MSA_Nj.svg +8 -0
  291. package/dist-vendor/assets/lt-CU4QmtZ-.svg +7 -0
  292. package/dist-vendor/assets/lt-DoukV-Sm.svg +7 -0
  293. package/dist-vendor/assets/lu-CCDqjGZj.svg +5 -0
  294. package/dist-vendor/assets/lu-DOI02Msy.svg +5 -0
  295. package/dist-vendor/assets/lv-C-KfY8Yc.svg +6 -0
  296. package/dist-vendor/assets/lv-DjyqV19Q.svg +6 -0
  297. package/dist-vendor/assets/ly-B0G7qBy-.svg +13 -0
  298. package/dist-vendor/assets/ly-BWpTK3ux.svg +13 -0
  299. package/dist-vendor/assets/ma-BNn_BSaU.svg +4 -0
  300. package/dist-vendor/assets/ma-BTRNTRUj.svg +4 -0
  301. package/dist-vendor/assets/mc-JhJMKfOk.svg +6 -0
  302. package/dist-vendor/assets/mc-PK078JHl.svg +6 -0
  303. package/dist-vendor/assets/mf-BaAGWwAq.svg +5 -0
  304. package/dist-vendor/assets/mf-DC-GBYih.svg +5 -0
  305. package/dist-vendor/assets/mg-C168LHXW.svg +7 -0
  306. package/dist-vendor/assets/mg-DDrNyYWg.svg +7 -0
  307. package/dist-vendor/assets/mh--hJdVdXy.svg +8 -0
  308. package/dist-vendor/assets/mh-gxuIp6Wk.svg +7 -0
  309. package/dist-vendor/assets/mk-Cx9Yf_ZD.svg +5 -0
  310. package/dist-vendor/assets/mk-D9SIMr-a.svg +5 -0
  311. package/dist-vendor/assets/ml-BBMGMlrT.svg +7 -0
  312. package/dist-vendor/assets/ml-DVf6ujpi.svg +7 -0
  313. package/dist-vendor/assets/mm-DB0gzm_2.svg +10 -0
  314. package/dist-vendor/assets/mm-lwT09MQ0.svg +12 -0
  315. package/dist-vendor/assets/mn-CNIDYiAG.svg +14 -0
  316. package/dist-vendor/assets/mn-CgXyw0O9.svg +14 -0
  317. package/dist-vendor/assets/mo-BAtCjuYA.svg +9 -0
  318. package/dist-vendor/assets/mo-CZPe8QjC.svg +9 -0
  319. package/dist-vendor/assets/mq-BFnJ22KI.svg +5 -0
  320. package/dist-vendor/assets/mq-Dt7FKNYb.svg +5 -0
  321. package/dist-vendor/assets/mr-Cqt475iO.svg +6 -0
  322. package/dist-vendor/assets/mr-D6G1wpeZ.svg +6 -0
  323. package/dist-vendor/assets/mu-B2mIIRce.svg +8 -0
  324. package/dist-vendor/assets/mu-mcq7cUFl.svg +8 -0
  325. package/dist-vendor/assets/mv-BXI4x8em.svg +6 -0
  326. package/dist-vendor/assets/mv-BynAllfM.svg +6 -0
  327. package/dist-vendor/assets/mw-C15nc1xZ.svg +10 -0
  328. package/dist-vendor/assets/mw-DkelfrL9.svg +15 -0
  329. package/dist-vendor/assets/my-BR3vHt6_.svg +18 -0
  330. package/dist-vendor/assets/my-Co4JeeyE.svg +26 -0
  331. package/dist-vendor/assets/mz-Bo6u1S_s.svg +21 -0
  332. package/dist-vendor/assets/mz-Drlr_USV.svg +21 -0
  333. package/dist-vendor/assets/na-0wFvily3.svg +16 -0
  334. package/dist-vendor/assets/na-D79ffb4Z.svg +16 -0
  335. package/dist-vendor/assets/nc-5j7wEmDR.svg +13 -0
  336. package/dist-vendor/assets/nc-Bw50_tBz.svg +12 -0
  337. package/dist-vendor/assets/ne-B1jPOYkl.svg +6 -0
  338. package/dist-vendor/assets/ne-Cium2f5G.svg +6 -0
  339. package/dist-vendor/assets/ng-CLL1nzMk.svg +6 -0
  340. package/dist-vendor/assets/ng-su4NM9If.svg +6 -0
  341. package/dist-vendor/assets/nl-BnOa6UiA.svg +5 -0
  342. package/dist-vendor/assets/nl-DKN85plC.svg +5 -0
  343. package/dist-vendor/assets/no-67wnnm5y.svg +7 -0
  344. package/dist-vendor/assets/no-qf2JPO73.svg +7 -0
  345. package/dist-vendor/assets/np-B4k6qJKf.svg +18 -0
  346. package/dist-vendor/assets/np-CIuq5GKd.svg +13 -0
  347. package/dist-vendor/assets/nr-DERIdzkN.svg +12 -0
  348. package/dist-vendor/assets/nr-SnI60Bgd.svg +12 -0
  349. package/dist-vendor/assets/nu-BfgWvGcd.svg +10 -0
  350. package/dist-vendor/assets/nu-Dm-LLXct.svg +10 -0
  351. package/dist-vendor/assets/nz-5vODdBjz.svg +36 -0
  352. package/dist-vendor/assets/nz-CaLnugvK.svg +36 -0
  353. package/dist-vendor/assets/pa-BLNN9G2-.svg +14 -0
  354. package/dist-vendor/assets/pa-BzRYvRsl.svg +13 -0
  355. package/dist-vendor/assets/pc-BJpYiA9b.svg +33 -0
  356. package/dist-vendor/assets/pc-D9OuqgOn.svg +33 -0
  357. package/dist-vendor/assets/pe--eye3JWr.svg +4 -0
  358. package/dist-vendor/assets/pe-BLqhuu1C.svg +4 -0
  359. package/dist-vendor/assets/pf-C8ahG68q.svg +19 -0
  360. package/dist-vendor/assets/pf-e6q_5ubr.svg +18 -0
  361. package/dist-vendor/assets/pg-BAYpbp9Z.svg +9 -0
  362. package/dist-vendor/assets/pg-nBvUkq7v.svg +16 -0
  363. package/dist-vendor/assets/ph-B10ogxgQ.svg +6 -0
  364. package/dist-vendor/assets/ph-BEzTn62K.svg +6 -0
  365. package/dist-vendor/assets/phone-input-impl-tGfTKVIJ.js +19 -0
  366. package/dist-vendor/assets/pk-BnahYzav.svg +15 -0
  367. package/dist-vendor/assets/pk-CWMEc3ad.svg +15 -0
  368. package/dist-vendor/assets/pl-jl6riBSr.svg +6 -0
  369. package/dist-vendor/assets/pl-o38JROoc.svg +6 -0
  370. package/dist-vendor/assets/pm-CHiP5UmZ.svg +5 -0
  371. package/dist-vendor/assets/pm-CatGySkp.svg +5 -0
  372. package/dist-vendor/assets/popover-Cg1zTBmw.js +1 -0
  373. package/dist-vendor/assets/pr-B4tMV0xm.svg +13 -0
  374. package/dist-vendor/assets/pr-DjaQzs0K.svg +13 -0
  375. package/dist-vendor/assets/ps-CEUcLi5W.svg +6 -0
  376. package/dist-vendor/assets/ps-DO8YKYeS.svg +6 -0
  377. package/dist-vendor/assets/pw-CQP52WMX.svg +11 -0
  378. package/dist-vendor/assets/pw-DOQyn2PV.svg +11 -0
  379. package/dist-vendor/assets/qa-CekFoc-3.svg +4 -0
  380. package/dist-vendor/assets/qa-Dkmpc78M.svg +4 -0
  381. package/dist-vendor/assets/re-Bg1MZWMt.svg +7 -0
  382. package/dist-vendor/assets/re-Bk4ipYK1.svg +5 -0
  383. package/dist-vendor/assets/react-CZI7_Jkm.js +1 -0
  384. package/dist-vendor/assets/react-dom-cJyBB_A4.js +1 -0
  385. package/dist-vendor/assets/registry-DBG9QhcD.js +66 -0
  386. package/dist-vendor/assets/ro-C2av9jVe.svg +7 -0
  387. package/dist-vendor/assets/ro-CoSeqKY1.svg +7 -0
  388. package/dist-vendor/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  389. package/dist-vendor/assets/ru-D-4tNwXt.svg +5 -0
  390. package/dist-vendor/assets/ru-DbUtf_DX.svg +5 -0
  391. package/dist-vendor/assets/rw-CcIfVufE.svg +13 -0
  392. package/dist-vendor/assets/rw-D7nbSYKI.svg +13 -0
  393. package/dist-vendor/assets/sb-BDTYjcbk.svg +13 -0
  394. package/dist-vendor/assets/sb-Dv-Gc94i.svg +13 -0
  395. package/dist-vendor/assets/sc-CRNsSLg9.svg +7 -0
  396. package/dist-vendor/assets/sc-DFTNEfqs.svg +7 -0
  397. package/dist-vendor/assets/scroll-area-KiRIggDo.js +1 -0
  398. package/dist-vendor/assets/sd-BwHx54f9.svg +13 -0
  399. package/dist-vendor/assets/sd-ClziNjGr.svg +13 -0
  400. package/dist-vendor/assets/se-8C923vhy.svg +4 -0
  401. package/dist-vendor/assets/se-DHad7SFX.svg +4 -0
  402. package/dist-vendor/assets/sg-DGYIMG0G.svg +13 -0
  403. package/dist-vendor/assets/sg-DisnRdSe.svg +13 -0
  404. package/dist-vendor/assets/sh-DBww0RCW.svg +7 -0
  405. package/dist-vendor/assets/sh-DNImvbrE.svg +7 -0
  406. package/dist-vendor/assets/si-BDW--7ta.svg +18 -0
  407. package/dist-vendor/assets/si-BMKT-Tec.svg +18 -0
  408. package/dist-vendor/assets/sj-AM0BJ0qg.svg +7 -0
  409. package/dist-vendor/assets/sj-BFFEGknm.svg +7 -0
  410. package/dist-vendor/assets/sk-8lQCLAqV.svg +9 -0
  411. package/dist-vendor/assets/sk-K9BNIYAO.svg +9 -0
  412. package/dist-vendor/assets/sl-C0dI8IsG.svg +12 -0
  413. package/dist-vendor/assets/sl-DxLJY5vJ.svg +7 -0
  414. package/dist-vendor/assets/sn-C4abx9Xn.svg +8 -0
  415. package/dist-vendor/assets/sn-S8ipNF1U.svg +8 -0
  416. package/dist-vendor/assets/so-BpxKZJzu.svg +11 -0
  417. package/dist-vendor/assets/so-DlzA2Fco.svg +11 -0
  418. package/dist-vendor/assets/sort-rows-FW_ghcyz.js +1 -0
  419. package/dist-vendor/assets/sr-CfMKAfua.svg +6 -0
  420. package/dist-vendor/assets/sr-Co7OKBh3.svg +6 -0
  421. package/dist-vendor/assets/ss-C_PPJ8V2.svg +8 -0
  422. package/dist-vendor/assets/ss-CxVEpdPD.svg +8 -0
  423. package/dist-vendor/assets/st-AMcb9FhJ.svg +16 -0
  424. package/dist-vendor/assets/st-C1Nd1c3V.svg +16 -0
  425. package/dist-vendor/assets/sy-Dpn5i9ke.svg +6 -0
  426. package/dist-vendor/assets/sy-DwSud114.svg +6 -0
  427. package/dist-vendor/assets/td-BsuVhZpT.svg +7 -0
  428. package/dist-vendor/assets/td-Ddv_29rE.svg +7 -0
  429. package/dist-vendor/assets/tf-Co33RhQH.svg +15 -0
  430. package/dist-vendor/assets/tf-DSn8VxE3.svg +15 -0
  431. package/dist-vendor/assets/tg-BpRxi4F-.svg +14 -0
  432. package/dist-vendor/assets/tg-CP1-sc35.svg +14 -0
  433. package/dist-vendor/assets/th-DK2zZyMY.svg +7 -0
  434. package/dist-vendor/assets/th-tzq84hgd.svg +7 -0
  435. package/dist-vendor/assets/tj-BWWBVTk9.svg +26 -0
  436. package/dist-vendor/assets/tj-b-aWfOTb.svg +22 -0
  437. package/dist-vendor/assets/tk-CDucsEss.svg +5 -0
  438. package/dist-vendor/assets/tk-CZEI6mqd.svg +5 -0
  439. package/dist-vendor/assets/tl-wpo93AGk.svg +13 -0
  440. package/dist-vendor/assets/tl-zghdr7_K.svg +13 -0
  441. package/dist-vendor/assets/tn-BcKCZULf.svg +4 -0
  442. package/dist-vendor/assets/tn-DcO8DL80.svg +4 -0
  443. package/dist-vendor/assets/to-6m55WaQo.svg +10 -0
  444. package/dist-vendor/assets/to-D8uVsoxb.svg +10 -0
  445. package/dist-vendor/assets/tr-Cd6FO9Bg.svg +8 -0
  446. package/dist-vendor/assets/tr-Dgwi_nfe.svg +8 -0
  447. package/dist-vendor/assets/tt-CTnr7aY5.svg +5 -0
  448. package/dist-vendor/assets/tt-f6m2xq_2.svg +7 -0
  449. package/dist-vendor/assets/tv-DDqkVT-n.svg +9 -0
  450. package/dist-vendor/assets/tv-MqebyrVm.svg +9 -0
  451. package/dist-vendor/assets/tw-BGxVDCOL.svg +32 -0
  452. package/dist-vendor/assets/tw-d-Mf-0VT.svg +34 -0
  453. package/dist-vendor/assets/tz-BUVjlfC1.svg +15 -0
  454. package/dist-vendor/assets/tz-BjLtHeil.svg +13 -0
  455. package/dist-vendor/assets/ua-Bq0XgQqK.svg +6 -0
  456. package/dist-vendor/assets/ua-BquxXKta.svg +6 -0
  457. package/dist-vendor/assets/ug-ByL2ejGl.svg +30 -0
  458. package/dist-vendor/assets/ug-CQ8d5RQC.svg +30 -0
  459. package/dist-vendor/assets/um-Bhke9Eic.svg +9 -0
  460. package/dist-vendor/assets/um-DreQrsBl.svg +9 -0
  461. package/dist-vendor/assets/us-C73uVeEr.svg +9 -0
  462. package/dist-vendor/assets/us-DAM9Utrf.svg +9 -0
  463. package/dist-vendor/assets/useTranslation-RqY_bF-3.js +1 -0
  464. package/dist-vendor/assets/uy-B2Qs7aGx.svg +28 -0
  465. package/dist-vendor/assets/uy-DD6peej-.svg +28 -0
  466. package/dist-vendor/assets/uz-C2f-Cubn.svg +30 -0
  467. package/dist-vendor/assets/uz-rmSB_IKB.svg +30 -0
  468. package/dist-vendor/assets/vc-COpmFovN.svg +8 -0
  469. package/dist-vendor/assets/vc-DaYqUZD4.svg +8 -0
  470. package/dist-vendor/assets/ve-BSqnIB9l.svg +26 -0
  471. package/dist-vendor/assets/ve-L4X6NQ3q.svg +26 -0
  472. package/dist-vendor/assets/vn-BEAEijd0.svg +11 -0
  473. package/dist-vendor/assets/vn-CsUBJx2L.svg +11 -0
  474. package/dist-vendor/assets/vu-BIFa5Beu.svg +21 -0
  475. package/dist-vendor/assets/vu-D6k0NQlg.svg +21 -0
  476. package/dist-vendor/assets/wf-BC64oop4.svg +5 -0
  477. package/dist-vendor/assets/wf-DrxpOO_G.svg +5 -0
  478. package/dist-vendor/assets/ws-IVFNwTc1.svg +7 -0
  479. package/dist-vendor/assets/ws-vzJNwdVm.svg +7 -0
  480. package/dist-vendor/assets/xx-DHLZWhOc.svg +4 -0
  481. package/dist-vendor/assets/xx-zm_JmrXl.svg +4 -0
  482. package/dist-vendor/assets/ye-BwST9gXC.svg +7 -0
  483. package/dist-vendor/assets/ye-Ir8OtngQ.svg +7 -0
  484. package/dist-vendor/assets/yt-BGlbbiEn.svg +5 -0
  485. package/dist-vendor/assets/yt-DIfEG0ex.svg +5 -0
  486. package/dist-vendor/assets/za-BUKoH9qm.svg +17 -0
  487. package/dist-vendor/assets/za-Jz40JTrv.svg +17 -0
  488. package/dist-vendor/i18next.js +1 -1208
  489. package/dist-vendor/jsx-runtime.js +1 -6
  490. package/dist-vendor/react-dom-client.js +9 -0
  491. package/dist-vendor/react-dom.js +1 -6
  492. package/dist-vendor/react-i18next.js +1 -0
  493. package/dist-vendor/react-router-dom.js +6 -1705
  494. package/dist-vendor/react.js +1 -6
  495. package/dist-vendor/sdk.js +1 -0
  496. package/dist-vendor/web-ui/lib/oklch.js +1 -0
  497. package/dist-vendor/web-ui/render/blocks.js +1 -0
  498. package/dist-vendor/web-ui/render/core.js +11 -0
  499. package/dist-vendor/web-ui.js +1 -67946
  500. package/package.json +1 -1
  501. package/dist/assets/ChatWidget-CZFJNVBt.js +0 -5
  502. package/dist/assets/DiagnosticsPage-BRGLbMCb.js +0 -1
  503. package/dist/assets/GeoMap-B1DFGu6_.js +0 -1
  504. package/dist/assets/GeoMap-vh-t_kPv.css +0 -1
  505. package/dist/assets/MarkdownEditor-DsKPqeIt.js +0 -189
  506. package/dist/assets/NewRecordView-B1jdKkrr.js +0 -1
  507. package/dist/assets/PluginSettingsPage-Dasrpx47.js +0 -1
  508. package/dist/assets/ScanSummary-xxY2oZVM.js +0 -1
  509. package/dist/assets/SettingsForm-C-xB5cdD.js +0 -1
  510. package/dist/assets/SettingsPage-DjRQ1bY5.js +0 -3
  511. package/dist/assets/ThemeSwitcher-BJRcZMR7.js +0 -1
  512. package/dist/assets/api-QNHQU9to.js +0 -1
  513. package/dist/assets/auth-context-CoCE5oPD.js +0 -1
  514. package/dist/assets/condition-B5taAXkb.js +0 -1
  515. package/dist/assets/countries-CoGvAZ5u.js +0 -1
  516. package/dist/assets/data-size-CO-LGHbN.js +0 -1
  517. package/dist/assets/development-ChLInqDF.js +0 -1
  518. package/dist/assets/dist-COeDLrWj.js +0 -1
  519. package/dist/assets/esm-CX8ST5Fv.js +0 -1
  520. package/dist/assets/esm-YFvMvTG9.css +0 -1
  521. package/dist/assets/esm-oGoWacTd.js +0 -24
  522. package/dist/assets/extend-CHOe1AVl.js +0 -1
  523. package/dist/assets/fields-Ce51pRua.js +0 -64
  524. package/dist/assets/file-text-BdYRF4MO.js +0 -1
  525. package/dist/assets/flag-icons-CTDpPZQq.css +0 -1
  526. package/dist/assets/i18n-vendor-T6EnJ_TL.js +0 -13
  527. package/dist/assets/ical-FRtCagm-.js +0 -8
  528. package/dist/assets/icons-0CjpO0K1.js +0 -6
  529. package/dist/assets/ilamy-view-D7DQZ577.js +0 -7
  530. package/dist/assets/index-CpRTFlxk.js +0 -22
  531. package/dist/assets/index-Le8YFirR.css +0 -2
  532. package/dist/assets/input-BFMNMo6y.js +0 -1
  533. package/dist/assets/list-cache-wPeWyKg1.js +0 -1
  534. package/dist/assets/markdown-vendor-WSL3P01P.js +0 -56
  535. package/dist/assets/phone-input-3xV95mM6.js +0 -1
  536. package/dist/assets/phone-input-8QtHMHO_.js +0 -21
  537. package/dist/assets/plugin-Cjr7lgQH.js +0 -1
  538. package/dist/assets/plugin-label-CfdhA4_L.js +0 -1
  539. package/dist/assets/popover-UkAmHo3Y.js +0 -1
  540. package/dist/assets/react-vendor-CzSUaSLk.js +0 -229
  541. package/dist/assets/registration-43gjHJ3X.js +0 -1
  542. package/dist/assets/rolldown-runtime-QTnfLwEv.js +0 -1
  543. package/dist/assets/settings-BEzSaRjz.js +0 -1
  544. package/dist/assets/shelf-DjiUBfgQ.js +0 -1
  545. package/dist/assets/showcase-BeBnutzT.js +0 -1
  546. package/dist/assets/src-B-FFwJ-G.js +0 -1
  547. package/dist/assets/src-B1LWYTOR.js +0 -2
  548. package/dist/assets/src-B7dY0wwO.js +0 -4
  549. package/dist/assets/src-BDP8FIN_.js +0 -1
  550. package/dist/assets/src-BPuTgDYD.js +0 -1
  551. package/dist/assets/src-BRP-DLVM2.js +0 -1
  552. package/dist/assets/src-BU56fYCH2.js +0 -1
  553. package/dist/assets/src-BmgYgIDb.js +0 -1
  554. package/dist/assets/src-Bzgh6Ge5.js +0 -1
  555. package/dist/assets/src-C06O0ceD.js +0 -1
  556. package/dist/assets/src-CCeQIMl_.js +0 -1
  557. package/dist/assets/src-CgXkpslu.js +0 -1
  558. package/dist/assets/src-CheiTWox.js +0 -7
  559. package/dist/assets/src-CjPxrk6V.js +0 -1
  560. package/dist/assets/src-Co7xh07B.js +0 -1
  561. package/dist/assets/src-CtQWxdaS.js +0 -8
  562. package/dist/assets/src-CwyJPFKQ.js +0 -1
  563. package/dist/assets/src-Cz38tTr3.js +0 -1
  564. package/dist/assets/src-DDtMlZ03.js +0 -1
  565. package/dist/assets/src-DNx0vmvI.js +0 -1
  566. package/dist/assets/src-DjrjxzQu.js +0 -1
  567. package/dist/assets/src-Dsh4Yd_x.js +0 -6
  568. package/dist/assets/src-Du26RLvk.js +0 -1
  569. package/dist/assets/src-G94LYhEo.js +0 -1
  570. package/dist/assets/src-aPsTM6Fr.js +0 -1
  571. package/dist/assets/src-iJXhTwKd.js +0 -1
  572. package/dist/assets/src-rXsbV4Ce.js +0 -6
  573. package/dist/assets/ui-BLiPhfyz.js +0 -2
  574. package/dist/assets/ui-DL6R5B56.js +0 -2
  575. package/dist/assets/ui-jz6tZ6GD.js +0 -2
  576. package/dist/assets/ui-mefYc6et.js +0 -2
  577. package/dist/assets/ui-vendor-ByG3otld.js +0 -44
  578. package/dist-vendor/chunk-KS7C4IRE-CACNl8KN.js +0 -6349
  579. package/dist-vendor/jsx-runtime-BiMSyZU3.js +0 -22
  580. package/dist-vendor/react-Be14ySWY.js +0 -293
  581. package/dist-vendor/react-dom-Dvp3Hdeu.js +0 -131
  582. package/dist-vendor/rolldown-runtime-Dqa2HsxW.js +0 -20
  583. package/dist-vendor/web.css +0 -2
  584. /package/{dist → dist-vendor}/assets/ad-B18i8NGa.svg +0 -0
  585. /package/{dist → dist-vendor}/assets/ad-Blhdm5jl.svg +0 -0
  586. /package/{dist → dist-vendor}/assets/af-Bc2fqp73.svg +0 -0
  587. /package/{dist → dist-vendor}/assets/af-C77Rf6cE.svg +0 -0
  588. /package/{dist → dist-vendor}/assets/arab-C-KgnQEz.svg +0 -0
  589. /package/{dist → dist-vendor}/assets/arab-C4CYPgyC.svg +0 -0
  590. /package/{dist → dist-vendor}/assets/as-BTEVCXG-.svg +0 -0
  591. /package/{dist → dist-vendor}/assets/as-Dekqy8Of.svg +0 -0
  592. /package/{dist → dist-vendor}/assets/aw-CLCX8uk5.svg +0 -0
  593. /package/{dist → dist-vendor}/assets/aw-W0PWLK5p.svg +0 -0
  594. /package/{dist → dist-vendor}/assets/bm-BeYgB2z9.svg +0 -0
  595. /package/{dist → dist-vendor}/assets/bm-DvNWWcPM.svg +0 -0
  596. /package/{dist → dist-vendor}/assets/bn-B6T3O78g.svg +0 -0
  597. /package/{dist → dist-vendor}/assets/bn-CPQcA8Ol.svg +0 -0
  598. /package/{dist → dist-vendor}/assets/bo-CcUiMqkJ.svg +0 -0
  599. /package/{dist → dist-vendor}/assets/bo-Dry0C6UA.svg +0 -0
  600. /package/{dist → dist-vendor}/assets/br-Cu5YU29T.svg +0 -0
  601. /package/{dist → dist-vendor}/assets/br-Dr5rMAMb.svg +0 -0
  602. /package/{dist → dist-vendor}/assets/bt-BTo4qm10.svg +0 -0
  603. /package/{dist → dist-vendor}/assets/bt-SxWnbWW0.svg +0 -0
  604. /package/{dist → dist-vendor}/assets/bz-BCKHR4_q.svg +0 -0
  605. /package/{dist → dist-vendor}/assets/bz-CoBdB-p8.svg +0 -0
  606. /package/{dist → dist-vendor}/assets/cy-DJKnEFYW.svg +0 -0
  607. /package/{dist → dist-vendor}/assets/cy-bZuP8hmf.svg +0 -0
  608. /package/{dist → dist-vendor}/assets/dg-CJPJrjiZ.svg +0 -0
  609. /package/{dist → dist-vendor}/assets/dg-DqkWLbnk.svg +0 -0
  610. /package/{dist → dist-vendor}/assets/dm-Cbhezfe1.svg +0 -0
  611. /package/{dist → dist-vendor}/assets/dm-DPPHwW2M.svg +0 -0
  612. /package/{dist → dist-vendor}/assets/do-B86d445t.svg +0 -0
  613. /package/{dist → dist-vendor}/assets/do-DeRnbj4d.svg +0 -0
  614. /package/{dist → dist-vendor}/assets/eac-CwGQsyAM.svg +0 -0
  615. /package/{dist → dist-vendor}/assets/eac-h4QKADRE.svg +0 -0
  616. /package/{dist → dist-vendor}/assets/ec-CaVOFQ3t.svg +0 -0
  617. /package/{dist → dist-vendor}/assets/ec-cwfBJlvF.svg +0 -0
  618. /package/{dist → dist-vendor}/assets/eg-DwOkwyQ0.svg +0 -0
  619. /package/{dist → dist-vendor}/assets/eg-YC70hswZ.svg +0 -0
  620. /package/{dist → dist-vendor}/assets/es-BuSGTZm_.svg +0 -0
  621. /package/{dist → dist-vendor}/assets/es-d5m8M5h8.svg +0 -0
  622. /package/{dist → dist-vendor}/assets/es-ga-D9xG2hYr.svg +0 -0
  623. /package/{dist → dist-vendor}/assets/es-ga-DXhVZ333.svg +0 -0
  624. /package/{dist → dist-vendor}/assets/fj-DEAVMg38.svg +0 -0
  625. /package/{dist → dist-vendor}/assets/fj-u3dAPoew.svg +0 -0
  626. /package/{dist → dist-vendor}/assets/fk-B-RvQ4Hz.svg +0 -0
  627. /package/{dist → dist-vendor}/assets/fk-nuUF_Ak3.svg +0 -0
  628. /package/{dist → dist-vendor}/assets/gb-nir-D4gikpNq.svg +0 -0
  629. /package/{dist → dist-vendor}/assets/gb-nir-vEp1ZXy6.svg +0 -0
  630. /package/{dist → dist-vendor}/assets/gb-wls-Bxz9hxvX.svg +0 -0
  631. /package/{dist → dist-vendor}/assets/gb-wls-CK0XlKT-.svg +0 -0
  632. /package/{dist → dist-vendor}/assets/gq-CPnMO1hT.svg +0 -0
  633. /package/{dist → dist-vendor}/assets/gq-Cag8QTk2.svg +0 -0
  634. /package/{dist → dist-vendor}/assets/gs-DOgYbHsY.svg +0 -0
  635. /package/{dist → dist-vendor}/assets/gs-DiiNa0F5.svg +0 -0
  636. /package/{dist → dist-vendor}/assets/gt-BLpn5qMn.svg +0 -0
  637. /package/{dist → dist-vendor}/assets/gt-CJo5DI-7.svg +0 -0
  638. /package/{dist → dist-vendor}/assets/gu-Di1JYREk.svg +0 -0
  639. /package/{dist → dist-vendor}/assets/gu-SbvrH0uZ.svg +0 -0
  640. /package/{dist → dist-vendor}/assets/hr-BpiVVBoV.svg +0 -0
  641. /package/{dist → dist-vendor}/assets/hr-fzLfaANM.svg +0 -0
  642. /package/{dist → dist-vendor}/assets/ht-DIMg4gti.svg +0 -0
  643. /package/{dist → dist-vendor}/assets/ht-pweRl6ZP.svg +0 -0
  644. /package/{dist → dist-vendor}/assets/im--VPIqfkF.svg +0 -0
  645. /package/{dist → dist-vendor}/assets/im-Dd9p-0-T.svg +0 -0
  646. /package/{dist → dist-vendor}/assets/io-13HOfeJD.svg +0 -0
  647. /package/{dist → dist-vendor}/assets/io-BImhNBcd.svg +0 -0
  648. /package/{dist → dist-vendor}/assets/ir-Q03Mij62.svg +0 -0
  649. /package/{dist → dist-vendor}/assets/ir-cCIgaNf6.svg +0 -0
  650. /package/{dist → dist-vendor}/assets/je-DyWbhIiC.svg +0 -0
  651. /package/{dist → dist-vendor}/assets/je-vXe0Dr49.svg +0 -0
  652. /package/{dist → dist-vendor}/assets/kg-B0FsxZiL.svg +0 -0
  653. /package/{dist → dist-vendor}/assets/kg-CjfitMyT.svg +0 -0
  654. /package/{dist → dist-vendor}/assets/kh-BBvObpUS.svg +0 -0
  655. /package/{dist → dist-vendor}/assets/kh-BeWfuE30.svg +0 -0
  656. /package/{dist → dist-vendor}/assets/ki-fuIMkEYQ.svg +0 -0
  657. /package/{dist → dist-vendor}/assets/ki-p_fAQGbS.svg +0 -0
  658. /package/{dist → dist-vendor}/assets/ky-BqaZHuhf.svg +0 -0
  659. /package/{dist → dist-vendor}/assets/ky-Dpsu1myA.svg +0 -0
  660. /package/{dist → dist-vendor}/assets/kz-CwKXYZ8s.svg +0 -0
  661. /package/{dist → dist-vendor}/assets/kz-Dkyx6q-p.svg +0 -0
  662. /package/{dist → dist-vendor}/assets/li-CHdhvNcr.svg +0 -0
  663. /package/{dist → dist-vendor}/assets/li-CMlf0YU8.svg +0 -0
  664. /package/{dist → dist-vendor}/assets/lk-DSQoDxn_.svg +0 -0
  665. /package/{dist → dist-vendor}/assets/lk-DUkgV9Tq.svg +0 -0
  666. /package/{dist → dist-vendor}/assets/md-DRlxvNwm.svg +0 -0
  667. /package/{dist → dist-vendor}/assets/md-DTi94M3M.svg +0 -0
  668. /package/{dist → dist-vendor}/assets/me-CfGorN3b.svg +0 -0
  669. /package/{dist → dist-vendor}/assets/me-Cv4Gwqah.svg +0 -0
  670. /package/{dist → dist-vendor}/assets/mp-CrOApEqW.svg +0 -0
  671. /package/{dist → dist-vendor}/assets/mp-CuaQmCLf.svg +0 -0
  672. /package/{dist → dist-vendor}/assets/ms-B-w7hFKu.svg +0 -0
  673. /package/{dist → dist-vendor}/assets/ms-DxciGbUu.svg +0 -0
  674. /package/{dist → dist-vendor}/assets/mt-YDa8zgzO.svg +0 -0
  675. /package/{dist → dist-vendor}/assets/mt-YqzKx9xl.svg +0 -0
  676. /package/{dist → dist-vendor}/assets/mx-Cc8Ccfe8.svg +0 -0
  677. /package/{dist → dist-vendor}/assets/mx-CvCwYHGF.svg +0 -0
  678. /package/{dist → dist-vendor}/assets/nf-DGrQb42O.svg +0 -0
  679. /package/{dist → dist-vendor}/assets/nf-Dl00mlk2.svg +0 -0
  680. /package/{dist → dist-vendor}/assets/ni-BX2WCaNt.svg +0 -0
  681. /package/{dist → dist-vendor}/assets/ni-CcFCSQxm.svg +0 -0
  682. /package/{dist → dist-vendor}/assets/om-DcqxRdQL.svg +0 -0
  683. /package/{dist → dist-vendor}/assets/om-nN8zP2Bu.svg +0 -0
  684. /package/{dist → dist-vendor}/assets/pn-BPAlH32D.svg +0 -0
  685. /package/{dist → dist-vendor}/assets/pn-DgxdtieE.svg +0 -0
  686. /package/{dist → dist-vendor}/assets/pt-BTevY6N2.svg +0 -0
  687. /package/{dist → dist-vendor}/assets/pt-DZ2ADgIR.svg +0 -0
  688. /package/{dist → dist-vendor}/assets/py-BKi5dxWt.svg +0 -0
  689. /package/{dist → dist-vendor}/assets/py-mNzh0mZC.svg +0 -0
  690. /package/{dist → dist-vendor}/assets/rs-BfwKwXtn.svg +0 -0
  691. /package/{dist → dist-vendor}/assets/rs-CnTO3ehk.svg +0 -0
  692. /package/{dist → dist-vendor}/assets/sa-Dh79zbT9.svg +0 -0
  693. /package/{dist → dist-vendor}/assets/sa-DnlyVVKx.svg +0 -0
  694. /package/{dist → dist-vendor}/assets/sh-ac-D-aE2xRW.svg +0 -0
  695. /package/{dist → dist-vendor}/assets/sh-ac-FjwY7RYr.svg +0 -0
  696. /package/{dist → dist-vendor}/assets/sh-hl-CgxUDvtv.svg +0 -0
  697. /package/{dist → dist-vendor}/assets/sh-hl-CqtQPzWZ.svg +0 -0
  698. /package/{dist → dist-vendor}/assets/sh-ta-BFo5zkKU.svg +0 -0
  699. /package/{dist → dist-vendor}/assets/sh-ta-CPJublpi.svg +0 -0
  700. /package/{dist → dist-vendor}/assets/sm-BKrUHzrq.svg +0 -0
  701. /package/{dist → dist-vendor}/assets/sm-DGBIRFB_.svg +0 -0
  702. /package/{dist → dist-vendor}/assets/sv-CJIHhYwF.svg +0 -0
  703. /package/{dist → dist-vendor}/assets/sv-RZ39q5hO.svg +0 -0
  704. /package/{dist → dist-vendor}/assets/sx-RKKs0ph6.svg +0 -0
  705. /package/{dist → dist-vendor}/assets/sx-nDhIaDNb.svg +0 -0
  706. /package/{dist → dist-vendor}/assets/sz-D39eIL5d.svg +0 -0
  707. /package/{dist → dist-vendor}/assets/sz-qxMwa2gs.svg +0 -0
  708. /package/{dist → dist-vendor}/assets/tc-CJHJmJj1.svg +0 -0
  709. /package/{dist → dist-vendor}/assets/tc-dtelpZmc.svg +0 -0
  710. /package/{dist → dist-vendor}/assets/tm-C_WSgUcv.svg +0 -0
  711. /package/{dist → dist-vendor}/assets/tm-DGBJvQay.svg +0 -0
  712. /package/{dist → dist-vendor}/assets/un-Bqg4Cbbh.svg +0 -0
  713. /package/{dist → dist-vendor}/assets/un-DabL4p35.svg +0 -0
  714. /package/{dist → dist-vendor}/assets/va-B9-hqIE-.svg +0 -0
  715. /package/{dist → dist-vendor}/assets/va-s7kyhqIM.svg +0 -0
  716. /package/{dist → dist-vendor}/assets/vg-C7xY6pic.svg +0 -0
  717. /package/{dist → dist-vendor}/assets/vg-ClZ-0KpG.svg +0 -0
  718. /package/{dist → dist-vendor}/assets/vi-BC_zcciE.svg +0 -0
  719. /package/{dist → dist-vendor}/assets/vi-BSdsyIxY.svg +0 -0
  720. /package/{dist → dist-vendor}/assets/xk-Bj15g7cp.svg +0 -0
  721. /package/{dist → dist-vendor}/assets/xk-Cdz2uTvR.svg +0 -0
  722. /package/{dist → dist-vendor}/assets/zm-BmsW91ne.svg +0 -0
  723. /package/{dist → dist-vendor}/assets/zm-D8B-0kdx.svg +0 -0
  724. /package/{dist → dist-vendor}/assets/zw-CSuuaw9K.svg +0 -0
  725. /package/{dist → dist-vendor}/assets/zw-U0m7oJ5e.svg +0 -0
@@ -0,0 +1,191 @@
1
+ import{n as _r,r as zr,t as hm}from"./rolldown-runtime-QTnfLwEv.js";import{t as pm}from"./react-CZI7_Jkm.js";import{t as fm}from"./react-dom-cJyBB_A4.js";import{t as mm}from"./jsx-runtime-By8HlURe.js";import{n as gm,t as An}from"./useTranslation-RqY_bF-3.js";import{$n as ll,at as ym,er as yt,it as km,ot as bm,st as wm,t as Eo,tt as vm}from"./input-CbheVI3-.js";import{C as xm,D as Cm,E as Sm,O as Em,S as Mm,T as Am,b as Dm,c as Tm,i as Om,k as Nm,t as Rm,w as _m,x as zm}from"./popover-Cg1zTBmw.js";var $m=yt("between-horizontal-end",[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]]),Lm=yt("between-vertical-end",[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]]),Im=yt("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),Fm=yt("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),Bm=yt("grid-2x2-x",[["path",{d:"M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3",key:"11za1p"}],["path",{d:"m16 16 5 5",key:"8tpb07"}],["path",{d:"m16 21 5-5",key:"193jll"}]]),Pm=yt("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),jm=yt("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]),Hm=yt("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]),qm=yt("image-plus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]),Vm=yt("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),Wm=yt("redo-2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]),Um=yt("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),Km=yt("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Jm=yt("unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),L=zr(pm(),1),Gm=zr(fm(),1),T=zr(mm(),1),cl=gm(),Zm=vm();function rt(t){this.content=t}rt.prototype={constructor:rt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new rt(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new rt(n)},addToStart:function(t,e){return new rt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new rt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new rt(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=rt.from(t),t.size?new rt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rt.from(t),t.size?new rt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=rt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},rt.from=function(t){if(t instanceof rt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new rt(e)};function dl(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){let s=i.text,a=o.text,l=0;for(;s[l]==a[l];l++)n++;return l&&l<s.length&&l<a.length&&pl(s.charCodeAt(l-1))&&hl(s.charCodeAt(l))&&n--,n}if(i.content.size||o.content.size){let s=dl(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ul(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=s.text,d=a.text,u=c.length,h=d.length;for(;u>0&&h>0&&c[u-1]==d[h-1];)u--,h--,n--,r--;return u&&h&&u<c.length&&pl(c.charCodeAt(u-1))&&hl(c.charCodeAt(u))&&(n++,r++),{a:n,b:r}}if(s.content.size||a.content.size){let c=ul(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function hl(t){return t>=56320&&t<57344}function pl(t){return t>=55296&&t<56320}var x=class gt{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new gt(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new gt(r,i)}cutByIndex(e,n){return e==n?gt.empty:e==0&&n==this.content.length?this:new gt(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new gt(i,o)}addToStart(e){return new gt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new gt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return dl(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return ul(this,e,n,r)}findIndex(e){if(e==0)return $r(0,e);if(e==this.size)return $r(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?$r(n+1,o):$r(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return gt.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return gt.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return gt.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||=e.slice(0,i),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new gt(n||e,r)}static from(e){if(!e)return gt.empty;if(e instanceof gt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new gt([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};x.empty=new x([],0);var Mo={index:0,offset:0};function $r(t,e){return Mo.index=t,Mo.offset=e,Mo}function Lr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Lr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Lr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}var B=class Xa{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||=e.slice(0,i);else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||=e.slice(0,i),n.push(this),r=!0),n&&n.push(o)}}return n||=e.slice(),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Lr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Xa.none;if(e instanceof Xa)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};B.none=[];var Dn=class extends Error{},M=class xn{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=ml(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new xn(r,this.openStart,this.openEnd)}removeBetween(e,n){return new xn(fl(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return xn.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw RangeError("Invalid input for Slice.fromJSON");return new xn(x.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new xn(e,r,i)}};M.empty=new M(x.empty,0,0);function fl(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(fl(o.content,e-i-1,n-i-1)))}function ml(t,e,n,r,i,o){let{index:s,offset:a}=t.findIndex(e),l=t.maybeChild(s);if(a==e||l.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=ml(l.content,e-a-1,n,s==0?r-1:0,s==t.childCount-1?i-1:0,l);return c&&t.replaceChild(s,l.copy(c))}function Xm(t,e,n){if(n.openStart>t.depth)throw new Dn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Dn("Inconsistent open depths");return gl(t,e,n,0)}function gl(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=gl(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Oe(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Qm(n,t);return Oe(o,kl(t,s,a,e,r))}else return Oe(o,Ir(t,e,r))}function yl(t,e){if(!e.type.compatibleContent(t.type))throw new Dn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ao(t,e,n){let r=t.node(n);return yl(r,e.node(n)),r}function Te(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Tn(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Te(t.nodeAfter,r),o++));for(let a=o;a<s;a++)Te(i.child(a),r);e&&e.depth==n&&e.textOffset&&Te(e.nodeBefore,r)}function Oe(t,e){if(!t.type.validContent(e))throw new Dn("Invalid content for node "+t.type.name);return t.copy(e)}function kl(t,e,n,r,i){let o=t.depth>i&&Ao(t,e,i+1),s=r.depth>i&&Ao(n,r,i+1),a=[];return Tn(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(yl(o,s),Te(Oe(o,kl(t,e,n,r,i+1)),a)):(o&&Te(Oe(o,Ir(t,e,i+1)),a),Tn(e,n,i,a),s&&Te(Oe(s,Ir(n,r,i+1)),a)),Tn(r,null,i,a),new x(a)}function Ir(t,e,n){let r=[];return Tn(null,t,n,r),t.depth>n&&Te(Oe(Ao(t,e,n+1),Ir(t,e,n+1)),r),Tn(e,null,n,r),new x(r)}function Qm(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)r=e.node(i).copy(x.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}var bl=class Qa{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return B.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Fr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Qa(n,r,o)}static resolveCached(e,n){let r=wl.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else wl.set(e,r=new Ym);let i=r.elts[r.i]=Qa.resolve(e,n);return r.i=(r.i+1)%tg,i}},Ym=class{constructor(){this.elts=[],this.i=0}},tg=12,wl=new WeakMap,Fr=class{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},eg=Object.create(null),Ne=class Ya{constructor(e,n,r,i=B.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||x.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Lr(this.attrs,n||e.defaultAttrs||eg)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new Ya(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ya(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s);return new M(i.node(s).content.cut(i.pos-a,o.pos-a),i.depth-s,o.depth-s)}replace(e,n,r){return Xm(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return bl.resolveCached(this,e)}resolveNoCache(e){return bl.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),vl(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=x.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=B.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!B.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=x.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Ne.prototype.text=void 0;var ng=class tl extends Ne{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new tl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new tl(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function vl(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var On=class Kf{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new rg(e,n);if(r.next==null)return Kf.empty;let i=xl(r);r.next&&r.err("Unexpected trailing text");let o=dg(cg(i));return ug(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return x.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:u}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let h=o(u,a.concat(d));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
2
+ `)}};On.empty=new On(!0);var rg=class{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}};function xl(t){let e=[];do e.push(ig(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ig(t){let e=[];do e.push(og(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function og(t){let e=lg(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=sg(t,e);else break;return e}function Cl(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function sg(t,e){let n=Cl(t),r=n;return t.eat(",")&&(r=t.next=="}"?-1:Cl(t)),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function ag(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function lg(t){if(t.eat("(")){let e=xl(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=ag(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function cg(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let d=n();i(o(s.expr,l),d),l=d}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=n();r(l,d),i(o(s.expr,l),d),l=d}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw Error("Unknown expr type")}}}}function Sl(t,e){return e-t}function El(t,e){let n=[];return r(e),n.sort(Sl);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function dg(t){let e=Object.create(null);return n(El(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<i.length;d++)i[d][0]==a&&(c=i[d][1]);El(t,l).forEach(d=>{c||i.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=e[r.join(",")]=new On(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(Sl);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function ug(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ml(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Al(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Dl(t,e,n,r){for(let i in e)if(!(i in t))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function Tl(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new pg(t,r,e[r]);return n}var Ol=class Jf{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Tl(e,r.attrs),this.defaultAttrs=Ml(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==On.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Al(this.attrs,e)}create(e=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new Ne(this,this.computeAttrs(e),x.from(n),B.setFrom(r))}createChecked(e=null,n,r){return n=x.from(n),this.checkContent(n),new Ne(this,this.computeAttrs(e),n,B.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=x.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(x.empty,!0);return o?new Ne(this,e,n.append(o),B.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Dl(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||=e.slice(0,r);return n?n.length?n:B.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Jf(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}};function hg(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}var pg=class{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?hg(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Nl=class Gf{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Tl(e,i.attrs),this.excluded=null;let o=Ml(this.attrs);this.instance=o?new B(this,o):null}create(e=null){return!e&&this.instance?this.instance:new B(this,Al(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Gf(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Dl(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Do=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=rt.from(t.nodes),e.marks=rt.from(t.marks||{}),this.nodes=Ol.compile(this.spec.nodes,this),this.marks=Nl.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],o=i.spec.content||"",s=i.spec.marks;if(i.contentMatch=n[o]||(n[o]=On.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=s=="_"?null:s?Rl(this,s.split(" ")):s==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Rl(this,o.split(" "))}this.nodeFromJSON=r=>Ne.fromJSON(this,r),this.markFromJSON=r=>B.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Ol){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new ng(n,n.defaultAttrs,t,B.setFrom(e))}mark(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}};function Rl(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function fg(t){return t.tag!=null}function mg(t){return t.style!=null}var Ze=class el{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(fg(i))this.tags.push(i);else if(mg(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Il(this,n,!1);return r.addAll(e,B.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Il(this,n,!0);return r.addAll(e,B.none,n.from,n.to),M.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(kg(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Fl(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Fl(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new el(e,el.schemaRules(e)))}},_l={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},gg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zl={ol:!0,ul:!0},Br=1,$l=2,Pr=4;function Ll(t,e,n){return e==null?t&&t.whitespace=="pre"?3:n&-5:(e?Br:0)|(e==="full"?$l:0)}var jr=class{constructor(t,e,n,r,i,o){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=B.none,this.match=i||(o&Pr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(x.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let n=this.type.contentMatch,r;return(r=n.findWrapping(t.type))?(this.match=n,r):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Br)){let n=this.content[this.content.length-1],r;if(n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-r[0].length))}}let e=x.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(x.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!_l.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}},Il=class{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=e.topNode,i,o=Ll(null,e.preserveWhitespace,0)|(n?Pr:0);i=r?new jr(r.type,r.attrs,B.none,!0,e.topMatch||r.type.contentMatch,o):n?new jr(null,null,B.none,!0,null,o):new jr(t.schema.topNodeType,null,B.none,!0,null,o),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=r.options&$l?"full":this.localPreserveWS||(r.options&Br)>0,{schema:o}=this.parser;if(i==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i)if(i==="full")n=n.replace(/\r\n?/g,`
3
+ `);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let s=n.split(/\r?\n|\r/);for(let a=0;a<s.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),e,!0),s[a]&&this.insertNode(o.text(s[a]),e,!/\S/.test(s[a]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let s=r.content[r.content.length-1],a=t.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,i=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),s;zl.hasOwnProperty(o)&&this.parser.normalizeLists&&yg(t);let a=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,n));t:if(a?a.ignore:gg.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,e);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(t=a.skip);let l,c=this.needsBlock;if(_l.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),l=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let d=a&&a.skip?e:this.readStyles(t,e);d&&this.addAll(t,d),l&&this.sync(i),this.needsBlock=c}else{let l=this.readStyles(t,e);l&&this.addElementByRule(t,a,l,a.consuming===!1?s:void 0)}this.localPreserveWS=r}leafFallback(t,e){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
4
+ `),e)}ignoreFallback(t,e){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let i=this.parser.matchedStyles[r],o=n.getPropertyValue(i);if(o)for(let s;;){let a=this.parser.matchStyle(i,o,this,s);if(!a)break;if(a.ignore)return null;if(e=a.clearMark?e.filter(l=>!a.clearMark(l)):e.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)s=a;else break}}return e}addElementByRule(t,e,n,r){let i,o;if(e.node)if(o=this.parser.schema.nodes[e.node],o.isLeaf)this.insertNode(o.create(e.attrs),n,t.nodeName=="BR")||this.leafFallback(t,n);else{let a=this.enter(o,e.attrs||null,n,e.preserveWhitespace);a&&(i=!0,n=a)}else{let a=this.parser.schema.marks[e.mark];n=n.concat(a.create(e.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,n,!1));else{let a=t;typeof e.contentElement=="string"?a=t.querySelector(e.contentElement):typeof e.contentElement=="function"?a=e.contentElement(t):e.contentElement&&(a=e.contentElement),this.findAround(t,a,!0),this.addAll(a,n),this.findAround(t,a,!1)}i&&this.sync(s)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,s=r==null?null:t.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o,e);this.findAtPoint(t,i)}findPlace(t,e,n){let r,i;for(let o=this.open,s=0;o>=0;o--){let a=this.nodes[o],l=a.findWrapping(t);if(l&&(!r||r.length>l.length+s)&&(r=l,i=a,!l.length))break;if(a.solid){if(n)break;s+=2}}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)e=this.enterInner(r[o],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(e=this.enterInner(i,null,e))}let r=this.findPlace(t,e,n);if(r){this.closeExtra();let i=this.top;i.match&&=i.match.matchType(t.type);let o=B.none;for(let s of r.concat(t.marks))(i.type?i.type.allowsMarkType(s.type):Bl(s.type,t.type))&&(o=s.addToSet(o));return i.content.push(t.mark(o)),!0}return!1}enter(t,e,n,r){let i=this.findPlace(t.create(e),n,!1);return i&&=this.enterInner(t,e,n,!0,r),i}enterInner(t,e,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let s=Ll(t,i,o.options);o.options&Pr&&o.content.length==0&&(s|=Pr);let a=B.none;return n=n.filter(l=>(o.type?o.type.allowsMarkType(l.type):Bl(l.type,t))?(a=l.addToSet(a),!1):!0),this.nodes.push(new jr(t,e,a,r,null,s)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=Br)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&t.nodeType==1&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(s,a)=>{for(;s>=0;s--){let l=e[s];if(l==""){if(s==e.length-1||s==0)continue;for(;a>=i;a--)if(o(s-1,a))return!0;return!1}else{let c=a>0||a==0&&r?this.nodes[a].type:n&&a>=i?n.node(a-i).type:null;if(!c||c.name!=l&&!c.isInGroup(l))return!1;a--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let n=this.parser.schema.nodes[e];if(n.isTextblock&&n.defaultAttrs)return n}}};function yg(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&zl.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function kg(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Fl(t){let e={};for(let n in t)e[n]=t[n];return e}function Bl(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||o.indexOf(d)<0&&s(d))return!0}};if(s(i.contentMatch))return!0}}var Nn=class Zf{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||=Hr(n).createDocumentFragment();let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,n);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){if(e.isText)return Hr(n).createTextNode(e.text);let{dom:r,contentDOM:i}=qr(Hr(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&qr(Hr(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:qr(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Zf(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Pl(e.nodes);return n.text||=r=>r.text,n}static marksFromSchema(e){return Pl(e.marks)}};function Pl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Hr(t){return t.document||window.document}var jl=new WeakMap;function bg(t){let e=jl.get(t);return e===void 0&&jl.set(t,e=wg(t)),e}function wg(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||=[],e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function qr(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],o;if(typeof i!="string")throw RangeError("Invalid array passed to renderSpec");if(r&&(o=bg(r))&&o.indexOf(e)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let h=u.indexOf(" ");h>0?l.setAttributeNS(u.slice(0,h),u.slice(h+1),c[u]):u=="style"&&l.style?l.style.cssText=c[u]:l.setAttribute(u,c[u])}}for(let u=d;u<e.length;u++){let h=e[u];if(h===0){if(u<e.length-1||u>d)throw RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof h=="string")l.appendChild(t.createTextNode(h));else{let{dom:p,contentDOM:f}=qr(t,h,n,r);if(l.appendChild(p),f){if(a)throw RangeError("Multiple content holes");a=f}}}return{dom:l,contentDOM:a}}var Hl=65535,ql=2**16;function vg(t,e){return t+e*ql}function Vl(t){return t&Hl}function xg(t){return(t-(t&Hl))/ql}var Cg=1,Sg=2,Wl=4,Ul=8,To=class{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(this.delInfo&Ul)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Wl)>0}},Re=class Cn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Cn.empty)return Cn.empty}recover(e){let n=0,r=Vl(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+xg(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],d=this.ranges[a+s],u=l+c;if(e<=u){let h=c?e==l?-1:e==u?1:n:n,p=l+i+(h<0?0:d);if(r)return p;let f=e==(n<0?l:u)?null:vg(a/3,e-l),m=e==l?Sg:e==u?Cg:Wl;return(n<0?e!=l:e!=u)&&(m|=Ul),new To(p,m,f)}i+=d-c}return r?e+i:new To(e+i,0,null)}touches(e,n){let r=0,i=Vl(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o];if(e<=l+c&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],d=this.ranges[i+r];e(a,a+c,l,l+d),o+=d-c}}invert(){return new Cn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Cn.empty:new Cn(e<0?[0,-e,0]:[0,0,e])}};Re.empty=new Re([]);var Kl=class nl{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new nl(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||=[],this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new nl;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o].mapResult(e,n);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this._maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new To(e,i,null)}},Oo=Object.create(null),ct=class{getMap(){return Re.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=Oo[e.stepType];if(!n)throw RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Oo)throw RangeError("Duplicate use of step JSON ID "+t);return Oo[t]=e,e.prototype.jsonID=t,e}},pt=class Cr{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Cr(e,null)}static fail(e){return new Cr(null,e)}static fromReplace(e,n,r,i){try{return Cr.ok(e.replace(n,r,i))}catch(o){if(o instanceof Dn)return Cr.fail(o.message);throw o}}};function No(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(No(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return x.fromArray(r)}var Ro=class Sr extends ct{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new M(No(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return pt.fromReplace(e,this.from,this.to,o)}invert(){return new Xe(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Sr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Sr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Sr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw RangeError("Invalid input for AddMarkStep.fromJSON");return new Sr(n.from,n.to,e.markFromJSON(n.mark))}};ct.jsonID("addMark",Ro);var Xe=class Er extends ct{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new M(No(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return pt.fromReplace(e,this.from,this.to,r)}invert(){return new Ro(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Er(n.pos,r.pos,this.mark)}merge(e){return e instanceof Er&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Er(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Er(n.from,n.to,e.markFromJSON(n.mark))}};ct.jsonID("removeMark",Xe);var _o=class Mr extends ct{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return pt.fromReplace(e,this.pos,this.pos+1,new M(x.from(r),0,+!n.isLeaf))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Mr(this.pos,n.marks[i]);return new Mr(this.pos,this.mark)}}return new Vr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mr(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Mr(n.pos,e.markFromJSON(n.mark))}};ct.jsonID("addNodeMark",_o);var Vr=class rl extends ct{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return pt.fromReplace(e,this.pos,this.pos+1,new M(x.from(r),0,+!n.isLeaf))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new _o(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new rl(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new rl(n.pos,e.markFromJSON(n.mark))}};ct.jsonID("removeNodeMark",Vr);var Mt=class Me extends ct{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&zo(e,this.from,this.to)?pt.fail("Structure replace would overwrite content"):pt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Re([this.from,this.to-this.from,this.slice.size])}invert(e){return new Me(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Me.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Me(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Me)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Me(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Me(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw RangeError("Invalid input for ReplaceStep.fromJSON");return new Me(n.from,n.to,M.fromJSON(e,n.slice),!!n.structure)}};Mt.MAP_BIAS=1,ct.jsonID("replace",Mt);var kt=class vo extends ct{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(zo(e,this.from,this.gapFrom)||zo(e,this.gapTo,this.to)))return pt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return pt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?pt.fromReplace(e,this.from,this.to,r):pt.fail("Content does not fit in gap")}getMap(){return new Re([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new vo(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new vo(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new vo(n.from,n.to,n.gapFrom,n.gapTo,M.fromJSON(e,n.slice),n.insert,!!n.structure)}};ct.jsonID("replaceAround",kt);function zo(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Eg(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let h=Math.max(c,e),p=Math.min(c+l.nodeSize,n),f=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(f)||(s&&s.to==h&&s.mark.eq(u[m])?s.to=p:i.push(s=new Xe(h,p,u[m])));a&&a.to==h?a.to=p:o.push(a=new Ro(h,p,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function Mg(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Nl){let c=s.marks,d;for(;d=r.isInSet(c);)(l||=[]).push(d),c=d.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let d=0;d<l.length;d++){let u=l[d],h;for(let p=0;p<i.length;p++){let f=i[p];f.step==o-1&&u.eq(i[p].style)&&(h=f)}h?(h.to=c,h.step=o):i.push({style:u,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>t.step(new Xe(s.from,s.to,s.style)))}function $o(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)s.push(new Mt(a,d,M.empty));else{r=u;for(let h=0;h<c.marks.length;h++)n.allowsMarkType(c.marks[h].type)||t.step(new Xe(a,d,c.marks[h]));if(i&&c.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,f;for(;h=p.exec(c.text);)f||=new M(x.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0),s.push(new Mt(a+h.index,a+h.index+h[0].length,f))}}a=d}if(!r.validEnd){let l=r.fillBefore(x.empty,!0);t.replace(a,a,new M(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function Ag(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Qe(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,r=0,i=0;;--n){let o=t.$from.node(n),s=t.$from.index(n)+r,a=t.$to.indexAfter(n)-i;if(n<t.depth&&o.canReplace(s,a,e))return n;if(n==0||o.type.spec.isolating||!Ag(o,s,a))break;s&&(r=1),a<o.childCount&&(i=1)}return null}function Dg(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,d=x.empty,u=0;for(let f=o,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,d=x.from(r.node(f).copy(d)),u++):l--;let h=x.empty,p=0;for(let f=o,m=!1;f>n;f--)m||i.after(f+1)<i.end(f)?(m=!0,h=x.from(i.node(f).copy(h)),p++):c++;t.step(new kt(l,c,s,a,new M(d.append(h),u,p),d.size-u,!0))}function Lo(t,e,n=null,r=t){let i=Tg(t,e),o=i&&Og(r,e);return o?i.map(Jl).concat({type:e,attrs:n}).concat(o.map(Jl)):null}function Jl(t){return{type:t,attrs:null}}function Tg(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function Og(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:s}function Ng(t,e,n){let r=x.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=x.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new kt(i,o,i,o,new M(r,0,0),n.length,!0))}function Rg(t,e,n,r,i){if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&_g(t.doc,t.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!f?c=!1:!p&&f&&(c=!0)}c===!1&&Zl(t,s,a,o),$o(t,t.mapping.slice(o).map(a,1),r,void 0,c===null);let d=t.mapping.slice(o),u=d.map(a,1),h=d.map(a+s.nodeSize,1);return t.step(new kt(u,h,u+1,h-1,new M(x.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Gl(t,s,a,o),!1}})}function Gl(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Zl(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
5
+ `))}})}function _g(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function zg(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw RangeError("No node at given position");n||=o.type;let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);t.step(new kt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new M(x.from(s),0,0),1,!0))}function Zt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>o;c--,d--){let u=i.node(c),h=i.index(c);if(u.type.spec.isolating)return!1;let p=u.content.cutByIndex(h,u.childCount),f=r&&r[d+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[d]||u;if(!u.canReplace(h+1,u.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function $g(t,e,n=1,r){let i=t.doc.resolve(e),o=x.empty,s=x.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=x.from(i.node(a).copy(o));let d=r&&r[c];s=x.from(d?d.type.create(d.attrs,s):i.node(a).copy(s))}t.step(new Mt(e,e,new M(o.append(s),n,n),!0))}function ce(t,e){let n=t.resolve(e),r=n.index();return Xl(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Lg(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function Xl(t,e){return!!(t&&e&&!t.isLeaf&&Lg(t,e))}function Wr(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Xl(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function Ig(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(i);d&&!u?r=!1:!d&&u&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Zl(t,d.node(),d.before(),a)}s.inlineContent&&$o(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Mt(c,l.map(e+n,-1),M.empty,!0)),r===!0){let d=t.doc.resolve(c);Gl(t,d.node(),d.before(),t.steps.length)}return t}function Fg(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Ql(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+ +(a>0),c=r.node(s),d=!1;if(o==1)d=c.canReplace(l,l,i);else{let u=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=u&&c.canReplaceWith(l,l,u[0])}if(d)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ur(t,e,n=e,r=M.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Yl(i,o,r)?new Mt(e,n,r):new Bg(i,o,r).fit()}function Yl(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var Bg=class{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=x.empty;for(let r=0;r<=t.depth;r++){let i=t.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=x.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&i.childCount==1;)i=i.firstChild.content,o--,s--;let a=new M(i,o,s);return t>-1?new kt(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new Mt(n.pos,r.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=e==1?t:this.unplaced.openStart;n>=0;n--){let r,i=null;n?(i=Io(this.unplaced.content,n-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let s=this.depth;s>=0;s--){let{type:a,match:l}=this.frontier[s],c,d=null;if(e==1&&(o?l.matchType(o.type)||(d=l.fillBefore(x.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:s,parent:i,inject:d};if(e==2&&o&&(c=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:i,wrap:c};if(i&&l.matchType(i.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Io(t,e);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new M(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Io(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new M(Rn(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new M(Rn(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-t,l=0,c=[],{match:d,type:u}=this.frontier[e];if(r){for(let f=0;f<r.childCount;f++)c.push(r.child(f));d=d.matchFragment(r)}let h=s.size+t-(o.content.size-o.openEnd);for(;l<s.childCount;){let f=s.child(l),m=d.matchType(f.type);if(!m)break;l++,(l>1||a==0||f.content.size)&&(d=m,c.push(tc(f.mark(u.allowedMarks(f.marks)),l==1?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=_n(this.placed,e,x.from(c)),this.frontier[e].match=d,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let g=m.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),m=g.content}this.unplaced=p?t==0?M.empty:new M(Rn(o.content,t-1,1),t-1,h<0?o.openEnd:t-1):new M(Rn(o.content,t,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!Fo(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=Fo(t,e,r,n,i);if(o){for(let s=e-1;s>=0;s--){let{match:a,type:l}=this.frontier[s],c=Fo(t,s,l,a,!0);if(!c||c.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=_n(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let r=t.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,i)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=_n(this.placed,this.depth,x.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(x.empty,!0);t.childCount&&(this.placed=_n(this.placed,this.frontier.length,t))}};function Rn(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Rn(t.firstChild.content,e-1,n)))}function _n(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_n(t.lastChild.content,e-1,n)))}function Io(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function tc(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,tc(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(x.empty,!0)))),t.copy(r)}function Fo(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!Pg(n,o.content,s)?a:null}function Pg(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function jg(t){return t.spec.defining||t.spec.definingForContent}function Hg(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Yl(i,o,r))return t.step(new Mt(e,n,r));let s=nc(i,o);s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let f=i.node(h).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let l=s.indexOf(a),c=[],d=r.openStart;for(let h=r.content,p=0;;p++){let f=h.firstChild;if(c.push(f),p==r.openStart)break;h=f.content}for(let h=d-1;h>=0;h--){let p=c[h],f=jg(p.type);if(f&&!p.sameMarkup(i.node(Math.abs(a)-1)))d=h;else if(f||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+d+1)%(r.openStart+1),f=c[p];if(f)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],y=!0;g<0&&(y=!1,g=-g);let b=i.node(g-1),w=i.index(g-1);if(b.canReplaceWith(w,w,f.type,f.marks))return t.replace(i.before(g),y?o.after(g):n,new M(ec(r.content,0,r.openStart,p),p,r.openEnd))}}let u=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>u));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function ec(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(ec(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(x.empty,!0))}return t}function qg(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Fg(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new M(x.from(r),0,0))}function Vg(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let s=r.sharedDepth(n),a=!1;for(let l=r.depth;l>s;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>s;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let o=nc(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function nc(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var rc=class xo extends ct{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return pt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return pt.fromReplace(e,this.pos,this.pos+1,new M(x.from(i),0,+!n.isLeaf))}getMap(){return Re.empty}invert(e){return new xo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new xo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw RangeError("Invalid input for AttrStep.fromJSON");return new xo(n.pos,n.attr,n.value)}};ct.jsonID("attr",rc);var ic=class il extends ct{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return pt.ok(r)}getMap(){return Re.empty}invert(e){return new il(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw RangeError("Invalid input for DocAttrStep.fromJSON");return new il(n.attr,n.value)}};ct.jsonID("docAttr",ic);var Ye=class extends Error{};Ye=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Ye.prototype=Object.create(Error.prototype),Ye.prototype.constructor=Ye,Ye.prototype.name="TransformError";var Bo=class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Kl}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ye(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,e=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(t=r.map(t,1),e=r.map(e,-1)),r.forEach((i,o,s,a)=>{t=Math.min(t,s),e=Math.max(e,a)})}return t==1e9?null:{from:t,to:e}}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=M.empty){let r=Ur(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new M(x.from(n),0,0))}delete(t,e){return this.replace(t,e,M.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return Hg(this,t,e,n),this}replaceRangeWith(t,e,n){return qg(this,t,e,n),this}deleteRange(t,e){return Vg(this,t,e),this}lift(t,e){return Dg(this,t,e),this}join(t,e=1){return Ig(this,t,e),this}wrap(t,e){return Ng(this,t,e),this}setBlockType(t,e=t,n,r=null){return Rg(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r){return zg(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new rc(t,e,n)),this}setDocAttribute(t,e){return this.step(new ic(t,e)),this}addNodeMark(t,e){return this.step(new _o(t,e)),this}removeNodeMark(t,e){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(e instanceof B)e.isInSet(n.marks)&&this.step(new Vr(t,e));else{let r=n.marks,i,o=[];for(;i=e.isInSet(r);)o.push(new Vr(t,i)),r=i.removeFromSet(r);for(let s=o.length-1;s>=0;s--)this.step(o[s])}return this}split(t,e=1,n){return $g(this,t,e,n),this}addMark(t,e,n){return Eg(this,t,e,n),this}removeMark(t,e,n){return Mg(this,t,e,n),this}clearIncompatible(t,e,n){return $o(this,t,e,n),this}},Po=Object.create(null),R=class{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new oc(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=M.empty){let n=e.content.lastChild,r=null;for(let s=0;s<e.openEnd;s++)r=n,n=n.lastChild;let i=t.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=t.mapping.slice(i);t.replaceRange(c.map(a.pos),c.map(l.pos),s?M.empty:e),s==0&&cc(t,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=t.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),cc(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new O(t):tn(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let i=t.depth-1;i>=0;i--){let o=e<0?tn(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):tn(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Pt(t.node(0))}static atStart(t){return tn(t,t,0,0,1)||new Pt(t)}static atEnd(t){return tn(t,t,t.content.size,t.childCount,-1)||new Pt(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=Po[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Po)throw RangeError("Duplicate use of selection JSON ID "+t);return Po[t]=e,e.prototype.jsonID=t,e}getBookmark(){return O.between(this.$anchor,this.$head).getBookmark()}};R.prototype.visible=!0;var oc=class{constructor(t,e){this.$from=t,this.$to=e}},sc=!1;function ac(t){!sc&&!t.parent.inlineContent&&(sc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var O=class Ar extends R{constructor(e,n=e){ac(e),ac(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return R.near(r);let i=e.resolve(n.map(this.anchor));return new Ar(i.parent.inlineContent?i:r,r)}replace(e,n=M.empty){if(super.replace(e,n),n==M.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ar&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new lc(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw RangeError("Invalid input for TextSelection.fromJSON");return new Ar(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=R.findFrom(n,r,!0)||R.findFrom(n,-r,!0);if(o)n=o.$head;else return R.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(R.findFrom(e,-r,!0)||R.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Ar(e,n)}};R.jsonID("text",O);var lc=class Xf{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Xf(e.map(this.anchor),e.map(this.head))}resolve(e){return O.between(e.resolve(this.anchor),e.resolve(this.head))}},N=class Dr extends R{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?R.near(o):new Dr(o)}content(){return new M(x.from(this.node),0,0)}eq(e){return e instanceof Dr&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Wg(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw RangeError("Invalid input for NodeSelection.fromJSON");return new Dr(e.resolve(n.anchor))}static create(e,n){return new Dr(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};N.prototype.visible=!1,R.jsonID("node",N);var Wg=class Qf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new lc(r,r):new Qf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&N.isSelectable(r)?new N(n):R.near(n)}},Pt=class Co extends R{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=M.empty){if(n==M.empty){e.delete(0,e.doc.content.size);let r=R.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Co(e)}map(e){return new Co(e)}eq(e){return e instanceof Co}getBookmark(){return Ug}};R.jsonID("all",Pt);var Ug={map(){return this},resolve(t){return new Pt(t)}};function tn(t,e,n,r,i,o=!1){if(e.inlineContent)return O.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&N.isSelectable(a))return N.create(t,n-(i<0?a.nodeSize:0))}else{let l=tn(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function cc(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Mt||i instanceof kt))return;let o=t.mapping.maps[r],s;o.forEach((a,l,c,d)=>{s??=d}),t.setSelection(R.near(t.doc.resolve(s),n))}var dc=1,uc=2,hc=4,Kg=class extends Bo{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|dc)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&dc)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=uc,this}ensureMarks(t){return B.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&uc)>0}addStep(t,e){super.addStep(t,e),this.updated&=-3,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||B.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(e==null)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(n??=e,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let o=this.doc.resolve(e);i=n==e?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),!this.selection.empty&&this.selection.to==e+t.length&&this.setSelection(R.near(this.selection.$to)),this}}setMeta(t,e){return this.meta[typeof t=="string"?t:t.key]=e,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=hc,this}get scrolledIntoView(){return(this.updated&hc)>0}};function pc(t,e){return!e||!t?t:t.bind(e)}var zn=class{constructor(t,e,n){this.name=t,this.init=pc(e.init,n),this.apply=pc(e.apply,n)}},Jg=[new zn("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new zn("selection",{init(t,e){return t.selection||R.atStart(e.doc)},apply(t){return t.selection}}),new zn("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new zn("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],jo=class{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Jg.slice(),e&&e.forEach(n=>{if(this.pluginsByKey[n.key])throw RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new zn(n.key,n.spec.state,n))})}},fc=class Tr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let u=0;u<this.config.plugins.length;u++)i.push(u<s?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let n=new Tr(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new Kg(this)}static create(e){let n=new jo(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Tr(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new jo(this.schema,e.plugins),r=n.fields,i=new Tr(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let i=new jo(e.schema,e.plugins),o=new Tr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Ne.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=R.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}};function mc(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=mc(i,e,{})),n[r]=i}return n}var j=class{constructor(t){this.spec=t,this.props={},t.props&&mc(t.props,this,this.props),this.key=t.key?t.key.key:gc("plugin")}getState(t){return t[this.key]}},Ho=Object.create(null);function gc(t){return t in Ho?t+"$"+ ++Ho[t]:(Ho[t]=0,t+"$")}var J=class{constructor(t="key"){this.key=gc(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}},yc=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function kc(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var bc=(t,e,n)=>{let r=kc(t,n);if(!r)return!1;let i=qo(r);if(!i){let s=r.blockRange(),a=s&&Qe(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(Tc(t,i,e,-1))return!0;if(r.parent.content.size==0&&(en(o,"end")||N.isSelectable(o)))for(let s=r.depth;;s--){let a=Ur(t.doc,r.before(s),r.after(s),M.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(en(o,"end")?R.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):N.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},Gg=(t,e,n)=>{let r=kc(t,n);if(!r)return!1;let i=qo(r);return i?wc(t,i,e):!1},Zg=(t,e,n)=>{let r=xc(t,n);if(!r)return!1;let i=Vo(r);return i?wc(t,i,e):!1};function wc(t,e,n){let r=e.nodeBefore,i=e.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let l=r.lastChild;if(!l)return!1;r=l}let o=e.nodeAfter,s=e.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let l=o.firstChild;if(!l)return!1;o=l}let a=Ur(t.doc,i,s,M.empty);if(!a||a.from!=i||a instanceof Mt&&a.slice.size>=s-i)return!1;if(n){let l=t.tr.step(a);l.setSelection(O.create(l.doc,i)),n(l.scrollIntoView())}return!0}function en(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var vc=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=qo(r)}let s=o&&o.nodeBefore;return!s||!N.isSelectable(s)?!1:(e&&e(t.tr.setSelection(N.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function qo(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function xc(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}var Cc=(t,e,n)=>{let r=xc(t,n);if(!r)return!1;let i=Vo(r);if(!i)return!1;let o=i.nodeAfter;if(Tc(t,i,e,1))return!0;if(r.parent.content.size==0&&(en(o,"start")||N.isSelectable(o))){let s=Ur(t.doc,r.before(),r.after(),M.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(en(o,"start")?R.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):N.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},Sc=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=Vo(r)}let s=o&&o.nodeAfter;return!s||!N.isSelectable(s)?!1:(e&&e(t.tr.setSelection(N.create(t.doc,o.pos)).scrollIntoView()),!0)};function Vo(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}var Xg=(t,e)=>{let n=t.selection,r=n instanceof N,i;if(r){if(n.node.isTextblock||!ce(t.doc,n.from))return!1;i=n.from}else if(i=Wr(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(N.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Qg=(t,e)=>{let n=t.selection,r;if(n instanceof N){if(n.node.isTextblock||!ce(t.doc,n.to))return!1;r=n.to}else if(r=Wr(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Yg=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Qe(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Ec=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
6
+ `).scrollIntoView()),!0)};function Wo(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Mc=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Wo(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(R.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Ac=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Pt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Wo(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(O.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},Dc=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Zt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Qe(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function t0(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof N&&e.selection.node.isBlock)return!r.parentOffset||!Zt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,l=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),a=Wo(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let f=t&&t(i.parent,l,r);o.unshift(f||(l&&a?{type:a}:null)),s=p;break}else{if(p==1)return!1;o.unshift(null)}let d=e.tr;(e.selection instanceof O||e.selection instanceof Pt)&&d.deleteSelection();let u=d.mapping.map(r.pos),h=Zt(d.doc,u,o.length,o);if(h||=(o[0]=a?{type:a}:null,Zt(d.doc,u,o.length,o)),!h)return!1;if(d.split(u,o.length,o),!l&&c&&r.node(s).type!=a){let p=d.mapping.map(r.before(s)),f=d.doc.resolve(p);a&&r.node(s-1).canReplaceWith(f.index(),f.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(s)),a)}return n&&n(d.scrollIntoView()),!0}}var e0=t0(),n0=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(N.create(t.doc,i))),!0)},r0=(t,e)=>(e&&e(t.tr.setSelection(new Pt(t.doc))),!0);function i0(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||ce(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Tc(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&i0(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,f=x.empty;for(let y=s.length-1;y>=0;y--)f=x.from(s[y].create(null,f));f=x.from(i.copy(f));let m=t.tr.step(new kt(e.pos-1,p,e.pos,p,new M(f,1,0),s.length,!0)),g=m.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&ce(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let d=o.type.spec.isolating||r>0&&l?null:R.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),h=u&&Qe(u);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(u,h).scrollIntoView()),!0;if(c&&en(o,"start",!0)&&en(i,"end")){let p=i,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let y=x.empty;for(let b=f.length-1;b>=0;b--)y=x.from(f[b].copy(y));n(t.tr.step(new kt(e.pos-f.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new M(y,f.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Oc(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(O.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var Nc=Oc(-1),Rc=Oc(1);function o0(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Lo(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function _c(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(c),u=d.index();i=d.parent.canReplaceWith(u,u+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}r(o.scrollIntoView())}return!0}}function Uo(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}var Ko=Uo(yc,bc,vc),zc=Uo(yc,Cc,Sc),de={Enter:Uo(Ec,Ac,Dc,e0),"Mod-Enter":Mc,Backspace:Ko,"Mod-Backspace":Ko,"Shift-Backspace":Ko,Delete:zc,"Mod-Delete":zc,"Mod-a":r0},s0={"Ctrl-h":de.Backspace,"Alt-Backspace":de["Mod-Backspace"],"Ctrl-d":de.Delete,"Ctrl-Alt-Backspace":de["Mod-Delete"],"Alt-Delete":de["Mod-Delete"],"Alt-d":de["Mod-Delete"],"Ctrl-a":Nc,"Ctrl-e":Rc};for(let t in de)s0[t]=de[t];typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform();function a0(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return l0(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function l0(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);o=new Fr(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Fr(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=Lo(o,n,r,e);return a?(t&&c0(t,e,a,i,n),!0):!1}function c0(t,e,n,r,i){let o=x.empty;for(let d=n.length-1;d>=0;d--)o=x.from(n[d].type.create(n[d].attrs,o));t.step(new kt(e.start-(r?2:0),e.end,e.start,e.end,new M(o,0,0),n.length,!0));let s=0;for(let d=0;d<n.length;d++)n[d].type==i&&(s=d+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,u=e.endIndex,h=!0;d<u;d++,h=!1)!h&&Zt(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function d0(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?u0(e,n,t,o):h0(e,n,o):!0:!1}}function u0(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new kt(o-1,s,o,s,new M(x.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Fr(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));let a=Qe(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return ce(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function h0(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,f=n.endIndex-1,m=n.startIndex;f>m;f--)p-=i.child(f).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+ +!a,d+1,s.content.append(l?x.empty:x.from(i))))return!1;let u=o.pos,h=u+s.nodeSize;return r.step(new kt(u-+!!a,h+ +!!l,u+1,h-1,new M((a?x.empty:x.from(i.copy(x.empty))).append(l?x.empty:x.from(i.copy(x.empty))),+!a,+!l),+!a)),e(r.scrollIntoView()),!0}function p0(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,d=x.from(c?t.create():null),u=new M(x.from(t.create(null,x.from(a.type.create(null,d)))),c?3:1,0),h=o.start,p=o.end;n(e.tr.step(new kt(h-(c?3:1),p,h,p,u,1,!0)).scrollIntoView())}return!0}}var it=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},nn=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},$c=null,Xt=function(t,e,n){let r=$c||=document.createRange();return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},f0=function(){$c=null},_e=function(t,e,n,r){return n&&(Lc(t,e,n,r,-1)||Lc(t,e,n,r,1))},m0=/^(img|br|input|textarea|hr)$/i;function Lc(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Ot(t))){let o=t.parentNode;if(!o||o.nodeType!=1||$n(t)||m0.test(t.nodeName)||t.contentEditable=="false")return!1;e=it(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(o.pmViewDesc?.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?Ot(t):0}else return!1}}function Ot(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function g0(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ot(t)}else if(t.parentNode&&!$n(t))e=it(t),t=t.parentNode;else return null}}function y0(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!$n(t))e=it(t)+1,t=t.parentNode;else return null}}function k0(t,e,n){for(let r=e==0,i=e==Ot(t);r||i;){if(t==n)return!0;let o=it(t);if(t=t.parentNode,!t)return!1;r&&=o==0,i&&=o==Ot(t)}}function $n(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Kr=function(t){return t.focusNode&&_e(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ze(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function b0(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function w0(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ot(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ot(r.startContainer),r.startOffset)}}}var jt=typeof navigator<"u"?navigator:null,Ic=typeof document<"u"?document:null,ue=jt&&jt.userAgent||"",Jo=/Edge\/(\d+)/.exec(ue),Fc=/MSIE \d/.exec(ue),Go=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ue),bt=!!(Fc||Go||Jo),he=Fc?document.documentMode:Go?+Go[1]:Jo?+Jo[1]:0,Nt=!bt&&/gecko\/(\d+)/i.test(ue);Nt&&+(/Firefox\/(\d+)/.exec(ue)||[0,0])[1];var Zo=!bt&&/Chrome\/(\d+)/.exec(ue),tt=!!Zo,Bc=Zo?+Zo[1]:0,dt=!bt&&!!jt&&/Apple Computer/.test(jt.vendor),rn=dt&&(/Mobile\/\w+/.test(ue)||!!jt&&jt.maxTouchPoints>2),Rt=rn||(jt?/Mac/.test(jt.platform):!1),Pc=jt?/Win/.test(jt.platform):!1,Qt=/Android \d/.test(ue),Ln=!!Ic&&"webkitFontSmoothing"in Ic.documentElement.style,v0=Ln?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function x0(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Yt(t,e){return typeof t=="number"?t:t[e]}function C0(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function jc(t,e,n){if(!Qo(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=nn(s);continue}let a=s,l=a==o.body,c=l?x0(o):C0(a),d=0,u=0;if(e.top<c.top+Yt(r,"top")?u=-(c.top-e.top+Yt(i,"top")):e.bottom>c.bottom-Yt(r,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+Yt(i,"top")-c.top:e.bottom-c.bottom+Yt(i,"bottom")),e.left<c.left+Yt(r,"left")?d=-(c.left-e.left+Yt(i,"left")):e.right>c.right-Yt(r,"right")&&(d=e.right-c.right+Yt(i,"right")),d||u)if(l)o.defaultView.scrollBy(d,u);else{let p=a.scrollLeft,f=a.scrollTop;u&&(a.scrollTop+=u),d&&(a.scrollLeft+=d);let m=a.scrollLeft-p,g=a.scrollTop-f;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let h=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s=h=="absolute"?s.offsetParent:nn(s)}}function S0(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:Hc(t.dom)}}function Hc(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=nn(r));return e}function E0({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;qc(n,r==0?0:r-e)}function qc(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}var on=null;function M0(t){if(t.setActive)return t.setActive();if(on)return t.focus(on);let e=Hc(t);t.focus(on==null?{get preventScroll(){return on={preventScroll:!0},!0}}:void 0),on||(on=!1,qc(e,0))}function Vc(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let d=t.firstChild,u=0;d;d=d.nextSibling,u++){let h;if(d.nodeType==1)h=d.getClientRects();else if(d.nodeType==3)h=Xt(d).getClientRects();else continue;for(let p=0;p<h.length;p++){let f=h[p];if(f.top<=s&&f.bottom>=a){s=Math.max(f.bottom,s),a=Math.min(f.top,a);let m=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(m<r){n=d,r=m,i=m&&n.nodeType==3?{left:f.right<e.left?f.right:f.left,top:e.top}:e,d.nodeType==1&&m&&(o=u+ +(e.left>=(f.left+f.right)/2));continue}}else f.top>e.top&&!l&&f.left<=e.left&&f.right>=e.left&&(l=d,c={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(o=u+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?A0(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:Vc(n,i)}function A0(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=pe(r,1);if(s.top!=s.bottom&&Xo(e,s)){i={node:t,offset:o+ +(e.left>=(s.left+s.right)/2)};break}}return r.detach(),i||{node:t,offset:0}}function Xo(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function D0(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function T0(t,e,n){let{node:r,offset:i}=Vc(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function O0(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Wc(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Xo(e,c))return Wc(s,e,c)}}if((o=(o+1)%r)==i)break}return t}function N0(t,e){let n=t.dom.ownerDocument,r,i=0,o=w0(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType==1?s:s.parentNode)){let c=t.dom.getBoundingClientRect();if(!Xo(e,c)||(s=Wc(t.dom,e,c),!s))return null}if(dt)for(let c=s;r&&c;c=nn(c))c.draggable&&(r=void 0);if(s=D0(s,e),r){if(Nt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],u;d.nodeName=="IMG"&&(u=d.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}let c;Ln&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=O0(t,r,i,e))}a??=T0(t,s,e);let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Qo(t){return t.top<t.bottom||t.left<t.right}function pe(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Qo(r))return r}return Array.prototype.find.call(n,Qo)||t.getBoundingClientRect()}var R0=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Uc(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Ln||Nt;if(r.nodeType==3)if(s&&(R0.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=pe(Xt(r,i,i),n);if(Nt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=pe(Xt(r,i-1,i-1),-1);if(l.top==a.top){let c=pe(Xt(r,i,i+1),-1);if(c.top!=a.top)return In(c,c.left<l.left)}}return a}else{let a=i,l=i,c=n<0?1:-1;return n<0&&!i?(l++,c=-1):n>=0&&i==r.nodeValue.length?(a--,c=1):n<0?a--:l++,In(pe(Xt(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Ot(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Yo(a.getBoundingClientRect(),!1)}if(o==null&&i<Ot(r)){let a=r.childNodes[i];if(a.nodeType==1)return Yo(a.getBoundingClientRect(),!0)}return Yo(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Ot(r))){let a=r.childNodes[i-1],l=a.nodeType==3?Xt(a,Ot(a)-+!s):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return In(pe(l,1),!1)}if(o==null&&i<Ot(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?Xt(a,0,+!s):a.nodeType==1?a:null:null;if(l)return In(pe(l,-1),!0)}return In(pe(r.nodeType==3?Xt(r):r,-n),n>=0)}function In(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Yo(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Kc(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function _0(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Kc(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=Uc(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Xt(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}var z0=/[\u0590-\u08ac]/;function $0(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!z0.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:Kc(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:u}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:f,focusOffset:m}=t.domSelectionRange(),g=f&&!p.contains(f.nodeType==1?f:f.parentNode)||l==f&&c==m;try{a.collapse(d,u),l&&(l!=d||c!=u)&&a.extend&&a.extend(l,c)}catch{}return h!=null&&(a.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}var Jc=null,Gc=null,Zc=!1;function L0(t,e,n){return Jc==e&&Gc==n?Zc:(Jc=e,Gc=n,Zc=n=="up"||n=="down"?_0(t,e,n):$0(t,e,n))}var _t=0,Xc=1,$e=2,Lt=3,Fn=class{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=_t,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(n<0){let i,o;if(t==this.contentDOM)i=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let r;if(t==this.dom&&this.contentDOM)r=e>it(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(e==0)for(let i=t;;i=i.parentNode){if(i==this.dom){r=!1;break}if(i.previousSibling)break}if(r==null&&e==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){r=!0;break}if(i.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let i=this.getDesc(r),o;if(i&&(!e||i.node))if(n&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(t.nodeType==1?t:t.parentNode):o==t))n=!1;else return i}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],i=n+r.size;if(n==t&&i!=n){for(;!r.border&&r.children.length;)for(let o=0;o<r.children.length;o++){let s=r.children[o];if(s.size){r=s;break}}return r}if(t<i)return r.descAt(t-n-r.border);n=i}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let n=0,r=0;for(let i=0;n<this.children.length;n++){let o=this.children[n],s=i+o.size;if(s>t||o instanceof ed){r=t-i;break}i=s}if(r)return this.children[n].domFromPos(r-this.children[n].border,e);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof Qc&&i.side>=0;n--);if(e<=0){let i,o=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,o=!1);return i&&e&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,e):{node:this.contentDOM,offset:i?it(i.dom)+1:0}}else{let i,o=!0;for(;i=n<this.children.length?this.children[n]:null,!(!i||i.dom.parentNode==this.contentDOM);n++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,e):{node:this.contentDOM,offset:i?it(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,n=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let a=this.children[s],l=o+a.size;if(r==-1&&t<=l){let c=o+a.border;if(t>=c&&e<=l-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,c);t=o;for(let d=s;d>0;d--){let u=this.children[d-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){r=it(u.dom)+1;break}t-=u.size}r==-1&&(r=0)}if(r>-1&&(l>e||s==this.children.length-1)){e=l;for(let c=s+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=it(d.dom);break}e+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return e.size==0||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(e.nodeType!=1||n==e.childNodes.length)throw RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n,r=!1){let i=Math.min(t,e),o=Math.max(t,e);for(let h=0,p=0;h<this.children.length;h++){let f=this.children[h],m=p+f.size;if(i>p&&o<m)return f.setSelection(t-p-f.border,e-p-f.border,n,r);p=m}let s=this.domFromPos(t,t?-1:1),a=e==t?s:this.domFromPos(e,e?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((Nt||dt)&&t==e){let{node:h,offset:p}=s;if(h.nodeType==3){if(d=!!(p&&h.nodeValue[p-1]==`
7
+ `),d&&p==h.nodeValue.length)for(let f=h,m;f;f=f.parentNode){if(m=f.nextSibling){m.nodeName=="BR"&&(s=a={node:m.parentNode,offset:it(m)+1});break}let g=f.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let f=h.childNodes[p-1];d=f&&(f.nodeName=="BR"||f.contentEditable=="false")}}if(Nt&&c.focusNode&&c.focusNode!=a.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(r=!0)}if(!(r||d&&dt)&&_e(s.node,s.offset,c.anchorNode,c.anchorOffset)&&_e(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||t==e)&&!(d&&Nt)){l.collapse(s.node,s.offset);try{t!=e&&l.extend(a.node,a.offset),u=!0}catch{}}if(!u){if(t>e){let p=s;s=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?t<=o&&e>=n:t<o&&e>n){let s=n+i.border,a=o-i.border;if(t>=s&&e<=a){this.dirty=t==n||e==o?$e:Xc,t==s&&e==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Lt:i.markDirty(t-s,e-s);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?$e:Lt}n=o}this.dirty=$e}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=t==1?$e:Xc;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}},Qc=class extends Fn{constructor(t,e,n,r){let i,o=e.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!e.type.spec.raw){if(o.nodeType!=1){let s=document.createElement("span");s.appendChild(o),o=s}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return this.dirty==_t&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return e?e(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},I0=class extends Fn{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t==this.textDOM?this.posAtStart+e:this.posAtStart+(e?this.size:0)}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}},Bn=class ol extends Fn{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Nn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ol(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Lt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Lt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=_t){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=_t}}slice(e,n,r){let i=ol.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=es(o,n,s,r)),e>0&&(o=es(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},sn=class Yf extends Fn{constructor(e,n,r,i,o,s,a){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,c=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=Nn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let h=d;return d=id(d,r,n),c?l=new F0(e,n,r,i,d,u||null,h,c):n.isText?new td(e,n,r,i,d,h):new Yf(e,n,r,i,d,u||null,h)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>x.empty)}return e}matchesNode(e,n,r){return this.dirty==_t&&e.eq(this.node)&&Jr(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new P0(this,s&&s.node,e);q0(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e,d):c.type.side>=0&&!u&&l.syncToMarks(d==this.node.childCount?B.none:this.node.child(d).marks,r,e,d),l.placeWidget(c,e,i)},(c,d,u,h)=>{l.syncToMarks(c.marks,r,e,h);let p;l.findNodeMatch(c,d,u,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,d,u,p,e)||l.updateNextNode(c,d,u,e,h,i)||l.addNode(c,d,u,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==$e)&&(s&&this.protectLocalComposition(e,s),nd(this.contentDOM,this.children,e),rn&&V0(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof O)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=W0(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&=void 0}let s=new I0(this,o,n,i);e.input.compositionNodes.push(s),this.children=es(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Lt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=_t}updateOuterDeco(e){if(Jr(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=rd(this.dom,this.nodeDOM,ts(this.outerDeco,this.node,n),ts(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function Yc(t,e,n,r,i){id(r,e,t);let o=new sn(void 0,t,e,n,r,r,r);return o.contentDOM&&o.updateChildren(i,0),o}var td=class tm extends sn{constructor(e,n,r,i,o,s){super(e,n,r,i,o,null,s)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Lt||this.dirty!=_t&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=_t||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=_t,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new tm(this.parent,i,this.outerDeco,this.innerDeco,o,o)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Lt)}get domAtom(){return!1}isText(e){return this.node.text==e}},ed=class extends Fn{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==_t&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},F0=class extends sn{constructor(t,e,n,r,i,o,s,a){super(t,e,n,r,i,o,s),this.spec=a}update(t,e,n,r){if(this.dirty==Lt)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,r),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n.root):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}};function nd(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=od(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof Bn){let l=r?r.previousSibling:t.lastChild;nd(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=od(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}var Pn=function(t){t&&(this.nodeName=t)};Pn.prototype=Object.create(null);var Le=[new Pn];function ts(t,e,n){if(t.length==0)return Le;let r=n?Le[0]:new Pn,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Pn(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Pn(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function rd(t,e,n,r){if(n==Le&&r==Le)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Le[0]),i=l}B0(i,a||Le[0],s)}return i}function B0(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function id(t,e,n){return rd(t,t,Le,ts(e,n,t.nodeType!=1))}function Jr(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function od(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var P0=class{constructor(t,e,n){this.lock=e,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=j0(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,t.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=_t,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let a=-1,l=this.top.children.length;r<this.preMatch.index&&(l=Math.min(this.index+3,l));for(let c=this.index;c<l;c++){let d=this.top.children[c];if(d.matchesMark(t[o])&&!this.isLocked(d.dom)){a=c;break}}if(a<0&&this.index<this.top.children.length){let c=this.top.children[this.index];c instanceof Bn&&c.dirty!=Lt&&c.mark.type==t[o].type&&c.spec.update&&!this.isLocked(c.dom)&&c.spec.update(t[o])&&(c.mark=t[o],a=this.index,this.changed=!0)}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=Bn.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let l=this.top.children[s];if(l.matchesNode(t,e,n)&&!this.preMatch.matched.has(l)){i=s;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,e,n,r,i){let o=this.top.children[r];return o.dirty==Lt&&o.dom==o.contentDOM&&(o.dirty=$e),o.update(t,e,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let n=t.pmViewDesc;if(n){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r}return-1}t=e}}updateNextNode(t,e,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof sn){let l=this.preMatch.matched.get(a);if(l!=null&&l!=i)return!1;let c=a.dom,d,u=this.isLocked(c)&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&a.dirty!=Lt&&Jr(e,a.outerDeco));if(!u&&a.update(t,e,n,r))return this.destroyBetween(this.index,s),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!u&&(d=this.recreateWrapper(a,t,e,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=$e,d.updateChildren(r,o+1),d.dirty=_t),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,n,r,i,o){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!Jr(n,t.outerDeco)||!r.eq(t.innerDeco))return null;let s=sn.create(this.top,e,n,r,i,o);if(s.contentDOM){s.children=t.children,t.children=[];for(let a of s.children)a.parent=s}return t.destroy(),s}addNode(t,e,n,r,i){let o=sn.create(this.top,t,e,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(t)&&(t==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let i=new Qc(this.top,t,e,n);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof Bn;)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof td)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((dt||tt)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);t=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),t=="BR"&&(n.className="ProseMirror-trailingBreak");let r=new ed(this.top,[],n,null);e==this.top?e.children.splice(this.index++,0,r):e.children.push(r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}};function j0(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];t:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Bn)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function H0(t,e){return t.type.side-e.type.side}function q0(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,i,e.forChild(o,d),c),o+=d.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,u;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(d?(u||=[d]).push(g):d=g)}if(d)if(u){u.sort(H0);for(let g=0;g<u.length;g++)n(u[g],c,!!l)}else n(d,c,!!l);let h,p;if(l)p=-1,h=l,l=null;else if(c<t.childCount)p=c,h=t.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=o&&a.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let g=f;s<i.length&&i[s].from<g&&(g=i[s].from);for(let y=0;y<a.length;y++)a[y].to<g&&(g=a[y].to);g<f&&(l=h.cut(g-o),h=h.cut(0,g-o),f=g,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?a.filter(g=>!g.inline):a.slice();r(h,m,e.forChild(o,h),p),o=f}}function V0(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function W0(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function es(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,d=a+=l.size;c>=n||d<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&=(o.push(i),void 0),d>n&&o.push(l.slice(n-c,l.size,r)))}return o}function ns(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Kr(n)){for(l=s;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&N.isSelectable(u)&&i.parent&&!(u.isInline&&k0(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new N(s==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let u=s,h=s;for(let p=0;p<n.rangeCount;p++){let f=n.getRangeAt(p);u=Math.min(u,t.docView.posFromDOM(f.startContainer,f.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(u<0)return null;[l,s]=h==t.state.selection.anchor?[h,u]:[u,h],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=is(t,d,a,u)}return c}function sd(t){return t.editable?t.hasFocus():pd(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function te(t,e=!1){let n=t.state.selection;if(dd(t,n),!sd(t))return;let r=t.input.mouseDown;if(!e&&tt&&r){let i=t.domSelectionRange(),o=t.domObserver.currentSelection;if(i.anchorNode&&o.anchorNode&&_e(i.anchorNode,i.anchorOffset,o.anchorNode,o.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)K0(t);else{let{anchor:i,head:o}=n,s,a;ad&&!(n instanceof O)&&(n.$from.parent.inlineContent||(s=ld(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=ld(t,n.to))),t.docView.setSelection(i,o,t,e),ad&&(s&&cd(s),a&&cd(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&U0(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}var ad=dt||tt&&Bc<63;function ld(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(dt&&i&&i.contentEditable=="false")return rs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return rs(i);if(o)return rs(o)}}function rs(t){return t.contentEditable="true",dt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function cd(t){t.contentEditable="false",t.wasDraggable&&=(t.draggable=!0,null)}function U0(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!sd(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function K0(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,it(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&bt&&he<=11&&(n.disabled=!0,n.disabled=!1)}function dd(t,e){if(e instanceof N){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(ud(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else ud(t)}function ud(t){t.lastSelectedViewDesc&&=(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),void 0)}function is(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||O.between(e,n,r)}function hd(t){return t.editable&&!t.hasFocus()?!1:pd(t)}function pd(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function J0(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return _e(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ss(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&R.findFrom(o,e)}function fe(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function fd(t,e,n){let r=t.state.selection;if(r instanceof O)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return fe(t,new O(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=ss(t.state,e);return i&&i instanceof N?fe(t,i):!1}else if(!(Rt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?N.isSelectable(o)?fe(t,new N(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Ln?fe(t,new O(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof N&&r.node.isInline)return fe(t,new O(e>0?r.$to:r.$from));{let i=ss(t.state,e);return i?fe(t,i):!1}}}function Gr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function jn(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function an(t,e){return e<0?G0(t):Z0(t)}function G0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Nt&&n.nodeType==1&&r<Gr(n)&&jn(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(jn(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(md(n))break;{let a=n.previousSibling;for(;a&&jn(a,-1);)i=n.parentNode,o=it(a),a=a.previousSibling;if(a)n=a,r=Gr(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?as(t,n,r):i&&as(t,i,o)}function Z0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Gr(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(jn(a,1))o=n,s=++r;else break}else{if(md(n))break;{let a=n.nextSibling;for(;a&&jn(a,1);)o=a.parentNode,s=it(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Gr(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&as(t,o,s)}function md(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function X0(t,e){for(;t&&e==t.childNodes.length&&!$n(t);)e=it(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Q0(t,e){for(;t&&!e&&!$n(t);)e=it(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function as(t,e,n){if(e.nodeType!=3){let o,s;(s=X0(e,n))?(e=s,n=0):(o=Q0(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Kr(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&te(t)},50)}function gd(t,e){let n=t.state.doc.resolve(e);if(!(tt||Pc)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function yd(t,e,n){let r=t.state.selection;if(r instanceof O&&!r.empty||n.indexOf("s")>-1||Rt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=ss(t.state,e);if(s&&s instanceof N)return fe(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Pt?R.near(s,e):R.findFrom(s,e);return a?fe(t,a):!1}return!1}function kd(t,e){if(!(t.state.selection instanceof O))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function bd(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Y0(t){if(!dt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;bd(t,r,"true"),setTimeout(()=>bd(t,r,"false"),20)}return!1}function t1(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function e1(t,e){let n=e.keyCode,r=t1(e);if(n==8||Rt&&n==72&&r=="c")return kd(t,-1)||an(t,-1);if(n==46&&!e.shiftKey||Rt&&n==68&&r=="c")return kd(t,1)||an(t,1);if(n==13||n==27)return!0;if(n==37||Rt&&n==66&&r=="c"){let i=n==37?gd(t,t.state.selection.from)=="ltr"?-1:1:-1;return fd(t,i,r)||an(t,i)}else if(n==39||Rt&&n==70&&r=="c"){let i=n==39?gd(t,t.state.selection.from)=="ltr"?1:-1:1;return fd(t,i,r)||an(t,i)}else{if(n==38||Rt&&n==80&&r=="c")return yd(t,-1,r)||an(t,-1);if(n==40||Rt&&n==78&&r=="c")return Y0(t)||yd(t,1,r)||an(t,1);if(r==(Rt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ls(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs==h.type.defaultAttrs?null:h.attrs),r=h.content}let s=t.someProp("clipboardSerializer")||Nn.fromSchema(t.state.schema),a=Md(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=Ed[c.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let p=a.createElement(d[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),u++}c=l.firstChild}return c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
8
+
9
+ `),slice:e}}function wd(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=!!e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return a=new M(x.from(t.state.schema.text(e.replace(/\r\n?/g,`
10
+ `))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let u=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(u)a=u;else{let h=i.marks(),{schema:p}=t.state,f=Nn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(f.serializeNode(p.text(m,h)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=o1(n),Ln&&s1(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||=(t.someProp("clipboardParser")||t.someProp("domParser")||Ze.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(u){return u.nodeName=="BR"&&!u.nextSibling&&u.parentNode&&!n1.test(u.parentNode.nodeName)?{ignore:!0}:null}}),d)a=a1(Sd(a,+d[1],+d[2]),d[4]);else if(a=M.maxOpen(r1(a.content,i),!0),a.openStart||a.openEnd){let u=0,h=0;for(let p=a.content.firstChild;u<a.openStart&&!p.type.spec.isolating;u++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=Sd(a,u,h)}return t.someProp("transformPasted",u=>{a=u(a,t,l)}),a}var n1=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function r1(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(s=>{if(!o)return;let a=r.findWrapping(s.type),l;if(!a)return o=null;if(l=o.length&&i.length&&xd(a,i,s,o[o.length-1],0))o[o.length-1]=l;else{o.length&&(o[o.length-1]=Cd(o[o.length-1],i.length));let c=vd(s,a);o.push(c),r=r.matchType(c.type),i=a}}),o)return x.from(o)}return t}function vd(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,x.from(t));return t}function xd(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=xd(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(x.from(vd(n,t,i+1))))}}function Cd(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Cd(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(x.empty,!0);return t.copy(n.append(r))}function cs(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=cs(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(x.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Sd(t,e,n){return e<t.openStart&&(t=new M(cs(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new M(cs(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Ed={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function Md(){return document.implementation.createHTMLDocument("title")}var Ad=null;function i1(t){let e=window.trustedTypes;return e?(Ad||=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n}),Ad.createHTML(t)):t}function o1(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Md(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&Ed[i[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=i1(t),o)for(let s=0;s<o.length;s++)r=r.querySelector(o[s])||r;for(let s=0;s<n.styleSheets.length;s++){let a=n.styleSheets[s];for(let l=0;l<a.rules.length;l++){let c=a.rules[l];if(c instanceof CSSStyleRule){let d=r.querySelectorAll(c.selectorText);for(let u=0;u<d.length;u++)d[u].style.cssText+=c.style.cssText}}}return r}function s1(t){let e=t.querySelectorAll(tt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function a1(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=x.from(l.create(r[a+1],i)),o++,s++}return new M(i,o,s)}var ft={},mt={},l1={touchstart:!0,touchmove:!0},c1=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function d1(t){for(let e in ft){let n=ft[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{h1(t,r)&&!us(t,r)&&(t.editable||!(r.type in mt))&&n(t,r)},l1[e]?{passive:!0}:void 0)}dt&&t.dom.addEventListener("input",()=>null),ds(t)}function ee(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function u1(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function ds(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>us(t,r))})}function us(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function h1(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function p1(t,e){!us(t,e)&&ft[e.type]&&(t.editable||!(e.type in mt))&&ft[e.type](t,e)}mt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Nd(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qt&&tt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),rn&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,ze(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||e1(t,n)?n.preventDefault():ee(t,"key")},mt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},mt.keypress=(t,e)=>{let n=e;if(Nd(t)||!n.charCode||n.ctrlKey&&!n.altKey||Rt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof O)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i,o))&&t.dispatch(o()),n.preventDefault()}};function Hn(t){return{left:t.clientX,top:t.clientY}}function f1(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function hs(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function qn(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function m1(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&N.isSelectable(r)?(qn(t,new N(n),"pointer"),!0):!1}function g1(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof N&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(N.isSelectable(a)){i=r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(s);break}}return i==null?!1:(qn(t,N.create(t.state.doc,i),"pointer"),!0)}function y1(t,e,n,r,i){return hs(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?g1(t,n):m1(t,n))}function k1(t,e,n,r){return hs(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function b1(t,e,n,r){return hs(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||w1(t,n,r)}function w1(t,e,n){if(n.button!=0)return!1;let r=Dd(t,e,!0),i=t.state.doc;return r?(qn(t,r,"pointer"),r instanceof O&&i.eq(t.state.doc)&&(t.input.mouseDown=new x1(t,r)),!0):!1}function Dd(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?O.create(r,0,r.content.size):null;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)return O.create(r,a+1,a+1+s.content.size);if(n&&N.isSelectable(s))return N.create(r,a)}return null}function ps(t){return Zr(t)}var Td=Rt?"metaKey":"ctrlKey";ft.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ps(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&f1(n,t.input.lastClick)&&!n[Td]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let s=t.posAtCoords(Hn(n));s&&(o=="singleClick"?t.input.mouseDown=new v1(t,s,n,!!r):(o=="doubleClick"?k1:b1)(t,s.pos,s.inside,n)?n.preventDefault():ee(t,"pointer"))};var Od=class{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},v1=class extends Od{constructor(t,e,n,r){super(t),this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!n[Td],this.allowDefault=n.shiftKey;let i,o;if(e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{let c=t.state.doc.resolve(e.pos);i=c.parent,o=c.depth?c.before():0}let s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:l}=t.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||l instanceof N&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Nt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),ee(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||te(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Hn(t))),this.updateAllowDefault(t),this.allowDefault||!e?ee(this.view,"pointer"):y1(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||dt&&this.mightDrag&&!this.mightDrag.node.isAtom||tt&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(qn(this.view,R.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):ee(this.view,"pointer")}move(t){this.updateAllowDefault(t),ee(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},x1=class extends Od{constructor(t,e){super(t),this.startSelection=e,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),ee(this.view,"pointer");let e=this.view.posAtCoords(Hn(t)),n=e&&Dd(this.view,e.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[o,s]=n.from<i.from?[i.to,n.from]:[i.from,n.to];qn(this.view,O.create(r,o,s),"pointer")}};ft.touchstart=t=>{t.input.lastTouch=Date.now(),ps(t),ee(t,"pointer")},ft.touchmove=t=>{t.input.lastTouch=Date.now(),ee(t,"pointer")},ft.contextmenu=t=>ps(t);function Nd(t,e){return t.composing?!0:dt&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var C1=Qt?5e3:-1;mt.compositionstart=mt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof O&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||tt&&Pc&&S1(t)))t.markCursor=t.state.storedMarks||n.marks(),Zr(t,!0),t.markCursor=null;else if(Zr(t,!e.selection.empty),Nt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Rd(t,C1)};function S1(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}mt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Rd(t,20))};function Rd(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Zr(t),e))}function _d(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function E1(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=g0(e.focusNode,e.focusOffset),r=y0(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function Zr(t,e=!1){if(!(Qt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_d(t),e||t.docView&&t.docView.dirty){let n=ns(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function M1(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var Vn=bt&&he<15||rn&&v0<604;ft.copy=mt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Vn?null:n.clipboardData,{dom:s,text:a}=ls(t,r.content());o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):M1(t,s),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function A1(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function D1(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Wn(t,r.value,null,i,e):Wn(t,r.textContent,r.innerHTML,i,e)},50)}function Wn(t,e,n,r,i){let o=wd(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||M.empty)))return!0;if(!o)return!1;let s=A1(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function zd(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}mt.paste=(t,e)=>{let n=e;if(t.composing&&!Qt)return;let r=Vn?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Wn(t,zd(r),r.getData("text/html"),i,n)?n.preventDefault():D1(t,n)};var $d=class{constructor(t,e,n){this.slice=t,this.move=e,this.node=n}},T1=Rt?"altKey":"ctrlKey";function Ld(t,e){let n;return t.someProp("dragCopies",r=>{n||=r(e)}),n==null?!e[T1]:!n}ft.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Hn(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof N?i.to-1:i.to))){if(r&&r.mightDrag)s=N.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=N.create(t.state.doc,d.posBefore))}}let{dom:a,text:l,slice:c}=ls(t,(s||t.state.selection).content());(!n.dataTransfer.files.length||!tt||Bc>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Vn?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Vn||n.dataTransfer.setData("text/plain",l),t.dragging=new $d(c,Ld(t,n),s)},ft.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},mt.dragover=mt.dragenter=(t,e)=>e.preventDefault(),mt.drop=(t,e)=>{try{O1(t,e,t.dragging)}finally{t.dragging=null}};function O1(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Hn(e));if(!r)return;let i=t.state.doc.resolve(r.pos),o=n&&n.slice;o?t.someProp("transformPasted",p=>{o=p(o,t,!1)}):o=wd(t,zd(e.dataTransfer),Vn?null:e.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&Ld(t,e));if(t.someProp("handleDrop",p=>p(t,e,o||M.empty,s))){e.preventDefault();return}if(!o)return;e.preventDefault();let a=o?Ql(t.state.doc,i.pos,o):i.pos;a??=i.pos;let l=t.state.tr;if(s){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,u=l.doc;if(d?l.replaceRangeWith(c,c,o.content.firstChild):l.replaceRange(c,c,o),l.doc.eq(u))return;let h=l.doc.resolve(c);if(d&&N.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new N(h));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((f,m,g,y)=>p=y),l.setSelection(is(t,h,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}ft.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&te(t)},20))},ft.blur=(t,e)=>{let n=e;t.focused&&=(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),!1)},ft.beforeinput=(t,e)=>{if(tt&&Qt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ze(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in mt)ft[t]=mt[t];function Un(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var Id=class em{constructor(e,n){this.toDOM=e,this.spec=n||Ie,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new wt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof em&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Un(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Kn=class sl{constructor(e,n){this.attrs=e,this.spec=n||Ie}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new wt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof sl&&Un(this.attrs,e.attrs)&&Un(this.spec,e.spec)}static is(e){return e.type instanceof sl}destroy(){}},N1=class nm{constructor(e,n){this.attrs=e,this.spec=n||Ie}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new wt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof nm&&Un(this.attrs,e.attrs)&&Un(this.spec,e.spec)}destroy(){}},wt=class Or{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Or(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Or(e,e,new Id(n,r))}static inline(e,n,r,i){return new Or(e,n,new Kn(r,i))}static node(e,n,r,i){return new Or(e,n,new N1(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Kn}get widget(){return this.type instanceof Id}},ln=[],Ie={},q=class Ae{constructor(e,n){this.local=e.length?e:ln,this.children=n.length?n:ln}static create(e,n){return n.length?Xr(n,e,0,Ie):ut}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==ut||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ie)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||=[]).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?R1(this.children,s||[],e,n,r,i,o):s?new Ae(s.sort(Fe),ln):ut}add(e,n){return n.length?this==ut?Ae.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let c=l+r,d;if(d=Pd(n,a,c)){for(i||=this.children.slice();o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,d,c+1):i.splice(o,0,l,l+a.nodeSize,Xr(d,a,c+1,Ie)),o+=3}});let s=Bd(o?jd(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ae(s.length?this.local.concat(s).sort(Fe):this.local,i||this.children)}remove(e){return e.length==0||this==ut?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let d=0,u;d<e.length;d++)(u=e[d])&&u.from>a&&u.to<l&&(e[d]=null,(s||=[]).push(u));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c==ut?(r.splice(o,3),o-=3):r[o+2]=c}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ae(i,r):ut}forChild(e,n){if(this==ut)return this;if(n.isLeaf)return Ae.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Kn){let c=Math.max(o,l.from)-o,d=Math.min(s,l.to)-o;c<d&&(i||=[]).push(l.copy(c,d))}}if(i){let a=new Ae(i.sort(Fe),ln);return r?new Fd([a,r]):a}return r||ut}eq(e){if(this==e)return!0;if(!(e instanceof Ae)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return fs(this.localsInner(e))}localsInner(e){if(this==ut)return ln;if(e.inlineContent||!this.local.some(Kn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Kn||n.push(this.local[r]);return n}forEachSet(e){e(this)}};q.empty=new q([],[]),q.removeOverlap=fs;var ut=q.empty,Fd=class Sn{constructor(e){this.members=e}map(e,n){let r=this.members.map(i=>i.map(e,n,Ie));return Sn.from(r)}forChild(e,n){if(n.isLeaf)return q.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ut&&(o instanceof Sn?r=r.concat(o.members):r.push(o))}return Sn.from(r)}eq(e){if(!(e instanceof Sn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&=(n=n.slice(),!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?fs(r?n:n.sort(Fe)):ln}static from(e){switch(e.length){case 0:return ut;case 1:return e[0];default:return new Sn(e.every(n=>n instanceof q)?e:e.reduce((n,r)=>n.concat(r instanceof q?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}};function R1(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,d=o;c<n.maps.length;c++){let u=0;n.maps[c].forEach((h,p,f,m)=>{let g=m-f-(p-h);for(let y=0;y<a.length;y+=3){let b=a[y+1];if(b<0||h>b+d-u)continue;let w=a[y]+d-u;p>=w?a[y+1]=h<=w?-2:-1:h>=d&&g&&(a[y]+=g,a[y+1]+=g)}u+=g}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=n.map(t[c]+o),u=d-i;if(u<0||u>=r.content.size){l=!0;continue}let h=n.map(t[c+1]+o,-1)-i,{index:p,offset:f}=r.content.findIndex(u),m=r.maybeChild(p);if(m&&f==u&&f+m.nodeSize==h){let g=a[c+2].mapInner(n,m,d+1,t[c]+o+1,s);g==ut?(a[c+1]=-2,l=!0):(a[c]=u,a[c+1]=h,a[c+2]=g)}else l=!0}if(l){let c=Xr(_1(a,t,e,n,i,o,s),r,0,s);e=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,u=0;d<c.children.length;d+=3){let h=c.children[d];for(;u<a.length&&a[u]<h;)u+=3;a.splice(u,0,c.children[d],c.children[d+1],c.children[d+2])}}return new q(e.sort(Fe),a)}function Bd(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new wt(i.from+e,i.to+e,i.type))}return n}function _1(t,e,n,r,i,o,s){function a(l,c){for(let d=0;d<l.local.length;d++){let u=l.local[d].map(r,i,c);u?n.push(u):s.onRemove&&s.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function Pd(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||=[]).push(s),t[o]=null);return i}function jd(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Xr(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let c=Pd(t,a,l+n);if(c){o=!0;let d=Xr(c,a,n+l+1,r);d!=ut&&i.push(l,l+a.nodeSize,d)}});let s=Bd(o?jd(t):t,-n).sort(Fe);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new q(s,i):ut}function Fe(t,e){return t.from-e.from||t.to-e.to}function fs(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Hd(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Hd(e,i,r.copy(o.from,r.to)));break}}}return e}function Hd(t,e,n){for(;e<t.length&&Fe(n,t[e])>0;)e++;t.splice(e,0,n)}function ms(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ut&&e.push(r)}),t.cursorWrapper&&e.push(q.create(t.state.doc,[t.cursorWrapper.deco])),Fd.from(e)}var z1={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},$1=bt&&he<=11,L1=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}},I1=class{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new L1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let r=0;r<n.length;r++)this.queue.push(n[r]);bt&&he<=11&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():dt&&t.composing&&n.some(r=>r.type=="childList"&&r.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),$1&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,z1)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(hd(this.view)){if(this.suppressingSelectionUpdates)return te(this.view);if(bt&&he<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&_e(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e=new Set,n;for(let i=t.focusNode;i;i=nn(i))e.add(i);for(let i=t.anchorNode;i;i=nn(i))if(e.has(i)){n=i;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&hd(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(t.editable)for(let c=0;c<e.length;c++){let d=this.registerMutation(e[c],a);d&&(i=i<0?d.from:Math.min(d.from,i),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(s=!0))}if(a.some(c=>c.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||tt&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&e.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of a)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(Nt&&a.length){let c=a.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,u]=c;d.parentNode&&d.parentNode.parentNode==u.parentNode?u.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let u of c){let h=u.parentNode;h&&h.nodeName=="LI"&&(!d||P1(t,d)!=h)&&u.remove()}}}let l=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Kr(n)&&(l=ns(t))&&l.eq(R.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,te(t),this.currentSelection.set(n),t.scrollToSelection()):(i>-1||r)&&(i>-1&&(t.docView.markDirty(i,o),F1(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,j1(t,a)),this.handleDOMChange(i,o,s,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||te(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let l=0;l<t.addedNodes.length;l++){let c=t.addedNodes[l];e.push(c),c.nodeType==3&&(this.lastChangedTextNode=c)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,i=t.nextSibling;if(bt&&he<=11&&t.addedNodes.length)for(let l=0;l<t.addedNodes.length;l++){let{previousSibling:c,nextSibling:d}=t.addedNodes[l];(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(r=c),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(i=d)}let o=r&&r.parentNode==t.target?it(r)+1:0,s=n.localPosFromDOM(t.target,o,-1),a=i&&i.parentNode==t.target?it(i):t.target.childNodes.length;return{from:s,to:n.localPosFromDOM(t.target,a,1)}}else return t.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=t.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}},qd=new WeakMap,Vd=!1;function F1(t){if(!qd.has(t)&&(qd.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Nt,Vd)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Vd=!0}}function Wd(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return _e(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function B1(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Wd(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Wd(t,n):null}function P1(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function j1(t,e){let{focusNode:n,focusOffset:r}=t.domSelectionRange();for(let i of e)if(i.parentNode?.nodeName=="TR"){let o=i.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let s=o;for(;;){let a=s.firstChild;if(!a||a.nodeType!=1||a.contentEditable=="false"||/^(BR|IMG)$/.test(a.nodeName))break;s=a}s.insertBefore(i,s.firstChild),n==i&&t.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function H1(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],Kr(l)||c.push({node:l.focusNode,offset:l.focusOffset})),tt&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let y=r.childNodes[g-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){o=g;break}if(!b||b.size)break}let u=t.state.doc,h=t.someProp("domParser")||Ze.fromSchema(t.state.schema),p=u.resolve(s),f=null,m=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace!="pre"||"full",findPositions:c,ruleFromNode:q1,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y??=g,f={anchor:g+s,head:y+s}}return{doc:m,sel:f,from:s,to:a}}function q1(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(dt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||dt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var V1=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function W1(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,A=ns(t,S);if(A&&!t.state.selection.eq(A)){if(tt&&Qt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",z=>z(t,ze(13,"Enter"))))return;let _=t.state.tr.setSelection(A);S=="pointer"?_.setMeta("pointer",!0):S=="key"&&_.scrollIntoView(),o&&_.setMeta("composition",o),t.dispatch(_)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=H1(t,e,n),d=t.state.doc,u=d.slice(c.from,c.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let f=J1(u.content,c.doc.content,c.from,h,p);if(f&&t.input.domChangeCount++,(rn&&t.input.lastIOSEnter>Date.now()-225||Qt)&&i.some(S=>S.nodeType==1&&!V1.test(S.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",S=>S(t,ze(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&l instanceof O&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))f={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let S=Ud(t,t.state.doc,c.sel);if(S&&!S.eq(t.state.selection)){let A=t.state.tr.setSelection(S);o&&A.setMeta("composition",o),t.dispatch(A)}}return}t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof O&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),bt&&he<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>c.from&&c.doc.textBetween(f.start-c.from-1,f.start-c.from+1)==" \xA0"&&(f.start--,f.endA--,f.endB--);let m=c.doc.resolveNoCache(f.start-c.from),g=c.doc.resolveNoCache(f.endB-c.from),y=d.resolve(f.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((rn&&t.input.lastIOSEnter>Date.now()-225&&(!b||i.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!b&&m.pos<c.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(c.doc.textBetween(m.pos,g.pos,"","")))&&t.someProp("handleKeyDown",S=>S(t,ze(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&K1(d,f.start,f.endA,m,g)&&t.someProp("handleKeyDown",S=>S(t,ze(8,"Backspace")))){Qt&&tt&&t.domObserver.suppressSelectionUpdates();return}tt&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),Qt&&!b&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==f.endA&&(f.endB-=2,g=c.doc.resolveNoCache(f.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,ze(13,"Enter"))})},20));let w=f.start,k=f.endA,v=S=>{let A=S||t.state.tr.replace(w,k,c.doc.slice(f.start-c.from,f.endB-c.from));if(c.sel){let _=Ud(t,A.doc,c.sel);_&&!(tt&&t.composing&&_.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(_.head==w||_.head==A.mapping.map(k)-1)||bt&&_.empty&&_.head==w)&&A.setSelection(_)}return o&&A.setMeta("composition",o),A.scrollIntoView()},E;if(b)if(m.pos==g.pos){bt&&he<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>te(t),20));let S=v(t.state.tr.delete(w,k)),A=d.resolve(f.start).marksAcross(d.resolve(f.endA));A&&S.ensureMarks(A),t.dispatch(S)}else if(f.endA==f.endB&&(E=U1(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let S=v(t.state.tr);E.type=="add"?S.addMark(w,k,E.mark):S.removeMark(w,k,E.mark),t.dispatch(S)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-+!g.textOffset){let S=m.parent.textBetween(m.parentOffset,g.parentOffset),A=()=>v(t.state.tr.insertText(S,w,k));t.someProp("handleTextInput",_=>_(t,w,k,S,A))||t.dispatch(A())}else t.dispatch(v());else t.dispatch(v())}function Ud(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:is(t,e.resolve(n.anchor),e.resolve(n.head))}function U1(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)o=n[d].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(x.from(c).eq(t))return{mark:a,type:s}}function K1(t,e,n,r,i){if(n-e<=i.pos-r.pos||gs(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(gs(o,!0,!0));return!s.parent.isTextblock||s.pos>n||gs(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function gs(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function J1(t,e,n,r,i){let o=t.findDiffStart(e,n),s=n+t.size,a=n+e.size;if(o==null)return null;let{a:l,b:c}=t.findDiffEnd(e,s,a);if(i=="end"){let d=Math.max(0,o-Math.min(l,c));r-=l+d-o}if(l<o&&s<a){let d=r<=o&&r>=l?o-r:0;o-=d,c=o+(c-l),l=o}else if(c<o){let d=r<=o&&r>=c?o-r:0;o-=d,l=o+(l-c),c=o}return{start:o,endA:l,endB:c}}var Kd=class{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new c1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Qd),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Zd(this),Gd(this),this.nodeViews=Xd(this),this.docView=Yc(this.state.doc,Jd(this),ms(this),this.dom,this),this.domObserver=new I1(this,(n,r,i,o)=>W1(this,n,r,i,o)),this.domObserver.start(),d1(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ds(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Qd),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let n=this.state,r=!1,i=!1;t.storedMarks&&this.composing&&(_d(this),i=!0),this.state=t;let o=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(o||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let u=Xd(this);Z1(u,this.nodeViews)&&(this.nodeViews=u,r=!0)}(o||e.handleDOMEvents!=this._props.handleDOMEvents)&&ds(this),this.editable=Zd(this),Gd(this);let s=ms(this),a=Jd(this),l=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",c=r||!this.docView.matchesNode(t.doc,a,s);(c||!t.selection.eq(n.selection))&&(i=!0);let d=l=="preserve"&&i&&this.dom.style.overflowAnchor==null&&S0(this);if(i){this.domObserver.stop();let u=c&&(bt||tt)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&G1(n.selection,t.selection);if(c){let p=tt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=E1(this)),(r||!this.docView.update(t.doc,a,s,this))&&(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Yc(t.doc,a,s,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(u=!0)}let h=this.input.mouseDown;u||!(h&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&J0(this)&&h.delaySelUpdate())?te(this,u):(dd(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,n),l=="reset"?this.dom.scrollTop=0:l=="to selection"?this.scrollToSelection():d&&E0(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))&&!this.someProp("handleScrollToSelection",e=>e(this)))if(this.state.selection instanceof N){let e=this.docView.domAfterPos(this.state.selection.from);e.nodeType==1&&jc(this,e.getBoundingClientRect(),t)}else jc(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let n=this.directPlugins[e];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let n=this.state.plugins[e];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}}updateDraggedNode(t,e){let n=t.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let i=n.from+(this.state.doc.content.size-e.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==n.node&&(r=i)}this.dragging=new $d(t.slice,t.move,r<0?void 0:N.create(this.state.doc,r))}someProp(t,e){let n=this._props&&this._props[t],r;if(n!=null&&(r=e?e(n):n))return r;for(let o=0;o<this.directPlugins.length;o++){let s=this.directPlugins[o].props[t];if(s!=null&&(r=e?e(s):s))return r}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let s=i[o].props[t];if(s!=null&&(r=e?e(s):s))return r}}hasFocus(){if(bt){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&M0(this.dom),te(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return t||document}updateRoot(){this._root=null}posAtCoords(t){return N0(this,t)}coordsAtPos(t,e=1){return Uc(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(r==null)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return L0(this,e||this.state,t)}pasteHTML(t,e){return Wn(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Wn(this,t,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(t){return ls(this,t)}destroy(){this.docView&&(u1(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ms(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,f0())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return p1(this,t)}domSelectionRange(){let t=this.domSelection();return t?dt&&this.root.nodeType===11&&b0(this.dom.ownerDocument)==this.dom&&B1(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Kd.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Jd(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||="no",[wt.node(0,t.state.doc.content.size,e)]}function Gd(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:wt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Zd(t){return!t.someProp("editable",e=>e(t.state)===!1)}function G1(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Xd(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Z1(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Qd(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}for(var me={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Qr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X1=typeof navigator<"u"&&/Mac/.test(navigator.platform),Q1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),at=0;at<10;at++)me[48+at]=me[96+at]=String(at);for(var at=1;at<=24;at++)me[at+111]="F"+at;for(var at=65;at<=90;at++)me[at]=String.fromCharCode(at+32),Qr[at]=String.fromCharCode(at);for(var ys in me)Qr.hasOwnProperty(ys)||(Qr[ys]=me[ys]);function Y1(t){var e=!(X1&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Q1&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified")&&t.key||(t.shiftKey?Qr:me)[t.keyCode]||t.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}var ty=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ey=typeof navigator<"u"&&/Win/.test(navigator.platform);function ny(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))ty?s=!0:i=!0;else throw Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function ry(t){let e=Object.create(null);for(let n in t)e[ny(n)]=t[n];return e}function ks(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function iy(t){return new j({props:{handleKeyDown:bs(t)}})}function bs(t){let e=ry(t);return function(n,r){let i=Y1(r),o,s=e[ks(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[ks(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ey&&r.ctrlKey&&r.altKey)&&(o=me[r.keyCode])&&o!=i){let a=e[ks(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var oy=Object.defineProperty,ws=(t,e)=>{for(var n in e)oy(t,n,{get:e[n],enumerable:!0})};function Yr(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var ti=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([s,a])=>[s,(...l)=>{let c=a(...l)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!t,l=t||i.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(l),s.every(u=>u===!0)),d={...Object.fromEntries(Object.entries(n).map(([u,h])=>[u,(...p)=>{let f=this.buildProps(l,e),m=h(...p)(f);return s.push(m),d}])),run:c};return d}createCan(t){let{rawCommands:e,state:n}=this,r=t||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(e).map(([o,s])=>[o,(...a)=>s(...a)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(t,e=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:t,editor:r,view:o,state:Yr({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)(s)]))}};return s}},Yd={};ws(Yd,{blur:()=>sy,clearContent:()=>ay,clearNodes:()=>ly,command:()=>cy,createParagraphNear:()=>dy,cut:()=>uy,deleteCurrentNode:()=>hy,deleteNode:()=>py,deleteRange:()=>fy,deleteSelection:()=>yy,enter:()=>ky,exitCode:()=>by,extendMarkRange:()=>wy,first:()=>vy,focus:()=>Cy,forEach:()=>Sy,insertContent:()=>Ey,insertContentAt:()=>My,insertDefaultBlock:()=>Ay,joinBackward:()=>Oy,joinDown:()=>Ty,joinForward:()=>Ny,joinItemBackward:()=>Ry,joinItemForward:()=>_y,joinTextblockBackward:()=>zy,joinTextblockForward:()=>$y,joinUp:()=>Dy,keyboardShortcut:()=>Iy,lift:()=>Fy,liftEmptyBlock:()=>By,liftListItem:()=>Py,newlineInCode:()=>jy,resetAttributes:()=>Hy,scrollIntoView:()=>qy,selectAll:()=>Vy,selectNodeBackward:()=>Wy,selectNodeForward:()=>Uy,selectParentNode:()=>Ky,selectTextblockEnd:()=>Jy,selectTextblockStart:()=>Gy,setContent:()=>Zy,setMark:()=>gk,setMeta:()=>yk,setNode:()=>kk,setNodeSelection:()=>bk,setTextDirection:()=>wk,setTextSelection:()=>vk,sinkListItem:()=>xk,splitBlock:()=>Ck,splitListItem:()=>Sk,toggleList:()=>Mk,toggleMark:()=>Ak,toggleNode:()=>Dk,toggleWrap:()=>Tk,undoInputRule:()=>Ok,unsetAllMarks:()=>Nk,unsetMark:()=>Rk,unsetTextDirection:()=>_k,updateAttributes:()=>zk,updateDecorations:()=>$k,wrapIn:()=>Lk,wrapInList:()=>Ik});var sy=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),ay=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),ly=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;let{doc:c,mapping:d}=e,u=c.resolve(d.map(l)),h=c.resolve(d.map(l+a.nodeSize)),p=u.blockRange(h);if(!p)return;let f=Qe(p);if(a.type.isTextblock){let{defaultType:m}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(p.start,m)}(f||f===0)&&e.lift(p,f)})}),!0},cy=t=>e=>t(e),dy=()=>({state:t,dispatch:e})=>Ac(t,e),uy=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new O(r.doc.resolve(Math.max(s-1,0)))),!0},hy=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;--o)if(i.node(o).type===r.type){if(e){let s=i.before(o),a=i.after(o);t.delete(s,a).scrollIntoView()}return!0}return!1};function Y(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var py=t=>({tr:e,state:n,dispatch:r})=>{let i=Y(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;--s)if(o.node(s).type===i){if(r){let a=o.before(s),l=o.after(s);e.delete(a,l).scrollIntoView()}return!0}return!1},fy=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},my=t=>t.content?/^text(\*|\+)/.test(t.content):!1,tu=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;let r=e.nodes[t.parent.type.name].spec;return my(r)?n==="left"?t.start()-1:t.end()+1:t.pos},gy=(t,e,n)=>({from:tu(t,n,"left"),to:tu(e,n,"right")}),yy=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){let n=t.tr,{ranges:r}=t.selection,i=n.steps.length;r.forEach(o=>{let s=n.mapping.slice(i),{from:a,to:l}=gy(n.doc.resolve(s.map(o.$from.pos)),n.doc.resolve(s.map(o.$to.pos)),t.schema);n.deleteRange(a,l)}),n.selection.empty||n.setSelection(O.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},ky=()=>({commands:t})=>t.keyboardShortcut("Enter"),by=()=>({state:t,dispatch:e})=>Mc(t,e);function vs(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ei(t,e,n={strict:!0}){let r=Object.keys(e);return!r.length||r.every(i=>n.strict?e[i]===t[i]:vs(e[i])?e[i].test(t[i]):e[i]===t[i])}function eu(t,e,n={}){return t.find(r=>r.type===e&&ei(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function nu(t,e,n={}){return!!eu(t,e,n)}function xs(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(l=>l.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(l=>l.type===e))return;if(!n){let l=r.node.marks.find(c=>c.type===e);l&&(n=l.attrs)}if(!eu([...r.node.marks],e,n))return;let i=r.index,o=t.start()+r.offset,s=i+1,a=o+r.node.nodeSize;for(;i>0&&nu([...t.parent.child(i-1).marks],e,n);)--i,o-=t.parent.child(i).nodeSize;for(;s<t.parent.childCount&&nu([...t.parent.child(s).marks],e,n);)a+=t.parent.child(s).nodeSize,s+=1;return{from:o,to:a}}function ne(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var wy=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=ne(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){let u=xs(l,o,e);if(u&&u.from<=c&&u.to>=d){let h=O.create(s,u.from,u.to);n.setSelection(h)}}return!0},vy=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function ru(t){return t instanceof O}function Be(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Cs(t,e=null){if(!e)return null;let n=R.atStart(t),r=R.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;let i=n.from,o=r.to;return e==="all"?O.create(t,Be(0,i,o),Be(t.content.size,i,o)):O.create(t,Be(e,i,o),Be(e,i,o))}function iu(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function ni(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function xy(){return typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var Cy=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{(ni()||iu())&&r.dom.focus(),xy()&&!ni()&&!iu()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(o&&t===null&&!ru(n.state.selection))return s(),!0;let a=Cs(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Sy=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),Ey=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),ou=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;--n){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&ou(r)}return t};function ri(t){if(typeof window>"u")throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return ou(n)}function su(t){return typeof t?.nodesBetween=="function"}function cn(t,e,n){if(su(t))return t;let r=typeof t=="object"&&!!t;n={slice:!0,parseOptions:{},...n};let i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return x.fromArray(t.map(s=>e.nodeFromJSON(s)));let o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(o){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),cn("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="",l=new Do({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Ze.fromSchema(l).parseSlice(ri(t),n.parseOptions):Ze.fromSchema(l).parse(ri(t),n.parseOptions),n.errorOnInvalidContent&&s)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${a}`)})}let o=Ze.fromSchema(e);return n.slice?o.parseSlice(ri(t),n.parseOptions).content:o.parse(ri(t),n.parseOptions)}return cn("",e,n)}function au(t){return!("type"in t)}function lu(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Mt||i instanceof kt))return;let o=t.mapping.maps[r],s=0;o.forEach((a,l,c,d)=>{s===0&&(s=d)}),t.setSelection(R.near(t.doc.resolve(s),n))}var My=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s,a=m=>{o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{cn(e,o.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(m){a(m)}try{s=cn(e,o.schema,{parseOptions:l,errorOnInvalidContent:n.errorOnInvalidContent??o.options.enableContentCheck})}catch(m){return a(m),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,h=!0,p=au(s)?s.content:[s];if(p.forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,h=h?m.isBlock:!1}),c===d&&h){let{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(--c,d+=1)}let f;if(u)f=Array.isArray(e)?e.map(m=>m.text||"").join(""):su(e)?p.map(m=>m.text??"").join(""):typeof e=="object"&&e&&e.text?e.text:e,r.insertText(f,c,d);else{f=x.from(p);let m=r.doc.resolve(c),g=m.node(),y=m.parentOffset===0,b=g.isText||g.isTextblock,w=g.content.size>0;y&&b&&w&&h&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&lu(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:f})}return!0};function cu(t){for(let e=0;e<t.edgeCount;e+=1){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Ay=(t={})=>({tr:e,dispatch:n,editor:r})=>{let{pos:i,attrs:o,content:s,updateSelection:a=!0}=t,l;l=typeof i=="number"?e.doc.resolve(i):i||e.selection.$from;let c=cu(l.parent.contentMatchAt(l.index()));if(!c)return!1;let d=Object.keys(c.spec.attrs||{}),u=o?Object.fromEntries(Object.entries(o).filter(([p])=>d.includes(p))):{},h;if(s){let p=cn(s,r.schema);h=c.createAndFill(u,p)}else h=c.createAndFill(u);return h?(n&&(e.insert(l.pos,h),a&&lu(e,e.steps.length-1,-1)),!0):!1},Dy=()=>({state:t,dispatch:e})=>Xg(t,e),Ty=()=>({state:t,dispatch:e})=>Qg(t,e),Oy=()=>({state:t,dispatch:e})=>bc(t,e),Ny=()=>({state:t,dispatch:e})=>Cc(t,e),Ry=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Wr(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},_y=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Wr(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},zy=()=>({state:t,dispatch:e})=>Gg(t,e),$y=()=>({state:t,dispatch:e})=>Zg(t,e);function du(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}function Ly(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))ni()||du()?s=!0:i=!0;else throw Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}var Iy=t=>({editor:e,view:n,tr:r,dispatch:i})=>{let o=Ly(t).split(/-(?!$)/),s=o.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0});return e.captureTransaction(()=>{n.someProp("handleKeyDown",l=>l(n,a))})?.steps.forEach(l=>{let c=l.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function re(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?Y(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(d,u)=>{if(d.isText)return;let h=Math.max(r,u),p=Math.min(i,u+d.nodeSize);a.push({node:d,from:h,to:p})});let l=i-r,c=a.filter(d=>!s||s.name===d.node.type.name).filter(d=>ei(d.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((d,u)=>d+u.to-u.from,0)>=l}var Fy=(t,e={})=>({state:n,dispatch:r})=>re(n,Y(t,n.schema),e)?Yg(n,r):!1,By=()=>({state:t,dispatch:e})=>Dc(t,e),Py=t=>({state:e,dispatch:n})=>d0(Y(t,e.schema))(e,n),jy=()=>({state:t,dispatch:e})=>Ec(t,e);function ii(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function uu(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var Hy=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=ii(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(o=Y(t,r.schema)),a==="mark"&&(s=ne(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&(l=!0,i&&n.setNodeMarkup(u,void 0,uu(d.attrs,e))),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&(l=!0,i&&n.addMark(u,u+d.nodeSize,s.create(uu(h.attrs,e))))})})}),l},qy=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Vy=()=>({tr:t,dispatch:e})=>{if(e){let n=new Pt(t.doc);t.setSelection(n)}return!0},Wy=()=>({state:t,dispatch:e})=>vc(t,e),Uy=()=>({state:t,dispatch:e})=>Sc(t,e),Ky=()=>({state:t,dispatch:e})=>n0(t,e),Jy=()=>({state:t,dispatch:e})=>Rc(t,e),Gy=()=>({state:t,dispatch:e})=>Nc(t,e);function Ss(t,e,n={},r={}){return cn(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Zy=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{let{doc:l}=o;if(r.preserveWhitespace!=="full"){let c=Ss(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});if(s){let d=au(c)?c.content:[c];o.replaceWith(0,l.content.size,d).setMeta("preventUpdate",!n)}return!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function hu(t,e){let n=ne(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});let a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function pu(t,e){let n=new Bo(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Xy(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Jn(t,e){for(let n=t.depth;n>0;--n){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function oi(t){return e=>Jn(e.$from,t)}function D(t,e,n){return t.config[e]===void 0&&t.parent?D(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?D(t.parent,e,n):null}):t.config[e]}function Es(t){return t.map(e=>{let n=D(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...Es(n())]:e}).flat(10)}function Gn(t,e){let n=Nn.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function fu(t){return typeof t=="function"}function F(t,e=void 0,...n){return fu(t)?e?t.bind(e)(...n):t(...n):t}function Qy(t={}){return Object.keys(t).length===0&&t.constructor===Object}function dn(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function mu(t){let e=[],{nodeExtensions:n,markExtensions:r}=dn(t),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(c=>c.name!=="text").map(c=>c.name),a=r.map(c=>c.name),l=[...s,...a];return t.forEach(c=>{let d=D(c,"addGlobalAttributes",{name:c.name,options:c.options,storage:c.storage,extensions:i});d&&d().forEach(u=>{let h;h=Array.isArray(u.types)?u.types:u.types==="*"?l:u.types==="nodes"?s:u.types==="marks"?a:[],h.forEach(p=>{Object.entries(u.attributes).forEach(([f,m])=>{e.push({type:p,name:f,attribute:{...o,...m}})})})})}),i.forEach(c=>{let d=D(c,"addAttributes",{name:c.name,options:c.options,storage:c.storage});if(!d)return;let u=d();Object.entries(u).forEach(([h,p])=>{let f={...o,...p};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,e.push({type:c.name,name:h,attribute:f})})}),e}function Yy(t){let e=[],n="",r=!1,i=!1,o=0,s=t.length;for(let a=0;a<s;a+=1){let l=t[a];if(l==="'"&&!i){r=!r,n+=l;continue}if(l==='"'&&!r){i=!i,n+=l;continue}if(!r&&!i){if(l==="("){o+=1,n+=l;continue}if(l===")"&&o>0){--o,n+=l;continue}if(l===";"&&o===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function gu(t){let e=[],n=Yy(t||""),r=n.length;for(let i=0;i<r;i+=1){let o=n[i],s=o.indexOf(":");if(s===-1)continue;let a=o.slice(0,s).trim(),l=o.slice(s+1).trim();a&&l&&e.push([a,l])}return e}function W(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let s=o?String(o).split(" "):[],a=r[i]?r[i].split(" "):[],l=s.filter(c=>!a.includes(c));r[i]=[...a,...l].join(" ")}else if(i==="style"){let s=new Map([...gu(r[i]),...gu(o)]);r[i]=Array.from(s.entries()).map(([a,l])=>`${a}: ${l}`).join("; ")}else r[i]=o}),r},{})}function un(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>W(n,r),{})}function tk(t){return typeof t=="string"?t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"||t!=="false"&&t:t}function yu(t,e){return"style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(n):tk(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function ku(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Qy(n)?!1:n!=null))}function bu(t){let e={};return!t?.attribute?.isRequired&&"default"in(t?.attribute||{})&&(e.default=t.attribute.default),t?.attribute?.validate!==void 0&&(e.validate=t.attribute.validate),[t.name,e]}function ek(t,e){let n=mu(t),{nodeExtensions:r,markExtensions:i}=dn(t);return new Do({topNode:r.find(o=>D(o,"topNode"))?.name,nodes:Object.fromEntries(r.map(o=>{let s=n.filter(h=>h.type===o.name),a={name:o.name,options:o.options,storage:o.storage,editor:e},l=ku({...t.reduce((h,p)=>{let f=D(p,"extendNodeSchema",a);return{...h,...f?f(o):{}}},{}),content:F(D(o,"content",a)),marks:F(D(o,"marks",a)),group:F(D(o,"group",a)),inline:F(D(o,"inline",a)),atom:F(D(o,"atom",a)),selectable:F(D(o,"selectable",a)),draggable:F(D(o,"draggable",a)),code:F(D(o,"code",a)),whitespace:F(D(o,"whitespace",a)),linebreakReplacement:F(D(o,"linebreakReplacement",a)),defining:F(D(o,"defining",a)),isolating:F(D(o,"isolating",a)),attrs:Object.fromEntries(s.map(bu))}),c=F(D(o,"parseHTML",a));c&&(l.parseDOM=c.map(h=>yu(h,s)));let d=D(o,"renderHTML",a);d&&(l.toDOM=h=>d({node:h,HTMLAttributes:un(h,s)}));let u=D(o,"renderText",a);return u&&(l.toText=u),[o.name,l]})),marks:Object.fromEntries(i.map(o=>{let s=n.filter(u=>u.type===o.name),a={name:o.name,options:o.options,storage:o.storage,editor:e},l=ku({...t.reduce((u,h)=>{let p=D(h,"extendMarkSchema",a);return{...u,...p?p(o):{}}},{}),inclusive:F(D(o,"inclusive",a)),excludes:F(D(o,"excludes",a)),group:F(D(o,"group",a)),spanning:F(D(o,"spanning",a)),code:F(D(o,"code",a)),attrs:Object.fromEntries(s.map(bu))}),c=F(D(o,"parseHTML",a));c&&(l.parseDOM=c.map(u=>yu(u,s)));let d=D(o,"renderHTML",a);return d&&(l.toDOM=u=>d({mark:u,HTMLAttributes:un(u,s)})),[o.name,l]}))})}function nk(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Zn(t){return t.sort((e,n)=>{let r=D(e,"priority")||100,i=D(n,"priority")||100;return r>i?-1:+(r<i)})}function wu(t){let e=Zn(Es(t)),n=nk(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function vu(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=`
11
+
12
+ `,textSerializers:s={}}=n||{},a="";return t.nodesBetween(r,i,(l,c,d,u)=>{l.isBlock&&c>r&&(a+=o);let h=s?.[l.type.name];if(h)return d&&(a+=h({node:l,pos:c,parent:d,index:u,range:e})),!1;l.isText&&(a+=l?.text?.slice(Math.max(r,c)-c,i-c))}),a}function rk(t,e){return vu(t,{from:0,to:t.content.size},e)}function xu(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function ik(t,e){let n=Y(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});let s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function Cu(t,e){let n=ii(typeof e=="string"?e:e.name,t.schema);return n==="node"?ik(t,e):n==="mark"?hu(t,e):{}}function ok(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function sk(t){let e=ok(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function si(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{let{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{let c=e.slice(o).map(a,-1),d=e.slice(o).map(l),u=e.invert().map(c,-1),h=e.invert().map(d);r.push({oldRange:{from:u,to:h},newRange:{from:c,to:d}})})}),sk(r)}function Ms(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=xs(n.resolve(t),i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}var ak=(t,e,n,r=20)=>{let i=t.doc.resolve(n),o=r,s=null;for(;o>0&&s===null;){let a=i.node(o);a?.type.name===e?s=a:--o}return[s,o]},lk=t=>{let e=t.depth-1;if(e<0)return null;let n=t.index(e);return n===0?null:t.node(e).child(n-1)};function hn(t,e){return e.nodes[t]||e.marks[t]||null}function ai(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var ck=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l;let c=(l=i.type.spec).toText?.call(l,{node:i,pos:o,parent:s,index:a})||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-o))}),n};function As(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?ne(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>!o||o.name===d.type.name).find(d=>ei(d.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:d,$to:u})=>{let h=d.pos,p=u.pos;t.doc.nodesBetween(h,p,(f,m)=>{if(o&&f.inlineContent&&!f.type.allowsMarkType(o))return!1;if(!f.isText&&!f.marks.length)return;let g=Math.max(h,m),y=Math.min(p,m+f.nodeSize),b=y-g;s+=b,a.push(...f.marks.map(w=>({mark:w,from:g,to:y})))})}),s===0)return!1;let l=a.filter(d=>!o||o.name===d.mark.type.name).filter(d=>ei(d.mark.attrs,n,{strict:!1})).reduce((d,u)=>d+u.to-u.from,0),c=a.filter(d=>!o||d.mark.type!==o&&d.mark.type.excludes(o)).reduce((d,u)=>d+u.to-u.from,0);return(l>0?l+c:l)>=s}function dk(t,e,n={}){if(!e)return re(t,null,n)||As(t,null,n);let r=ii(e,t.schema);return r==="node"?re(t,e,n):r==="mark"&&As(t,e,n)}var uk=(t,e)=>{let{$from:n,$to:r,$anchor:i}=t.selection;if(e){let o=oi(a=>a.type.name===e)(t.selection);if(!o)return!1;let s=t.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},hk=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Su(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Ds(t,e){let{nodeExtensions:n}=dn(e),r=n.find(o=>o.name===t);if(!r)return!1;let i=F(D(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof i=="string"&&i.split(" ").includes("list")}function Xn(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test(t.text??"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let r=!0;return t.content.forEach(i=>{r!==!1&&(Xn(i,{ignoreWhitespace:n,checkChildren:e})||(r=!1))}),r}return!1}function Eu(t){return t instanceof N}var Mu=class rm{constructor(e){this.position=e}static fromJSON(e){return new rm(e.position)}toJSON(){return{position:this.position}}};function pk(t,e){let n=e.mapping.mapResult(t.position);return{position:new Mu(n.pos),mapResult:n}}function fk(t){return new Mu(t)}function mk(t,e,n){let{selection:r}=e,i=null;if(ru(r)&&(i=r.$cursor),i){let s=t.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(s)||!s.some(a=>a.type.excludes(n)))}let{ranges:o}=r;return o.some(({$from:s,$to:a})=>{let l=s.depth===0&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(s.pos,a.pos,(c,d,u)=>{if(l)return!1;if(c.isInline){let h=!u||u.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(f=>f.type.excludes(n));l=h&&p}return!l}),l})}var gk=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=ne(t,r.schema);if(i)if(s){let c=hu(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{let d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(h,p)=>{let f=Math.max(p,d),m=Math.min(p+h.nodeSize,u);h.marks.find(g=>g.type===l)?h.marks.forEach(g=>{l===g.type&&n.addMark(f,m,l.create({...g.attrs,...e}))}):n.addMark(f,m,l.create(e))})});return mk(r,n,l)},yk=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),kk=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=Y(t,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>_c(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>_c(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},bk=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=Be(t,0,r.content.size),o=N.create(r,i);e.setSelection(o)}return!0},wk=(t,e)=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=r,s,a;return typeof e=="number"?(s=e,a=e):e&&"from"in e&&"to"in e?(s=e.from,a=e.to):(s=o.from,a=o.to),i&&n.doc.nodesBetween(s,a,(l,c)=>{l.isText||n.setNodeMarkup(c,void 0,{...l.attrs,dir:t})}),!0},vk=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=O.atStart(r).from,a=O.atEnd(r).to,l=Be(i,s,a),c=Be(o,s,a),d=O.create(r,l,c);e.setSelection(d)}return!0},xk=t=>({state:e,dispatch:n})=>p0(Y(t,e.schema))(e,n);function Au(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var Ck=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,d=ai(c,a.node().type.name,a.node().attrs);if(o instanceof N&&o.node.isBlock)return!a.parentOffset||!Zt(s,a.pos)?!1:(r&&(t&&Au(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let u=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:cu(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=u&&h?[{type:h,attrs:d}]:void 0,f=Zt(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!f&&Zt(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(f=!0,p=h?[{type:h,attrs:d}]:void 0),r){if(f&&(o instanceof O&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),h&&!u&&!a.parentOffset&&a.parent.type!==h)){let m=e.mapping.map(a.before()),g=e.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Au(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},Sk=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let s=Y(t,r.schema),{$from:a,$to:l}=r.selection,c=r.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;let d=a.node(-1);if(d.type!==s)return!1;let u=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let g=x.empty,y=a.index(-1)?1:a.index(-2)?2:3;for(let S=a.depth-y;S>=a.depth-3;--S)g=x.from(a.node(S).copy(g));let b=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,w={...ai(u,a.node().type.name,a.node().attrs),...e},k=s.contentMatch.defaultType?.createAndFill(w)||void 0;g=g.append(x.from(s.createAndFill(null,k)||void 0));let v=a.before(a.depth-(y-1));n.replace(v,a.after(-b),new M(g,4-y,0));let E=-1;n.doc.nodesBetween(v,n.doc.content.size,(S,A)=>{if(E>-1)return!1;S.isTextblock&&S.content.size===0&&(E=A+1)}),E>-1&&n.setSelection(O.near(n.doc.resolve(E))),n.scrollIntoView()}return!0}let h=l.pos===a.end()?d.contentMatchAt(0).defaultType:null,p={...ai(u,d.type.name,d.attrs),...e},f={...ai(u,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,l.pos);let m=h?[{type:s,attrs:p},{type:h,attrs:f}]:[{type:s,attrs:p}];if(!Zt(n.doc,a.pos,2))return!1;if(i){let{selection:g,storedMarks:y}=r,{splittableMarks:b}=o.extensionManager,w=y||g.$to.parentOffset&&g.$from.marks();if(n.split(a.pos,2,m).scrollIntoView(),!w||!i)return!0;let k=w.filter(v=>b.includes(v.type.name));n.ensureMarks(k)}return!0};function Du(t){return!t||t==="1"?null:t}function Tu(t,e){return Du(t)===Du(e)}var Ts=(t,e)=>{let n=oi(o=>o.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return!(n.node.type===i?.type&&ce(t.doc,n.pos))||!Tu(n.node.attrs.type,i?.attrs.type)||t.join(n.pos),!0},Os=(t,e)=>{let n=oi(o=>o.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return!(n.node.type===i?.type&&ce(t.doc,r))||!Tu(n.node.attrs.type,i?.attrs.type)||t.join(r),!0};function Ek(t){let e=t.doc,n=e.firstChild;if(!n)return null;let r=e.resolve(1),i=e.resolve(n.nodeSize-1);return O.between(r,i)}var Mk=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:d})=>{let{extensions:u,splittableMarks:h}=i.extensionManager,p=Y(t,s.schema),f=Y(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,w=y.blockRange(b),k=g||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;let v=oi(P=>Ds(P.type.name,u))(m),E=m.from===0&&m.to===s.doc.content.size,S=s.doc.content.content,A=S.length===1?S[0]:null,_=E&&A&&Ds(A.type.name,u)?{node:A,pos:0,depth:0}:null,z=v??_,nt=!!v&&w.depth>=1&&w.depth-v.depth<=1,lt=!!_;if((nt||lt)&&z){if(z.node.type===p)return E&&lt?l().command(({tr:P,dispatch:H})=>{let Z=Ek(P);return Z?(P.setSelection(Z),H&&H(P),!0):!1}).liftListItem(f).run():c.liftListItem(f);if(Ds(z.node.type.name,u)&&p.validContent(z.node.content))return l().command(()=>(o.setNodeMarkup(z.pos,p),!0)).command(()=>Ts(o,p)).command(()=>Os(o,p)).run()}return!n||!k||!a?l().command(()=>d().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Ts(o,p)).command(()=>Os(o,p)).run():l().command(()=>{let P=d().wrapInList(p,r),H=k.filter(Z=>h.includes(Z.type.name));return o.ensureMarks(H),P?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Ts(o,p)).command(()=>Os(o,p)).run()},Ak=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=ne(t,r.schema);return As(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Dk=(t,e,n={})=>({state:r,commands:i})=>{let o=Y(t,r.schema),s=Y(e,r.schema),a=re(r,o,n),l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...n})},Tk=(t,e={})=>({state:n,commands:r})=>{let i=Y(t,n.schema);return re(n,i,e)?r.lift(i):r.wrapIn(i,e)},Ok=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;--l)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},Nk=(t={})=>({tr:e,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=t,{selection:o}=e,{empty:s,ranges:a}=o;if(s)return!0;let{nonClearableMarks:l}=r.extensionManager;if(n){let c=Object.values(r.schema.marks).filter(d=>i||!l.includes(d.name));a.forEach(d=>{for(let u of c)e.removeMark(d.$from.pos,d.$to.pos,u)})}return!0},Rk=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:o=!1}=e,{selection:s}=n,a=ne(t,r.schema),{$from:l,empty:c,ranges:d}=s;if(!i)return!0;if(c&&o){let{from:u,to:h}=s,p=xs(l,a,l.marks().find(f=>f.type===a)?.attrs);p&&(u=p.from,h=p.to),n.removeMark(u,h,a)}else d.forEach(u=>{n.removeMark(u.$from.pos,u.$to.pos,a)});return n.removeStoredMark(a),!0},_k=t=>({tr:e,state:n,dispatch:r})=>{let{selection:i}=n,o,s;return typeof t=="number"?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=i.from,s=i.to),r&&e.doc.nodesBetween(o,s,(a,l)=>{if(a.isText)return;let c={...a.attrs};delete c.dir,e.setNodeMarkup(l,void 0,c)}),!0},zk=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=ii(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(o=Y(t,r.schema)),a==="mark"&&(s=ne(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{let d=c.$from.pos,u=c.$to.pos,h,p,f,m;n.selection.empty?r.doc.nodesBetween(d,u,(g,y)=>{o&&o===g.type&&(l=!0,f=Math.max(y,d),m=Math.min(y+g.nodeSize,u),h=y,p=g)}):r.doc.nodesBetween(d,u,(g,y)=>{y<d&&o&&o===g.type&&(l=!0,f=Math.max(y,d),m=Math.min(y+g.nodeSize,u),h=y,p=g),y>=d&&y<=u&&(o&&o===g.type&&(l=!0,i&&n.setNodeMarkup(y,void 0,{...g.attrs,...e})),s&&g.marks.length&&g.marks.forEach(b=>{if(s===b.type&&(l=!0,i)){let w=Math.max(y,d),k=Math.min(y+g.nodeSize,u);n.addMark(w,k,s.create({...b.attrs,...e}))}}))}),p&&(h!==void 0&&i&&n.setNodeMarkup(h,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(g=>{s===g.type&&i&&n.addMark(f,m,s.create({...g.attrs,...e}))}))}),l},pn=new J("__tiptap_decorations__"),$k=t=>({tr:e,dispatch:n})=>(n&&e.setMeta(pn,{type:"force",name:t}),!0),Lk=(t,e={})=>({state:n,dispatch:r})=>o0(Y(t,n.schema),e)(n,r),Ik=(t,e={})=>({state:n,dispatch:r})=>a0(Y(t,n.schema),e)(n,r),fn=new WeakMap;function Fk(t,e){fn.set(t,(fn.get(t)??0)+1);try{return e()}finally{let n=(fn.get(t)??1)-1;n>0?fn.set(t,n):fn.delete(t)}}function Bk(t){return fn.has(t)}var Pk=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){let n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){let n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){let n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Ou=typeof process<"u"&&!1;function jk(t){return t.kind==="widget"}function Nu(t,e){let n=[],r=new Set;for(let i of t)i.kind==="widget"&&jk(i)&&r.add(i.key),n.push(i.toPMDecoration(e));return{decorations:n,widgetKeys:r}}function Hk(t,e,n){let{decorations:r,widgetKeys:i}=Nu(e,n);return{set:q.create(t,r),widgetKeys:i}}function Ru({position:t,from:e,to:n,docSize:r}){return t<e?!1:t<n||t===n&&n===r}function qk({decorations:t,from:e,to:n,docSize:r,extensionName:i,warnedExtensions:o}){return t.filter(s=>Ru({position:s.anchor,from:e,to:n,docSize:r})?!0:(s.anchor===n||o.has(i)||(o.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${e}, ${n}). It was ignored.`)),!1))}function _u(t){let e=t.spec?.key;return typeof e=="string"?e:void 0}function Vk(t){let e=new Map,n=new Map;for(let r of t.find()){let i=_u(r);if(!i)continue;let o=r.spec.extensionName??"unknown",s=e.get(i)??new Set;s.add(o),e.set(i,s),n.set(i,(n.get(i)??0)+1)}return Array.from(e,([r,i])=>({key:r,extensions:i})).filter(({key:r})=>(n.get(r)??0)>1)}function zu(t){return t.jsonID==="attr"}function Wk(t){let e=!1;if(t.getMap().forEach(()=>{e=!0}),e||zu(t))return!0;let n=t;return typeof n.from=="number"&&typeof n.to=="number"}function Uk(t,e){let n=null,r=0,i=0;for(let o=0;o<t.childCount&&!(i>e.to);o+=1){let s=i+t.child(o).nodeSize;s>=e.from&&(n===null&&(n=i),r=s),i=s}return n===null?null:{from:n,to:r}}function Kk(t,e){if(t.steps.some(o=>!Wk(o)))return{type:"full"};let n=si(t).map(({newRange:o})=>o);t.steps.forEach((o,s)=>{if(!zu(o))return;let a=t.mapping.slice(s);n.push({from:a.map(o.pos,-1),to:a.map(o.pos+1)})});let r=[];for(let o of n){let s=Uk(e,o);s&&r.push(s)}r.sort((o,s)=>o.from-s.from);let i=[];for(let o of r){let s=i[i.length-1];s&&o.from<=s.to?s.to=Math.max(s.to,o.to):i.push({...o})}return{type:"ranges",ranges:i}}function $u(t,e,n,r){return t.map(e,n,{onRemove:i=>{let o=i?.key;typeof o=="string"&&r.delete(o)}})}function Jk(t,e,n){let r=e.decorationSetsByExtension[t]??q.empty,i=new Set(e.widgetKeysByExtension[t]??[]);return{set:$u(r,n.mapping,n.doc,i),widgetKeys:i}}function Lu(t,e){let n=Object.values(e).flatMap(r=>r.find());return q.create(t,n)}function Iu(t){let e=new Set;for(let n of Object.values(t))for(let r of n)e.add(r);return e}function Gk(t,e){switch(e.update??"document"){case"document":if(e.createInRange)throw Error(`[tiptap error]: Extension "${t}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw Error(`[tiptap error]: Extension "${t}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw Error(`[tiptap error]: Extension "${t}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw Error(`[tiptap error]: Extension "${t}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${t}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function Zk(t,e,n){return n?!0:t.update==="manual"?!1:t.shouldUpdate?t.shouldUpdate(e):e.tr.docChanged}var Xk=new Set,Qk=class{constructor(t){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let n=pn.getState(e);n&&this.warnDuplicateWidgetKeys(n)},this.editor=t.editor,this.entries=this.resolveEntries(t.entries),this.entries.forEach(({name:e,spec:n})=>Gk(e,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){return pn.getState(this.editor.state)?.widgetKeys??Xk}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(t){let e=[];for(let{name:n,addDecorations:r}of t){let i=r();i&&e.push({name:n,spec:i})}return e}createPlugin(){let{editor:t,entries:e}=this;return new j({key:pn,state:{init:(n,r)=>{let i={},o={};for(let{name:a,spec:l}of e){let{set:c,widgetKeys:d}=this.buildFullSet(a,l,r);i[a]=c,o[a]=d}let s={decorationSetsByExtension:i,widgetKeysByExtension:o,mergedDecorationSet:this.buildMergedSet(r.doc,i),widgetKeys:Iu(o)};return this.warnDuplicateWidgetKeys(s),s},apply:(n,r,i,o)=>{let s=n.getMeta(pn),a=s?.type==="force"&&!s.name,l=s?.type==="force"?s.name:void 0,c={},d={},u=new Set;return Fk(t,()=>{for(let{name:h,spec:p}of e){let f=a||l===h;if(Zk(p,{editor:t,tr:n,oldState:i,newState:o},f))if(p.update==="changedRanges"&&n.docChanged&&!f){let m=this.applyChangedRangesRecompute(h,p,r,n,o);c[h]=m.set,d[h]=m.widgetKeys,u.add(h)}else{let{set:m,widgetKeys:g}=this.buildFullSet(h,p,o);c[h]=m,d[h]=g,u.add(h)}else{let m=Jk(h,r,n);c[h]=m.set,d[h]=m.widgetKeys}}}),u.size===0&&!n.docChanged?r:{decorationSetsByExtension:c,widgetKeysByExtension:d,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:n,decorationSetsByExtension:c,recomputedNames:u}),widgetKeys:Iu(d)}}},props:{decorations(n){return pn.getState(n)?.mergedDecorationSet??q.empty}}})}applyChangedRangesRecompute(t,e,n,r,i){let o=Kk(r,i.doc);return o.type==="full"?this.buildFullSet(t,e,i):this.rebuildRanges(t,e,n,r,i,o.ranges)}rebuildRanges(t,e,n,r,i,o){let s=n.decorationSetsByExtension[t]??q.empty,a=new Set(n.widgetKeysByExtension[t]??[]),l=$u(s,r.mapping,r.doc,a),c=i.doc.content.size;for(let{from:d,to:u}of o){let h=l.find(d,u).filter(m=>Ru({position:m.from,from:d,to:u,docSize:c}));for(let m of h){let g=_u(m);g&&a.delete(g)}l=l.remove(h);let{decorations:p,widgetKeys:f}=Nu(qk({decorations:this.runCreate(t,"createInRange",()=>e.createInRange({editor:this.editor,state:i,view:this.mountedView,from:d,to:u})),from:d,to:u,docSize:c,extensionName:t,warnedExtensions:this.warnedOutOfRangeExtensions}),t);l=l.add(i.doc,p);for(let m of f)a.add(m)}return{set:l,widgetKeys:a}}buildFullSet(t,e,n){let r=this.runCreate(t,"create",()=>e.create({editor:this.editor,state:n,view:this.mountedView}));return Hk(n.doc,r,t)}runCreate(t,e,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension "${t}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(t){if(!Ou)return;if(t.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let e=Vk(t.mergedDecorationSet),n=new Set(e.map(({key:r})=>r));for(let{key:r,extensions:i}of e){if(this.warnedWidgetKeys.has(r))continue;let o=Array.from(i).map(s=>`"${s}"`).join(", ");console.warn(`[tiptap warn]: Duplicate widget decoration key "${r}" in extension${i.size===1?"":"s"} ${o}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(t,e){let n=Object.keys(e);return n.length===1?e[n[0]]:Lu(t,e)}mergeAfterApply({entries:t,previous:e,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return t.length===1?r[t[0].name]:i.size===0?e.mergedDecorationSet.map(n.mapping,n.doc):Lu(n.doc,r)}};function Yk(t,e){let{selection:n}=t,{$from:r}=n;if(n instanceof N){let o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let i=r.depth;for(;i>=0;){let o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(e))return!0;--i}return!1}function tb(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}function eb(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function nb(t){return typeof t=="number"}function rb(t){return Object.prototype.toString.call(t).slice(8,-1)}function li(t){return rb(t)==="Object"&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}ws({},{createAtomBlockMarkdownSpec:()=>ib,createBlockMarkdownSpec:()=>ob,createInlineMarkdownSpec:()=>lb,parseAttributes:()=>Ns,parseIndentedBlocks:()=>_s,renderNestedMarkdownContent:()=>zs,serializeAttributes:()=>Rs});function Ns(t){if(!t?.trim())return{};let e={},n=[],r=t.replace(/["']([^"']*)["']/g,a=>(n.push(a),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);i&&(e.class=i.map(a=>a.trim().slice(1)).join(" "));let o=r.match(/(?:^|\s)#([\w-]+)/);o&&(e.id=o[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,a,l])=>{let c=parseInt(l.match(/__QUOTED_(\d+)__/)?.[1]||"0",10),d=n[c];d&&(e[a]=d.slice(1,-1))});let s=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(a=>{a.match(/^[a-zA-Z][\w-]*$/)&&(e[a]=!0)}),e}function Rs(t){if(!t||Object.keys(t).length===0)return"";let e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function ib(t){let{nodeName:e,name:n,parseAttributes:r=Ns,serializeAttributes:i=Rs,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=t,l=n||e,c=d=>{if(!a)return d;let u={};return a.forEach(h=>{h in d&&(u[h]=d[h])}),u};return{parseMarkdown:(d,u)=>{let h={...o,...d.attributes};return u.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(d){let u=RegExp(`^:::${l}(?:\\s|$)`,"m"),h=d.match(u)?.index;return h===void 0?-1:h},tokenize(d,u,h){let p=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),f=d.match(p);if(!f)return;let m=f[1]||"",g=r(m);if(!s.find(y=>!(y in g)))return{type:e,raw:f[0],attributes:g}}},renderMarkdown:d=>{let u=c(d.attrs||{}),h=i(u),p=h?` {${h}}`:"";return`:::${l}${p} :::`}}}function ob(t){let{nodeName:e,name:n,getContent:r,parseAttributes:i=Ns,serializeAttributes:o=Rs,defaultAttributes:s={},content:a="block",allowedAttributes:l}=t,c=n||e,d=u=>{if(!l)return u;let h={};return l.forEach(p=>{p in u&&(h[p]=u[p])}),h};return{parseMarkdown:(u,h)=>{let p;if(r){let m=r(u);p=typeof m=="string"?[{type:"text",text:m}]:m}else p=a==="block"?h.parseChildren(u.tokens||[]):h.parseInline(u.tokens||[]);let f={...s,...u.attributes};return h.createNode(e,f,p)},markdownTokenizer:{name:e,level:"block",start(u){let h=RegExp(`^:::${c}`,"m"),p=u.match(h)?.index;return p===void 0?-1:p},tokenize(u,h,p){let f=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),m=u.match(f);if(!m)return;let[g,y=""]=m,b=i(y),w=1,k=g.length,v="",E=/^:::([\w-]*)(\s.*)?/gm,S=u.slice(k);for(E.lastIndex=0;;){let A=E.exec(S);if(A===null)break;let _=A.index,z=A[1];if(!A[2]?.endsWith(":::")){if(z)w+=1;else if(--w,w===0){let nt=S.slice(0,_);v=nt.trim();let lt=u.slice(0,k+_+A[0].length),P=[];if(v)if(a==="block")for(P=p.blockTokens(nt),P.forEach(H=>{H.text&&(!H.tokens||H.tokens.length===0)&&(H.tokens=p.inlineTokens(H.text))});P.length>0;){let H=P[P.length-1];if(H.type==="paragraph"&&(!H.text||H.text.trim()===""))P.pop();else break}else P=p.inlineTokens(v);return{type:e,raw:lt,attributes:b,content:v,tokens:P}}}}}},renderMarkdown:(u,h)=>{let p=d(u.attrs||{}),f=o(p),m=f?` {${f}}`:"",g=h.renderChildren(u.content||[],`
13
+
14
+ `);return`:::${c}${m}
15
+
16
+ ${g}
17
+
18
+ :::`}}}function sb(t){if(!t.trim())return{};let e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(t);for(;r!==null;){let[,i,o,s]=r;e[i]=o||s,r=n.exec(t)}return e}function ab(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function lb(t){let{nodeName:e,name:n,getContent:r,parseAttributes:i=sb,serializeAttributes:o=ab,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=t,c=n||e,d=h=>{if(!l)return h;let p={};return l.forEach(f=>{let m=typeof f=="string"?f:f.name,g=typeof f=="string"?void 0:f.skipIfDefault;if(m in h){let y=h[m];if(g!==void 0&&y===g)return;p[m]=y}}),p},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,p)=>{let f={...s,...h.attributes};if(a)return p.createNode(e,f);let m=r?r(h):h.content||"";return m?p.createNode(e,f,[p.createTextNode(m)]):p.createNode(e,f,[])},markdownTokenizer:{name:e,level:"inline",start(h){let p=RegExp(a?`\\[${u}\\s*[^\\]]*\\]`:`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),f=h.match(p)?.index;return f===void 0?-1:f},tokenize(h,p,f){let m=RegExp(a?`^\\[${u}\\s*([^\\]]*)\\]`:`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=h.match(m);if(!g)return;let y="",b="";if(a){let[,k]=g;b=k}else{let[,k,v]=g;b=k,y=v||""}let w=i(b.trim());return{type:e,raw:g[0],content:y.trim(),attributes:w}}},renderMarkdown:h=>{let p="";r?p=r(h):h.content&&h.content.length>0&&(p=h.content.filter(y=>y.type==="text").map(y=>y.text).join(""));let f=d(h.attrs||{}),m=o(f),g=m?` ${m}`:"";return a?`[${c}${g}]`:`[${c}${g}]${p}[/${c}]`}}}function _s(t,e,n){let r=t.split(`
19
+ `),i=[],o="",s=0,a=e.baseIndentSize||2;for(;s<r.length;){let l=r[s],c=l.match(e.itemPattern);if(!c){if(i.length>0)break;if(l.trim()===""){s+=1,o=`${o}${l}
20
+ `;continue}else return}let d=e.extractItemData(c),{indentLevel:u,mainContent:h}=d;o=`${o}${l}
21
+ `;let p=[h];for(s+=1;s<r.length;){let y=r[s];if(y.trim()===""){let b=r.slice(s+1).findIndex(w=>w.trim()!=="");if(b===-1)break;if((r[s+1+b].match(/^(\s*)/)?.[1]?.length||0)>u){p.push(y),o=`${o}${y}
22
+ `,s+=1;continue}else break}if((y.match(/^(\s*)/)?.[1]?.length||0)>u)p.push(y),o=`${o}${y}
23
+ `,s+=1;else break}let f,m=p.slice(1);if(m.length>0){let y=m.map(b=>b.slice(u+a)).join(`
24
+ `);y.trim()&&(f=e.customNestedParser?e.customNestedParser(y):n.blockTokens(y))}let g=e.createToken(d,f);i.push(g)}if(i.length!==0)return{items:i,raw:o}}function zs(t,e,n,r){if(!t||!Array.isArray(t.content))return"";let i=typeof n=="function"?n(r):n,[o,...s]=t.content,a=`${i}${e.renderChildren([o])}`;return s&&s.length>0&&s.forEach((l,c)=>{let d=e.renderChild?.call(e,l,c+1)??e.renderChildren([l]);if(d!=null){let u=d.split(`
25
+ `).map(h=>h?e.indent(h):e.indent("")).join(`
26
+ `);a+=l.type==="paragraph"?`
27
+
28
+ ${u}`:`
29
+ ${u}`}}),a}function Fu(t,e){let n={...t};return li(t)&&li(e)&&Object.keys(e).forEach(r=>{li(e[r])&&li(t[r])?n[r]=Fu(t[r],e[r]):n[r]=e[r]}),n}function cb(t,e,n={}){let{state:r}=e,{doc:i,tr:o}=r,s=t;i.descendants((a,l)=>{let c=o.mapping.map(l),d=o.mapping.map(l)+a.nodeSize,u=null;if(a.marks.forEach(p=>{if(p!==s)return!1;u=p}),!u)return;let h=!1;if(Object.keys(n).forEach(p=>{n[p]!==u.attrs[p]&&(h=!0)}),h){let p=t.type.create({...t.attrs,...n});o.removeMark(c,d,t.type),o.addMark(c,d,p)}}),o.docChanged&&e.view.dispatch(o)}var Qn=class{constructor(t){this.find=t.find,this.handler=t.handler,this.undoable=t.undoable??!0}},db=(t,e)=>{if(vs(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function ci(t){let{editor:e,from:n,to:r,text:i,rules:o,plugin:s}=t,{view:a}=e;if(a.composing)return!1;let l=a.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(u=>u.type.spec.code))return!1;let c=!1,d=ck(l)+i;return o.forEach(u=>{if(c)return;let h=db(d,u.find);if(!h)return;let p=h[0].length-i.length;if(p>0){let k=l.parentOffset-p;if(k<0||l.parent.textBetween(k,l.parentOffset)!==h[0].slice(0,p))return}let f=a.state.tr,m=Yr({state:a.state,transaction:f}),g={from:n-(h[0].length-i.length),to:r},{commands:y,chain:b,can:w}=new ti({editor:e,state:m});u.handler({state:m,range:g,match:h,commands:y,chain:b,can:w})===null||!f.steps.length||(u.undoable&&f.setMeta(s,{transform:f,from:n,to:r,text:i}),a.dispatch(f),c=!0)}),c}function ub(t){let{editor:e,rules:n}=t,r=new j({state:{init(){return null},apply(i,o,s){let a=i.getMeta(r);if(a)return a;let l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:c}=l;c=typeof c=="string"?c:Gn(x.from(c),s.schema);let{from:d}=l,u=d+c.length;ci({editor:e,from:d,to:u,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return ci({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&ci({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?ci({editor:e,from:s.pos,to:s.pos,text:`
30
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var $s=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...F(D(this,"addOptions",{name:this.name}))}}get storage(){return{...F(D(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>Fu(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},At=class im extends $s{constructor(){super(...arguments),this.type="mark"}static create(e={}){let n=typeof e=="function"?e():e;return new im(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let o=i.marks();if(!o.find(a=>a?.type.name===n.name))return!1;let s=o.find(a=>a?.type.name===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}},Bu=class{constructor(t){this.find=t.find,this.handler=t.handler}},hb=(t,e,n)=>{if(vs(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function pb(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:d}=new ti({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,i,(h,p)=>{if(h.type?.spec?.code||!(h.isText||h.isTextblock||h.isInline))return;let f=h.content?.size??h.nodeSize??0,m=Math.max(r,p),g=Math.min(i,p+f);m>=g||hb(h.isText?h.text||"":h.textBetween(m-p,g-p,void 0,"\uFFFC"),o.find,s).forEach(y=>{if(y.index===void 0)return;let b=m+y.index+1,w=b+y[0].length,k={from:n.tr.mapping.map(b),to:n.tr.mapping.map(w)},v=o.handler({state:n,range:k,match:y,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(v)})}),u.every(h=>h!==null)}var Ls=null,fb=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function mb(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}let l=({state:c,from:d,to:u,rule:h,pasteEvt:p})=>{let f=c.tr,m=Yr({state:c,transaction:f});if(!(!pb({editor:e,state:m,from:Math.max(d-1,0),to:u.b-1,rule:h,pasteEvent:p,dropEvent:a})||!f.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,f}};return n.map(c=>new j({view(d){let u=p=>{r=d.dom.parentElement?.contains(p.target)?d.dom.parentElement:null,r&&(Ls=e)},h=()=>{Ls&&=null};return window.addEventListener("dragstart",u),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",u),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,u)=>{if(o=r===d.dom.parentElement,a=u,!o){let h=Ls;h?.isEditable&&setTimeout(()=>{let p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,u)=>{let h=u.clipboardData?.getData("text/html");return s=u,i=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(d,u,h)=>{let p=d[0],f=p.getMeta("uiEvent")==="paste"&&!i,m=p.getMeta("uiEvent")==="drop"&&!o,g=p.getMeta("applyPasteRules"),y=!!g;if(!f&&!m&&!y)return;if(y){let{text:k}=g;k=typeof k=="string"?k:Gn(x.from(k),h.schema);let{from:v}=g,E=v+k.length,S=fb(k);return l({rule:c,state:h,from:v,to:{b:E},pasteEvt:S})}let b=u.doc.content.findDiffStart(h.doc.content),w=u.doc.content.findDiffEnd(h.doc.content);if(!(!nb(b)||!w||b===w.b))return l({rule:c,state:h,from:b,to:w,pasteEvt:s})}}))}var di=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=wu(t),this.schema=ek(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{let n=D(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:hn(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){let{editor:t}=this,e=Zn([...this.extensions].reverse()).flatMap(r=>{let i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:hn(r.name,this.schema)},o=[],s=D(r,"addKeyboardShortcuts",i),a={};if(r.type==="mark"&&D(r,"exitable",i)&&(a.ArrowRight=()=>At.handleExit({editor:t,mark:r})),s){let h=Object.fromEntries(Object.entries(s()).map(([p,f])=>[p,()=>f({editor:t})]));a={...a,...h}}let l=iy(a);o.push(l);let c=D(r,"addInputRules",i);if(Su(r,t.options.enableInputRules)&&c){let h=c();if(h&&h.length){let p=ub({editor:t,rules:h}),f=Array.isArray(p)?p:[p];o.push(...f)}}let d=D(r,"addPasteRules",i);if(Su(r,t.options.enablePasteRules)&&d){let h=d();if(h&&h.length){let p=mb({editor:t,rules:h});o.push(...p)}}let u=D(r,"addProseMirrorPlugins",i);if(u){let h=u();o.push(...h)}return o}),n=this.createDecorationPlugin();return n&&e.push(n),e}createDecorationPlugin(){var t;let{editor:e}=this;(t=this.decorationManager)==null||t.destroy();let n=[];return this.extensions.forEach(r=>{let i=D(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:hn(r.name,this.schema)});i&&n.push({name:r.name,addDecorations:i})}),this.decorationManager=new Qk({editor:e,entries:n}),this.decorationManager.plugin}get attributes(){return mu(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:e}=dn(this.extensions);return Object.fromEntries(e.filter(n=>!!D(n,"addNodeView")).map(n=>{let r=this.attributes.filter(s=>s.type===n.name),i=D(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Y(n.name,this.schema)});if(!i)return[];let o=i();return o?[n.name,(s,a,l,c,d)=>{let u=un(s,r);return o({node:s,view:a,getPos:l,decorations:c,innerDecorations:d,editor:t,extension:n,HTMLAttributes:u})}]:[]}))}dispatchTransaction(t){let{editor:e}=this;return Zn([...this.extensions].reverse()).reduceRight((n,r)=>{let i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:hn(r.name,this.schema)},o=D(r,"dispatchTransaction",i);return o?s=>{o.call(i,{transaction:s,next:n})}:n},t)}transformPastedHTML(t){let{editor:e}=this;return Zn([...this.extensions]).reduce((n,r)=>{let i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:hn(r.name,this.schema)},o=D(r,"transformPastedHTML",i);return o?(s,a)=>{let l=n(s,a);return o.call(i,l)}:n},t||(n=>n))}get markViews(){let{editor:t}=this,{markExtensions:e}=dn(this.extensions);return Object.fromEntries(e.filter(n=>!!D(n,"addMarkView")).map(n=>{let r=this.attributes.filter(o=>o.type===n.name),i=D(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ne(n.name,this.schema)});return i?[n.name,(o,s,a)=>{let l=un(o,r);return i()({mark:o,view:s,inline:a,editor:t,extension:n,HTMLAttributes:l,updateAttributes:c=>{cb(o,t,c)}})}]:[]}))}destroy(){var t;(t=this.decorationManager)==null||t.destroy(),this.extensions.forEach(e=>{let n=e;for(;n.parent;){let r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:hn(e.name,this.schema)};e.type==="mark"&&((F(D(e,"keepOnSplit",n))??!0)&&this.splittableMarks.push(e.name),(F(D(e,"clearable",n))??!0)||this.nonClearableMarks.push(e.name));let r=D(e,"onBeforeCreate",n),i=D(e,"onCreate",n),o=D(e,"onUpdate",n),s=D(e,"onSelectionUpdate",n),a=D(e,"onTransaction",n),l=D(e,"onFocus",n),c=D(e,"onBlur",n),d=D(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};di.resolve=wu,di.sort=Zn,di.flatten=Es;var Pu={};ws(Pu,{ClipboardTextSerializer:()=>ju,Commands:()=>Hu,Delete:()=>qu,Drop:()=>Vu,Editable:()=>Wu,FocusEvents:()=>Ku,Keymap:()=>Ju,Paste:()=>Gu,Tabindex:()=>Zu,TextDirection:()=>Xu,focusEventsPluginKey:()=>Uu});var V=class om extends $s{constructor(){super(...arguments),this.type="extension"}static create(e={}){let n=typeof e=="function"?e():e;return new om(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}},ju=V.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new j({key:new J("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,o=xu(n),{blockSeparator:s}=this.options,a={...s===void 0?{}:{blockSeparator:s},textSerializers:o};return[...i.ranges].sort((l,c)=>l.$from.pos-c.$from.pos).map(({$from:l,$to:c})=>vu(r,{from:l.pos,to:c.pos},a)).join(s??`
31
+
32
+ `)}}})]}}),Hu=V.create({name:"commands",addCommands(){return{...Yd}}}),qu=V.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){let n=()=>{var r;if((r=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction?.call(r,t)??t.getMeta("y-sync$"))return;let i=pu(t.before,[t,...e]);si(i).forEach(s=>{i.mapping.mapResult(s.oldRange.from).deletedAfter&&i.mapping.mapResult(s.oldRange.to).deletedBefore&&i.before.nodesBetween(s.oldRange.from,s.oldRange.to,(a,l)=>{let c=l+a.nodeSize-2,d=s.oldRange.from<=l&&c<=s.oldRange.to;this.editor.emit("delete",{type:"node",node:a,from:l,to:c,newFrom:i.mapping.map(l),newTo:i.mapping.map(c),deletedRange:s.oldRange,newRange:s.newRange,partial:!d,editor:this.editor,transaction:t,combinedTransform:i})})});let o=i.mapping;i.steps.forEach((s,a)=>{if(s instanceof Xe){let l=o.slice(a).map(s.from,-1),c=o.slice(a).map(s.to),d=o.invert().map(l,-1),u=o.invert().map(c),h=l>0&&i.doc.nodeAt(l-1)?.marks.some(f=>f.eq(s.mark)),p=i.doc.nodeAt(c)?.marks.some(f=>f.eq(s.mark));this.editor.emit("delete",{type:"mark",mark:s.mark,from:s.from,to:s.to,deletedRange:{from:d,to:u},newRange:{from:l,to:c},partial:!!(p||h),editor:this.editor,transaction:t,combinedTransform:i})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),Vu=V.create({name:"drop",addProseMirrorPlugins(){return[new j({key:new J("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Wu=V.create({name:"editable",addProseMirrorPlugins(){return[new j({key:new J("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Uu=new J("focusEvents"),Ku=V.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new j({key:Uu,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ju=V.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:s})=>{let{selection:a,doc:l}=s,{empty:c,$anchor:d}=a,{pos:u,parent:h}=d,p=d.parent.isTextblock&&u>0?s.doc.resolve(u-1):d,f=p.parent.type.spec.isolating,m=d.pos-d.parentOffset,g=f&&p.parent.childCount===1?m===d.pos:R.atStart(l).from===u;return!c||!h.type.isTextblock||h.textContent.length||!g||g&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ni()||du()?i:r},addProseMirrorPlugins(){return[new j({key:new J("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta("composition")))return;let r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),i=t.some(p=>p.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:a}=e.selection,l=R.atStart(e.doc).from,c=R.atEnd(e.doc).to;if(o||!(s===l&&a===c)||!Xn(n.doc))return;let d=n.tr,u=Yr({state:n,transaction:d}),{commands:h}=new ti({editor:this.editor,state:u});if(h.clearNodes(),d.steps.length)return d}})]}}),Gu=V.create({name:"paste",addProseMirrorPlugins(){return[new j({key:new J("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Zu=V.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new j({key:new J("tabindex"),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??"0"}}})]}}),Xu=V.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:t}=dn(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new j({key:new J("textDirection"),props:{attributes:()=>{let t=this.options.direction;return t?{dir:t}:{}}}})]}}),Qu=!1;function gb(t){if(Qu)return;Qu=!0;let e;try{e=Mt.fromJSON(t,{from:0,to:0}).slice.content}catch{return}e instanceof x||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var yb=class Nr{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Nr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Nr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Nr(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+ +!o;if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(a);if(!i&&!s&&l.depth<=this.depth)return;let c=new Nr(l,this.editor,i,i||s?n:null);i&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){let l=s[a];if(o[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;let o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(a=>n[a]===s.node.attrs[a])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},kb=`.ProseMirror {
33
+ position: relative;
34
+ }
35
+
36
+ .ProseMirror {
37
+ word-wrap: break-word;
38
+ white-space: pre-wrap;
39
+ white-space: break-spaces;
40
+ -webkit-font-variant-ligatures: none;
41
+ font-variant-ligatures: none;
42
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
43
+ }
44
+
45
+ .ProseMirror [contenteditable="false"] {
46
+ white-space: normal;
47
+ }
48
+
49
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
50
+ white-space: pre-wrap;
51
+ }
52
+
53
+ .ProseMirror pre {
54
+ white-space: pre-wrap;
55
+ }
56
+
57
+ img.ProseMirror-separator {
58
+ display: inline !important;
59
+ border: none !important;
60
+ margin: 0 !important;
61
+ width: 0 !important;
62
+ height: 0 !important;
63
+ }
64
+
65
+ .ProseMirror-gapcursor {
66
+ display: none;
67
+ pointer-events: none;
68
+ position: absolute;
69
+ margin: 0;
70
+ }
71
+
72
+ .ProseMirror-gapcursor:after {
73
+ content: "";
74
+ display: block;
75
+ position: absolute;
76
+ top: -2px;
77
+ width: 20px;
78
+ border-top: 1px solid black;
79
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
80
+ }
81
+
82
+ @keyframes ProseMirror-cursor-blink {
83
+ to {
84
+ visibility: hidden;
85
+ }
86
+ }
87
+
88
+ .ProseMirror-hideselection *::selection {
89
+ background: transparent;
90
+ }
91
+
92
+ .ProseMirror-hideselection *::-moz-selection {
93
+ background: transparent;
94
+ }
95
+
96
+ .ProseMirror-hideselection * {
97
+ caret-color: transparent;
98
+ }
99
+
100
+ .ProseMirror-focused .ProseMirror-gapcursor {
101
+ display: block;
102
+ }`,bb=class extends Pk{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:pk,createMappablePosition:fk},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);let e=this.createDoc();if(!this.editorState){let n=Cs(e,this.options.autofocus);this.editorState=fc.create({doc:e,schema:this.schema,selection:n||void 0})}gb(this.schema),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=tb(kb,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return Ou&&!this.hasWarnedStaleDecorationRead&&Bk(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){let n=fu(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;let e=this.state.plugins,n=e;if([].concat(t).forEach(i=>{let o=typeof i=="string"?`${i}$`:i.key;n=n.filter(s=>!s.key.startsWith(o))}),e.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let t=[...this.options.enableCoreExtensions?[Wu,ju.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),Hu,Ku,Ju,Zu.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),Vu,Gu,qu,Xu.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!="object"||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(e?.type));this.extensionManager=new di(t,this)}createCommandManager(){this.commandManager=new ti({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Ss(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;let n=Ss(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=fc.create({doc:n,schema:this.schema,selection:Cs(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}createView(t){let{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=e.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new Kd(t,{...e,attributes:{role:"textbox",...e?.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();let l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>this.capturedTransaction?.step(c));return}let{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});let s=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=s?.getMeta("focus"),l=s?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||o.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Cu(this.state,t)}isActive(t,e){let n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return dk(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Gn(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:e=`
103
+
104
+ `,textSerializers:n={}}=t||{};return rk(this.state.doc,{blockSeparator:e,textSerializers:{...xu(this.schema),...n}})}get isEmpty(){return Xn(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(t,e){return this.$doc?.querySelector(t,e)||null}$nodes(t,e){return this.$doc?.querySelectorAll(t,e)||null}$pos(t){let e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new yb(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Pe(t){return new Qn({find:t.find,handler:({state:e,range:n,match:r})=>{let i=F(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],a=r[0];if(s){let l=a.search(/\S/),c=n.from+a.indexOf(s),d=c+s.length;if(Ms(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(p=>p===t.type&&p!==h.mark.type)).filter(h=>h.to>c).length)return null;d<n.to&&o.delete(d,n.to),c>n.from&&o.delete(n.from+l,c);let u=n.from+l+s.length;o.addMark(n.from+l,u,t.type.create(i||{})),o.removeStoredMark(t.type)}},undoable:t.undoable})}function Yu(t){return new Qn({find:t.find,handler:({state:e,range:n,match:r})=>{let i=F(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,a=n.to,l=t.type.create(i);if(r[1]){let c=s+r[0].lastIndexOf(r[1]);c>a?c=a:a=c+r[1].length;let d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(c,a,l)}else if(r[0]){let c=t.type.isInline?s:s-1;o.insert(c,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()},undoable:t.undoable})}function Is(t){return new Qn({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=F(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)},undoable:t.undoable})}function mn(t){return new Qn({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=F(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&Lo(a,t.type,o);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){let{selection:d,storedMarks:u}=e,{splittableMarks:h}=t.editor.extensionManager,p=u||d.$to.parentOffset&&d.$from.marks();if(p){let f=p.filter(m=>h.includes(m.type.name));s.ensureMarks(f)}}if(t.keepAttributes){let d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}let c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&ce(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)},undoable:t.undoable})}var wb=t=>"touches"in t,vb=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let n=e.clientX-this.startX,r=e.clientY-this.startY;this.handleResize(n,r)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let n=e.touches[0];if(!n)return;let r=n.clientX-this.startX,i=n.clientY-this.startY;this.handleResize(r,i)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,n=this.element.offsetHeight;this.onCommit(e,n),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=e=>{e.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key==="Shift"&&(this.isShiftKeyPressed=!1)},this.node=t.node,this.editor=t.editor,this.element=t.element,this.element.draggable=!1,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,t.options?.min&&(this.minSize={...this.minSize,...t.options.min}),t.options?.max&&(this.maxSize=t.options.max),t?.options?.directions&&(this.directions=t.options.directions),t.options?.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),t.options?.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),t.options?.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type===this.node.type?(this.node=t,!this.onUpdate||this.onUpdate(t,e,n)):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){let t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){let e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){let n=e.includes("top"),r=e.includes("bottom"),i=e.includes("left"),o=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),i&&(t.style.left="0"),o&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;e=this.createCustomHandle?this.createCustomHandle(t):this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){let t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,wb(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,t,e),o=this.applyConstraints(r,i,n);this.element.style.width=`${o.width}px`,this.element.style.height=`${o.height}px`,this.onResize&&this.onResize(o.width,o.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,i=this.startHeight,o=t.includes("right"),s=t.includes("left"),a=t.includes("bottom"),l=t.includes("top");return o?r=this.startWidth+e:s&&(r=this.startWidth-e),a?i=this.startHeight+n:l&&(i=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(o?e:-e)),(t==="top"||t==="bottom")&&(i=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,t):{width:r,height:i}}applyConstraints(t,e,n){if(!n){let o=Math.max(this.minSize.width,t),s=Math.max(this.minSize.height,e);return this.maxSize?.width&&(o=Math.min(this.maxSize.width,o)),this.maxSize?.height&&(s=Math.min(this.maxSize.height,s)),{width:o,height:s}}let r=t,i=e;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(t,e,n){return n==="left"||n==="right"?{width:t,height:t/this.aspectRatio}:n==="top"||n==="bottom"?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}},I=class sm extends $s{constructor(){super(...arguments),this.type="node"}static create(e={}){let n=typeof e=="function"?e():e;return new sm(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}};function ge(t){return new Bu({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=F(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,a=r[r.length-1],l=r[0],c=n.to;if(a){let d=l.search(/\S/),u=n.from+l.indexOf(a),h=u+a.length;if(Ms(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(f=>f===t.type&&f!==p.mark.type)).filter(p=>p.to>u).length)return null;h<n.to&&s.delete(h,n.to),u>n.from&&s.delete(n.from+d,u),c=n.from+d+a.length,s.addMark(n.from+d,c,t.type.create(o||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||s.removeStoredMark(t.type)}}})}var{getOwnPropertyNames:xb,getOwnPropertySymbols:Cb}=Object,{hasOwnProperty:Sb}=Object.prototype;function Fs(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function ui(t){return function(e,n,r){if(!e||!n||typeof e!="object"||typeof n!="object")return t(e,n,r);let{cache:i}=r,o=i.get(e),s=i.get(n);if(o&&s)return o===n&&s===e;i.set(e,n),i.set(n,e);let a=t(e,n,r);return i.delete(e),i.delete(n),a}}function Eb(t){return t?.[Symbol.toStringTag]}function th(t){return xb(t).concat(Cb(t))}var Mb=Object.hasOwn||((t,e)=>Sb.call(t,e));function je(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var Ab="__v",Db="__o",Tb="_owner",{getOwnPropertyDescriptor:eh,keys:nh}=Object;function Ob(t,e){return t.byteLength===e.byteLength&&hi(new Uint8Array(t),new Uint8Array(e))}function Nb(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Rb(t,e){return t.byteLength===e.byteLength&&hi(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function _b(t,e){return je(t.getTime(),e.getTime())}function zb(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function $b(t,e){return t===e}function rh(t,e,n){let r=t.size;if(r!==e.size)return!1;if(!r)return!0;let i=Array(r),o=t.entries(),s,a,l=0;for(;(s=o.next())&&!s.done;){let c=e.entries(),d=!1,u=0;for(;(a=c.next())&&!a.done;){if(i[u]){u++;continue}let h=s.value,p=a.value;if(n.equals(h[0],p[0],l,u,t,e,n)&&n.equals(h[1],p[1],h[0],p[0],t,e,n)){d=i[u]=!0;break}u++}if(!d)return!1;l++}return!0}var Lb=je;function Ib(t,e,n){let r=nh(t),i=r.length;if(nh(e).length!==i)return!1;for(;i-- >0;)if(!oh(t,e,n,r[i]))return!1;return!0}function Yn(t,e,n){let r=th(t),i=r.length;if(th(e).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!oh(t,e,n,o)||(s=eh(t,o),a=eh(e,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function Fb(t,e){return je(t.valueOf(),e.valueOf())}function Bb(t,e){return t.source===e.source&&t.flags===e.flags}function ih(t,e,n){let r=t.size;if(r!==e.size)return!1;if(!r)return!0;let i=Array(r),o=t.values(),s,a;for(;(s=o.next())&&!s.done;){let l=e.values(),c=!1,d=0;for(;(a=l.next())&&!a.done;){if(!i[d]&&n.equals(s.value,a.value,s.value,a.value,t,e,n)){c=i[d]=!0;break}d++}if(!c)return!1}return!0}function hi(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function Pb(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function oh(t,e,n,r){return(r===Tb||r===Db||r===Ab)&&(t.$$typeof||e.$$typeof)?!0:Mb(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var jb="[object ArrayBuffer]",Hb="[object Arguments]",qb="[object Boolean]",Vb="[object DataView]",Wb="[object Date]",Ub="[object Error]",Kb="[object Map]",Jb="[object Number]",Gb="[object Object]",Zb="[object RegExp]",Xb="[object Set]",Qb="[object String]",Yb={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},tw="[object URL]",ew=Object.prototype.toString;function nw({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(m==null||g==null)return!1;let b=typeof m;if(b!==typeof g)return!1;if(b!=="object")return b==="number"?a(m,g,y):b==="function"&&o(m,g,y);let w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return l(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return r(m,g,y);if(w===RegExp)return d(m,g,y);if(w===Map)return s(m,g,y);if(w===Set)return u(m,g,y);let k=ew.call(m);if(k===Wb)return r(m,g,y);if(k===Zb)return d(m,g,y);if(k===Kb)return s(m,g,y);if(k===Xb)return u(m,g,y);if(k===Gb)return typeof m.then!="function"&&typeof g.then!="function"&&l(m,g,y);if(k===tw)return p(m,g,y);if(k===Ub)return i(m,g,y);if(k===Hb)return l(m,g,y);if(Yb[k])return h(m,g,y);if(k===jb)return t(m,g,y);if(k===Vb)return n(m,g,y);if(k===qb||k===Jb||k===Qb)return c(m,g,y);if(f){let v=f[k];if(!v){let E=Eb(m);E&&(v=f[E])}if(v)return v(m,g,y)}return!1}}function rw({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:Ob,areArraysEqual:n?Yn:Nb,areDataViewsEqual:Rb,areDatesEqual:_b,areErrorsEqual:zb,areFunctionsEqual:$b,areMapsEqual:n?Fs(rh,Yn):rh,areNumbersEqual:Lb,areObjectsEqual:n?Yn:Ib,arePrimitiveWrappersEqual:Fb,areRegExpsEqual:Bb,areSetsEqual:n?Fs(ih,Yn):ih,areTypedArraysEqual:n?Fs(hi,Yn):hi,areUrlsEqual:Pb,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){let i=ui(r.areArraysEqual),o=ui(r.areMapsEqual),s=ui(r.areObjectsEqual),a=ui(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function iw(t){return function(e,n,r,i,o,s,a){return t(e,n,a)}}function ow({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(s,a){let{cache:l=t?new WeakMap:void 0,meta:c}=n();return e(s,a,{cache:l,equals:r,meta:c,strict:i})};if(t)return function(s,a){return e(s,a,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(s,a){return e(s,a,o)}}var sw=ye();ye({strict:!0}),ye({circular:!0}),ye({circular:!0,strict:!0}),ye({createInternalComparator:()=>je}),ye({strict:!0,createInternalComparator:()=>je}),ye({circular:!0,createInternalComparator:()=>je}),ye({circular:!0,createInternalComparator:()=>je,strict:!0});function ye(t={}){let{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,o=nw(rw(t));return ow({circular:e,comparator:o,createState:r,equals:n?n(o):iw(o),strict:i})}var aw=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},lw=({contentComponent:t})=>{let e=(0,cl.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot);return(0,T.jsx)(T.Fragment,{children:Object.values(e)})};function cw(){let t=new Set,e={},n=!1,r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(i=>i())}))};return{subscribe(i){return t.add(i),()=>{t.delete(i)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(i,o){e={...e,[i]:Gm.createPortal(o.reactElement,o.element,i)},r()},removeRenderer(i){let o={...e};delete o[i],e=o,r()}}}var dw=class extends L.Component{constructor(t){super(t),this.editorContentRef=L.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let t=this.props.editor;if(t&&!t.isDestroyed&&t.view.dom?.parentNode){if(t.contentComponent)return;let e=this.editorContentRef.current;e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e}),t.contentComponent=cw(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!t.view.dom?.parentNode)return;let e=document.createElement("div");e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e})}catch{}}}render(){let{editor:t,innerRef:e,...n}=this.props;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{ref:aw(e,this.editorContentRef),...n}),t?.contentComponent&&(0,T.jsx)(lw,{contentComponent:t.contentComponent})]})}},uw=(0,L.forwardRef)((t,e)=>{let n=L.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return L.createElement(dw,{key:n,innerRef:e,...t})}),sh=L.memo(uw),hw=typeof window<"u"?L.useLayoutEffect:L.useEffect,pw=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e,n=i=>{i?.transaction!==void 0&&i.transaction===e||(e=i?.transaction,this.transactionNumber+=1,this.subscribers.forEach(o=>o()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function ah(t){let[e]=(0,L.useState)(()=>new pw(t.editor)),n=(0,Zm.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn??sw);return hw(()=>e.watch(t.editor),[t.editor,e]),(0,L.useDebugValue)(n),n}var lh=typeof window>"u",fw=lh||!!(typeof window<"u"&&window.next),mw=class am{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){let e=this.options.current.immediatelyRender,n=e??!0;return(lh||fw&&e===void 0)&&(n=!1),n?this.createEditor():null}createEditor(){return new bb({...this.options.current,onBeforeCreate:(...e)=>{var n;return(n=this.options.current).onBeforeCreate?.call(n,...e)},onBlur:(...e)=>{var n;return(n=this.options.current).onBlur?.call(n,...e)},onCreate:(...e)=>{var n;return(n=this.options.current).onCreate?.call(n,...e)},onDestroy:(...e)=>{var n;return(n=this.options.current).onDestroy?.call(n,...e)},onFocus:(...e)=>{var n;return(n=this.options.current).onFocus?.call(n,...e)},onSelectionUpdate:(...e)=>{var n;return(n=this.options.current).onSelectionUpdate?.call(n,...e)},onTransaction:(...e)=>{var n;return(n=this.options.current).onTransaction?.call(n,...e)},onUpdate:(...e)=>{var n;return(n=this.options.current).onUpdate?.call(n,...e)},onContentError:(...e)=>{var n;return(n=this.options.current).onContentError?.call(n,...e)},onDrop:(...e)=>{var n;return(n=this.options.current).onDrop?.call(n,...e)},onPaste:(...e)=>{var n;return(n=this.options.current).onPaste?.call(n,...e)},onDelete:(...e)=>{var n;return(n=this.options.current).onDelete?.call(n,...e)},onMount:(...e)=>{var n;return(n=this.options.current).onMount?.call(n,...e)},onUnmount:(...e)=>{var n;return(n=this.options.current).onUnmount?.call(n,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length===n.extensions.length&&e.extensions.every((i,o)=>i===n.extensions?.[o]):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?am.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,r)=>n===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function gw(t={},e=[]){let n=(0,L.useRef)(t);n.current=t;let[r]=(0,L.useState)(()=>new mw(n)),i=(0,cl.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,L.useDebugValue)(i),(0,L.useEffect)(r.onRender(e)),ah({editor:i,selector:({transactionNumber:o})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&o===0?0:o+1}),i}var ch=(0,L.createContext)({editor:null});ch.Consumer;var yw=(0,L.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),kw=()=>(0,L.useContext)(yw);L.forwardRef((t,e)=>{let{onDragStart:n}=kw();return(0,T.jsx)(t.as||"div",{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})}),L.createContext({markViewContentRef:()=>{}});var Bs=(0,L.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});Bs.displayName="TiptapContext";var bw=()=>(0,L.useContext)(Bs);function dh({children:t,...e}){let n="editor"in e?e.editor:e.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let r=(0,L.useMemo)(()=>({editor:n}),[n]),i=(0,L.useMemo)(()=>({editor:n}),[n]);return(0,T.jsx)(ch.Provider,{value:i,children:(0,T.jsx)(Bs.Provider,{value:r,children:t})})}dh.displayName="Tiptap";function uh({...t}){let{editor:e}=bw();return(0,T.jsx)(sh,{editor:e,...t})}uh.displayName="Tiptap.Content",Object.assign(dh,{Content:uh});var pi=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);let{children:n,...r}=e??{};if(t==="svg")throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},ww=(t,e)=>{let{state:n}=t,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let o=i.depth-1;if(o<0)return!1;let s=i.node(o),a=i.index(o);if(a===0)return!1;if(s.type===e)return t.commands.lift(e.name);let l=s.child(a-1);if(l.type!==e||!l.lastChild?.isTextblock)return!1;let c=i.before()-1-1;return t.commands.command(({tr:d,dispatch:u})=>{if(!u)return!0;let h=i.parent.content,p=new M(h,0,0);return d.replace(c,i.after(),p),d.setSelection(O.create(d.doc,c+h.size)),d.scrollIntoView(),u(d),!0})},vw=/^\s*>\s$/,xw=I.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return pi("blockquote",{...W(this.options.HTMLAttributes,t),children:pi("slot",{})})},parseMarkdown:(t,e)=>{let n=e.parseBlockChildren??e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";let n=[];return t.content.forEach((r,i)=>{let o=(e.renderChild?.call(e,r,i)??e.renderChildren([r])).split(`
105
+ `).map(s=>s.trim()===""?">":`> ${s}`);n.push(o.join(`
106
+ `))}),n.join(`
107
+ >
108
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>ww(this.editor,this.type)}},addInputRules(){return[mn({find:vw,type:this.type})]}}),Cw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Sw=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Ew=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Mw=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Aw=At.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return pi("strong",{...W(this.options.HTMLAttributes,t),children:pi("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Pe({find:Cw,type:this.type}),Pe({find:Ew,type:this.type})]},addPasteRules(){return[ge({find:Sw,type:this.type}),ge({find:Mw,type:this.type})]}}),Dw=t=>{let e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Tw=t=>{let e=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},Ow=At.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",W(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Pe({find:Dw,type:this.type})]},addPasteRules(){return[ge({find:Tw,type:this.type})]}}),Ps=4,Nw=/^```([a-z]+)?[\s\n]$/,Rw=/^~~~([a-z]+)?[\s\n]$/,_w=I.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Ps,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{let{languageClassPrefix:e}=this.options;return e&&[...t.firstElementChild?.classList||[]].filter(n=>n.startsWith(e)).map(n=>n.replace(e,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",W(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>t.raw?.startsWith("```")===!1&&t.raw?.startsWith("~~~")===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[]),renderMarkdown:(t,e)=>{let n="",r=t.attrs?.language||"";return n=t.content?[`\`\`\`${r}`,e.renderChildren(t.content),"```"].join(`
109
+ `):`\`\`\`${r}
110
+
111
+ \`\`\``,n},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{if(!this.options.enableTabIndentation)return!1;let e=this.options.tabSize??Ps,{state:n}=t,{selection:r}=n,{$from:i,empty:o}=r;if(i.parent.type!==this.type)return!1;let s=" ".repeat(e);return o?t.commands.insertContent(s):t.commands.command(({tr:a})=>{let{from:l,to:c}=r,d=n.doc.textBetween(l,c,`
112
+ `,`
113
+ `).split(`
114
+ `).map(u=>s+u).join(`
115
+ `);return a.replaceWith(l,c,n.schema.text(d)),!0})},"Shift-Tab":({editor:t})=>{if(!this.options.enableTabIndentation)return!1;let e=this.options.tabSize??Ps,{state:n}=t,{selection:r}=n,{$from:i,empty:o}=r;return i.parent.type===this.type?o?t.commands.command(({tr:s})=>{let{pos:a}=i,l=i.start(),c=i.end(),d=n.doc.textBetween(l,c,`
116
+ `,`
117
+ `).split(`
118
+ `),u=0,h=0,p=a-l;for(let y=0;y<d.length;y+=1){if(h+d[y].length>=p){u=y;break}h+=d[y].length+1}let f=d[u].match(/^ */)?.[0]||"",m=Math.min(f.length,e);if(m===0)return!0;let g=l;for(let y=0;y<u;y+=1)g+=d[y].length+1;return s.delete(g,g+m),a-g<=m&&s.setSelection(O.create(s.doc,g)),!0}):t.commands.command(({tr:s})=>{let{from:a,to:l}=r,c=n.doc.textBetween(a,l,`
119
+ `,`
120
+ `).split(`
121
+ `).map(d=>{let u=d.match(/^ */)?.[0]||"",h=Math.min(u.length,e);return d.slice(h)}).join(`
122
+ `);return s.replaceWith(a,l,n.schema.text(c)),!0}):!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
123
+
124
+ `);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let o=r.before();return o>0?!1:t.commands.insertDefaultBlock({pos:o})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:a})=>(a.setSelection(R.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[Is({find:Nw,type:this.type,getAttributes:t=>({language:t[1]})}),Is({find:Rw,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new j({key:new J("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:o,schema:s}=t.state,a=s.text(n.replace(/\r\n?/g,`
125
+ `));return o.replaceSelectionWith(this.type.create({language:i},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(O.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),zw=I.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
126
+
127
+ `):""}),$w=I.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",W(this.options.HTMLAttributes,t)]},renderText(){return`
128
+ `},renderMarkdown:()=>`
129
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){let u=l.filter(h=>a.includes(h.type.name));c.ensureMarks(u)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Lw=I.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,W(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{let n=t.attrs?.level?parseInt(t.attrs.level,10):1,r="#".repeat(n);return t.content?`${r} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Is({find:RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),Iw=I.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",W(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Yk(e,e.schema.nodes[this.name]))return!1;let{selection:n}=e,{$to:r}=n,i=t();return Eu(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:a})=>{if(a){let{$to:l}=s.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(O.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(N.create(s.doc,l.pos)):s.setSelection(O.create(s.doc,l.pos));else{let d=(o.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType)?.create();d&&(s.insert(c,d),s.setSelection(O.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Yu({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Fw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Bw=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Pw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,jw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Hw=At.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",W(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Pe({find:Fw,type:this.type}),Pe({find:Pw,type:this.type})]},addPasteRules(){return[ge({find:Bw,type:this.type}),ge({find:jw,type:this.type})]}}),qw="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Vw="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",js="numeric",Hs="ascii",qs="alpha",tr="asciinumeric",er="alphanumeric",Vs="domain",hh="emoji",Ww="scheme",Uw="slashscheme",Ws="whitespace";function Kw(t,e){return t in e||(e[t]=[]),e[t]}function He(t,e,n){e[js]&&(e[tr]=!0,e[er]=!0),e[Hs]&&(e[tr]=!0,e[qs]=!0),e[tr]&&(e[er]=!0),e[qs]&&(e[er]=!0),e[er]&&(e[Vs]=!0),e[hh]&&(e[Vs]=!0);for(let r in e){let i=Kw(r,n);i.indexOf(t)<0&&i.push(t)}}function Jw(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function vt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}vt.groups={},vt.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){let i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r||=vt.groups;let i;return e&&e.j?i=e:(i=new vt(e),n&&r&&He(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this,o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r||=vt.groups;let i=this;if(e&&e.j)return i.j[t]=e,e;let o=e,s,a=i.go(t);return a?(s=new vt,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new vt,o&&(r&&(s.t&&typeof s.t=="string"?He(o,Object.assign(Jw(s.t,r),n),r):n&&He(o,n,r)),s.t=o),i.j[t]=s,s}};var $=(t,e,n,r,i)=>t.ta(e,n,r,i),X=(t,e,n,r,i)=>t.tr(e,n,r,i),ph=(t,e,n,r,i)=>t.ts(e,n,r,i),C=(t,e,n,r,i)=>t.tt(e,n,r,i),ie="WORD",Us="UWORD",fh="ASCIINUMERICAL",mh="ALPHANUMERICAL",nr="LOCALHOST",Ks="TLD",Js="UTLD",fi="SCHEME",gn="SLASH_SCHEME",Gs="NUM",Zs="WS",Xs="NL",rr="OPENBRACE",ir="CLOSEBRACE",mi="OPENBRACKET",gi="CLOSEBRACKET",yi="OPENPAREN",ki="CLOSEPAREN",bi="OPENANGLEBRACKET",wi="CLOSEANGLEBRACKET",vi="FULLWIDTHLEFTPAREN",xi="FULLWIDTHRIGHTPAREN",Ci="LEFTCORNERBRACKET",Si="RIGHTCORNERBRACKET",Ei="LEFTWHITECORNERBRACKET",Mi="RIGHTWHITECORNERBRACKET",Ai="FULLWIDTHLESSTHAN",Di="FULLWIDTHGREATERTHAN",Ti="AMPERSAND",Oi="APOSTROPHE",Ni="ASTERISK",ke="AT",Ri="BACKSLASH",_i="BACKTICK",zi="CARET",qe="COLON",Qs="COMMA",$i="DOLLAR",Ht="DOT",Li="EQUALS",Ys="EXCLAMATION",zt="HYPHEN",or="PERCENT",Ii="PIPE",Fi="PLUS",Bi="POUND",sr="QUERY",ta="QUOTE",gh="FULLWIDTHMIDDLEDOT",ea="SEMI",qt="SLASH",ar="TILDE",Pi="UNDERSCORE",yh="EMOJI",ji="SYM",kh=Object.freeze({__proto__:null,ALPHANUMERICAL:mh,AMPERSAND:Ti,APOSTROPHE:Oi,ASCIINUMERICAL:fh,ASTERISK:Ni,AT:ke,BACKSLASH:Ri,BACKTICK:_i,CARET:zi,CLOSEANGLEBRACKET:wi,CLOSEBRACE:ir,CLOSEBRACKET:gi,CLOSEPAREN:ki,COLON:qe,COMMA:Qs,DOLLAR:$i,DOT:Ht,EMOJI:yh,EQUALS:Li,EXCLAMATION:Ys,FULLWIDTHGREATERTHAN:Di,FULLWIDTHLEFTPAREN:vi,FULLWIDTHLESSTHAN:Ai,FULLWIDTHMIDDLEDOT:gh,FULLWIDTHRIGHTPAREN:xi,HYPHEN:zt,LEFTCORNERBRACKET:Ci,LEFTWHITECORNERBRACKET:Ei,LOCALHOST:nr,NL:Xs,NUM:Gs,OPENANGLEBRACKET:bi,OPENBRACE:rr,OPENBRACKET:mi,OPENPAREN:yi,PERCENT:or,PIPE:Ii,PLUS:Fi,POUND:Bi,QUERY:sr,QUOTE:ta,RIGHTCORNERBRACKET:Si,RIGHTWHITECORNERBRACKET:Mi,SCHEME:fi,SEMI:ea,SLASH:qt,SLASH_SCHEME:gn,SYM:ji,TILDE:ar,TLD:Ks,UNDERSCORE:Pi,UTLD:Js,UWORD:Us,WORD:ie,WS:Zs}),oe=/[a-z]/,lr=/\p{L}/u,na=/\p{Emoji}/u,se=/\d/,ra=/\s/,bh="\r",ia=`
130
+ `,Gw="\uFE0F",Zw="\u200D",oa="\uFFFC",sa=null,aa=null;function Xw(t=[]){let e={};vt.groups=e;let n=new vt;sa??=vh(qw),aa??=vh(Vw),C(n,"'",Oi),C(n,"{",rr),C(n,"}",ir),C(n,"[",mi),C(n,"]",gi),C(n,"(",yi),C(n,")",ki),C(n,"<",bi),C(n,">",wi),C(n,"\uFF08",vi),C(n,"\uFF09",xi),C(n,"\u300C",Ci),C(n,"\u300D",Si),C(n,"\u300E",Ei),C(n,"\u300F",Mi),C(n,"\uFF1C",Ai),C(n,"\uFF1E",Di),C(n,"&",Ti),C(n,"*",Ni),C(n,"@",ke),C(n,"`",_i),C(n,"^",zi),C(n,":",qe),C(n,",",Qs),C(n,"$",$i),C(n,".",Ht),C(n,"=",Li),C(n,"!",Ys),C(n,"-",zt),C(n,"%",or),C(n,"|",Ii),C(n,"+",Fi),C(n,"#",Bi),C(n,"?",sr),C(n,'"',ta),C(n,"/",qt),C(n,";",ea),C(n,"~",ar),C(n,"_",Pi),C(n,"\\",Ri),C(n,"\u30FB",gh);let r=X(n,se,Gs,{[js]:!0});X(r,se,r);let i=X(r,oe,fh,{[tr]:!0}),o=X(r,lr,mh,{[er]:!0}),s=X(n,oe,ie,{[Hs]:!0});X(s,se,i),X(s,oe,s),X(i,se,i),X(i,oe,i);let a=X(n,lr,Us,{[qs]:!0});X(a,oe),X(a,se,o),X(a,lr,a),X(o,se,o),X(o,oe),X(o,lr,o);let l=C(n,ia,Xs,{[Ws]:!0}),c=C(n,bh,Zs,{[Ws]:!0}),d=X(n,ra,Zs,{[Ws]:!0});C(n,oa,d),C(c,ia,l),C(c,oa,d),X(c,ra,d),C(d,bh),C(d,ia),X(d,ra,d),C(d,oa,d);let u=X(n,na,yh,{[hh]:!0});C(u,"#"),X(u,na,u),C(u,Gw,u);let h=C(u,Zw);C(h,"#"),X(h,na,u);let p=[[oe,s],[se,i]],f=[[oe,null],[lr,a],[se,o]];for(let m=0;m<sa.length;m++)be(n,sa[m],Ks,ie,p);for(let m=0;m<aa.length;m++)be(n,aa[m],Js,Us,f);He(Ks,{tld:!0,ascii:!0},e),He(Js,{utld:!0,alpha:!0},e),be(n,"file",fi,ie,p),be(n,"mailto",fi,ie,p),be(n,"http",gn,ie,p),be(n,"https",gn,ie,p),be(n,"ftp",gn,ie,p),be(n,"ftps",gn,ie,p),He(fi,{scheme:!0,ascii:!0},e),He(gn,{slashscheme:!0,ascii:!0},e),t=t.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<t.length;m++){let g=t[m][0],y=t[m][1]?{[Ww]:!0}:{[Uw]:!0};g.indexOf("-")>=0?y[Vs]=!0:oe.test(g)?se.test(g)?y[tr]=!0:y[Hs]=!0:y[js]=!0,ph(n,g,g,y)}return ph(n,"localhost",nr,{ascii:!0}),n.jd=new vt(ji),{start:n,tokens:Object.assign({groups:e},kh)}}function wh(t,e){let n=Qw(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let a=t,l=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(u=0,h=0,d=a):u>=0&&(u+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=u,s-=h,c-=u,i.push({t:d.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function Qw(t){let e=[],n=t.length,r=0;for(;r<n;){let i=t.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function be(t,e,n,r,i){let o,s=e.length;for(let a=0;a<s-1;a++){let l=e[a];t.j[l]?o=t.j[l]:(o=new vt(r),o.jr=i.slice(),t.j[l]=o),t=o}return o=new vt(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function vh(t){let e=[],n=[],r=0;for(;r<t.length;){let i=0;for(;"0123456789".indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}var cr={defaultProtocol:"http",events:null,format:xh,formatHref:xh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function la(t,e=null){let n=Object.assign({},cr);t&&(n=Object.assign(n,t instanceof la?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}la.prototype={o:cr,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=e!=null,i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:cr[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function xh(t){return t}function Ch(t,e){this.t="token",this.v=t,this.tk=e}Ch.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=cr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:i,attributes:s,content:o,eventListeners:u}}};function Hi(t,e){class n extends Ch{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var Yw=Hi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Sh=Hi("text"),tv=Hi("nl"),qi=Hi("url",{isLink:!0,toHref(t=cr.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==nr&&t[1].t===qe}}),$t=t=>new vt(t);function ev({groups:t}){let e=t.domain.concat([Ti,Ni,ke,Ri,_i,zi,$i,Li,zt,Gs,or,Ii,Fi,Bi,qt,ji,ar,Pi]),n=[Oi,qe,Qs,Ht,Ys,or,sr,ta,ea,bi,wi,rr,ir,gi,mi,yi,ki,vi,xi,Ci,Si,Ei,Mi,Ai,Di],r=[Ti,Oi,Ni,Ri,_i,zi,$i,Li,zt,rr,ir,or,Ii,Fi,Bi,sr,qt,ji,ar,Pi],i=$t(),o=C(i,ar);$(o,r,o),$(o,t.domain,o);let s=$t(),a=$t(),l=$t();$(i,t.domain,s),$(i,t.scheme,a),$(i,t.slashscheme,l),$(s,r,o),$(s,t.domain,s);let c=C(s,ke);C(o,ke,c),C(a,ke,c),C(l,ke,c);let d=C(o,Ht);$(d,r,o),$(d,t.domain,o);let u=$t();$(c,t.domain,u),$(u,t.domain,u);let h=C(u,Ht);$(h,t.domain,u);let p=$t(Yw);$(h,t.tld,p),$(h,t.utld,p),C(c,nr,p);let f=C(u,zt);C(f,zt,f),$(f,t.domain,u),$(p,t.domain,u),C(p,Ht,h),C(p,zt,f);let m=C(s,zt),g=C(s,Ht);C(m,zt,m),$(m,t.domain,s),$(g,r,o),$(g,t.domain,s);let y=$t(qi);$(g,t.tld,y),$(g,t.utld,y),$(y,t.domain,s),$(y,r,o),C(y,Ht,g),C(y,zt,m),C(y,ke,c);let b=C(y,qe),w=$t(qi);$(b,t.numeric,w);let k=$t(qi),v=$t();$(k,e,k),$(k,n,v),$(v,e,k),$(v,n,v),C(y,qt,k),C(w,qt,k);let E=C(a,qe),S=C(C(C(l,qe),qt),qt);$(a,t.domain,s),C(a,Ht,g),C(a,zt,m),$(l,t.domain,s),C(l,Ht,g),C(l,zt,m),$(E,t.domain,k),C(E,qt,k),C(E,sr,k),$(S,t.domain,k),$(S,e,k),C(S,qt,k);let A=[[rr,ir],[mi,gi],[yi,ki],[bi,wi],[vi,xi],[Ci,Si],[Ei,Mi],[Ai,Di]];for(let _=0;_<A.length;_++){let[z,nt]=A[_],lt=C(k,z);C(v,z,lt);let P=$t(qi);$(lt,e,P);let H=$t();$(lt,n,H),C(lt,nt,k),$(P,e,P),$(P,n,H),$(H,e,P),$(H,n,H),C(P,nt,k),C(H,nt,k)}return C(i,nr,y),C(i,Xs,tv),{start:i,tokens:kh}}function nv(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=t,l=null,c=null,d=0,u=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(h=0,u=a):h>=0&&h++,i++,d++;if(h<0)i-=d,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(ca(Sh,e,s)),s=[]),i-=h,d-=h;let p=u.t,f=n.slice(i-d,i);o.push(ca(p,e,f))}}return s.length>0&&o.push(ca(Sh,e,s)),o}function ca(t,e,n){let r=n[0].s,i=n[n.length-1].e;return new t(e.slice(r,i),n)}var rv=typeof console<"u"&&console&&console.warn||(()=>{}),iv="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",G={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ov(){return vt.groups={},G.scanner=null,G.parser=null,G.tokenQueue=[],G.pluginQueue=[],G.customSchemes=[],G.initialized=!1,G}function Eh(t,e=!1){if(G.initialized&&rv(`linkifyjs: already initialized - will not register custom scheme "${t}" ${iv}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw Error(`linkifyjs: incorrect scheme format.
131
+ 1. Must only contain digits, lowercase ASCII letters or "-"
132
+ 2. Cannot start or end with "-"
133
+ 3. "-" cannot repeat`);G.customSchemes.push([t,e])}function sv(){G.scanner=Xw(G.customSchemes);for(let t=0;t<G.tokenQueue.length;t++)G.tokenQueue[t][1]({scanner:G.scanner});G.parser=ev(G.scanner.tokens);for(let t=0;t<G.pluginQueue.length;t++)G.pluginQueue[t][1]({scanner:G.scanner,parser:G.parser});return G.initialized=!0,G}function da(t){return G.initialized||sv(),nv(G.parser.start,t,wh(G.scanner.start,t))}da.scan=wh;function Mh(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new la(n),i=da(t),o=[];for(let s=0;s<i.length;s++){let a=i[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}var ua="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",av=new RegExp(ua),lv=RegExp(`${ua}$`),cv=new RegExp(ua,"g");function dv(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function uv(t){return new j({key:new J("autolink"),appendTransaction:(e,n,r)=>{let i=e.some(a=>a.docChanged)&&!n.doc.eq(r.doc),o=e.some(a=>a.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r;if(si(pu(n.doc,[...e])).forEach(({newRange:a})=>{let l=Xy(r.doc,a,u=>u.isTextblock),c,d;if(l.length>1)c=l[0],d=r.doc.textBetween(c.pos,c.pos+c.node.nodeSize,void 0," ");else if(l.length){let u=r.doc.textBetween(a.from,a.to," "," ");if(!lv.test(u))return;c=l[0],d=r.doc.textBetween(c.pos,a.to,void 0," ")}if(c&&d){let u=d.split(av).filter(Boolean);if(u.length<=0)return!1;let h=u[u.length-1],p=c.pos+d.lastIndexOf(h);if(!h)return!1;let f=da(h).map(m=>m.toObject(t.defaultProtocol));if(!dv(f))return!1;f.filter(m=>m.isLink).map(m=>({...m,from:p+m.start+1,to:p+m.end+1})).filter(m=>!r.schema.marks.code||!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code)).filter(m=>t.validate(m.value)).filter(m=>t.shouldAutoLink(m.value)).forEach(m=>{Ms(m.from,m.to,r.doc).some(g=>g.mark.type===t.type)||s.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),s.steps.length)return s}})}function hv(t){return new j({key:new J("handleClickLink"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let s=r.target;if(!s)return!1;let a=t.editor.view.dom;i=s.closest("a"),i&&!a.contains(i)&&(i=null)}if(!i)return!1;let o=!1;if(t.enableClickSelection&&(o=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let s=Cu(e.state,t.type.name),a=i.href??s.href,l=i.target??s.target;a&&(window.open(a,l),o=!0)}return o}}})}var pv=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,fv=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Ah(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";--r)n+=1;return n%2==1}function mv(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&Ah(t,r)){r+=1;continue}let i=0;for(;r<e&&t[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function Dh(t,e,n){let[,r,i]=e;return(e.index?t[e.index-1]:void 0)==="!"||Ah(t,e.index??0)||mv(t,e.index??0)?!1:!!r.trim()&&n(i)}function Th(t){let[e,n,r,,i,o,s]=t,a=i??o??s;return{index:t.index??0,text:e,replaceWith:n,data:{href:r,title:a||null,markdown:!0}}}function gv(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function Oh(t){return{href:t.data?.href,title:t.data?.title??null}}function yv(t){let e=Pe({find:n=>{let r=pv.exec(n);return!r||!Dh(n,r,t.isAllowedHref)?null:Th(r)},type:t.type,getAttributes:Oh});return new Qn({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function kv(t){let e=ge({find:n=>{let r=[];for(let o of n.matchAll(fv))Dh(n,o,t.isAllowedHref)&&r.push(Th(o));let i=(t.findPlainUrls?.call(t,n)??[]).filter(o=>!r.some(s=>gv(s,o)));return[...r,...i]},type:t.type,getAttributes:Oh});return new Bu({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.match.data?.markdown&&n.state.tr.setMeta("preventAutolink",!0),r}})}function bv(t){return new j({key:new J("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{shouldAutoLink:i}=t,{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});let c=Mh(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||i!==void 0&&!i(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function ae(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(cv,"").match(RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var wv=At.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Eh(t);return}Eh(t.scheme,t.optionalSlashes)})},onDestroy(){ov()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ae(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{let e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;let r=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!ae(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ae(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",W(this.options.HTMLAttributes,t),0]:["a",W(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{let n=t.attrs?.href??"",r=t.attrs?.title??"",i=e.renderChildren(t);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ae(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ae(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[yv({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!ae(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let t=e=>{let n=[];if(e){let{protocols:r,defaultProtocol:i}=this.options;Mh(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!ae(s,r),protocols:r,defaultProtocol:i})).forEach(o=>{this.options.shouldAutoLink(o.value)&&n.push({text:o.value,data:{href:o.href},index:o.start})})}return n};return this.options.markdownLinks?[kv({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!ae(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[ge({find:t,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(uv({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!ae(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(hv({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(bv({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),vv=Object.defineProperty,xv=(t,e)=>{for(var n in e)vv(t,n,{get:e[n],enumerable:!0})},Cv="listItem",Nh="textStyle",Rh=/^\s*([-+*])\s$/,_h=I.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",W(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
134
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Cv,this.editor.getAttributes(Nh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=mn({find:Rh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=mn({find:Rh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Nh),editor:this.editor})),[t]}}),Sv=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let o=-1;for(let p=i.depth;p>0;--p)if(i.node(p).type.name===e){o=p;break}if(o<0)return null;let s=i.node(o),a=i.index(o);if(a+1>=s.childCount)return null;let l=s.child(a+1);if(!n.includes(l.type.name))return null;let c=t.schema.nodes[e],d=!1;if(l.forEach(p=>{p.type===c&&p.childCount>1&&(d=!0)}),!d)return null;let u=t.doc.resolve(i.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;let h=[];return u.forEach(p=>{h.push(p)}),h.length===0?null:{listItemDepth:o,nestedList:u,nestedListPos:i.after(),insertPos:i.after(o),items:h}},Ev=(t,e,n,r)=>{let i=Sv(t,n,r);if(!i)return!1;let{selection:o}=t,{nestedList:s,nestedListPos:a,insertPos:l,items:c}=i,d=t.tr;d.delete(a,a+s.nodeSize);let u=d.mapping.map(l);return d.insert(u,x.from(c)),d.setSelection(o.map(d.doc,d.mapping)),e&&e(d),!0},Mv=(t,e,n)=>Ev(t.state,t.view.dispatch,e,n),zh=(t,e)=>V.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>Mv(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),$h=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Vi="abcdefghijklmnopqrstuvwxyz",Lh=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function Wi(t){let e=t,n="";for(let[r,i]of $h)for(;e>=r;)n+=i,e-=r;return n}function ha(t){return Wi(t).toUpperCase()}function Ih(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let i=!1;for(let[o,s]of $h)if(e.startsWith(s,n)){r+=o,n+=s.length,i=!0;break}if(!i)return 0}return r}function Av(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=Ih(t);return e<=0?!1:(t===t.toLowerCase()?Wi(e):ha(e))===t}function Dv(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function Ui(t){if(t<=26)return Vi[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?Vi[n]:Vi[e]+Vi[n]}function Ki(t){if(!(!t||/^\d+$/.test(t))){if(Av(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function pa(t){if(/^\d+$/.test(t))return parseInt(t,10);let e=Ki(t);if(e==="i"||e==="I")return Ih(t);if(e==="a"||e==="A"){let r=Dv(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function Tv(t,e){if(t==="numeric")return String(e);switch(t){case"a":return Ui(e);case"A":return Ui(e).toUpperCase();case"i":return Wi(e);case"I":return ha(e);default:return String(e)}}function Ov(t){if(t.length===0)return!1;let e=Ki(t[0])??"numeric",n=pa(t[0]);if(n<1)return!1;for(let r=0;r<t.length;r++){let i=Tv(e,n+r);if(t[r]!==i)return!1}return!0}function Nv(t){return{type:Ki(t),start:pa(t)}}function Rv(t){let{type:e,start:n}=Nv(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function _v(t,e,n=". "){let r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${Ui(r)}${n}`;case"A":return`${Ui(r).toUpperCase()}${n}`;case"i":return`${Wi(r)}${n}`;case"I":return`${ha(r)}${n}`;default:return`${r}${n}`}}function zv(t){let e=t.tokens?.[0];return!!(t.text&&t.tokens?.length===1&&e?.type==="list"&&e.ordered&&e.raw===t.text)}function $v(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var Fh=I.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",W(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=e.parseBlockChildren??e.parseChildren,r=[];if(t.tokens&&t.tokens.length>0){if(zv(t))return{type:"listItem",content:[{type:"paragraph",content:$v(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))r=n(t.tokens);else{let i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(r=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){let o=n(t.tokens.slice(1));r.push(...o)}}else r=n(t.tokens)}}return r.length===0&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:r}},renderMarkdown:(t,e,n)=>zs(t,e,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){let i=r.meta?.parentAttrs?.start||1;return _v(r.meta?.parentAttrs?.type,i-1+(r.index||0),". ")}return"- "},n),addExtensions(){return[zh(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});xv({},{findListItemPos:()=>Ji,getNextListDepth:()=>fa,handleBackspace:()=>ma,handleDelete:()=>ga,handleTab:()=>Hh,hasListBefore:()=>Bh,hasListItemAfter:()=>Lv,hasListItemBefore:()=>Iv,listItemHasSubList:()=>Fv,nextListIsDeeper:()=>Ph,nextListIsHigher:()=>jh});var Ji=(t,e)=>{let{$from:n}=e.selection,r=Y(t,e.schema),i=null,o=n.depth,s=n.pos,a=null;for(;o>0&&a===null;)i=n.node(o),i.type===r?a=o:(--o,--s);return a===null?null:{$pos:e.doc.resolve(s),depth:a}},fa=(t,e)=>{let n=Ji(t,e);if(!n)return!1;let[,r]=ak(e,t,n.$pos.pos+4);return r},Bh=(t,e,n)=>{let{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),o=t.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},ma=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!re(t.state,e)&&Bh(t.state,e,n)){let{$anchor:o}=t.state.selection,s=t.state.doc.resolve(o.before()-1),a=[];s.node().descendants((d,u)=>{d.type.name===e&&a.push({node:d,pos:u})});let l=a.at(-1);if(!l)return!1;let c=t.state.doc.resolve(s.start()+l.pos+1);return t.chain().cut({from:o.start()-1,to:o.end()+1},c.end()).joinForward().run()}if(!re(t.state,e)||!hk(t.state))return!1;let{$from:r}=t.state.selection,i=r.depth-1;return r.node(i).type!==t.schema.nodes[e]||r.index(i)!==0?!1:t.chain().liftListItem(e).run()},Ph=(t,e)=>{let n=fa(t,e),r=Ji(t,e);return!r||!n?!1:n>r.depth},jh=(t,e)=>{let n=fa(t,e),r=Ji(t,e);return!r||!n?!1:n<r.depth},ga=(t,e)=>{if(!re(t.state,e)||!uk(t.state,e))return!1;let{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Ph(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():jh(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Hh=(t,e,n)=>{let{state:r}=t,{selection:i}=r;if(!i.empty)return!1;let{$from:o}=i;if(o.parentOffset!==0||!o.parent.isTextblock||re(r,e))return!1;let s=lk(o);if(!s||!n.includes(s.type.name))return!1;let a=s.lastChild;if(!a||a.type.name!==e)return!1;let l=o.parent;if(!a.canReplace(a.childCount,a.childCount,x.from(l)))return!1;let c=o.before(),d=o.after(),u=c-2;return t.commands.command(({tr:h,dispatch:p})=>(p&&(h.delete(c,d).insert(u,x.from(l)),h.setSelection(O.create(h.doc,u+1)),h.scrollIntoView()),!0))},Lv=(t,e)=>{let{$anchor:n}=e.selection,r=e.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==t)},Iv=(t,e)=>{let{$anchor:n}=e.selection,r=e.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==t)},Fv=(t,e,n)=>{if(!n)return!1;let r=Y(t,e.schema),i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},qh=V.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&ga(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&ga(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&ma(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&ma(t,n,r)&&(e=!0)}),e},Tab:({editor:t})=>{for(let{itemName:e,wrapperNames:n}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&Hh(t,e,n))return!0;return!1}}}}),ya=RegExp(`^(\\s*)(${Lh})([.)])\\s+(.*)$`),Bv=/^\s/,yn={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function Pv(t){return ya.test(t.trimStart())}function jv(t){let e=t.trimStart();return yn.bulletItem.test(e)||Pv(e)||yn.heading.test(e)||yn.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||yn.codeFence.test(e)||yn.blockMath.test(e)}function Hv(t){return Object.values(yn).some(e=>e.test(t))}function qv(t){let e=[],n=[],r=!1;return t.forEach(i=>{if(r){n.push(i);return}if(i.trim()===""){r=!0,n.push(i);return}if(e.length>0&&jv(i)){r=!0,n.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:n}}function Vv(t){let e=[],n=0,r=0;for(;n<t.length;){let i=t[n],o=i.match(ya);if(!o)break;let[,s,a,l,c]=o,d=s.length,u=parseInt(a,10),h=isNaN(u)?Ki(a):void 0,p=isNaN(u)?pa(a):u,f=[c],m=n+1,g=[i],y=!1;for(;m<t.length;){let b=t[m];if(b.match(ya))break;if(b.trim()==="")g.push(b),f.push(""),y=!0,m+=1;else if(b.match(Bv)){let w=b.length-b.trimStart().length,k=d+a.length+1;g.push(b),f.push(b.slice(Math.min(w,k))),m+=1}else{if(y||Hv(b))break;g.push(b),f.push(b),m+=1}}e.push({indent:d,number:p,type:h,content:f.join(`
135
+ `).trim(),contentLines:f,raw:g.join(`
136
+ `)}),r=m,n=m}return[e,r]}var Wv=RegExp(`^(${Lh})([.)])\\s+(.+)$`);function Uv(t){let e=t.split(`
137
+ `).filter(r=>r.trim().length>0);if(e.length===0)return null;let n=[];for(let r of e){let i=r.trim().match(Wv);if(!i)return null;n.push({marker:i[1],content:i[3]})}return Ov(n.map(r=>r.marker))?{type:"orderedList",attrs:Rv(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function Vh(t,e,n){let r=[],i=0;for(;i<t.length;){let o=t[i];if(o.indent===e){let{paragraphLines:s,blockLines:a}=qv(o.contentLines),l=s.join(`
138
+ `).trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});let d=a.join(`
139
+ `).trim();if(d){let p=n.blockTokens(d);c.push(...p)}let u=i+1,h=[];for(;u<t.length&&t[u].indent>e;)h.push(t[u]),u+=1;if(h.length>0){let p=Vh(h,Math.min(...h.map(f=>f.indent)),n);c.push({type:"list",ordered:!0,start:h[0].number,typeMarker:h[0].type,items:p,raw:h.map(f=>f.raw).join(`
140
+ `)})}r.push({type:"list_item",raw:o.raw,tokens:c}),i=u}else i+=1}return r}function Kv(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];let r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){let o=e.parseChildren([i]);r.push({type:"paragraph",content:o})}else{let o=e.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}var Jv="listItem",Wh="textStyle",Uh=/^(\d+)\.\s$/;function Kh(t){let e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var Jh=I.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{let e=t.getAttribute("type");if(e)return e;let n=t.getAttribute("style");if(n){let i=Kh(n);if(i)return i}let r=t.querySelector("li");if(r){let i=r.getAttribute("style");if(i){let o=Kh(i);if(o)return o}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,type:n,...r}=t,i=W(this.options.HTMLAttributes,r);return e!==1&&(i.start=e),n&&n!=="1"&&(i.type=n),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];let n=t.start||1,r=t.typeMarker,i=t.items?Kv(t.items,e):[],o={};return n!==1&&(o.start=n),r&&(o.type=r),Object.keys(o).length>0?{type:"orderedList",attrs:o,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
141
+ `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{let r=t.split(`
142
+ `),[i,o]=Vv(r);if(i.length===0)return;let s=Vh(i,i[0].indent,n);if(s.length!==0)return{type:"list",ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:s,raw:r.slice(0,o).join(`
143
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Jv,this.editor.getAttributes(Wh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new j({props:{handlePaste:(t,e)=>{if(e.clipboardData?.getData("text/html")?.trim())return!1;let n=e.clipboardData?.getData("text/plain");if(!n)return!1;let r=Uv(n);if(!r)return!1;try{let i=t.state.schema.nodeFromJSON(r),o=t.state.tr.replaceSelectionWith(i);return t.dispatch(o),!0}catch{return!1}}}})]},addInputRules(){let t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1],e=mn({find:Uh,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=mn({find:Uh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Wh)}),joinPredicate:t,editor:this.editor})),[e]}}),Gv=/^\s*(\[([( |x])?\])\s$/,Zv="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",Xv=(t,e,n)=>n?.checkboxLabel?.call(n,t,e)||`Task item checkbox for ${t.textContent||"empty task item"}`,Gh=I.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>t.querySelector("div")??t}]},renderHTML({node:t,HTMLAttributes:e}){return["li",W(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>zs(t,e,`- [${t.attrs?.checked?"x":" "}] `),addExtensions(){return this.options.nested?[zh(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");s.style.cssText=Zv;let c=u=>{let h=Xv(u,u.attrs.checked,this.options.a11y);a.setAttribute("aria-label",h),s.textContent=h};c(t),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",u=>u.preventDefault()),a.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:h}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{let f=n();if(typeof f!="number")return!1;let m=p.doc.nodeAt(f);return p.setNodeMarkup(f,void 0,{...m?.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,h])=>{i.setAttribute(u,h)}),i.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(e).forEach(([u,h])=>{i.setAttribute(u,h)});let d=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:u=>{if(u.type!==this.type)return!1;i.dataset.checked=u.attrs.checked,a.checked=u.attrs.checked,c(u);let h=r.extensionManager.attributes,p=un(u,h),f=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return d.forEach(g=>{f.has(g)||(g in m?i.setAttribute(g,m[g]):i.removeAttribute(g))}),Object.entries(p).forEach(([g,y])=>{y==null?g in m?i.setAttribute(g,m[g]):i.removeAttribute(g):i.setAttribute(g,y)}),d=f,!0}}}},addInputRules(){return[mn({find:Gv,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Zh=I.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",W(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
144
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){let e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return e===void 0?-1:e},tokenize(t,e,n){let r=o=>{let s=_s(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(s){let a={type:"taskList",raw:s.raw,items:s.items},l=o.slice(s.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(o)},i=_s(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});V.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(_h.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Fh.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(qh.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Jh.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Gh.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Zh.configure(this.options.taskList)),t}});var Gi="&nbsp;",ka="\xA0",Qv=I.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",W(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{let n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);let r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Gi||n[0].text===Gi||n[0].raw===ka||n[0].text===ka)&&r.length===1&&r[0].type==="text"&&(r[0].text===Gi||r[0].text===ka)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{if(!t)return"";let r=Array.isArray(t.content)?t.content:[];if(r.length===0){let i=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type==="paragraph"&&i.length===0?Gi:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Yv=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ex=At.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",W(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Pe({find:Yv,type:this.type})]},addPasteRules(){return[ge({find:tx,type:this.type})]}}),nx=I.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),rx=At.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",W(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function ix(t={}){return new j({view(e){return new ox(e,t)}})}var ox=class{constructor(t,e){this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=e.width??1,this.color=e.color===!1?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(n=>{let r=i=>{this[n](i)};return t.dom.addEventListener(n,r),{name:n,handler:r}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){if(this.cursorPos!=null&&e.doc!=t.state.doc)if(this.lastDragEvent){let n=this.computeTarget(this.lastDragEvent);n==this.cursorPos?this.updateOverlay():this.setCursor(n)}else this.updateOverlay()}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),e=!t.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),o=i.width/r.offsetWidth,s=i.height/r.offsetHeight;if(e){let d=t.nodeBefore,u=t.nodeAfter;if(d||u){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),f=d?p.bottom:p.top;d&&u&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*s;n={left:p.left,right:p.right,top:f-m,bottom:f+m}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),u=this.width/2*o;n={left:d.left-u,right:d.left+u,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",e),this.element.classList.toggle("prosemirror-dropcursor-inline",!e);let l,c;if(!a||a==document.body&&getComputedStyle(a).position=="static")l=-pageXOffset,c=-pageYOffset;else{let d=a.getBoundingClientRect(),u=d.width/a.offsetWidth,h=d.height/a.offsetHeight;l=d.left-a.scrollLeft*u,c=d.top-a.scrollTop*h}this.element.style.left=(n.left-l)/o+"px",this.element.style.top=(n.top-c)/s+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}computeTarget(t){let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r=="function"?r(this.editorView,e,t):r;if(!e||i)return null;let o=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=Ql(this.editorView.state.doc,o,this.editorView.dragging.slice);s!=null&&(o=s)}return o}dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;let e=this.computeTarget(t);e!=null&&(this.setCursor(e),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}},xt=class De extends R{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return De.valid(r)?new De(r):R.near(r)}content(){return M.empty}eq(e){return e instanceof De&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw RangeError("Invalid input for GapCursor.fromJSON");return new De(e.resolve(n.pos))}getBookmark(){return new sx(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!ax(e)||!lx(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){t:for(;;){if(!r&&De.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(De.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!N.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue t}break}o=s,i+=n;let a=e.doc.resolve(i);if(De.valid(a))return a}return null}}};xt.prototype.visible=!1,xt.findFrom=xt.findGapCursorFrom,R.jsonID("gapcursor",xt);var sx=class lm{constructor(e){this.pos=e}map(e){return new lm(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return xt.valid(n)?new xt(n):R.near(n)}};function Xh(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function ax(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Xh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function lx(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Xh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function cx(){return new j({props:{decorations:px,createSelectionBetween(t,e,n){return e.pos==n.pos&&xt.valid(n)?new xt(n):null},handleClick:ux,handleKeyDown:dx,handleDOMEvents:{beforeinput:hx}}})}var dx=bs({ArrowLeft:Zi("horiz",-1),ArrowRight:Zi("horiz",1),ArrowUp:Zi("vert",-1),ArrowDown:Zi("vert",1)});function Zi(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof O){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=xt.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new xt(c))),!0):!1}}function ux(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!xt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&N.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new xt(r))),!0)}function hx(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof xt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=x.empty;for(let s=r.length-1;s>=0;s--)i=x.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new M(i,0,0));return o.setSelection(O.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function px(t){if(!(t.selection instanceof xt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",q.create(t.doc,[wt.widget(t.selection.head,e,{key:"gapcursor"})])}var Xi=200,et=function(){};et.prototype.append=function(t){return t.length?(t=et.from(t),!this.length&&t||t.length<Xi&&this.leafAppend(t)||this.length<Xi&&t.leafPrepend(this)||this.appendInner(t)):this},et.prototype.prepend=function(t){return t.length?et.from(t).append(this):this},et.prototype.appendInner=function(t){return new fx(this,t)},et.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?et.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},et.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},et.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},et.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(i,o){return r.push(t(i,o))},e,n),r},et.from=function(t){return t instanceof et?t:t&&t.length?new Qh(t):et.empty};var Qh=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,o,s){for(var a=i;a<o;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){for(var a=i-1;a>=o;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Xi)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Xi)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(et);et.empty=new Qh([]);var fx=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,i,o){var s=this.left.length;if(r<s&&this.left.forEachInner(n,r,Math.min(i,s),o)===!1||i>s&&this.right.forEachInner(n,Math.max(r-s,0),Math.min(this.length,i)-s,o+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,i,o){var s=this.left.length;if(r>s&&this.right.forEachInvertedInner(n,r-s,Math.max(i,s)-s,o+s)===!1||i<s&&this.left.forEachInvertedInner(n,Math.min(r,s),i,o)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(n,r):n>=i?this.right.slice(n-i,r-i):this.left.slice(n,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(et),mx=500,dr=class En{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],d=[];return this.items.forEach((u,h)=>{if(!u.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,d.push(u);return}if(i){d.push(new we(u.map));let p=u.step.map(i.slice(o)),f;p&&s.maybeStep(p).doc&&(f=s.mapping.maps[s.mapping.maps.length-1],c.push(new we(f,void 0,void 0,c.length+d.length))),o--,f&&i.appendMap(f,o)}else s.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(o)):u.selection,l=new En(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),h=new we(e.mapping.maps[d],u,n),p;(p=l&&l.merge(h))&&(h=p,d?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&=(s++,void 0),i||(l=h)}let c=s-r.depth;return c>yx&&(a=gx(a,c),s-=c),new En(a.append(o),s)}remapping(e,n){let r=new Kl;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new En(this.items.append(e.map(n=>new we(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=n;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let f=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(o.slice(l+1,p));g&&a++,r.push(new we(f,m,g))}else r.push(new we(f))},i);let c=[];for(let h=n;h<s;h++)c.push(new we(o.maps[h]));let d=this.items.slice(0,i).append(c).append(r),u=new En(d,a);return u.emptyItemCount()>mx&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let u=new we(c.invert(),l,d),h,p=i.length-1;(h=i.length&&i[p].merge(u))?i[p]=h:i.push(u)}}else s.map&&r--},this.items.length,0),new En(et.from(i.reverse()),o)}};dr.empty=new dr(et.empty,0);function gx(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var we=class cm{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new cm(n.getMap().invert(),n,this.selection)}}},ve=class{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},yx=20;function kx(t,e,n,r){let i=n.getMeta(Ve),o;if(i)return i.historyState;n.getMeta(vx)&&(t=new ve(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Ve))return s.getMeta(Ve).redo?new ve(t.done.addTransform(n,void 0,r,Qi(e)),t.undone,Yh(n.mapping.maps),t.prevTime,t.prevComposition):new ve(t.done,t.undone.addTransform(n,void 0,r,Qi(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!bx(n,t.prevRanges)),c=s?ba(t.prevRanges,n.mapping):Yh(n.mapping.maps);return new ve(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Qi(e)),dr.empty,c,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new ve(t.done.rebased(n,o),t.undone.rebased(n,o),ba(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ve(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ba(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function bx(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Yh(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function ba(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function wx(t,e,n){let r=Qi(e),i=Ve.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new ve(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ve,{redo:n,historyState:l})}var wa=!1,tp=null;function Qi(t){let e=t.plugins;if(tp!=e){wa=!1,tp=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){wa=!0;break}}return wa}var Ve=new J("history"),vx=new J("closeHistory");function xx(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new j({key:Ve,state:{init(){return new ve(dr.empty,dr.empty,null,0,-1)},apply(e,n,r){return kx(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?np:r=="historyRedo"?rp:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function ep(t,e){return(n,r)=>{let i=Ve.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=wx(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}var np=ep(!1,!0),rp=ep(!0,!0);V.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{let e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){let n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{let e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new j({key:new J("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;let i=this.options.limit,o=this.options.autoTrim;if(i==null||i===0||o===!1){t=!0;return}let s=this.storage.characters({node:r.doc});if(s>i){let a=s-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let l=r.tr.deleteRange(0,a);return t=!0,l}t=!0},filterTransaction:(e,n)=>{let r=this.options.limit;if(!e.docChanged||r===0||r==null)return!0;let i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;let s=e.selection.$head.pos,a=s-(o-r),l=s;return e.deleteRange(a,l),!(this.storage.characters({node:e.doc})>r)}})]}});var Cx=V.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[ix(this.options)]}});V.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new j({key:new J("focus"),props:{decorations:({doc:t,selection:e})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!n||!r)return q.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(!l.isText){if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1}});let a=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(wt.node(c,c+l.nodeSize,{class:this.options.className}))}),q.create(t,o)}}})]}});var Sx=V.create({name:"gapCursor",addProseMirrorPlugins(){return[cx()]},extendNodeSchema(t){return{allowGapCursor:F(D(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage}))??null}}}),ip="placeholder",op=new J("tiptap__placeholder");function sp(t){let{editor:e,placeholder:n,dataAttribute:r,pos:i,node:o,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=t,d=[l];return s&&d.push(c),wt.node(i,i+o.nodeSize,{class:d.join(" "),[r]:typeof n=="function"?n({editor:e,node:o,pos:i,hasAnchor:a}):n})}function ap(t,e){return typeof t=="function"?t(e):t}function lp({editor:t,options:e,dataAttribute:n,doc:r,selection:i,from:o,to:s}){let{anchor:a}=i,l=[],c=t.isEmpty;return r.nodesBetween(o,s,(d,u)=>{let h=a>=u&&a<=u+d.nodeSize,p=!d.isLeaf&&Xn(d);return d.type.isTextblock&&(h||!e.showOnlyCurrent)&&p&&l.push(sp({editor:t,isEmptyDoc:c,dataAttribute:n,hasAnchor:h,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:ap(e.emptyNodeClass,{editor:t,node:d,pos:u,hasAnchor:h})},node:d,pos:u})),e.includeChildren}),l}function cp({editor:t,options:e,dataAttribute:n,doc:r,selection:i}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;let{anchor:o}=i,s=[],a=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){let l=r.resolve(o),c=l.depth>0?l.node(1):l.nodeAfter,d=l.depth>0?l.before(1):o;if(c&&c.type.isTextblock&&Xn(c)){let u=o>=d&&o<=d+c.nodeSize;s.push(sp({editor:t,isEmptyDoc:a,dataAttribute:n,hasAnchor:u,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:ap(e.emptyNodeClass,{editor:t,node:c,pos:d,hasAnchor:u})},node:c,pos:d}))}}else s.push(...lp({editor:t,options:e,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return q.create(r,s)}function ur(t,e){let n=t.resolve(e);if(n.depth===0){let i=n.nodeAfter??n.nodeBefore;if(!i)return{from:e,to:e};let o=n.nodeAfter?e:e-i.nodeSize;return{from:o,to:o+i.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function hr(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function Ex(t,e,n){let r=[];return t.forEach((i,o)=>{let s=o,a=s+i.nodeSize,l=s+1,c=a+1;l<n&&c>e&&r.push({from:s,to:a})}),r}function Mx(t){if(t.length===0)return[];let e=[...t].sort((r,i)=>r.from-i.from),n=[{...e[0]}];for(let r=1;r<e.length;r+=1){let i=n[n.length-1],o=e[r];o.from<=i.to?i.to=Math.max(i.to,o.to):n.push({...o})}return n}function Ax(t,e){let n=Ex(t,e.from,e.to);return n.push(hr(t,ur(t,e.from))),e.to>e.from?n.push(hr(t,ur(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(hr(t,ur(t,Math.min(e.from+1,t.content.size)))),n}function Dx(t,e,n){let r=[];if(t.docChanged){let i=si(t);for(let o of i)r.push(...Ax(n.doc,o.newRange))}return t.selectionSet&&(r.push(hr(n.doc,ur(n.doc,t.mapping.map(e.selection.anchor)))),r.push(hr(n.doc,ur(n.doc,n.selection.anchor)))),Mx(r)}function Tx(t,e,n){let r=Math.max(0,Math.min(t,n.content.size));return{from:r,to:Math.max(r,Math.min(e,n.content.size))}}function Ox({decorations:t,ranges:e,editor:n,options:r,dataAttribute:i,doc:o,selection:s}){let a=t;for(let l of e){let{from:c,to:d}=Tx(l.from,l.to,o),u=a.find(c,d).filter(p=>p.from>=c&&p.to<=d);u.length&&(a=a.remove(u));let h=lp({editor:n,options:r,dataAttribute:i,doc:o,selection:s,from:c,to:d});h.length&&(a=a.add(o,h))}return a}function Nx({editor:t,options:e,dataAttribute:n}){return{init(r,i){return cp({editor:t,options:e,dataAttribute:n,doc:i.doc,selection:i.selection})??q.empty},apply(r,i,o,s){return!r.docChanged&&!r.selectionSet?i:Ox({decorations:i.map(r.mapping,r.doc),ranges:Dx(r,o,s),editor:t,options:e,dataAttribute:n,doc:s.doc,selection:s.selection})}}}function Rx(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function _x({editor:t,options:e}){let n=e.dataAttribute?`data-${Rx(e.dataAttribute)}`:`data-${ip}`,r=e.showOnlyCurrent&&!e.includeChildren;return new j({key:op,...r?{}:{state:Nx({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:i,selection:o})=>cp({editor:t,options:e,dataAttribute:n,doc:i,selection:o}):i=>e.showOnlyWhenEditable&&!t.isEditable?q.empty:op.getState(i)??q.empty}})}var zx=V.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:ip,placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[_x({editor:this.editor,options:this.options})]}});function va(t,e){return!t.selection.empty&&!Eu(t.selection)&&e.isEditable}function $x(t,e){return va(t,e)&&!e.isFocused&&!e.view.dragging}function Lx(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function Ix(t){t.focus()}V.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){let{editor:t,options:e}=this;return[new j({key:new J("selection"),props:{decorations(n){return $x(n,t)?q.create(n.doc,[wt.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return va(n.state,t)&&Lx(),!1},focus(n){return va(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&Ix(n)}),!1}}}})]}});function dp({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var Fx=V.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let t=new J(this.name),e=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(e).includes(r.name));return[new j({key:t,appendTransaction:(r,i,o)=>{let{doc:s,tr:a,schema:l}=o,c=t.getState(o),d=s.content.size,u=l.nodes[e];if(!r.some(h=>h.getMeta("skipTrailingNode"))&&c)return a.insert(d,u.create())},state:{init:(r,i)=>{let o=i.tr.doc.lastChild;return!dp({node:o,types:n})},apply:(r,i)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return i;let o=r.doc.lastChild;return!dp({node:o,types:n})}}})]}}),Bx=V.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>np(t,e),redo:()=>({state:t,dispatch:e})=>rp(t,e)}},addProseMirrorPlugins(){return[xx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Px=V.create({name:"starterKit",addExtensions(){let t=[];return this.options.bold!==!1&&t.push(Aw.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(xw.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(_h.configure(this.options.bulletList)),this.options.code!==!1&&t.push(Ow.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(_w.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(zw.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(Cx.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(Sx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push($w.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(Lw.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(Bx.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(Iw.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(Hw.configure(this.options.italic)),this.options.listItem!==!1&&t.push(Fh.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(qh.configure(this.options?.listKeymap)),this.options.link!==!1&&t.push(wv.configure(this.options?.link)),this.options.orderedList!==!1&&t.push(Jh.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(Qv.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(ex.configure(this.options.strike)),this.options.text!==!1&&t.push(nx.configure(this.options.text)),this.options.underline!==!1&&t.push(rx.configure(this.options?.underline)),this.options.trailingNode!==!1&&t.push(Fx.configure(this.options?.trailingNode)),t}}),xa,Ca;if(typeof WeakMap<"u"){let t=new WeakMap;xa=e=>t.get(e),Ca=(e,n)=>(t.set(e,n),n)}else{let t=[],e=0;xa=n=>{for(let r=0;r<t.length;r+=2)if(t[r]==n)return t[r+1]},Ca=(n,r)=>(e==10&&(e=0),t[e++]=n,t[e++]=r)}var Q=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){let n=this.map[e];if(n!=t)continue;let r=e%this.width,i=e/this.width|0,o=r+1,s=i+1;for(let a=1;o<this.width&&this.map[e+a]==n;a++)o++;for(let a=1;s<this.height&&this.map[e+this.width*a]==n;a++)s++;return{left:r,top:i,right:o,bottom:s}}throw RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){let{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(o,c)}}cellsInRect(t){let e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==t){let s=e+t*this.width,a=(t+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(t){return xa(t)||Ca(t,jx(t))}};function jx(t){if(t.type.spec.tableRole!="table")throw RangeError("Not a table node: "+t.type.name);let e=Hx(t),n=t.childCount,r=[],i=0,o=null,s=[];for(let c=0,d=e*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){let u=t.child(c);d++;for(let f=0;;f++){for(;i<r.length&&r[i]!=0;)i++;if(f==u.childCount)break;let m=u.child(f),{colspan:g,rowspan:y,colwidth:b}=m.attrs;for(let w=0;w<y;w++){if(w+c>=n){(o||=[]).push({type:"overlong_rowspan",pos:d,n:y-w});break}let k=i+w*e;for(let v=0;v<g;v++){r[k+v]==0?r[k+v]=d:(o||=[]).push({type:"collision",row:c,pos:d,n:g-v});let E=b&&b[v];if(E){let S=(k+v)%e*2,A=s[S];A==null||A!=E&&s[S+1]==1?(s[S]=E,s[S+1]=1):A==E&&s[S+1]++}}}i+=g,d+=m.nodeSize}let h=(c+1)*e,p=0;for(;i<h;)r[i++]==0&&p++;p&&(o||=[]).push({type:"missing",row:c,n:p}),d++}(e===0||n===0)&&(o||=[]).push({type:"zero_sized"});let a=new Q(e,n,r,o),l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&qx(a,s,t),a}function Hx(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),o=0;if(n)for(let s=0;s<r;s++){let a=t.child(s);for(let l=0;l<a.childCount;l++){let c=a.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){let a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function qx(t,e,n){t.problems||=[];let r={};for(let i=0;i<t.map.length;i++){let o=t.map[i];if(r[o])continue;r[o]=!0;let s=n.nodeAt(o);if(!s)throw RangeError(`No cell with offset ${o} found`);let a=null,l=s.attrs;for(let c=0;c<l.colspan;c++){let d=e[(i+c)%t.width*2];d!=null&&(!l.colwidth||l.colwidth[c]!=d)&&((a||=Vx(l))[c]=d)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function Vx(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function ht(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var xe=new J("selectingCells");function We(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Wx(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function It(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Yi(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=We(e.$head)||Ux(e.$head);if(n)return n;throw RangeError(`No cell found around position ${e.head}`)}function Ux(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Sa(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Kx(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Ea(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function up(t,e,n){let r=t.node(-1),i=Q.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function Ue(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function hp(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function Jx(t,e,n){let r=ht(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var U=class le extends R{constructor(e,n=e){let r=e.node(-1),i=Q.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),a=e.node(0),l=i.cellsInRect(s).filter(d=>d!=n.pos-o);l.unshift(n.pos-o);let c=l.map(d=>{let u=r.nodeAt(d);if(!u)throw RangeError(`No cell with offset ${d} found`);let h=o+d+1;return new oc(a.resolve(h),a.resolve(h+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Sa(r)&&Sa(i)&&Ea(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?le.rowSelection(r,i):o&&this.isColSelection()?le.colSelection(r,i):new le(r,i)}return O.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=Q.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){let c=[];for(let d=l*n.width+i.left,u=i.left;u<i.right;u++,d++){let h=n.map[d];if(o[h])continue;o[h]=!0;let p=n.findCell(h),f=e.nodeAt(h);if(!f)throw RangeError(`No cell with offset ${h} found`);let m=i.left-p.left,g=p.right-i.right;if(m>0||g>0){let y=f.attrs;if(m>0&&(y=Ue(y,0,m)),g>0&&(y=Ue(y,y.colspan-g,g)),p.left<i.left){if(f=f.type.createAndFill(y),!f)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else f=f.type.create(y,f.content)}if(p.top<i.top||p.bottom>i.bottom){let y={...f.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};f=p.top<i.top?f.type.createAndFill(y):f.type.create(y,f.content)}c.push(f)}s.push(e.child(l).copy(x.from(c)))}let a=this.isColSelection()&&this.isRowSelection()?e:s;return new M(x.from(a),1,1)}replace(e,n=M.empty){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?M.empty:n)}let o=R.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new M(x.from(n),0,0))}forEachCell(e){let n=this.$anchorCell.node(-1),r=Q.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(n.nodeAt(o[s]),i+o[s])}isColSelection(){let e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=Q.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new le(e,n)}isRowSelection(){let e=this.$anchorCell.node(-1),n=Q.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(e){return e instanceof le&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=Q.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(n=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new le(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new le(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new le(e.resolve(n),e.resolve(r))}getBookmark(){return new Gx(this.$anchorCell.pos,this.$headCell.pos)}};U.prototype.visible=!1,R.jsonID("cell",U);var Gx=class dm{constructor(e,n){this.anchor=e,this.head=n}map(e){return new dm(e.map(this.anchor),e.map(this.head))}resolve(e){let n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Ea(n,r)?new U(n,r):R.near(r,1)}};function Zx(t){if(!(t.selection instanceof U))return null;let e=[];return t.selection.forEachCell((n,r)=>{e.push(wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),q.create(t.doc,e)}function Xx({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function Qx({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function Yx(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof N&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=U.create(i,r.from);else if(s=="row"){let a=i.resolve(r.from+1);o=U.rowSelection(a,a)}else if(!n){let a=Q.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=U.create(i,l+1,c)}}else r instanceof O&&Xx(r)?o=O.create(i,r.from):r instanceof O&&Qx(r)&&(o=O.create(i,r.$from.start(),r.$from.end()));return o&&(e||=t.tr).setSelection(o),e}var tC=new J("fix-tables");function pp(t,e,n,r){let i=t.childCount,o=e.childCount;t:for(let s=0,a=0;s<o;s++){let l=e.child(s);for(let c=a,d=Math.min(i,s+3);c<d;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue t}r(l,n),a<i&&t.child(a).sameMarkup(l)?pp(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function fp(t,e){let n,r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=eC(t,i,o,n))};return e?e.doc!=t.doc&&pp(e.doc,t.doc,0,r):t.doc.descendants(r),n}function eC(t,e,n,r){let i=Q.get(e);if(!i.problems)return r;r||=t.tr;let o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){let c=i.problems[l];if(c.type=="collision"){let d=e.nodeAt(c.pos);if(!d)continue;let u=d.attrs;for(let h=0;h<u.rowspan;h++)o[c.row+h]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Ue(u,u.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){let d=e.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){let d=e.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){let d=r.mapping.map(n);r.delete(d,d+e.nodeSize)}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s??=l,a=l);for(let l=0,c=n+1;l<i.height;l++){let d=e.child(l),u=c+d.nodeSize,h=o[l];if(h>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);let f=[];for(let g=0;g<h;g++){let y=ht(t.schema)[p].createAndFill();y&&f.push(y)}let m=(l==0||s==l-1)&&a==l?c+1:u-1;r.insert(r.mapping.map(m),f)}c=u}return r.setMeta(tC,{fixTables:!0})}function Vt(t){let e=t.selection,n=Yi(t),r=n.node(-1),i=n.start(-1),o=Q.get(r);return{...e instanceof U?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function mp(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;Jx(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){let a=s*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){let l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,hp(c.attrs,i-e.colCount(l))),s+=c.attrs.rowspan-1}else{let l=o==null?ht(r.type.schema).cell:r.nodeAt(e.map[a+o]).type,c=e.positionAt(s,i,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function nC(t,e){if(!It(t))return!1;if(e){let n=Vt(t);e(mp(t.tr,n,n.left))}return!0}function rC(t,e){if(!It(t))return!1;if(e){let n=Vt(t);e(mp(t.tr,n,n.right))}return!0}function iC(t,{map:e,table:n,tableStart:r},i){let o=t.mapping.maps.length;for(let s=0;s<e.height;){let a=s*e.width+i,l=e.map[a],c=n.nodeAt(l),d=c.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(o).map(r+l),null,Ue(d,i-e.colCount(l)));else{let u=t.mapping.slice(o).map(r+l);t.delete(u,u+c.nodeSize)}s+=d.rowspan}}function oC(t,e){if(!It(t))return!1;if(e){let n=Vt(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;iC(r,n,i),i!=n.left;i--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Q.get(o)}e(r)}return!0}function sC(t,e,n){let r=ht(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(e.nodeAt(t.map[i+n*t.width])?.type!=r)return!1;return!0}function gp(t,{map:e,tableStart:n,table:r},i){let o=n;for(let l=0;l<i;l++)o+=r.child(l).nodeSize;let s=[],a=i>0?-1:0;sC(e,r,i+a)&&(a=i==0||i==e.height?null:0);for(let l=0,c=e.width*i;l<e.width;l++,c++)if(i>0&&i<e.height&&e.map[c]==e.map[c-e.width]){let d=e.map[c],u=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...u,rowspan:u.rowspan+1}),l+=u.colspan-1}else{let d=(a==null?ht(r.type.schema).cell:r.nodeAt(e.map[c+a*e.width])?.type)?.createAndFill();d&&s.push(d)}return t.insert(o,ht(r.type.schema).row.create(null,s)),t}function aC(t,e){if(!It(t))return!1;if(e){let n=Vt(t);e(gp(t.tr,n,n.top))}return!0}function lC(t,e){if(!It(t))return!1;if(e){let n=Vt(t);e(gp(t.tr,n,n.bottom))}return!0}function cC(t,{map:e,table:n,tableStart:r},i){let o=0;for(let c=0;c<i;c++)o+=n.child(c).nodeSize;let s=o+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(o+r,s+r);let l=new Set;for(let c=0,d=i*e.width;c<e.width;c++,d++){let u=e.map[d];if(!l.has(u)){if(l.add(u),i>0&&u==e.map[d-e.width]){let h=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<e.height&&u==e.map[d+e.width]){let h=n.nodeAt(u),p=h.attrs,f=h.type.create({...p,rowspan:h.attrs.rowspan-1},h.content),m=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(a).map(r+m),f),c+=p.colspan-1}}}}function dC(t,e){if(!It(t))return!1;if(e){let n=Vt(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;cC(r,n,i),i!=n.top;i--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Q.get(n.table)}e(r)}return!0}function yp(t){let e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function uC({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,s=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[a]==n[a+1])return!0;o+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[s]==n[s+t])return!0;i++,s++}return!1}function kp(t,e){let n=t.selection;if(!(n instanceof U)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Vt(t),{map:i}=r;if(uC(i,r))return!1;if(e){let o=t.tr,s={},a=x.empty,l,c;for(let d=r.top;d<r.bottom;d++)for(let u=r.left;u<r.right;u++){let h=i.map[d*i.width+u],p=r.table.nodeAt(h);if(!(s[h]||!p))if(s[h]=!0,l==null)l=h,c=p;else{yp(p)||(a=a.append(p.content));let f=o.mapping.map(h+r.tableStart);o.delete(f,f+p.nodeSize)}}if(l==null||c==null)return!0;if(o.setNodeMarkup(l+r.tableStart,null,{...hp(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size>0){let d=l+1+c.content.size,u=yp(c)?l+1:d;o.replaceWith(u+r.tableStart,d+r.tableStart,a)}o.setSelection(new U(o.doc.resolve(l+r.tableStart))),e(o)}return!0}function bp(t,e){let n=ht(t.schema);return hC(({node:r})=>n[r.type.spec.tableRole])(t,e)}function hC(t){return(e,n)=>{let r=e.selection,i,o;if(r instanceof U){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,o=r.$anchorCell.pos}else{if(i=Wx(r.$from),!i)return!1;o=We(r.$from)?.pos}if(i==null||o==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let s=i.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});let c=Vt(e),d=e.tr;for(let h=0;h<c.right-c.left;h++)a.push(l?{...s,colwidth:l&&l[h]?[l[h]]:null}:s);let u;for(let h=c.top;h<c.bottom;h++){let p=c.map.positionAt(h,c.left,c.table);h==c.top&&(p+=i.nodeSize);for(let f=c.left,m=0;f<c.right;f++,m++)f==c.left&&h==c.top||d.insert(u=d.mapping.map(p+c.tableStart,1),t({node:i,row:h,col:f}).createAndFill(a[m]))}d.setNodeMarkup(o,t({node:i,row:c.top,col:c.left}),a[0]),r instanceof U&&d.setSelection(new U(d.doc.resolve(r.$anchorCell.pos),u?d.doc.resolve(u):void 0)),n(d)}return!0}}function pC(t,e){return function(n,r){if(!It(n))return!1;let i=Yi(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){let o=n.tr;n.selection instanceof U?n.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&o.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function fC(t){return function(e,n){if(!It(e))return!1;if(n){let r=ht(e.schema),i=Vt(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,a[l].attrs);if(o.steps.length===0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,a[l].attrs);n(o)}return!0}}function wp(t,e,n){let r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){let o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function pr(t,e){return e||={useDeprecatedLogic:!1},e.useDeprecatedLogic?fC(t):function(n,r){if(!It(n))return!1;if(r){let i=ht(n.schema),o=Vt(n),s=n.tr,a=wp("row",o,i),l=wp("column",o,i),c=(t==="column"?a:t==="row"&&l)?1:0,d=t=="column"?{left:0,top:c,right:1,bottom:o.map.height}:t=="row"?{left:c,top:0,right:o.map.width,bottom:1}:o,u=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(d).forEach(h=>{let p=h+o.tableStart,f=s.doc.nodeAt(p);f&&s.setNodeMarkup(p,u,f.attrs)}),r(s)}return!0}}pr("row",{useDeprecatedLogic:!0}),pr("column",{useDeprecatedLogic:!0});var mC=pr("cell",{useDeprecatedLogic:!0});function gC(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){let o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function vp(t){return function(e,n){if(!It(e))return!1;let r=gC(Yi(e),t);if(r==null)return!1;if(n){let i=e.doc.resolve(r);n(e.tr.setSelection(O.between(i,Kx(i))).scrollIntoView())}return!0}}function yC(t,e){let n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function to(t,e){let n=t.selection;if(!(n instanceof U))return!1;if(e){let r=t.tr,i=ht(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new M(i,0,0))}),r.docChanged&&e(r)}return!0}function kC(t){if(t.size===0)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content,d=l?0:Math.max(0,n-1),u=l<e.childCount-1?0:Math.max(0,r-1);(d||u)&&(c=Ma(ht(s).row,new M(c,d,u)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(n||r?Ma(ht(s).row,new M(e,n,r)).content:e);else return null;return bC(s,a)}function bC(t,e){let n=[];for(let i=0;i<e.length;i++){let o=e[i];for(let s=o.childCount-1;s>=0;s--){let{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(x.empty),n[i]<r){let o=ht(t).cell.createAndFill(),s=[];for(let a=n[i];a<r;a++)s.push(o);e[i]=e[i].append(x.from(s))}return{height:e.length,width:r,rows:e}}function Ma(t,e){let n=t.createAndFill();return new Bo(n).replace(0,n.content.size,e).doc}function wC({width:t,height:e,rows:n},r,i){if(t!=r){let o=[],s=[];for(let a=0;a<n.length;a++){let l=n[a],c=[];for(let d=o[a]||0,u=0;d<r;u++){let h=l.child(u%l.childCount);d+h.attrs.colspan>r&&(h=h.type.createChecked(Ue(h.attrs,h.attrs.colspan,d+h.attrs.colspan-r),h.content)),c.push(h),d+=h.attrs.colspan;for(let p=1;p<h.attrs.rowspan;p++)o[a+p]=(o[a+p]||0)+h.attrs.colspan}s.push(x.from(c))}n=s,t=r}if(e!=i){let o=[];for(let s=0,a=0;s<i;s++,a++){let l=[],c=n[a%e];for(let d=0;d<c.childCount;d++){let u=c.child(d);s+u.attrs.rowspan>i&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,i-u.attrs.rowspan)},u.content)),l.push(u)}o.push(x.from(l))}n=o,e=i}return{width:t,height:e,rows:n}}function vC(t,e,n,r,i,o,s){let a=t.doc.type.schema,l=ht(a),c,d;if(i>e.width)for(let u=0,h=0;u<e.height;u++){let p=n.child(u);h+=p.nodeSize;let f=[],m;m=p.lastChild==null||p.lastChild.type==l.cell?c||=l.cell.createAndFill():d||=l.header_cell.createAndFill();for(let g=e.width;g<i;g++)f.push(m);t.insert(t.mapping.slice(s).map(h-1+r),f)}if(o>e.height){let u=[];for(let f=0,m=(e.height-1)*e.width;f<Math.max(e.width,i);f++){let g=f>=e.width?!1:n.nodeAt(e.map[m+f]).type==l.header_cell;u.push(g?d||=l.header_cell.createAndFill():c||=l.cell.createAndFill())}let h=l.row.create(null,x.from(u)),p=[];for(let f=e.height;f<o;f++)p.push(h);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),p)}return!!(c||d)}function xp(t,e,n,r,i,o,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=i;c<o;c++){let d=s*e.width+c,u=e.map[d];if(e.map[d-e.width]==u){l=!0;let h=n.nodeAt(u),{top:p,left:f}=e.findCell(u);t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...h.attrs,rowspan:s-p}),t.insert(t.mapping.slice(a).map(e.positionAt(s,f,n)),h.type.createAndFill({...h.attrs,rowspan:p+h.attrs.rowspan-s})),c+=h.attrs.colspan-1}}return l}function Cp(t,e,n,r,i,o,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=i;c<o;c++){let d=c*e.width+s,u=e.map[d];if(e.map[d-1]==u){l=!0;let h=n.nodeAt(u),p=e.colCount(u),f=t.mapping.slice(a).map(u+r);t.setNodeMarkup(f,null,Ue(h.attrs,s-p,h.attrs.colspan-(s-p))),t.insert(f+h.nodeSize,h.type.createAndFill(Ue(h.attrs,0,s-p))),c+=h.attrs.rowspan-1}}return l}function Sp(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw Error("No table found");let s=Q.get(o),{top:a,left:l}=r,c=l+i.width,d=a+i.height,u=t.tr,h=0;function p(){if(o=n?u.doc.nodeAt(n-1):u.doc,!o)throw Error("No table found");s=Q.get(o),h=u.mapping.maps.length}vC(u,s,o,n,c,d,h)&&p(),xp(u,s,o,n,l,c,a,h)&&p(),xp(u,s,o,n,l,c,d,h)&&p(),Cp(u,s,o,n,a,d,l,h)&&p(),Cp(u,s,o,n,a,d,c,h)&&p();for(let f=a;f<d;f++){let m=s.positionAt(f,l,o),g=s.positionAt(f,c,o);u.replace(u.mapping.slice(h).map(m+n),u.mapping.slice(h).map(g+n),new M(i.rows[f-a],0,0))}p(),u.setSelection(new U(u.doc.resolve(n+s.positionAt(a,l,o)),u.doc.resolve(n+s.positionAt(d-1,c-1,o)))),e(u)}var xC=bs({ArrowLeft:no("horiz",-1),ArrowRight:no("horiz",1),ArrowUp:no("vert",-1),ArrowDown:no("vert",1),"Shift-ArrowLeft":ro("horiz",-1),"Shift-ArrowRight":ro("horiz",1),"Shift-ArrowUp":ro("vert",-1),"Shift-ArrowDown":ro("vert",1),Backspace:to,"Mod-Backspace":to,Delete:to,"Mod-Delete":to});function eo(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function no(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection;if(o instanceof U)return eo(n,r,R.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=Ep(i,t,e);if(s==null)return!1;if(t=="horiz")return eo(n,r,R.near(n.doc.resolve(o.head+e),e));{let a=n.doc.resolve(s),l=up(a,t,e),c;return c=l?R.near(l,1):e<0?R.near(n.doc.resolve(a.before(-1)),-1):R.near(n.doc.resolve(a.after(-1)),1),eo(n,r,c)}}}function ro(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof U)s=o;else{let l=Ep(i,t,e);if(l==null)return!1;s=new U(n.doc.resolve(l))}let a=up(s.$headCell,t,e);return a?eo(n,r,new U(s.$anchorCell,a)):!1}}function CC(t,e){let n=t.state.doc,r=We(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new U(r))),!0):!1}function SC(t,e,n){if(!It(t.state))return!1;let r=kC(n),i=t.state.selection;if(i instanceof U){r||={width:1,height:1,rows:[x.from(Ma(ht(t.state.schema).cell,n))]};let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=Q.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=wC(r,a.right-a.left,a.bottom-a.top),Sp(t.state,t.dispatch,s,a,r),!0}else if(r){let o=Yi(t.state),s=o.start(-1);return Sp(t.state,t.dispatch,s,Q.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function EC(t,e){if(e.button!=0||e.ctrlKey||e.metaKey)return;let n=Mp(t,e.target),r;if(e.shiftKey&&t.state.selection instanceof U)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(r=We(t.state.selection.$anchor))!=null&&Aa(t,e)?.pos!=r.pos)i(r,e),e.preventDefault();else if(!n)return;function i(a,l){let c=Aa(t,l),d=xe.getState(t.state)==null;if(!c||!Ea(a,c))if(d)c=a;else return;let u=new U(a,c);if(d||!t.state.selection.eq(u)){let h=t.state.tr.setSelection(u);d&&h.setMeta(xe,a.pos),t.dispatch(h)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",s),xe.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(xe,-1))}function s(a){let l=a,c=xe.getState(t.state),d;if(c!=null)d=t.state.doc.resolve(c);else if(Mp(t,l.target)!=n&&(d=Aa(t,e),!d))return o();d&&i(d,l)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",s)}function Ep(t,e,n){if(!(t.state.selection instanceof O))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let s=r.before(i),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?s:null}}return null}function Mp(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Aa(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&We(t.state.doc.resolve(r))||We(t.state.doc.resolve(i))}var MC=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Da(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type==this.node.type?(this.node=t,Da(t,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Da(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild,c=t.firstChild;if(c){for(let u=0,h=0;u<c.childCount;u++){let{colspan:p,colwidth:f}=c.child(u).attrs;for(let m=0;m<p;m++,h++){let g=i==h?o:f&&f[m],y=g?g+"px":"";if(s+=g||r,g||(a=!1),l)l.style.width!=y&&(l.style.width=y),l=l.nextSibling;else{let b=document.createElement("col");b.style.width=y,e.appendChild(b)}}}for(;l;){var d;let u=l.nextSibling;(d=l.parentNode)==null||d.removeChild(l),l=u}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var Dt=new J("tableColumnResizing");function AC({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=MC,lastColumnResizable:i=!0}={}){let o=new j({key:Dt,state:{init(s,a){var l;let c=(l=o.spec)==null||(l=l.props)==null?void 0:l.nodeViews,d=ht(a.schema).table.name;return r&&c&&(c[d]=(u,h)=>new r(u,n,h)),new DC(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{let a=Dt.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{TC(s,a,t,i)},mouseleave:s=>{OC(s)},mousedown:(s,a)=>{NC(s,a,e,n)}},decorations:s=>{let a=Dt.getState(s);if(a&&a.activeHandle>-1)return LC(s,a.activeHandle)},nodeViews:{}}});return o}var DC=class So{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(Dt);if(r&&r.setHandle!=null)return new So(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new So(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Sa(e.doc.resolve(i))||(i=-1),new So(i,n.dragging)}return n}};function TC(t,e,n,r){if(!t.editable)return;let i=Dt.getState(t.state);if(i&&!i.dragging){let o=_C(e.target),s=-1;if(o){let{left:a,right:l}=o.getBoundingClientRect();e.clientX-a<=n?s=Ap(t,e,"left",n):l-e.clientX<=n&&(s=Ap(t,e,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){let a=t.state.doc.resolve(s),l=a.node(-1),c=Q.get(l),d=a.start(-1);if(c.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==c.width-1)return}Tp(t,s)}}}function OC(t){if(!t.editable)return;let e=Dt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Tp(t,-1)}function NC(t,e,n,r){if(!t.editable)return!1;let i=t.dom.ownerDocument.defaultView??window,o=Dt.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;let s=t.state.doc.nodeAt(o.activeHandle),a=RC(t,o.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Dt,{setDragging:{startX:e.clientX,startWidth:a}}));function l(d){i.removeEventListener("mouseup",l),i.removeEventListener("mousemove",c);let u=Dt.getState(t.state);u?.dragging&&(zC(t,u.activeHandle,Dp(u.dragging,d,n)),t.dispatch(t.state.tr.setMeta(Dt,{setDragging:null})))}function c(d){if(!d.which)return l(d);let u=Dt.getState(t.state);if(u&&u.dragging){let h=Dp(u.dragging,d,n);Op(t,u.activeHandle,h,r)}}return Op(t,o.activeHandle,a,r),i.addEventListener("mouseup",l),i.addEventListener("mousemove",c),e.preventDefault(),!0}function RC(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),s=o.node.childNodes[o.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(s-=r[l],a--);return s/a}function _C(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function Ap(t,e,n,r){let i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;let{pos:s}=o,a=We(t.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;let l=Q.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function Dp(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Tp(t,e){t.dispatch(t.state.tr.setMeta(Dt,{setHandle:e}))}function zC(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),o=Q.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<o.height;c++){let d=c*o.width+a;if(c&&o.map[d]==o.map[d-o.width])continue;let u=o.map[d],h=i.nodeAt(u).attrs,p=h.colspan==1?0:a-o.colCount(u);if(h.colwidth&&h.colwidth[p]==n)continue;let f=h.colwidth?h.colwidth.slice():$C(h.colspan);f[p]=n,l.setNodeMarkup(s+u,null,{...h,colwidth:f})}l.docChanged&&t.dispatch(l)}function Op(t,e,n,r){let i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=Q.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Da(o,l.firstChild,l,r,a,n)}function $C(t){return Array(t).fill(0)}function LC(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return q.empty;let o=Q.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1;for(let l=0;l<o.height;l++){let c=a+l*o.width;if((a==o.width-1||o.map[c]!=o.map[c+1])&&(l==0||o.map[c]!=o.map[c-o.width])){let d=o.map[c],u=s+d+i.nodeAt(d).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",Dt.getState(t)?.dragging&&n.push(wt.node(s+d,s+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(wt.widget(u,h))}}return q.create(t.doc,n)}function IC({allowTableNodeSelection:t=!1}={}){return new j({key:xe,state:{init(){return null},apply(e,n){let r=e.getMeta(xe);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;let{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:Zx,handleDOMEvents:{mousedown:EC},createSelectionBetween(e){return xe.getState(e.state)==null?null:e.state.selection},handleTripleClick:CC,handleKeyDown:xC,handlePaste:SC},appendTransaction(e,n,r){return Yx(r,fp(r,n),t)}})}function io(t){return t==="left"||t==="right"||t==="center"?t:null}function FC(t){let e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return io(e||n)}function BC(t){return io(t?.align)}function Np(){return{default:null,parseHTML:t=>FC(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function PC(t){let e=t.parentElement,n=t.closest("table");if(!e||!n)return null;let r=Array.from(e.children).indexOf(t),i=n.querySelectorAll("colgroup > col")[r]?.getAttribute("width");return i?[parseInt(i,10)]:null}function Rp(t){let e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):PC(t)}var jC=/[ \t\r\n\f]+/g;function _p(t){return t.children.length>0?!1:(t.textContent??"").replace(jC,"")===""}function zp(t){let e=t.createAndFill();if(!e)throw Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}var $p=I.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:Rp},align:Np()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>_p(t)?{}:!1,getContent:(t,e)=>zp(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",W(this.options.HTMLAttributes,t),0]}}),Lp=I.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:Rp},align:Np()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>_p(t)?{}:!1,getContent:(t,e)=>zp(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",W(this.options.HTMLAttributes,t),0]}}),Ip=I.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",W(this.options.HTMLAttributes,t),0]}});function Ta(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Fp(t,e,n,r,i,o){var s;let a=0,l=!0,c=e.firstChild,d=t.firstChild;if(d!==null)for(let h=0,p=0;h<d.childCount;h+=1){let{colspan:f,colwidth:m}=d.child(h).attrs;for(let g=0;g<f;g+=1,p+=1){let y=i===p?o:m&&m[g],b=y?`${y}px`:"";if(a+=y||r,y||(l=!1),c){if(c.style.width!==b){let[w,k]=Ta(r,y);c.style.setProperty(w,k)}c=c.nextSibling}else{let w=document.createElement("col"),[k,v]=Ta(r,y);w.style.setProperty(k,v),e.appendChild(w)}}}for(;c;){let h=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=h}let u=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!u?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var HC=class{constructor(t,e,n,r={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(let[i,o]of Object.entries(r))o!=null&&(i==="style"?this.table.style.cssText=String(o):this.table.setAttribute(i,String(o)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Fp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type===this.node.type?(this.node=t,Fp(t,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(t){let e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function qC(t,e,n,r){let i=0,o=!0,s=[],a=t.firstChild;if(!a)return{};for(let d=0,u=0;d<a.childCount;d+=1){let{colspan:h,colwidth:p}=a.child(d).attrs;for(let f=0;f<h;f+=1,u+=1){let m=n===u?r:p&&p[f];i+=m||e,m||(o=!1);let[g,y]=Ta(e,m);s.push(["col",{style:`${g}: ${y}`}])}}let l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function Bp(t,e){return e?t.createChecked(null,e):t.createAndFill()}function VC(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function WC(t,e,n,r,i){let o=VC(t),s=[],a=[];for(let c=0;c<n;c+=1){let d=Bp(o.cell,i);if(d&&a.push(d),r){let u=Bp(o.header_cell,i);u&&s.push(u)}}let l=[];for(let c=0;c<e;c+=1)l.push(o.row.createChecked(null,r&&c===0?s:a));return o.table.createChecked(null,l)}function UC(t){return t instanceof U}var oo=({editor:t})=>{let{selection:e}=t.state;if(!UC(e))return!1;let n=0;return Jn(e.ranges[0].$from,r=>r.type.name==="table")?.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1};function Pp(t,e){let n=t.mapping.map(e);if(Jn(t.selection.$from,o=>o.type.name==="table")?.pos===n)return;let r=t.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;t.setSelection(O.near(t.doc.resolve(i),-1))}function KC(t){let e="",n=0;for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}if(t[n]!=="`"){e+=t[n++];continue}let r=0;for(;n+r<t.length&&t[n+r]==="`";)r+=1;let i=n+r,o=!1;for(;i<t.length;){if(t[i]!=="`"){i+=1;continue}let s=0;for(;i+s<t.length&&t[i+s]==="`";)s+=1;if(s===r){let a=t.slice(n+r,i);e+=t.slice(n,n+r)+a.replace(/\\\||\|/g,l=>l==="|"?"\\|":l)+t.slice(i,i+r),n=i+r,o=!0;break}i+=s}o||(e+=t.slice(n,n+r),n+=r)}return e}function JC(t){return t.split(`
145
+ `).map(e=>!e.includes("|")||!e.includes("`")?e:KC(e)).join(`
146
+ `)}function GC(t){return(t||"").replace(/\s+/g," ").trim()}function ZC(t,e,n={}){let r=n.cellLineSeparator??"";if(!t||!t.content||t.content.length===0)return"";let i=[];t.content.forEach(p=>{let f=[];p.content&&p.content.forEach(m=>{let g="";g=m.content&&Array.isArray(m.content)&&m.content.length>1?m.content.map(k=>e.renderChildren(k)).join(r):m.content?e.renderChildren(m.content):"";let y=GC(g.split(r).join(`
147
+ `).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),b=m.type==="tableHeader",w=BC(m.attrs);f.push({text:y,isHeader:b,align:w})}),i.push(f)});let o=i.reduce((p,f)=>Math.max(p,f.length),0);if(o===0)return"";let s=Array.from({length:o}).fill(0);i.forEach(p=>{for(let f=0;f<o;f+=1){let m=(p[f]?.text||"").length;m>s[f]&&(s[f]=m),s[f]<3&&(s[f]=3)}});let a=(p,f)=>p+" ".repeat(Math.max(0,f-p.length)),l=i[0],c=l.some(p=>p.isHeader),d=Array.from({length:o}).fill(null);i.forEach(p=>{for(let f=0;f<o;f+=1)!d[f]&&p[f]?.align&&(d[f]=p[f].align)});let u=`
148
+ `,h=Array.from({length:o}).map((p,f)=>c&&l[f]&&l[f].text||"");return u+=`| ${h.map((p,f)=>a(p,s[f])).join(" | ")} |
149
+ `,u+=`| ${s.map((p,f)=>{let m=Math.max(3,p),g=d[f];return g==="left"?`:${"-".repeat(m)}`:g==="right"?`${"-".repeat(m)}:`:g==="center"?`:${"-".repeat(m)}:`:"-".repeat(m)}).join(" | ")} |
150
+ `,(c?i.slice(1):i).forEach(p=>{u+=`| ${Array.from({length:o}).fill(0).map((f,m)=>a(p[m]&&p[m].text||"",s[m])).join(" | ")} |
151
+ `}),u}var XC=ZC,jp=I.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:HC,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=qC(t,this.options.cellMinWidth),o=e.style;function s(){return o||(r?`width: ${r}`:`min-width: ${i}`)}let a=["table",W(this.options.HTMLAttributes,e,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},parseMarkdown:(t,e)=>{let n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){let i=[];t.header.forEach((o,s)=>{let a=io(r[s]??o.align),l=a?{align:a}:{};i.push(e.createNode("tableHeader",l,[{type:"paragraph",content:e.parseInline(o.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}return t.rows&&t.rows.forEach(i=>{let o=[];i.forEach((s,a)=>{let l=io(r[a]??s.align),c=l?{align:l}:{};o.push(e.createNode("tableCell",c,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode("tableRow",{},o))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>XC(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{let e=t.split(`
152
+ `);if(e.length<2)return-1;let n=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,n){let r=t.indexOf(`
153
+
154
+ `),i=r>=0?t.slice(0,r):t,o=i.split(`
155
+ `);if(o.length<2)return;let s=o[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;let a=JC(i);if(a===i)return;let l=n.blockTokens(a)[0];if(l?.type!=="table"||!l.raw)return;let c=l.raw.split(`
156
+ `).length,d=t.split(`
157
+ `).slice(0,c).join(`
158
+ `);return{...l,raw:d}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=WC(o.schema,t,e,n);if(i){let a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(O.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>nC(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>rC(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{let n=Jn(t.selection.$from,r=>r.type.name==="table");return oC(t,e&&(r=>{n&&Pp(r,n.pos),e(r)}))},addRowBefore:()=>({state:t,dispatch:e})=>aC(t,e),addRowAfter:()=>({state:t,dispatch:e})=>lC(t,e),deleteRow:()=>({state:t,dispatch:e})=>{let n=Jn(t.selection.$from,r=>r.type.name==="table");return dC(t,e&&(r=>{n&&Pp(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>yC(t,e),mergeCells:()=>({state:t,dispatch:e})=>kp(t,e),splitCell:()=>({state:t,dispatch:e})=>bp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>pr("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>pr("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>mC(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>kp(t,e)?!0:bp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>pC(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>vp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>vp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&fp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=U.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:oo,"Mod-Backspace":oo,Delete:oo,"Mod-Delete":oo}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[AC({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],IC({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:i})=>{let o=W(this.options.HTMLAttributes,i);return new e(n,this.options.cellMinWidth,r,o)}},extendNodeSchema(t){return{tableRole:F(D(t,"tableRole",{name:t.name,options:t.options,storage:t.storage}))}}});V.create({name:"tableKit",addExtensions(){let t=[];return this.options.table!==!1&&t.push(jp.configure(this.options.table)),this.options.tableCell!==!1&&t.push($p.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(Lp.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(Ip.configure(this.options.tableRow)),t}});var QC=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,YC=I.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",W(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{let e=t.attrs?.src??"",n=t.attrs?.alt??"",r=t.attrs?.title??"";return r?`![${n}](${e} "${r}")`:`![${n}](${e})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;let{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set(["src","width","height"]);return({node:o,getPos:s,HTMLAttributes:a,editor:l})=>{let c=document.createElement("img");c.draggable=!1;let d=W(this.options.HTMLAttributes,a);Object.entries(d).forEach(([m,g])=>{if(g!=null)switch(m){case"src":case"width":case"height":break;default:c.setAttribute(m,g);break}}),d.src!==null&&(c.src=d.src);let u={...a},h=m=>{if(typeof m=="string"&&m!==""){c.getAttribute("src")!==m&&(c.src=m);return}c.hasAttribute("src")&&c.removeAttribute("src"),c.src!==""&&(c.src="")};h(a.src);let p=new vb({element:c,editor:l,node:o,getPos:s,onResize:(m,g)=>{c.style.width=`${m}px`,c.style.height=`${g}px`},onCommit:(m,g)=>{let y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:m,height:g}).run()},onUpdate:m=>{if(m.type!==o.type)return!1;let g=un(m,l.extensionManager.attributes.filter(y=>y.type===m.type.name));return Object.keys(u).forEach(y=>{!i.has(y)&&!(y in g)&&c.removeAttribute(y)}),Object.entries(g).forEach(([y,b])=>{i.has(y)||(b==null?c.removeAttribute(y):c.setAttribute(y,b))}),h(g.src),u=g,!0},options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),f=p.dom;return f.style.visibility="hidden",f.style.pointerEvents="none",c.onload=()=>{f.style.visibility="",f.style.pointerEvents=""},p}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Yu({find:QC,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Hp={};function tS(t){let e=Hp[t];if(e)return e;e=Hp[t]=[];for(let n=0;n<128;n++){let r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function kn(t,e){typeof e!="string"&&(e=kn.defaultChars);let n=tS(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,s=r.length;o<s;o+=3){let a=parseInt(r.slice(o+1,o+3),16);if(a<128){i+=n[a];continue}if((a&224)==192&&o+3<s){let l=parseInt(r.slice(o+4,o+6),16);if((l&192)==128){let c=a<<6&1984|l&63;c<128?i+="\uFFFD\uFFFD":i+=String.fromCharCode(c),o+=3;continue}}if((a&240)==224&&o+6<s){let l=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16);if((l&192)==128&&(c&192)==128){let d=a<<12&61440|l<<6&4032|c&63;d<2048||d>=55296&&d<=57343?i+="\uFFFD\uFFFD\uFFFD":i+=String.fromCharCode(d),o+=6;continue}}if((a&248)==240&&o+9<s){let l=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16),d=parseInt(r.slice(o+10,o+12),16);if((l&192)==128&&(c&192)==128&&(d&192)==128){let u=a<<18&1835008|l<<12&258048|c<<6&4032|d&63;u<65536||u>1114111?i+="\uFFFD\uFFFD\uFFFD\uFFFD":(u-=65536,i+=String.fromCharCode(55296+(u>>10),56320+(u&1023))),o+=9;continue}}i+="\uFFFD"}return i})}kn.defaultChars=";/?:@&=+$,#",kn.componentChars="";var qp={};function eS(t){let e=qp[t];if(e)return e;e=qp[t]=[];for(let n=0;n<128;n++){let r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function fr(t,e,n){typeof e!="string"&&(n=e,e=fr.defaultChars),n===void 0&&(n=!0);let r=eS(e),i="";for(let o=0,s=t.length;o<s;o++){let a=t.charCodeAt(o);if(n&&a===37&&o+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(o+1,o+3))){i+=t.slice(o,o+3),o+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1<s){let l=t.charCodeAt(o+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}fr.defaultChars=";/?:@&=+$,-_.!~*'()#",fr.componentChars="-_.!~*'()";function Oa(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function so(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var nS=/^([a-z0-9.+-]+:)/i,rS=/:[0-9]*$/,iS=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Vp=["%","/","?",";","#","'","{","}","|","\\","^","`","<",">",'"',"`"," ","\r",`
159
+ `," "],Wp=["/","?","#"],oS=255,Up=/^[+a-z0-9A-Z_-]{0,63}$/,sS=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Kp={javascript:!0,"javascript:":!0},Jp={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Na(t,e){if(t&&t instanceof so)return t;let n=new so;return n.parse(t,e),n}so.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){let c=iS.exec(o);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=nS.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&Kp[s])&&(o=o.substr(2),this.slashes=!0)),!Kp[s]&&(i||s&&!Jp[s])){let c=-1;for(let f=0;f<Wp.length;f++)r=o.indexOf(Wp[f]),r!==-1&&(c===-1||r<c)&&(c=r);let d,u;u=c===-1?o.lastIndexOf("@"):o.lastIndexOf("@",c),u!==-1&&(d=o.slice(0,u),o=o.slice(u+1),this.auth=d),c=-1;for(let f=0;f<Vp.length;f++)r=o.indexOf(Vp[f]),r!==-1&&(c===-1||r<c)&&(c=r);c===-1&&(c=o.length),o[c-1]===":"&&c--;let h=o.slice(0,c);o=o.slice(c),this.parseHost(h),this.hostname=this.hostname||"";let p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){let f=this.hostname.split(/\./);for(let m=0,g=f.length;m<g;m++){let y=f[m];if(y&&!y.match(Up)){let b="";for(let w=0,k=y.length;w<k;w++)y.charCodeAt(w)>127?b+="x":b+=y[w];if(!b.match(Up)){let w=f.slice(0,m),k=f.slice(m+1),v=y.match(sS);v&&(w.push(v[1]),k.unshift(v[2])),k.length&&(o=k.join(".")+o),this.hostname=w.join(".");break}}}}this.hostname.length>oS&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));let l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),Jp[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},so.prototype.parseHost=function(t){let e=rS.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var aS=_r({decode:()=>kn,encode:()=>fr,format:()=>Oa,parse:()=>Na}),Gp=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Zp=/[\0-\x1F\x7F-\x9F]/,lS=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Ra=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Xp=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Qp=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,cS=_r({Any:()=>Gp,Cc:()=>Zp,Cf:()=>lS,P:()=>Ra,S:()=>Xp,Z:()=>Qp}),dS=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0))),uS=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0))),hS=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]]),pS=String.fromCodePoint??function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function fS(t){return t>=55296&&t<=57343||t>1114111?65533:hS.get(t)??t}var ot;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(ot||={});var mS=32,Ke;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ke||={});function _a(t){return t>=ot.ZERO&&t<=ot.NINE}function gS(t){return t>=ot.UPPER_A&&t<=ot.UPPER_F||t>=ot.LOWER_A&&t<=ot.LOWER_F}function yS(t){return t>=ot.UPPER_A&&t<=ot.UPPER_Z||t>=ot.LOWER_A&&t<=ot.LOWER_Z||_a(t)}function kS(t){return t===ot.EQUALS||yS(t)}var st;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(st||={});var Ce;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Ce||={});var bS=class{constructor(t,e,n){this.decodeTree=t,this.emitCodePoint=e,this.errors=n,this.state=st.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ce.Strict}startEntity(t){this.decodeMode=t,this.state=st.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,e){switch(this.state){case st.EntityStart:return t.charCodeAt(e)===ot.NUM?(this.state=st.NumericStart,this.consumed+=1,this.stateNumericStart(t,e+1)):(this.state=st.NamedEntity,this.stateNamedEntity(t,e));case st.NumericStart:return this.stateNumericStart(t,e);case st.NumericDecimal:return this.stateNumericDecimal(t,e);case st.NumericHex:return this.stateNumericHex(t,e);case st.NamedEntity:return this.stateNamedEntity(t,e)}}stateNumericStart(t,e){return e>=t.length?-1:(t.charCodeAt(e)|mS)===ot.LOWER_X?(this.state=st.NumericHex,this.consumed+=1,this.stateNumericHex(t,e+1)):(this.state=st.NumericDecimal,this.stateNumericDecimal(t,e))}addToNumericResult(t,e,n,r){if(e!==n){let i=n-e;this.result=this.result*r**+i+parseInt(t.substr(e,i),r),this.consumed+=i}}stateNumericHex(t,e){let n=e;for(;e<t.length;){let r=t.charCodeAt(e);if(_a(r)||gS(r))e+=1;else return this.addToNumericResult(t,n,e,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,n,e,16),-1}stateNumericDecimal(t,e){let n=e;for(;e<t.length;){let r=t.charCodeAt(e);if(_a(r))e+=1;else return this.addToNumericResult(t,n,e,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,n,e,10),-1}emitNumericEntity(t,e){var n;if(this.consumed<=e)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ot.SEMI)this.consumed+=1;else if(this.decodeMode===Ce.Strict)return 0;return this.emitCodePoint(fS(this.result),this.consumed),this.errors&&(t!==ot.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,e){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Ke.VALUE_LENGTH)>>14;for(;e<t.length;e++,this.excess++){let o=t.charCodeAt(e);if(this.treeIndex=wS(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===Ce.Attribute&&(i===0||kS(o))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Ke.VALUE_LENGTH)>>14,i!==0){if(o===ot.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ce.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;let{result:e,decodeTree:n}=this,r=(n[e]&Ke.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,r,this.consumed),(t=this.errors)==null||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,e,n){let{decodeTree:r}=this;return this.emitCodePoint(e===1?r[t]&~Ke.VALUE_LENGTH:r[t+1],n),e===3&&this.emitCodePoint(r[t+2],n),n}end(){var t;switch(this.state){case st.NamedEntity:return this.result!==0&&(this.decodeMode!==Ce.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case st.NumericDecimal:return this.emitNumericEntity(0,2);case st.NumericHex:return this.emitNumericEntity(0,3);case st.NumericStart:return(t=this.errors)==null||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case st.EntityStart:return 0}}};function Yp(t){let e="",n=new bS(t,r=>e+=pS(r));return function(r,i){let o=0,s=0;for(;(s=r.indexOf("&",s))>=0;){e+=r.slice(o,s),n.startEntity(i);let l=n.write(r,s+1);if(l<0){o=s+n.end();break}o=s+l,s=l===0?o+1:o}let a=e+r.slice(o);return e="",a}}function wS(t,e,n,r){let i=(e&Ke.BRANCH_LENGTH)>>7,o=e&Ke.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){let l=r-o;return l<0||l>=i?-1:t[n+l]-1}let s=n,a=s+i-1;for(;s<=a;){let l=s+a>>>1,c=t[l];if(c<r)s=l+1;else if(c>r)a=l-1;else return t[l+i]}return-1}var tf=Yp(dS);Yp(uS);function vS(t,e=Ce.Legacy){return tf(t,e)}function xS(t){return tf(t,Ce.Strict)}var CS=_r({arrayReplaceAt:()=>ef,asciiTrim:()=>co,assign:()=>ao,escapeHtml:()=>Je,escapeRE:()=>LS,fromCodePoint:()=>mr,has:()=>MS,isMdAsciiPunct:()=>kr,isPunctChar:()=>rf,isPunctCharCode:()=>yr,isSpace:()=>K,isString:()=>za,isValidEntityCode:()=>$a,isWhiteSpace:()=>gr,lib:()=>IS,normalizeReference:()=>lo,unescapeAll:()=>bn,unescapeMd:()=>OS});function SS(t){return Object.prototype.toString.call(t)}function za(t){return SS(t)==="[object String]"}var ES=Object.prototype.hasOwnProperty;function MS(t,e){return ES.call(t,e)}function ao(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){if(e){if(typeof e!="object")throw TypeError(e+"must be object");Object.keys(e).forEach(function(n){t[n]=e[n]})}}),t}function ef(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function $a(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)==65535||(t&65535)==65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function mr(t){if(t>65535){t-=65536;let e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var nf=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,AS=RegExp(nf.source+"|&([a-z#][a-z0-9]{1,31});","gi"),DS=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function TS(t,e){if(e.charCodeAt(0)===35&&DS.test(e)){let r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return $a(r)?mr(r):t}let n=vS(t);return n===t?t:n}function OS(t){return t.indexOf("\\")<0?t:t.replace(nf,"$1")}function bn(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(AS,function(e,n,r){return n||TS(e,r)})}var NS=/[&<>"]/,RS=/[&<>"]/g,_S={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function zS(t){return _S[t]}function Je(t){return NS.test(t)?t.replace(RS,zS):t}var $S=/[.?*+^$[\]\\(){}|-]/g;function LS(t){return t.replace($S,"\\$&")}function K(t){switch(t){case 9:case 32:return!0}return!1}function gr(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function rf(t){return Ra.test(t)||Xp.test(t)}function yr(t){return rf(mr(t))}function kr(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function lo(t){return t=t.trim().replace(/\s+/g," "),t.toLowerCase().toUpperCase()}function of(t){return t===32||t===9||t===10||t===13}function co(t){let e=0;for(;e<t.length&&of(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&of(t.charCodeAt(n));n--);return t.slice(e,n+1)}var IS={mdurl:aS,ucmicro:cS};function FS(t,e,n){let r,i,o,s,a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<a;){if(o=t.src.charCodeAt(t.pos),o===93&&(r--,r===0)){i=!0;break}if(s=t.pos,t.md.inline.skipToken(t),o===91){if(s===t.pos-1)r++;else if(n)return t.pos=l,-1}}let c=-1;return i&&(c=t.pos),t.pos=l,c}function BS(t,e,n){let r,i=e,o={ok:!1,pos:0,str:""};if(t.charCodeAt(i)===60){for(i++;i<n;){if(r=t.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=bn(t.slice(e+1,i)),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let s=0;for(;i<n&&(r=t.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(t.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(s++,s>32))return o;if(r===41){if(s===0)break;s--}i++}return e===i||s!==0||(o.str=bn(t.slice(e,i)),o.pos=i,o.ok=!0),o}function PS(t,e,n,r){let i,o=e,s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let a=t.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;e++,o++,a===40&&(a=41),s.marker=a}for(;o<n;){if(i=t.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=bn(t.slice(e,o)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=bn(t.slice(e,o)),s}var jS=_r({parseLinkDestination:()=>BS,parseLinkLabel:()=>FS,parseLinkTitle:()=>PS}),Wt={};Wt.code_inline=function(t,e,n,r,i){let o=t[e];return"<code"+i.renderAttrs(o)+">"+Je(o.content)+"</code>"},Wt.code_block=function(t,e,n,r,i){let o=t[e];return"<pre"+i.renderAttrs(o)+"><code>"+Je(t[e].content)+`</code></pre>
160
+ `},Wt.fence=function(t,e,n,r,i){let o=t[e],s=o.info?bn(o.info).trim():"",a="",l="";if(s){let d=s.split(/(\s+)/g);a=d[0],l=d.slice(2).join("")}let c;if(c=n.highlight&&n.highlight(o.content,a,l)||Je(o.content),c.indexOf("<pre")===0)return c+`
161
+ `;if(s){let d=o.attrIndex("class"),u=o.attrs?o.attrs.slice():[];d<0?u.push(["class",n.langPrefix+a]):(u[d]=u[d].slice(),u[d][1]+=" "+n.langPrefix+a);let h={attrs:u};return`<pre><code${i.renderAttrs(h)}>${c}</code></pre>
162
+ `}return`<pre><code${i.renderAttrs(o)}>${c}</code></pre>
163
+ `},Wt.image=function(t,e,n,r,i){let o=t[e];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(t,e,n)},Wt.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
164
+ `:`<br>
165
+ `},Wt.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
166
+ `:`<br>
167
+ `:`
168
+ `},Wt.text=function(t,e){return Je(t[e].content)},Wt.html_block=function(t,e){return t[e].content},Wt.html_inline=function(t,e){return t[e].content};function wn(){this.rules=ao({},Wt)}wn.prototype.renderAttrs=function(t){let e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e<n;e++)r+=" "+Je(t.attrs[e][0])+'="'+Je(t.attrs[e][1])+'"';return r},wn.prototype.renderToken=function(t,e,n){let r=t[e],i="";if(r.hidden)return"";r.block&&r.nesting!==-1&&e&&t[e-1].hidden&&(i+=`
169
+ `),i+=(r.nesting===-1?"</":"<")+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=" /");let o=!1;if(r.block&&(o=!0,r.nesting===1&&e+1<t.length)){let s=t[e+1];(s.type==="inline"||s.hidden||s.nesting===-1&&s.tag===r.tag)&&(o=!1)}return i+=o?`>
170
+ `:">",i},wn.prototype.renderInline=function(t,e,n){let r="",i=this.rules;for(let o=0,s=t.length;o<s;o++){let a=t[o].type;i[a]===void 0?r+=this.renderToken(t,o,e):r+=i[a](t,o,e,n,this)}return r},wn.prototype.renderInlineAsText=function(t,e,n){let r="";for(let i=0,o=t.length;i<o;i++)switch(t[i].type){case"text":r+=t[i].content;break;case"image":r+=this.renderInlineAsText(t[i].children,e,n);break;case"html_inline":case"html_block":r+=t[i].content;break;case"softbreak":case"hardbreak":r+=`
171
+ `;break;default:}return r},wn.prototype.render=function(t,e,n){let r="",i=this.rules;for(let o=0,s=t.length;o<s;o++){let a=t[o].type;a==="inline"?r+=this.renderInline(t[o].children,e,n):i[a]===void 0?r+=this.renderToken(t,o,e,n):r+=i[a](t,o,e,n,this)}return r};function Ct(){this.__rules__=[],this.__cache__=null}Ct.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},Ct.prototype.__compile__=function(){let t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})},Ct.prototype.at=function(t,e,n){let r=this.__find__(t),i=n||{};if(r===-1)throw Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null},Ct.prototype.before=function(t,e,n,r){let i=this.__find__(t),o=r||{};if(i===-1)throw Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Ct.prototype.after=function(t,e,n,r){let i=this.__find__(t),o=r||{};if(i===-1)throw Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Ct.prototype.push=function(t,e,n){let r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null},Ct.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);let n=[];return t.forEach(function(r){let i=this.__find__(r);if(i<0){if(e)return;throw Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n},Ct.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)},Ct.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);let n=[];return t.forEach(function(r){let i=this.__find__(r);if(i<0){if(e)return;throw Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n},Ct.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function Ft(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ft.prototype.attrIndex=function(t){if(!this.attrs)return-1;let e=this.attrs;for(let n=0,r=e.length;n<r;n++)if(e[n][0]===t)return n;return-1},Ft.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},Ft.prototype.attrSet=function(t,e){let n=this.attrIndex(t),r=[t,e];n<0?this.attrPush(r):this.attrs[n]=r},Ft.prototype.attrGet=function(t){let e=this.attrIndex(t),n=null;return e>=0&&(n=this.attrs[e][1]),n},Ft.prototype.attrJoin=function(t,e){let n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e};function sf(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}sf.prototype.Token=Ft;var HS=/\r\n?|\n/g,qS=/\0/g;function VS(t){let e;e=t.src.replace(HS,`
172
+ `),e=e.replace(qS,"\uFFFD"),t.src=e}function WS(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function US(t){let e=t.tokens;for(let n=0,r=e.length;n<r;n++){let i=e[n];i.type==="inline"&&t.md.inline.parse(i.content,t.md,t.env,i.children)}}function KS(t){return/^<a[>\s]/i.test(t)}function JS(t){return/^<\/a\s*>/i.test(t)}function GS(t){let e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let i=e[n].children,o=0;for(let s=i.length-1;s>=0;s--){let a=i[s];if(a.type==="link_close"){for(s--;i[s].level!==a.level&&i[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(KS(a.content)&&o>0&&o--,JS(a.content)&&o++),!(o>0)&&a.type==="text"&&t.md.linkify.test(a.content)){let l=a.content,c=t.md.linkify.match(l),d=[],u=a.level,h=0;c.length>0&&c[0].index===0&&s>0&&i[s-1].type==="text_special"&&(c=c.slice(1));for(let p=0;p<c.length;p++){let f=c[p].url,m=t.md.normalizeLink(f);if(!t.md.validateLink(m))continue;let g=c[p].text;g=c[p].schema?c[p].schema==="mailto:"&&!/^mailto:/i.test(g)?t.md.normalizeLinkText("mailto:"+g).replace(/^mailto:/,""):t.md.normalizeLinkText(g):t.md.normalizeLinkText("http://"+g).replace(/^http:\/\//,"");let y=c[p].index;if(y>h){let v=new t.Token("text","",0);v.content=l.slice(h,y),v.level=u,d.push(v)}let b=new t.Token("link_open","a",1);b.attrs=[["href",m]],b.level=u++,b.markup="linkify",b.info="auto",d.push(b);let w=new t.Token("text","",0);w.content=g,w.level=u,d.push(w);let k=new t.Token("link_close","a",-1);k.level=--u,k.markup="linkify",k.info="auto",d.push(k),h=c[p].lastIndex}if(h<l.length){let p=new t.Token("text","",0);p.content=l.slice(h),p.level=u,d.push(p)}e[n].children=i=ef(i,s,d)}}}}var af=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ZS=/\((c|tm|r)\)/i,XS=/\((c|tm|r)\)/gi,QS={c:"\xA9",r:"\xAE",tm:"\u2122"};function YS(t,e){return QS[e.toLowerCase()]}function tE(t){let e=0;for(let n=t.length-1;n>=0;n--){let r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(XS,YS)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function eE(t){let e=0;for(let n=t.length-1;n>=0;n--){let r=t[n];r.type==="text"&&!e&&af.test(r.content)&&(r.content=r.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1\u2014").replace(/(^|\s)--(?=\s|$)/gm,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1\u2013")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function nE(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(ZS.test(t.tokens[e].content)&&tE(t.tokens[e].children),af.test(t.tokens[e].content)&&eE(t.tokens[e].children))}var rE=/['"]/,lf=/['"]/g,cf="\u2019";function uo(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function iE(t,e){let n="",r=0;e.sort((i,o)=>i.pos-o.pos);for(let i=0;i<e.length;i++){let o=e[i];n+=t.slice(r,o.pos)+o.ch,r=o.pos+1}return n+t.slice(r)}function oE(t,e){let n,r=[],i={};for(let o=0;o<t.length;o++){let s=t[o],a=t[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,s.type!=="text")continue;let l=s.content,c=0,d=l.length;t:for(;c<d;){lf.lastIndex=c;let u=lf.exec(l);if(!u)break;let h=!0,p=!0;c=u.index+1;let f=u[0]==="'",m=32;if(u.index-1>=0)m=l.charCodeAt(u.index-1);else for(n=o-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){m=t[n].content.charCodeAt(t[n].content.length-1);break}let g=32;if(c<d)g=l.charCodeAt(c);else for(n=o+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){g=t[n].content.charCodeAt(0);break}let y=kr(m)||yr(m),b=kr(g)||yr(g),w=gr(m),k=gr(g);if(k?h=!1:b&&(w||y||(h=!1)),w?p=!1:y&&(k||b||(p=!1)),g===34&&u[0]==='"'&&m>=48&&m<=57&&(p=h=!1),h&&p&&(h=y,p=b),!h&&!p){f&&uo(i,o,u.index,cf);continue}if(p)for(n=r.length-1;n>=0;n--){let v=r[n];if(r[n].level<a)break;if(v.single===f&&r[n].level===a){v=r[n];let E,S;f?(E=e.md.options.quotes[2],S=e.md.options.quotes[3]):(E=e.md.options.quotes[0],S=e.md.options.quotes[1]),uo(i,o,u.index,S),uo(i,v.token,v.pos,E),r.length=n;continue t}}h?r.push({token:o,pos:u.index,single:f,level:a}):p&&f&&uo(i,o,u.index,cf)}}Object.keys(i).forEach(function(o){t[o].content=iE(t[o].content,i[o])})}function sE(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!rE.test(t.tokens[e].content)||oE(t.tokens[e].children,t)}function aE(t){let e,n,r=t.tokens,i=r.length;for(let o=0;o<i;o++){if(r[o].type!=="inline")continue;let s=r[o].children,a=s.length;for(e=0;e<a;e++)s[e].type==="text_special"&&(s[e].type="text");for(e=n=0;e<a;e++)s[e].type==="text"&&e+1<a&&s[e+1].type==="text"?s[e+1].content=s[e].content+s[e+1].content:(e!==n&&(s[n]=s[e]),n++);e!==n&&(s.length=n)}}var La=[["normalize",VS],["block",WS],["inline",US],["linkify",GS],["replacements",nE],["smartquotes",sE],["text_join",aE]];function Ia(){this.ruler=new Ct;for(let t=0;t<La.length;t++)this.ruler.push(La[t][0],La[t][1])}Ia.prototype.process=function(t){let e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)},Ia.prototype.State=sf;function Ut(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;let i=this.src;for(let o=0,s=0,a=0,l=0,c=i.length,d=!1;s<c;s++){let u=i.charCodeAt(s);if(!d)if(K(u)){a++,u===9?l+=4-l%4:l++;continue}else d=!0;(u===10||s===c-1)&&(u!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),d=!1,a=0,l=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ut.prototype.push=function(t,e,n){let r=new Ft(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Ut.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},Ut.prototype.skipEmptyLines=function(t){for(let e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},Ut.prototype.skipSpaces=function(t){for(let e=this.src.length;t<e&&K(this.src.charCodeAt(t));t++);return t},Ut.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!K(this.src.charCodeAt(--t)))return t+1;return t},Ut.prototype.skipChars=function(t,e){for(let n=this.src.length;t<n&&this.src.charCodeAt(t)===e;t++);return t},Ut.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;for(;t>n;)if(e!==this.src.charCodeAt(--t))return t+1;return t},Ut.prototype.getLines=function(t,e,n,r){if(t>=e)return"";let i=Array(e-t);for(let o=0,s=t;s<e;s++,o++){let a=0,l=this.bMarks[s],c=l,d;for(d=s+1<e||r?this.eMarks[s]+1:this.eMarks[s];c<d&&a<n;){let u=this.src.charCodeAt(c);if(K(u))u===9?a+=4-(a+this.bsCount[s])%4:a++;else if(c-l<this.tShift[s])a++;else break;c++}a>n?i[o]=Array(a-n+1).join(" ")+this.src.slice(c,d):i[o]=this.src.slice(c,d)}return i.join("")},Ut.prototype.Token=Ft;var lE=65536;function Fa(t,e){let n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function df(t){let e=[],n=t.length,r=0,i=t.charCodeAt(r),o=!1,s=0,a="";for(;r<n;)i===124&&(o?(a+=t.substring(s,r-1),s=r):(e.push(a+t.substring(s,r)),a="",s=r+1)),o=i===92,r++,i=t.charCodeAt(r);return e.push(a+t.substring(s)),e}function cE(t,e,n,r){if(e+2>n)return!1;let i=e+1;if(t.sCount[i]<t.blkIndent||t.sCount[i]-t.blkIndent>=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;let s=t.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=t.eMarks[i])return!1;let a=t.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!K(a)||s===45&&K(a))return!1;for(;o<t.eMarks[i];){let k=t.src.charCodeAt(o);if(k!==124&&k!==45&&k!==58&&!K(k))return!1;o++}let l=Fa(t,e+1),c=l.split("|"),d=[];for(let k=0;k<c.length;k++){let v=c[k].trim();if(!v){if(k===0||k===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(v))return!1;v.charCodeAt(v.length-1)===58?d.push(v.charCodeAt(0)===58?"center":"right"):v.charCodeAt(0)===58?d.push("left"):d.push("")}if(l=Fa(t,e).trim(),l.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;c=df(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();let u=c.length;if(u===0||u!==d.length)return!1;if(r)return!0;let h=t.parentType;t.parentType="table";let p=t.md.block.ruler.getRules("blockquote"),f=t.push("table_open","table",1),m=[e,0];f.map=m;let g=t.push("thead_open","thead",1);g.map=[e,e+1];let y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let k=0;k<c.length;k++){let v=t.push("th_open","th",1);d[k]&&(v.attrs=[["style","text-align:"+d[k]]]);let E=t.push("inline","",0);E.content=c[k].trim(),E.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let b,w=0;for(i=e+2;i<n&&!(t.sCount[i]<t.blkIndent);i++){let k=!1;for(let E=0,S=p.length;E<S;E++)if(p[E](t,i,n,!0)){k=!0;break}if(k||(l=Fa(t,i).trim(),!l)||t.sCount[i]-t.blkIndent>=4||(c=df(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),w+=u-c.length,w>lE))break;if(i===e+2){let E=t.push("tbody_open","tbody",1);E.map=b=[e+2,0]}let v=t.push("tr_open","tr",1);v.map=[i,i+1];for(let E=0;E<u;E++){let S=t.push("td_open","td",1);d[E]&&(S.attrs=[["style","text-align:"+d[E]]]);let A=t.push("inline","",0);A.content=c[E]?c[E].trim():"",A.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return b&&(t.push("tbody_close","tbody",-1),b[1]=i),t.push("table_close","table",-1),m[1]=i,t.parentType=h,t.line=i,!0}function dE(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,i=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,i=r;continue}break}t.line=i;let o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+`
173
+ `,o.map=[e,t.line],!0}function uE(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>o)return!1;let s=t.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=t.skipChars(i,s);let l=i-a;if(l<3)return!1;let c=t.src.slice(a,i),d=t.src.slice(i,o);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let u=e,h=!1;for(;u++,!(u>=n||(i=a=t.bMarks[u]+t.tShift[u],o=t.eMarks[u],i<o&&t.sCount[u]<t.blkIndent));)if(t.src.charCodeAt(i)===s&&!(t.sCount[u]-t.blkIndent>=4)&&(i=t.skipChars(i,s),!(i-a<l)&&(i=t.skipSpaces(i),!(i<o)))){h=!0;break}l=t.sCount[e],t.line=u+ +!!h;let p=t.push("fence","code",0);return p.info=d,p.content=t.getLines(e+1,u,l,!0),p.markup=c,p.map=[e,t.line],!0}function hE(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],s=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;let a=[],l=[],c=[],d=[],u=t.md.block.ruler.getRules("blockquote"),h=t.parentType;t.parentType="blockquote";let p=!1,f;for(f=e;f<n;f++){let w=t.sCount[f]<t.blkIndent;if(i=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i>=o)break;if(t.src.charCodeAt(i++)===62&&!w){let v=t.sCount[f]+1,E,S;t.src.charCodeAt(i)===32?(i++,v++,S=!1,E=!0):t.src.charCodeAt(i)===9?(E=!0,(t.bsCount[f]+v)%4==3?(i++,v++,S=!1):S=!0):E=!1;let A=v;for(a.push(t.bMarks[f]),t.bMarks[f]=i;i<o;){let _=t.src.charCodeAt(i);if(K(_))_===9?A+=4-(A+t.bsCount[f]+ +!!S)%4:A++;else break;i++}p=i>=o,l.push(t.bsCount[f]),t.bsCount[f]=t.sCount[f]+1+ +!!E,c.push(t.sCount[f]),t.sCount[f]=A-v,d.push(t.tShift[f]),t.tShift[f]=i-t.bMarks[f];continue}if(p)break;let k=!1;for(let v=0,E=u.length;v<E;v++)if(u[v](t,f,n,!0)){k=!0;break}if(k){t.lineMax=f,t.blkIndent!==0&&(a.push(t.bMarks[f]),l.push(t.bsCount[f]),d.push(t.tShift[f]),c.push(t.sCount[f]),t.sCount[f]-=t.blkIndent);break}a.push(t.bMarks[f]),l.push(t.bsCount[f]),d.push(t.tShift[f]),c.push(t.sCount[f]),t.sCount[f]=-1}let m=t.blkIndent;t.blkIndent=0;let g=t.push("blockquote_open","blockquote",1);g.markup=">";let y=[e,0];g.map=y,t.md.block.tokenize(t,e,f);let b=t.push("blockquote_close","blockquote",-1);b.markup=">",t.lineMax=s,t.parentType=h,y[1]=t.line;for(let w=0;w<d.length;w++)t.bMarks[w+e]=a[w],t.tShift[w+e]=d[w],t.sCount[w+e]=c[w],t.bsCount[w+e]=l[w];return t.blkIndent=m,!0}function pE(t,e,n,r){let i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.bMarks[e]+t.tShift[e],s=t.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o<i;){let c=t.src.charCodeAt(o++);if(c!==s&&!K(c))return!1;c===s&&a++}if(a<3)return!1;if(r)return!0;t.line=e+1;let l=t.push("hr","hr",0);return l.map=[e,t.line],l.markup=Array(a+1).join(String.fromCharCode(s)),!0}function uf(t,e){let n=t.eMarks[e],r=t.bMarks[e]+t.tShift[e],i=t.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!K(t.src.charCodeAt(r))?-1:r}function hf(t,e){let n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e],i=n;if(i+1>=r)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=t.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i<r&&(o=t.src.charCodeAt(i),!K(o))?-1:i}function fE(t,e){let n=t.level+2;for(let r=e+2,i=t.tokens.length-2;r<i;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function mE(t,e,n,r){let i,o,s,a,l=e,c=!0;if(t.sCount[l]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let d=!1;r&&t.parentType==="paragraph"&&t.sCount[l]>=t.blkIndent&&(d=!0);let u,h,p;if((p=hf(t,l))>=0){if(u=!0,s=t.bMarks[l]+t.tShift[l],h=Number(t.src.slice(s,p-1)),d&&h!==1)return!1}else if((p=uf(t,l))>=0)u=!1;else return!1;if(d&&t.skipSpaces(p)>=t.eMarks[l])return!1;if(r)return!0;let f=t.src.charCodeAt(p-1),m=t.tokens.length;u?(a=t.push("ordered_list_open","ol",1),h!==1&&(a.attrs=[["start",h]])):a=t.push("bullet_list_open","ul",1);let g=[l,0];a.map=g,a.markup=String.fromCharCode(f);let y=!1,b=t.md.block.ruler.getRules("list"),w=t.parentType;for(t.parentType="list";l<n;){o=p,i=t.eMarks[l];let k=t.sCount[l]+p-(t.bMarks[l]+t.tShift[l]),v=k;for(;o<i;){let Z=t.src.charCodeAt(o);if(Z===9)v+=4-(v+t.bsCount[l])%4;else if(Z===32)v++;else break;o++}let E=o,S;S=E>=i?1:v-k,S>4&&(S=1);let A=k+S;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(f);let _=[l,0];a.map=_,u&&(a.info=t.src.slice(s,p-1));let z=t.tight,nt=t.tShift[l],lt=t.sCount[l],P=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=A,t.tight=!0,t.tShift[l]=E-t.bMarks[l],t.sCount[l]=v,E>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(c=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=P,t.tShift[l]=nt,t.sCount[l]=lt,t.tight=z,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(f),l=t.line,_[1]=l,l>=n||t.sCount[l]<t.blkIndent||t.sCount[l]-t.blkIndent>=4)break;let H=!1;for(let Z=0,Bt=b.length;Z<Bt;Z++)if(b[Z](t,l,n,!0)){H=!0;break}if(H)break;if(u){if(p=hf(t,l),p<0)break;s=t.bMarks[l]+t.tShift[l]}else if(p=uf(t,l),p<0)break;if(f!==t.src.charCodeAt(p-1))break}return a=u?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(f),g[1]=l,t.line=l,t.parentType=w,c&&fE(t,m),!0}function gE(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],s=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==91)return!1;function a(b){let w=t.lineMax;if(b>=w||t.isEmpty(b))return null;let k=!1;if(t.sCount[b]-t.blkIndent>3&&(k=!0),t.sCount[b]<0&&(k=!0),!k){let S=t.md.block.ruler.getRules("reference"),A=t.parentType;t.parentType="reference";let _=!1;for(let z=0,nt=S.length;z<nt;z++)if(S[z](t,b,w,!0)){_=!0;break}if(t.parentType=A,_)return null}let v=t.bMarks[b]+t.tShift[b],E=t.eMarks[b];return t.src.slice(v,E+1)}let l=t.src.slice(i,o+1);o=l.length;let c=-1;for(i=1;i<o;i++){let b=l.charCodeAt(i);if(b===91)return!1;if(b===93){c=i;break}else if(b===10){let w=a(s);w!==null&&(l+=w,o=l.length,s++)}else if(b===92&&(i++,i<o&&l.charCodeAt(i)===10)){let w=a(s);w!==null&&(l+=w,o=l.length,s++)}}if(c<0||l.charCodeAt(c+1)!==58)return!1;for(i=c+2;i<o;i++){let b=l.charCodeAt(i);if(b===10){let w=a(s);w!==null&&(l+=w,o=l.length,s++)}else if(!K(b))break}let d=t.md.helpers.parseLinkDestination(l,i,o);if(!d.ok)return!1;let u=t.md.normalizeLink(d.str);if(!t.md.validateLink(u))return!1;i=d.pos;let h=i,p=s,f=i;for(;i<o;i++){let b=l.charCodeAt(i);if(b===10){let w=a(s);w!==null&&(l+=w,o=l.length,s++)}else if(!K(b))break}let m=t.md.helpers.parseLinkTitle(l,i,o);for(;m.can_continue;){let b=a(s);if(b===null)break;l+=b,i=o,o=l.length,s++,m=t.md.helpers.parseLinkTitle(l,i,o,m)}let g;for(i<o&&f!==i&&m.ok?(g=m.str,i=m.pos):(g="",i=h,s=p);i<o&&K(l.charCodeAt(i));)i++;if(i<o&&l.charCodeAt(i)!==10&&g)for(g="",i=h,s=p;i<o&&K(l.charCodeAt(i));)i++;if(i<o&&l.charCodeAt(i)!==10)return!1;let y=lo(l.slice(1,c));return y?(r||(t.env.references===void 0&&(t.env.references={}),t.env.references[y]===void 0&&(t.env.references[y]={title:g,href:u}),t.line=s),!0):!1}var yE="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".split("."),kE=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),bE=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),Ge=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp("^</?("+yE.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[RegExp(bE.source+"\\s*$"),/^$/,!1]];function wE(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let s=t.src.slice(i,o),a=0;for(;a<Ge.length&&!Ge[a][0].test(s);a++);if(a===Ge.length)return!1;if(r)return Ge[a][2];let l=e+1,c=Ge[a][1].test("");if(!Ge[a][1].test(s)){for(;l<n&&!(t.sCount[l]<t.blkIndent&&(c||!t.isEmpty(l)));l++)if(i=t.bMarks[l]+t.tShift[l],o=t.eMarks[l],s=t.src.slice(i,o),Ge[a][1].test(s)){s.length!==0&&l++;break}}t.line=l;let d=t.push("html_block","",0);return d.map=[e,l],d.content=t.getLines(e,l,t.blkIndent,!0),!0}function vE(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=t.src.charCodeAt(++i);s===35&&i<o&&a<=6;)a++,s=t.src.charCodeAt(++i);if(a>6||i<o&&!K(s))return!1;if(r)return!0;o=t.skipSpacesBack(o,i);let l=t.skipCharsBack(o,35,i);l>i&&K(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;let c=t.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[e,t.line];let d=t.push("inline","",0);d.content=co(t.src.slice(i,o)),d.map=[e,t.line],d.children=[];let u=t.push("heading_close","h"+String(a),-1);return u.markup="########".slice(0,a),!0}function xE(t,e,n){let r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;let i=t.parentType;t.parentType="paragraph";let o=0,s,a=e+1;for(;a<n&&!t.isEmpty(a);a++){if(t.sCount[a]-t.blkIndent>3)continue;if(t.sCount[a]>=t.blkIndent){let p=t.bMarks[a]+t.tShift[a],f=t.eMarks[a];if(p<f&&(s=t.src.charCodeAt(p),(s===45||s===61)&&(p=t.skipChars(p,s),p=t.skipSpaces(p),p>=f))){o=s===61?1:2;break}}if(t.sCount[a]<0)continue;let h=!1;for(let p=0,f=r.length;p<f;p++)if(r[p](t,a,n,!0)){h=!0;break}if(h)break}if(!o)return t.parentType=i,!1;let l=co(t.getLines(e,a,t.blkIndent,!1));t.line=a+1;let c=t.push("heading_open","h"+String(o),1);c.markup=String.fromCharCode(s),c.map=[e,t.line];let d=t.push("inline","",0);d.content=l,d.map=[e,t.line-1],d.children=[];let u=t.push("heading_close","h"+String(o),-1);return u.markup=String.fromCharCode(s),t.parentType=i,!0}function CE(t,e,n){let r=t.md.block.ruler.getRules("paragraph"),i=t.parentType,o=e+1;for(t.parentType="paragraph";o<n&&!t.isEmpty(o);o++){if(t.sCount[o]-t.blkIndent>3||t.sCount[o]<0)continue;let c=!1;for(let d=0,u=r.length;d<u;d++)if(r[d](t,o,n,!0)){c=!0;break}if(c)break}let s=co(t.getLines(e,o,t.blkIndent,!1));t.line=o;let a=t.push("paragraph_open","p",1);a.map=[e,t.line];let l=t.push("inline","",0);return l.content=s,l.map=[e,t.line],l.children=[],t.push("paragraph_close","p",-1),t.parentType=i,!0}var ho=[["table",cE,["paragraph","reference"]],["code",dE],["fence",uE,["paragraph","reference","blockquote","list"]],["blockquote",hE,["paragraph","reference","blockquote","list"]],["hr",pE,["paragraph","reference","blockquote","list"]],["list",mE,["paragraph","reference","blockquote"]],["reference",gE],["html_block",wE,["paragraph","reference","blockquote"]],["heading",vE,["paragraph","reference","blockquote"]],["lheading",xE],["paragraph",CE]];function po(){this.ruler=new Ct;for(let t=0;t<ho.length;t++)this.ruler.push(ho[t][0],ho[t][1],{alt:(ho[t][2]||[]).slice()})}po.prototype.tokenize=function(t,e,n){let r=this.ruler.getRules(""),i=r.length,o=t.md.options.maxNesting,s=e,a=!1;for(;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n||t.sCount[s]<t.blkIndent));){if(t.level>=o){t.line=n;break}let l=t.line,c=!1;for(let d=0;d<i;d++)if(c=r[d](t,s,n,!1),c){if(l>=t.line)throw Error("block rule didn't increment state.line");break}if(!c)throw Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),s=t.line,s<n&&t.isEmpty(s)&&(a=!0,s++,t.line=s)}},po.prototype.parse=function(t,e,n,r){if(!t)return;let i=new this.State(t,e,n,r);this.tokenize(i,i.line,i.lineMax)},po.prototype.State=Ut;function br(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}br.prototype.pushPending=function(){let t=new Ft("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},br.prototype.push=function(t,e,n){this.pending&&this.pushPending();let r=new Ft(t,e,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},br.prototype.scanDelims=function(t,e){let n=this.posMax,r=this.src.charCodeAt(t),i;if(t===0)i=32;else if(t===1)i=this.src.charCodeAt(0),(i&63488)==55296&&(i=65533);else if(i=this.src.charCodeAt(t-1),(i&64512)==56320){let f=this.src.charCodeAt(t-2);i=(f&64512)==55296?65536+(f-55296<<10)+(i-56320):65533}else(i&64512)==55296&&(i=65533);let o=t;for(;o<n&&this.src.charCodeAt(o)===r;)o++;let s=o-t,a=o<n?this.src.charCodeAt(o):32;if((a&64512)==55296){let f=this.src.charCodeAt(o+1);a=(f&64512)==56320?65536+(a-55296<<10)+(f-56320):65533}else(a&64512)==56320&&(a=65533);let l=kr(i)||yr(i),c=kr(a)||yr(a),d=gr(i),u=gr(a),h=!u&&(!c||d||l),p=!d&&(!l||u||c);return{can_open:h&&(e||!p||l),can_close:p&&(e||!h||c),length:s}},br.prototype.Token=Ft;function SE(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function EE(t,e){let n=t.pos;for(;n<t.posMax&&!SE(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}var ME=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function AE(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;let n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;let i=t.pending.match(ME);if(!i)return!1;let o=i[1],s=t.md.linkify.matchAtStart(t.src.slice(n-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;let l=a.length;for(;l>0&&a.charCodeAt(l-1)===42;)l--;l!==a.length&&(a=a.slice(0,l));let c=t.md.normalizeLink(a);if(!t.md.validateLink(c))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);let d=t.push("link_open","a",1);d.attrs=[["href",c]],d.markup="linkify",d.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(a);let h=t.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return t.pos+=a.length-o.length,!0}function DE(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;let r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<i&&K(t.src.charCodeAt(n));)n++;return t.pos=n,!0}var Ba=[];for(let t=0;t<256;t++)Ba.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){Ba[t.charCodeAt(0)]=1});function TE(t,e){let n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(i=t.src.charCodeAt(n),K(i));)n++;return t.pos=n,!0}if(i===32){if(!e){let a=t.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return t.pos=n,!0}let o=t.src[n];if(i>=55296&&i<=56319&&n+1<r){let a=t.src.charCodeAt(n+1);a>=56320&&a<=57343&&(o+=t.src[n+1],n++)}let s="\\"+o;if(!e){let a=t.push("text_special","",0);i<256&&Ba[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return t.pos=n+1,!0}function OE(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=t.posMax;for(;n<i&&t.src.charCodeAt(n)===96;)n++;let o=t.src.slice(r,n),s=o.length;if(t.backticksScanned&&(t.backticks[s]||0)<=r)return e||(t.pending+=o),t.pos+=s,!0;let a=n,l;for(;(l=t.src.indexOf("`",a))!==-1;){for(a=l+1;a<i&&t.src.charCodeAt(a)===96;)a++;let c=a-l;if(c===s){if(!e){let d=t.push("code_inline","code",0);d.markup=o,d.content=t.src.slice(n,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=a,!0}t.backticks[c]=l}return t.backticksScanned=!0,e||(t.pending+=o),t.pos+=s,!0}function NE(t,e){let n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;let i=t.scanDelims(t.pos,!0),o=i.length,s=String.fromCharCode(r);if(o<2)return!1;let a;o%2&&(a=t.push("text","",0),a.content=s,o--);for(let l=0;l<o;l+=2)a=t.push("text","",0),a.content=s+s,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return t.pos+=i.length,!0}function pf(t,e){let n,r=[],i=e.length;for(let o=0;o<i;o++){let s=e[o];if(s.marker!==126||s.end===-1)continue;let a=e[s.end];n=t.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[a.token-1].type==="text"&&t.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){let o=r.pop(),s=o+1;for(;s<t.tokens.length&&t.tokens[s].type==="s_close";)s++;s--,o!==s&&(n=t.tokens[s],t.tokens[s]=t.tokens[o],t.tokens[o]=n)}}function RE(t){let e=t.tokens_meta,n=t.tokens_meta.length;pf(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&pf(t,e[r].delimiters)}var ff={tokenize:NE,postProcess:RE};function _E(t,e){let n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;let i=t.scanDelims(t.pos,r===42);for(let o=0;o<i.length;o++){let s=t.push("text","",0);s.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:i.length,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return t.pos+=i.length,!0}function mf(t,e){let n=e.length;for(let r=n-1;r>=0;r--){let i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;let o=e[i.end],s=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?a+a:a,l.content="";let c=t.tokens[o.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?a+a:a,c.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function zE(t){let e=t.tokens_meta,n=t.tokens_meta.length;mf(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&mf(t,e[r].delimiters)}var gf={tokenize:_E,postProcess:zE};function $E(t,e){let n,r,i,o,s="",a="",l=t.pos,c=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;let d=t.pos,u=t.posMax,h=t.pos+1,p=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(p<0)return!1;let f=p+1;if(f<u&&t.src.charCodeAt(f)===40){for(c=!1,f++;f<u&&(n=t.src.charCodeAt(f),!(!K(n)&&n!==10));f++);if(f>=u)return!1;if(l=f,i=t.md.helpers.parseLinkDestination(t.src,f,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?f=i.pos:s="",l=f;f<u&&(n=t.src.charCodeAt(f),!(!K(n)&&n!==10));f++);if(i=t.md.helpers.parseLinkTitle(t.src,f,t.posMax),f<u&&l!==f&&i.ok)for(a=i.str,f=i.pos;f<u&&(n=t.src.charCodeAt(f),!(!K(n)&&n!==10));f++);}(f>=u||t.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(t.env.references===void 0)return!1;if(f<u&&t.src.charCodeAt(f)===91?(l=f+1,f=t.md.helpers.parseLinkLabel(t,f),f>=0?r=t.src.slice(l,f++):f=p+1):f=p+1,r||=t.src.slice(h,p),o=t.env.references[lo(r)],!o)return t.pos=d,!1;s=o.href,a=o.title}if(!e){t.pos=h,t.posMax=p;let m=t.push("link_open","a",1),g=[["href",s]];m.attrs=g,a&&g.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=f,t.posMax=u,!0}function LE(t,e){let n,r,i,o,s,a,l,c,d="",u=t.pos,h=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;let p=t.pos+2,f=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(f<0)return!1;if(o=f+1,o<h&&t.src.charCodeAt(o)===40){for(o++;o<h&&(n=t.src.charCodeAt(o),!(!K(n)&&n!==10));o++);if(o>=h)return!1;for(c=o,a=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),a.ok&&(d=t.md.normalizeLink(a.str),t.md.validateLink(d)?o=a.pos:d=""),c=o;o<h&&(n=t.src.charCodeAt(o),!(!K(n)&&n!==10));o++);if(a=t.md.helpers.parseLinkTitle(t.src,o,t.posMax),o<h&&c!==o&&a.ok)for(l=a.str,o=a.pos;o<h&&(n=t.src.charCodeAt(o),!(!K(n)&&n!==10));o++);else l="";if(o>=h||t.src.charCodeAt(o)!==41)return t.pos=u,!1;o++}else{if(t.env.references===void 0)return!1;if(o<h&&t.src.charCodeAt(o)===91?(c=o+1,o=t.md.helpers.parseLinkLabel(t,o),o>=0?i=t.src.slice(c,o++):o=f+1):o=f+1,i||=t.src.slice(p,f),s=t.env.references[lo(i)],!s)return t.pos=u,!1;d=s.href,l=s.title}if(!e){r=t.src.slice(p,f);let m=[];t.md.inline.parse(r,t.md,t.env,m);let g=t.push("image","img",0),y=[["src",d],["alt",""]];g.attrs=y,g.children=m,g.content=r,l&&y.push(["title",l])}return t.pos=o,t.posMax=h,!0}var IE=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,FE=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function BE(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;let r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;let s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}let o=t.src.slice(r+1,n);if(FE.test(o)){let s=t.md.normalizeLink(o);if(!t.md.validateLink(s))return!1;if(!e){let a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";let l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);let c=t.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return t.pos+=o.length+2,!0}if(IE.test(o)){let s=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(s))return!1;if(!e){let a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";let l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);let c=t.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return t.pos+=o.length+2,!0}return!1}function PE(t){return/^<a[>\s]/i.test(t)}function jE(t){return/^<\/a\s*>/i.test(t)}function HE(t){let e=t|32;return e>=97&&e<=122}function qE(t,e){if(!t.md.options.html)return!1;let n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!HE(i))return!1;let o=t.src.slice(r).match(kE);if(!o)return!1;if(!e){let s=t.push("html_inline","",0);s.content=o[0],PE(s.content)&&t.linkLevel++,jE(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}var VE=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,WE=/^&([a-z][a-z0-9]{1,31});/i;function UE(t,e){let n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){let i=t.src.slice(n).match(VE);if(i){if(!e){let o=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),s=t.push("text_special","",0);s.content=$a(o)?mr(o):mr(65533),s.markup=i[0],s.info="entity"}return t.pos+=i[0].length,!0}}else{let i=t.src.slice(n).match(WE);if(i){let o=xS(i[0]);if(o!==i[0]){if(!e){let s=t.push("text_special","",0);s.content=o,s.markup=i[0],s.info="entity"}return t.pos+=i[0].length,!0}}}return!1}function yf(t){let e={},n=t.length;if(!n)return;let r=0,i=-2,o=[];for(let s=0;s<n;s++){let a=t[s];if(o.push(0),(t[r].marker!==a.marker||i!==a.token-1)&&(r=s),i=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);let l=e[a.marker][(a.open?3:0)+a.length%3],c=r-o[r]-1,d=c;for(;c>l;c-=o[c]+1){let u=t[c];if(u.marker===a.marker&&u.open&&u.end<0){let h=!1;if((u.close||a.open)&&(u.length+a.length)%3==0&&(u.length%3!=0||a.length%3!=0)&&(h=!0),!h){let p=c>0&&!t[c-1].open?o[c-1]+1:0;o[s]=s-c+p,o[c]=p,a.open=!1,u.end=s,u.close=!1,d=-1,i=-2;break}}}d!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=d)}}function KE(t){let e=t.tokens_meta,n=t.tokens_meta.length;yf(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&yf(e[r].delimiters)}function JE(t){let e,n,r=0,i=t.tokens,o=t.tokens.length;for(e=n=0;e<o;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<o&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}var Pa=[["text",EE],["linkify",AE],["newline",DE],["escape",TE],["backticks",OE],["strikethrough",ff.tokenize],["emphasis",gf.tokenize],["link",$E],["image",LE],["autolink",BE],["html_inline",qE],["entity",UE]],ja=[["balance_pairs",KE],["strikethrough",ff.postProcess],["emphasis",gf.postProcess],["fragments_join",JE]];function wr(){this.ruler=new Ct;for(let t=0;t<Pa.length;t++)this.ruler.push(Pa[t][0],Pa[t][1]);this.ruler2=new Ct;for(let t=0;t<ja.length;t++)this.ruler2.push(ja[t][0],ja[t][1])}wr.prototype.skipToken=function(t){let e=t.pos,n=this.ruler.getRules(""),r=n.length,i=t.md.options.maxNesting,o=t.cache;if(o[e]!==void 0){t.pos=o[e];return}let s=!1;if(t.level<i){for(let a=0;a<r;a++)if(t.level++,s=n[a](t,!0),t.level--,s){if(e>=t.pos)throw Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,o[e]=t.pos},wr.prototype.tokenize=function(t){let e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos<r;){let o=t.pos,s=!1;if(t.level<i){for(let a=0;a<n;a++)if(s=e[a](t,!1),s){if(o>=t.pos)throw Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},wr.prototype.parse=function(t,e,n,r){let i=new this.State(t,e,n,r);this.tokenize(i);let o=this.ruler2.getRules(""),s=o.length;for(let a=0;a<s;a++)o[a](i)},wr.prototype.State=br;function GE(t){let e={};t||={},e.src_Any=Gp.source,e.src_Cc=Zp.source,e.src_Z=Qp.source,e.src_P=Ra.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");let n="[><\uFF5C]";return e.src_pseudo_letter=`(?:(?!${n}|${e.src_ZPCc})${e.src_Any})`,e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth=`(?:(?:(?!${e.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator=`(?=$|${n}|${e.src_ZPCc})(?!${t["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${e.src_ZPCc}))`,e.src_path=`(?:[/?#](?:(?!${e.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${e.src_ZCc}|\\]).)*\\]|\\((?:(?!${e.src_ZCc}|[)]).)*\\)|\\{(?:(?!${e.src_ZCc}|[}]).)*\\}|\\"(?:(?!${e.src_ZCc}|["]).)+\\"|\\'(?:(?!${e.src_ZCc}|[']).)+\\'|\\'(?=${e.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${e.src_ZCc}|[.]|$)|`+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${e.src_ZCc}|$)|;(?!${e.src_ZCc}|$)|\\!+(?!${e.src_ZCc}|[!]|$)|\\?(?!${e.src_ZCc}|[?]|$))+|\\/)?`,e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+`|${e.src_pseudo_letter}{1,63})`,e.src_domain="(?:"+e.src_xn+`|(?:${e.src_pseudo_letter})|(?:${e.src_pseudo_letter}(?:-|${e.src_pseudo_letter}){0,61}${e.src_pseudo_letter}))`,e.src_host=`(?:(?:(?:(?:${e.src_domain})\\.)*${e.src_domain}))`,e.tpl_host_fuzzy="(?:"+e.src_ip4+`|(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%)))`,e.tpl_host_no_ip_fuzzy=`(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%))`,e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${e.src_ZPCc}|>|$))`,e.tpl_email_fuzzy=`(^|${n}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}function Ha(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){e&&Object.keys(e).forEach(function(n){t[n]=e[n]})}),t}function fo(t){return Object.prototype.toString.call(t)}function ZE(t){return fo(t)==="[object String]"}function XE(t){return fo(t)==="[object Object]"}function QE(t){return fo(t)==="[object RegExp]"}function kf(t){return fo(t)==="[object Function]"}function YE(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var bf={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function tM(t){return Object.keys(t||{}).reduce(function(e,n){return e||bf.hasOwnProperty(n)},!1)}var eM={"http:":{validate:function(t,e,n){let r=t.slice(e);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){let r=t.slice(e);return n.re.no_http||(n.re.no_http=RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){let r=t.slice(e);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},nM="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",rM="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function iM(t){return function(e,n){let r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function wf(){return function(t,e){e.normalize(t)}}function mo(t){let e=t.re=GE(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(nM),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(r(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(r(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(r(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");let i=[];t.__compiled__={};function o(a,l){throw Error(`(LinkifyIt) Invalid schema "${a}": ${l}`)}Object.keys(t.__schemas__).forEach(function(a){let l=t.__schemas__[a];if(l===null)return;let c={validate:null,link:null};if(t.__compiled__[a]=c,XE(l)){QE(l.validate)?c.validate=iM(l.validate):kf(l.validate)?c.validate=l.validate:o(a,l),kf(l.normalize)?c.normalize=l.normalize:l.normalize?o(a,l):c.normalize=wf();return}if(ZE(l)){i.push(a);return}o(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:wf()};let s=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(YE).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${s})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${s})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}function vf(t,e,n,r){let i=t.slice(n,r);this.schema=e.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Tt(t,e){if(!(this instanceof Tt))return new Tt(t,e);e||tM(t)&&(e=t,t={}),this.__opts__=Ha({},bf,e),this.__schemas__=Ha({},eM,t),this.__compiled__={},this.__tlds__=rM,this.__tlds_replaced__=!1,this.re={},mo(this)}Tt.prototype.add=function(t,e){return this.__schemas__[t]=e,mo(this),this},Tt.prototype.set=function(t){return this.__opts__=Ha(this.__opts__,t),this},Tt.prototype.test=function(t){if(!t.length)return!1;let e,n;if(this.re.schema_test.test(t)){for(n=this.re.schema_search,n.lastIndex=0;(e=n.exec(t))!==null;)if(this.testSchemaAt(t,e[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)},Tt.prototype.pretest=function(t){return this.re.pretest.test(t)},Tt.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},Tt.prototype.match=function(t){let e=[],n=[],r=[],i=[],o,s,a;function l(u,h){return u?h?u.index===h.index?u.lastIndex>=h.lastIndex?u:h:u.index<h.index?u:h:u:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(o=a.exec(t))!==null;)s=this.testSchemaAt(t,o[2],a.lastIndex),s&&n.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+s});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(o=a.exec(t))!==null;)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(o=a.exec(t))!==null;)i.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});let c=[0,0,0],d=0;for(;;){let u=[n[c[0]],i[c[1]],r[c[2]]],h=l(l(u[0],u[1]),u[2]);if(!h)break;if(h===u[0]?c[0]++:h===u[1]?c[1]++:c[2]++,h.index<d)continue;let p=new vf(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),e.push(p),d=h.lastIndex}return e.length?e:null},Tt.prototype.matchAtStart=function(t){if(!t.length)return null;let e=this.re.schema_at_start.exec(t);if(!e)return null;let n=this.testSchemaAt(t,e[2],e[0].length);if(!n)return null;let r=new vf(t,e[2],e.index+e[1].length,e.index+e[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Tt.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(n,r,i){return n!==i[r-1]}).reverse(),mo(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,mo(this),this)},Tt.prototype.normalize=function(t){t.schema||(t.url=`http://${t.url}`),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url=`mailto:${t.url}`)},Tt.prototype.onCompile=function(){};var vn=2147483647,Kt=36,qa=1,go=26,oM=38,sM=700,xf=72,Cf=128,Sf="-",aM=/^xn--/,lM=/[^\0-\x7F]/,cM=/[\x2E\u3002\uFF0E\uFF61]/g,dM={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},uM=Kt-qa,Jt=Math.floor,Va=String.fromCharCode;function Se(t){throw RangeError(dM[t])}function hM(t,e){let n=[],r=t.length;for(;r--;)n[r]=e(t[r]);return n}function Ef(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(cM,".");let i=hM(t.split("."),e).join(".");return r+i}function Mf(t){let e=[],n=0,r=t.length;for(;n<r;){let i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let o=t.charCodeAt(n++);(o&64512)==56320?e.push(((i&1023)<<10)+(o&1023)+65536):(e.push(i),n--)}else e.push(i)}return e}var pM=t=>String.fromCodePoint(...t),fM=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Kt},Af=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Df=function(t,e,n){let r=0;for(t=n?Jt(t/sM):t>>1,t+=Jt(t/e);t>455;r+=Kt)t=Jt(t/uM);return Jt(r+36*t/(t+oM))},Tf=function(t){let e=[],n=t.length,r=0,i=Cf,o=xf,s=t.lastIndexOf(Sf);s<0&&(s=0);for(let a=0;a<s;++a)t.charCodeAt(a)>=128&&Se("not-basic"),e.push(t.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){let l=r;for(let d=1,u=Kt;;u+=Kt){a>=n&&Se("invalid-input");let h=fM(t.charCodeAt(a++));h>=Kt&&Se("invalid-input"),h>Jt((vn-r)/d)&&Se("overflow"),r+=h*d;let p=u<=o?qa:u>=o+go?go:u-o;if(h<p)break;let f=Kt-p;d>Jt(vn/f)&&Se("overflow"),d*=f}let c=e.length+1;o=Df(r-l,c,l==0),Jt(r/c)>vn-i&&Se("overflow"),i+=Jt(r/c),r%=c,e.splice(r++,0,i)}return String.fromCodePoint(...e)},Of=function(t){let e=[];t=Mf(t);let n=t.length,r=Cf,i=0,o=xf;for(let l of t)l<128&&e.push(Va(l));let s=e.length,a=s;for(s&&e.push(Sf);a<n;){let l=vn;for(let d of t)d>=r&&d<l&&(l=d);let c=a+1;l-r>Jt((vn-i)/c)&&Se("overflow"),i+=(l-r)*c,r=l;for(let d of t)if(d<r&&++i>vn&&Se("overflow"),d===r){let u=i;for(let h=Kt;;h+=Kt){let p=h<=o?qa:h>=o+go?go:h-o;if(u<p)break;let f=u-p,m=Kt-p;e.push(Va(Af(p+f%m,0))),u=Jt(f/m)}e.push(Va(Af(u,0))),o=Df(i,c,a===s),i=0,++a}++i,++r}return e.join("")},Nf={version:"2.3.1",ucs2:{decode:Mf,encode:pM},decode:Tf,encode:Of,toASCII:function(t){return Ef(t,function(e){return lM.test(e)?"xn--"+Of(e):e})},toUnicode:function(t){return Ef(t,function(e){return aM.test(e)?Tf(e.slice(4).toLowerCase()):e})}},mM={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},gM=/^(vbscript|javascript|file|data):/,yM=/^data:image\/(gif|png|jpeg|webp);/;function kM(t){let e=t.trim().toLowerCase();return!gM.test(e)||yM.test(e)}var Rf=["http:","https:","mailto:"];function bM(t){let e=Na(t,!0);if(e.hostname&&(!e.protocol||Rf.indexOf(e.protocol)>=0))try{e.hostname=Nf.toASCII(e.hostname)}catch{}return fr(Oa(e))}function wM(t){let e=Na(t,!0);if(e.hostname&&(!e.protocol||Rf.indexOf(e.protocol)>=0))try{e.hostname=Nf.toUnicode(e.hostname)}catch{}return kn(Oa(e),kn.defaultChars+"%")}function St(t,e){if(!(this instanceof St))return new St(t,e);e||za(t)||(e=t||{},t="default"),this.inline=new wr,this.block=new po,this.core=new Ia,this.renderer=new wn,this.linkify=new Tt,this.validateLink=kM,this.normalizeLink=bM,this.normalizeLinkText=wM,this.utils=CS,this.helpers=ao({},jS),this.options={},this.configure(t),e&&this.set(e)}St.prototype.set=function(t){return ao(this.options,t),this},St.prototype.configure=function(t){let e=this;if(za(t)){let n=t;if(t=mM[n],!t)throw Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this},St.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));let r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},St.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));let r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},St.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},St.prototype.parse=function(t,e){if(typeof t!="string")throw Error("Input data should be a String");let n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},St.prototype.render=function(t,e){return e||={},this.renderer.render(this.parse(t,e),this.options,e)},St.prototype.parseInline=function(t,e){let n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},St.prototype.renderInline=function(t,e){return e||={},this.renderer.render(this.parseInline(t,e),this.options,e)};var vM=new Do({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function xM(t,e){if(t.isText&&e.isText&&B.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}var CM=class{constructor(t,e){this.schema=t,this.tokenHandlers=e,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:B.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let e=this.top(),n=e.content,r=n[n.length-1],i=this.schema.text(t,e.marks),o;r&&(o=xM(r,i))?n[n.length-1]=o:n.push(i)}openMark(t){let e=this.top();e.marks=t.addToSet(e.marks)}closeMark(t){let e=this.top();e.marks=t.removeFromSet(e.marks)}parseTokens(t){for(let e=0;e<t.length;e++){let n=t[e],r=this.tokenHandlers[n.type];if(!r)throw Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,t,e)}}addNode(t,e,n){let r=this.top(),i=t.createAndFill(e,n,r?r.marks:[]);return i?(this.push(i),i):null}openNode(t,e){this.stack.push({type:t,attrs:e,content:[],marks:B.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}};function vr(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function Wa(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function _f(t){return t[t.length-1]==`
174
+ `?t.slice(0,t.length-1):t}function Ua(){}function SM(t,e){let n=Object.create(null);for(let r in e){let i=e[r];if(i.block){let o=t.nodeType(i.block);Wa(i,r)?n[r]=(s,a,l,c)=>{s.openNode(o,vr(i,a,l,c)),s.addText(_f(a.content)),s.closeNode()}:(n[r+"_open"]=(s,a,l,c)=>s.openNode(o,vr(i,a,l,c)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,a,l,c)=>s.addNode(o,vr(i,a,l,c))}else if(i.mark){let o=t.marks[i.mark];Wa(i,r)?n[r]=(s,a,l,c)=>{s.openMark(o.create(vr(i,a,l,c))),s.addText(_f(a.content)),s.closeMark(o)}:(n[r+"_open"]=(s,a,l,c)=>s.openMark(o.create(vr(i,a,l,c))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)Wa(i,r)?n[r]=Ua:(n[r+"_open"]=Ua,n[r+"_close"]=Ua);else throw RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}var EM=class{constructor(t,e,n){this.schema=t,this.tokenizer=e,this.tokens=n,this.tokenHandlers=SM(t,n)}parse(t,e={}){let n=new CM(this.schema,this.tokenHandlers),r;n.parseTokens(this.tokenizer.parse(t,e));do r=n.closeNode();while(n.stack.length);return r||this.schema.topNodeType.createAndFill()}};function zf(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new EM(vM,St("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:zf(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:zf(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});var MM={open:"",close:"",mixable:!0},Gt=new class{constructor(t,e,n={}){this.nodes=t,this.marks=e,this.options=n}serialize(t,e={}){e=Object.assign({},this.options,e);let n=new Lf(this.nodes,this.marks,e);return n.renderContent(t),n.out}}({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){let n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
175
+ `),t.text(e.textContent,!1),t.write(`
176
+ `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){let n=e.attrs.order??1,r=String(n+e.childCount-1).length,i=t.repeat(" ",r+2);t.renderList(e,i,o=>{let s=String(n+o);return t.repeat(" ",r-s.length)+s+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(`\\
177
+ `);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=AM(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return $f(n.child(r),-1)},close(t,e,n,r){return $f(n.child(r-1),1)},escape:!1}});function $f(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let o=i>0&&e>0?" `":"`";for(let s=0;s<i;s++)o+="`";return i>0&&e<0&&(o+=" "),o}function AM(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}var Lf=class{constructor(t,e,n){this.nodes=t,this.marks=e,this.options=n,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,this.options.tightLists===void 0&&(this.options.tightLists=!1),this.options.hardBreakNodeName===void 0&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
178
+ `),t>1){let e=this.delim,n=/\s+$/.exec(e);n&&(e=e.slice(0,e.length-n[0].length));for(let r=1;r<t;r++)this.out+=e+`
179
+ `}this.closed=null}}getMark(t){let e=this.marks[t];if(!e){if(this.options.strict!==!1)throw Error(`Mark type \`${t}\` not supported by Markdown renderer`);e=MM}return e}wrapBlock(t,e,n,r){let i=this.delim;this.write(e??t),this.delim+=t,r(),this.delim=i,this.closeBlock(n)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
180
+ `)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,e=!0){let n=t.split(`
181
+ `);for(let r=0;r<n.length;r++)this.write(),!e&&n[r][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=e?this.esc(n[r],this.atBlockStart):n[r],r!=n.length-1&&(this.out+=`
182
+ `)}render(t,e,n){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,e,n);else{if(this.options.strict!==!1)throw Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((e,n,r)=>this.render(e,t,r))}renderInline(t,e=!0){this.atBlockStart=e;let n=[],r="",i=(o,s,a)=>{let l=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(l=l.filter(f=>{if(a+1==t.childCount)return!1;let m=t.child(a+1);return f.isInSet(m.marks)&&(!m.isText||/\S/.test(m.text))}));let c=r;if(r="",o&&o.isText&&l.some(f=>{let m=this.getMark(f.type.name);return m&&m.expelEnclosingWhitespace&&!f.isInSet(n)})){let[f,m,g]=/^(\s*)(.*)$/m.exec(o.text);m&&(c+=m,o=g?o.withText(g):null,o||(l=n))}if(o&&o.isText&&l.some(f=>{let m=this.getMark(f.type.name);return m&&m.expelEnclosingWhitespace&&!this.isMarkAhead(t,a+1,f)})){let[f,m,g]=/^(.*?)(\s*)$/m.exec(o.text);g&&(r=g,o=m?o.withText(m):null,o||(l=n))}let d=l.length?l[l.length-1]:null,u=d&&this.getMark(d.type.name).escape===!1,h=l.length-+!!u;t:for(let f=0;f<h;f++){let m=l[f];if(!this.getMark(m.type.name).mixable)break;for(let g=0;g<n.length;g++){let y=n[g];if(!this.getMark(y.type.name).mixable)break;if(m.eq(y)){f>g?l=l.slice(0,g).concat(m).concat(l.slice(g,f)).concat(l.slice(f+1,h)):g>f&&(l=l.slice(0,f).concat(l.slice(f+1,g)).concat(m).concat(l.slice(g,h)));continue t}}}let p=0;for(;p<Math.min(n.length,h)&&l[p].eq(n[p]);)++p;for(;p<n.length;)this.text(this.markString(n.pop(),!1,t,a),!1);if(c&&this.text(c),o){for(;n.length<h;){let f=l[n.length];n.push(f),this.text(this.markString(f,!0,t,a),!1),this.atBlockStart=!1}u&&o.isText?this.text(this.markString(d,!0,t,a)+o.text+this.markString(d,!1,t,a+1),!1):this.render(o,t,a),this.atBlockStart=!1}o?.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(i),i(null,0,t.childCount),this.atBlockStart=!1}renderList(t,e,n){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=t.attrs.tight===void 0?this.options.tightLists:t.attrs.tight,i=this.inTightList;this.inTightList=r,t.forEach((o,s,a)=>{a&&r&&this.flushClose(1),this.wrapBlock(e,n(a),t,()=>this.render(o,t,a))}),this.inTightList=i}esc(t,e=!1){return t=t.replace(/[`*\\~\[\]_]/g,(n,r)=>n=="_"&&r>0&&r+1<t.length&&t[r-1].match(/\w/)&&t[r+1].match(/\w/)?n:"\\"+n),e&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let e=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return e[0]+t+e[1]}repeat(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}markString(t,e,n,r){let i=this.getMark(t.type.name),o=e?i.open:i.close;return typeof o=="string"?o:o(this,t,n,r)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,e,n){for(;;e++){if(e>=t.childCount)return!1;let r=t.child(e);if(r.type.name!=this.options.hardBreakNodeName)return n.isInSet(r.marks);e++}}},DM=zr(hm(((t,e)=>{var n=!0,r=!1,i=!1;e.exports=function(y,b){b&&(n=!b.enabled,r=!!b.label,i=!!b.labelAfter),y.core.ruler.after("inline","github-task-lists",function(w){for(var k=w.tokens,v=2;v<k.length;v++)a(k,v)&&(l(k[v],w.Token),o(k[v-2],"class","task-list-item"+(n?"":" enabled")),o(k[s(k,v-2)],"class","contains-task-list"))})};function o(y,b,w){var k=y.attrIndex(b),v=[b,w];k<0?y.attrPush(v):y.attrs[k]=v}function s(y,b){for(var w=y[b].level-1,k=b-1;k>=0;k--)if(y[k].level===w)return k;return-1}function a(y,b){return p(y[b])&&f(y[b-1])&&m(y[b-2])&&g(y[b])}function l(y,b){if(y.children.unshift(c(y,b)),y.children[1].content=y.children[1].content.slice(3),y.content=y.content.slice(3),r)if(i){y.children.pop();var w="task-item-"+Math.ceil(1e4*1e3*Math.random()-1e3);y.children[0].content=y.children[0].content.slice(0,-1)+' id="'+w+'">',y.children.push(h(y.content,w,b))}else y.children.unshift(d(b)),y.children.push(u(b))}function c(y,b){var w=new b("html_inline","",0),k=n?' disabled="" ':"";return y.content.indexOf("[ ] ")===0?w.content='<input class="task-list-item-checkbox"'+k+'type="checkbox">':(y.content.indexOf("[x] ")===0||y.content.indexOf("[X] ")===0)&&(w.content='<input class="task-list-item-checkbox" checked=""'+k+'type="checkbox">'),w}function d(y){var b=new y("html_inline","",0);return b.content="<label>",b}function u(y){var b=new y("html_inline","",0);return b.content="</label>",b}function h(y,b,w){var k=new w("html_inline","",0);return k.content='<label class="task-list-item-label" for="'+b+'">'+y+"</label>",k.attrs=[{for:b}],k}function p(y){return y.type==="inline"}function f(y){return y.type==="paragraph_open"}function m(y){return y.type==="list_item_open"}function g(y){return y.content.indexOf("[ ] ")===0||y.content.indexOf("[x] ")===0||y.content.indexOf("[X] ")===0}}))(),1),TM=Object.defineProperty,OM=(t,e,n)=>e in t?TM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yo=(t,e,n)=>(OM(t,typeof e=="symbol"?e:e+"",n),n),NM=V.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function o(s){if(!r.isActive(s))return!1;let a=r.getAttributes(s);return i.updateAttributes(s,{tight:e??!(a!=null&&a.tight)})}return t.options.listTypes.some(s=>o(s))}}}}}),If=St();function Ff(t,e){return If.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new If.inline.State(t,null,null,[]).scanDelims(e,!0)}function Bf(t,e,n,r){let i=t.substring(0,n)+t.substring(n+e.length);return i=i.substring(0,n+r)+e+i.substring(n+r),i}function RM(t,e,n,r){let i=n,o=t;for(;i<r&&!Ff(o,i).can_open;)o=Bf(o,e,i,1),i++;return{text:o,from:i,to:r}}function _M(t,e,n,r){let i=r,o=t;for(;i>n&&!Ff(o,i).can_close;)o=Bf(o,e,i,-1),i--;return{text:o,from:n,to:i}}function zM(t,e,n,r){let i={text:t,from:n,to:r};return i=RM(i.text,e,i.from,i.to),i=_M(i.text,e,i.from,i.to),i.to-i.from<e.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+e.length)),i.text}var $M=class extends Lf{constructor(t,e,n){super(t,e,n??{}),yo(this,"inTable",!1),this.inlines=[]}render(t,e,n){super.render(t,e,n);let r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!=null&&r.end){let{delimiter:i,start:o,end:s}=this.normalizeInline(r);this.out=zM(this.out,i,o,s),this.inlines.pop()}}markString(t,e,n,r){let i=this.marks[t.type.name];if(i.expelEnclosingWhitespace)if(e)this.inlines.push({start:this.out.length,delimiter:i.open});else{let o=this.inlines.pop();this.inlines.push({...o,end:this.out.length})}return super.markString(t,e,n,r)}normalizeInline(t){let{start:e,end:n}=t;for(;this.out.charAt(e).match(/\s/);)e++;return{...t,start:e}}},Pf=At.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){return this.editor.storage.markdown.options.html?jf(e)?.[0]??"":(console.warn(`Tiptap Markdown: "${e.type.name}" mark is only available in html mode`),"")},close(t,e){return this.editor.storage.markdown.options.html?jf(e)?.[1]??"":""}},parse:{}}}}});function jf(t){let e=t.type.schema,n=e.text(" ",[t]),r=Gn(x.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function Ka(t){let e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function LM(t){return t?.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function IM(t){let e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function FM(t){let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}var ko=I.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(BM(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function BM(t,e){let n=t.type.schema,r=Gn(x.from(t),n);return t.isBlock&&(e instanceof x||e.type.name===n.topNodeType.name)?PM(r):r}function PM(t){let e=Ka(t).firstElementChild;return e.innerHTML=e.innerHTML.trim()?`
183
+ ${e.innerHTML}
184
+ `:`
185
+ `,e.outerHTML}var jM=I.create({name:"blockquote"}).extend({addStorage(){return{markdown:{serialize:Gt.nodes.blockquote,parse:{}}}}}),Hf=I.create({name:"bulletList"}).extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),HM=I.create({name:"codeBlock"}).extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
186
+ `),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){t.set({langPrefix:this.options.languageClassPrefix??"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),qf=I.create({name:"hardBreak"}).extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(t.inTable?ko.storage.markdown.serialize.call(this,t,e,n):`\\
187
+ `);return}},parse:{}}}}}),qM=I.create({name:"heading"}).extend({addStorage(){return{markdown:{serialize:Gt.nodes.heading,parse:{}}}}}),VM=I.create({name:"horizontalRule"}).extend({addStorage(){return{markdown:{serialize:Gt.nodes.horizontal_rule,parse:{}}}}}),WM=I.create({name:"image"}).extend({addStorage(){return{markdown:{serialize:Gt.nodes.image,parse:{}}}}}),UM=I.create({name:"listItem"}).extend({addStorage(){return{markdown:{serialize:Gt.nodes.list_item,parse:{}}}}}),KM=I.create({name:"orderedList"});function JM(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}var GM=KM.extend({addStorage(){return{markdown:{serialize(t,e,n,r){let i=e.attrs.start||1,o=String(i+e.childCount-1).length,s=t.repeat(" ",o+2),a=JM(e,n,r)%2?") ":". ";t.renderList(e,s,l=>{let c=String(i+l);return t.repeat(" ",o-c.length)+c+a})},parse:{}}}}}),ZM=I.create({name:"paragraph"}).extend({addStorage(){return{markdown:{serialize:Gt.nodes.paragraph,parse:{}}}}});function Ja(t){var e;return(t==null||(e=t.content)==null?void 0:e.content)??[]}var XM=I.create({name:"table"}).extend({addStorage(){return{markdown:{serialize(t,e,n){if(!QM(e)){ko.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,o)=>{if(t.write("| "),r.forEach((s,a,l)=>{l&&t.write(" | ");let c=s.firstChild;c.textContent.trim()&&t.renderInline(c)}),t.write(" |"),t.ensureNewLine(),!o){let s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${s} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function Vf(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function QM(t){let e=Ja(t),n=e[0],r=e.slice(1);return!(Ja(n).some(i=>i.type.name!=="tableHeader"||Vf(i)||i.childCount>1)||r.some(i=>Ja(i).some(o=>o.type.name==="tableHeader"||Vf(o)||o.childCount>1)))}var YM=[jM,Hf,HM,qf,qM,VM,ko,WM,UM,GM,ZM,XM,I.create({name:"taskItem"}).extend({addStorage(){return{markdown:{serialize(t,e){let n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{let n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),I.create({name:"taskList"}).extend({addStorage(){return{markdown:{serialize:Hf.storage.markdown.serialize,parse:{setup(t){t.use(DM.default)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),I.create({name:"text"}).extend({addStorage(){return{markdown:{serialize(t,e){t.text(LM(e.text))},parse:{}}}}}),At.create({name:"bold"}).extend({addStorage(){return{markdown:{serialize:Gt.marks.strong,parse:{}}}}}),At.create({name:"code"}).extend({addStorage(){return{markdown:{serialize:Gt.marks.code,parse:{}}}}}),Pf,At.create({name:"italic"}).extend({addStorage(){return{markdown:{serialize:Gt.marks.em,parse:{}}}}}),At.create({name:"link"}).extend({addStorage(){return{markdown:{serialize:Gt.marks.link,parse:{}}}}}),At.create({name:"strike"}).extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}})];function bo(t){let e=t.storage?.markdown,n=YM.find(r=>r.name===t.name)?.storage.markdown;return e||n?{...n,...e}:null}var tA=class{constructor(t){yo(this,"editor",null),this.editor=t}serialize(t){let e=new $M(this.nodes,this.marks,{hardBreakNodeName:qf.name});return e.renderContent(t),e.out}get nodes(){return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(t=>[t,this.serializeNode(ko)])),...Object.fromEntries(this.editor.extensionManager.extensions.filter(t=>t.type==="node"&&this.serializeNode(t)).map(t=>[t.name,this.serializeNode(t)])??[])}}get marks(){return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(t=>[t,this.serializeMark(Pf)])),...Object.fromEntries(this.editor.extensionManager.extensions.filter(t=>t.type==="mark"&&this.serializeMark(t)).map(t=>[t.name,this.serializeMark(t)])??[])}}serializeNode(t){var e;return(e=bo(t))==null||(e=e.serialize)==null?void 0:e.bind({editor:this.editor,options:t.options})}serializeMark(t){let e=bo(t)?.serialize;return e?{...e,open:typeof e.open=="function"?e.open.bind({editor:this.editor,options:t.options}):e.open,close:typeof e.close=="function"?e.close.bind({editor:this.editor,options:t.options}):e.close}:null}},eA=class{constructor(t,e){yo(this,"editor",null),yo(this,"md",null);let{html:n,linkify:r,breaks:i}=e;this.editor=t,this.md=this.withPatchedRenderer(St({html:n,linkify:r,breaks:i}))}parse(t){let{inline:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(r=>{var i;return(i=bo(r))==null||(i=i.parse)==null||(i=i.setup)==null?void 0:i.call({editor:this.editor,options:r.options},this.md)});let n=Ka(this.md.render(t));return this.editor.extensionManager.extensions.forEach(r=>{var i;return(i=bo(r))==null||(i=i.parse)==null||(i=i.updateDOM)==null?void 0:i.call({editor:this.editor,options:r.options},n)}),this.normalizeDOM(n,{inline:e,content:t}),n.innerHTML}return t}normalizeDOM(t,e){let{inline:n,content:r}=e;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(i=>{i.nextSibling?.nodeType===Node.TEXT_NODE&&!i.closest("pre")&&(i.nextSibling.textContent=i.nextSibling.textContent.replace(/^\n/,""))}),n&&this.normalizeInline(t,r),t}normalizeBlocks(t){let e=Object.values(this.editor.schema.nodes).filter(n=>n.isBlock).map(n=>n.spec.parseDOM?.map(r=>r.tag)).flat().filter(Boolean).join(",");e&&[...t.querySelectorAll(e)].forEach(n=>{n.parentElement.matches("p")&&IM(n)})}normalizeInline(t,e){var n;if((n=t.firstElementChild)!=null&&n.matches("p")){let r=t.firstElementChild,{nextElementSibling:i}=r,o=e.match(/^\s+/)?.[0]??"",s=i?"":e.match(/\s+$/)?.[0]??"";if(e.match(/^\n\n/)){r.innerHTML=`${r.innerHTML}${s}`;return}FM(r),t.innerHTML=`${o}${t.innerHTML}${s}`}}withPatchedRenderer(t){let e=n=>function(){let r=n(...arguments);return r===`
188
+ `?r:r[r.length-1]===`
189
+ `?r.slice(0,-1):r};return t.renderer.rules.hardbreak=e(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=e(t.renderer.rules.softbreak),t.renderer.rules.fence=e(t.renderer.rules.fence),t.renderer.rules.code_block=e(t.renderer.rules.code_block),t.renderer.renderToken=e(t.renderer.renderToken.bind(t.renderer)),t}},nA=V.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new j({key:new J("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;let r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return Ze.fromSchema(this.editor.schema).parseSlice(Ka(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),rA=V.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){let t=Pu.Commands.config.addCommands();return{setContent:(e,n)=>r=>t.setContent(r.editor.storage.markdown.parser.parse(e),n)(r),insertContentAt:(e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new eA(this.editor,this.options),serializer:new tA(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[NM.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),nA.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function iA(t){let{char:e,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,a=n&&!r,l=eb(e),c=RegExp(`\\s${l}$`),d=o?"^":"",u=r?"":l,h=RegExp(a?`${d}${l}.*?(?=\\s${u}|$)`:`${d}(?:^)?${l}[^\\s${u}]*`,"gm"),p=s.nodeBefore?.isText&&s.nodeBefore.text;if(!p)return null;let f=s.pos-p.length,m=Array.from(p.matchAll(h)).pop();if(!m||m.input===void 0||m.index===void 0)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!y)return null;let b=f+m.index,w=b+m[0].length;return a&&c.test(p.slice(w-1,w+1))&&(m[0]+=" ",w+=1),b<s.pos&&w>=s.pos?{range:{from:b,to:w},query:m[0].slice(e.length),text:m[0]}:null}function oA(t){return t.docChanged?t.steps.some(e=>{let n=e.slice;if(!n?.content)return!1;let r=n.content.textBetween(0,n.content.size,`
190
+ `);return/\s/.test(r)}):!1}function sA(t){return()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:o}=t.view.coordsAtPos(e);try{return new DOMRect(o,n,r-o,i-n)}catch{return null}}}function aA(t,e,n,r){return n?()=>{let i=r.getState(t.state)?.decorationId;return e.dom.querySelector(`[data-decoration-id="${i}"]`)?.getBoundingClientRect()||null}:sA(t)}function lA({match:t,dismissedRange:e,state:n,transaction:r,editor:i,shouldResetDismissed:o,effectiveAllowSpaces:s}){return o?.({editor:i,state:n,range:e,match:t,transaction:r,allowSpaces:s})?!1:s?t.range.from===e.from:t.range.from===e.from&&!oA(r)}function cA({view:t,pluginKeyRef:e}){let n=t.state.tr.setMeta(e,{exit:!0});t.dispatch(n)}function dA({pluginKey:t,decorationTag:e,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:o,dispatchExit:s}){return{handleKeyDown(a,l){var c;let d=t.getState(a.state);return d.active?l.key==="Escape"||l.key==="Esc"?((c=o?.onKeyDown)==null||c.call(o,{view:a,event:l,range:d.range}),s(a),!0):o?.onKeyDown?.call(o,{view:a,event:l,range:d.range})||!1:!1},decorations(a){let{active:l,range:c,decorationId:d,query:u}=t.getState(a);if(!l)return null;let h=!u?.length,p=[n];return h&&p.push(i),q.create(a.doc,[wt.inline(c.from,c.to,{nodeName:e,class:p.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":r})])}}}function uA({editor:t,char:e,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:o,findSuggestionMatch:s,allow:a,shouldShow:l,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,h,p,f){let{isEditable:m}=t,{composing:g}=t.view,{selection:y}=u,{empty:b,from:w}=y,k={...h},v=u.getMeta(d);if(v&&v.exit)return k.active=!1,k.decorationId=null,k.range={from:0,to:0},k.query=null,k.text=null,k.dismissedRange=h.active?{...h.range}:h.dismissedRange,k;if(k.composing=g,u.docChanged&&k.dismissedRange!==null&&(k.dismissedRange={from:u.mapping.map(k.dismissedRange.from),to:u.mapping.map(k.dismissedRange.to)}),m&&(b||t.view.composing)){(w<h.range.from||w>h.range.to)&&!g&&!h.composing&&(k.active=!1);let E=s({char:e,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:o,$position:y.$from}),S=`id_${Math.floor(Math.random()*4294967295)}`;E&&a({editor:t,state:f,range:E.range,isActive:h.active})&&(!l||l({editor:t,range:E.range,query:E.query,text:E.text,transaction:u}))?(k.dismissedRange!==null&&!c({match:E,dismissedRange:k.dismissedRange,state:f,transaction:u})&&(k.dismissedRange=null),k.dismissedRange===null?(k.active=!0,k.decorationId=h.decorationId||S,k.range=E.range,k.query=E.query,k.text=E.text):k.active=!1):(E||(k.dismissedRange=null),k.active=!1)}else k.active=!1;return k.active||(k.decorationId=null,k.range={from:0,to:0},k.query=null,k.text=null),k}}}function hA({editor:t,items:e}){let n=null,r=null,i=null,o=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},s=l=>new Promise(c=>{i=c,r=setTimeout(()=>{r=null;let d=i;i=null,d?.()},l)}),a=()=>{n?.abort(),o(),n=null};return{abort:a,fetch:async(l,c)=>{a(),n=new AbortController;let d=n;if(c>0&&await s(c),n!==d||d.signal.aborted)return{status:"aborted"};try{let u=await e({editor:t,query:l,signal:d.signal});return n!==d||d.signal.aborted?{status:"aborted"}:{status:"resolved",items:u}}catch{return n!==d||d.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function pA({placement:t,offset:e,flip:n,floatingUi:r}){let i=[wm({mainAxis:e.mainAxis??4,crossAxis:e.crossAxis??0})];return n&&i.push(bm()),r?.middleware?.length&&i.push(...r.middleware),{placement:t,strategy:r?.strategy??"absolute",middleware:i}}function fA(t){if(t instanceof HTMLElement)return t;if(typeof t=="string")try{let e=document.querySelector(t);if(e)return e}catch{return document.body}return document.body}function mA({getReferenceRect:t,contextElement:e,config:n,container:r,dismissOnOutsideClick:i,dismiss:o}){return(s,a={})=>{let l={getBoundingClientRect:()=>t()??new DOMRect,contextElement:e},c=!1,d=!s.isConnected;d&&fA(r).appendChild(s),a.onPosition||(s.style.visibility="hidden",s.style.width="max-content");let u=km(l,s,()=>{ym(l,s,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:p,y:f,placement:m,strategy:g})=>{if(a.onPosition){a.onPosition({x:p,y:f,placement:m,strategy:g});return}Object.assign(s.style,{position:g,left:`${p}px`,top:`${f}px`}),c||(c=!0,s.style.visibility="")})},a.autoUpdate),h;return i&&(h=p=>{let f=p.target;!(f instanceof Node)||s.contains(f)||e.contains(f)||o()},document.addEventListener("pointerdown",h,!0)),()=>{u(),h&&document.removeEventListener("pointerdown",h,!0),d&&s.remove()}}}function gA({editor:t,pluginKey:e,items:n,renderer:r,minQueryLength:i,debounce:o,initialItems:s,placement:a,offset:l,container:c,flip:d,floatingUi:u,dismissOnOutsideClick:h,command:p,clientRectFor:f,dispatchExit:m}){let g,y=hA({editor:t,items:n}),b=pA({placement:a,offset:l,flip:d,floatingUi:u});function w(k,v){var E,S,A;switch(k){case"started":(E=r?.onStart)==null||E.call(r,v);break;case"updated":(S=r?.onUpdate)==null||S.call(r,v);break;case"stopped":(A=r?.onExit)==null||A.call(r,v);break;default:break}}return{update:async(k,v)=>{var E,S;let A=e.getState(v),_=e.getState(k.state);if(!A||!_)return;let z=null,nt=A.query!==_.query,lt=A.text!==_.text,P=A.range.from!==_.range.from||A.range.to!==_.range.to,H=nt||lt||P;if(!A.active&&_.active)z="started";else if(A.active&&!_.active)z="stopped";else if(_.active&&H)z="updated";else return;let Z=z==="stopped"?A:_,Bt=k.dom.querySelector(`[data-decoration-id="${Z.decorationId}"]`),Rr=f(k,Bt),um=i===0||(Z.query?Z.query.length>=i:!1),al=(z==="started"||z==="updated")&&um;if(g={editor:t,range:Z.range,query:Z.query||"",text:Z.text||"",items:s??[],command:Mn=>p({editor:t,range:Z.range,props:Mn}),decorationNode:Bt,clientRect:Rr,loading:al,placement:a,offset:{mainAxis:l.mainAxis??4,crossAxis:l.crossAxis??0},container:c,flip:d,floatingUi:b,mount:mA({getReferenceRect:Rr,contextElement:k.dom,config:b,container:c,dismissOnOutsideClick:h,dismiss:()=>m(t.view)})},z==="started"&&((E=r?.onBeforeStart)==null||E.call(r,g)),z==="updated"&&((S=r?.onBeforeUpdate)==null||S.call(r,g)),z==="started"&&w(z,g),z==="started"||z==="updated")if(!al)y.abort(),g={...g,items:s??[],loading:!1};else{g={...g,items:s??[],loading:!0},z="updated",w(z,g);let Mn=await y.fetch(Z.query||"",o);if(Mn.status==="aborted")return;if(!e.getState(k.state)?.active){y.abort();return}g=Mn.status==="resolved"?{...g,items:Mn.items,loading:!1}:{...g,loading:!1}}if(z==="stopped"){y.abort(),w(z,g),g=void 0;return}z==="updated"&&w(z,g)},destroy:()=>{var k;y.abort(),g&&((k=r?.onExit)==null||k.call(r,g))}}}var yA=new J("suggestion");function kA({pluginKey:t=yA,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:u=()=>null,items:h=()=>[],minQueryLength:p=0,debounce:f=0,initialItems:m,placement:g="bottom-start",offset:y={},container:b,flip:w=!0,floatingUi:k,dismissOnOutsideClick:v=!0,render:E=()=>({}),allow:S=()=>!0,findSuggestionMatch:A=iA,shouldShow:_,shouldResetDismissed:z}){let nt=E?.(),lt=r&&!i,P=(Bt,Rr)=>aA(e,Bt,Rr,t);function H(Bt){return lA({...Bt,editor:e,shouldResetDismissed:z,effectiveAllowSpaces:lt})}let Z=Bt=>cA({view:Bt,pluginKeyRef:t});return new j({key:t,view:()=>gA({editor:e,pluginKey:t,items:h,renderer:nt,minQueryLength:p,debounce:f,initialItems:m,placement:g,offset:y,container:b,flip:w,floatingUi:k,dismissOnOutsideClick:v,command:u,clientRectFor:P,dispatchExit:Z}),state:uA({editor:e,char:n,effectiveAllowSpaces:lt,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,findSuggestionMatch:A,allow:S,shouldShow:_,shouldKeepDismissed:H,pluginKey:t}),props:dA({pluginKey:t,decorationTag:a,decorationClass:l,decorationContent:c,decorationEmptyClass:d,renderer:nt,dispatchExit:Z})})}var bA=kA;function wA(t){return V.create({name:"slashMenu",addProseMirrorPlugins(){return[bA({editor:this.editor,char:"/",allowedPrefixes:[" ",`
191
+ `],items:({query:e})=>t.filter(e),command:({editor:e,range:n,props:r})=>r.run({editor:e,range:n}),render:()=>{let e=n=>t.open({rect:n.clientRect?.()??null,items:n.items,pick:n.command});return{onStart:e,onUpdate:e,onKeyDown:({event:n})=>t.keyDown(n),onExit:()=>t.close()}}})]}})}function vA(t){return[Px.configure({link:{openOnClick:!1},underline:!1}),Zh,Gh.configure({nested:!0}),jp,Ip,Lp,$p,YC.configure({inline:!1}),rA.configure({transformPastedText:!0,linkify:!1}),...t.placeholder?[zx.configure({placeholder:t.placeholder})]:[],...t.slash?[wA(t.slash)]:[]]}var Ee=(t,e)=>{let n=t.chain().focus();return e?n.deleteRange(e):n},Ga=(t,e)=>({key:`h${t}`,icon:e,run:(n,r)=>Ee(n,r).toggleHeading({level:t}).run(),active:n=>n.isActive("heading",{level:t})}),xr=[Ga(1,Pm),Ga(2,jm),Ga(3,Hm),{key:"bulletList",icon:_m,run:(t,e)=>Ee(t,e).toggleBulletList().run(),active:t=>t.isActive("bulletList")},{key:"orderedList",icon:Am,run:(t,e)=>Ee(t,e).toggleOrderedList().run(),active:t=>t.isActive("orderedList")},{key:"taskList",icon:Sm,run:(t,e)=>Ee(t,e).toggleTaskList().run(),active:t=>t.isActive("taskList")},{key:"blockquote",icon:Mm,run:(t,e)=>Ee(t,e).toggleBlockquote().run(),active:t=>t.isActive("blockquote")},{key:"codeBlock",icon:Nm,run:(t,e)=>Ee(t,e).toggleCodeBlock().run(),active:t=>t.isActive("codeBlock")},{key:"horizontalRule",icon:xm,run:(t,e)=>Ee(t,e).setHorizontalRule().run()},{key:"table",icon:Dm,run:(t,e)=>Ee(t,e).insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),active:t=>t.isActive("table")}],Et=(0,L.forwardRef)(({icon:t,label:e,active:n,disabled:r,tone:i,onClick:o,...s},a)=>(0,T.jsx)("button",{ref:a,type:"button","aria-label":e,title:e,"aria-pressed":n??!1,disabled:r,onClick:o,...s,className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 ${i==="danger"?"hover:bg-muted hover:text-destructive":"hover:bg-muted hover:text-foreground"} ${n?"bg-muted text-primary":""}`,children:(0,T.jsx)(t,{size:15})}));Et.displayName="ToolButton";var wo=()=>(0,T.jsx)("span",{className:"mx-0.5 h-5 w-px shrink-0 bg-border","aria-hidden":!0}),Za=[{key:"bold",icon:Im,run:t=>t.chain().focus().toggleBold().run(),active:t=>t.isActive("bold")},{key:"italic",icon:Vm,run:t=>t.chain().focus().toggleItalic().run(),active:t=>t.isActive("italic")},{key:"strike",icon:Um,run:t=>t.chain().focus().toggleStrike().run(),active:t=>t.isActive("strike")},{key:"code",icon:Em,run:t=>t.chain().focus().toggleCode().run(),active:t=>t.isActive("code")}];function xA({editor:t,onDone:e}){let{t:n}=An(),[r,i]=(0,L.useState)(t.getAttributes("link").href??""),o=()=>{let s=t.chain().focus().extendMarkRange("link");r.trim()===""?s.unsetLink().run():s.setLink({href:r.trim()}).run(),e()};return(0,T.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,T.jsx)(Eo,{autoFocus:!0,value:r,placeholder:"https://","aria-label":n("form.mdLink"),onChange:s=>i(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),o()),s.key==="Escape"&&(s.preventDefault(),e())},className:"h-7 flex-1 text-sm"}),(0,T.jsx)(Et,{icon:ll,label:n("actions.save"),onClick:o}),(0,T.jsx)(Et,{icon:Jm,label:n("form.md.unlink"),onClick:()=>{t.chain().focus().extendMarkRange("link").unsetLink().run(),e()}})]})}function CA({editor:t,onDone:e}){let{t:n}=An(),[r,i]=(0,L.useState)(""),[o,s]=(0,L.useState)(""),a=()=>{let l=r.trim();l&&t.chain().focus().setImage({src:l,alt:o.trim()||void 0}).run(),e()};return(0,T.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,T.jsx)(Eo,{autoFocus:!0,value:r,placeholder:"https://\u2026 /uploads/\u2026","aria-label":n("form.md.imageUrl"),onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a()),l.key==="Escape"&&(l.preventDefault(),e())},className:"h-7 min-w-0 flex-1 text-sm"}),(0,T.jsx)(Eo,{value:o,placeholder:n("form.md.imageAlt"),"aria-label":n("form.md.imageAlt"),onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a()),l.key==="Escape"&&(l.preventDefault(),e())},className:"h-7 w-32 text-sm"}),(0,T.jsx)(Et,{icon:ll,label:n("actions.save"),disabled:!r.trim(),onClick:a})]})}function SA({editor:t}){let{t:e}=An();return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(wo,{}),(0,T.jsx)(Et,{icon:Lm,label:e("form.md.addRow"),onClick:()=>t.chain().focus().addRowAfter().run()}),(0,T.jsx)(Et,{icon:$m,label:e("form.md.addColumn"),onClick:()=>t.chain().focus().addColumnAfter().run()}),(0,T.jsx)(Et,{icon:zm,tone:"danger",label:e("form.md.deleteRow"),onClick:()=>t.chain().focus().deleteRow().run()}),(0,T.jsx)(Et,{icon:Fm,tone:"danger",label:e("form.md.deleteColumn"),onClick:()=>t.chain().focus().deleteColumn().run()}),(0,T.jsx)(Et,{icon:Bm,tone:"danger",label:e("form.md.deleteTable"),onClick:()=>t.chain().focus().deleteTable().run()})]})}function Wf({icon:t,label:e,active:n,open:r,onOpenChange:i,children:o}){return(0,T.jsxs)(Rm,{open:r,onOpenChange:i,children:[(0,T.jsx)(Tm,{render:(0,T.jsx)(Et,{icon:t,label:e,active:n||r})}),(0,T.jsx)(Om,{align:"start",className:"w-80 p-2",children:o})]})}function EA({editor:t}){let{t:e}=An(),[n,r]=(0,L.useState)(null),i=ah({editor:t,selector:({editor:s})=>s&&!s.isDestroyed?{marks:Za.map(a=>a.active(s)),blocks:xr.map(a=>a.active?.(s)??!1),link:s.isActive("link"),table:s.isActive("table"),canUndo:s.can().undo(),canRedo:s.can().redo()}:{marks:Za.map(()=>!1),blocks:xr.map(()=>!1),link:!1,table:!1,canUndo:!1,canRedo:!1}}),o=s=>(0,T.jsx)("div",{className:"flex items-center gap-0.5",children:s});return(0,T.jsx)("div",{className:"flex flex-col gap-1.5",children:(0,T.jsxs)("div",{className:"-mx-0.5 flex items-center gap-0.5 overflow-x-auto overscroll-x-contain border-b border-border px-0.5 pb-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[o((0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Et,{icon:Km,label:e("form.md.undo"),disabled:!i.canUndo,onClick:()=>t.chain().focus().undo().run()}),(0,T.jsx)(Et,{icon:Wm,label:e("form.md.redo"),disabled:!i.canRedo,onClick:()=>t.chain().focus().redo().run()})]})),(0,T.jsx)(wo,{}),o(Za.map((s,a)=>(0,T.jsx)(Et,{icon:s.icon,label:e(`form.md.${s.key}`),active:i.marks[a],onClick:()=>s.run(t)},s.key))),(0,T.jsx)(wo,{}),o(xr.map((s,a)=>(0,T.jsx)(Et,{icon:s.icon,label:e(`form.md.${s.key}`),active:i.blocks[a],onClick:()=>s.run(t)},s.key))),(0,T.jsx)(wo,{}),o((0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Wf,{icon:Cm,label:e("form.md.link"),active:i.link,open:n==="link",onOpenChange:s=>r(s?"link":null),children:(0,T.jsx)(xA,{editor:t,onDone:()=>r(null)})}),(0,T.jsx)(Wf,{icon:qm,label:e("form.md.image"),open:n==="image",onOpenChange:s=>r(s?"image":null),children:(0,T.jsx)(CA,{editor:t,onDone:()=>r(null)})})]})),i.table&&(0,T.jsx)(SA,{editor:t})]})})}var Uf=t=>t&&!t.isDestroyed?t.storage.markdown:void 0;function MA({value:t,onChange:e,placeholder:n,readonly:r}){let{t:i}=An(),[o,s]=(0,L.useState)(null),a=(0,L.useRef)(null);a.current=o;let l=h=>i(`form.md.${h}`),c=(0,L.useRef)(l);c.current=l;let d=(0,L.useMemo)(()=>({filter:h=>{let p=h.trim().toLowerCase(),f=xr.map(m=>({key:m.key,run:({editor:g,range:y})=>m.run(g,y)}));return p?f.filter(m=>m.key.toLowerCase().includes(p)||c.current(m.key).toLowerCase().includes(p)):f},open:({rect:h,items:p,pick:f})=>s(m=>({rect:h,items:p,pick:f,index:m&&m.index<p.length?m.index:0})),close:()=>s(null),keyDown:h=>{let p=a.current;if(!p)return!1;let f=p.items.length-1;if(h.key==="ArrowDown")return s({...p,index:p.index>=f?0:p.index+1}),!0;if(h.key==="ArrowUp")return s({...p,index:p.index<=0?f:p.index-1}),!0;if(h.key==="Enter"){let m=p.items[p.index];return m?(p.pick(m),!0):!1}return h.key==="Escape"?(s(null),!0):!1}}),[]),u=gw({editable:!r,extensions:vA({placeholder:r?void 0:n,slash:d}),content:t,autofocus:!1,onUpdate:({editor:h})=>{let p=Uf(h);p&&e?.(p.getMarkdown())},editorProps:{attributes:{class:"md-static outline-none"}}});return(0,L.useEffect)(()=>{let h=Uf(u);!u||!h||t!==h.getMarkdown()&&u.commands.setContent(t,{emitUpdate:!1})},[u,t]),!u||u.isDestroyed?null:(0,T.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-1.5 md:gap-2",children:[!r&&(0,T.jsx)(EA,{editor:u}),(0,T.jsx)(sh,{editor:u,className:`min-h-48 w-full min-w-0 max-w-full flex-1 overflow-y-auto bg-transparent px-2 py-1.5 transition-colors focus-within:border-ring md:min-h-64 md:px-4 md:py-3 ${r?"border-t border-border":"border-0"}`}),o&&o.items.length>0&&(0,T.jsx)("div",{role:"listbox",className:"fixed z-50 max-h-64 w-56 overflow-y-auto rounded-lg border border-border bg-card p-1 shadow-lg",style:{top:(o.rect?.bottom??0)+4,left:o.rect?.left??0},children:o.items.map((h,p)=>{let f=xr.find(m=>m.key===h.key)?.icon;return(0,T.jsxs)("button",{type:"button",role:"option","aria-selected":p===o.index,onMouseEnter:()=>s({...o,index:p}),onClick:()=>o.pick(h),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm ${p===o.index?"bg-muted text-foreground":"text-muted-foreground"}`,children:[f&&(0,T.jsx)(f,{size:15,className:"shrink-0"}),l(h.key)]},h.key)})})]})}export{MA as default};