ghost 6.40.0 → 6.41.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 (184) hide show
  1. package/core/boot.js +8 -8
  2. package/core/built/admin/assets/{PolarAngleAxis-D7m1zwVk.js → PolarAngleAxis-Bh28wbPV.js} +1 -1
  3. package/core/built/admin/assets/{_baseAssignValue-BDsvYKNK.js → _baseAssignValue-hdDG700N.js} +1 -1
  4. package/core/built/admin/assets/{a-large-small-DxRNdz0F.js → a-large-small-BiK5_5LV.js} +1 -1
  5. package/core/built/admin/assets/{account-migration-SYnE1jBW.js → account-migration-DsSHanIB.js} +1 -1
  6. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
  7. package/core/built/admin/assets/admin-x-settings/{code-editor-view-Bj9rgbLw.mjs → code-editor-view-BEIdFhw3.mjs} +2 -2
  8. package/core/built/admin/assets/admin-x-settings/{index-BrZ9YAzd.mjs → index-BEh3nFEy.mjs} +3 -3
  9. package/core/built/admin/assets/admin-x-settings/{index-DRndIh9T.mjs → index-BLF2n6YB.mjs} +2 -2
  10. package/core/built/admin/assets/admin-x-settings/{index-CIl25Teq.mjs → index-BmPIWs5F.mjs} +3 -3
  11. package/core/built/admin/assets/admin-x-settings/{index-CNyNY3Wh.mjs → index-CP9YnNzc.mjs} +3 -3
  12. package/core/built/admin/assets/admin-x-settings/{index-SGr5sE2h.mjs → index-Cd2Ns-D2.mjs} +2 -2
  13. package/core/built/admin/assets/admin-x-settings/{index-PGoLP2kh.mjs → index-CjqAcKpK.mjs} +5 -5
  14. package/core/built/admin/assets/admin-x-settings/{index-pCIv_7bB.mjs → index-CnMcD9aj.mjs} +6212 -6158
  15. package/core/built/admin/assets/admin-x-settings/{index-CPCcgad-.mjs → index-LzsrZC40.mjs} +3 -3
  16. package/core/built/admin/assets/admin-x-settings/{index-DPqY4h5h.mjs → index-ZYW0UW7I.mjs} +3 -3
  17. package/core/built/admin/assets/admin-x-settings/{modals-lo32WZLi.mjs → modals-C48Tq1rW.mjs} +9 -9
  18. package/core/built/admin/assets/{arrow-right-BixoEua4.js → arrow-right-Bk43nMGd.js} +1 -1
  19. package/core/built/admin/assets/{at-sign-BsHNViA_.js → at-sign-DWOf36uj.js} +1 -1
  20. package/core/built/admin/assets/{audience-0RCWjbIK.js → audience-CvP78Gug.js} +1 -1
  21. package/core/built/admin/assets/{automations-DTUfYvf6.js → automations-BBWZhrha.js} +1 -1
  22. package/core/built/admin/assets/{automations-DiGkcVt-.js → automations-CmulGWwu.js} +1 -1
  23. package/core/built/admin/assets/{avatar-flipboard-BgoH-wIq.js → avatar-flipboard-CVf-N6wp.js} +1 -1
  24. package/core/built/admin/assets/{bluesky-sharing-C2xwSoS-.js → bluesky-sharing-DVC3I9Um.js} +1 -1
  25. package/core/built/admin/assets/{chart-X5cLIH1X.js → chart-CUKSNmKY.js} +1 -1
  26. package/core/built/admin/assets/{checkbox-DMamS4oG.js → checkbox-B_yDSM8z.js} +1 -1
  27. package/core/built/admin/assets/{chevron-up-CVgBkTk5.js → chevron-up-DuaKtE_M.js} +1 -1
  28. package/core/built/admin/assets/{chunk.941.f47098cbbce89a049e03.js → chunk.331.2ec2e2702eda02de96cd.js} +3 -3
  29. package/core/built/admin/assets/{chunk.524.a1d668dcc84709a5d702.js → chunk.524.49cc01002e1a5dba8ef9.js} +4 -4
  30. package/core/built/admin/assets/{chunk.582.180bf2525cf552f5ac5f.js → chunk.582.4bbc54c5f7d3dfb93288.js} +6 -6
  31. package/core/built/admin/assets/{circle-alert-Dg3UkvRP.js → circle-alert-bcK_Yqap.js} +1 -1
  32. package/core/built/admin/assets/{code-editor-view-CAICoZJe.js → code-editor-view-Bl4Jzjhk.js} +1 -1
  33. package/core/built/admin/assets/{comments-BHru9ZQ8.js → comments-DMea0nul.js} +1 -1
  34. package/core/built/admin/assets/{content-helpers-BByMp-Y5.js → content-helpers-B2yRzdvJ.js} +1 -1
  35. package/core/built/admin/assets/{copy-D7jqplrv.js → copy-DVtQi_VJ.js} +1 -1
  36. package/core/built/admin/assets/{data-list-DUaY9nlT.js → data-list-BF4GeUmt.js} +1 -1
  37. package/core/built/admin/assets/{deleted-feed-item-jLcSKuul.js → deleted-feed-item-DO2u3qmi.js} +1 -1
  38. package/core/built/admin/assets/{dropzone-DSPf3N_o.js → dropzone-Cs4DrURS.js} +1 -1
  39. package/core/built/admin/assets/{edit-profile-BvU2-lW5.js → edit-profile-CnuBNQhO.js} +1 -1
  40. package/core/built/admin/assets/{editor-D3fcjt_F.js → editor-CTO9FIUW.js} +1 -1
  41. package/core/built/admin/assets/{empty-indicator-2Pjmce3n.js → empty-indicator-BvyaMcmw.js} +1 -1
  42. package/core/built/admin/assets/{en-Bu-6PYn5.js → en-CjPXRj8j.js} +1 -1
  43. package/core/built/admin/assets/{feed-CygLK1Ad.js → feed-D2wk4cCS.js} +1 -1
  44. package/core/built/admin/assets/{filter-query-core-a0PNU2EO.js → filter-query-core-VEnwTCyO.js} +1 -1
  45. package/core/built/admin/assets/{filters-jiyRsLMH.js → filters-DtIsuqv5.js} +1 -1
  46. package/core/built/admin/assets/{gh-chart-CEhBBu3F.js → gh-chart-JxzKqaoO.js} +1 -1
  47. package/core/built/admin/assets/{ghost-0ab96884815339963364804ab266c99f.js → ghost-30c3dedbe1cca943b92efa7efd2710e4.js} +36 -21
  48. package/core/built/admin/assets/{growth-Fz3Oatml.js → growth-CPNrBpHK.js} +1 -1
  49. package/core/built/admin/assets/{hash-CeFrjo3C.js → hash-CJzbTA5k.js} +1 -1
  50. package/core/built/admin/assets/{inbox-CCirPaG2.js → inbox-CVVAkCmd.js} +1 -1
  51. package/core/built/admin/assets/{index-Dd2BJRZH.js → index-AkQJUr1z.js} +1 -1
  52. package/core/built/admin/assets/{index-CYPN5csJ.js → index-BLWOUf31.js} +1 -1
  53. package/core/built/admin/assets/{index-D7Ui3Fih.js → index-BRBRkRqa.js} +1 -1
  54. package/core/built/admin/assets/{index-CFEzD2_M.js → index-BkbhBpVC.js} +3 -3
  55. package/core/built/admin/assets/{index-BYwL7gFN.js → index-BxFFWYdP.js} +1 -1
  56. package/core/built/admin/assets/{index-D3LfHeBl.js → index-C5_ZKpC1.js} +1 -1
  57. package/core/built/admin/assets/{index-Bjw2qAph.js → index-Cdbufdfy.js} +1 -1
  58. package/core/built/admin/assets/{index-BTf6YUBb.js → index-Cq5vsvxE.js} +1 -1
  59. package/core/built/admin/assets/{index-DPbi4ie_.js → index-CuGoX8Ub.js} +1 -1
  60. package/core/built/admin/assets/{index-CsaU9dfl.js → index-CuH5raTz.js} +1 -1
  61. package/core/built/admin/assets/{index-Bf83suMc.js → index-D3A8RTi0.js} +1 -1
  62. package/core/built/admin/assets/{index-Dskrbhv3.js → index-DIyK69JM.js} +1 -1
  63. package/core/built/admin/assets/{index-GExKMpy_.js → index-DLFVpwt3.js} +1 -1
  64. package/core/built/admin/assets/{index-BOMdiHRG.js → index-DQZp_NsL.js} +1 -1
  65. package/core/built/admin/assets/{index-2qcjFCQs.js → index-DR74ulj2.js} +1 -1
  66. package/core/built/admin/assets/{index-WKMARia9.js → index-DYE2untj.js} +1 -1
  67. package/core/built/admin/assets/{index-DNZUJQ8v.js → index-DssW7xhk.js} +1 -1
  68. package/core/built/admin/assets/{index-Cq4mS7QK.js → index-DvyNqFct.js} +1 -1
  69. package/core/built/admin/assets/{index-C7xLyJVb.js → index-DxB7NHpG.js} +1 -1
  70. package/core/built/admin/assets/{index-Bw4DM4Pr.js → index-IDaHqjnu.js} +1 -1
  71. package/core/built/admin/assets/{index-ClOB5u8L.js → index-TtBMzSeP.js} +1 -1
  72. package/core/built/admin/assets/{index-takfwHSn.js → index-UMWVIyz7.js} +1 -1
  73. package/core/built/admin/assets/{koenig-lexical-BJM9wAwQ.js → koenig-lexical-DVAmevhl.js} +1 -1
  74. package/core/built/admin/assets/{kpi-card-BP-2yicn.js → kpi-card-D3CzvsrI.js} +1 -1
  75. package/core/built/admin/assets/{kpi-card-DOplXdDT.js → kpi-card-DV-nN7xT.js} +1 -1
  76. package/core/built/admin/assets/{kpi-tabs-Rq5jJW2Z.js → kpi-tabs-B3NkaTwb.js} +1 -1
  77. package/core/built/admin/assets/{kpis-yHgME_iy.js → kpis-CVwF08QL.js} +1 -1
  78. package/core/built/admin/assets/{label-fijjy1Mb.js → label-BiPpMny2.js} +1 -1
  79. package/core/built/admin/assets/{links-s3IeAkbo.js → links-BY0Uo6O5.js} +1 -1
  80. package/core/built/admin/assets/{list-page-CUcB5ebB.js → list-page-COHNMpOi.js} +1 -1
  81. package/core/built/admin/assets/{loader-circle-C7mWzo52.js → loader-circle-B1uEfpbZ.js} +1 -1
  82. package/core/built/admin/assets/{mail-9TFkAaAh.js → mail-ccQhEr7k.js} +1 -1
  83. package/core/built/admin/assets/{main-layout-XtviVkg1.js → main-layout-BYKdA6Z1.js} +1 -1
  84. package/core/built/admin/assets/{members-XkHao5Yf.js → members-DkpEnvG5.js} +1 -1
  85. package/core/built/admin/assets/minus-C68D81nx.js +1 -0
  86. package/core/built/admin/assets/{modals-B6R7oqvb.js → modals-X6RSWn5Y.js} +3 -3
  87. package/core/built/admin/assets/{moderation-B2Tixfce.js → moderation-BFrrwfvx.js} +1 -1
  88. package/core/built/admin/assets/{newsletter-CbESXhxf.js → newsletter-n7kc6cxR.js} +1 -1
  89. package/core/built/admin/assets/{newsletters-DOIL_cOY.js → newsletters-CSCa3QdE.js} +1 -1
  90. package/core/built/admin/assets/{note-mUikaB-p.js → note-CMZjeK8e.js} +1 -1
  91. package/core/built/admin/assets/{onboarding-route-Dqv2nP7b.js → onboarding-route-BaX0a-pu.js} +1 -1
  92. package/core/built/admin/assets/{overview-yZ-7KJdx.js → overview-CS9dmE_6.js} +1 -1
  93. package/core/built/admin/assets/{pagemenu-TxGvHwRO.js → pagemenu-O_y8Jm4v.js} +1 -1
  94. package/core/built/admin/assets/{pencil-CKTgzafp.js → pencil-BcymGPnE.js} +1 -1
  95. package/core/built/admin/assets/{pin-BU_u-xRX.js → pin-Bl3nSr7I.js} +1 -1
  96. package/core/built/admin/assets/{post-analytics-CWA8invj.js → post-analytics-DW-TKu-t.js} +1 -1
  97. package/core/built/admin/assets/{post-analytics-context-BWDhMRq_.js → post-analytics-context-D7PgEMo8.js} +1 -1
  98. package/core/built/admin/assets/{post-analytics-header-Bm0mcxjK.js → post-analytics-header-B8C0vA5Y.js} +1 -1
  99. package/core/built/admin/assets/{post-share-modal-D8BtRD2u.js → post-share-modal-D0OlASBQ.js} +1 -1
  100. package/core/built/admin/assets/{posts-u-CAKddc.js → posts-BZaw4-dc.js} +1 -1
  101. package/core/built/admin/assets/{power-DR9gpiQR.js → power-DWm6pts5.js} +1 -1
  102. package/core/built/admin/assets/{referrers-DV_Ihg9y.js → referrers-BsZ85Z0a.js} +1 -1
  103. package/core/built/admin/assets/{repeat-uXmOJ6y8.js → repeat-DQay9e22.js} +1 -1
  104. package/core/built/admin/assets/{reply-9ZyqaxI-.js → reply-CoNqmExw.js} +1 -1
  105. package/core/built/admin/assets/{rocket-DMOr1OCt.js → rocket-Dne6P_8f.js} +1 -1
  106. package/core/built/admin/assets/{select-CPSy44ld.js → select-BfWJkrKc.js} +1 -1
  107. package/core/built/admin/assets/{settings-krk0432u.js → settings-BoXzKMhL.js} +1 -1
  108. package/core/built/admin/assets/{settings-66Zv8QvL.js → settings-rRY210wx.js} +25 -25
  109. package/core/built/admin/assets/{share-modal-BRmGllZq.js → share-modal-CtdLQbnQ.js} +1 -1
  110. package/core/built/admin/assets/{sort-button-5fyeViQL.js → sort-button-7pVgpa0d.js} +1 -1
  111. package/core/built/admin/assets/{source-icon-DeeHyZRn.js → source-icon-Dtua85oN.js} +1 -1
  112. package/core/built/admin/assets/{sprout-956Q4On2.js → sprout-CpwUJAPT.js} +1 -1
  113. package/core/built/admin/assets/{square-BaCvbKJY.js → square-CDrQjv8R.js} +1 -1
  114. package/core/built/admin/assets/{stats-BVKNZJO6.js → stats-Yo9Gco0_.js} +1 -1
  115. package/core/built/admin/assets/{stats-view-gtyaqudG.js → stats-view-DubukX9V.js} +1 -1
  116. package/core/built/admin/assets/{step-1-09wdjzdX.js → step-1-CH8jWKi7.js} +1 -1
  117. package/core/built/admin/assets/{step-2-8iaQ0efq.js → step-2-CWy7Qi0Q.js} +1 -1
  118. package/core/built/admin/assets/{step-3-BuHAZbdD.js → step-3-CNiDFH17.js} +1 -1
  119. package/core/built/admin/assets/{table-DTofVyjA.js → table-qQi9EXB1.js} +1 -1
  120. package/core/built/admin/assets/{tabs-CL5eaCGL.js → tabs-M6kFEqPE.js} +1 -1
  121. package/core/built/admin/assets/{tags-DJrbEw5-.js → tags-74U6lgwY.js} +1 -1
  122. package/core/built/admin/assets/{tags-U3lciBmd.js → tags-DuMshkTz.js} +1 -1
  123. package/core/built/admin/assets/{textarea-DdDuNixZ.js → textarea-CGBp9nOo.js} +1 -1
  124. package/core/built/admin/assets/{tiers-DXKbghdk.js → tiers-D2DYHaeO.js} +1 -1
  125. package/core/built/admin/assets/{toggle-group-DaZKTYDS.js → toggle-group-GYp_w6Po.js} +1 -1
  126. package/core/built/admin/assets/{topic-filter-BzqiVOAU.js → topic-filter-N3CzJ01P.js} +1 -1
  127. package/core/built/admin/assets/{trash-CKK_p9G5.js → trash-CUqAK3SQ.js} +1 -1
  128. package/core/built/admin/assets/{underline-Bq0P-5Zy.js → underline-CwuJG-Ql.js} +1 -1
  129. package/core/built/admin/assets/{undo-2-CcBtw-tW.js → undo-2-D6ZRqONE.js} +1 -1
  130. package/core/built/admin/assets/{upload-BcylHEMw.js → upload-BLiT66bJ.js} +1 -1
  131. package/core/built/admin/assets/{use-growth-stats-Ci0gymWp.js → use-growth-stats-u18So4Gq.js} +1 -1
  132. package/core/built/admin/assets/{use-simple-pagination-ByaFwxfZ.js → use-simple-pagination-Dp2sTt2S.js} +1 -1
  133. package/core/built/admin/assets/{user-round-check-D0I7NO1g.js → user-round-check-BDomHaso.js} +1 -1
  134. package/core/built/admin/assets/{user-round-x-DeGVH29o.js → user-round-x-Cc0RL-V9.js} +1 -1
  135. package/core/built/admin/assets/{virtual-list-window-S0xZxQAf.js → virtual-list-window-BnjCoNIr.js} +1 -1
  136. package/core/built/admin/assets/{wallet-cards-B9TQg4x3.js → wallet-cards-CVZ99Nm3.js} +1 -1
  137. package/core/built/admin/assets/{web-BRN2mUpo.js → web-B_MLxGxZ.js} +1 -1
  138. package/core/built/admin/index.html +5 -5
  139. package/core/server/{services/custom-redirects/file-store.js → adapters/redirects/FileStore.js} +6 -5
  140. package/core/server/{services/custom-redirects/file-store.ts → adapters/redirects/FileStore.ts} +6 -4
  141. package/core/server/adapters/redirects/RedirectsStoreBase.d.ts +9 -0
  142. package/core/server/adapters/redirects/RedirectsStoreBase.js +8 -0
  143. package/core/server/{services/custom-redirects/gcs-store.js → adapters/redirects/S3RedirectsStore.js} +50 -18
  144. package/core/server/adapters/redirects/S3RedirectsStore.ts +163 -0
  145. package/core/server/adapters/scheduling/scheduling-base.js +41 -0
  146. package/core/server/adapters/scheduling/types.js +2 -0
  147. package/core/server/adapters/scheduling/types.ts +36 -0
  148. package/core/server/api/endpoints/authentication.js +26 -5
  149. package/core/server/api/endpoints/schedules.js +0 -30
  150. package/core/server/api/endpoints/utils/serializers/output/authentication.js +10 -0
  151. package/core/server/data/migrations/versions/6.41/2026-05-13-12-00-00-rename-reset-all-passwords-permission.js +21 -0
  152. package/core/server/data/schema/fixtures/fixtures.json +3 -3
  153. package/core/server/models/api-key.js +18 -0
  154. package/core/server/models/user.js +18 -0
  155. package/core/server/services/adapter-manager/config.js +6 -0
  156. package/core/server/services/adapter-manager/index.js +1 -0
  157. package/core/server/services/auth/index.js +4 -0
  158. package/core/server/services/auth/reset-authentication.js +50 -0
  159. package/core/server/services/auth/reset-authentication.ts +75 -0
  160. package/core/server/services/automations/index.js +21 -15
  161. package/core/server/services/custom-redirects/index.js +2 -4
  162. package/core/server/services/gifts/gift-bookshelf-repository.js +7 -0
  163. package/core/server/services/gifts/gift-bookshelf-repository.ts +10 -0
  164. package/core/server/services/gifts/gift-reminder-scheduler.js +94 -0
  165. package/core/server/services/gifts/gift-reminder-scheduler.ts +109 -0
  166. package/core/server/services/gifts/gift-repository.ts +1 -0
  167. package/core/server/services/gifts/gift-service-wrapper.js +10 -7
  168. package/core/server/services/gifts/gift-service.js +1 -32
  169. package/core/server/services/gifts/gift-service.ts +3 -59
  170. package/core/server/services/internal-keys/index.js +1 -3
  171. package/core/server/services/internal-keys/index.ts +11 -3
  172. package/core/server/services/post-scheduling/index.js +16 -28
  173. package/core/server/services/post-scheduling/index.ts +14 -0
  174. package/core/server/services/post-scheduling/post-scheduling.js +115 -0
  175. package/core/server/services/post-scheduling/post-scheduling.ts +138 -0
  176. package/core/server/services/users.js +29 -16
  177. package/core/server/web/api/endpoints/admin/middleware.js +8 -4
  178. package/core/server/web/api/endpoints/admin/routes.js +1 -1
  179. package/core/shared/config/defaults.json +5 -0
  180. package/core/shared/labs.js +2 -1
  181. package/package.json +1 -1
  182. package/core/built/admin/assets/minus-DPrXh11r.js +0 -1
  183. package/core/server/services/custom-redirects/gcs-store.ts +0 -117
  184. package/core/server/services/post-scheduling/post-scheduler-service.js +0 -126
