ghost 6.56.0 → 6.57.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 (385) hide show
  1. package/bin/validate-adapters.js +74 -0
  2. package/bin/validate-adapters.ts +87 -0
  3. package/bin/warm-compile-cache.sh +60 -0
  4. package/components/tryghost-custom-field-types-0.0.0.tgz +0 -0
  5. package/components/tryghost-kg-html-to-lexical-1.3.3.tgz +0 -0
  6. package/components/tryghost-kg-lexical-html-renderer-1.4.3.tgz +0 -0
  7. package/components/tryghost-parse-email-address-0.0.0.tgz +0 -0
  8. package/core/app.js +1 -1
  9. package/core/boot.js +21 -25
  10. package/core/bridge.js +10 -12
  11. package/core/built/admin/assets/Combination-BDvCdg1t.js +41 -0
  12. package/core/built/admin/assets/about-C7O-AgRZ.js +1 -0
  13. package/core/built/admin/assets/{account-migration-D3O_yVck.js → account-migration-Cv_ol1ko.js} +1 -1
  14. package/core/built/admin/assets/action-list-lGzZLHc8.js +1 -0
  15. package/core/built/admin/assets/activitypub/{account-migration-D8FbP-Z-.js → account-migration-DHFbePl6.js} +7 -7
  16. package/core/built/admin/assets/activitypub/activitypub.js +3 -3
  17. package/core/built/admin/assets/activitypub/{avatar-11EA1VSs.js → avatar-CT4tS2_S.js} +2 -2
  18. package/core/built/admin/assets/activitypub/{avatar-flipboard-jfbLG-xe.js → avatar-flipboard-ByYWKipo.js} +2 -2
  19. package/core/built/admin/assets/activitypub/{bluesky-sharing-f1jTQe2P.js → bluesky-sharing-srVnSHDz.js} +8 -8
  20. package/core/built/admin/assets/activitypub/{content-formatters-nmTOPY9M.js → content-formatters-C2sos5Ht.js} +3 -3
  21. package/core/built/admin/assets/activitypub/{copy-BCwo9ep3.js → copy-B1UBTOoZ.js} +2 -2
  22. package/core/built/admin/assets/activitypub/{dist-BEfX-0aW.js → dist-MPsb2WZ1.js} +4 -4
  23. package/core/built/admin/assets/activitypub/{domain-AaDlZlrA.js → domain-DzcM9Dzo.js} +9 -9
  24. package/core/built/admin/assets/activitypub/{edit-profile-DPi8Tl5M.js → edit-profile-CsQ_4xAk.js} +5 -5
  25. package/core/built/admin/assets/activitypub/{explore-CxTzjILQ.js → explore-CJe0DZBK.js} +8 -8
  26. package/core/built/admin/assets/activitypub/{feed-DPv5x2MX.js → feed-CKV3qWON.js} +9 -9
  27. package/core/built/admin/assets/activitypub/{field-DbgA8lat.js → field-DckHfDJf.js} +3 -3
  28. package/core/built/admin/assets/activitypub/{hash-BWuZoYkA.js → hash-Dlp8RM55.js} +2 -2
  29. package/core/built/admin/assets/activitypub/{inbox-35VDQ2K2.js → inbox-CsPy4R0M.js} +2 -2
  30. package/core/built/admin/assets/activitypub/{inbox-DSrF_i1O.js → inbox-DAsjzUUe.js} +10 -10
  31. package/core/built/admin/assets/activitypub/{label-CPjFBbo7.js → label-DWyo9E5T.js} +3 -3
  32. package/core/built/admin/assets/activitypub/layout-DM_3pqsU.js +1 -0
  33. package/core/built/admin/assets/activitypub/{moderation-BkDC1XVZ.js → moderation-B0Inc03M.js} +7 -7
  34. package/core/built/admin/assets/activitypub/{note-xEyH4xT-.js → note-CSE54lER.js} +7 -7
  35. package/core/built/admin/assets/activitypub/{notifications-DClaL3ui.js → notifications-RSwbKqdh.js} +9 -9
  36. package/core/built/admin/assets/activitypub/{preferences-DpnOa-4Z.js → preferences-CE231n2_.js} +11 -11
  37. package/core/built/admin/assets/activitypub/{profile-Dvi9mz-6.js → profile-aaQ1j1Eo.js} +13 -13
  38. package/core/built/admin/assets/activitypub/{reply-Cs9ySd6Z.js → reply-Cjb0Vs3m.js} +2 -2
  39. package/core/built/admin/assets/activitypub/{routes-DFBeTnfn.js → routes-Djb0mc9k.js} +26 -26
  40. package/core/built/admin/assets/activitypub/{separator-C5u_VjzY.js → separator-D8pROI5n.js} +3 -3
  41. package/core/built/admin/assets/activitypub/{settings-CV2fFu6D.js → settings-DMc32IQl.js} +5 -5
  42. package/core/built/admin/assets/activitypub/{site-_TgDd_EM.js → site-DVIcsohX.js} +4 -4
  43. package/core/built/admin/assets/activitypub/{step-1-BfnNL2oF.js → step-1-9Yey9usF.js} +5 -5
  44. package/core/built/admin/assets/activitypub/{step-2-DLndZkO-.js → step-2-DdYmKRXV.js} +6 -6
  45. package/core/built/admin/assets/activitypub/{step-3-A-PZTtRE.js → step-3-hdSkcjZU.js} +10 -10
  46. package/core/built/admin/assets/activitypub/{tabs-BUbz7tea.js → tabs-CUqseYzQ.js} +6 -6
  47. package/core/built/admin/assets/activitypub/{topic-filter-BdX_xYYT.js → topic-filter-Coni6OXM.js} +3 -3
  48. package/core/built/admin/assets/activitypub/{use-activity-pub-queries-EwuRemHh.js → use-activity-pub-queries-MeHTPMQv.js} +2 -2
  49. package/core/built/admin/assets/activitypub/{use-navigate-with-base-path-cy4ACBc4.js → use-navigate-with-base-path-B046AM38.js} +24 -7
  50. package/core/built/admin/assets/activitypub/{use-reply-chain-data-CyFcGfan.js → use-reply-chain-data-1AO-Xob6.js} +5 -5
  51. package/core/built/admin/assets/activitypub/{x-7zk8mV2p.js → x-BRfRYd16.js} +2 -2
  52. package/core/built/admin/assets/add-integration-modal-m9Dv6f77.js +1 -0
  53. package/core/built/admin/assets/add-newsletter-modal-CPSVZL2H.js +1 -0
  54. package/core/built/admin/assets/add-recommendation-modal-Ci9Z5yat.js +1 -0
  55. package/core/built/admin/assets/analytics-DqSCVV8U.js +1 -0
  56. package/core/built/admin/assets/announcement-bar-modal-DU3avV7d.js +1 -0
  57. package/core/built/admin/assets/api-keys-BK0LylyK.js +1 -0
  58. package/core/built/admin/assets/api-keys-_iCT4dxr.js +1 -0
  59. package/core/built/admin/assets/{audience-CkBb2LlO.js → audience-DTJtXXWY.js} +1 -1
  60. package/core/built/admin/assets/automated-emails-PayPCT8L.js +1 -0
  61. package/core/built/admin/assets/{automations-DhKeS_U5.js → automations-162q5HjL.js} +1 -1
  62. package/core/built/admin/assets/{automations-cMllU545.js → automations-dtQ_MRZ7.js} +1 -1
  63. package/core/built/admin/assets/{bluesky-sharing-DPGpyD-G.js → bluesky-sharing-B8Es3AuV.js} +1 -1
  64. package/core/built/admin/assets/brand-icon-09YqFZjV.js +1 -0
  65. package/core/built/admin/assets/{breadcrumb-DIfcF5ow.js → breadcrumb-tg5zL--z.js} +1 -1
  66. package/core/built/admin/assets/{chart-helpers-DV0FkdcD.js → chart-helpers-CZElTGYL.js} +1 -1
  67. package/core/built/admin/assets/checkbox-Cyo-x7mC.js +1 -0
  68. package/core/built/admin/assets/{chunk.524.87b52f4fada529df2c4c.js → chunk.524.cd5498dd4e195f679266.js} +4 -4
  69. package/core/built/admin/assets/{chunk.582.340bcca873e806cbd4bb.js → chunk.582.6f92ec1f03734bf2ea3f.js} +6 -6
  70. package/core/built/admin/assets/{chunk.332.05991a101d67f732dec3.js → chunk.873.b8fc05a8ab877fb819ed.js} +28 -27
  71. package/core/built/admin/assets/code-editor-view-Dq1rQ4tS.js +1 -0
  72. package/core/built/admin/assets/color-picker-field-BonBgxhU.js +1 -0
  73. package/core/built/admin/assets/color-utils-BsrwXuDz.js +1 -0
  74. package/core/built/admin/assets/combobox-uX5r_paI.js +1 -0
  75. package/core/built/admin/assets/command-DxwBO2pF.js +1 -0
  76. package/core/built/admin/assets/comments-Dn-RO-nU.js +1 -0
  77. package/core/built/admin/assets/components-CwL6a6As-B0E0-NBJ.js +1 -0
  78. package/core/built/admin/assets/confirmation-modal-B6D6mk6R.js +1 -0
  79. package/core/built/admin/assets/content-api-modal-BxQ-7T6u.js +1 -0
  80. package/core/built/admin/assets/copy-field-BAxL4Zqn.js +1 -0
  81. package/core/built/admin/assets/currency-Dy4Tc2R2.js +1 -0
  82. package/core/built/admin/assets/custom-integration-modal---d_l7lc.js +1 -0
  83. package/core/built/admin/assets/{date-range-select-dXc-GsVe.js → date-range-select-PB2n1HZf.js} +1 -1
  84. package/core/built/admin/assets/debounce-Dg2fW5Rg.js +3 -0
  85. package/core/built/admin/assets/design-and-theme-modal-DYRT207a.js +23 -0
  86. package/core/built/admin/assets/dirty-confirm-dialog-BnDJ39ao.js +1 -0
  87. package/core/built/admin/assets/disabled-sources-indicator-iMHrkyV3.js +1 -0
  88. package/core/built/admin/assets/dist-B2PvRwLn.js +1 -0
  89. package/core/built/admin/assets/{dist-pHiOxyxa.js → dist-D5vhMdXf.js} +1 -1
  90. package/core/built/admin/assets/dist-DlCyLrOC.js +1 -0
  91. package/core/built/admin/assets/dist-WeOIvSYM.js +23 -0
  92. package/core/built/admin/assets/{dist-DyViJwIy.js → dist-cFzKLG7y.js} +3 -3
  93. package/core/built/admin/assets/dist-j1xxxnY8.js +1 -0
  94. package/core/built/admin/assets/dist-myQaY0ka.js +1 -0
  95. package/core/built/admin/assets/{domain-B5ogXUBa.js → domain-BR8FIdjD.js} +1 -1
  96. package/core/built/admin/assets/{dropzone-BnFG7dDP.js → dropzone-hNxmUvwD.js} +1 -1
  97. package/core/built/admin/assets/{edit-profile-B07jCZy9.js → edit-profile-CENrkY0l.js} +1 -1
  98. package/core/built/admin/assets/editor-B18D0lm8.js +8 -0
  99. package/core/built/admin/assets/embed-signup-form-modal-BsCYUMvQ.js +9 -0
  100. package/core/built/admin/assets/{explore-Ca1y8HW_.js → explore-BmrnljWw.js} +1 -1
  101. package/core/built/admin/assets/{feed-x4iFMBP4.js → feed-Dy4li6i8.js} +1 -1
  102. package/core/built/admin/assets/{field-ChCAabZg.js → field-Dh_lwk13.js} +1 -1
  103. package/core/built/admin/assets/{filter-sources-LdtH1e-T.js → filter-sources-D2zDuJH5.js} +1 -1
  104. package/core/built/admin/assets/filters-3JBQcNtJ.js +1 -0
  105. package/core/built/admin/assets/{filters-CjVKRP8U.js → filters-CFt_BDe4.js} +1 -1
  106. package/core/built/admin/assets/first-promoter-modal-D6Rjxugw.js +1 -0
  107. package/core/built/admin/assets/format-url-C-t8G6Qd.js +1 -0
  108. package/core/built/admin/assets/{ghost-7f01131115186d1af84ead76e79646dd.js → ghost-d683fbeb945b13155ea669caa5d8db41.js} +300 -298
  109. package/core/built/admin/assets/{gift-link-modal-Buqh2vXh.js → gift-link-modal-zMtlJhLQ.js} +1 -1
  110. package/core/built/admin/assets/{gift-links-CsUhefWG.js → gift-links-CVuqLhsZ.js} +1 -1
  111. package/core/built/admin/assets/global-data-provider-B949LDXJ.js +1 -0
  112. package/core/built/admin/assets/grid-CUciBfjf.js +1 -0
  113. package/core/built/admin/assets/{growth-Dy2UOSay.js → growth-C38Xtp8D.js} +2 -2
  114. package/core/built/admin/assets/{growth-DajOBdN0.js → growth-CFws67_i.js} +1 -1
  115. package/core/built/admin/assets/history-modal-ILAOkbxH.js +1 -0
  116. package/core/built/admin/assets/{hooks-CixO01lL.js → hooks-D6EE7BIt.js} +2 -2
  117. package/core/built/admin/assets/html-field-9a9Id_2q.js +1 -0
  118. package/core/built/admin/assets/iframe-buffering-e8vH4-Qn.js +1 -0
  119. package/core/built/admin/assets/images-CrQKVc9Q.js +1 -0
  120. package/core/built/admin/assets/{inbox-BUOLDoji.js → inbox-BrSRzyvz.js} +13 -13
  121. package/core/built/admin/assets/index-BHy2DZX-.js +67 -0
  122. package/core/built/admin/assets/index-Ds2iUoF6.css +1 -0
  123. package/core/built/admin/assets/index.es-B9tvf-t4.js +1 -0
  124. package/core/built/admin/assets/{input-group-uSK3XT7b.js → input-group-6vEPvX9S.js} +1 -1
  125. package/core/built/admin/assets/integration-header-B4DyXV06.js +1 -0
  126. package/core/built/admin/assets/integrations-BT6_iJvu.js +1 -0
  127. package/core/built/admin/assets/invite-user-modal-5xDCEw90.js +1 -0
  128. package/core/built/admin/assets/isEmail-BOfC647y.js +1 -0
  129. package/core/built/admin/assets/koenig-editor-base-BWLEB9Vf.js +1 -0
  130. package/core/built/admin/assets/{koenig-lexical-BFc4yFed.js → koenig-lexical-Cj62r_y9.js} +1 -1
  131. package/core/built/admin/assets/{kpi-card-BN-E6WYX.js → kpi-card-DOUnkZcN.js} +1 -1
  132. package/core/built/admin/assets/{kpi-card-CCt-qeWD.js → kpi-card-IHDo8Q56.js} +1 -1
  133. package/core/built/admin/assets/{kpi-helpers-DlxTbTs4.js → kpi-helpers-CjUdECAK.js} +1 -1
  134. package/core/built/admin/assets/{kpi-tabs-BlcUttpn.js → kpi-tabs-X3DkOYbI.js} +1 -1
  135. package/core/built/admin/assets/{label-AVrxwmsz.js → label-Dq6QaOuS.js} +1 -1
  136. package/core/built/admin/assets/label-picker-8YlhS2U3.js +1 -0
  137. package/core/built/admin/assets/{labels-DAIqKed7.js → labels-DAPjKPy2.js} +1 -1
  138. package/core/built/admin/assets/layout-TMj4P-vv.js +1 -0
  139. package/core/built/admin/assets/limit-modal-BRPsit_B.js +1 -0
  140. package/core/built/admin/assets/{link-helpers-D9LsDOkG.js → link-helpers-Bzkk68GD.js} +1 -1
  141. package/core/built/admin/assets/member-custom-fields-CmvsuuV_.js +1 -0
  142. package/core/built/admin/assets/member-detail-DCvRrkmJ.js +1 -0
  143. package/core/built/admin/assets/members-DxbSKngD.js +11 -0
  144. package/core/built/admin/assets/modal-page-BMTzFHVO.js +1 -0
  145. package/core/built/admin/assets/{moderation-CQ3urTFE.js → moderation-Da5lhhWh.js} +1 -1
  146. package/core/built/admin/assets/multi-select-combobox-CYdkH7KQ.js +1 -0
  147. package/core/built/admin/assets/navigation-modal-BIoTwtMy.js +1 -0
  148. package/core/built/admin/assets/newsletter-BptlVoJm.js +1 -0
  149. package/core/built/admin/assets/newsletter-detail-modal-BIvxqE0N.js +1 -0
  150. package/core/built/admin/assets/newsletter-emails-Bf8IZLsP.js +1 -0
  151. package/core/built/admin/assets/{newsletters-vt3Ni1Ov.js → newsletters-BgrIZk0V.js} +1 -1
  152. package/core/built/admin/assets/{newsletters-BXJbJgA-.js → newsletters-Du0lzskS.js} +1 -1
  153. package/core/built/admin/assets/{note-Dk877BTv.js → note-DYcLOmDb.js} +1 -1
  154. package/core/built/admin/assets/{notifications-CPlLjPxO.js → notifications-B2SPFIV9.js} +1 -1
  155. package/core/built/admin/assets/{offers-DEniVRD5.js → offers-Um6ab71O.js} +1 -1
  156. package/core/built/admin/assets/offers-container-modal-BZnZITMw.js +1 -0
  157. package/core/built/admin/assets/{onboarding-route-DdStOtjy.js → onboarding-route-DgdfxkQh.js} +1 -1
  158. package/core/built/admin/assets/overview-BYQJXSog.js +1 -0
  159. package/core/built/admin/assets/overview-Dt2_mR6U.js +1 -0
  160. package/core/built/admin/assets/{page-header-pp4dWmOS.js → page-header-CpmxJj5B.js} +1 -1
  161. package/core/built/admin/assets/{pages-B4goRPUn.js → pages-BVMnpI2O.js} +1 -1
  162. package/core/built/admin/assets/pintura-modal-B4MuBuuO.js +1 -0
  163. package/core/built/admin/assets/portal-frame-BF0NBIji.js +1 -0
  164. package/core/built/admin/assets/portal-modal-DMVbm0oy.js +1 -0
  165. package/core/built/admin/assets/{post-analytics-BMJrI81R.js → post-analytics-CXWBOGyP.js} +1 -1
  166. package/core/built/admin/assets/post-analytics-header-ChzjXVPt.js +1 -0
  167. package/core/built/admin/assets/{post-analytics-provider-Btml5vJI.js → post-analytics-provider-Cgw4U_fw.js} +1 -1
  168. package/core/built/admin/assets/{post-share-modal-AcUZkbfL.js → post-share-modal-B9Vmk_XM.js} +1 -1
  169. package/core/built/admin/assets/{posts-DhXE7b6r.js → posts-CxG7v0-M.js} +1 -1
  170. package/core/built/admin/assets/preferences-BfzJmnsd.js +5 -0
  171. package/core/built/admin/assets/preview-chrome-BOVO6_PE.js +1 -0
  172. package/core/built/admin/assets/preview-modal-Dw_HtD6S.js +1 -0
  173. package/core/built/admin/assets/profile-BT5vtv9b.js +1 -0
  174. package/core/built/admin/assets/radio-group-I7ou7PoJ.js +1 -0
  175. package/core/built/admin/assets/{referrers-pmJT4k3-.js → referrers-B9QDAfYm.js} +1 -1
  176. package/core/built/admin/assets/{router-provider-BmEZf6c6.js → router-provider-DSQfprxH.js} +1 -1
  177. package/core/built/admin/assets/select-D9oU1IoM.js +1 -0
  178. package/core/built/admin/assets/settings-CfZFbyu_.js +4 -0
  179. package/core/built/admin/assets/{settings-BGgk7oCI.js → settings-CpvHWix7.js} +1 -1
  180. package/core/built/admin/assets/settings-breadcrumbs-K0USP2nw.js +1 -0
  181. package/core/built/admin/assets/{share-modal-BeuydaBf.js → share-modal-ClIyPzc5.js} +1 -1
  182. package/core/built/admin/assets/slack-modal-1XXqOfiw.js +1 -0
  183. package/core/built/admin/assets/social-urls-CHQ9cTAK.js +1 -0
  184. package/core/built/admin/assets/{sort-button-Df4t2AL8.js → sort-button-CdBsm40v.js} +1 -1
  185. package/core/built/admin/assets/{source-icon-ajoaKb41.js → source-icon-CEYmVLXR.js} +1 -1
  186. package/core/built/admin/assets/{stats-C_lfxZAw.js → stats-D8nZCTy5.js} +1 -1
  187. package/core/built/admin/assets/{stats-view-Cxot1iD8.js → stats-view-CugFVf0g.js} +1 -1
  188. package/core/built/admin/assets/{step-1-ogAA4lDr.js → step-1-DOYjrORn.js} +1 -1
  189. package/core/built/admin/assets/{step-2-C5Xini-7.js → step-2-vA6RsarH.js} +1 -1
  190. package/core/built/admin/assets/{step-3-CZv1FV81.js → step-3-BtIBxMId.js} +2 -2
  191. package/core/built/admin/assets/stripe-button-UFP4QRXd.js +1 -0
  192. package/core/built/admin/assets/stripe-connect-modal-C_L3uM6n.js +1 -0
  193. package/core/built/admin/assets/switch-CE2NuMn-.js +1 -0
  194. package/core/built/admin/assets/{table-DFj1wiYv.js → table-TMCgCQK7.js} +1 -1
  195. package/core/built/admin/assets/tabs-Dd6oOKbv.js +1 -0
  196. package/core/built/admin/assets/tag-detail-D3l-UJPR.js +1 -0
  197. package/core/built/admin/assets/tags-BwCgmr5v.js +1 -0
  198. package/core/built/admin/assets/tags-WdKQGWR8.js +1 -0
  199. package/core/built/admin/assets/testimonials-modal-CqWp-xXJ.js +1 -0
  200. package/core/built/admin/assets/tier-detail-modal-BkcR2u0A.js +1 -0
  201. package/core/built/admin/assets/{tiers-DYsa4DCo.js → tiers-Da6kxHQP.js} +1 -1
  202. package/core/built/admin/assets/toggle-group-Guorw93z.js +1 -0
  203. package/core/built/admin/assets/{topic-filter-DGDxDalo.js → topic-filter-CbgoWIHn.js} +1 -1
  204. package/core/built/admin/assets/transistor-modal-DuNnnpal.js +1 -0
  205. package/core/built/admin/assets/unsplash-modal-y2bVwTHH.js +1 -0
  206. package/core/built/admin/assets/{use-analytics-data-C76v4LIp.js → use-analytics-data-B-b4wNSC.js} +1 -1
  207. package/core/built/admin/assets/use-check-theme-limit-error-m09J38Mq.js +2 -0
  208. package/core/built/admin/assets/use-feature-flag-ud0Qz8vt.js +1 -0
  209. package/core/built/admin/assets/use-filter-params-BnbBDc7T.js +1 -0
  210. package/core/built/admin/assets/use-filterable-api-iMpDZBxD.js +1 -0
  211. package/core/built/admin/assets/use-form-vRjI0Kwk.js +1 -0
  212. package/core/built/admin/assets/{use-growth-stats-aNXJOmQr.js → use-growth-stats-DPU5rt3W.js} +1 -1
  213. package/core/built/admin/assets/use-hash-link-navigation-guard-B9j6HIrV.js +1 -0
  214. package/core/built/admin/assets/use-limiter-BkN3E4gw.js +2 -0
  215. package/core/built/admin/assets/use-pintura-config-C_z8HTG2.js +1 -0
  216. package/core/built/admin/assets/use-pintura-editor-DNgbkhGp.js +1 -0
  217. package/core/built/admin/assets/{use-post-referrers-CG0SZioj.js → use-post-referrers-C2mXyrp-.js} +1 -1
  218. package/core/built/admin/assets/use-query-params-DHhhu8wi.js +1 -0
  219. package/core/built/admin/assets/{use-reply-chain-data-RLdPKRmS.js → use-reply-chain-data-DaK8q2qQ.js} +1 -1
  220. package/core/built/admin/assets/use-setting-group-YlYcoNyP.js +1 -0
  221. package/core/built/admin/assets/use-settings-navigation-Bf1g1rEh.js +1 -0
  222. package/core/built/admin/assets/{use-simple-pagination-DgcF69KI.js → use-simple-pagination-D9ckKo5-.js} +1 -1
  223. package/core/built/admin/assets/{use-tinybird-query-C1R_Kbmy.js → use-tinybird-query-GSa32hVw.js} +1 -1
  224. package/core/built/admin/assets/{use-tinybird-token-C9fPjVM_.js → use-tinybird-token-CKLOZFsw.js} +1 -1
  225. package/core/built/admin/assets/use-url-input-z-p0Kewm.js +5 -0
  226. package/core/built/admin/assets/user-detail-modal-BMxOA4Sv.js +1 -0
  227. package/core/built/admin/assets/{users-Dkv8NQZe.js → users-B6hIds6n.js} +1 -1
  228. package/core/built/admin/assets/validator-Cr0sMKuW.js +7 -0
  229. package/core/built/admin/assets/{virtual-list-BmTUzeoF.js → virtual-list-RHeEL05L.js} +1 -1
  230. package/core/built/admin/assets/web-Bw2QMO5u.js +2 -0
  231. package/core/built/admin/assets/web-xJtcwMy4.js +1 -0
  232. package/core/built/admin/assets/zapier-modal-BP2f4-vY.js +1 -0
  233. package/core/built/admin/index.html +15 -13
  234. package/core/frontend/helpers/authors.js +1 -1
  235. package/core/frontend/helpers/link.js +3 -8
  236. package/core/frontend/helpers/tags.js +1 -1
  237. package/core/frontend/meta/author-url.js +2 -2
  238. package/core/frontend/meta/url.js +4 -4
  239. package/core/frontend/services/proxy.js +1 -1
  240. package/core/frontend/services/routing/events.js +20 -6
  241. package/core/frontend/services/routing/permalink-adapter.js +0 -13
  242. package/core/frontend/services/routing/permalink-adapter.ts +0 -13
  243. package/core/frontend/services/routing/router-manager.js +15 -9
  244. package/core/frontend/services/sitemap/base-site-map-generator.js +1 -28
  245. package/core/frontend/services/sitemap/site-map-manager.js +22 -57
  246. package/core/server/adapters/route-settings/utils.js +10 -2
  247. package/core/server/adapters/route-settings/utils.ts +12 -2
  248. package/core/server/api/endpoints/email-post.js +1 -1
  249. package/core/server/api/endpoints/previews.js +1 -1
  250. package/core/server/api/endpoints/search-index-public.js +3 -3
  251. package/core/server/api/endpoints/search-index.js +4 -4
  252. package/core/server/api/endpoints/utils/serializers/input/authors.js +2 -2
  253. package/core/server/api/endpoints/utils/serializers/input/comments.js +1 -1
  254. package/core/server/api/endpoints/utils/serializers/input/pages.js +3 -3
  255. package/core/server/api/endpoints/utils/serializers/input/posts.js +3 -3
  256. package/core/server/api/endpoints/utils/serializers/input/tags.js +1 -1
  257. package/core/server/api/endpoints/utils/serializers/input/users.js +2 -2
  258. package/core/server/api/endpoints/utils/serializers/input/utils/url.js +31 -13
  259. package/core/server/api/endpoints/utils/serializers/output/mappers/posts.js +2 -2
  260. package/core/server/api/endpoints/utils/serializers/output/mappers/tags.js +2 -2
  261. package/core/server/api/endpoints/utils/serializers/output/mappers/users.js +8 -0
  262. package/core/server/api/endpoints/utils/serializers/output/utils/url.js +18 -11
  263. package/core/server/data/migrations/versions/6.57/2026-08-04-18-00-00-store-custom-field-values-as-leaf-rows.js +74 -0
  264. package/core/server/data/migrations/versions/6.57/2026-08-04-18-54-14-reset-automation-email-analytics.js +25 -0
  265. package/core/server/data/schema/commands.js +21 -5
  266. package/core/server/data/schema/schema.js +24 -5
  267. package/core/server/lib/common/to-plain.ts +1 -1
  268. package/core/server/models/post.js +2 -2
  269. package/core/server/services/adapter-manager/adapter-manager.js +1 -45
  270. package/core/server/services/adapter-manager/adapter-manager.ts +2 -48
  271. package/core/server/services/adapter-manager/adapter-paths.js +24 -0
  272. package/core/server/services/adapter-manager/adapter-paths.ts +21 -0
  273. package/core/server/services/adapter-manager/base-classes.js +22 -0
  274. package/core/server/services/adapter-manager/base-classes.ts +22 -0
  275. package/core/server/services/adapter-manager/index.js +4 -27
  276. package/core/server/services/adapter-manager/index.ts +4 -31
  277. package/core/server/services/adapter-manager/utils.js +50 -0
  278. package/core/server/services/adapter-manager/utils.ts +57 -0
  279. package/core/server/services/audience-feedback/audience-feedback-controller.js +1 -1
  280. package/core/server/services/audience-feedback/audience-feedback-service.js +2 -2
  281. package/core/server/services/automations/service.js +2 -2
  282. package/core/server/services/automations/service.ts +2 -2
  283. package/core/server/services/comments/comments-service-emails.js +1 -1
  284. package/core/server/services/comments/comments-service.js +1 -1
  285. package/core/server/services/email-analytics/email-analytics-service-wrapper.js +11 -2
  286. package/core/server/services/email-analytics/email-analytics-service.js +1 -1
  287. package/core/server/services/email-service/email-service-wrapper.js +2 -1
  288. package/core/server/services/email-service/mailgun-email-provider.js +15 -0
  289. package/core/server/services/indexnow-ping/indexnow-ping-service.js +1 -1
  290. package/core/server/services/indexnow-ping/indexnow-ping-service.ts +2 -4
  291. package/core/server/services/lib/mailgun-client.js +3 -3
  292. package/core/server/services/media-inliner/external-media-inliner.js +12 -8
  293. package/core/server/services/member-attribution/url-translator.js +5 -7
  294. package/core/server/services/member-welcome-emails/service.js +72 -12
  295. package/core/server/services/members/api.js +1 -1
  296. package/core/server/services/members/import-export/import/completion-email.js +8 -4
  297. package/core/server/services/members/import-export/import/completion-email.ts +9 -4
  298. package/core/server/services/members/import-export/import/importer.js +25 -4
  299. package/core/server/services/members/import-export/import/importer.ts +26 -6
  300. package/core/server/services/members/import-export/import/row.ts +5 -1
  301. package/core/server/services/members/import-export/index.js +1 -5
  302. package/core/server/services/members/import-export/index.ts +2 -6
  303. package/core/server/services/members-custom-fields/queries.js +4 -13
  304. package/core/server/services/members-custom-fields/queries.ts +4 -13
  305. package/core/server/services/members-custom-fields/schema.js +18 -27
  306. package/core/server/services/members-custom-fields/schema.ts +17 -27
  307. package/core/server/services/members-custom-fields/storage.js +94 -27
  308. package/core/server/services/members-custom-fields/storage.ts +114 -39
  309. package/core/server/services/members-custom-fields/values-service.js +98 -219
  310. package/core/server/services/members-custom-fields/values-service.ts +110 -238
  311. package/core/server/services/mentions/resource-service.js +1 -1
  312. package/core/server/services/mentions/service.js +2 -2
  313. package/core/server/services/route-settings/dynamic-routing-service.js +9 -59
  314. package/core/server/services/slack-ping/slack-ping-service.js +2 -2
  315. package/core/server/services/slack-ping/slack-ping-service.ts +3 -5
  316. package/core/server/services/stats/content-stats-service.js +3 -3
  317. package/core/server/services/stats/posts-stats-service.js +2 -2
  318. package/core/server/services/url/config.js +90 -135
  319. package/core/server/services/url/index.js +6 -49
  320. package/core/server/services/url/lazy-find-resource.js +14 -11
  321. package/core/server/services/url/lazy-find-resource.ts +14 -11
  322. package/core/server/services/url/lazy-url-service.js +174 -94
  323. package/core/server/services/url/lazy-url-service.ts +233 -97
  324. package/core/server/services/url/routable-resources.js +62 -71
  325. package/core/server/services/url/router-filter.js +12 -4
  326. package/core/server/services/url/router-filter.ts +12 -4
  327. package/core/server/services/webhooks/index.js +1 -1
  328. package/core/server/services/webhooks/serialize.js +2 -1
  329. package/core/shared/config/env/config.testing-mysql.json +1 -2
  330. package/core/shared/config/env/config.testing.json +1 -2
  331. package/core/shared/events/index.js +1 -2
  332. package/core/shared/labs.js +3 -3
  333. package/package.json +5 -6
  334. package/pnpm-lock.yaml +6 -9
  335. package/pnpm-workspace.yaml +2 -2
  336. package/tsconfig.json +1 -0
  337. package/core/built/admin/assets/Combination-BCm9FL4o.js +0 -41
  338. package/core/built/admin/assets/activitypub/layout-CTgrezN7.js +0 -1
  339. package/core/built/admin/assets/automated-emails-6t2bIRWf.js +0 -7
  340. package/core/built/admin/assets/checkbox-BIl077a0.js +0 -1
  341. package/core/built/admin/assets/code-editor-view-C0aWNwdl.js +0 -1
  342. package/core/built/admin/assets/comments-qwhIjH3c.js +0 -1
  343. package/core/built/admin/assets/disabled-sources-indicator-DYAXW-6V.js +0 -1
  344. package/core/built/admin/assets/dist-BUKmD51u.js +0 -1
  345. package/core/built/admin/assets/dist-CNlMj7ML.js +0 -1
  346. package/core/built/admin/assets/dist-DDY6GRVz.js +0 -1
  347. package/core/built/admin/assets/dist-DG78yroX.js +0 -23
  348. package/core/built/admin/assets/editor-DDYSOXGN.js +0 -8
  349. package/core/built/admin/assets/esm-CFX93H5M.js +0 -2
  350. package/core/built/admin/assets/filters-CLehPo_D.js +0 -1
  351. package/core/built/admin/assets/index-08n05-rc.js +0 -67
  352. package/core/built/admin/assets/index-DgUzgFvS.css +0 -1
  353. package/core/built/admin/assets/label-picker-DVnpu_IF.js +0 -1
  354. package/core/built/admin/assets/layout-B0YLh7R9.js +0 -1
  355. package/core/built/admin/assets/member-custom-fields-C8NpZYza.js +0 -1
  356. package/core/built/admin/assets/member-detail-CIVAdKXf.js +0 -1
  357. package/core/built/admin/assets/members-oLPiSkXD.js +0 -10
  358. package/core/built/admin/assets/modals-CB7v-k3T.js +0 -31
  359. package/core/built/admin/assets/newsletter-rbeDX9Wk.js +0 -1
  360. package/core/built/admin/assets/overview--4V-kx9c.js +0 -1
  361. package/core/built/admin/assets/overview-DSLv30oz.js +0 -1
  362. package/core/built/admin/assets/post-analytics-header-pU2m9ZuV.js +0 -1
  363. package/core/built/admin/assets/preferences-Ru4CRPHC.js +0 -5
  364. package/core/built/admin/assets/profile-BNb1oj7D.js +0 -1
  365. package/core/built/admin/assets/select-B0HteHrp.js +0 -1
  366. package/core/built/admin/assets/settings-B1C9Q3wo.js +0 -4
  367. package/core/built/admin/assets/social-urls-DA2lXrhW.js +0 -8
  368. package/core/built/admin/assets/switch-CyQcwMAv.js +0 -1
  369. package/core/built/admin/assets/tabs-D4y1gqUd.js +0 -1
  370. package/core/built/admin/assets/tags-Dmft-Y4O.js +0 -1
  371. package/core/built/admin/assets/toggle-group-R2QMFvXW.js +0 -1
  372. package/core/built/admin/assets/use-filter-params-WrdhAISv.js +0 -1
  373. package/core/built/admin/assets/web-BqW0b0_C.js +0 -1
  374. package/core/built/admin/assets/web-Cy5GKMWM.js +0 -2
  375. package/core/server/services/url/local-file-cache.js +0 -75
  376. package/core/server/services/url/queue.js +0 -260
  377. package/core/server/services/url/resource.js +0 -102
  378. package/core/server/services/url/resources.js +0 -480
  379. package/core/server/services/url/url-generator.js +0 -276
  380. package/core/server/services/url/url-service-facade.js +0 -366
  381. package/core/server/services/url/url-service-facade.ts +0 -519
  382. package/core/server/services/url/url-service.js +0 -387
  383. package/core/server/services/url/urls.js +0 -140
  384. package/core/shared/events/url-resource-updated-event.js +0 -33
  385. /package/core/built/admin/assets/{dist-CqO2lWS0.js → dist-CqO2lWS02.js} +0 -0