@@ -1 +1 @@
1
- import{l as q,r as u,b as $,j as e,T as H,U as L,ce as Ne,g as Ce,t as Ue,P as Me,W as Be,A as ae,B as j,m as ie,h as Pe,e as K,bL as Te,F as ce,a$ as de,a2 as ue,cR as De,a3 as xe,a4 as Q,a5 as Y,a6 as W,H as G,c1 as Fe,b1 as Re,a7 as X,a8 as me,Y as U,cS as Ie,cT as Oe,cU as Ee,cV as ne,a9 as Se,aa as Ae,u as fe,cE as $e,a as He,M as Le,N as Ve,O as ze,Q as _e,L as te,E as Qe,c as Ye,S as I,b8 as We,D as Ge,q as Xe,v as qe,w as Ke,x as Ze,R as Je,a1 as es,cW as ss,s as re,o as ls,n as ns,cI as z,V as ts,bH as rs,bI as os,cX as as,cY as he,cZ as is}from"./index-CFEzD2_M.js";import{P as cs}from"./pencil-CKTgzafp.js";import{E as ds}from"./edit-profile-BvU2-lW5.js";import{T as us,a as xs,b as S,d as _,c as A}from"./tabs-CL5eaCGL.js";import{a as ms}from"./settings-krk0432u.js";import{U as fs}from"./user-round-x-DeGVH29o.js";import{C as hs}from"./copy-D7jqplrv.js";import"./label-fijjy1Mb.js";import"./textarea-DdDuNixZ.js";import"./at-sign-BsHNViA_.js";function ps(s){return typeof s.name=="string"?s.name:typeof s.preferredUsername=="string"?s.preferredUsername:typeof s.preferredUsername=="object"&&s.preferredUsername!==null&&"@value"in s.preferredUsername&&typeof s.preferredUsername["@value"]=="string"?s.preferredUsername["@value"]:"Unknown"}const pe=({noResultsMessage:s,actors:o,isLoading:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d})=>{const i=q("index","me"),{data:r}=i,t=u.useRef(null),a=u.useRef(null);u.useEffect(()=>(t.current&&t.current.disconnect(),t.current=new IntersectionObserver(l=>{l[0].isIntersecting&&m&&!d&&c()}),a.current&&t.current.observe(a.current),()=>{t.current&&t.current.disconnect()}),[m,d,c]);const x=$();return e.jsxs("div",{className:"pt-3","data-testid":"actor-list",children:[m===!1&&o.length===0?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Ne,{})}),s]}):e.jsx("div",{className:"flex flex-col",children:o.map(({actor:l,isFollowing:h,blockedByMe:b,domainBlockedByMe:k})=>{const w=l.handle||Ce(l),y=w===r?.handle;return e.jsx(Ue.Fragment,{children:e.jsx(Me,{actor:l,align:"center",isCurrentUser:y,side:"left",children:e.jsx("div",{children:e.jsxs(Be,{"data-testid":"actor-item",onClick:()=>{Pe(l,x)},children:[e.jsx(ae,{author:l}),e.jsx("div",{children:e.jsxs("div",{className:"break-anywhere text-gray-600",children:[e.jsx("span",{className:"mr-1 line-clamp-1 font-bold text-black dark:text-white",children:ps(l)}),e.jsx("div",{className:"line-clamp-1 text-sm",children:w})]})}),b||k?e.jsx(j,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):y?null:e.jsx(ie,{className:"ml-auto","data-testid":"follow-button",following:h,handle:w,type:"secondary"})]},l.id)})})},l.id)})}),e.jsx("div",{ref:a,className:"h-1"}),(d||n)&&e.jsx("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(K,{size:"md"})})]})},js=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m})=>{const d=u.useRef(null),i=u.useRef(null),r=u.useRef(null),t=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(d.current&&d.current.disconnect(),d.current=new IntersectionObserver(x=>{x[0].isIntersecting&&n&&!c&&o()}),i.current&&d.current.observe(i.current),r.current&&d.current.observe(r.current),()=>{d.current&&d.current.disconnect()}),[n,c,o]);const a=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Te,{})}),"You haven't liked anything yet."]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-likes-list",children:[s.map((x,l)=>e.jsxs("li",{"data-testid":"profile-like-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:x.actor,allowDelete:x.object.authored,commentCount:x.object.replyCount,isLoading:m,layout:"feed",likeCount:x.object.likeCount,object:x.object,repostCount:x.object.repostCount,type:x.type,onClick:()=>{x.object.type==="Note"?a(`/notes/${encodeURIComponent(x.object.id)}`):x.object.type==="Article"&&a(`/reader/${encodeURIComponent(x.object.id)}`)}}),l<s.length-1&&e.jsx(de,{}),l===t&&e.jsx("div",{ref:i,className:"h-1"})]},`likes-${x.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(K,{size:"md"})})]}),e.jsx("div",{ref:r,className:"h-1"})]})},bs=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m,noResultsMessage:d})=>{const i=u.useRef(null),r=u.useRef(null),t=u.useRef(null),a=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(l=>{l[0].isIntersecting&&n&&!c&&o()}),r.current&&i.current.observe(r.current),t.current&&i.current.observe(t.current),()=>{i.current&&i.current.disconnect()}),[n,c,o]);const x=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(cs,{})}),d]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-posts-list",children:[s.map((l,h)=>e.jsxs("li",{"data-testid":"profile-post-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:l.actor,allowDelete:l.object.authored,commentCount:l.object.replyCount,isLoading:m,layout:"feed",likeCount:l.object.likeCount,object:l.object,repostCount:l.object.repostCount,type:l.type,onClick:()=>{l.object.type==="Note"?x(`/notes/${encodeURIComponent(l.object.id)}`):l.object.type==="Article"&&x(`/reader/${encodeURIComponent(l.object.id)}`)}}),h<s.length-1&&e.jsx(de,{}),h===a&&e.jsx("div",{ref:r,className:"h-1"})]},`posts-${l.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(K,{size:"md"})})]}),e.jsx("div",{ref:t,className:"h-1"})]})},je=({handle:s,isUserBlocked:o,isDomainBlocked:n,onUnblockUser:c,onUnblockDomain:m,trigger:d,onUnblockComplete:i,isOpen:r,onOpenChange:t})=>{const[a,x]=u.useState(!1),[l,h]=u.useState(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";return p?g="dual":N?g="userOnly":F&&(g="domainOnly"),{mode:g,userUnblocked:!1,domainUnblocked:!1}}),b=r!==void 0,k=b?r:a,[w,y]=u.useState(!1),M=u.useCallback(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";p?g="dual":N?g="userOnly":F&&(g="domainOnly"),h(C=>({...C,mode:g,userUnblocked:!1,domainUnblocked:!1}))},[o,n]);u.useEffect(()=>{k&&!w?(M(),y(!0)):k||y(!1)},[k,w,M]);const T=()=>{b?t?.(!0):x(!0)},f=p=>{p||(b?t?.(!1):x(!1))},O=async()=>{await c(),h(p=>({...p,userUnblocked:!0})),(l.mode!=="dual"||l.domainUnblocked)&&(f(!1),i?.()),U.success("User unblocked")},E=async()=>{await m(),h(p=>({...p,domainUnblocked:!0})),(l.mode!=="dual"||l.userUnblocked)&&(f(!1),i?.()),U.success("Domain unblocked")},D=s.split("@").filter(Boolean)[1],B=()=>e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:"Unblock"}),e.jsx(W,{className:"mt-4!",asChild:!0,children:e.jsxs("div",{className:"flex flex-col rounded-md border",children:[e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(G,{children:"Unblock user"}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.userUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:O,children:[e.jsx(Fe,{}),l.userUnblocked?"User unblocked":"Unblock user"]})]}),e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(G,{children:"Unblock domain"}),e.jsxs("p",{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:D})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.domainUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:E,children:[e.jsx(Re,{}),l.domainUnblocked?"Domain unblocked":"Unblock domain"]})]})]})})]}),e.jsx(X,{children:e.jsx(j,{onClick:()=>f(!1),children:"OK"})})]}),P=()=>{const p=l.mode==="userOnly";return e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:p?"Unblock this user?":"Unblock this domain?"}),e.jsx(W,{children:p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]}):e.jsxs(e.Fragment,{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:D})," will be able to follow you and engage with your public posts."]})})]}),e.jsxs(X,{children:[e.jsx(me,{children:"Cancel"}),e.jsx(j,{onClick:p?O:E,children:"Unblock"})]})]})};return e.jsxs(ue,{open:k,onOpenChange:f,children:[d&&e.jsx(De,{asChild:!0,onClick:T,children:d}),e.jsx(xe,{className:`${l.mode==="dual"&&"max-w-[600px]"}`,children:l.mode==="dual"?B():P()})]})},gs=({account:s,children:o,onCopyHandle:n,onBlockAccount:c,onBlockDomain:m,disabled:d=!1,isBlocked:i=!1,isDomainBlocked:r=!1})=>{const[t,a]=u.useState(null),[x,l]=u.useState(!1),h=f=>{f.stopPropagation(),n()},b=f=>{f.stopPropagation(),c()},k=f=>{f.stopPropagation(),m()},w=s?.handle,y=w?.split("@").filter(Boolean)[1],M=()=>e.jsx(ue,{open:x,onOpenChange:l,children:e.jsxs(xe,{onClick:f=>f.stopPropagation(),children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:t==="user"?"Block this user?":"Block this domain?"}),e.jsx(W,{children:t==="user"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:w})," will be able to see your public posts, but will no longer be able follow you or interact with your content on the social web."]}):e.jsxs(e.Fragment,{children:["All users from ",e.jsx("span",{className:"font-semibold text-black",children:y})," will be able to see your public posts, but won't be able to follow you or interact with your content."]})})]}),e.jsxs(X,{children:[t!=="domain"&&e.jsx(j,{className:"mr-auto -ml-3 hover:bg-transparent hover:opacity-80",variant:"ghost",onClick:f=>{f.stopPropagation(),a("domain")},children:"Block domain instead"}),e.jsx(me,{onClick:f=>f.stopPropagation(),children:"Cancel"}),e.jsx(Se,{className:Ae({variant:"destructive"}),onClick:t==="user"?b:k,children:"Block"})]})]})}),T=()=>s&&e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isOpen:x,isUserBlocked:s.blockedByMe,onOpenChange:l,onUnblockDomain:m,onUnblockUser:c});return e.jsxs(e.Fragment,{children:[e.jsxs(Ie,{children:[e.jsx(Oe,{disabled:d,asChild:!0,onClick:f=>f.stopPropagation(),children:o}),e.jsx(Ee,{align:"end",className:"p-2",children:e.jsxs("div",{className:"flex w-48 flex-col",children:[e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start",variant:"ghost",onClick:h,children:"Copy handle"})}),e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:f=>{f.stopPropagation(),!i&&!r&&a("user"),l(!0)},children:i?"Unblock user":r?"Unblock domain":"Block user"})})]})})]}),i||r?T():M()]})},ks=({account:s,onUnblock:o,onDomainUnblock:n,className:c=""})=>{const[m,d]=u.useState(!1),i=e.jsx(j,{className:`min-w-[90px] ${c}`,variant:"destructive",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:m?"Unblock":"Blocked"});return e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isUserBlocked:s.blockedByMe,trigger:i,onUnblockDomain:n,onUnblockUser:o})},oe=()=>{},ws=({account:s,customFields:o,isLoadingAccount:n,postsTab:c,likesTab:m,followingTab:d,followersTab:i})=>{const r=fe(),t=$e(),a=$(),{canGoBack:x}=He(),l=r.handle?`/profile/${r.handle}`:"/profile",h=!r.handle,b=r.handle?r.tab||"":t.pathname.split("/").pop()||"",k=u.useMemo(()=>h?["likes","following","followers"]:["following","followers"],[h]),w=k.includes(b)?b:"posts",y=Le("index"),M=Ve("index"),T=ze("index"),f=_e("index"),O=q("index","me"),{data:E}=r.handle?O:{data:void 0},D=r.handle===E?.handle||!r.handle,B=s?.blockedByMe,P=s?.domainBlockedByMe,[p,N]=u.useState(!1),[F,g]=u.useState(!1),C=u.useRef(null);u.useEffect(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);const Z=()=>{B?M.mutate(s):(y.mutate(s),U.success("User blocked")),N(!1)},J=()=>{P?f.mutate({url:s.apId,handle:s.handle}):(T.mutate({url:s.apId,handle:s.handle}),U.success("Domain blocked")),N(!1)},ee=async()=>{if(!s?.handle||!navigator?.clipboard?.writeText){U.error("Unable to copy handle");return}try{await navigator.clipboard.writeText(s.handle),g(!0),U.success("Handle copied"),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>g(!1),2e3)}catch{U.error("Failed to copy handle"),g(!1)}},[R,be]=u.useState(!1),[ge,se]=u.useState(!1),ke=()=>{be(!R)},V=u.useRef(null),[le,we]=u.useState(!1);u.useEffect(()=>{V.current&&we(V.current.scrollHeight>160)},[R,s?.bio,o,n]),u.useEffect(()=>{b&&(k.includes(b)||a(l,{replace:!0}))},[k,l,a,b]);const ve=v=>v==="posts"?l:`${l}/${v}`,ye=v=>{v!==w&&a(ve(v),{replace:!0})};return!n&&!s?e.jsx(te,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center [&_svg]:translate-x-px",children:e.jsxs(Qe,{children:[e.jsx(Ye,{children:e.jsx(fs,{})}),e.jsx("div",{children:"Profile not found"})]})})}):e.jsx(te,{children:e.jsx("div",{className:"z-0 mx-[max(-4vw,-32px)] -mt-9 flex flex-col items-center pb-16",children:e.jsx("div",{className:"mx-auto w-full",children:e.jsxs(e.Fragment,{children:[s?.bannerImageUrl?e.jsx("div",{className:"h-[15vw] min-h-[200px] w-full overflow-hidden bg-gradient-to-tr from-gray-200 to-gray-100",children:e.jsx("img",{alt:s?.name,className:"size-full object-cover",referrerPolicy:"no-referrer",src:s?.bannerImageUrl})}):e.jsx("div",{className:"h-[max(8vw,132px)] w-full overflow-hidden bg-gradient-to-tr from-white to-white dark:from-black dark:to-black"}),e.jsxs("div",{className:`mx-auto max-w-[620px] px-6 ${!s?.bannerImageUrl&&!x?"-mt-8":"-mt-12"}`,children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"-ml-2 rounded-full bg-white p-1 dark:bg-black",children:n?e.jsx(I,{className:"size-[92px] rounded-full"}):e.jsx(ae,{author:{icon:{url:s?.avatarUrl},name:s?.name,handle:s?.handle},size:"lg"})}),!D&&!n&&e.jsxs("div",{className:"flex gap-2",children:[B||P?e.jsx(ks,{account:s,onDomainUnblock:J,onUnblock:Z}):e.jsx(ie,{following:s?.followedByMe,handle:s?.handle,type:"primary",onFollow:oe,onUnfollow:oe}),e.jsx(gs,{account:s,isBlocked:B,isDomainBlocked:P,onBlockAccount:Z,onBlockDomain:J,onCopyHandle:ee,children:e.jsx(j,{"aria-label":"Open profile menu",variant:"outline",children:e.jsx(We,{})})})]}),D&&!n&&e.jsxs(Ge,{open:ge,onOpenChange:se,children:[e.jsx(Xe,{children:e.jsx(ms,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(qe,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(Ke,{children:e.jsx(Ze,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Je,{className:"break-anywhere mt-4 truncate",children:n?e.jsx(I,{className:"w-32"}):s?.name}),e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("a",{className:"inline-flex max-w-full truncate text-[1.5rem] text-gray-800 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-500",href:s?.url,rel:"noopener noreferrer",target:"_blank",children:e.jsx("span",{className:"truncate",children:n?e.jsx(I,{className:"w-full max-w-56"}):s?.handle})}),!n&&e.jsx(j,{className:"-ml-1.5 size-6 p-0 text-gray-800 hover:text-gray-900 dark:text-gray-700 dark:hover:text-gray-600",title:"Copy handle",variant:"link",onClick:ee,children:F?e.jsx(es,{size:16}):e.jsx(hs,{size:16})}),s?.followsMe&&!n&&e.jsx(ss,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]}),(s?.bio||o?.length>0)&&e.jsxs("div",{ref:V,className:`ap-profile-content break-anywhere relative text-[1.5rem] [&>p]:mb-3 ${R?"max-h-none pb-7":"max-h-[160px] overflow-hidden"} relative`,children:[n?e.jsxs(e.Fragment,{children:[e.jsx(I,{}),e.jsx(I,{className:"w-full max-w-48"})]}):e.jsx("div",{dangerouslySetInnerHTML:{__html:re(ls(ns(s?.bio??"",["a","br"])))}}),o?.map(v=>e.jsxs("span",{className:"mt-3 line-clamp-1 flex flex-col text-[1.5rem]",children:[e.jsx("span",{className:"text-xs font-semibold",children:v.name}),e.jsx("span",{dangerouslySetInnerHTML:{__html:re(v.value)},className:"ap-profile-content truncate"})]})),!R&&le&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/100 via-60% to-transparent dark:from-black dark:via-black/100"}),le&&e.jsx(j,{className:"absolute bottom-0 h-auto p-0 text-md",variant:"link",onClick:ke,children:R?"Show less":"Show all"})]}),e.jsxs(us,{className:"mt-5",value:w,variant:"underline",onValueChange:v=>ye(v),children:[e.jsxs(xs,{children:[e.jsx(S,{value:"posts",children:"Posts"}),h&&e.jsxs(S,{value:"likes",children:["Likes",e.jsx(_,{children:z(s?.likedCount||0)})]}),e.jsxs(S,{value:"following",children:["Following",e.jsx(_,{children:z(s?.followingCount||0)})]}),e.jsxs(S,{value:"followers",children:["Followers",e.jsx(_,{children:z(s?.followerCount||0)})]})]}),e.jsx(A,{value:"posts",children:(B||P)&&!p?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(ts,{})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center gap-0.5",children:[e.jsxs(G,{children:[s.name," is blocked"]}),e.jsx("p",{children:"You can view the posts, but it won't unblock the user."}),e.jsx(j,{className:"mt-4",variant:"secondary",onClick:()=>N(!0),children:"View posts"})]})]}):c}),h&&e.jsx(A,{value:"likes",children:m}),e.jsx(A,{value:"following",children:d}),e.jsx(A,{value:"followers",children:i})]},r.handle||s?.handle||"current-user")]})]})})})})},vs=({handle:s})=>{const{postsByAccountQuery:o}=as(s||"me",{enabled:!0}),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>t.posts)??Array.from({length:5},(t,a)=>({id:`placeholder-${a}`,object:{}}));return e.jsx(bs,{fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:s?`${s} hasn't posted anything yet`:"You haven't posted anything yet.",posts:r})},ys=()=>{const{postsLikedByAccountQuery:s}=is({enabled:!0}),{data:o,fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d}=s,i=o?.pages.flatMap(r=>r.posts)??Array.from({length:5},(r,t)=>({id:`placeholder-${t}`,object:{}}));return e.jsx(js,{fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d,posts:i})},Ns=({handle:s})=>{const o=he(s===""?"me":s,"following"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"following"in t?t.following:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing,blockedByMe:a.blockedByMe,domainBlockedByMe:a.domainBlockedByMe})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no following`})},Cs=({handle:s})=>{const o=he(s===""?"me":s,"followers"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"followers"in t?t.followers:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no followers yet`})},Es=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:m}=q("index",s.handle||"me");if(u.useEffect(()=>{m()},[s.handle,m]),c&&rs(c)&&c.statusCode!==404)return e.jsx(os,{errorCode:c.code,statusCode:c.statusCode});const d=Object.keys(o?.customFields||{}).map(x=>({name:x,value:o.customFields[x]}))||[],i=e.jsx(vs,{handle:s.handle||""}),r=e.jsx(ys,{}),t=e.jsx(Ns,{handle:s.handle||""}),a=e.jsx(Cs,{handle:s.handle||""});return e.jsx(ws,{account:o,customFields:d,followersTab:a,followingTab:t,isLoadingAccount:n,likesTab:r,postsTab:i})};export{Es as default};
1
+ import{l as q,r as u,b as $,j as e,T as H,U as L,ce as Ne,g as Ce,t as Ue,P as Me,W as Be,A as ae,B as j,m as ie,h as Pe,e as K,bL as Te,F as ce,a$ as de,a2 as ue,cR as De,a3 as xe,a4 as Q,a5 as Y,a6 as W,H as G,c1 as Fe,b1 as Re,a7 as X,a8 as me,Y as U,cS as Ie,cT as Oe,cU as Ee,cV as ne,a9 as Se,aa as Ae,u as fe,cE as $e,a as He,M as Le,N as Ve,O as ze,Q as _e,L as te,E as Qe,c as Ye,S as I,b8 as We,D as Ge,q as Xe,v as qe,w as Ke,x as Ze,R as Je,a1 as es,cW as ss,s as re,o as ls,n as ns,cI as z,V as ts,bH as rs,bI as os,cX as as,cY as he,cZ as is}from"./index-BkbhBpVC.js";import{P as cs}from"./pencil-BcymGPnE.js";import{E as ds}from"./edit-profile-CnuBNQhO.js";import{T as us,a as xs,b as S,d as _,c as A}from"./tabs-M6kFEqPE.js";import{a as ms}from"./settings-BoXzKMhL.js";import{U as fs}from"./user-round-x-Cc0RL-V9.js";import{C as hs}from"./copy-DVtQi_VJ.js";import"./label-BiPpMny2.js";import"./textarea-CGBp9nOo.js";import"./at-sign-DWOf36uj.js";function ps(s){return typeof s.name=="string"?s.name:typeof s.preferredUsername=="string"?s.preferredUsername:typeof s.preferredUsername=="object"&&s.preferredUsername!==null&&"@value"in s.preferredUsername&&typeof s.preferredUsername["@value"]=="string"?s.preferredUsername["@value"]:"Unknown"}const pe=({noResultsMessage:s,actors:o,isLoading:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d})=>{const i=q("index","me"),{data:r}=i,t=u.useRef(null),a=u.useRef(null);u.useEffect(()=>(t.current&&t.current.disconnect(),t.current=new IntersectionObserver(l=>{l[0].isIntersecting&&m&&!d&&c()}),a.current&&t.current.observe(a.current),()=>{t.current&&t.current.disconnect()}),[m,d,c]);const x=$();return e.jsxs("div",{className:"pt-3","data-testid":"actor-list",children:[m===!1&&o.length===0?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Ne,{})}),s]}):e.jsx("div",{className:"flex flex-col",children:o.map(({actor:l,isFollowing:h,blockedByMe:b,domainBlockedByMe:k})=>{const w=l.handle||Ce(l),y=w===r?.handle;return e.jsx(Ue.Fragment,{children:e.jsx(Me,{actor:l,align:"center",isCurrentUser:y,side:"left",children:e.jsx("div",{children:e.jsxs(Be,{"data-testid":"actor-item",onClick:()=>{Pe(l,x)},children:[e.jsx(ae,{author:l}),e.jsx("div",{children:e.jsxs("div",{className:"break-anywhere text-gray-600",children:[e.jsx("span",{className:"mr-1 line-clamp-1 font-bold text-black dark:text-white",children:ps(l)}),e.jsx("div",{className:"line-clamp-1 text-sm",children:w})]})}),b||k?e.jsx(j,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):y?null:e.jsx(ie,{className:"ml-auto","data-testid":"follow-button",following:h,handle:w,type:"secondary"})]},l.id)})})},l.id)})}),e.jsx("div",{ref:a,className:"h-1"}),(d||n)&&e.jsx("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(K,{size:"md"})})]})},js=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m})=>{const d=u.useRef(null),i=u.useRef(null),r=u.useRef(null),t=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(d.current&&d.current.disconnect(),d.current=new IntersectionObserver(x=>{x[0].isIntersecting&&n&&!c&&o()}),i.current&&d.current.observe(i.current),r.current&&d.current.observe(r.current),()=>{d.current&&d.current.disconnect()}),[n,c,o]);const a=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Te,{})}),"You haven't liked anything yet."]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-likes-list",children:[s.map((x,l)=>e.jsxs("li",{"data-testid":"profile-like-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:x.actor,allowDelete:x.object.authored,commentCount:x.object.replyCount,isLoading:m,layout:"feed",likeCount:x.object.likeCount,object:x.object,repostCount:x.object.repostCount,type:x.type,onClick:()=>{x.object.type==="Note"?a(`/notes/${encodeURIComponent(x.object.id)}`):x.object.type==="Article"&&a(`/reader/${encodeURIComponent(x.object.id)}`)}}),l<s.length-1&&e.jsx(de,{}),l===t&&e.jsx("div",{ref:i,className:"h-1"})]},`likes-${x.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(K,{size:"md"})})]}),e.jsx("div",{ref:r,className:"h-1"})]})},bs=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:m,noResultsMessage:d})=>{const i=u.useRef(null),r=u.useRef(null),t=u.useRef(null),a=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(l=>{l[0].isIntersecting&&n&&!c&&o()}),r.current&&i.current.observe(r.current),t.current&&i.current.observe(t.current),()=>{i.current&&i.current.disconnect()}),[n,c,o]);const x=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(cs,{})}),d]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-posts-list",children:[s.map((l,h)=>e.jsxs("li",{"data-testid":"profile-post-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:l.actor,allowDelete:l.object.authored,commentCount:l.object.replyCount,isLoading:m,layout:"feed",likeCount:l.object.likeCount,object:l.object,repostCount:l.object.repostCount,type:l.type,onClick:()=>{l.object.type==="Note"?x(`/notes/${encodeURIComponent(l.object.id)}`):l.object.type==="Article"&&x(`/reader/${encodeURIComponent(l.object.id)}`)}}),h<s.length-1&&e.jsx(de,{}),h===a&&e.jsx("div",{ref:r,className:"h-1"})]},`posts-${l.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(K,{size:"md"})})]}),e.jsx("div",{ref:t,className:"h-1"})]})},je=({handle:s,isUserBlocked:o,isDomainBlocked:n,onUnblockUser:c,onUnblockDomain:m,trigger:d,onUnblockComplete:i,isOpen:r,onOpenChange:t})=>{const[a,x]=u.useState(!1),[l,h]=u.useState(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";return p?g="dual":N?g="userOnly":F&&(g="domainOnly"),{mode:g,userUnblocked:!1,domainUnblocked:!1}}),b=r!==void 0,k=b?r:a,[w,y]=u.useState(!1),M=u.useCallback(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";p?g="dual":N?g="userOnly":F&&(g="domainOnly"),h(C=>({...C,mode:g,userUnblocked:!1,domainUnblocked:!1}))},[o,n]);u.useEffect(()=>{k&&!w?(M(),y(!0)):k||y(!1)},[k,w,M]);const T=()=>{b?t?.(!0):x(!0)},f=p=>{p||(b?t?.(!1):x(!1))},O=async()=>{await c(),h(p=>({...p,userUnblocked:!0})),(l.mode!=="dual"||l.domainUnblocked)&&(f(!1),i?.()),U.success("User unblocked")},E=async()=>{await m(),h(p=>({...p,domainUnblocked:!0})),(l.mode!=="dual"||l.userUnblocked)&&(f(!1),i?.()),U.success("Domain unblocked")},D=s.split("@").filter(Boolean)[1],B=()=>e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:"Unblock"}),e.jsx(W,{className:"mt-4!",asChild:!0,children:e.jsxs("div",{className:"flex flex-col rounded-md border",children:[e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(G,{children:"Unblock user"}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.userUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:O,children:[e.jsx(Fe,{}),l.userUnblocked?"User unblocked":"Unblock user"]})]}),e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(G,{children:"Unblock domain"}),e.jsxs("p",{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:D})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.domainUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:E,children:[e.jsx(Re,{}),l.domainUnblocked?"Domain unblocked":"Unblock domain"]})]})]})})]}),e.jsx(X,{children:e.jsx(j,{onClick:()=>f(!1),children:"OK"})})]}),P=()=>{const p=l.mode==="userOnly";return e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:p?"Unblock this user?":"Unblock this domain?"}),e.jsx(W,{children:p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]}):e.jsxs(e.Fragment,{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:D})," will be able to follow you and engage with your public posts."]})})]}),e.jsxs(X,{children:[e.jsx(me,{children:"Cancel"}),e.jsx(j,{onClick:p?O:E,children:"Unblock"})]})]})};return e.jsxs(ue,{open:k,onOpenChange:f,children:[d&&e.jsx(De,{asChild:!0,onClick:T,children:d}),e.jsx(xe,{className:`${l.mode==="dual"&&"max-w-[600px]"}`,children:l.mode==="dual"?B():P()})]})},gs=({account:s,children:o,onCopyHandle:n,onBlockAccount:c,onBlockDomain:m,disabled:d=!1,isBlocked:i=!1,isDomainBlocked:r=!1})=>{const[t,a]=u.useState(null),[x,l]=u.useState(!1),h=f=>{f.stopPropagation(),n()},b=f=>{f.stopPropagation(),c()},k=f=>{f.stopPropagation(),m()},w=s?.handle,y=w?.split("@").filter(Boolean)[1],M=()=>e.jsx(ue,{open:x,onOpenChange:l,children:e.jsxs(xe,{onClick:f=>f.stopPropagation(),children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:t==="user"?"Block this user?":"Block this domain?"}),e.jsx(W,{children:t==="user"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:w})," will be able to see your public posts, but will no longer be able follow you or interact with your content on the social web."]}):e.jsxs(e.Fragment,{children:["All users from ",e.jsx("span",{className:"font-semibold text-black",children:y})," will be able to see your public posts, but won't be able to follow you or interact with your content."]})})]}),e.jsxs(X,{children:[t!=="domain"&&e.jsx(j,{className:"mr-auto -ml-3 hover:bg-transparent hover:opacity-80",variant:"ghost",onClick:f=>{f.stopPropagation(),a("domain")},children:"Block domain instead"}),e.jsx(me,{onClick:f=>f.stopPropagation(),children:"Cancel"}),e.jsx(Se,{className:Ae({variant:"destructive"}),onClick:t==="user"?b:k,children:"Block"})]})]})}),T=()=>s&&e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isOpen:x,isUserBlocked:s.blockedByMe,onOpenChange:l,onUnblockDomain:m,onUnblockUser:c});return e.jsxs(e.Fragment,{children:[e.jsxs(Ie,{children:[e.jsx(Oe,{disabled:d,asChild:!0,onClick:f=>f.stopPropagation(),children:o}),e.jsx(Ee,{align:"end",className:"p-2",children:e.jsxs("div",{className:"flex w-48 flex-col",children:[e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start",variant:"ghost",onClick:h,children:"Copy handle"})}),e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:f=>{f.stopPropagation(),!i&&!r&&a("user"),l(!0)},children:i?"Unblock user":r?"Unblock domain":"Block user"})})]})})]}),i||r?T():M()]})},ks=({account:s,onUnblock:o,onDomainUnblock:n,className:c=""})=>{const[m,d]=u.useState(!1),i=e.jsx(j,{className:`min-w-[90px] ${c}`,variant:"destructive",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:m?"Unblock":"Blocked"});return e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isUserBlocked:s.blockedByMe,trigger:i,onUnblockDomain:n,onUnblockUser:o})},oe=()=>{},ws=({account:s,customFields:o,isLoadingAccount:n,postsTab:c,likesTab:m,followingTab:d,followersTab:i})=>{const r=fe(),t=$e(),a=$(),{canGoBack:x}=He(),l=r.handle?`/profile/${r.handle}`:"/profile",h=!r.handle,b=r.handle?r.tab||"":t.pathname.split("/").pop()||"",k=u.useMemo(()=>h?["likes","following","followers"]:["following","followers"],[h]),w=k.includes(b)?b:"posts",y=Le("index"),M=Ve("index"),T=ze("index"),f=_e("index"),O=q("index","me"),{data:E}=r.handle?O:{data:void 0},D=r.handle===E?.handle||!r.handle,B=s?.blockedByMe,P=s?.domainBlockedByMe,[p,N]=u.useState(!1),[F,g]=u.useState(!1),C=u.useRef(null);u.useEffect(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);const Z=()=>{B?M.mutate(s):(y.mutate(s),U.success("User blocked")),N(!1)},J=()=>{P?f.mutate({url:s.apId,handle:s.handle}):(T.mutate({url:s.apId,handle:s.handle}),U.success("Domain blocked")),N(!1)},ee=async()=>{if(!s?.handle||!navigator?.clipboard?.writeText){U.error("Unable to copy handle");return}try{await navigator.clipboard.writeText(s.handle),g(!0),U.success("Handle copied"),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>g(!1),2e3)}catch{U.error("Failed to copy handle"),g(!1)}},[R,be]=u.useState(!1),[ge,se]=u.useState(!1),ke=()=>{be(!R)},V=u.useRef(null),[le,we]=u.useState(!1);u.useEffect(()=>{V.current&&we(V.current.scrollHeight>160)},[R,s?.bio,o,n]),u.useEffect(()=>{b&&(k.includes(b)||a(l,{replace:!0}))},[k,l,a,b]);const ve=v=>v==="posts"?l:`${l}/${v}`,ye=v=>{v!==w&&a(ve(v),{replace:!0})};return!n&&!s?e.jsx(te,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center [&_svg]:translate-x-px",children:e.jsxs(Qe,{children:[e.jsx(Ye,{children:e.jsx(fs,{})}),e.jsx("div",{children:"Profile not found"})]})})}):e.jsx(te,{children:e.jsx("div",{className:"z-0 mx-[max(-4vw,-32px)] -mt-9 flex flex-col items-center pb-16",children:e.jsx("div",{className:"mx-auto w-full",children:e.jsxs(e.Fragment,{children:[s?.bannerImageUrl?e.jsx("div",{className:"h-[15vw] min-h-[200px] w-full overflow-hidden bg-gradient-to-tr from-gray-200 to-gray-100",children:e.jsx("img",{alt:s?.name,className:"size-full object-cover",referrerPolicy:"no-referrer",src:s?.bannerImageUrl})}):e.jsx("div",{className:"h-[max(8vw,132px)] w-full overflow-hidden bg-gradient-to-tr from-white to-white dark:from-black dark:to-black"}),e.jsxs("div",{className:`mx-auto max-w-[620px] px-6 ${!s?.bannerImageUrl&&!x?"-mt-8":"-mt-12"}`,children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"-ml-2 rounded-full bg-white p-1 dark:bg-black",children:n?e.jsx(I,{className:"size-[92px] rounded-full"}):e.jsx(ae,{author:{icon:{url:s?.avatarUrl},name:s?.name,handle:s?.handle},size:"lg"})}),!D&&!n&&e.jsxs("div",{className:"flex gap-2",children:[B||P?e.jsx(ks,{account:s,onDomainUnblock:J,onUnblock:Z}):e.jsx(ie,{following:s?.followedByMe,handle:s?.handle,type:"primary",onFollow:oe,onUnfollow:oe}),e.jsx(gs,{account:s,isBlocked:B,isDomainBlocked:P,onBlockAccount:Z,onBlockDomain:J,onCopyHandle:ee,children:e.jsx(j,{"aria-label":"Open profile menu",variant:"outline",children:e.jsx(We,{})})})]}),D&&!n&&e.jsxs(Ge,{open:ge,onOpenChange:se,children:[e.jsx(Xe,{children:e.jsx(ms,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(qe,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(Ke,{children:e.jsx(Ze,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Je,{className:"break-anywhere mt-4 truncate",children:n?e.jsx(I,{className:"w-32"}):s?.name}),e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("a",{className:"inline-flex max-w-full truncate text-[1.5rem] text-gray-800 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-500",href:s?.url,rel:"noopener noreferrer",target:"_blank",children:e.jsx("span",{className:"truncate",children:n?e.jsx(I,{className:"w-full max-w-56"}):s?.handle})}),!n&&e.jsx(j,{className:"-ml-1.5 size-6 p-0 text-gray-800 hover:text-gray-900 dark:text-gray-700 dark:hover:text-gray-600",title:"Copy handle",variant:"link",onClick:ee,children:F?e.jsx(es,{size:16}):e.jsx(hs,{size:16})}),s?.followsMe&&!n&&e.jsx(ss,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]}),(s?.bio||o?.length>0)&&e.jsxs("div",{ref:V,className:`ap-profile-content break-anywhere relative text-[1.5rem] [&>p]:mb-3 ${R?"max-h-none pb-7":"max-h-[160px] overflow-hidden"} relative`,children:[n?e.jsxs(e.Fragment,{children:[e.jsx(I,{}),e.jsx(I,{className:"w-full max-w-48"})]}):e.jsx("div",{dangerouslySetInnerHTML:{__html:re(ls(ns(s?.bio??"",["a","br"])))}}),o?.map(v=>e.jsxs("span",{className:"mt-3 line-clamp-1 flex flex-col text-[1.5rem]",children:[e.jsx("span",{className:"text-xs font-semibold",children:v.name}),e.jsx("span",{dangerouslySetInnerHTML:{__html:re(v.value)},className:"ap-profile-content truncate"})]})),!R&&le&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/100 via-60% to-transparent dark:from-black dark:via-black/100"}),le&&e.jsx(j,{className:"absolute bottom-0 h-auto p-0 text-md",variant:"link",onClick:ke,children:R?"Show less":"Show all"})]}),e.jsxs(us,{className:"mt-5",value:w,variant:"underline",onValueChange:v=>ye(v),children:[e.jsxs(xs,{children:[e.jsx(S,{value:"posts",children:"Posts"}),h&&e.jsxs(S,{value:"likes",children:["Likes",e.jsx(_,{children:z(s?.likedCount||0)})]}),e.jsxs(S,{value:"following",children:["Following",e.jsx(_,{children:z(s?.followingCount||0)})]}),e.jsxs(S,{value:"followers",children:["Followers",e.jsx(_,{children:z(s?.followerCount||0)})]})]}),e.jsx(A,{value:"posts",children:(B||P)&&!p?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(ts,{})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center gap-0.5",children:[e.jsxs(G,{children:[s.name," is blocked"]}),e.jsx("p",{children:"You can view the posts, but it won't unblock the user."}),e.jsx(j,{className:"mt-4",variant:"secondary",onClick:()=>N(!0),children:"View posts"})]})]}):c}),h&&e.jsx(A,{value:"likes",children:m}),e.jsx(A,{value:"following",children:d}),e.jsx(A,{value:"followers",children:i})]},r.handle||s?.handle||"current-user")]})]})})})})},vs=({handle:s})=>{const{postsByAccountQuery:o}=as(s||"me",{enabled:!0}),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>t.posts)??Array.from({length:5},(t,a)=>({id:`placeholder-${a}`,object:{}}));return e.jsx(bs,{fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:s?`${s} hasn't posted anything yet`:"You haven't posted anything yet.",posts:r})},ys=()=>{const{postsLikedByAccountQuery:s}=is({enabled:!0}),{data:o,fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d}=s,i=o?.pages.flatMap(r=>r.posts)??Array.from({length:5},(r,t)=>({id:`placeholder-${t}`,object:{}}));return e.jsx(js,{fetchNextPage:n,hasNextPage:c,isFetchingNextPage:m,isLoading:d,posts:i})},Ns=({handle:s})=>{const o=he(s===""?"me":s,"following"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"following"in t?t.following:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing,blockedByMe:a.blockedByMe,domainBlockedByMe:a.domainBlockedByMe})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no following`})},Cs=({handle:s})=>{const o=he(s===""?"me":s,"followers"),{data:n,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"followers"in t?t.followers:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:m,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no followers yet`})},Es=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:m}=q("index",s.handle||"me");if(u.useEffect(()=>{m()},[s.handle,m]),c&&rs(c)&&c.statusCode!==404)return e.jsx(os,{errorCode:c.code,statusCode:c.statusCode});const d=Object.keys(o?.customFields||{}).map(x=>({name:x,value:o.customFields[x]}))||[],i=e.jsx(vs,{handle:s.handle||""}),r=e.jsx(ys,{}),t=e.jsx(Ns,{handle:s.handle||""}),a=e.jsx(Cs,{handle:s.handle||""});return e.jsx(ws,{account:o,customFields:d,followersTab:a,followingTab:t,isLoadingAccount:n,likesTab:r,postsTab:i})};export{Es as default};
@@ -1 +1 @@
1
- import{r as c}from"./index-CFEzD2_M.js";const z=(n,t)=>n==null?t:t==null?n:Math.max(n,t),C=new WeakMap,ut={onUpdate(n,t,e){if(C.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),s=n.integer.concat(n.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!s.find(l=>l.pos===o.pos&&l.value===o.value)),a=s.find(o=>!i.find(l=>o.pos===l.pos&&o.value===l.value));C.set(e,z(r?.pos,a?.pos))},getDelta(n,t,e){const i=n-t,s=C.get(e.flow);if(!i&&s!=null&&s>=e.pos)return e.length*e.flow.computedTrend}},y=(n,t,e)=>{const i=document.createElement(n),[s,r]=Array.isArray(t)?[void 0,t]:[t,e];return s&&Object.assign(i,s),r?.forEach(a=>i.appendChild(a)),i},J=(n,t)=>{var e;return t==="left"?n.offsetLeft:(((e=n.offsetParent instanceof HTMLElement?n.offsetParent:null)==null?void 0:e.offsetWidth)??0)-n.offsetWidth-n.offsetLeft},G=n=>n.offsetWidth>0&&n.offsetHeight>0,Y=(n,t)=>{!customElements.get(n)&&customElements.define(n,t)};function Z(n,t,{reverse:e=!1}={}){const i=n.length;for(let s=e?i-1:0;e?s>=0:s<i;e?s--:s++)t(n[s],s)}function q(n,t,e,i){const s=t.formatToParts(n);e&&s.unshift({type:"prefix",value:e}),i&&s.push({type:"suffix",value:i});const r=[],a=[],o=[],l=[],u={},p=d=>`${d}:${u[d]=(u[d]??-1)+1}`;let f="",m=!1,g=!1;for(const d of s){f+=d.value;const h=d.type==="minusSign"||d.type==="plusSign"?"sign":d.type;h==="integer"?(m=!0,a.push(...d.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:d.value}):h==="decimal"?(g=!0,o.push({type:h,value:d.value,key:p(h)})):h==="fraction"?o.push(...d.value.split("").map(A=>({type:h,value:parseInt(A),key:p(h),pos:-1-u[h]}))):(m||g?l:r).push({type:h,value:d.value,key:p(h)})}const M=[];for(let d=a.length-1;d>=0;d--){const h=a[d];M.unshift(h.type==="integer"?{...h,key:p(h.type),pos:u[h.type]}:{...h,key:p(h.type)})}return{pre:r,integer:M,fraction:o,post:l,valueAsString:f,value:typeof n=="string"?parseFloat(n):n}}const Q=String.raw,K=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),tt=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),w=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,E="--_number-flow-d-opacity",U="--_number-flow-d-width",R="--_number-flow-dx",k="--_number-flow-d",et=(()=>{try{return CSS.registerProperty({name:E,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:R,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:k,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),it="var(--number-flow-char-height, 1em)",v="var(--number-flow-mask-height, 0.25em)",N=`calc(${v} / 2)`,$="var(--number-flow-mask-width, 0.5em)",_=`calc(${$} / var(--scale-x))`,b="#000 0, transparent 71%",P=Q`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${it} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${U}) / var(--width));transform:translateX(var(${R})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${_} * 2) 100%,${_} ${v},${_} ${v},${_} ${v},${_} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${N} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${R})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${k})}.digit__num,.number .section::after{padding:${N} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${E}))}`,st=HTMLElement,B=tt&&K&&et;let S;class I extends st{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e;if(t==null)return;const{pre:i,integer:s,fraction:r,post:a,value:o}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,o):this.trend,this.computedAnimated=B&&this._animated&&(!this.respectMotionPreference||!(w!=null&&w.matches))&&G(this),(e=this.plugins)==null||e.forEach(u=>{var p;return(p=u.onUpdate)==null?void 0:p.call(u,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:s,fraction:r}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)S||(S=new CSSStyleSheet,S.replaceSync(P)),this.shadowRoot.adoptedStyleSheets=[S];else{const l=document.createElement("style");l.textContent=P,this.shadowRoot.appendChild(l)}this._pre=new F(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new nt(this,s,r),this.shadowRoot.appendChild(this._num.el),this._post=new F(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}I.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(n,t)=>Math.sign(t-n),respectMotionPreference:!0,plugins:void 0,digits:void 0};class nt{constructor(t,e,i,{className:s,...r}={}){this.flow=t,this._integer=new L(t,e,{justify:"right",part:"integer"}),this._fraction=new L(t,i,{justify:"left",part:"fraction"}),this._inner=y("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=y("span",{...r,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,s=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[R]:[`${e}px`,"0px"],[U]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class D{constructor(t,e,{justify:i,className:s,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=l=>()=>{this.children.delete(l)},this.justify=i;const o=e.map(l=>this.addChar(l).el);this.el=y("span",{...r,className:`section section--justify-${i} ${s??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const s=t.type==="integer"||t.type==="fraction"?new X(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new at(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${J(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,s=this.justify==="left",r=s?"prepend":"append";if(Z(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class L extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof X&&i.update(0)}),this.pop(e)}}class F extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class x{constructor(t,e,{onRemove:i,animateIn:s=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[E]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[E]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class W extends x{constructor(t,e,i,s){super(t.flow,i,s),this.section=t,this.value=e,this.el=i}}class X extends W{constructor(t,e,i,s,r){var a,o;const l=(((o=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:o.max)??9)+1,u=Array.from({length:l}).map((f,m)=>{const g=y("span",{className:"digit__num"},[document.createTextNode(String(m))]);return m!==i&&g.setAttribute("inert",""),g.style.setProperty("--n",String(m)),g}),p=y("span",{part:`digit ${e}-digit`,className:"digit"},u);p.style.setProperty("--current",String(i)),p.style.setProperty("--length",String(l)),super(t,i,p,r),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=l}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],s=e.width/2;this._prevCenter=this.section.justify==="left"?i+s:i-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],s=e.width/2,r=this.section.justify==="left"?i+s:i-s,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[k]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const r=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class at extends W{constructor(t,e,i,s){const r=y("span",{className:"symbol__value",textContent:i});super(t,i,y("span",{part:`symbol ${e}`,className:"symbol"},[r]),s),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new x(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const s=y("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new x(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const rt=parseInt(c.version.match(/^(\d+)\./)?.[1]),j=rt>=19,ot=["data","digits"];class T extends I{attributeChangedCallback(t,e,i){this[t]=JSON.parse(i)}}T.observedAttributes=j?[]:ot;Y("number-flow-react",T);const lt={},O=j?n=>n:JSON.stringify;function V(n){const{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o,...l}=n;return[{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o},l]}class ht extends c.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[e]=V(this.props);Object.entries(e).forEach(([i,s])=>{this.el[i]=s??T.defaultProps[i]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),j&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,e,i){i?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:e,className:i,data:s,willChange:r,isolate:a,group:o,digits:l,onAnimationsStart:u,onAnimationsFinish:p,...f}]=V(this.props);return c.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":r?"":void 0,class:i,...f,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:O(l),data:O(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const ft=c.forwardRef(function({value:t,locales:e,format:i,prefix:s,suffix:r,...a},o){c.useImperativeHandle(o,()=>l.current,[]);const l=c.useRef(),u=c.useContext(H);u?.useRegister(l);const p=c.useMemo(()=>e?JSON.stringify(e):"",[e]),f=c.useMemo(()=>i?JSON.stringify(i):"",[i]),m=c.useMemo(()=>{const g=lt[`${p}:${f}`]??=new Intl.NumberFormat(e,i);return q(t,g,s,r)},[t,p,f,s,r]);return c.createElement(ht,{...a,group:u,data:m,innerRef:l})}),H=c.createContext(void 0);function mt({children:n}){const t=c.useRef(new Set),e=c.useRef(!1),i=c.useRef(new WeakMap),s=c.useMemo(()=>({useRegister(r){c.useEffect(()=>(t.current.add(r),()=>{t.current.delete(r)}),[])},willUpdate(){e.current||(e.current=!0,t.current.forEach(r=>{const a=r.current;!a||!a.created||(a.willUpdate(),i.current.set(a,!0))}))},didUpdate(){t.current.forEach(r=>{const a=r.current;!a||!i.current.get(a)||(a.didUpdate(),i.current.delete(a))}),e.current=!1}}),[]);return c.createElement(H.Provider,{value:s},n)}const ct=()=>c.useSyncExternalStore(()=>()=>{},()=>B,()=>!1),dt=()=>c.useSyncExternalStore(n=>(w?.addEventListener("change",n),()=>w?.removeEventListener("change",n)),()=>w.matches,()=>!1);function gt({respectMotionPreference:n=!0}={}){const t=ct(),e=dt();return t&&(!n||!e)}export{T as NumberFlowElement,mt as NumberFlowGroup,ut as continuous,ft as default,gt as useCanAnimate,ct as useIsSupported,dt as usePrefersReducedMotion};
1
+ import{r as c}from"./index-BkbhBpVC.js";const z=(n,t)=>n==null?t:t==null?n:Math.max(n,t),C=new WeakMap,ut={onUpdate(n,t,e){if(C.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),s=n.integer.concat(n.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!s.find(l=>l.pos===o.pos&&l.value===o.value)),a=s.find(o=>!i.find(l=>o.pos===l.pos&&o.value===l.value));C.set(e,z(r?.pos,a?.pos))},getDelta(n,t,e){const i=n-t,s=C.get(e.flow);if(!i&&s!=null&&s>=e.pos)return e.length*e.flow.computedTrend}},y=(n,t,e)=>{const i=document.createElement(n),[s,r]=Array.isArray(t)?[void 0,t]:[t,e];return s&&Object.assign(i,s),r?.forEach(a=>i.appendChild(a)),i},J=(n,t)=>{var e;return t==="left"?n.offsetLeft:(((e=n.offsetParent instanceof HTMLElement?n.offsetParent:null)==null?void 0:e.offsetWidth)??0)-n.offsetWidth-n.offsetLeft},G=n=>n.offsetWidth>0&&n.offsetHeight>0,Y=(n,t)=>{!customElements.get(n)&&customElements.define(n,t)};function Z(n,t,{reverse:e=!1}={}){const i=n.length;for(let s=e?i-1:0;e?s>=0:s<i;e?s--:s++)t(n[s],s)}function q(n,t,e,i){const s=t.formatToParts(n);e&&s.unshift({type:"prefix",value:e}),i&&s.push({type:"suffix",value:i});const r=[],a=[],o=[],l=[],u={},p=d=>`${d}:${u[d]=(u[d]??-1)+1}`;let f="",m=!1,g=!1;for(const d of s){f+=d.value;const h=d.type==="minusSign"||d.type==="plusSign"?"sign":d.type;h==="integer"?(m=!0,a.push(...d.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:d.value}):h==="decimal"?(g=!0,o.push({type:h,value:d.value,key:p(h)})):h==="fraction"?o.push(...d.value.split("").map(A=>({type:h,value:parseInt(A),key:p(h),pos:-1-u[h]}))):(m||g?l:r).push({type:h,value:d.value,key:p(h)})}const M=[];for(let d=a.length-1;d>=0;d--){const h=a[d];M.unshift(h.type==="integer"?{...h,key:p(h.type),pos:u[h.type]}:{...h,key:p(h.type)})}return{pre:r,integer:M,fraction:o,post:l,valueAsString:f,value:typeof n=="string"?parseFloat(n):n}}const Q=String.raw,K=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),tt=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),w=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,E="--_number-flow-d-opacity",U="--_number-flow-d-width",R="--_number-flow-dx",k="--_number-flow-d",et=(()=>{try{return CSS.registerProperty({name:E,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:R,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:k,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),it="var(--number-flow-char-height, 1em)",v="var(--number-flow-mask-height, 0.25em)",N=`calc(${v} / 2)`,$="var(--number-flow-mask-width, 0.5em)",_=`calc(${$} / var(--scale-x))`,b="#000 0, transparent 71%",P=Q`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${it} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${U}) / var(--width));transform:translateX(var(${R})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${_} * 2) 100%,${_} ${v},${_} ${v},${_} ${v},${_} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${N} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${R})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${k})}.digit__num,.number .section::after{padding:${N} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${E}))}`,st=HTMLElement,B=tt&&K&&et;let S;class I extends st{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e;if(t==null)return;const{pre:i,integer:s,fraction:r,post:a,value:o}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,o):this.trend,this.computedAnimated=B&&this._animated&&(!this.respectMotionPreference||!(w!=null&&w.matches))&&G(this),(e=this.plugins)==null||e.forEach(u=>{var p;return(p=u.onUpdate)==null?void 0:p.call(u,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:s,fraction:r}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)S||(S=new CSSStyleSheet,S.replaceSync(P)),this.shadowRoot.adoptedStyleSheets=[S];else{const l=document.createElement("style");l.textContent=P,this.shadowRoot.appendChild(l)}this._pre=new F(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new nt(this,s,r),this.shadowRoot.appendChild(this._num.el),this._post=new F(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}I.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(n,t)=>Math.sign(t-n),respectMotionPreference:!0,plugins:void 0,digits:void 0};class nt{constructor(t,e,i,{className:s,...r}={}){this.flow=t,this._integer=new L(t,e,{justify:"right",part:"integer"}),this._fraction=new L(t,i,{justify:"left",part:"fraction"}),this._inner=y("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=y("span",{...r,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,s=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[R]:[`${e}px`,"0px"],[U]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class D{constructor(t,e,{justify:i,className:s,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=l=>()=>{this.children.delete(l)},this.justify=i;const o=e.map(l=>this.addChar(l).el);this.el=y("span",{...r,className:`section section--justify-${i} ${s??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const s=t.type==="integer"||t.type==="fraction"?new X(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new at(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${J(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,s=this.justify==="left",r=s?"prepend":"append";if(Z(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class L extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof X&&i.update(0)}),this.pop(e)}}class F extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class x{constructor(t,e,{onRemove:i,animateIn:s=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[E]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[E]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class W extends x{constructor(t,e,i,s){super(t.flow,i,s),this.section=t,this.value=e,this.el=i}}class X extends W{constructor(t,e,i,s,r){var a,o;const l=(((o=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:o.max)??9)+1,u=Array.from({length:l}).map((f,m)=>{const g=y("span",{className:"digit__num"},[document.createTextNode(String(m))]);return m!==i&&g.setAttribute("inert",""),g.style.setProperty("--n",String(m)),g}),p=y("span",{part:`digit ${e}-digit`,className:"digit"},u);p.style.setProperty("--current",String(i)),p.style.setProperty("--length",String(l)),super(t,i,p,r),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=l}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],s=e.width/2;this._prevCenter=this.section.justify==="left"?i+s:i-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],s=e.width/2,r=this.section.justify==="left"?i+s:i-s,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[k]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const r=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class at extends W{constructor(t,e,i,s){const r=y("span",{className:"symbol__value",textContent:i});super(t,i,y("span",{part:`symbol ${e}`,className:"symbol"},[r]),s),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new x(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const s=y("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new x(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const rt=parseInt(c.version.match(/^(\d+)\./)?.[1]),j=rt>=19,ot=["data","digits"];class T extends I{attributeChangedCallback(t,e,i){this[t]=JSON.parse(i)}}T.observedAttributes=j?[]:ot;Y("number-flow-react",T);const lt={},O=j?n=>n:JSON.stringify;function V(n){const{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o,...l}=n;return[{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o},l]}class ht extends c.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[e]=V(this.props);Object.entries(e).forEach(([i,s])=>{this.el[i]=s??T.defaultProps[i]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),j&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,e,i){i?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:e,className:i,data:s,willChange:r,isolate:a,group:o,digits:l,onAnimationsStart:u,onAnimationsFinish:p,...f}]=V(this.props);return c.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":r?"":void 0,class:i,...f,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:O(l),data:O(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const ft=c.forwardRef(function({value:t,locales:e,format:i,prefix:s,suffix:r,...a},o){c.useImperativeHandle(o,()=>l.current,[]);const l=c.useRef(),u=c.useContext(H);u?.useRegister(l);const p=c.useMemo(()=>e?JSON.stringify(e):"",[e]),f=c.useMemo(()=>i?JSON.stringify(i):"",[i]),m=c.useMemo(()=>{const g=lt[`${p}:${f}`]??=new Intl.NumberFormat(e,i);return q(t,g,s,r)},[t,p,f,s,r]);return c.createElement(ht,{...a,group:u,data:m,innerRef:l})}),H=c.createContext(void 0);function mt({children:n}){const t=c.useRef(new Set),e=c.useRef(!1),i=c.useRef(new WeakMap),s=c.useMemo(()=>({useRegister(r){c.useEffect(()=>(t.current.add(r),()=>{t.current.delete(r)}),[])},willUpdate(){e.current||(e.current=!0,t.current.forEach(r=>{const a=r.current;!a||!a.created||(a.willUpdate(),i.current.set(a,!0))}))},didUpdate(){t.current.forEach(r=>{const a=r.current;!a||!i.current.get(a)||(a.didUpdate(),i.current.delete(a))}),e.current=!1}}),[]);return c.createElement(H.Provider,{value:s},n)}const ct=()=>c.useSyncExternalStore(()=>()=>{},()=>B,()=>!1),dt=()=>c.useSyncExternalStore(n=>(w?.addEventListener("change",n),()=>w?.removeEventListener("change",n)),()=>w.matches,()=>!1);function gt({respectMotionPreference:n=!0}={}){const t=ct(),e=dt();return t&&(!n||!e)}export{T as NumberFlowElement,mt as NumberFlowGroup,ut as continuous,ft as default,gt as useCanAnimate,ct as useIsSupported,dt as usePrefersReducedMotion};
@@ -1,4 +1,4 @@
1
- import{dC as Sr,dD as Dt}from"./index-CFEzD2_M.js";import{_ as wr}from"./typeof-QjJsDpFa.js";function Jt(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pe={},he={exports:{}};const Zt={},Yt=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"})),_r=Sr(Yt);var Tr;function Kt(){return Tr||(Tr=1,(function(e,r){var o=(function(){var i=function(L,h,m,S){for(m=m||{},S=L.length;S--;m[L[S]]=h);return m},p=[1,5],y=[1,7],v=[1,8],u=[1,6,10],l=[1,9],g=[1,6,8,10],A=[1,24],d=[1,25],w=[1,26],C=[1,27],M=[1,28],B=[1,29],I=[1,30],k=[1,17],q=[1,18],_=[1,19],N=[21,22,23,24,25,29,30],J=[1,6,8,10,18],Z=[1,47],G=[6,18],Y={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,andCondition:5,OR:6,filterExpr:7,AND:8,LPAREN:9,RPAREN:10,propExpr:11,valueExpr:12,PROP:13,NOT:14,REGEXPOP:15,LBRACKET:16,inExpr:17,RBRACKET:18,OP:19,VALUE:20,NULL:21,TRUE:22,FALSE:23,NUMBER:24,NOW:25,DATEOP:26,AMOUNT:27,INTERVAL:28,LITERAL:29,STRING:30,ADD:31,SUB:32,CONTAINS:33,STARTSWITH:34,ENDSWITH:35,GT:36,LT:37,GTE:38,LTE:39,$accept:0,$end:1},terminals_:{2:"error",6:"OR",8:"AND",9:"LPAREN",10:"RPAREN",13:"PROP",14:"NOT",16:"LBRACKET",18:"RBRACKET",21:"NULL",22:"TRUE",23:"FALSE",24:"NUMBER",25:"NOW",27:"AMOUNT",28:"INTERVAL",29:"LITERAL",30:"STRING",31:"ADD",32:"SUB",33:"CONTAINS",34:"STARTSWITH",35:"ENDSWITH",36:"GT",37:"LT",38:"GTE",39:"LTE"},productions_:[0,[3,1],[4,1],[4,3],[5,1],[5,3],[7,3],[7,2],[11,1],[12,2],[12,1],[12,4],[12,3],[12,2],[12,1],[17,3],[17,1],[20,1],[20,1],[20,1],[20,1],[20,4],[20,1],[20,1],[26,1],[26,1],[15,2],[15,2],[15,2],[19,1],[19,1],[19,1],[19,1],[19,1]],performAction:function(h,m,S,P,E,f,Q,W){var c=f.length-1;switch(E){case 1:return P.debug("expression",f[c]),P.debug("opt",W),f[c]&&f[c].yg?f[c].yg:f[c];case 2:P.debug("andCondition",f[c]),this.$=f[c];break;case 3:P.debug("expression OR andCondition",f[c-2],f[c]),f[c-2]=f[c-2].$or?f[c-2]:{$or:[P.ungroup(f[c-2])]},f[c-2].$or.push(P.ungroup(f[c])),this.$=f[c-2];break;case 4:P.debug("filterExpr",f[c]),this.$=f[c];break;case 5:P.debug("andCondition AND filterExpr",f[c-2],f[c]),f[c-2]=f[c-2].$and?f[c-2]:{$and:[P.ungroup(f[c-2])]},f[c-2].$and.push(P.ungroup(f[c])),this.$=f[c-2];break;case 6:P.debug("LPAREN expression RPAREN",f[c-1]),this.$={yg:f[c-1]};break;case 7:this.$={[f[c-1]]:f[c]};break;case 8:f[c]=f[c].replace(/:$/,""),f[c]=W.aliases&&W.aliases[f[c]]?W.aliases[f[c]]:f[c],this.$=f[c];break;case 9:this.$={$not:f[c]};break;case 10:this.$={$regex:f[c]};break;case 11:this.$={$nin:f[c-1]};break;case 12:this.$={$in:f[c-1]};break;case 13:this.$={},this.$[f[c-1]]=f[c];break;case 14:this.$=f[c];break;case 15:this.$.push(f[c]);break;case 16:this.$=[f[c]];break;case 17:this.$=null;break;case 18:this.$=!0;break;case 19:this.$=!1;break;case 20:this.$=parseInt(h);break;case 21:this.$=P.relDateToAbsolute(f[c-2],f[c-1],f[c]);break;case 22:this.$=P.unescape(f[c]);break;case 23:f[c]=f[c].replace(/^'|'$/g,""),this.$=P.unescape(f[c]);break;case 24:this.$="add";break;case 25:this.$="sub";break;case 26:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c]);break;case 27:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c],"^");break;case 28:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c],"$");break;case 29:this.$="$ne";break;case 30:this.$="$gt";break;case 31:this.$="$lt";break;case 32:this.$="$gte";break;case 33:this.$="$lte";break}},table:[{3:1,4:2,5:3,7:4,9:p,11:6,13:y},{1:[3]},{1:[2,1],6:v},i(u,[2,2],{8:l}),i(g,[2,4]),{4:10,5:3,7:4,9:p,11:6,13:y},{12:11,14:[1,12],15:13,16:[1,14],19:15,20:16,21:A,22:d,23:w,24:C,25:M,29:B,30:I,33:k,34:q,35:_,36:[1,20],37:[1,21],38:[1,22],39:[1,23]},i([14,16,21,22,23,24,25,29,30,33,34,35,36,37,38,39],[2,8]),{5:31,7:4,9:p,11:6,13:y},{7:32,9:p,11:6,13:y},{6:v,10:[1,33]},i(g,[2,7]),i(N,[2,29],{15:34,16:[1,35],33:k,34:q,35:_}),i(g,[2,10]),{17:36,20:37,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{20:38,21:A,22:d,23:w,24:C,25:M,29:B,30:I},i(g,[2,14]),{30:[1,39]},{30:[1,40]},{30:[1,41]},i(N,[2,30]),i(N,[2,31]),i(N,[2,32]),i(N,[2,33]),i(J,[2,17]),i(J,[2,18]),i(J,[2,19]),i(J,[2,20]),{26:42,31:[1,43],32:[1,44]},i(J,[2,22]),i(J,[2,23]),i(u,[2,3],{8:l}),i(g,[2,5]),i(g,[2,6]),i(g,[2,9]),{17:45,20:37,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{6:Z,18:[1,46]},i(G,[2,16]),i(g,[2,13]),i(g,[2,26]),i(g,[2,27]),i(g,[2,28]),{27:[1,48]},{27:[2,24]},{27:[2,25]},{6:Z,18:[1,49]},i(g,[2,12]),{20:50,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{28:[1,51]},i(g,[2,11]),i(G,[2,15]),i(J,[2,21])],defaultActions:{43:[2,24],44:[2,25]},parseError:function(h,m){if(m.recoverable)this.trace(h);else{var S=new Error(h);throw S.hash=m,S}},parse:function(h){var m=this,S=[0],P=[null],E=[],f=this.table,Q="",W=0,c=0,ie=2,$=1,t=E.slice.call(arguments,1),n=Object.create(this.lexer),s={yy:{}};for(var T in this.yy)Object.prototype.hasOwnProperty.call(this.yy,T)&&(s.yy[T]=this.yy[T]);n.setInput(h,s.yy),s.yy.lexer=n,s.yy.parser=this,typeof n.yylloc>"u"&&(n.yylloc={});var F=n.yylloc;E.push(F);var D=n.options&&n.options.ranges;typeof s.yy.parseError=="function"?this.parseError=s.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var R=function(){var X;return X=n.lex()||$,typeof X!="number"&&(X=m.symbols_[X]||X),X},b,O,j,x,V={},z,U,ne,re;;){if(O=S[S.length-1],this.defaultActions[O]?j=this.defaultActions[O]:((b===null||typeof b>"u")&&(b=R()),j=f[O]&&f[O][b]),typeof j>"u"||!j.length||!j[0]){var a="";re=[];for(z in f[O])this.terminals_[z]&&z>ie&&re.push("'"+this.terminals_[z]+"'");n.showPosition?a="Parse error on line "+(W+1)+`:
1
+ import{dC as Sr,dD as Dt}from"./index-BkbhBpVC.js";import{_ as wr}from"./typeof-QjJsDpFa.js";function Jt(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pe={},he={exports:{}};const Zt={},Yt=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"})),_r=Sr(Yt);var Tr;function Kt(){return Tr||(Tr=1,(function(e,r){var o=(function(){var i=function(L,h,m,S){for(m=m||{},S=L.length;S--;m[L[S]]=h);return m},p=[1,5],y=[1,7],v=[1,8],u=[1,6,10],l=[1,9],g=[1,6,8,10],A=[1,24],d=[1,25],w=[1,26],C=[1,27],M=[1,28],B=[1,29],I=[1,30],k=[1,17],q=[1,18],_=[1,19],N=[21,22,23,24,25,29,30],J=[1,6,8,10,18],Z=[1,47],G=[6,18],Y={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,andCondition:5,OR:6,filterExpr:7,AND:8,LPAREN:9,RPAREN:10,propExpr:11,valueExpr:12,PROP:13,NOT:14,REGEXPOP:15,LBRACKET:16,inExpr:17,RBRACKET:18,OP:19,VALUE:20,NULL:21,TRUE:22,FALSE:23,NUMBER:24,NOW:25,DATEOP:26,AMOUNT:27,INTERVAL:28,LITERAL:29,STRING:30,ADD:31,SUB:32,CONTAINS:33,STARTSWITH:34,ENDSWITH:35,GT:36,LT:37,GTE:38,LTE:39,$accept:0,$end:1},terminals_:{2:"error",6:"OR",8:"AND",9:"LPAREN",10:"RPAREN",13:"PROP",14:"NOT",16:"LBRACKET",18:"RBRACKET",21:"NULL",22:"TRUE",23:"FALSE",24:"NUMBER",25:"NOW",27:"AMOUNT",28:"INTERVAL",29:"LITERAL",30:"STRING",31:"ADD",32:"SUB",33:"CONTAINS",34:"STARTSWITH",35:"ENDSWITH",36:"GT",37:"LT",38:"GTE",39:"LTE"},productions_:[0,[3,1],[4,1],[4,3],[5,1],[5,3],[7,3],[7,2],[11,1],[12,2],[12,1],[12,4],[12,3],[12,2],[12,1],[17,3],[17,1],[20,1],[20,1],[20,1],[20,1],[20,4],[20,1],[20,1],[26,1],[26,1],[15,2],[15,2],[15,2],[19,1],[19,1],[19,1],[19,1],[19,1]],performAction:function(h,m,S,P,E,f,Q,W){var c=f.length-1;switch(E){case 1:return P.debug("expression",f[c]),P.debug("opt",W),f[c]&&f[c].yg?f[c].yg:f[c];case 2:P.debug("andCondition",f[c]),this.$=f[c];break;case 3:P.debug("expression OR andCondition",f[c-2],f[c]),f[c-2]=f[c-2].$or?f[c-2]:{$or:[P.ungroup(f[c-2])]},f[c-2].$or.push(P.ungroup(f[c])),this.$=f[c-2];break;case 4:P.debug("filterExpr",f[c]),this.$=f[c];break;case 5:P.debug("andCondition AND filterExpr",f[c-2],f[c]),f[c-2]=f[c-2].$and?f[c-2]:{$and:[P.ungroup(f[c-2])]},f[c-2].$and.push(P.ungroup(f[c])),this.$=f[c-2];break;case 6:P.debug("LPAREN expression RPAREN",f[c-1]),this.$={yg:f[c-1]};break;case 7:this.$={[f[c-1]]:f[c]};break;case 8:f[c]=f[c].replace(/:$/,""),f[c]=W.aliases&&W.aliases[f[c]]?W.aliases[f[c]]:f[c],this.$=f[c];break;case 9:this.$={$not:f[c]};break;case 10:this.$={$regex:f[c]};break;case 11:this.$={$nin:f[c-1]};break;case 12:this.$={$in:f[c-1]};break;case 13:this.$={},this.$[f[c-1]]=f[c];break;case 14:this.$=f[c];break;case 15:this.$.push(f[c]);break;case 16:this.$=[f[c]];break;case 17:this.$=null;break;case 18:this.$=!0;break;case 19:this.$=!1;break;case 20:this.$=parseInt(h);break;case 21:this.$=P.relDateToAbsolute(f[c-2],f[c-1],f[c]);break;case 22:this.$=P.unescape(f[c]);break;case 23:f[c]=f[c].replace(/^'|'$/g,""),this.$=P.unescape(f[c]);break;case 24:this.$="add";break;case 25:this.$="sub";break;case 26:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c]);break;case 27:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c],"^");break;case 28:f[c]=f[c].replace(/^'|'$/g,""),f[c]=P.unescape(f[c]),this.$=P.stringToRegExp(f[c],"$");break;case 29:this.$="$ne";break;case 30:this.$="$gt";break;case 31:this.$="$lt";break;case 32:this.$="$gte";break;case 33:this.$="$lte";break}},table:[{3:1,4:2,5:3,7:4,9:p,11:6,13:y},{1:[3]},{1:[2,1],6:v},i(u,[2,2],{8:l}),i(g,[2,4]),{4:10,5:3,7:4,9:p,11:6,13:y},{12:11,14:[1,12],15:13,16:[1,14],19:15,20:16,21:A,22:d,23:w,24:C,25:M,29:B,30:I,33:k,34:q,35:_,36:[1,20],37:[1,21],38:[1,22],39:[1,23]},i([14,16,21,22,23,24,25,29,30,33,34,35,36,37,38,39],[2,8]),{5:31,7:4,9:p,11:6,13:y},{7:32,9:p,11:6,13:y},{6:v,10:[1,33]},i(g,[2,7]),i(N,[2,29],{15:34,16:[1,35],33:k,34:q,35:_}),i(g,[2,10]),{17:36,20:37,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{20:38,21:A,22:d,23:w,24:C,25:M,29:B,30:I},i(g,[2,14]),{30:[1,39]},{30:[1,40]},{30:[1,41]},i(N,[2,30]),i(N,[2,31]),i(N,[2,32]),i(N,[2,33]),i(J,[2,17]),i(J,[2,18]),i(J,[2,19]),i(J,[2,20]),{26:42,31:[1,43],32:[1,44]},i(J,[2,22]),i(J,[2,23]),i(u,[2,3],{8:l}),i(g,[2,5]),i(g,[2,6]),i(g,[2,9]),{17:45,20:37,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{6:Z,18:[1,46]},i(G,[2,16]),i(g,[2,13]),i(g,[2,26]),i(g,[2,27]),i(g,[2,28]),{27:[1,48]},{27:[2,24]},{27:[2,25]},{6:Z,18:[1,49]},i(g,[2,12]),{20:50,21:A,22:d,23:w,24:C,25:M,29:B,30:I},{28:[1,51]},i(g,[2,11]),i(G,[2,15]),i(J,[2,21])],defaultActions:{43:[2,24],44:[2,25]},parseError:function(h,m){if(m.recoverable)this.trace(h);else{var S=new Error(h);throw S.hash=m,S}},parse:function(h){var m=this,S=[0],P=[null],E=[],f=this.table,Q="",W=0,c=0,ie=2,$=1,t=E.slice.call(arguments,1),n=Object.create(this.lexer),s={yy:{}};for(var T in this.yy)Object.prototype.hasOwnProperty.call(this.yy,T)&&(s.yy[T]=this.yy[T]);n.setInput(h,s.yy),s.yy.lexer=n,s.yy.parser=this,typeof n.yylloc>"u"&&(n.yylloc={});var F=n.yylloc;E.push(F);var D=n.options&&n.options.ranges;typeof s.yy.parseError=="function"?this.parseError=s.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var R=function(){var X;return X=n.lex()||$,typeof X!="number"&&(X=m.symbols_[X]||X),X},b,O,j,x,V={},z,U,ne,re;;){if(O=S[S.length-1],this.defaultActions[O]?j=this.defaultActions[O]:((b===null||typeof b>"u")&&(b=R()),j=f[O]&&f[O][b]),typeof j>"u"||!j.length||!j[0]){var a="";re=[];for(z in f[O])this.terminals_[z]&&z>ie&&re.push("'"+this.terminals_[z]+"'");n.showPosition?a="Parse error on line "+(W+1)+`:
2
2
  `+n.showPosition()+`
3
3
  Expecting `+re.join(", ")+", got '"+(this.terminals_[b]||b)+"'":a="Parse error on line "+(W+1)+": Unexpected "+(b==$?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(a,{text:n.match,token:this.terminals_[b]||b,line:n.yylineno,loc:F,expected:re})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+b);switch(j[0]){case 1:S.push(b),P.push(n.yytext),E.push(n.yylloc),S.push(j[1]),b=null,c=n.yyleng,Q=n.yytext,W=n.yylineno,F=n.yylloc;break;case 2:if(U=this.productions_[j[1]][1],V.$=P[P.length-U],V._$={first_line:E[E.length-(U||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(U||1)].first_column,last_column:E[E.length-1].last_column},D&&(V._$.range=[E[E.length-(U||1)].range[0],E[E.length-1].range[1]]),x=this.performAction.apply(V,[Q,c,W,s.yy,j[1],P,E].concat(t)),typeof x<"u")return x;U&&(S=S.slice(0,-1*U*2),P=P.slice(0,-1*U),E=E.slice(0,-1*U)),S.push(this.productions_[j[1]][0]),P.push(V.$),E.push(V._$),ne=f[S[S.length-2]][S[S.length-1]],S.push(ne);break;case 3:return!0}}return!0}};Y.parseError=function(L,h){var m=L.split(`
4
4
  `);throw m[0]="Query Error: unexpected character in filter at char "+(h.loc.first_column+1),new Error(m.join(`
@@ -1,4 +1,4 @@
1
- import{P as st,a as Q,b as v,x as it,N as Ee,s as Ie,T as H,p as ot,t as m,d as X,e as P,y as z,L as fe,z as at,A as lt,E as ht,B as ft,C as ut,F as dt,w as pt,G as ct,J as mt,g as Me,i as gt,K as kt,M as ue,O as Lt}from"./settings-66Zv8QvL.js";import{html as bt,htmlCompletionSource as wt}from"./index-GExKMpy_.js";import"./index-CFEzD2_M.js";import"./tabs-CL5eaCGL.js";import"./newsletters-DOIL_cOY.js";import"./posts-u-CAKddc.js";import"./typeof-QjJsDpFa.js";import"./tiers-DXKbghdk.js";import"./dropzone-DSPf3N_o.js";import"./index-WKMARia9.js";import"./referrers-DV_Ihg9y.js";import"./select-CPSy44ld.js";import"./chevron-up-CVgBkTk5.js";import"./underline-Bq0P-5Zy.js";import"./toggle-group-DaZKTYDS.js";import"./textarea-DdDuNixZ.js";import"./index-BOMdiHRG.js";import"./index-Dskrbhv3.js";import"./index-Bf83suMc.js";class _{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new _(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{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 R(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,r=0,n=0){for(let s=r;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let r=0;for(let n=0;r<this.text.length&&n<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let e="";for(let r=0;r<this.basePos;r++)e+=" ";return e+this.text.slice(this.basePos)}}function de(t,e,r){if(r.pos==r.text.length||t!=e.block&&r.indent>=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(A(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent<r.baseIndent+t.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function A(t){return t==32||t==9||t==10||t==13}function R(t,e=0){for(;e<t.length&&A(t.charCodeAt(e));)e++;return e}function pe(t,e,r){for(;e>r&&A(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let r=e;r<t.text.length;r++)if(t.text.charCodeAt(r)==96)return-1}return e}function ve(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function se(t,e,r){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let i=t.text.charCodeAt(s);if(i==t.next)n++;else if(!A(i))return-1}return r&&t.next==45&&Oe(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||A(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function oe(t,e,r){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!A(t.text.charCodeAt(n+1))||r&&!Ne(e,u.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let r=e-t.pos;return r>6?-1:r}function Oe(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let r=e;for(;e<t.text.length&&A(t.text.charCodeAt(e));)e++;return e==t.text.length?r:-1}const W=/^[ \t]*$/,Re=/-->/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Re],[/^\s*<\?/,Te],[/^\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,W],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,W]];function ze(t,e,r){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,i=ee.length-(r?1:0);s<i;s++)if(ee[s][0].test(n))return s;return-1}function ce(t,e){let r=t.countIndent(e,t.pos,t.indent),n=t.countIndent(t.skipSpace(e),e,r);return n>=r+5?r+1:n}function x(t,e,r){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==u.CodeText?t[n].to=r:t.push(k(u.CodeText,e,r))}const $={LinkReference:void 0,IndentedCode(t,e){let r=e.baseIndent+4;if(e.indent<r)return!1;let n=e.findColumn(r),s=t.lineStart+n,i=t.lineStart+e.text.length,o=[],a=[];for(x(o,s,i);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){x(a,t.lineStart-1,t.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<r)break;{if(a.length){for(let h of a)h.type==u.CodeText?x(o,h.from,h.to):o.push(h);a=[]}x(o,t.lineStart-1,t.lineStart);for(let h of e.markers)o.push(h);i=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<i&&x(o,l,i)}}return a.length&&(a=a.filter(l=>l.type!=u.CodeText),a.length&&(e.markers=a.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(u.CodeBlock,i-s),s),!0},FencedCode(t,e){let r=Pe(e);if(r<0)return!1;let n=t.lineStart+e.pos,s=e.next,i=r-e.pos,o=e.skipSpace(r),a=pe(e.text,e.text.length,o),l=[k(u.CodeMark,n,n+i)];o<a&&l.push(k(u.CodeInfo,t.lineStart+o,t.lineStart+a));for(let h=!0,f=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;h=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==s;)d++;if(d-e.pos>=i&&e.skipSpace(d)==e.text.length){for(let c of e.markers)l.push(c);f&&p&&x(l,t.lineStart-1,t.lineStart),l.push(k(u.CodeMark,t.lineStart+e.pos,t.lineStart+d)),t.nextLine();break}else{p=!0,h||(x(l,t.lineStart-1,t.lineStart),f=!1);for(let g of e.markers)l.push(g);let c=t.lineStart+e.basePos,L=t.lineStart+e.text.length;c<L&&(x(l,c,L),f=!1)}}return t.addNode(t.buffer.writeElements(l,-n).finish(u.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let r=ve(e);return r<0?!1:(t.startContext(u.Blockquote,e.pos),t.addNode(u.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+r),null)},HorizontalRule(t,e){if(se(e,t,!1)<0)return!1;let r=t.lineStart+e.pos;return t.nextLine(),t.addNode(u.HorizontalRule,r),!0},BulletList(t,e){let r=ie(e,t,!1);if(r<0)return!1;t.block.type!=u.BulletList&&t.startContext(u.BulletList,e.basePos,e.next);let n=ce(e,e.pos+1);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},OrderedList(t,e){let r=oe(e,t,!1);if(r<0)return!1;t.block.type!=u.OrderedList&&t.startContext(u.OrderedList,e.basePos,e.text.charCodeAt(e.pos+r-1));let n=ce(e,e.pos+r);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},ATXHeading(t,e){let r=ye(e);if(r<0)return!1;let n=e.pos,s=t.lineStart+n,i=pe(e.text,e.text.length,n),o=i;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==i||o==n||!A(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=t.buffer.write(u.HeaderMark,0,r).writeElements(t.parser.parseInline(e.text.slice(n+r+1,o),s+r+1),-s);o<e.text.length&&a.write(u.HeaderMark,o-n,i-n);let l=a.finish(u.ATXHeading1-1+r,e.text.length-n);return t.nextLine(),t.addNode(l,s),!0},HTMLBlock(t,e){let r=ze(e,t,!1);if(r<0)return!1;let n=t.lineStart+e.pos,s=ee[r][1],i=[],o=s!=W;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let h of e.markers)i.push(h)}o&&t.nextLine();let a=s==Re?u.CommentBlock:s==Te?u.ProcessingInstructionBlock:u.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(i,-n).finish(a,l-n),n),!0},SetextHeading:void 0};class At{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,r,n){if(this.stage==-1)return!1;let s=n.content+`
1
+ import{P as st,a as Q,b as v,x as it,N as Ee,s as Ie,T as H,p as ot,t as m,d as X,e as P,y as z,L as fe,z as at,A as lt,E as ht,B as ft,C as ut,F as dt,w as pt,G as ct,J as mt,g as Me,i as gt,K as kt,M as ue,O as Lt}from"./settings-rRY210wx.js";import{html as bt,htmlCompletionSource as wt}from"./index-DLFVpwt3.js";import"./index-BkbhBpVC.js";import"./tabs-M6kFEqPE.js";import"./newsletters-CSCa3QdE.js";import"./posts-BZaw4-dc.js";import"./typeof-QjJsDpFa.js";import"./tiers-D2DYHaeO.js";import"./dropzone-Cs4DrURS.js";import"./index-DYE2untj.js";import"./referrers-BsZ85Z0a.js";import"./select-BfWJkrKc.js";import"./chevron-up-DuaKtE_M.js";import"./underline-CwuJG-Ql.js";import"./toggle-group-GYp_w6Po.js";import"./textarea-CGBp9nOo.js";import"./index-DQZp_NsL.js";import"./index-DIyK69JM.js";import"./index-D3A8RTi0.js";class _{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new _(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{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 R(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,r=0,n=0){for(let s=r;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let r=0;for(let n=0;r<this.text.length&&n<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let e="";for(let r=0;r<this.basePos;r++)e+=" ";return e+this.text.slice(this.basePos)}}function de(t,e,r){if(r.pos==r.text.length||t!=e.block&&r.indent>=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(A(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent<r.baseIndent+t.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function A(t){return t==32||t==9||t==10||t==13}function R(t,e=0){for(;e<t.length&&A(t.charCodeAt(e));)e++;return e}function pe(t,e,r){for(;e>r&&A(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let r=e;r<t.text.length;r++)if(t.text.charCodeAt(r)==96)return-1}return e}function ve(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function se(t,e,r){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let i=t.text.charCodeAt(s);if(i==t.next)n++;else if(!A(i))return-1}return r&&t.next==45&&Oe(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||A(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function oe(t,e,r){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!A(t.text.charCodeAt(n+1))||r&&!Ne(e,u.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let r=e-t.pos;return r>6?-1:r}function Oe(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let r=e;for(;e<t.text.length&&A(t.text.charCodeAt(e));)e++;return e==t.text.length?r:-1}const W=/^[ \t]*$/,Re=/-->/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Re],[/^\s*<\?/,Te],[/^\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,W],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,W]];function ze(t,e,r){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,i=ee.length-(r?1:0);s<i;s++)if(ee[s][0].test(n))return s;return-1}function ce(t,e){let r=t.countIndent(e,t.pos,t.indent),n=t.countIndent(t.skipSpace(e),e,r);return n>=r+5?r+1:n}function x(t,e,r){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==u.CodeText?t[n].to=r:t.push(k(u.CodeText,e,r))}const $={LinkReference:void 0,IndentedCode(t,e){let r=e.baseIndent+4;if(e.indent<r)return!1;let n=e.findColumn(r),s=t.lineStart+n,i=t.lineStart+e.text.length,o=[],a=[];for(x(o,s,i);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){x(a,t.lineStart-1,t.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<r)break;{if(a.length){for(let h of a)h.type==u.CodeText?x(o,h.from,h.to):o.push(h);a=[]}x(o,t.lineStart-1,t.lineStart);for(let h of e.markers)o.push(h);i=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<i&&x(o,l,i)}}return a.length&&(a=a.filter(l=>l.type!=u.CodeText),a.length&&(e.markers=a.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(u.CodeBlock,i-s),s),!0},FencedCode(t,e){let r=Pe(e);if(r<0)return!1;let n=t.lineStart+e.pos,s=e.next,i=r-e.pos,o=e.skipSpace(r),a=pe(e.text,e.text.length,o),l=[k(u.CodeMark,n,n+i)];o<a&&l.push(k(u.CodeInfo,t.lineStart+o,t.lineStart+a));for(let h=!0,f=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;h=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==s;)d++;if(d-e.pos>=i&&e.skipSpace(d)==e.text.length){for(let c of e.markers)l.push(c);f&&p&&x(l,t.lineStart-1,t.lineStart),l.push(k(u.CodeMark,t.lineStart+e.pos,t.lineStart+d)),t.nextLine();break}else{p=!0,h||(x(l,t.lineStart-1,t.lineStart),f=!1);for(let g of e.markers)l.push(g);let c=t.lineStart+e.basePos,L=t.lineStart+e.text.length;c<L&&(x(l,c,L),f=!1)}}return t.addNode(t.buffer.writeElements(l,-n).finish(u.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let r=ve(e);return r<0?!1:(t.startContext(u.Blockquote,e.pos),t.addNode(u.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+r),null)},HorizontalRule(t,e){if(se(e,t,!1)<0)return!1;let r=t.lineStart+e.pos;return t.nextLine(),t.addNode(u.HorizontalRule,r),!0},BulletList(t,e){let r=ie(e,t,!1);if(r<0)return!1;t.block.type!=u.BulletList&&t.startContext(u.BulletList,e.basePos,e.next);let n=ce(e,e.pos+1);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},OrderedList(t,e){let r=oe(e,t,!1);if(r<0)return!1;t.block.type!=u.OrderedList&&t.startContext(u.OrderedList,e.basePos,e.text.charCodeAt(e.pos+r-1));let n=ce(e,e.pos+r);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},ATXHeading(t,e){let r=ye(e);if(r<0)return!1;let n=e.pos,s=t.lineStart+n,i=pe(e.text,e.text.length,n),o=i;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==i||o==n||!A(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=t.buffer.write(u.HeaderMark,0,r).writeElements(t.parser.parseInline(e.text.slice(n+r+1,o),s+r+1),-s);o<e.text.length&&a.write(u.HeaderMark,o-n,i-n);let l=a.finish(u.ATXHeading1-1+r,e.text.length-n);return t.nextLine(),t.addNode(l,s),!0},HTMLBlock(t,e){let r=ze(e,t,!1);if(r<0)return!1;let n=t.lineStart+e.pos,s=ee[r][1],i=[],o=s!=W;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let h of e.markers)i.push(h)}o&&t.nextLine();let a=s==Re?u.CommentBlock:s==Te?u.ProcessingInstructionBlock:u.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(i,-n).finish(a,l-n),n),!0},SetextHeading:void 0};class At{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,r,n){if(this.stage==-1)return!1;let s=n.content+`
2
2
  `+r.scrub(),i=this.advance(s);return i>-1&&i<s.length?this.complete(e,n,i):!1}finish(e,r){return(this.stage==2||this.stage==3)&&R(r.content,this.pos)==r.content.length?this.complete(e,r,r.content.length):!1}complete(e,r,n){return e.addLeafElement(r,k(u.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;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(k(u.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(qe(e,R(e,this.pos),this.start)))return-1}else if(this.stage==2){let r=R(e,this.pos),n=0;if(r>this.pos){let s=Qe(e,r,this.start);if(s){let i=G(e,s.to-this.start);i>0&&(this.nextStage(s),n=i)}}return n||(n=G(e,this.pos)),n>0&&n<e.length?n:-1}else return G(e,this.pos)}}}function G(t,e){for(;e<t.length;e++){let r=t.charCodeAt(e);if(r==10)break;if(!A(r))return-1}return e}class xt{nextLine(e,r,n){let s=r.depth<e.stack.length?-1:Oe(r),i=r.next;if(s<0)return!1;let o=k(u.HeaderMark,e.lineStart+r.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(n,k(i==61?u.SetextHeading1:u.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const De={LinkReference(t,e){return e.content.charCodeAt(0)==91?new At(e):null},SetextHeading(){return new xt}},Bt=[(t,e)=>ye(e)>=0,(t,e)=>Pe(e)>=0,(t,e)=>ve(e)>=0,(t,e)=>ie(e,t,!0)>=0,(t,e)=>oe(e,t,!0)>=0,(t,e)=>se(e,t,!0)>=0,(t,e)=>ze(e,t,!0)>=0],Et={text:"",end:0};class It{constructor(e,r,n,s){this.parser=e,this.input=r,this.ranges=s,this.line=new Ct,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=_.create(u.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Pt(n,r):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 n=0;;){let s=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!s||e.markers[n].from<s.end);){let i=e.markers[n++];this.addNode(i.type,i.from,i.to)}if(!s)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;e:for(;;){for(let n of this.parser.blockParsers)if(n){let s=n(this,e);if(s!=!1){if(s==!0)return null;e.forward();continue e}}break}let r=new St(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let s=n(this,r);s&&r.parsers.push(s)}e: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,r))break e}for(let n of r.parsers)if(n.nextLine(this,e,r))return null;r.content+=`
3
3
  `+e.scrub();for(let n of e.markers)r.marks.push(n)}return this.finishLeaf(r),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new 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 r=this.fragments.takeNodes(this);return r?(this.absoluteLineStart+=r,this.lineStart=Ge(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 r=Et;if(r.end=e,e>=this.to)r.text="";else if(r.text=this.lineChunkAt(e),r.end+=r.text.length,this.ranges.length>1){let n=this.absoluteLineStart,s=this.rangeI;for(;this.ranges[s].to<r.end;){s++;let i=this.ranges[s].from,o=this.lineChunkAt(i);r.end=i+o.length,r.text=r.text.slice(0,this.ranges[s-1].to-n)+o,n=r.end-r.text.length}}return r}readLine(){let{line:e}=this,{text:r,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(r);e.depth<this.stack.length;e.depth++){let s=this.stack[e.depth],i=this.parser.skipContextMarkup[s.type];if(!i)throw new Error("Unhandled block context "+u[s.type]);let o=this.line.markers.length;if(!i(s,this,e)){this.line.markers.length>o&&(s.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let r=this.input.chunk(e),n;if(this.input.lineChunks)n=r==`
4
4
  `?"":r;else{let s=r.indexOf(`