@@ -1,6 +1,6 @@
1
- import{A as e,B as t,E as n,G as r,H as i,I as a,L as o,M as s,N as c,Nt as l,R as u,S as d,St as f,T as p,V as m,a as h,f as ee,i as te,it as ne,j as re,o as g,s as ie,v as ae,vt as _,y as oe,yt as se}from"./dist-BnFdlebk.js";import{t as ce}from"./dist-DDY6GRVz.js";import{html as le,htmlCompletionSource as ue}from"./dist-pHiOxyxa.js";var de=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,o,s){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=o,this.positions=s,this.hashProp=[[a.contextHash,r]]}addChild(e,t){e.prop(a.contextHash)!=this.hash&&(e=new m(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new m(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new m(u.none,e,t,n,this.hashProp)})}},v;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(v||={});var fe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return b(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function me(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==v.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=v.BulletList||S(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var he={[v.Blockquote](e,t,n){return n.next==62?(n.markers.push(R(v.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(y(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[v.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[v.OrderedList]:me,[v.BulletList]:me,[v.Document](){return!0}};function y(e){return e==32||e==9||e==10||e==13}function b(e,t=0){for(;t<e.length&&y(e.charCodeAt(t));)t++;return t}function ge(e,t,n){for(;t>n&&y(e.charCodeAt(t-1));)t--;return t}function x(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function _e(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function S(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!y(n))return-1}return n&&e.next==45&&ye(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(j.SetextHeading)>-1||r<3?-1:1}function C(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||y(e.text.charCodeAt(e.pos+1)))&&(!n||C(t,v.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!y(e.text.charCodeAt(r+1))||n&&!C(t,v.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ve(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function ye(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&y(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,be=/-->/,xe=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,be],[/^\s*<\?/,xe],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function Se(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function Ce(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function O(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==v.CodeText?e[r].to=n:e.push(R(v.CodeText,t,n))}var k={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(O(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){O(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==v.CodeText?O(o,e.from,e.to):o.push(e);s=[]}O(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&O(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=v.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(v.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=x(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=ge(t.text,t.text.length,o),c=[R(v.CodeMark,r,r+a)];o<s&&c.push(R(v.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&O(c,e.lineStart-1,e.lineStart),c.push(R(v.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(O(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(O(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(v.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=_e(t);return n<0?!1:(e.startContext(v.Blockquote,t.pos),e.addNode(v.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(S(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(v.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=v.BulletList&&e.startContext(v.BulletList,t.basePos,t.next);let r=Ce(t,t.pos+1);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=v.OrderedList&&e.startContext(v.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Ce(t,t.pos+n);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ve(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=ge(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!y(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(v.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(v.HeaderMark,o-r,a-r);let c=s.finish(v.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Se(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==be?v.CommentBlock:i==xe?v.ProcessingInstructionBlock:v.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},we=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
1
+ import{i as e}from"./use-check-theme-limit-error-m09J38Mq.js";import{A as t,B as n,E as r,G as i,H as a,I as o,L as s,M as c,N as l,Nt as u,R as d,S as f,St as p,T as m,V as h,a as ee,f as te,i as ne,it as re,j as ie,o as g,s as ae,v as oe,vt as _,y as se,yt as ce}from"./dist-BnFdlebk.js";import{html as le,htmlCompletionSource as ue}from"./dist-D5vhMdXf.js";var de=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,s){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=s,this.hashProp=[[o.contextHash,r]]}addChild(e,t){e.prop(o.contextHash)!=this.hash&&(e=new h(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new h(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new h(d.none,e,t,n,this.hashProp)})}},v;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(v||={});var fe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return b(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function me(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==v.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=v.BulletList||S(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var he={[v.Blockquote](e,t,n){return n.next==62?(n.markers.push(R(v.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(y(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[v.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[v.OrderedList]:me,[v.BulletList]:me,[v.Document](){return!0}};function y(e){return e==32||e==9||e==10||e==13}function b(e,t=0){for(;t<e.length&&y(e.charCodeAt(t));)t++;return t}function ge(e,t,n){for(;t>n&&y(e.charCodeAt(t-1));)t--;return t}function x(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function _e(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function S(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!y(n))return-1}return n&&e.next==45&&ye(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(j.SetextHeading)>-1||r<3?-1:1}function C(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||y(e.text.charCodeAt(e.pos+1)))&&(!n||C(t,v.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!y(e.text.charCodeAt(r+1))||n&&!C(t,v.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ve(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function ye(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&y(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,be=/-->/,xe=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,be],[/^\s*<\?/,xe],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function Se(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function Ce(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function O(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==v.CodeText?e[r].to=n:e.push(R(v.CodeText,t,n))}var k={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(O(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){O(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==v.CodeText?O(o,e.from,e.to):o.push(e);s=[]}O(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&O(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=v.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(v.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=x(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=ge(t.text,t.text.length,o),c=[R(v.CodeMark,r,r+a)];o<s&&c.push(R(v.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&O(c,e.lineStart-1,e.lineStart),c.push(R(v.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(O(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(O(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(v.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=_e(t);return n<0?!1:(e.startContext(v.Blockquote,t.pos),e.addNode(v.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(S(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(v.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=v.BulletList&&e.startContext(v.BulletList,t.basePos,t.next);let r=Ce(t,t.pos+1);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=v.OrderedList&&e.startContext(v.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Ce(t,t.pos+n);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ve(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=ge(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!y(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(v.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(v.HeaderMark,o-r,a-r);let c=s.finish(v.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Se(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==be?v.CommentBlock:i==xe?v.ProcessingInstructionBlock:v.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},we=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
2
2
  `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&b(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,R(v.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(ze(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(R(v.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Le(e,b(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=b(e,this.pos),n=0;if(t>this.pos){let r=Re(e,t,this.start);if(r){let t=A(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=A(e,this.pos),n>0&&n<e.length?n:-1}else return A(e,this.pos)}};function A(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!y(n))return-1}return t}var Te=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:ye(t),i=t.next;if(r<0)return!1;let a=R(v.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,R(i==61?v.SetextHeading1:v.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},j={LinkReference(e,t){return t.content.charCodeAt(0)==91?new we(t):null},SetextHeading(){return new Te}},Ee=[(e,t)=>ve(t)>=0,(e,t)=>x(t)>=0,(e,t)=>_e(t)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>T(t,e,!0)>=0,(e,t)=>S(t,e,!0)>=0,(e,t)=>Se(t,e,!0)>=0],De={text:``,end:0},Oe=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new pe,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=de.create(v.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Ve(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new fe(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
3
3
  `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=He(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=De;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+v[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
4
4
  `?``:t;else{let e=t.indexOf(`
5
- `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=de.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new m(this.parser.nodeSet.types[e],I,I,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(G(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?M(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=G(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(v.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?R(this.parser.getNodeType(e),t,n,r):new Me(e,t)}get buffer(){return new je(this.parser.nodeSet)}};function M(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=M(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new m(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var ke=class e extends t{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Oe(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=P(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,c=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),d=this.blockNames.slice(),f=this.inlineParsers.slice(),p=this.inlineNames.slice(),m=this.endLeafBlock.slice(),h=this.wrappers;if(N(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:o,composite:s,style:c}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;s&&(i[e.length]=(e,t,n)=>s(t,n,e.value));let l=e.length,d=s?[`Block`,`BlockContext`]:o?l>=v.ATXHeading1&&l<=v.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(u.define({id:l,name:n,props:d&&[[a.group,d]]})),c&&(t||={},Array.isArray(c)||c instanceof re?t[n]=c:Object.assign(t,c))}r=new o(e),t&&(r=r.extend(s(t)))}if(N(n.props)&&(r=r.extend(...n.props)),N(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(c[t]=l[t]=void 0),n>-1&&(f[n]=void 0)}if(N(n.parseBlock))for(let e of n.parseBlock){let t=d.indexOf(e.name);if(t>-1)c[t]=e.parse,l[t]=e.leaf;else{let t=e.before?F(d,e.before):e.after?F(d,e.after)+1:d.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.leaf),d.splice(t,0,e.name)}e.endLeaf&&m.push(e.endLeaf)}if(N(n.parseInline))for(let e of n.parseInline){let t=p.indexOf(e.name);if(t>-1)f[t]=e.parse;else{let t=e.before?F(p,e.before):e.after?F(p,e.after)+1:p.length-1;f.splice(t,0,e.parse),p.splice(t,0,e.name)}}return n.wrap&&(h=h.concat(n.wrap)),new e(r,c,l,d,m,i,f,p,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new W(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function N(e){return e!=null&&e.length>0}function P(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=P(e[0]);if(e.length==1)return t;let n=P(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||I).concat(t||I),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function F(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Ae=[u.none];for(let e=1,t;t=v[e];e++)Ae[e]=u.define({id:e,name:t,props:e>=v.Escape?[]:[[a.group,e in he?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var I=[],je=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return m.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},L=class{constructor(e,t,n,r=I){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new je(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Me=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return I}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function R(e,t,n,r){return new L(e,t,n,r)}var Ne={resolve:`Emphasis`,mark:`EmphasisMark`},Pe={resolve:`Emphasis`,mark:`EmphasisMark`},z={},B={},V=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Fe=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,H=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{H=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var U={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(Fe.charCodeAt(t)==r)return e.append(R(v.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(R(v.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(R(v.InlineCode,n,r+1,[R(v.CodeMark,n,n+i),R(v.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(R(v.Autolink,n,n+1+i[0].length,[R(v.LinkMark,n,n+1),R(v.URL,n+1,n+i[0].length),R(v.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(R(v.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(R(v.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(R(v.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=H.test(i),s=H.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new V(t==95?Ne:Pe,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(R(v.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(R(v.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new V(z,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new V(B,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof V&&(r.type==z||r.type==B)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=Ie(e,i,r.type==z?v.Link:v.Image,r.from,n+1);if(r.type==z)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof V&&t.type==z&&(t.side=0)}return a.to}}return-1}};function Ie(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(R(v.LinkMark,r,r+(n==v.Image?2:1))),t.push(R(v.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=Le(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=Re(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(R(v.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(R(v.LinkMark,n,s)))}else if(o==91){let n=ze(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return R(n,r,s,t)}function Le(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return R(v.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(y(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?R(v.URL,t+n,i+n):i==e.length?null:!1}}function Re(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return R(v.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function ze(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:R(v.LinkLabel,t+n,a+1+n);else{if(r&&!y(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var W=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new V(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof V&&(t.type==z||t.type==B))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof V&&n.type.resolve&&n.side&2))continue;let r=n.type==Ne||n.type==Pe,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof V&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof L&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new V(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new V(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof L&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof V&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof V?t:null}skipSpace(e){return b(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?R(this.parser.getNodeType(e),t,n,r):new Me(e,t)}};W.linkStart=z,W.imageStart=B;function G(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof L&&(n[r]=new L(t.type,t.from,t.to,G(t.children,[e])))}else n.splice(r++,0,e)}return n}var Be=[v.CodeBlock,v.ListItem,v.OrderedList,v.BulletList],Ve=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
6
- `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(a.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=He(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new m(e.parser.nodeSet.types[v.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(Be.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function He(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var Ue=s({"Blockquote/...":c.quote,HorizontalRule:c.contentSeparator,"ATXHeading1/... SetextHeading1/...":c.heading1,"ATXHeading2/... SetextHeading2/...":c.heading2,"ATXHeading3/...":c.heading3,"ATXHeading4/...":c.heading4,"ATXHeading5/...":c.heading5,"ATXHeading6/...":c.heading6,"Comment CommentBlock":c.comment,Escape:c.escape,Entity:c.character,"Emphasis/...":c.emphasis,"StrongEmphasis/...":c.strong,"Link/... Image/...":c.link,"OrderedList/... BulletList/...":c.list,"BlockQuote/...":c.quote,"InlineCode CodeText":c.monospace,"URL Autolink":c.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":c.processingInstruction,"CodeInfo LinkLabel":c.labelName,LinkTitle:c.string,Paragraph:c.content}),We=new ke(new o(Ae).extend(Ue),Object.keys(k).map(e=>k[e]),Object.keys(k).map(e=>j[e]),Object.keys(k),Ee,he,Object.keys(U).map(e=>U[e]),Object.keys(U),[]);function Ge(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function Ke(e){let{codeParser:t,htmlParser:n}=e;return{wrap:i((e,r)=>{let i=e.type.id;if(t&&(i==v.CodeBlock||i==v.FencedCode)){let n=``;if(i==v.FencedCode){let t=e.node.getChild(v.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==v.CodeText,bracketed:i==v.FencedCode}}else if(n&&(i==v.HTMLBlock||i==v.HTMLTag||i==v.CommentBlock))return{parser:n,overlay:Ge(e.node,e.from,e.to)};return null})}}var qe={resolve:`Strikethrough`,mark:`StrikethroughMark`},Je={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":c.strikethrough}},{name:`StrikethroughMark`,style:c.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=H.test(r),c=H.test(i);return e.addDelimiter(qe,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function K(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function Ye(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var Xe=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Ze=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&Xe.test(r=t.text.slice(t.pos))){let i=[];K(e,n.content,0,i,n.start)==K(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];K(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},Qe={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":c.heading}},`TableRow`,{name:`TableCell`,style:c.content},{name:`TableDelimiter`,style:c.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return Ye(t.content,0)?new Ze:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof Ze)||!Ye(t.text,t.basePos))return!1;let r=e.peekLine();return Xe.test(r)&&K(e,t.text,t.basePos)==K(e,r,t.basePos)},before:`SetextHeading`}]},$e=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},et={defineNodes:[{name:`Task`,block:!0,style:c.list},{name:`TaskMarker`,style:c.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new $e:null},after:`SetextHeading`}]},tt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,nt=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,rt=/[\w-]+\.[\w-]+($|[/:])/,it=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,at=/\/[a-zA-Z\d@.]+/gy;function ot(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function st(e,t){nt.lastIndex=t;let n=nt.exec(e);if(!n||rt.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&ot(e,t,r,`)`)>ot(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ct(e,t){it.lastIndex=t;let n=it.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var lt=[Qe,et,Je,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;tt.lastIndex=r;let i=tt.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=st(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ct(e.text,r):(a=ct(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(at.lastIndex=a,i=at.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function ut(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),y(s))break}return-1}}var dt={defineNodes:[{name:`Superscript`,style:c.special(c.content)},{name:`SuperscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Superscript`,parse:ut(94,`Superscript`,`SuperscriptMark`)}]},ft={defineNodes:[{name:`Subscript`,style:c.special(c.content)},{name:`SubscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Subscript`,parse:ut(126,`Subscript`,`SubscriptMark`)}]},pt={defineNodes:[{name:`Emoji`,style:c.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},mt=ee({commentTokens:{block:{open:`<!--`,close:`-->`}}}),ht=new a,gt=We.configure({props:[ae.add(e=>!e.is(`Block`)||e.is(`Document`)||q(e)!=null||_t(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),ht.add(q),d.add({Document:()=>null}),n.add({Document:mt})]});function q(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function _t(e){return e.name==`OrderedList`||e.name==`BulletList`}function vt(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=q(e.type))!=null&&r<=t)break;n=e}return n.to}var yt=oe.of((t,n,r)=>{for(let i=e(t).resolveInner(r,-1);i&&!(i.from<n);i=i.parent){let e=i.type.prop(ht);if(e==null)continue;let t=vt(i,e);if(t>r)return{from:r,to:t}}return null});function J(e){return new te(mt,e,[],`markdown`)}var bt=J(gt),Y=J(gt.configure([lt,ft,dt,pt,{props:[ae.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function xt(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):h.matchLanguageName(e,n,!0),t instanceof h)return t.support?t.support.language.parser:ie.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var X=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+Ct(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function St(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new X(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new X(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new X(i.parent,s,s+t,a[1],e,n,i))}}return r}function Ct(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Z(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Ct(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Q(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(p)!=` `)return e;let r=l(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var wt=((t={})=>({state:n,dispatch:r})=>{let i=e(n),{doc:a}=n,o=null,s=n.changeByRange(e=>{if(!e.empty||!Y.isActiveAt(n,e.from,-1)&&!Y.isActiveAt(n,e.from,1))return o={range:e};let r=e.from,s=a.lineAt(r),c=St(i.resolveInner(r,-1),a);for(;c.length&&c[c.length-1].from>r-s.from;)c.pop();if(!c.length)return o={range:e};let u=c[c.length-1];if(u.to-u.spaceAfter.length>r-s.from)return o={range:e};let d=r>=u.to-u.spaceAfter.length&&!/\S/.test(s.text.slice(u.to));if(u.item&&d){let e=u.node.firstChild,i=u.node.getChild(`ListItem`,`ListItem`);if(e.to>=r||i&&i.to<r||s.from>0&&!/[^\s>]/.test(a.lineAt(s.from-1).text)||t.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(a,1)):t=s.from+(e?e.to:0);let i=[{from:t,to:r,insert:n}];return u.node.name==`OrderedList`&&Z(u.item,a,i,-2),e&&e.node.name==`OrderedList`&&Z(e.item,a,i),{range:_.cursor(t+n.length),changes:i}}else{let e=Dt(c,n,s);return{range:_.cursor(r+e.length+1),changes:{from:s.from,insert:e+n.lineBreak}}}}if(u.node.name==`Blockquote`&&d&&s.from){let t=a.lineAt(s.from-1),r=/>\s*$/.exec(t.text);if(r&&r.index==u.from){let i=n.changes([{from:t.from+r.index,to:t.to},{from:s.from+u.from,to:s.to}]);return{range:e.map(i),changes:i}}}let f=[];u.node.name==`OrderedList`&&Z(u.item,a,f);let p=u.item&&u.item.from<s.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=u.to)for(let e=0,t=c.length-1;e<=t;e++)m+=e==t&&!p?c[e].marker(a,1):c[e].blank(e<t?l(s.text,4,c[e+1].from)-m.length:null);let h=r;for(;h>s.from&&/\s/.test(s.text.charAt(h-s.from-1));)h--;return m=Q(m,n),Et(u.node,n.doc)&&(m=Dt(c,n,s)+n.lineBreak+m),f.push({from:h,to:r,insert:n.lineBreak+m}),{range:_.cursor(h+m.length+1),changes:f}});return o?!1:(r(n.update(s,{scrollIntoView:!0,userEvent:`input`})),!0)})();function Tt(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Et(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function Dt(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?l(n.text,4,e[t+1].from)-r.length:null,t<i);return Q(r,t)}function Ot(e,t){let n=e.resolveInner(t,-1),r=t;Tt(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(Tt(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var kt=[{key:`Enter`,run:wt},{key:`Backspace`,run:({state:t,dispatch:n})=>{let r=e(t),i=null,a=t.changeByRange(e=>{let n=e.from,{doc:a}=t;if(e.empty&&Y.isActiveAt(t,e.from)){let e=a.lineAt(n),i=St(Ot(r,n),a);if(i.length){let r=i[i.length-1],a=r.to-r.spaceAfter.length+ +!!r.spaceAfter;if(n-e.from>a&&!/\S/.test(e.text.slice(a,n-e.from)))return{range:_.cursor(e.from+a),changes:{from:e.from+a,to:n}};if(n-e.from==a&&(r.item&&e.from<=r.item.from||/^[\s>]*$/.test(e.text.slice(0,r.to)))){let i=e.from+r.from;if(r.item&&r.node.from<r.item.from&&/\S/.test(e.text.slice(r.from,r.to))){let n=r.blank(l(e.text,4,r.to)-l(e.text,4,r.from));return i==e.from&&(n=Q(n,t)),{range:_.cursor(i+n.length),changes:{from:i,to:e.from+r.to,insert:n}}}if(i<n)return{range:_.cursor(i),changes:{from:i,to:n}}}}}return i={range:e}});return i?!1:(n(t.update(a,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],At=le({matchClosingTags:!1});function jt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=bt,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=At}=e;if(!(i instanceof ke))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,yt],u;o&&l.push(Ft),n instanceof g?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?xt(t,u):void 0;c.push(Ke({codeParser:d,htmlParser:s.language.parser})),r&&l.push(f.high(ne.of(kt)));let p=J(i.configure(c));return a&&l.push(p.data.of({autocomplete:Mt})),new g(p,l)}function Mt(t){let{state:n,pos:r}=t,i=/<[:\-\.\w\u00b7-\uffff]*$/.exec(n.sliceDoc(r-25,r));if(!i)return null;let a=e(n).resolveInner(r,-1);for(;a&&!a.type.isTop;){if(a.name==`CodeBlock`||a.name==`FencedCode`||a.name==`ProcessingInstructionBlock`||a.name==`CommentBlock`||a.name==`Link`||a.name==`Image`)return null;a=a.parent}return{from:r-i[0].length,to:r,options:Nt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var $=null;function Nt(){if($)return $;let e=ue(new ce(se.create({extensions:At}),0,!0));return $=e?e.options:[]}var Pt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Ft=r.domEventHandlers({paste:(t,n)=>{let{main:r}=n.state.selection;if(r.empty)return!1;let i=t.clipboardData?.getData(`text/plain`);if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i=`https://`+i),!Y.isActiveAt(n.state,r.from,1)))return!1;let a=e(n.state),o=!1;return a.iterate({from:r.from,to:r.to,enter:e=>{(e.from>r.from||Pt.test(e.name))&&(o=!0)},leave:e=>{e.to<r.to&&(o=!0)}}),o?!1:(n.dispatch({changes:[{from:r.from,insert:`[`},{from:r.to,insert:`](${i})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});export{jt as markdown};
5
+ `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=de.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new h(this.parser.nodeSet.types[e],I,I,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(G(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?M(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=G(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(v.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?R(this.parser.getNodeType(e),t,n,r):new Me(e,t)}get buffer(){return new je(this.parser.nodeSet)}};function M(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=M(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new h(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var ke=class e extends n{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Oe(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=P(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),u=this.blockNames.slice(),f=this.inlineParsers.slice(),p=this.inlineNames.slice(),m=this.endLeafBlock.slice(),h=this.wrappers;if(N(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:s,style:c}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;s&&(i[e.length]=(e,t,n)=>s(t,n,e.value));let l=e.length,u=s?[`Block`,`BlockContext`]:a?l>=v.ATXHeading1&&l<=v.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(d.define({id:l,name:n,props:u&&[[o.group,u]]})),c&&(t||={},Array.isArray(c)||c instanceof ie?t[n]=c:Object.assign(t,c))}r=new s(e),t&&(r=r.extend(c(t)))}if(N(n.props)&&(r=r.extend(...n.props)),N(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=l[t]=void 0),n>-1&&(f[n]=void 0)}if(N(n.parseBlock))for(let e of n.parseBlock){let t=u.indexOf(e.name);if(t>-1)a[t]=e.parse,l[t]=e.leaf;else{let t=e.before?F(u,e.before):e.after?F(u,e.after)+1:u.length-1;a.splice(t,0,e.parse),l.splice(t,0,e.leaf),u.splice(t,0,e.name)}e.endLeaf&&m.push(e.endLeaf)}if(N(n.parseInline))for(let e of n.parseInline){let t=p.indexOf(e.name);if(t>-1)f[t]=e.parse;else{let t=e.before?F(p,e.before):e.after?F(p,e.after)+1:p.length-1;f.splice(t,0,e.parse),p.splice(t,0,e.name)}}return n.wrap&&(h=h.concat(n.wrap)),new e(r,a,l,u,m,i,f,p,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new W(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function N(e){return e!=null&&e.length>0}function P(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=P(e[0]);if(e.length==1)return t;let n=P(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||I).concat(t||I),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function F(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Ae=[d.none];for(let e=1,t;t=v[e];e++)Ae[e]=d.define({id:e,name:t,props:e>=v.Escape?[]:[[o.group,e in he?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var I=[],je=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return h.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},L=class{constructor(e,t,n,r=I){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new je(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Me=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return I}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function R(e,t,n,r){return new L(e,t,n,r)}var Ne={resolve:`Emphasis`,mark:`EmphasisMark`},Pe={resolve:`Emphasis`,mark:`EmphasisMark`},z={},B={},V=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Fe=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,H=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{H=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var U={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(Fe.charCodeAt(t)==r)return e.append(R(v.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(R(v.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(R(v.InlineCode,n,r+1,[R(v.CodeMark,n,n+i),R(v.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(R(v.Autolink,n,n+1+i[0].length,[R(v.LinkMark,n,n+1),R(v.URL,n+1,n+i[0].length),R(v.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(R(v.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(R(v.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(R(v.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=H.test(i),s=H.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new V(t==95?Ne:Pe,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(R(v.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(R(v.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new V(z,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new V(B,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof V&&(r.type==z||r.type==B)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=Ie(e,i,r.type==z?v.Link:v.Image,r.from,n+1);if(r.type==z)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof V&&t.type==z&&(t.side=0)}return a.to}}return-1}};function Ie(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(R(v.LinkMark,r,r+(n==v.Image?2:1))),t.push(R(v.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=Le(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=Re(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(R(v.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(R(v.LinkMark,n,s)))}else if(o==91){let n=ze(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return R(n,r,s,t)}function Le(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return R(v.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(y(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?R(v.URL,t+n,i+n):i==e.length?null:!1}}function Re(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return R(v.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function ze(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:R(v.LinkLabel,t+n,a+1+n);else{if(r&&!y(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var W=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new V(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof V&&(t.type==z||t.type==B))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof V&&n.type.resolve&&n.side&2))continue;let r=n.type==Ne||n.type==Pe,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof V&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof L&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new V(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new V(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof L&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof V&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof V?t:null}skipSpace(e){return b(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?R(this.parser.getNodeType(e),t,n,r):new Me(e,t)}};W.linkStart=z,W.imageStart=B;function G(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof L&&(n[r]=new L(t.type,t.from,t.to,G(t.children,[e])))}else n.splice(r++,0,e)}return n}var Be=[v.CodeBlock,v.ListItem,v.OrderedList,v.BulletList],Ve=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
6
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(o.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=He(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new h(e.parser.nodeSet.types[v.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(Be.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function He(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var Ue=c({"Blockquote/...":l.quote,HorizontalRule:l.contentSeparator,"ATXHeading1/... SetextHeading1/...":l.heading1,"ATXHeading2/... SetextHeading2/...":l.heading2,"ATXHeading3/...":l.heading3,"ATXHeading4/...":l.heading4,"ATXHeading5/...":l.heading5,"ATXHeading6/...":l.heading6,"Comment CommentBlock":l.comment,Escape:l.escape,Entity:l.character,"Emphasis/...":l.emphasis,"StrongEmphasis/...":l.strong,"Link/... Image/...":l.link,"OrderedList/... BulletList/...":l.list,"BlockQuote/...":l.quote,"InlineCode CodeText":l.monospace,"URL Autolink":l.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":l.processingInstruction,"CodeInfo LinkLabel":l.labelName,LinkTitle:l.string,Paragraph:l.content}),We=new ke(new s(Ae).extend(Ue),Object.keys(k).map(e=>k[e]),Object.keys(k).map(e=>j[e]),Object.keys(k),Ee,he,Object.keys(U).map(e=>U[e]),Object.keys(U),[]);function Ge(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function Ke(e){let{codeParser:t,htmlParser:n}=e;return{wrap:a((e,r)=>{let i=e.type.id;if(t&&(i==v.CodeBlock||i==v.FencedCode)){let n=``;if(i==v.FencedCode){let t=e.node.getChild(v.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==v.CodeText,bracketed:i==v.FencedCode}}else if(n&&(i==v.HTMLBlock||i==v.HTMLTag||i==v.CommentBlock))return{parser:n,overlay:Ge(e.node,e.from,e.to)};return null})}}var qe={resolve:`Strikethrough`,mark:`StrikethroughMark`},Je={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":l.strikethrough}},{name:`StrikethroughMark`,style:l.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=H.test(r),c=H.test(i);return e.addDelimiter(qe,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function K(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function Ye(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var Xe=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Ze=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&Xe.test(r=t.text.slice(t.pos))){let i=[];K(e,n.content,0,i,n.start)==K(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];K(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},Qe={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":l.heading}},`TableRow`,{name:`TableCell`,style:l.content},{name:`TableDelimiter`,style:l.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return Ye(t.content,0)?new Ze:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof Ze)||!Ye(t.text,t.basePos))return!1;let r=e.peekLine();return Xe.test(r)&&K(e,t.text,t.basePos)==K(e,r,t.basePos)},before:`SetextHeading`}]},$e=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},et={defineNodes:[{name:`Task`,block:!0,style:l.list},{name:`TaskMarker`,style:l.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new $e:null},after:`SetextHeading`}]},tt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,nt=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,rt=/[\w-]+\.[\w-]+($|[/:])/,it=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,at=/\/[a-zA-Z\d@.]+/gy;function ot(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function st(e,t){nt.lastIndex=t;let n=nt.exec(e);if(!n||rt.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&ot(e,t,r,`)`)>ot(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ct(e,t){it.lastIndex=t;let n=it.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var lt=[Qe,et,Je,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;tt.lastIndex=r;let i=tt.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=st(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ct(e.text,r):(a=ct(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(at.lastIndex=a,i=at.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function ut(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),y(s))break}return-1}}var dt={defineNodes:[{name:`Superscript`,style:l.special(l.content)},{name:`SuperscriptMark`,style:l.processingInstruction}],parseInline:[{name:`Superscript`,parse:ut(94,`Superscript`,`SuperscriptMark`)}]},ft={defineNodes:[{name:`Subscript`,style:l.special(l.content)},{name:`SubscriptMark`,style:l.processingInstruction}],parseInline:[{name:`Subscript`,parse:ut(126,`Subscript`,`SubscriptMark`)}]},pt={defineNodes:[{name:`Emoji`,style:l.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},mt=te({commentTokens:{block:{open:`<!--`,close:`-->`}}}),ht=new o,gt=We.configure({props:[oe.add(e=>!e.is(`Block`)||e.is(`Document`)||q(e)!=null||_t(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),ht.add(q),f.add({Document:()=>null}),r.add({Document:mt})]});function q(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function _t(e){return e.name==`OrderedList`||e.name==`BulletList`}function vt(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=q(e.type))!=null&&r<=t)break;n=e}return n.to}var yt=se.of((e,n,r)=>{for(let i=t(e).resolveInner(r,-1);i&&!(i.from<n);i=i.parent){let e=i.type.prop(ht);if(e==null)continue;let t=vt(i,e);if(t>r)return{from:r,to:t}}return null});function J(e){return new ne(mt,e,[],`markdown`)}var bt=J(gt),Y=J(gt.configure([lt,ft,dt,pt,{props:[oe.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function xt(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):ee.matchLanguageName(e,n,!0),t instanceof ee)return t.support?t.support.language.parser:ae.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var X=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+Ct(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function St(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new X(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new X(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new X(i.parent,s,s+t,a[1],e,n,i))}}return r}function Ct(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Z(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Ct(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Q(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(m)!=` `)return e;let r=u(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var wt=((e={})=>({state:n,dispatch:r})=>{let i=t(n),{doc:a}=n,o=null,s=n.changeByRange(t=>{if(!t.empty||!Y.isActiveAt(n,t.from,-1)&&!Y.isActiveAt(n,t.from,1))return o={range:t};let r=t.from,s=a.lineAt(r),c=St(i.resolveInner(r,-1),a);for(;c.length&&c[c.length-1].from>r-s.from;)c.pop();if(!c.length)return o={range:t};let l=c[c.length-1];if(l.to-l.spaceAfter.length>r-s.from)return o={range:t};let d=r>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&d){let t=l.node.firstChild,i=l.node.getChild(`ListItem`,`ListItem`);if(t.to>=r||i&&i.to<r||s.from>0&&!/[^\s>]/.test(a.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(a,1)):t=s.from+(e?e.to:0);let i=[{from:t,to:r,insert:n}];return l.node.name==`OrderedList`&&Z(l.item,a,i,-2),e&&e.node.name==`OrderedList`&&Z(e.item,a,i),{range:_.cursor(t+n.length),changes:i}}else{let e=Dt(c,n,s);return{range:_.cursor(r+e.length+1),changes:{from:s.from,insert:e+n.lineBreak}}}}if(l.node.name==`Blockquote`&&d&&s.from){let e=a.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=n.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:t.map(i),changes:i}}}let f=[];l.node.name==`OrderedList`&&Z(l.item,a,f);let p=l.item&&l.item.from<s.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)m+=e==t&&!p?c[e].marker(a,1):c[e].blank(e<t?u(s.text,4,c[e+1].from)-m.length:null);let h=r;for(;h>s.from&&/\s/.test(s.text.charAt(h-s.from-1));)h--;return m=Q(m,n),Et(l.node,n.doc)&&(m=Dt(c,n,s)+n.lineBreak+m),f.push({from:h,to:r,insert:n.lineBreak+m}),{range:_.cursor(h+m.length+1),changes:f}});return o?!1:(r(n.update(s,{scrollIntoView:!0,userEvent:`input`})),!0)})();function Tt(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Et(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function Dt(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?u(n.text,4,e[t+1].from)-r.length:null,t<i);return Q(r,t)}function Ot(e,t){let n=e.resolveInner(t,-1),r=t;Tt(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(Tt(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var kt=[{key:`Enter`,run:wt},{key:`Backspace`,run:({state:e,dispatch:n})=>{let r=t(e),i=null,a=e.changeByRange(t=>{let n=t.from,{doc:a}=e;if(t.empty&&Y.isActiveAt(e,t.from)){let t=a.lineAt(n),i=St(Ot(r,n),a);if(i.length){let r=i[i.length-1],a=r.to-r.spaceAfter.length+ +!!r.spaceAfter;if(n-t.from>a&&!/\S/.test(t.text.slice(a,n-t.from)))return{range:_.cursor(t.from+a),changes:{from:t.from+a,to:n}};if(n-t.from==a&&(r.item&&t.from<=r.item.from||/^[\s>]*$/.test(t.text.slice(0,r.to)))){let i=t.from+r.from;if(r.item&&r.node.from<r.item.from&&/\S/.test(t.text.slice(r.from,r.to))){let n=r.blank(u(t.text,4,r.to)-u(t.text,4,r.from));return i==t.from&&(n=Q(n,e)),{range:_.cursor(i+n.length),changes:{from:i,to:t.from+r.to,insert:n}}}if(i<n)return{range:_.cursor(i),changes:{from:i,to:n}}}}}return i={range:t}});return i?!1:(n(e.update(a,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],At=le({matchClosingTags:!1});function jt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=bt,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=At}=e;if(!(i instanceof ke))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,yt],u;o&&l.push(Ft),n instanceof g?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?xt(t,u):void 0;c.push(Ke({codeParser:d,htmlParser:s.language.parser})),r&&l.push(p.high(re.of(kt)));let f=J(i.configure(c));return a&&l.push(f.data.of({autocomplete:Mt})),new g(f,l)}function Mt(e){let{state:n,pos:r}=e,i=/<[:\-\.\w\u00b7-\uffff]*$/.exec(n.sliceDoc(r-25,r));if(!i)return null;let a=t(n).resolveInner(r,-1);for(;a&&!a.type.isTop;){if(a.name==`CodeBlock`||a.name==`FencedCode`||a.name==`ProcessingInstructionBlock`||a.name==`CommentBlock`||a.name==`Link`||a.name==`Image`)return null;a=a.parent}return{from:r-i[0].length,to:r,options:Nt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var $=null;function Nt(){if($)return $;let t=ue(new e(ce.create({extensions:At}),0,!0));return $=t?t.options:[]}var Pt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Ft=i.domEventHandlers({paste:(e,n)=>{let{main:r}=n.state.selection;if(r.empty)return!1;let i=e.clipboardData?.getData(`text/plain`);if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i=`https://`+i),!Y.isActiveAt(n.state,r.from,1)))return!1;let a=t(n.state),o=!1;return a.iterate({from:r.from,to:r.to,enter:e=>{(e.from>r.from||Pt.test(e.name))&&(o=!0)},leave:e=>{e.to<r.to&&(o=!0)}}),o?!1:(n.dispatch({changes:[{from:r.from,insert:`[`},{from:r.to,insert:`](${i})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});export{jt as markdown};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-Bb3IsNbi.js";import{n,t as r}from"./jsx-runtime-DX3WBWVO.js";import{a as i}from"./dist-Cb5RSHSg.js";import{n as a,r as o,t as s}from"./dist-CQJY6SVY.js";import{t as c}from"./dist-CqO2lWS02.js";import{t as l}from"./dist-myQaY0ka.js";var u=(e,t)=>{t?.(e),e.defaultPrevented||e.stopPropagation()},d=e(t(),1),f=[`top`,`right`,`bottom`,`left`],p=Math.min,m=Math.max,h=Math.round,g=Math.floor,_=e=>({x:e,y:e}),v={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function y(e,t,n){return m(e,p(t,n))}function b(e,t){return typeof e==`function`?e(t):e}function x(e){return e.split(`-`)[0]}function S(e){return e.split(`-`)[1]}function C(e){return e===`x`?`y`:`x`}function w(e){return e===`y`?`height`:`width`}function T(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function E(e){return C(T(e))}function D(e,t,n){n===void 0&&(n=!1);let r=S(e),i=E(e),a=w(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=I(o)),[o,I(o)]}function O(e){let t=I(e);return[k(e),t,k(t)]}function k(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var A=[`left`,`right`],j=[`right`,`left`],M=[`top`,`bottom`],N=[`bottom`,`top`];function P(e,t,n){switch(e){case`top`:case`bottom`:return n?t?j:A:t?A:j;case`left`:case`right`:return t?M:N;default:return[]}}function F(e,t,n,r){let i=S(e),a=P(x(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(k)))),a}function I(e){let t=x(e);return v[t]+e.slice(t.length)}function L(e){return{top:0,right:0,bottom:0,left:0,...e}}function R(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:L(e)}function z(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function B(e,t,n){let{reference:r,floating:i}=e,a=T(t),o=E(t),s=w(o),c=x(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(S(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ee(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=b(t,e),p=R(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=z(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=z(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var te=50,ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ee},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=B(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<te&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=B(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=b(e,t)||{};if(l==null)return{};let d=R(u),f={x:n,y:r},m=E(i),h=w(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,x=_?`bottom`:`right`,C=_?`clientHeight`:`clientWidth`,T=a.reference[h]+a.reference[m]-f[m]-a.floating[h],D=f[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[C]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[C]||a.floating[h]);let A=T/2-D/2,j=k/2-g[h]/2-1,M=p(d[v],j),N=p(d[x],j),P=M,F=k-g[h]-N,I=k/2-g[h]/2+A,L=y(P,I,F),z=!c.arrow&&S(i)!=null&&I!==L&&a.reference[h]/2-(I<P?M:N)-g[h]/2<0,B=z?I<P?I-P:I-F:0;return{[m]:f[m]+B,data:{[m]:L,centerOffset:I-L-B,...z&&{alignmentOffset:B}},reset:z}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=b(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=x(r),_=T(o),v=x(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[I(o)]:O(o)),C=p!==`none`;!d&&C&&S.push(...F(o,m,p,y));let w=[o,...S],E=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(E[g]),u){let e=D(r,a,y);k.push(E[e[0]],E[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=w[e];if(t&&(!(u===`alignment`&&_!==T(t))||A.every(e=>T(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=T(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return f.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=b(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=x(n),s=S(n),c=T(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=b(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=b(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=T(x(i)),p=C(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=y(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=y(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=b(e,t),u={x:n,y:r},d=T(i),f=C(d),p=u[f],m=u[d],h=b(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(x(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=b(e,t),u=await o.detectOverflow(t,l),d=x(i),f=S(i),h=T(i)===`y`,{width:g,height:_}=a.floating,v,y;d===`top`||d===`bottom`?(v=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(y=d,v=f===`end`?`top`:`bottom`);let C=_-u.top-u.bottom,w=g-u.left-u.right,E=p(_-u[v],C),D=p(g-u[y],w),O=!t.middlewareData.shift,k=E,A=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=C),O&&!f){let e=m(u.left,0),t=m(u.right,0),n=m(u.top,0),r=m(u.bottom,0);h?A=g-2*(e!==0||t!==0?e+t:m(u.left,u.right)):k=_-2*(n!==0||r!==0?n+r:m(u.top,u.bottom))}await c({...t,availableWidth:A,availableHeight:k});let j=await o.getDimensions(s.floating);return g!==j.width||_!==j.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<`u`}function V(e){return he(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((he(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function he(e){return me()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return me()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return me()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function ge(e){return!me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function K(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _e(e){return/^(table|td|th)$/.test(V(e))}function ve(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ye=/transform|translate|scale|rotate|perspective|filter/,be=/paint|layout|strict|content/,q=e=>!!e&&e!==`none`,xe;function Se(e){let t=W(e)?Y(e):e;return q(t.transform)||q(t.translate)||q(t.scale)||q(t.rotate)||q(t.perspective)||!we()&&(q(t.backdropFilter)||q(t.filter))||ye.test(t.willChange||``)||be.test(t.contain||``)}function Ce(e){let t=X(e);for(;G(t)&&!J(t);){if(Se(t))return t;if(ve(t))return null;t=X(t)}return null}function we(){return xe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xe}function J(e){return/^(html|body|#document)$/.test(V(e))}function Y(e){return H(e).getComputedStyle(e)}function Te(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function X(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||U(e);return ge(t)?t.host:t}function Ee(e){let t=X(e);return J(t)?e.ownerDocument?e.ownerDocument.body:e.body:G(t)&&K(t)?t:Ee(t)}function De(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ee(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],K(r)?r:[],e&&n?De(e):[])}else return t.concat(r,De(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ke(e){let t=Y(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=h(n)!==a||h(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ae(e){return W(e)?e:e.contextElement}function Z(e){let t=Ae(e);if(!G(t))return _(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ke(t),o=(a?h(n.width):n.width)/r,s=(a?h(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var je=_(0);function Me(e){let t=H(e);return!we()||!t.visualViewport?je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ne(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ae(e),o=_(1);t&&(r?W(r)&&(o=Z(r)):o=Z(e));let s=Ne(a,n,r)?Me(a):_(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=H(a),t=r&&W(r)?H(r):r,n=e,i=Oe(n);for(;i&&r&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=Y(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Oe(n)}}return z({width:u,height:d,x:c,y:l})}function Pe(e,t){let n=Te(e).scrollLeft;return t?t.left+n:Q(U(e)).left+n}function Fe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Pe(e,n),y:n.top+t.scrollTop}}function Ie(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?ve(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=_(1),u=_(0),d=G(r);if((d||!d&&!a)&&((V(r)!==`body`||K(o))&&(c=Te(r)),d)){let e=Q(r);l=Z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Fe(o,c):_(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Le(e){return Array.from(e.getClientRects())}function Re(e){let t=U(e),n=Te(e),r=e.ownerDocument.body,i=m(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=m(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Pe(e),s=-n.scrollTop;return Y(r).direction===`rtl`&&(o+=m(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ze=25;function Be(e,t){let n=H(e),r=U(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=we();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Pe(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=ze&&(a-=o)}else l<=ze&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ve(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=G(e)?Z(e):_(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function He(e,t,n){let r;if(t===`viewport`)r=Be(e,n);else if(t===`document`)r=Re(U(e));else if(W(t))r=Ve(t,n);else{let n=Me(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return z(r)}function Ue(e,t){let n=X(e);return n===t||!W(n)||J(n)?!1:Y(n).position===`fixed`||Ue(n,t)}function We(e,t){let n=t.get(e);if(n)return n;let r=De(e,[],!1).filter(e=>W(e)&&V(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?X(e):e;for(;W(o)&&!J(o);){let t=Y(o),n=Se(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||K(o)&&!n&&Ue(e,o))?r=r.filter(e=>e!==o):i=t,o=X(o)}return t.set(e,r),r}function Ge(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ve(t)?[]:We(t,this._c):[].concat(n),r],o=He(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=He(t,a[e],i);s=m(n.top,s),c=p(n.right,c),l=p(n.bottom,l),u=m(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ke(e){let{width:t,height:n}=ke(e);return{width:t,height:n}}function qe(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=_(0);function l(){c.x=Pe(i)}if(r||!r&&!a)if((V(t)!==`body`||K(i))&&(s=Te(t)),r){let e=Q(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Fe(i,s):_(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Je(e){return Y(e).position===`static`}function Ye(e,t){if(!G(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function Xe(e,t){let n=H(e);if(ve(e))return n;if(!G(e)){let t=X(e);for(;t&&!J(t);){if(W(t)&&!Je(t))return t;t=X(t)}return n}let r=Ye(e,t);for(;r&&_e(r)&&Je(r);)r=Ye(r,t);return r&&J(r)&&Je(r)&&!Se(r)?n:r||Ce(e)||n}var Ze=async function(e){let t=this.getOffsetParent||Xe,n=this.getDimensions,r=await n(e.floating);return{reference:qe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qe(e){return Y(e).direction===`rtl`}var $e={convertOffsetParentRelativeRectToViewportRelativeRect:Ie,getDocumentElement:U,getClippingRect:Ge,getOffsetParent:Xe,getElementRects:Ze,getClientRects:Le,getDimensions:Ke,getScale:Z,isElement:W,isRTL:Qe};function et(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tt(e,t){let n=null,r,i=U(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(s||t(),!f||!h)return;let _=g(d),v=g(i.clientWidth-(u+f)),y=g(i.clientHeight-(d+h)),b=g(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:m(0,p(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==c){if(!S)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!et(l,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function nt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ae(e),u=i||a?[...l?De(l):[],...t?De(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?tt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!et(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var rt=ue,it=de,at=ie,ot=pe,st=se,ct=re,lt=fe,ut=(e,t,n)=>{let r=new Map,i={platform:$e,...n},a={...i.platform,_c:r};return ne(e,t,{...i,platform:a})},dt=e(n(),1),ft=typeof document<`u`?d.useLayoutEffect:function(){};function pt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!pt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function mt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ht(e,t){let n=mt(e);return Math.round(t*n)/n}function gt(e){let t=d.useRef(e);return ft(()=>{t.current=e}),t}function _t(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);pt(p,r)||m(r);let[h,g]=d.useState(null),[_,v]=d.useState(null),y=d.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=d.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=d.useRef(null),w=d.useRef(null),T=d.useRef(u),E=c!=null,D=gt(c),O=gt(i),k=gt(l),A=d.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),ut(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!pt(T.current,t)&&(T.current=t,dt.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);ft(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=d.useRef(!1);ft(()=>(j.current=!0,()=>{j.current=!1}),[]),ft(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=d.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=d.useMemo(()=>({reference:x,floating:S}),[x,S]),P=d.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ht(N.floating,u.x),r=ht(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...mt(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var vt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ct({element:r.current,padding:i}).fn(n):r?ct({element:r,padding:i}).fn(n):{}}}},yt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},bt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},xt=(e,t)=>({fn:lt(e).fn,options:[e,t]}),St=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{let n=ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},wt=(e,t)=>{let n=st(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tt=(e,t)=>{let n=vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$=r(),Et=`Arrow`,Dt=d.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,$.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,$.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Dt.displayName=Et;var Ot=Dt,kt=`Popper`,[At,jt]=o(kt),[Mt,Nt]=At(kt),Pt=e=>{let{__scopePopper:t,children:n}=e,[r,i]=d.useState(null),[a,o]=d.useState(void 0);return(0,$.jsx)(Mt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Pt.displayName=kt;var Ft=`PopperAnchor`,It=d.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...a}=e,o=Nt(Ft,n),s=d.useRef(null),l=o.onAnchorChange,u=i(t,d.useCallback(e=>{s.current=e,e&&l(e)},[l])),f=d.useRef(null);d.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&l(f.current)});let p=o.placementState&&Kt(o.placementState),m=p?.[0],h=p?.[1];return r?null:(0,$.jsx)(c.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...a,ref:u})});It.displayName=Ft;var Lt=`PopperContent`,[Rt,zt]=At(Lt),Bt=d.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:o=0,align:u=`center`,alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:_=`partial`,hideWhenDetached:v=!1,updatePositionStrategy:y=`optimized`,onPlaced:b,...x}=e,S=Nt(Lt,n),[C,w]=d.useState(null),T=i(t,w),[E,D]=d.useState(null),O=l(E),k=O?.width??0,A=O?.height??0,j=r+(u===`center`?``:`-`+u),M=typeof g==`number`?g:{top:0,right:0,bottom:0,left:0,...g},N=Array.isArray(h)?h:[h],P=N.length>0,F={padding:M,boundary:N.filter(Wt),altBoundary:P},{refs:I,floatingStyles:L,placement:R,isPositioned:z,middlewareData:B}=_t({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>nt(...e,{animationFrame:y===`always`}),elements:{reference:S.anchor},middleware:[yt({mainAxis:o+A,alignmentAxis:f}),m&&bt({mainAxis:!0,crossAxis:!1,limiter:_===`partial`?xt():void 0,...F}),m&&St({...F}),Ct({...F,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Tt({element:E,padding:p}),Gt({arrowWidth:k,arrowHeight:A}),v&&wt({strategy:`referenceHidden`,...F,boundary:P?F.boundary:void 0})]}),ee=S.setPlacementState;a(()=>(ee(R),()=>{ee(void 0)}),[R,ee]);let[te,ne]=Kt(R),re=s(b);a(()=>{z&&re?.()},[z,re]);let ie=B.arrow?.x,ae=B.arrow?.y,oe=B.arrow?.centerOffset!==0,[se,ce]=d.useState();return a(()=>{C&&ce(window.getComputedStyle(C).zIndex)},[C]),(0,$.jsx)(`div`,{ref:I.setFloating,"data-radix-popper-content-wrapper":``,style:{...L,transform:z?L.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(` `),...B.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,$.jsx)(Rt,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,$.jsx)(c.div,{"data-side":te,"data-align":ne,...x,ref:T,style:{...x.style,animation:z?void 0:`none`}})})})});Bt.displayName=Lt;var Vt=`PopperArrow`,Ht={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ut=d.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=zt(Vt,n),a=Ht[i.placedSide];return(0,$.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,$.jsx)(Ot,{...r,ref:t,style:{...r.style,display:`block`}})})});Ut.displayName=Vt;function Wt(e){return e!==null}var Gt=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Kt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Kt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var qt=Pt,Jt=It,Yt=Bt,Xt=Ut;export{jt as a,qt as i,Xt as n,u as o,Yt as r,Jt as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-Bb3IsNbi.js";import{n}from"./dist-CQJY6SVY.js";var r=e(t(),1);function i(e){let[t,i]=r.useState(void 0);return n(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let n=t[0],r,a;if(`borderBoxSize`in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;i({width:r,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else i(void 0)},[e]),t}export{i as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-Bb3IsNbi.js";import{t as n}from"./jsx-runtime-DX3WBWVO.js";import{t as r}from"./inline-Cw-gigDW.js";import{i,o as a,t as o}from"./field-ChCAabZg.js";import{B as ee,Bt as te,Cn as ne,Cr as re,Fi as ie,Ho as ae,Ht as oe,Ir as s,Ms as se,Sr as ce,_t as le,br as ue,ht as de,ir as c,or as l,rr as u,xr as fe,zt as pe}from"./index-08n05-rc.js";import"./layout-B0YLh7R9.js";import{n as me,t as d}from"./social-web-handle-CvfIKPww.js";var f=e(t(),1),p=n();function m(e){let t=e.trim();if(t===``)return null;try{return new URL(t.includes(`://`)?t:`https://${t}`).host||null}catch{return t.replace(/^[a-z][a-z\d+\-.]*:\/\//i,``).split(/[/?#]/)[0]||null}}function he(e,t){if(e)try{return new URL(e).host}catch{}return t?.split(`@`).at(-1)??``}function ge(e,t){if(!e)return``;try{return new URL(e,t||window.location.origin).toString()}catch{return e}}async function _e(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}var h=()=>{let{data:e,isLoading:t}=le(`index`,`me`),{data:n}=ne(),{data:h,isLoading:ve,isError:g}=de(`index`),_=pe(`index`),v=oe(`index`),y=te(e?.handle||`index`),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(``),[w,T]=(0,f.useState)(null),[E,D]=(0,f.useState)(!1),[O,k]=(0,f.useState)(!1),[A,j]=(0,f.useState)(!1),[M,N]=(0,f.useState)(null),[P,F]=(0,f.useState)(null),[I,L]=(0,f.useState)(null),[ye,R]=(0,f.useState)(!1),[be,z]=(0,f.useState)(!1),B=(0,f.useRef)(null);(0,f.useEffect)(()=>{e?.handle&&(C(d(e.handle).username),T(null))},[e?.handle]),(0,f.useEffect)(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);let V=m(b),H=h?.domain??null,U=he(h?.actorUrl,h?.handle),W=d(e?.handle).username,G=y.isPending,xe=_.isPending||v.isPending,K=ve||xe,q=t||G||!e,J=!!(E&&S!==W),Y=!!(A&&V&&(!H||M===V)),Se=!!(O&&V&&!A),X=!!(Y&&V&&V!==M),Ce=!!(M&&V===M),we=V?`https://${V}/.well-known/webfinger`:``,Te=U?`https://${U}/.well-known/webfinger`:``,Z=d(h?.handle),Q={username:E?S:Z.username,domain:(O||A)&&b?V??b.trim():Z.domain},Ee=`@${Q.username}@${Q.domain}`,De=ge(e?.avatarUrl||n?.site?.icon,n?.site?.url),Oe=e=>{e.preventDefault();let t=m(new FormData(e.currentTarget).get(`domain`)?.toString()??``);t&&(x(t),k(!0),j(!0),F(null),L(null))},ke=async()=>{if(!(!V||!X)){F(null),L(null);try{await v.mutateAsync(V),N(V)}catch{L(`Redirect could not be validated`)}}},Ae=async()=>{if(M){F(null),L(null);try{await _.mutateAsync(M),x(``),k(!1),j(!1),N(null)}catch{F(`Could not save the custom domain. Try again.`)}}},$=()=>{x(``),k(!1),j(!1),N(null),F(null),L(null)},je=async()=>{if(!e||!E||!J)return;let t=me(S);if(t){T(t);return}T(null);try{await y.mutateAsync({name:e.name,username:S,bio:e.bio??``,avatarUrl:e.avatarUrl||``,bannerImageUrl:e.bannerImageUrl||``}),D(!1)}catch{T(`Could not save the Social Web username. Try again.`)}},Me=()=>{C(W),T(null),D(!1)},Ne=async()=>{F(null);try{await _.mutateAsync(null),x(``),k(!1),j(!1),N(null)}catch{F(`Could not remove the custom domain. Try again.`)}},Pe=async()=>{!Q.username||!Q.domain||(await _e(Ee),R(!0),z(!0),B.current&&window.clearTimeout(B.current),B.current=window.setTimeout(()=>{R(!1),z(!1)},2e3))};return(0,p.jsx)(ee,{children:(0,p.jsxs)(`div`,{className:`mx-auto max-w-[620px] py-[min(4vh,48px)]`,children:[(0,p.jsx)(r,{gap:`2xl`,justify:`between`,children:(0,p.jsx)(se,{children:`Your social web handle`})}),(0,p.jsx)(`p`,{className:`mt-3 text-base text-muted-foreground`,children:`Like an email address, your handle is how people can find and interact with you.`}),(0,p.jsx)(`div`,{className:`mt-10`,children:(0,p.jsx)(`div`,{className:`rounded-md border border-border-default bg-sidebar px-4 pt-3 pb-4`,children:(0,p.jsx)(o,{children:ve?(0,p.jsx)(c,{className:`mt-2 h-16 w-full`}):g?(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Could not load your Social Web handle.`}):(0,p.jsxs)(`div`,{className:`mt-3 flex items-start gap-2`,children:[(0,p.jsx)(`div`,{className:`mt-[-5px] flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-elevated text-muted-foreground ring-1 ring-border-default`,children:t?(0,p.jsx)(c,{className:`size-7 rounded-full`}):De?(0,p.jsx)(`img`,{alt:e?.name||n?.site?.title||``,className:`size-full rounded-full object-cover`,referrerPolicy:`no-referrer`,src:De}):(0,p.jsx)(ie,{className:`size-4`,strokeWidth:1.5})}),(0,p.jsx)(`div`,{className:`-ml-14 min-w-0 overflow-x-auto px-14`,children:(0,p.jsxs)(`div`,{"aria-label":`Social Web handle breakdown`,className:`inline-flex pb-9 font-mono text-xl leading-none font-medium whitespace-nowrap text-foreground select-none`,role:`group`,children:[(0,p.jsx)(`span`,{children:`@`}),(0,p.jsxs)(`div`,{className:`relative`,children:[(0,p.jsx)(`span`,{children:Q.username}),(0,p.jsxs)(`div`,{className:`absolute top-7 left-0 w-full border-t border-border-strong before:absolute before:top-[-5px] before:left-0 before:h-[5px] before:border-l before:border-border-strong after:absolute after:top-[-5px] after:right-0 after:h-[5px] after:border-l after:border-border-strong`,children:[(0,p.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-0 left-1/2 h-[5px] border-l border-border-strong`}),(0,p.jsx)(`div`,{className:`absolute top-2 right-0 w-max min-w-full text-center font-sans text-[10px] leading-normal font-medium whitespace-nowrap text-muted-foreground uppercase`,children:`Username`})]})]}),(0,p.jsx)(`span`,{className:`ml-px`,children:`@`}),(0,p.jsxs)(`div`,{className:`relative`,children:[(0,p.jsx)(`span`,{children:Q.domain}),(0,p.jsxs)(`div`,{className:`absolute top-7 left-0 w-full border-t border-state-success before:absolute before:top-[-5px] before:left-0 before:h-[5px] before:border-l before:border-state-success after:absolute after:top-[-5px] after:right-0 after:h-[5px] after:border-l after:border-state-success`,children:[(0,p.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-0 left-1/2 h-[5px] border-l border-state-success`}),(0,p.jsx)(`div`,{className:`absolute top-2 left-0 w-max min-w-full text-center font-sans text-[10px] leading-normal font-medium whitespace-nowrap text-state-success uppercase`,children:`Domain`})]})]}),h?.handle&&(0,p.jsx)(ce,{delayDuration:0,children:(0,p.jsxs)(ue,{open:be,onOpenChange:z,children:[(0,p.jsx)(re,{asChild:!0,children:(0,p.jsx)(s,{"aria-label":`Copy Social Web handle`,className:`mt-[-2px] ml-1.5 size-5 shrink-0 self-start p-0 text-muted-foreground hover:text-foreground [&_svg]:size-3.5!`,type:`button`,variant:`ghost`,onClick:()=>{Pe()},children:(0,p.jsx)(ae,{size:12})})}),(0,p.jsx)(fe,{children:ye?`Copied!`:`Copy`})]})})]})})]})})})}),(0,p.jsx)(`form`,{className:`mt-10`,onSubmit:e=>{e.preventDefault(),je()},children:(0,p.jsxs)(o,{children:[(0,p.jsx)(a,{htmlFor:`social-web-username`,children:`Social web username`}),t?(0,p.jsx)(c,{className:`h-9 w-full`}):(0,p.jsxs)(r,{className:`flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,children:[(0,p.jsx)(l,{"aria-describedby":w?`social-web-username-error`:void 0,"aria-invalid":w?!0:void 0,autoComplete:`off`,className:`sm:flex-1`,disabled:q||!E,id:`social-web-username`,value:S,"data-1p-ignore":!0,onChange:e=>{C(e.target.value),T(null)}}),E?(0,p.jsxs)(r,{gap:`md`,justify:`end`,children:[(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:G,type:`button`,variant:`outline`,onClick:Me,children:`Cancel`}),(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:q||!J,type:`submit`,children:G?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u,{color:`light`,size:`sm`}),`Saving...`]}):`Save`})]}):(0,p.jsx)(s,{"aria-label":`Edit Social web username`,className:`h-9 text-sm sm:w-auto`,disabled:q,type:`button`,variant:`outline`,onClick:()=>{C(W),T(null),D(!0)},children:`Edit`})]}),w&&(0,p.jsx)(i,{id:`social-web-username-error`,children:w})]})}),(0,p.jsx)(`div`,{className:`mt-10`,children:H&&!M?(0,p.jsxs)(o,{"data-invalid":P?!0:void 0,children:[(0,p.jsx)(a,{htmlFor:`social-web-active-domain`,children:`Social web domain`}),(0,p.jsxs)(r,{className:`flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,children:[(0,p.jsx)(l,{"aria-label":`Active social web domain`,autoComplete:`off`,className:`sm:flex-1`,id:`social-web-active-domain`,value:H,"data-1p-ignore":!0,disabled:!0}),(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:K,variant:`outline`,onClick:Ne,children:_.isPending?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u,{size:`sm`}),`Removing...`]}):`Remove`})]}),P&&(0,p.jsx)(i,{id:`social-web-domain-error`,children:P})]}):(0,p.jsxs)(`form`,{onSubmit:Oe,children:[(0,p.jsxs)(o,{"data-invalid":P?!0:void 0,children:[(0,p.jsx)(a,{htmlFor:`social-web-domain`,children:`Social web domain`}),(0,p.jsxs)(r,{className:`flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,children:[(0,p.jsx)(l,{"aria-describedby":P?`social-web-domain-error`:void 0,"aria-invalid":P?!0:void 0,"aria-label":`Social web domain`,autoComplete:`off`,className:`sm:flex-1`,disabled:K||!O||A,id:`social-web-domain`,name:`domain`,placeholder:U,value:O||A?b:U,"data-1p-ignore":!0,onChange:e=>{x(e.target.value),j(!1),N(null),F(null),L(null)}}),!Y&&(O?(0,p.jsxs)(r,{gap:`md`,justify:`end`,children:[(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:K,type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:K||!Se||g,type:`submit`,children:`Activate`})]}):(0,p.jsx)(s,{"aria-label":`Edit Social web domain`,className:`h-9 text-sm sm:w-auto`,disabled:K||g,type:`button`,variant:`outline`,onClick:()=>{x(``),F(null),L(null),k(!0)},children:`Edit`}))]}),P&&(0,p.jsx)(i,{id:`social-web-domain-error`,children:P})]}),Y&&(0,p.jsxs)(`div`,{className:`mt-6 rounded-md border border-border-default bg-surface-elevated p-4`,children:[(0,p.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Set up your redirect`}),(0,p.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Add a redirect or proxy service to forward social web requests to Ghost.`}),(0,p.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 text-sm`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`text-muted-foreground`,children:`Redirect from`}),(0,p.jsx)(`code`,{className:`mt-1 block overflow-x-auto rounded-sm bg-background px-3 py-2 text-foreground`,children:we})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`text-muted-foreground`,children:`Redirect to`}),(0,p.jsx)(`code`,{className:`mt-1 block overflow-x-auto rounded-sm bg-background px-3 py-2 text-foreground`,children:Te})]})]})]}),Y&&(0,p.jsxs)(r,{className:`mt-4 flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,justify:`between`,children:[(0,p.jsx)(`div`,{className:`text-sm text-destructive`,children:I}),(0,p.jsxs)(r,{gap:`md`,justify:`end`,children:[(0,p.jsx)(s,{disabled:K,variant:`outline`,onClick:$,children:`Cancel`}),Ce?(0,p.jsx)(s,{disabled:K,onClick:Ae,children:_.isPending?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u,{color:`light`,size:`sm`}),`Saving...`]}):`Save`}):(0,p.jsx)(s,{disabled:K||!X||g,onClick:ke,children:v.isPending?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(u,{color:`light`,size:`sm`}),`Validating...`]}):I?`Retry`:`Validate`})]})]})]})})]})})};export{h as default};
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-Bb3IsNbi.js";import{t as n}from"./jsx-runtime-DX3WBWVO.js";import{t as r}from"./inline-Cw-gigDW.js";import{i,o as a,t as o}from"./field-Dh_lwk13.js";import{B as ee,Bt as te,Ht as ne,Ir as re,Lr as ie,Pi as ae,Pr as s,Rr as oe,Tn as se,Vo as ce,_t as le,ar as c,cr as l,ht as ue,js as de,or as u,zr as fe,zt as pe}from"./index-BHy2DZX-.js";import"./layout-TMj4P-vv.js";import{n as me,t as d}from"./social-web-handle-CvfIKPww.js";var f=e(t(),1),p=n();function m(e){let t=e.trim();if(t===``)return null;try{return new URL(t.includes(`://`)?t:`https://${t}`).host||null}catch{return t.replace(/^[a-z][a-z\d+\-.]*:\/\//i,``).split(/[/?#]/)[0]||null}}function he(e,t){if(e)try{return new URL(e).host}catch{}return t?.split(`@`).at(-1)??``}function ge(e,t){if(!e)return``;try{return new URL(e,t||window.location.origin).toString()}catch{return e}}async function _e(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}var h=()=>{let{data:e,isLoading:t}=le(`index`,`me`),{data:n}=se(),{data:h,isLoading:ve,isError:g}=ue(`index`),_=pe(`index`),v=ne(`index`),y=te(e?.handle||`index`),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(``),[w,T]=(0,f.useState)(null),[E,D]=(0,f.useState)(!1),[O,k]=(0,f.useState)(!1),[A,j]=(0,f.useState)(!1),[M,N]=(0,f.useState)(null),[P,F]=(0,f.useState)(null),[I,L]=(0,f.useState)(null),[ye,R]=(0,f.useState)(!1),[be,z]=(0,f.useState)(!1),B=(0,f.useRef)(null);(0,f.useEffect)(()=>{e?.handle&&(C(d(e.handle).username),T(null))},[e?.handle]),(0,f.useEffect)(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);let V=m(b),H=h?.domain??null,U=he(h?.actorUrl,h?.handle),W=d(e?.handle).username,G=y.isPending,xe=_.isPending||v.isPending,K=ve||xe,q=t||G||!e,J=!!(E&&S!==W),Y=!!(A&&V&&(!H||M===V)),Se=!!(O&&V&&!A),X=!!(Y&&V&&V!==M),Ce=!!(M&&V===M),we=V?`https://${V}/.well-known/webfinger`:``,Te=U?`https://${U}/.well-known/webfinger`:``,Z=d(h?.handle),Q={username:E?S:Z.username,domain:(O||A)&&b?V??b.trim():Z.domain},Ee=`@${Q.username}@${Q.domain}`,De=ge(e?.avatarUrl||n?.site?.icon,n?.site?.url),Oe=e=>{e.preventDefault();let t=m(new FormData(e.currentTarget).get(`domain`)?.toString()??``);t&&(x(t),k(!0),j(!0),F(null),L(null))},ke=async()=>{if(!(!V||!X)){F(null),L(null);try{await v.mutateAsync(V),N(V)}catch{L(`Redirect could not be validated`)}}},Ae=async()=>{if(M){F(null),L(null);try{await _.mutateAsync(M),x(``),k(!1),j(!1),N(null)}catch{F(`Could not save the custom domain. Try again.`)}}},$=()=>{x(``),k(!1),j(!1),N(null),F(null),L(null)},je=async()=>{if(!e||!E||!J)return;let t=me(S);if(t){T(t);return}T(null);try{await y.mutateAsync({name:e.name,username:S,bio:e.bio??``,avatarUrl:e.avatarUrl||``,bannerImageUrl:e.bannerImageUrl||``}),D(!1)}catch{T(`Could not save the Social Web username. Try again.`)}},Me=()=>{C(W),T(null),D(!1)},Ne=async()=>{F(null);try{await _.mutateAsync(null),x(``),k(!1),j(!1),N(null)}catch{F(`Could not remove the custom domain. Try again.`)}},Pe=async()=>{!Q.username||!Q.domain||(await _e(Ee),R(!0),z(!0),B.current&&window.clearTimeout(B.current),B.current=window.setTimeout(()=>{R(!1),z(!1)},2e3))};return(0,p.jsx)(ee,{children:(0,p.jsxs)(`div`,{className:`mx-auto max-w-[620px] py-[min(4vh,48px)]`,children:[(0,p.jsx)(r,{gap:`2xl`,justify:`between`,children:(0,p.jsx)(de,{children:`Your social web handle`})}),(0,p.jsx)(`p`,{className:`mt-3 text-base text-muted-foreground`,children:`Like an email address, your handle is how people can find and interact with you.`}),(0,p.jsx)(`div`,{className:`mt-10`,children:(0,p.jsx)(`div`,{className:`rounded-md border border-border-default bg-sidebar px-4 pt-3 pb-4`,children:(0,p.jsx)(o,{children:ve?(0,p.jsx)(u,{className:`mt-2 h-16 w-full`}):g?(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Could not load your Social Web handle.`}):(0,p.jsxs)(`div`,{className:`mt-3 flex items-start gap-2`,children:[(0,p.jsx)(`div`,{className:`mt-[-5px] flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-elevated text-muted-foreground ring-1 ring-border-default`,children:t?(0,p.jsx)(u,{className:`size-7 rounded-full`}):De?(0,p.jsx)(`img`,{alt:e?.name||n?.site?.title||``,className:`size-full rounded-full object-cover`,referrerPolicy:`no-referrer`,src:De}):(0,p.jsx)(ae,{className:`size-4`,strokeWidth:1.5})}),(0,p.jsx)(`div`,{className:`-ml-14 min-w-0 overflow-x-auto px-14`,children:(0,p.jsxs)(`div`,{"aria-label":`Social Web handle breakdown`,className:`inline-flex pb-9 font-mono text-xl leading-none font-medium whitespace-nowrap text-foreground select-none`,role:`group`,children:[(0,p.jsx)(`span`,{children:`@`}),(0,p.jsxs)(`div`,{className:`relative`,children:[(0,p.jsx)(`span`,{children:Q.username}),(0,p.jsxs)(`div`,{className:`absolute top-7 left-0 w-full border-t border-border-strong before:absolute before:top-[-5px] before:left-0 before:h-[5px] before:border-l before:border-border-strong after:absolute after:top-[-5px] after:right-0 after:h-[5px] after:border-l after:border-border-strong`,children:[(0,p.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-0 left-1/2 h-[5px] border-l border-border-strong`}),(0,p.jsx)(`div`,{className:`absolute top-2 right-0 w-max min-w-full text-center font-sans text-[10px] leading-normal font-medium whitespace-nowrap text-muted-foreground uppercase`,children:`Username`})]})]}),(0,p.jsx)(`span`,{className:`ml-px`,children:`@`}),(0,p.jsxs)(`div`,{className:`relative`,children:[(0,p.jsx)(`span`,{children:Q.domain}),(0,p.jsxs)(`div`,{className:`absolute top-7 left-0 w-full border-t border-state-success before:absolute before:top-[-5px] before:left-0 before:h-[5px] before:border-l before:border-state-success after:absolute after:top-[-5px] after:right-0 after:h-[5px] after:border-l after:border-state-success`,children:[(0,p.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-0 left-1/2 h-[5px] border-l border-state-success`}),(0,p.jsx)(`div`,{className:`absolute top-2 left-0 w-max min-w-full text-center font-sans text-[10px] leading-normal font-medium whitespace-nowrap text-state-success uppercase`,children:`Domain`})]})]}),h?.handle&&(0,p.jsx)(oe,{delayDuration:0,children:(0,p.jsxs)(re,{open:be,onOpenChange:z,children:[(0,p.jsx)(fe,{asChild:!0,children:(0,p.jsx)(s,{"aria-label":`Copy Social Web handle`,className:`mt-[-2px] ml-1.5 size-5 shrink-0 self-start p-0 text-muted-foreground hover:text-foreground [&_svg]:size-3.5!`,type:`button`,variant:`ghost`,onClick:()=>{Pe()},children:(0,p.jsx)(ce,{size:12})})}),(0,p.jsx)(ie,{children:ye?`Copied!`:`Copy`})]})})]})})]})})})}),(0,p.jsx)(`form`,{className:`mt-10`,onSubmit:e=>{e.preventDefault(),je()},children:(0,p.jsxs)(o,{children:[(0,p.jsx)(a,{htmlFor:`social-web-username`,children:`Social web username`}),t?(0,p.jsx)(u,{className:`h-9 w-full`}):(0,p.jsxs)(r,{className:`flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,children:[(0,p.jsx)(l,{"aria-describedby":w?`social-web-username-error`:void 0,"aria-invalid":w?!0:void 0,autoComplete:`off`,className:`sm:flex-1`,disabled:q||!E,id:`social-web-username`,value:S,"data-1p-ignore":!0,onChange:e=>{C(e.target.value),T(null)}}),E?(0,p.jsxs)(r,{gap:`md`,justify:`end`,children:[(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:G,type:`button`,variant:`outline`,onClick:Me,children:`Cancel`}),(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:q||!J,type:`submit`,children:G?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c,{color:`light`,size:`sm`}),`Saving...`]}):`Save`})]}):(0,p.jsx)(s,{"aria-label":`Edit Social web username`,className:`h-9 text-sm sm:w-auto`,disabled:q,type:`button`,variant:`outline`,onClick:()=>{C(W),T(null),D(!0)},children:`Edit`})]}),w&&(0,p.jsx)(i,{id:`social-web-username-error`,children:w})]})}),(0,p.jsx)(`div`,{className:`mt-10`,children:H&&!M?(0,p.jsxs)(o,{"data-invalid":P?!0:void 0,children:[(0,p.jsx)(a,{htmlFor:`social-web-active-domain`,children:`Social web domain`}),(0,p.jsxs)(r,{className:`flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,children:[(0,p.jsx)(l,{"aria-label":`Active social web domain`,autoComplete:`off`,className:`sm:flex-1`,id:`social-web-active-domain`,value:H,"data-1p-ignore":!0,disabled:!0}),(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:K,variant:`outline`,onClick:Ne,children:_.isPending?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c,{size:`sm`}),`Removing...`]}):`Remove`})]}),P&&(0,p.jsx)(i,{id:`social-web-domain-error`,children:P})]}):(0,p.jsxs)(`form`,{onSubmit:Oe,children:[(0,p.jsxs)(o,{"data-invalid":P?!0:void 0,children:[(0,p.jsx)(a,{htmlFor:`social-web-domain`,children:`Social web domain`}),(0,p.jsxs)(r,{className:`flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,children:[(0,p.jsx)(l,{"aria-describedby":P?`social-web-domain-error`:void 0,"aria-invalid":P?!0:void 0,"aria-label":`Social web domain`,autoComplete:`off`,className:`sm:flex-1`,disabled:K||!O||A,id:`social-web-domain`,name:`domain`,placeholder:U,value:O||A?b:U,"data-1p-ignore":!0,onChange:e=>{x(e.target.value),j(!1),N(null),F(null),L(null)}}),!Y&&(O?(0,p.jsxs)(r,{gap:`md`,justify:`end`,children:[(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:K,type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,p.jsx)(s,{className:`h-9 text-sm sm:w-auto`,disabled:K||!Se||g,type:`submit`,children:`Activate`})]}):(0,p.jsx)(s,{"aria-label":`Edit Social web domain`,className:`h-9 text-sm sm:w-auto`,disabled:K||g,type:`button`,variant:`outline`,onClick:()=>{x(``),F(null),L(null),k(!0)},children:`Edit`}))]}),P&&(0,p.jsx)(i,{id:`social-web-domain-error`,children:P})]}),Y&&(0,p.jsxs)(`div`,{className:`mt-6 rounded-md border border-border-default bg-surface-elevated p-4`,children:[(0,p.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Set up your redirect`}),(0,p.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Add a redirect or proxy service to forward social web requests to Ghost.`}),(0,p.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 text-sm`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`text-muted-foreground`,children:`Redirect from`}),(0,p.jsx)(`code`,{className:`mt-1 block overflow-x-auto rounded-sm bg-background px-3 py-2 text-foreground`,children:we})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`text-muted-foreground`,children:`Redirect to`}),(0,p.jsx)(`code`,{className:`mt-1 block overflow-x-auto rounded-sm bg-background px-3 py-2 text-foreground`,children:Te})]})]})]}),Y&&(0,p.jsxs)(r,{className:`mt-4 flex-col items-stretch sm:flex-row sm:items-center`,gap:`md`,justify:`between`,children:[(0,p.jsx)(`div`,{className:`text-sm text-destructive`,children:I}),(0,p.jsxs)(r,{gap:`md`,justify:`end`,children:[(0,p.jsx)(s,{disabled:K,variant:`outline`,onClick:$,children:`Cancel`}),Ce?(0,p.jsx)(s,{disabled:K,onClick:Ae,children:_.isPending?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c,{color:`light`,size:`sm`}),`Saving...`]}):`Save`}):(0,p.jsx)(s,{disabled:K||!X||g,onClick:ke,children:v.isPending?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c,{color:`light`,size:`sm`}),`Validating...`]}):I?`Retry`:`Validate`})]})]})]})})]})})};export{h as default};