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,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-D3LfHeBl.js","./minus-DPrXh11r.js","./deleted-feed-item-jLcSKuul.js","./trash-CKK_p9G5.js","./topic-filter-BzqiVOAU.js","./empty-indicator-2Pjmce3n.js","./inbox-CCirPaG2.js","./feed-CygLK1Ad.js","./hash-CeFrjo3C.js","./note-mUikaB-p.js","./index-Bjw2qAph.js","./at-sign-BsHNViA_.js","./user-round-check-D0I7NO1g.js","./reply-9ZyqaxI-.js","./index-CYPN5csJ.js","./sprout-956Q4On2.js","./index-C7xLyJVb.js","./pencil-CKTgzafp.js","./edit-profile-BvU2-lW5.js","./label-fijjy1Mb.js","./textarea-DdDuNixZ.js","./tabs-CL5eaCGL.js","./settings-krk0432u.js","./user-round-x-DeGVH29o.js","./copy-D7jqplrv.js","./index-D7Ui3Fih.js","./toggle-group-DaZKTYDS.js","./square-BaCvbKJY.js","./moderation-B2Tixfce.js","./bluesky-sharing-C2xwSoS-.js","./account-migration-SYnE1jBW.js","./step-1-09wdjzdX.js","./step-2-8iaQ0efq.js","./avatar-flipboard-BgoH-wIq.js","./repeat-uXmOJ6y8.js","./step-3-BuHAZbdD.js","./a-large-small-DxRNdz0F.js","./post-analytics-context-BWDhMRq_.js","./posts-u-CAKddc.js","./post-analytics-CWA8invj.js","./main-layout-XtviVkg1.js","./post-share-modal-D8BtRD2u.js","./share-modal-BRmGllZq.js","./overview-yZ-7KJdx.js","./growth-Fz3Oatml.js","./wallet-cards-B9TQg4x3.js","./source-icon-DeeHyZRn.js","./mail-9TFkAaAh.js","./source-utils-B1S3ZHA2.js","./pagemenu-TxGvHwRO.js","./table-DTofVyjA.js","./kpi-card-BP-2yicn.js","./post-analytics-header-Bm0mcxjK.js","./get-site-timezone-BDBAcjmq.js","./post-helpers-DR3PcyZg.js","./member-route-ZLy3opLv.js","./currency-fEUUCkj0.js","./stats-BVKNZJO6.js","./data-list-DUaY9nlT.js","./kpi-card-DOplXdDT.js","./gh-chart-CEhBBu3F.js","./undo-2-CcBtw-tW.js","./upload-BcylHEMw.js","./arrow-right-BixoEua4.js","./chart-X5cLIH1X.js","./_baseAssignValue-BDsvYKNK.js","./index-WKMARia9.js","./value-BGBiTkF3.js","./underline-Bq0P-5Zy.js","./loader-circle-C7mWzo52.js","./chevron-up-CVgBkTk5.js","./circle-alert-Dg3UkvRP.js","./power-DR9gpiQR.js","./pin-BU_u-xRX.js","./rocket-DMOr1OCt.js","./tags-U3lciBmd.js","./links-s3IeAkbo.js","./PolarAngleAxis-D7m1zwVk.js","./kpis-yHgME_iy.js","./kpi-tabs-Rq5jJW2Z.js","./web-BRN2mUpo.js","./select-CPSy44ld.js","./en-Bu-6PYn5.js","./filters-jiyRsLMH.js","./newsletter-CbESXhxf.js","./use-simple-pagination-ByaFwxfZ.js","./tags-DJrbEw5-.js","./virtual-list-window-S0xZxQAf.js","./list-page-CUcB5ebB.js","./comments-BHru9ZQ8.js","./filter-query-core-a0PNU2EO.js","./index-ClOB5u8L.js","./typeof-QjJsDpFa.js","./checkbox-DMamS4oG.js","./index-BTf6YUBb.js","./automations-DiGkcVt-.js","./automations-DTUfYvf6.js","./editor-D3fcjt_F.js","./editor-BZV40eAE.css","./index-Dd2BJRZH.js","./stats-view-gtyaqudG.js","./audience-0RCWjbIK.js","./use-growth-stats-Ci0gymWp.js","./index-BYwL7gFN.js","./content-helpers-BByMp-Y5.js","./index-2qcjFCQs.js","./sort-button-5fyeViQL.js","./referrers-DV_Ihg9y.js","./tiers-DXKbghdk.js","./index-DPbi4ie_.js","./newsletters-DOIL_cOY.js","./members-XkHao5Yf.js","./dropzone-DSPf3N_o.js","./onboarding-route-Dqv2nP7b.js","./settings-66Zv8QvL.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C5_ZKpC1.js","./minus-C68D81nx.js","./deleted-feed-item-DO2u3qmi.js","./trash-CUqAK3SQ.js","./topic-filter-N3CzJ01P.js","./empty-indicator-BvyaMcmw.js","./inbox-CVVAkCmd.js","./feed-D2wk4cCS.js","./hash-CJzbTA5k.js","./note-CMZjeK8e.js","./index-Cdbufdfy.js","./at-sign-DWOf36uj.js","./user-round-check-BDomHaso.js","./reply-CoNqmExw.js","./index-BLWOUf31.js","./sprout-CpwUJAPT.js","./index-DxB7NHpG.js","./pencil-BcymGPnE.js","./edit-profile-CnuBNQhO.js","./label-BiPpMny2.js","./textarea-CGBp9nOo.js","./tabs-M6kFEqPE.js","./settings-BoXzKMhL.js","./user-round-x-Cc0RL-V9.js","./copy-DVtQi_VJ.js","./index-BRBRkRqa.js","./toggle-group-GYp_w6Po.js","./square-CDrQjv8R.js","./moderation-BFrrwfvx.js","./bluesky-sharing-DVC3I9Um.js","./account-migration-DsSHanIB.js","./step-1-CH8jWKi7.js","./step-2-CWy7Qi0Q.js","./avatar-flipboard-CVf-N6wp.js","./repeat-DQay9e22.js","./step-3-CNiDFH17.js","./a-large-small-BiK5_5LV.js","./post-analytics-context-D7PgEMo8.js","./posts-BZaw4-dc.js","./post-analytics-DW-TKu-t.js","./main-layout-BYKdA6Z1.js","./post-share-modal-D0OlASBQ.js","./share-modal-CtdLQbnQ.js","./overview-CS9dmE_6.js","./growth-CPNrBpHK.js","./wallet-cards-CVZ99Nm3.js","./source-icon-Dtua85oN.js","./mail-ccQhEr7k.js","./source-utils-B1S3ZHA2.js","./pagemenu-O_y8Jm4v.js","./table-qQi9EXB1.js","./kpi-card-D3CzvsrI.js","./post-analytics-header-B8C0vA5Y.js","./get-site-timezone-BDBAcjmq.js","./post-helpers-DR3PcyZg.js","./member-route-ZLy3opLv.js","./currency-fEUUCkj0.js","./stats-Yo9Gco0_.js","./data-list-BF4GeUmt.js","./kpi-card-DV-nN7xT.js","./gh-chart-JxzKqaoO.js","./undo-2-D6ZRqONE.js","./upload-BLiT66bJ.js","./arrow-right-Bk43nMGd.js","./chart-CUKSNmKY.js","./_baseAssignValue-hdDG700N.js","./index-DYE2untj.js","./value-BGBiTkF3.js","./underline-CwuJG-Ql.js","./loader-circle-B1uEfpbZ.js","./chevron-up-DuaKtE_M.js","./circle-alert-bcK_Yqap.js","./power-DWm6pts5.js","./pin-Bl3nSr7I.js","./rocket-Dne6P_8f.js","./tags-DuMshkTz.js","./links-BY0Uo6O5.js","./PolarAngleAxis-Bh28wbPV.js","./kpis-CVwF08QL.js","./kpi-tabs-B3NkaTwb.js","./web-B_MLxGxZ.js","./select-BfWJkrKc.js","./en-CjPXRj8j.js","./filters-DtIsuqv5.js","./newsletter-n7kc6cxR.js","./use-simple-pagination-Dp2sTt2S.js","./tags-74U6lgwY.js","./virtual-list-window-BnjCoNIr.js","./list-page-COHNMpOi.js","./comments-DMea0nul.js","./filter-query-core-VEnwTCyO.js","./index-TtBMzSeP.js","./typeof-QjJsDpFa.js","./checkbox-B_yDSM8z.js","./index-Cq5vsvxE.js","./automations-CmulGWwu.js","./automations-BBWZhrha.js","./editor-CTO9FIUW.js","./editor-BZV40eAE.css","./index-AkQJUr1z.js","./stats-view-DubukX9V.js","./audience-CvP78Gug.js","./use-growth-stats-u18So4Gq.js","./index-BxFFWYdP.js","./content-helpers-B2yRzdvJ.js","./index-DR74ulj2.js","./sort-button-7pVgpa0d.js","./referrers-BsZ85Z0a.js","./tiers-D2DYHaeO.js","./index-CuGoX8Ub.js","./newsletters-CSCa3QdE.js","./members-DkpEnvG5.js","./dropzone-Cs4DrURS.js","./onboarding-route-BaX0a-pu.js","./settings-rRY210wx.js"])))=>i.map(i=>d[i]);
2
2
  function Tq(e,t){for(var o=0;o<t.length;o++){const n=t[o];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in e)){const c=Object.getOwnPropertyDescriptor(n,r);c&&Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const i of c.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function o(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function n(r){if(r.ep)return;r.ep=!0;const c=o(r);fetch(r.href,c)}})();var ea0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function VR(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var o=function n(){var r=!1;try{r=this instanceof n}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),o}var Wz={exports:{}},fc={},gz={exports:{}},q1={};var hA;function GR(){if(hA)return q1;hA=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),i=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),O=Symbol.iterator;function q(k){return k===null||typeof k!="object"?null:(k=O&&k[O]||k["@@iterator"],typeof k=="function"?k:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,g={};function v(k,H,n0){this.props=k,this.context=H,this.refs=g,this.updater=n0||h}v.prototype.isReactComponent={},v.prototype.setState=function(k,H){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,H,"setState")},v.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function w(){}w.prototype=v.prototype;function N(k,H,n0){this.props=k,this.context=H,this.refs=g,this.updater=n0||h}var x=N.prototype=new w;x.constructor=N,W(x,v.prototype),x.isPureReactComponent=!0;var R=Array.isArray,_=Object.prototype.hasOwnProperty,T={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function L(k,H,n0){var A0,s0={},q0=null,p0=null;if(H!=null)for(A0 in H.ref!==void 0&&(p0=H.ref),H.key!==void 0&&(q0=""+H.key),H)_.call(H,A0)&&!j.hasOwnProperty(A0)&&(s0[A0]=H[A0]);var e0=arguments.length-2;if(e0===1)s0.children=n0;else if(1<e0){for(var R0=Array(e0),Z0=0;Z0<e0;Z0++)R0[Z0]=arguments[Z0+2];s0.children=R0}if(k&&k.defaultProps)for(A0 in e0=k.defaultProps,e0)s0[A0]===void 0&&(s0[A0]=e0[A0]);return{$$typeof:e,type:k,key:q0,ref:p0,props:s0,_owner:T.current}}function J(k,H){return{$$typeof:e,type:k.type,key:H,ref:k.ref,props:k.props,_owner:k._owner}}function Q(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function Z(k){var H={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(n0){return H[n0]})}var t0=/\/+/g;function b0(k,H){return typeof k=="object"&&k!==null&&k.key!=null?Z(""+k.key):H.toString(36)}function O0(k,H,n0,A0,s0){var q0=typeof k;(q0==="undefined"||q0==="boolean")&&(k=null);var p0=!1;if(k===null)p0=!0;else switch(q0){case"string":case"number":p0=!0;break;case"object":switch(k.$$typeof){case e:case t:p0=!0}}if(p0)return p0=k,s0=s0(p0),k=A0===""?"."+b0(p0,0):A0,R(s0)?(n0="",k!=null&&(n0=k.replace(t0,"$&/")+"/"),O0(s0,H,n0,"",function(Z0){return Z0})):s0!=null&&(Q(s0)&&(s0=J(s0,n0+(!s0.key||p0&&p0.key===s0.key?"":(""+s0.key).replace(t0,"$&/")+"/")+k)),H.push(s0)),1;if(p0=0,A0=A0===""?".":A0+":",R(k))for(var e0=0;e0<k.length;e0++){q0=k[e0];var R0=A0+b0(q0,e0);p0+=O0(q0,H,n0,R0,s0)}else if(R0=q(k),typeof R0=="function")for(k=R0.call(k),e0=0;!(q0=k.next()).done;)q0=q0.value,R0=A0+b0(q0,e0++),p0+=O0(q0,H,n0,R0,s0);else if(q0==="object")throw H=String(k),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return p0}function M0(k,H,n0){if(k==null)return k;var A0=[],s0=0;return O0(k,A0,"","",function(q0){return H.call(n0,q0,s0++)}),A0}function Y(k){if(k._status===-1){var H=k._result;H=H(),H.then(function(n0){(k._status===0||k._status===-1)&&(k._status=1,k._result=n0)},function(n0){(k._status===0||k._status===-1)&&(k._status=2,k._result=n0)}),k._status===-1&&(k._status=0,k._result=H)}if(k._status===1)return k._result.default;throw k._result}var c0={current:null},$={transition:null},P={ReactCurrentDispatcher:c0,ReactCurrentBatchConfig:$,ReactCurrentOwner:T};function I(){throw Error("act(...) is not supported in production builds of React.")}return q1.Children={map:M0,forEach:function(k,H,n0){M0(k,function(){H.apply(this,arguments)},n0)},count:function(k){var H=0;return M0(k,function(){H++}),H},toArray:function(k){return M0(k,function(H){return H})||[]},only:function(k){if(!Q(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},q1.Component=v,q1.Fragment=o,q1.Profiler=r,q1.PureComponent=N,q1.StrictMode=n,q1.Suspense=z,q1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,q1.act=I,q1.cloneElement=function(k,H,n0){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var A0=W({},k.props),s0=k.key,q0=k.ref,p0=k._owner;if(H!=null){if(H.ref!==void 0&&(q0=H.ref,p0=T.current),H.key!==void 0&&(s0=""+H.key),k.type&&k.type.defaultProps)var e0=k.type.defaultProps;for(R0 in H)_.call(H,R0)&&!j.hasOwnProperty(R0)&&(A0[R0]=H[R0]===void 0&&e0!==void 0?e0[R0]:H[R0])}var R0=arguments.length-2;if(R0===1)A0.children=n0;else if(1<R0){e0=Array(R0);for(var Z0=0;Z0<R0;Z0++)e0[Z0]=arguments[Z0+2];A0.children=e0}return{$$typeof:e,type:k.type,key:s0,ref:q0,props:A0,_owner:p0}},q1.createContext=function(k){return k={$$typeof:i,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},k.Provider={$$typeof:c,_context:k},k.Consumer=k},q1.createElement=L,q1.createFactory=function(k){var H=L.bind(null,k);return H.type=k,H},q1.createRef=function(){return{current:null}},q1.forwardRef=function(k){return{$$typeof:b,render:k}},q1.isValidElement=Q,q1.lazy=function(k){return{$$typeof:f,_payload:{_status:-1,_result:k},_init:Y}},q1.memo=function(k,H){return{$$typeof:u,type:k,compare:H===void 0?null:H}},q1.startTransition=function(k){var H=$.transition;$.transition={};try{k()}finally{$.transition=H}},q1.unstable_act=I,q1.useCallback=function(k,H){return c0.current.useCallback(k,H)},q1.useContext=function(k){return c0.current.useContext(k)},q1.useDebugValue=function(){},q1.useDeferredValue=function(k){return c0.current.useDeferredValue(k)},q1.useEffect=function(k,H){return c0.current.useEffect(k,H)},q1.useId=function(){return c0.current.useId()},q1.useImperativeHandle=function(k,H,n0){return c0.current.useImperativeHandle(k,H,n0)},q1.useInsertionEffect=function(k,H){return c0.current.useInsertionEffect(k,H)},q1.useLayoutEffect=function(k,H){return c0.current.useLayoutEffect(k,H)},q1.useMemo=function(k,H){return c0.current.useMemo(k,H)},q1.useReducer=function(k,H,n0){return c0.current.useReducer(k,H,n0)},q1.useRef=function(k){return c0.current.useRef(k)},q1.useState=function(k){return c0.current.useState(k)},q1.useSyncExternalStore=function(k,H,n0){return c0.current.useSyncExternalStore(k,H,n0)},q1.useTransition=function(){return c0.current.useTransition()},q1.version="18.3.1",q1}var mA;function vb(){return mA||(mA=1,gz.exports=GR()),gz.exports}var WA;function QR(){if(WA)return fc;WA=1;var e=vb(),t=Symbol.for("react.element"),o=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function i(b,z,u){var f,O={},q=null,h=null;u!==void 0&&(q=""+u),z.key!==void 0&&(q=""+z.key),z.ref!==void 0&&(h=z.ref);for(f in z)n.call(z,f)&&!c.hasOwnProperty(f)&&(O[f]=z[f]);if(b&&b.defaultProps)for(f in z=b.defaultProps,z)O[f]===void 0&&(O[f]=z[f]);return{$$typeof:t,type:b,key:q,ref:h,props:O,_owner:r.current}}return fc.Fragment=o,fc.jsx=i,fc.jsxs=i,fc}var gA;function YR(){return gA||(gA=1,Wz.exports=QR()),Wz.exports}var l=YR(),p=vb();const l0=Cu(p),yb=Tq({__proto__:null,default:l0},[p]);var Hi={},vz={exports:{}},ht={},yz={exports:{}},Rz={};var vA;function KR(){return vA||(vA=1,(function(e){function t($,P){var I=$.length;$.push(P);e:for(;0<I;){var k=I-1>>>1,H=$[k];if(0<r(H,P))$[k]=P,$[I]=H,I=k;else break e}}function o($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var P=$[0],I=$.pop();if(I!==P){$[0]=I;e:for(var k=0,H=$.length,n0=H>>>1;k<n0;){var A0=2*(k+1)-1,s0=$[A0],q0=A0+1,p0=$[q0];if(0>r(s0,I))q0<H&&0>r(p0,s0)?($[k]=p0,$[q0]=I,k=q0):($[k]=s0,$[A0]=I,k=A0);else if(q0<H&&0>r(p0,I))$[k]=p0,$[q0]=I,k=q0;else break e}}return P}function r($,P){var I=$.sortIndex-P.sortIndex;return I!==0?I:$.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var i=Date,b=i.now();e.unstable_now=function(){return i.now()-b}}var z=[],u=[],f=1,O=null,q=3,h=!1,W=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x($){for(var P=o(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=$)n(u),P.sortIndex=P.expirationTime,t(z,P);else break;P=o(u)}}function R($){if(g=!1,x($),!W)if(o(z)!==null)W=!0,Y(_);else{var P=o(u);P!==null&&c0(R,P.startTime-$)}}function _($,P){W=!1,g&&(g=!1,w(L),L=-1),h=!0;var I=q;try{for(x(P),O=o(z);O!==null&&(!(O.expirationTime>P)||$&&!Z());){var k=O.callback;if(typeof k=="function"){O.callback=null,q=O.priorityLevel;var H=k(O.expirationTime<=P);P=e.unstable_now(),typeof H=="function"?O.callback=H:O===o(z)&&n(z),x(P)}else n(z);O=o(z)}if(O!==null)var n0=!0;else{var A0=o(u);A0!==null&&c0(R,A0.startTime-P),n0=!1}return n0}finally{O=null,q=I,h=!1}}var T=!1,j=null,L=-1,J=5,Q=-1;function Z(){return!(e.unstable_now()-Q<J)}function t0(){if(j!==null){var $=e.unstable_now();Q=$;var P=!0;try{P=j(!0,$)}finally{P?b0():(T=!1,j=null)}}else T=!1}var b0;if(typeof N=="function")b0=function(){N(t0)};else if(typeof MessageChannel<"u"){var O0=new MessageChannel,M0=O0.port2;O0.port1.onmessage=t0,b0=function(){M0.postMessage(null)}}else b0=function(){v(t0,0)};function Y($){j=$,T||(T=!0,b0())}function c0($,P){L=v(function(){$(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){W||h||(W=!0,Y(_))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return q},e.unstable_getFirstCallbackNode=function(){return o(z)},e.unstable_next=function($){switch(q){case 1:case 2:case 3:var P=3;break;default:P=q}var I=q;q=P;try{return $()}finally{q=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,P){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var I=q;q=$;try{return P()}finally{q=I}},e.unstable_scheduleCallback=function($,P,I){var k=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?k+I:k):I=k,$){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=I+H,$={id:f++,callback:P,priorityLevel:$,startTime:I,expirationTime:H,sortIndex:-1},I>k?($.sortIndex=I,t(u,$),o(z)===null&&$===o(u)&&(g?(w(L),L=-1):g=!0,c0(R,I-k))):($.sortIndex=H,t(z,$),W||h||(W=!0,Y(_))),$},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function($){var P=q;return function(){var I=q;q=P;try{return $.apply(this,arguments)}finally{q=I}}}})(Rz)),Rz}var yA;function ZR(){return yA||(yA=1,yz.exports=KR()),yz.exports}var RA;function JR(){if(RA)return ht;RA=1;var e=vb(),t=ZR();function o(a){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+a,M=1;M<arguments.length;M++)s+="&args[]="+encodeURIComponent(arguments[M]);return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,r={};function c(a,s){i(a,s),i(a+"Capture",s)}function i(a,s){for(r[a]=s,a=0;a<s.length;a++)n.add(s[a])}var b=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),z=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},O={};function q(a){return z.call(O,a)?!0:z.call(f,a)?!1:u.test(a)?O[a]=!0:(f[a]=!0,!1)}function h(a,s,M,d){if(M!==null&&M.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return d?!1:M!==null?!M.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function W(a,s,M,d){if(s===null||typeof s>"u"||h(a,s,M,d))return!0;if(d)return!1;if(M!==null)switch(M.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function g(a,s,M,d,A,m,y){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=d,this.attributeNamespace=A,this.mustUseProperty=M,this.propertyName=a,this.type=s,this.sanitizeURL=m,this.removeEmptyString=y}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){v[a]=new g(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var s=a[0];v[s]=new g(s,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){v[a]=new g(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){v[a]=new g(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){v[a]=new g(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){v[a]=new g(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){v[a]=new g(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){v[a]=new g(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){v[a]=new g(a,5,!1,a.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function N(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var s=a.replace(w,N);v[s]=new g(s,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var s=a.replace(w,N);v[s]=new g(s,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var s=a.replace(w,N);v[s]=new g(s,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){v[a]=new g(a,1,!1,a.toLowerCase(),null,!1,!1)}),v.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){v[a]=new g(a,1,!1,a.toLowerCase(),null,!0,!0)});function x(a,s,M,d){var A=v.hasOwnProperty(s)?v[s]:null;(A!==null?A.type!==0:d||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(W(s,M,A,d)&&(M=null),d||A===null?q(s)&&(M===null?a.removeAttribute(s):a.setAttribute(s,""+M)):A.mustUseProperty?a[A.propertyName]=M===null?A.type===3?!1:"":M:(s=A.attributeName,d=A.attributeNamespace,M===null?a.removeAttribute(s):(A=A.type,M=A===3||A===4&&M===!0?"":""+M,d?a.setAttributeNS(d,s,M):a.setAttribute(s,M))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),T=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),Q=Symbol.for("react.provider"),Z=Symbol.for("react.context"),t0=Symbol.for("react.forward_ref"),b0=Symbol.for("react.suspense"),O0=Symbol.for("react.suspense_list"),M0=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),c0=Symbol.for("react.offscreen"),$=Symbol.iterator;function P(a){return a===null||typeof a!="object"?null:(a=$&&a[$]||a["@@iterator"],typeof a=="function"?a:null)}var I=Object.assign,k;function H(a){if(k===void 0)try{throw Error()}catch(M){var s=M.stack.trim().match(/\n( *(at )?)/);k=s&&s[1]||""}return`
3
3
  `+k+a}var n0=!1;function A0(a,s){if(!a||n0)return"";n0=!0;var M=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(K){var d=K}Reflect.construct(a,[],s)}else{try{s.call()}catch(K){d=K}a.call(s.prototype)}else{try{throw Error()}catch(K){d=K}a()}}catch(K){if(K&&d&&typeof K.stack=="string"){for(var A=K.stack.split(`
4
4
  `),m=d.stack.split(`
@@ -256,7 +256,7 @@ You can add a description to the \`${pa}\` by passing a \`${av}\` component as a
256
256
 
257
257
  Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${pa}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
258
258
 
259
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},BJ=Z7,TJ=J7,PJ=ev,bv=tv,Mv=ov,lv=sv,zv=pv,uv=rv,dv=cv;const hM=Nn("inline-flex items-center justify-center gap-2 rounded-md text-sm whitespace-nowrap transition-colors focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",{variants:{variant:{default:"bg-primary font-medium text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive font-medium text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background font-medium hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary font-medium text-secondary-foreground hover:bg-secondary/80",ghost:"font-medium hover:bg-accent hover:text-accent-foreground",link:"font-medium text-primary underline-offset-4 hover:underline",dropdown:"border border-input bg-background hover:bg-accent hover:text-accent-foreground"},size:{default:"h-(--control-height) px-3 py-2",sm:"h-7 rounded-md px-3 text-xs [&_svg]:size-3",lg:"h-11 rounded-md px-8 text-md font-semibold",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),z1=p.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,children:r,...c},i)=>{const b=n?Wa:"button",z=t==="dropdown"?l.jsxs(l.Fragment,{children:[r,l.jsx(kY,{className:"-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50",strokeWidth:2})]}):r;return l.jsx(b,{ref:i,className:L0(hM({variant:t,size:o,className:e})),...c,children:z})});z1.displayName="Button";const XJ=BJ,jJ=TJ,DJ=PJ,Ov=p.forwardRef(({className:e,...t},o)=>l.jsx(bv,{className:L0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));Ov.displayName=bv.displayName;const fv=p.forwardRef(({className:e,...t},o)=>l.jsx(DJ,{children:l.jsxs("div",{className:_n,children:[l.jsx(Ov,{onClick:n=>n.stopPropagation()}),l.jsx(Mv,{ref:o,className:L0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));fv.displayName=Mv.displayName;const Av=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col space-y-2 text-center sm:text-left",e),...t});Av.displayName="AlertDialogHeader";const qv=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2 [&>button]:min-w-20",e),...t});qv.displayName="AlertDialogFooter";const hv=p.forwardRef(({className:e,...t},o)=>l.jsx(uv,{ref:o,className:L0("text-xl font-semibold",e),...t}));hv.displayName=uv.displayName;const mv=p.forwardRef(({className:e,...t},o)=>l.jsx(dv,{ref:o,className:L0("text-base",e),...t}));mv.displayName=dv.displayName;const Wv=p.forwardRef(({className:e,...t},o)=>l.jsx(lv,{ref:o,className:L0(hM(),e),...t}));Wv.displayName=lv.displayName;const gv=p.forwardRef(({className:e,...t},o)=>l.jsx(zv,{ref:o,className:L0(hM({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));gv.displayName=zv.displayName;const IJ=p.lazy(()=>d1(()=>import("./index-Bw4DM4Pr.js"),[],import.meta.url)),F6=e=>l.jsx(p.Suspense,{fallback:l.jsx("div",{}),children:l.jsx(IJ,{...e})}),ga0=e=>e.format("YYYY-MM-DD"),va0=e=>Math.round(e/100),ya0=e=>{if(!e.length)return{min:0,max:1};const t=e.map(f=>Number(f.value));let o=Math.min(...t),n=Math.max(...t);if(o===n){const f=o;return{min:Math.max(0,f-1),max:f+1}}const r=.02;o=Math.max(0,o-o*r),n=n+n*r;const c=n-o,i=Math.floor(Math.log10(c)),b=Math.pow(10,i),z=Math.round(n/b)*b;n=z<n?Math.ceil(n/b)*b:z;const u=Math.round(o/b)*b;if(o=u>o?Math.floor(o/b)*b:u,o=Math.max(0,o),o===n){const f=(o+n)/2,O=Math.max(Math.abs(f)*r,b);o=Math.max(0,Math.floor(f-O)),n=Math.ceil(f+O)}return o=Math.max(0,o),{min:o,max:n}},Ra0=(e,t)=>{if(!e.length)return 40;const o=Math.max(...e.map(r=>t(r).length));return Math.max(20,o*8+20)},La0=e=>{const t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.ceil(n/(1e3*3600*24));return Math.max(r,1)},wa0=e=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone,o=St().tz(t).endOf("day");let n;return e===-1?n=St().tz(t).startOf("year"):n=St().tz(t).subtract(e-1,"days").startOf("day"),{startDate:n,endDate:o,timezone:t}},xa0=(e,t,o="value",n="avg")=>{if(!e.length)return[];if(t>=91&&t<=356){const r=[];let c=St(e[0].date).startOf("week"),i=0,b=0,z=0;return e.forEach((u,f)=>{const O=St(u.date);O.isSame(c,"week")?(i+=Number(u[o]),b+=1,z=Number(u[o])):(r.push({...e[f-1],date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z}),c=O.startOf("week"),i=Number(u[o]),b=1,z=Number(u[o])),f===e.length-1&&r.push({...u,date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z})}),r}else if(t>356){const r=[];let c=St(e[0].date).startOf("month"),i=0,b=0,z=0;return e.forEach((u,f)=>{const O=St(u.date);O.isSame(c,"month")?(i+=Number(u[o]),b+=1,z=Number(u[o])):(r.push({...e[f-1],date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z}),c=O.startOf("month"),i=Number(u[o]),b=1,z=Number(u[o])),f===e.length-1&&r.push({...u,date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z})}),r}return e},Na0=(e,t,o=!1,n=!1)=>t===1&&n?St(e).format("h:mma"):t===1&&o?St(e).format("MMM D, h:mma"):t>365?St(e).format("MMM YYYY"):t>=91?`Week of ${C6(e)}`:C6(e),vv=e=>e.name&&e.name.trim()||e.email||"Unknown Member",FJ=e=>{const t=vv(e),o=t.split(" ");return o.length>=2?(o[0][0]+o[o.length-1][0]).toUpperCase():t.substring(0,2).toUpperCase()},yO=p.forwardRef(({className:e,...t},o)=>l.jsx(eW,{ref:o,className:L0("aspect-square h-full w-full",e),...t}));yO.displayName=eW.displayName;const mM=p.forwardRef(({className:e,...t},o)=>l.jsx(tW,{ref:o,className:L0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));mM.displayName=tW.displayName;function UJ({src:e}){const[t,o]=p.useState(!1);return p.useEffect(()=>{o(!1)},[e]),l.jsx("img",{alt:"",className:L0("absolute inset-0 h-full w-full object-cover",!t&&"invisible"),src:e,onLoad:n=>{const{naturalWidth:r,naturalHeight:c}=n.currentTarget;r>1&&c>1&&o(!0)}})}const RO=p.forwardRef(({className:e,children:t,src:o,name:n,email:r,...c},i)=>{const b={name:n||void 0,email:r||void 0},z=!!(n||r),u=z?FJ(b):null,f=z?QG(vv(b),"75","55"):void 0;return l.jsx(Jm,{ref:i,className:L0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...c,children:t??l.jsxs(l.Fragment,{children:[l.jsx(mM,{className:L0("text-xs text-muted-foreground md:text-sm [&_svg]:size-3 md:[&_svg]:size-4",z&&"font-semibold text-white"),style:z?{backgroundColor:f}:void 0,children:u??l.jsx(OM,{})}),o&&l.jsx(UJ,{src:o})]})})});RO.displayName=Jm.displayName;const HJ=Nn("inline-flex items-center rounded-xs border px-1.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:outline-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",warning:"border-transparent bg-state-warning/20 text-yellow-600",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function yv({className:e,variant:t,...o}){return l.jsx("div",{className:L0(HJ({variant:t}),e),...o})}const $J=Nn("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border-default bg-surface-panel shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-border-subtle bg-surface-elevated","shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_28%),7px_6px_42px_8px_rgb(202_103_255_/_32%)]","dark:shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_36%),7px_6px_42px_8px_rgb(202_103_255_/_38%)]","hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_38%),7px_8px_42px_10px_rgb(202_103_255_/_42%)]","dark:hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_50%),7px_8px_42px_10px_rgb(202_103_255_/_52%)]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"border border-state-info/40 bg-state-info/10",success:"border border-state-success/40 bg-state-success/10",warning:"border border-state-warning/40 bg-state-warning/10",destructive:"bg-surface-panel shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),WM=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:c,role:i="status",className:b,children:z,...u}=e,f=O=>{O.preventDefault(),O.stopPropagation(),r&&c&&c()};return l.jsxs("div",{ref:t,className:L0($J({variant:o,size:n}),b),role:i,...u,children:[r&&l.jsx(z1,{"aria-label":"Dismiss notification",className:"absolute top-1 right-1 size-8 text-text-secondary hover:text-text-primary",size:"icon",variant:"ghost",onClick:f,children:l.jsx(dO,{className:"size-5"})}),z]})});WM.displayName="Banner";const Ss=WO,Rv=gO,VJ=vO,GJ=qM,Lv=p.forwardRef(({className:e,...t},o)=>l.jsx(_s,{ref:o,className:L0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t}));Lv.displayName=_s.displayName;const ka=p.forwardRef(({className:e,children:t,...o},n)=>l.jsx(VJ,{children:l.jsxs("div",{className:_n,children:[l.jsx(Lv,{}),l.jsx(ks,{ref:n,className:L0("fixed left-[50%] top-[8vmin] z-50 grid w-full max-w-lg translate-x-[-50%] gap-6 bg-surface-overlay p-6 shadow-lg duration-200 transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg outline-hidden",e),...o,children:t})]})}));ka.displayName=ks.displayName;const gM=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col gap-y-1.5 text-center sm:text-left",e),...t});gM.displayName="DialogHeader";const vM=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2 sm:items-end [&_button]:min-w-20",e),...t});vM.displayName="DialogFooter";const yM=p.forwardRef(({className:e,...t},o)=>l.jsx(Cs,{ref:o,className:L0("text-xl font-semibold leading-none tracking-tight",e),...t}));yM.displayName=Cs.displayName;const wv=p.forwardRef(({className:e,...t},o)=>l.jsx(Es,{ref:o,className:L0("text-sm text-muted-foreground",e),...t}));wv.displayName=Es.displayName;const xv=p.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...n},r)=>l.jsx(Xh,{ref:r,className:L0("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),decorative:o,orientation:t,...n}));xv.displayName=Xh.displayName;var a3,RM="HoverCard",[Nv]=ro(RM,[Rr]),LM=Rr(),[QJ,wM]=Nv(RM),_v=e=>{const{__scopeHoverCard:t,children:o,open:n,defaultOpen:r,onOpenChange:c,openDelay:i=700,closeDelay:b=300}=e,z=LM(t),u=p.useRef(0),f=p.useRef(0),O=p.useRef(!1),q=p.useRef(!1),[h,W]=s2({prop:n,defaultProp:r??!1,onChange:c,caller:RM}),g=p.useCallback(()=>{clearTimeout(f.current),u.current=window.setTimeout(()=>W(!0),i)},[i,W]),v=p.useCallback(()=>{clearTimeout(u.current),!O.current&&!q.current&&(f.current=window.setTimeout(()=>W(!1),b))},[b,W]),w=p.useCallback(()=>W(!1),[W]);return p.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(f.current)},[]),l.jsx(QJ,{scope:t,open:h,onOpenChange:W,onOpen:g,onClose:v,onDismiss:w,hasSelectionRef:O,isPointerDownOnContentRef:q,children:l.jsx(jb,{...z,children:o})})};_v.displayName=RM;var kv="HoverCardTrigger",Cv=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=wM(kv,o),c=LM(o);return l.jsx(zs,{asChild:!0,...c,children:l.jsx(L1.a,{"data-state":r.open?"open":"closed",...n,ref:t,onPointerEnter:T0(e.onPointerEnter,db(r.onOpen)),onPointerLeave:T0(e.onPointerLeave,db(r.onClose)),onFocus:T0(e.onFocus,r.onOpen),onBlur:T0(e.onBlur,r.onClose),onTouchStart:T0(e.onTouchStart,i=>i.preventDefault())})})});Cv.displayName=kv;var LO="HoverCardPortal",[YJ,KJ]=Nv(LO,{forceMount:void 0}),Ev=e=>{const{__scopeHoverCard:t,forceMount:o,children:n,container:r}=e,c=wM(LO,t);return l.jsx(YJ,{scope:t,forceMount:o,children:l.jsx(yt,{present:o||c.open,children:l.jsx(Ra,{asChild:!0,container:r,children:n})})})};Ev.displayName=LO;var ub="HoverCardContent",Sv=p.forwardRef((e,t)=>{const o=KJ(ub,e.__scopeHoverCard),{forceMount:n=o.forceMount,...r}=e,c=wM(ub,e.__scopeHoverCard);return l.jsx(yt,{present:n||c.open,children:l.jsx(ZJ,{"data-state":c.open?"open":"closed",...r,onPointerEnter:T0(e.onPointerEnter,db(c.onOpen)),onPointerLeave:T0(e.onPointerLeave,db(c.onClose)),ref:t})})});Sv.displayName=ub;var ZJ=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:i,...b}=e,z=wM(ub,o),u=LM(o),f=p.useRef(null),O=T1(t,f),[q,h]=p.useState(!1);return p.useEffect(()=>{if(q){const W=document.body;return a3=W.style.userSelect||W.style.webkitUserSelect,W.style.userSelect="none",W.style.webkitUserSelect="none",()=>{W.style.userSelect=a3,W.style.webkitUserSelect=a3}}},[q]),p.useEffect(()=>{if(f.current){const W=()=>{h(!1),z.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(z.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",W),()=>{document.removeEventListener("pointerup",W),z.hasSelectionRef.current=!1,z.isPointerDownOnContentRef.current=!1}}},[z.isPointerDownOnContentRef,z.hasSelectionRef]),p.useEffect(()=>{f.current&&t00(f.current).forEach(g=>g.setAttribute("tabindex","-1"))}),l.jsx(ya,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:T0(c,W=>{W.preventDefault()}),onDismiss:z.onDismiss,children:l.jsx(Db,{...u,...b,onPointerDown:T0(b.onPointerDown,W=>{W.currentTarget.contains(W.target)&&h(!0),z.hasSelectionRef.current=!1,z.isPointerDownOnContentRef.current=!0}),ref:O,style:{...b.style,userSelect:q?"text":void 0,WebkitUserSelect:q?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),JJ="HoverCardArrow",e00=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=LM(o);return l.jsx(Ib,{...r,...n,ref:t})});e00.displayName=JJ;function db(e){return t=>t.pointerType==="touch"?void 0:e()}function t00(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;o.nextNode();)t.push(o.currentNode);return t}var o00=_v,n00=Cv,r00=Ev,Bv=Sv;const a00=o00,c00=n00,Tv=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>l.jsx(r00,{children:l.jsx("div",{className:_n,children:l.jsx(Bv,{ref:r,align:t,className:L0("pointer-events-auto z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-hover-card-content-transform-origin)",e),sideOffset:o,...n})})}));Tv.displayName=Bv.displayName;const s00=Nn("rounded-full",{variants:{variant:{neutral:"bg-muted",info:"bg-state-info",success:"bg-state-success",error:"bg-state-danger",warning:"bg-state-warning"},state:{idle:"",active:"animate-pulse",inactive:"border-2 bg-transparent"},size:{sm:"size-2",md:"size-3",lg:"size-4"}},compoundVariants:[{variant:"neutral",state:"inactive",className:"border-muted-foreground"},{variant:"info",state:"inactive",className:"border-state-info"},{variant:"success",state:"inactive",className:"border-state-success"},{variant:"error",state:"inactive",className:"border-state-danger"},{variant:"warning",state:"inactive",className:"border-state-warning"}],defaultVariants:{variant:"success",state:"idle",size:"sm"}});function U6({className:e,variant:t,state:o,size:n,label:r,...c}){return l.jsxs("span",{className:"inline-flex items-center",...c,children:[l.jsx("span",{"aria-hidden":"true",className:L0(s00({variant:t,state:o,size:n}),e)}),r&&l.jsx("span",{className:"sr-only",children:r})]})}const Hr={base:"rounded-md border border-border-default bg-surface-elevated transition-colors",focusSelf:"focus-visible:outline-hidden focus-visible:bg-transparent focus-visible:border-focus-ring focus-visible:ring-2 focus-visible:ring-focus-ring/25",focusWithin:"has-[:focus-visible]:outline-hidden has-[:focus-visible]:bg-transparent has-[:focus-visible]:border-focus-ring has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus-ring/25",invalidSelf:"aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/20 dark:aria-[invalid=true]:ring-destructive/40",invalidWithin:"has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 dark:has-[[aria-invalid=true]]:ring-destructive/40",disabledSelf:"disabled:cursor-not-allowed disabled:opacity-50"};function i00(e="self"){return e==="self"?L0(Hr.base,Hr.focusSelf,Hr.invalidSelf,Hr.disabledSelf):L0(Hr.base,Hr.focusWithin,Hr.invalidWithin)}const xM=p.forwardRef(({className:e,type:t,...o},n)=>l.jsx("input",{ref:n,className:L0(i00("self"),"flex h-9 w-full px-3 py-1 text-base file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground",e),type:t,...o}));xM.displayName="Input";function p00({className:e,...t}){return l.jsx("kbd",{className:L0("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-xs px-1 font-sans text-xs font-medium m-0 shadow-none border-none text-shadow-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e),"data-slot":"kbd",...t})}function F1({containerClassName:e,count:t=1,randomize:o=!1,minWidth:n=70,maxWidth:r=100,className:c,...i}){const{randomWidths:b,keys:z}=p.useMemo(()=>{const u=[],f=[];for(let O=0;O<t;O++){if(o){const q=Math.floor((r-n)/5),h=Math.floor(Math.random()*(q+1)),W=n+h*5;u.push(`${W}%`)}f.push(`skeleton-${O}`)}return{randomWidths:u,keys:f}},[t,o,n,r]);return l.jsx("span",{className:e,children:Array.from({length:t}).map((u,f)=>l.jsxs(l0.Fragment,{children:[l.jsx("span",{className:L0("inline-flex w-full leading-none animate-pulse rounded-[2px] bg-primary/10",c),style:o?{width:b[f]}:void 0,...i,children:"‌"}),l.jsx("br",{})]},z[f]))})}const b00=l0.forwardRef(({className:e,lines:t=5,...o},n)=>t<1?l.jsx(l.Fragment,{}):l.jsx("div",{ref:n,className:L0("flex flex-col gap-2",e),...o,children:Array.from({length:t},(r,c)=>{let i="66%";switch(c%5){case 0:i="57%";break;case 1:i="33%";break;case 2:i="40%";break;case 3:i="48%";break;case 4:i="24%";break}return l.jsxs("div",{className:"flex justify-between gap-6",children:[l.jsx("div",{className:"grow",style:{maxWidth:i},children:l.jsx(F1,{})}),l.jsx(F1,{className:"w-[60px] self-end"})]},c)})}));b00.displayName="SkeletonTable";const Ob=({size:e="md",color:t="dark",className:o=""})=>{let n="relative mx-0 my-[-0.5] box-border inline-block animate-spin rounded-full before:z-10 before:block before:rounded-full before:content-['']";switch(e){case"sm":n+=" h-[16px] w-[16px] border-2 before:mt-[10px] before:h-[3px] before:w-[3px]";break;case"md":n+=" h-[20px] w-[20px] border-2 before:mt-[13px] before:h-[3px] before:w-[3px]";break;default:n+=" h-[50px] w-[50px] border before:mt-[7px] before:h-[7px] before:w-[7px]";break}return t==="light"?n+=" border-white/20 before:bg-white dark:border-black/10 dark:before:bg-black":n+=" border-black/10 before:bg-black dark:border-white/20 dark:before:bg-white",l.jsx("div",{className:`${n} ${o}`})},_a0=()=>l.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:l.jsx("div",{className:"flex size-20 items-center justify-center rounded-full",children:l.jsxs("div",{className:"-mt-1.5 flex items-end gap-2",children:[l.jsx(F1,{className:"h-10 w-3"}),l.jsx(F1,{className:"h-14 w-3"}),l.jsx(F1,{className:"h-6 w-3"})]})})}),M00=({className:e="",children:t})=>l.jsx("div",{className:`my-10 flex flex-col items-center gap-1 text-sm text-text-secondary ${e}`,children:t}),l00=({className:e="",children:t})=>l.jsx("div",{className:`text-text-tertiary [&>svg]:size-8 [&>svg]:stroke-[1px] ${e}`,children:t}),z00=({open:e,defaultOpen:t,onOpenChange:o,children:n,...r})=>{const c=e!==void 0,[i,b]=p.useState(t??!1),z=c?e:i,u=p.useCallback(O=>{c||b(O),o?.(O)},[c,o]),f=p.useRef(u);return p.useEffect(()=>{f.current=u},[u]),p.useEffect(()=>{if(!z)return;const O=q=>{q.key==="Escape"&&(q.preventDefault(),q.stopPropagation(),f.current(!1))};return document.addEventListener("keydown",O,{capture:!0}),()=>document.removeEventListener("keydown",O,{capture:!0})},[z]),l.jsx(Vj,{...r,open:z,onOpenChange:u,children:n})},u00=Gj,c3=Yj,Pv=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>l.jsx(Qj,{children:l.jsx("div",{className:_n,children:l.jsx(WW,{ref:r,align:t,className:L0("z-50 rounded-md bg-surface-overlay p-5 text-popover-foreground shadow-md border outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)",e),sideOffset:o,...n})})}));Pv.displayName=WW.displayName;const d00=WO,ka0=gO,O00=vO,Xv=p.forwardRef(({className:e,...t},o)=>l.jsx(_s,{className:L0("fixed inset-0 z-50 bg-black/10 data-[state=open]:animate-in duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));Xv.displayName=_s.displayName;const f00=Nn("fixed z-50 gap-4 bg-background p-8 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jv=p.forwardRef(({side:e="right",className:t,children:o,...n},r)=>l.jsx(O00,{children:l.jsxs("div",{className:_n,children:[l.jsx(Xv,{}),l.jsxs(ks,{ref:r,className:L0(f00({side:e}),t),...n,children:[l.jsxs(qM,{className:"fixed top-4 right-4 z-50 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(dO,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),o]})]})}));jv.displayName=ks.displayName;const A00=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col space-y-1 text-center sm:text-left",e),...t});A00.displayName="SheetHeader";const q00=p.forwardRef(({className:e,...t},o)=>l.jsx(Cs,{ref:o,className:L0("text-xl font-semibold text-foreground",e),...t}));q00.displayName=Cs.displayName;const h00=p.forwardRef(({className:e,...t},o)=>l.jsx(Es,{ref:o,className:L0("text-sm text-muted-foreground",e),...t}));h00.displayName=Es.displayName;const Dv=801;function s3(){return window.innerWidth<Dv}function m00(){const[e,t]=p.useState(s3());return p.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Dv-1}px)`),n=()=>{t(s3())};return o.addEventListener("change",n),t(s3()),()=>o.removeEventListener("change",n)},[]),e}const W00=TX,g00=PX,v00=XX,Iv=p.forwardRef(({className:e,sideOffset:t=4,...o},n)=>l.jsx(jX,{children:l.jsx("div",{className:_n,children:l.jsx($m,{ref:n,className:L0("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:t,...o})})}));Iv.displayName=$m.displayName;const y00="sidebar:state",R00=3600*24*7,L00="30rem",w00="28rem",x00="4rem",N00="b",NM="(--control-height)",Fv=p.createContext(null);function u2(){const e=p.useContext(Fv);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Uv=p.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:o,className:n,style:r,children:c,...i},b)=>{const z=m00(),[u,f]=p.useState(!1),[O,q]=p.useState(e),h=t??O,W=p.useCallback(N=>{const x=typeof N=="function"?N(h):N;o?o(x):q(x),document.cookie=`${y00}=${x}; path=/; max-age=${R00}`},[o,h]),g=p.useCallback(()=>z?f(N=>!N):W(N=>!N),[z,W,f]);p.useEffect(()=>{const N=x=>{x.key===N00&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[g]);const v=h?"expanded":"collapsed",w=p.useMemo(()=>({state:v,open:h,setOpen:W,isMobile:z,openMobile:u,setOpenMobile:f,toggleSidebar:g}),[v,h,W,z,u,f,g]);return l.jsx(Fv.Provider,{value:w,children:l.jsx(W00,{delayDuration:0,children:l.jsx("div",{ref:b,className:L0("group/sidebar-wrapper relative flex h-full w-full has-[[data-variant=inset]]:bg-sidebar",n),style:{"--sidebar-width":L00,"--sidebar-width-icon":x00,...r},...i,children:c})})})});Uv.displayName="SidebarProvider";const Hv=p.forwardRef(({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:n,children:r,...c},i)=>{const{isMobile:b,state:z,openMobile:u,setOpenMobile:f}=u2();return o==="none"?l.jsx("div",{ref:i,className:L0("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),role:"navigation",...c,children:r}):b?l.jsx(d00,{open:u,onOpenChange:f,...c,children:l.jsx(jv,{className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",role:"navigation",side:e,style:{"--sidebar-width":w00},children:l.jsx("div",{className:"flex size-full flex-col",children:r})})}):l.jsxs("div",{ref:i,className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":z==="collapsed"?o:"","data-side":e,"data-state":z,"data-variant":t,role:"navigation",children:[l.jsx("div",{className:L0("relative h-full w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1.6rem)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{className:L0("absolute inset-y-0 z-10 hidden h-full w-(--sidebar-width) md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1.6rem_+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) border-sidebar-border group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...c,children:l.jsx("div",{className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:r})})]})});Hv.displayName="Sidebar";const $v=p.forwardRef(({children:e,className:t,onClick:o,...n},r)=>{const{toggleSidebar:c}=u2();return l.jsx(z1,{ref:r,className:L0("h-7 w-7",t),"data-sidebar":"trigger",size:"icon",variant:"ghost",onClick:i=>{o?.(i),c()},...n,children:e||l.jsxs(l.Fragment,{children:[l.jsx(yK,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})});$v.displayName="SidebarTrigger";const _00=p.forwardRef(({className:e,...t},o)=>{const{toggleSidebar:n}=u2();return l.jsx("button",{ref:o,"aria-label":"Toggle Sidebar",className:L0("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),"data-sidebar":"rail",tabIndex:-1,title:"Toggle Sidebar",type:"button",onClick:n,...t})});_00.displayName="SidebarRail";const Vv=p.forwardRef(({className:e,...t},o)=>l.jsx("main",{ref:o,className:L0("relative flex h-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Vv.displayName="SidebarInset";const k00=p.forwardRef(({className:e,...t},o)=>l.jsx(xM,{ref:o,className:L0("w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",`h-${NM}`,e),"data-sidebar":"input",...t}));k00.displayName="SidebarInput";const Gv=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("flex flex-col gap-2 p-2",e),"data-sidebar":"header",...t}));Gv.displayName="SidebarHeader";const Qv=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("flex flex-col gap-2 p-2",e),"data-sidebar":"footer",...t}));Qv.displayName="SidebarFooter";const C00=p.forwardRef(({className:e,...t},o)=>l.jsx(xv,{ref:o,className:L0("mx-2 w-auto bg-sidebar-border",e),"data-sidebar":"separator",...t}));C00.displayName="SidebarSeparator";const Yv=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("flex min-h-0 flex-1 flex-col gap-4 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content",...t}));Yv.displayName="SidebarContent";const Ca=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group",...t}));Ca.displayName="SidebarGroup";const E00=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Wa:"div";return l.jsx(r,{ref:n,className:L0("duration-200 flex shrink-0 items-center rounded-md px-3 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-all ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",`h-${NM}`,e),"data-sidebar":"group-label",...o})});E00.displayName="SidebarGroupLabel";const S00=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Wa:"button";return l.jsx(r,{ref:n,className:L0("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"group-action",...o})});S00.displayName="SidebarGroupAction";const Bs=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("w-full text-sm",e),"data-sidebar":"group-content",...t}));Bs.displayName="SidebarGroupContent";const Ea=p.forwardRef(({className:e,...t},o)=>l.jsx("ul",{ref:o,className:L0("flex w-full min-w-0 flex-col gap-0.5",e),"data-sidebar":"menu",...t}));Ea.displayName="SidebarMenu";const wO=p.forwardRef(({className:e,...t},o)=>l.jsx("li",{ref:o,className:L0("group/menu-item relative",e),"data-sidebar":"menu-item",...t}));wO.displayName="SidebarMenuItem";const B00=Nn("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-md font-medium text-sidebar-foreground ring-sidebar-ring outline-hidden transition-all group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"border border-sidebar-border bg-background hover:border-sidebar-accent hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"},size:{default:`h-${NM} text-md`,sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),_M=p.forwardRef(({asChild:e=!1,isActive:t=!1,variant:o="default",size:n="default",tooltip:r,className:c,...i},b)=>{const z=e?Wa:"button",{isMobile:u,state:f}=u2(),O=l.jsx(z,{ref:b,className:L0(B00({variant:o,size:n}),c),"data-active":t,"data-sidebar":"menu-button","data-size":n,...i});return r?(typeof r=="string"&&(r={children:r}),l.jsxs(g00,{children:[l.jsx(v00,{asChild:!0,children:O}),l.jsx(Iv,{align:"center",hidden:f!=="collapsed"||u,side:"right",...r})]})):O});_M.displayName="SidebarMenuButton";const T00=p.forwardRef(({className:e,asChild:t=!1,showOnHover:o=!1,...n},r)=>{const c=t?Wa:"button";return l.jsx(c,{ref:r,className:L0("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",o&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),"data-sidebar":"menu-action",...n})});T00.displayName="SidebarMenuAction";const xO=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("absolute right-2 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-sm font-medium tabular-nums text-text-secondary select-none pointer-events-none","peer-hover/menu-button: peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=default]/menu-button:top-2","peer-data-[size=lg]/menu-button:top-3","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-badge",...t}));xO.displayName="SidebarMenuBadge";const P00=p.forwardRef(({className:e,showIcon:t=!1,...o},n)=>{const r=p.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{ref:n,className:L0("rounded-md flex gap-2 px-3 items-center",`h-${NM}`,e),"data-sidebar":"menu-skeleton",...o,children:[t&&l.jsx(F1,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(F1,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});P00.displayName="SidebarMenuSkeleton";const X00=p.forwardRef(({className:e,...t},o)=>l.jsx("ul",{ref:o,className:L0("mx-3.5 flex min-w-0 translate-x-px flex-col gap-0.5 border-l border-sidebar-border px-3 py-0.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-sub",...t}));X00.displayName="SidebarMenuSub";const j00=p.forwardRef(({...e},t)=>l.jsx("li",{ref:t,...e}));j00.displayName="SidebarMenuSubItem";const D00=p.forwardRef(({asChild:e=!1,size:t="md",isActive:o,className:n,...r},c)=>{const i=e?Wa:"a";return l.jsx(i,{ref:c,className:L0("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-3 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),"data-active":o,"data-sidebar":"menu-sub-button","data-size":t,...r})});D00.displayName="SidebarMenuSubButton";const I00=Nn("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-5 w-9",sm:"h-4 w-7"}},defaultVariants:{size:"default"}}),F00=Nn("pointer-events-none block rounded-full bg-background ring-0 [filter:drop-shadow(0_1px_2px_rgba(0,0,0,0.07))] transition-transform data-[state=unchecked]:translate-x-0",{variants:{size:{default:"size-4 data-[state=checked]:translate-x-4",sm:"size-3 data-[state=checked]:translate-x-3"}},defaultVariants:{size:"default"}}),Kv=p.forwardRef(({className:e,size:t,...o},n)=>l.jsx(gm,{className:L0(I00({size:t,className:e})),...o,ref:n,children:l.jsx(FP,{className:L0(F00({size:t}))})}));Kv.displayName=gm.displayName;const Ts=vW,Ca0=LW({dataType:Ts,path:"/users/",defaultSearchParams:{limit:"100",include:"roles"},defaultNextPageParams:(e,t)=>({...t,page:(e.meta?.pagination.next||1).toString()}),returnData:e=>{const{pages:t}=e,o=t.flatMap(r=>r.users),n=t[t.length-1].meta;return{users:o,meta:n,isEnd:n?n.pagination.pages===n.pagination.page:!0}}}),Ea0=uD({dataType:Ts,path:e=>`/users/slug/${e}/`,defaultSearchParams:{include:"roles"}}),Zv=Xe({method:"PUT",path:e=>`/users/${e.id}/`,body:e=>({users:[e]}),searchParams:()=>({include:"roles"}),updateQueries:{dataType:Ts,emberUpdateType:"createOrUpdate",update:wW("users")}}),Sa0=Xe({method:"DELETE",path:e=>`/users/${e}/`,updateQueries:{dataType:Ts,emberUpdateType:"delete",update:mD("users")}}),Ba0=Xe({method:"PUT",path:()=>"/users/password/",body:({newPassword:e,confirmNewPassword:t,userId:o,oldPassword:n})=>({password:[{user_id:o,oldPassword:n||"",newPassword:e,ne2Password:t}]})}),Ta0=Xe({method:"PUT",path:()=>"/users/owner/",body:e=>({owner:[{id:e}]}),updateQueries:{dataType:Ts,emberUpdateType:"createOrUpdate",update:wW("users")}});function Sa(e){return e.roles.some(t=>t.name==="Owner")}function kM(e){return e.roles.some(t=>t.name==="Administrator")}function Jv(e){return e.roles.some(o=>o.name==="Editor")||e.roles.some(o=>o.name==="Super Editor")}function U00(e){return e.roles.some(t=>t.name==="Super Editor")}function H00(e){return e.roles.some(t=>t.name==="Author")}function Ps(e){return e.roles.some(t=>t.name==="Contributor")}function Pa0(e){return H00(e)||Ps(e)}function $00(e){return Sa(e)||kM(e)||Jv(e)}function e9(e){return Sa(e)||kM(e)||U00(e)}function V00(e){return Sa(e)||kM(e)||Jv(e)}function G00(e){return Sa(e)||kM(e)}const fa="SettingsResponseType",Ba=Yo({dataType:fa,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore,transistor"}}),Xa0=Xe({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:fa,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==fa}}}}),ja0=Xe({method:"POST",path:()=>"/settings/access_code/regenerate/",updateQueries:{dataType:fa,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==fa}}}}),Da0=Xe({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:fa}}),Ia0=Xe({method:"POST",path:()=>"/slack/test/"});function Fa0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function Ua0(e,t){return t.map(o=>e?.find(n=>n.key===o)?.value)}function Ao(e,t){return e&&e.find(n=>n.key===t)?.value||null}function Ha0(e,t){return e?e.find(n=>n.key===t)?.is_read_only||!1:void 0}function $a0(e,t){const o=c=>e.some(i=>i.key===c&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}const Q00="SiteResponseType",CM=Yo({dataType:Q00,path:"/site/"});function Va0(e){const t=new URL(e.url),o=t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`;return`${t.origin}${o}`}function Y00(e,t){if(sJ(t)&&iJ(t))return pJ(t)||"";const o=new URL(e.url).hostname||"";return o.startsWith("www.")?o.replace(/^(www)\.(?=[^/]*\..{2,5})/,""):o}function Ga0(e,t,o){const n=Y00(t,o);return e==="noreply"?`noreply@${n}`:e}const du=navigator.userAgent.indexOf("Mac")!==-1?"command":"ctrl",K00=du==="command"?"⌘K":"Ctrl+K",Z00=e=>{e.preventDefault();const t=new KeyboardEvent("keydown",{key:"k",keyCode:75,metaKey:du==="command",ctrlKey:du==="ctrl"});document.dispatchEvent(t)};function J00({...e}){const{data:t}=me(),o=CM(),n=Ba(),r=o.data?.site.title??"",c=o.data?.site.icon??"https://static.ghost.org/v4.0.0/images/ghost-orb-1.png",i=Ao(n.data?.settings,"is_private")??!1,b=t&&!Ps(t);return l.jsx(Gv,{...e,children:l.jsxs("div",{className:"flex flex-col items-stretch gap-6",children:[l.jsx("div",{className:"flex items-center justify-between",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx("div",{className:"h-8 w-8 flex-shrink-0 rounded-md border-0 bg-transparent",children:l.jsx("img",{src:c,alt:"Site icon",className:"h-full w-full rounded-md object-cover"})}),l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[l.jsx("div",{className:"min-w-0 overflow-hidden text-[15px] font-semibold text-ellipsis whitespace-nowrap text-foreground",children:r}),i&&l.jsx("a",{"aria-label":"Open access settings",className:"shrink-0",href:"#/settings/members",children:l.jsxs(yv,{className:"gap-1 border-transparent bg-orange-100 px-1.5 py-0 text-[11px] leading-5 font-semibold text-orange-700 transition-colors hover:bg-orange-200 dark:bg-orange-500/20 dark:text-orange-300 dark:hover:bg-orange-500/30",variant:"secondary",children:[l.jsx(bK,{className:"size-3",strokeWidth:2.25}),"Private"]})})]})]})}),b&&l.jsxs(z1,{variant:"outline",className:"flex h-[38px] items-center justify-between pr-2 text-base text-muted-foreground shadow-xs hover:border-gray-200 hover:bg-background hover:text-gray-700 hover:shadow-sm dark:bg-gray-950 dark:hover:border-gray-800 [&_svg]:stroke-2",onClick:Z00,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(zO,{className:"text-muted-foreground"}),"Search site"]}),l.jsx(p00,{className:"bg-transparent text-gray-500 shadow-none dark:text-gray-800",style:{textShadow:"none"},children:K00})]})]})})}function i0(e,t,o){function n(b,z){var u;Object.defineProperty(b,"_zod",{value:b._zod??{},enumerable:!1}),(u=b._zod).traits??(u.traits=new Set),b._zod.traits.add(e),t(b,z);for(const f in i.prototype)f in b||Object.defineProperty(b,f,{value:i.prototype[f].bind(b)});b._zod.constr=i,b._zod.def=z}const r=o?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function i(b){var z;const u=o?.Parent?new c:this;n(u,b),(z=u._zod).deferred??(z.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:b=>o?.Parent&&b instanceof o.Parent?!0:b?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class ba extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class t9 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const o9={};function Wr(e){return o9}function e10(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function Ou(e,t){return typeof t=="bigint"?t.toString():t}function NO(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function _O(e){return e==null}function kO(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}const H6=Symbol("evaluating");function E1(e,t,o){let n;Object.defineProperty(e,t,{get(){if(n!==H6)return n===void 0&&(n=H6,n=o()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function d2(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function O2(...e){const t={};for(const o of e){const n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function $6(e){return JSON.stringify(e)}const n9="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const t10=NO(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Aa(e){if(fb(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const o=t.prototype;return!(fb(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function r9(e){return Aa(e)?{...e}:Array.isArray(e)?[...e]:e}const o10=new Set(["string","number","symbol"]);function qa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xr(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function K0(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function n10(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function r10(e,t){const o=e._zod.def,n=O2(e._zod.def,{get shape(){const r={};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(r[c]=o.shape[c])}return d2(this,"shape",r),r},checks:[]});return xr(e,n)}function a10(e,t){const o=e._zod.def,n=O2(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete r[c]}return d2(this,"shape",r),r},checks:[]});return xr(e,n)}function c10(e,t){if(!Aa(t))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=O2(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return d2(this,"shape",c),c},checks:[]});return xr(e,r)}function s10(e,t){if(!Aa(t))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return d2(this,"shape",n),n},checks:e._zod.def.checks};return xr(e,o)}function i10(e,t){const o=O2(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return d2(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return xr(e,o)}function p10(e,t,o){const n=O2(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(o)for(const i in o){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(c[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)c[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return d2(this,"shape",c),c},checks:[]});return xr(t,n)}function b10(e,t,o){const n=O2(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(o)for(const i in o){if(!(i in c))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(c[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)c[i]=new e({type:"nonoptional",innerType:r[i]});return d2(this,"shape",c),c},checks:[]});return xr(t,n)}function ea(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function ta(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function zp(e){return typeof e=="string"?e:e?.message}function gr(e,t,o){const n={...e,path:e.path??[]};if(!e.message){const r=zp(e.inst?._zod.def?.error?.(e))??zp(t?.error?.(e))??zp(o.customError?.(e))??zp(o.localeError?.(e))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function CO(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ts(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const a9=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ou,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},c9=i0("$ZodError",a9),EM=i0("$ZodError",a9,{Parent:Error});function M10(e,t=o=>o.message){const o={},n=[];for(const r of e.issues)r.path.length>0?(o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:o}}function l10(e,t=o=>o.message){const o={_errors:[]},n=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(i=>n({issues:i}));else if(c.code==="invalid_key")n({issues:c.issues});else if(c.code==="invalid_element")n({issues:c.issues});else if(c.path.length===0)o._errors.push(t(c));else{let i=o,b=0;for(;b<c.path.length;){const z=c.path[b];b===c.path.length-1?(i[z]=i[z]||{_errors:[]},i[z]._errors.push(t(c))):i[z]=i[z]||{_errors:[]},i=i[z],b++}}};return n(e),o}const SM=e=>(t,o,n,r)=>{const c=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:o,issues:[]},c);if(i instanceof Promise)throw new ba;if(i.issues.length){const b=new(r?.Err??e)(i.issues.map(z=>gr(z,c,Wr())));throw n9(b,r?.callee),b}return i.value},Qa0=SM(EM),BM=e=>async(t,o,n,r)=>{const c=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:o,issues:[]},c);if(i instanceof Promise&&(i=await i),i.issues.length){const b=new(r?.Err??e)(i.issues.map(z=>gr(z,c,Wr())));throw n9(b,r?.callee),b}return i.value},Ya0=BM(EM),TM=e=>(t,o,n)=>{const r=n?{...n,async:!1}:{async:!1},c=t._zod.run({value:o,issues:[]},r);if(c instanceof Promise)throw new ba;return c.issues.length?{success:!1,error:new(e??c9)(c.issues.map(i=>gr(i,r,Wr())))}:{success:!0,data:c.value}},z10=TM(EM),PM=e=>async(t,o,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let c=t._zod.run({value:o,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(i=>gr(i,r,Wr())))}:{success:!0,data:c.value}},u10=PM(EM),d10=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return SM(e)(t,o,r)},O10=e=>(t,o,n)=>SM(e)(t,o,n),f10=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return BM(e)(t,o,r)},A10=e=>async(t,o,n)=>BM(e)(t,o,n),q10=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return TM(e)(t,o,r)},h10=e=>(t,o,n)=>TM(e)(t,o,n),m10=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return PM(e)(t,o,r)},W10=e=>async(t,o,n)=>PM(e)(t,o,n),g10=/^[cC][^\s-]{8,}$/,v10=/^[0-9a-z]+$/,y10=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,R10=/^[0-9a-vA-V]{20}$/,L10=/^[A-Za-z0-9]{27}$/,w10=/^[a-zA-Z0-9_-]{21}$/,x10=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,N10=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,V6=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_10=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,k10="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function C10(){return new RegExp(k10,"u")}const E10=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S10=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,B10=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,T10=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P10=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s9=/^[A-Za-z0-9_-]*$/,X10=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,j10=/^\+(?:[0-9]){6,14}[0-9]$/,i9="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",D10=new RegExp(`^${i9}$`);function p9(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function I10(e){return new RegExp(`^${p9(e)}$`)}function F10(e){const t=p9({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${i9}T(?:${n})$`)}const U10=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},H10=/^(?:true|false)$/i,$10=/^[^A-Z]*$/,V10=/^[^a-z]*$/,io=i0("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),b9={number:"number",bigint:"bigint",object:"date"},G10=i0("$ZodCheckLessThan",(e,t)=>{io.init(e,t);const o=b9[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:o,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Q10=i0("$ZodCheckGreaterThan",(e,t)=>{io.init(e,t);const o=b9[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:o,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Y10=i0("$ZodCheckMaxLength",(e,t)=>{var o;io.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!_O(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=CO(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),K10=i0("$ZodCheckMinLength",(e,t)=>{var o;io.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!_O(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=CO(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Z10=i0("$ZodCheckLengthEquals",(e,t)=>{var o;io.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!_O(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=n=>{const r=n.value,c=r.length;if(c===t.length)return;const i=CO(r),b=c>t.length;n.issues.push({origin:i,...b?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),XM=i0("$ZodCheckStringFormat",(e,t)=>{var o,n;io.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),J10=i0("$ZodCheckRegex",(e,t)=>{XM.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ee0=i0("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$10),XM.init(e,t)}),te0=i0("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=V10),XM.init(e,t)}),oe0=i0("$ZodCheckIncludes",(e,t)=>{io.init(e,t);const o=qa(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),ne0=i0("$ZodCheckStartsWith",(e,t)=>{io.init(e,t);const o=new RegExp(`^${qa(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),re0=i0("$ZodCheckEndsWith",(e,t)=>{io.init(e,t);const o=new RegExp(`.*${qa(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ae0=i0("$ZodCheckOverwrite",(e,t)=>{io.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class ce0{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
259
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},BJ=Z7,TJ=J7,PJ=ev,bv=tv,Mv=ov,lv=sv,zv=pv,uv=rv,dv=cv;const hM=Nn("inline-flex items-center justify-center gap-2 rounded-md text-sm whitespace-nowrap transition-colors focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",{variants:{variant:{default:"bg-primary font-medium text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive font-medium text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background font-medium hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary font-medium text-secondary-foreground hover:bg-secondary/80",ghost:"font-medium hover:bg-accent hover:text-accent-foreground",link:"font-medium text-primary underline-offset-4 hover:underline",dropdown:"border border-input bg-background hover:bg-accent hover:text-accent-foreground"},size:{default:"h-(--control-height) px-3 py-2",sm:"h-7 rounded-md px-3 text-xs [&_svg]:size-3",lg:"h-11 rounded-md px-8 text-md font-semibold",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),z1=p.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,children:r,...c},i)=>{const b=n?Wa:"button",z=t==="dropdown"?l.jsxs(l.Fragment,{children:[r,l.jsx(kY,{className:"-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50",strokeWidth:2})]}):r;return l.jsx(b,{ref:i,className:L0(hM({variant:t,size:o,className:e})),...c,children:z})});z1.displayName="Button";const XJ=BJ,jJ=TJ,DJ=PJ,Ov=p.forwardRef(({className:e,...t},o)=>l.jsx(bv,{className:L0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));Ov.displayName=bv.displayName;const fv=p.forwardRef(({className:e,...t},o)=>l.jsx(DJ,{children:l.jsxs("div",{className:_n,children:[l.jsx(Ov,{onClick:n=>n.stopPropagation()}),l.jsx(Mv,{ref:o,className:L0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));fv.displayName=Mv.displayName;const Av=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col space-y-2 text-center sm:text-left",e),...t});Av.displayName="AlertDialogHeader";const qv=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2 [&>button]:min-w-20",e),...t});qv.displayName="AlertDialogFooter";const hv=p.forwardRef(({className:e,...t},o)=>l.jsx(uv,{ref:o,className:L0("text-xl font-semibold",e),...t}));hv.displayName=uv.displayName;const mv=p.forwardRef(({className:e,...t},o)=>l.jsx(dv,{ref:o,className:L0("text-base",e),...t}));mv.displayName=dv.displayName;const Wv=p.forwardRef(({className:e,...t},o)=>l.jsx(lv,{ref:o,className:L0(hM(),e),...t}));Wv.displayName=lv.displayName;const gv=p.forwardRef(({className:e,...t},o)=>l.jsx(zv,{ref:o,className:L0(hM({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));gv.displayName=zv.displayName;const IJ=p.lazy(()=>d1(()=>import("./index-IDaHqjnu.js"),[],import.meta.url)),F6=e=>l.jsx(p.Suspense,{fallback:l.jsx("div",{}),children:l.jsx(IJ,{...e})}),ga0=e=>e.format("YYYY-MM-DD"),va0=e=>Math.round(e/100),ya0=e=>{if(!e.length)return{min:0,max:1};const t=e.map(f=>Number(f.value));let o=Math.min(...t),n=Math.max(...t);if(o===n){const f=o;return{min:Math.max(0,f-1),max:f+1}}const r=.02;o=Math.max(0,o-o*r),n=n+n*r;const c=n-o,i=Math.floor(Math.log10(c)),b=Math.pow(10,i),z=Math.round(n/b)*b;n=z<n?Math.ceil(n/b)*b:z;const u=Math.round(o/b)*b;if(o=u>o?Math.floor(o/b)*b:u,o=Math.max(0,o),o===n){const f=(o+n)/2,O=Math.max(Math.abs(f)*r,b);o=Math.max(0,Math.floor(f-O)),n=Math.ceil(f+O)}return o=Math.max(0,o),{min:o,max:n}},Ra0=(e,t)=>{if(!e.length)return 40;const o=Math.max(...e.map(r=>t(r).length));return Math.max(20,o*8+20)},La0=e=>{const t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.ceil(n/(1e3*3600*24));return Math.max(r,1)},wa0=e=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone,o=St().tz(t).endOf("day");let n;return e===-1?n=St().tz(t).startOf("year"):n=St().tz(t).subtract(e-1,"days").startOf("day"),{startDate:n,endDate:o,timezone:t}},xa0=(e,t,o="value",n="avg")=>{if(!e.length)return[];if(t>=91&&t<=356){const r=[];let c=St(e[0].date).startOf("week"),i=0,b=0,z=0;return e.forEach((u,f)=>{const O=St(u.date);O.isSame(c,"week")?(i+=Number(u[o]),b+=1,z=Number(u[o])):(r.push({...e[f-1],date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z}),c=O.startOf("week"),i=Number(u[o]),b=1,z=Number(u[o])),f===e.length-1&&r.push({...u,date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z})}),r}else if(t>356){const r=[];let c=St(e[0].date).startOf("month"),i=0,b=0,z=0;return e.forEach((u,f)=>{const O=St(u.date);O.isSame(c,"month")?(i+=Number(u[o]),b+=1,z=Number(u[o])):(r.push({...e[f-1],date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z}),c=O.startOf("month"),i=Number(u[o]),b=1,z=Number(u[o])),f===e.length-1&&r.push({...u,date:c.format("YYYY-MM-DD"),[o]:n==="sum"?i:n==="avg"?b>0?i/b:0:z})}),r}return e},Na0=(e,t,o=!1,n=!1)=>t===1&&n?St(e).format("h:mma"):t===1&&o?St(e).format("MMM D, h:mma"):t>365?St(e).format("MMM YYYY"):t>=91?`Week of ${C6(e)}`:C6(e),vv=e=>e.name&&e.name.trim()||e.email||"Unknown Member",FJ=e=>{const t=vv(e),o=t.split(" ");return o.length>=2?(o[0][0]+o[o.length-1][0]).toUpperCase():t.substring(0,2).toUpperCase()},yO=p.forwardRef(({className:e,...t},o)=>l.jsx(eW,{ref:o,className:L0("aspect-square h-full w-full",e),...t}));yO.displayName=eW.displayName;const mM=p.forwardRef(({className:e,...t},o)=>l.jsx(tW,{ref:o,className:L0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));mM.displayName=tW.displayName;function UJ({src:e}){const[t,o]=p.useState(!1);return p.useEffect(()=>{o(!1)},[e]),l.jsx("img",{alt:"",className:L0("absolute inset-0 h-full w-full object-cover",!t&&"invisible"),src:e,onLoad:n=>{const{naturalWidth:r,naturalHeight:c}=n.currentTarget;r>1&&c>1&&o(!0)}})}const RO=p.forwardRef(({className:e,children:t,src:o,name:n,email:r,...c},i)=>{const b={name:n||void 0,email:r||void 0},z=!!(n||r),u=z?FJ(b):null,f=z?QG(vv(b),"75","55"):void 0;return l.jsx(Jm,{ref:i,className:L0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...c,children:t??l.jsxs(l.Fragment,{children:[l.jsx(mM,{className:L0("text-xs text-muted-foreground md:text-sm [&_svg]:size-3 md:[&_svg]:size-4",z&&"font-semibold text-white"),style:z?{backgroundColor:f}:void 0,children:u??l.jsx(OM,{})}),o&&l.jsx(UJ,{src:o})]})})});RO.displayName=Jm.displayName;const HJ=Nn("inline-flex items-center rounded-xs border px-1.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:outline-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",warning:"border-transparent bg-state-warning/20 text-yellow-600",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function yv({className:e,variant:t,...o}){return l.jsx("div",{className:L0(HJ({variant:t}),e),...o})}const $J=Nn("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border-default bg-surface-panel shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-border-subtle bg-surface-elevated","shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_28%),7px_6px_42px_8px_rgb(202_103_255_/_32%)]","dark:shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_36%),7px_6px_42px_8px_rgb(202_103_255_/_38%)]","hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_38%),7px_8px_42px_10px_rgb(202_103_255_/_42%)]","dark:hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_50%),7px_8px_42px_10px_rgb(202_103_255_/_52%)]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"border border-state-info/40 bg-state-info/10",success:"border border-state-success/40 bg-state-success/10",warning:"border border-state-warning/40 bg-state-warning/10",destructive:"bg-surface-panel shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),WM=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:c,role:i="status",className:b,children:z,...u}=e,f=O=>{O.preventDefault(),O.stopPropagation(),r&&c&&c()};return l.jsxs("div",{ref:t,className:L0($J({variant:o,size:n}),b),role:i,...u,children:[r&&l.jsx(z1,{"aria-label":"Dismiss notification",className:"absolute top-1 right-1 size-8 text-text-secondary hover:text-text-primary",size:"icon",variant:"ghost",onClick:f,children:l.jsx(dO,{className:"size-5"})}),z]})});WM.displayName="Banner";const Ss=WO,Rv=gO,VJ=vO,GJ=qM,Lv=p.forwardRef(({className:e,...t},o)=>l.jsx(_s,{ref:o,className:L0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t}));Lv.displayName=_s.displayName;const ka=p.forwardRef(({className:e,children:t,...o},n)=>l.jsx(VJ,{children:l.jsxs("div",{className:_n,children:[l.jsx(Lv,{}),l.jsx(ks,{ref:n,className:L0("fixed left-[50%] top-[8vmin] z-50 grid w-full max-w-lg translate-x-[-50%] gap-6 bg-surface-overlay p-6 shadow-lg duration-200 transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg outline-hidden",e),...o,children:t})]})}));ka.displayName=ks.displayName;const gM=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col gap-y-1.5 text-center sm:text-left",e),...t});gM.displayName="DialogHeader";const vM=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2 sm:items-end [&_button]:min-w-20",e),...t});vM.displayName="DialogFooter";const yM=p.forwardRef(({className:e,...t},o)=>l.jsx(Cs,{ref:o,className:L0("text-xl font-semibold leading-none tracking-tight",e),...t}));yM.displayName=Cs.displayName;const wv=p.forwardRef(({className:e,...t},o)=>l.jsx(Es,{ref:o,className:L0("text-sm text-muted-foreground",e),...t}));wv.displayName=Es.displayName;const xv=p.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...n},r)=>l.jsx(Xh,{ref:r,className:L0("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),decorative:o,orientation:t,...n}));xv.displayName=Xh.displayName;var a3,RM="HoverCard",[Nv]=ro(RM,[Rr]),LM=Rr(),[QJ,wM]=Nv(RM),_v=e=>{const{__scopeHoverCard:t,children:o,open:n,defaultOpen:r,onOpenChange:c,openDelay:i=700,closeDelay:b=300}=e,z=LM(t),u=p.useRef(0),f=p.useRef(0),O=p.useRef(!1),q=p.useRef(!1),[h,W]=s2({prop:n,defaultProp:r??!1,onChange:c,caller:RM}),g=p.useCallback(()=>{clearTimeout(f.current),u.current=window.setTimeout(()=>W(!0),i)},[i,W]),v=p.useCallback(()=>{clearTimeout(u.current),!O.current&&!q.current&&(f.current=window.setTimeout(()=>W(!1),b))},[b,W]),w=p.useCallback(()=>W(!1),[W]);return p.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(f.current)},[]),l.jsx(QJ,{scope:t,open:h,onOpenChange:W,onOpen:g,onClose:v,onDismiss:w,hasSelectionRef:O,isPointerDownOnContentRef:q,children:l.jsx(jb,{...z,children:o})})};_v.displayName=RM;var kv="HoverCardTrigger",Cv=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=wM(kv,o),c=LM(o);return l.jsx(zs,{asChild:!0,...c,children:l.jsx(L1.a,{"data-state":r.open?"open":"closed",...n,ref:t,onPointerEnter:T0(e.onPointerEnter,db(r.onOpen)),onPointerLeave:T0(e.onPointerLeave,db(r.onClose)),onFocus:T0(e.onFocus,r.onOpen),onBlur:T0(e.onBlur,r.onClose),onTouchStart:T0(e.onTouchStart,i=>i.preventDefault())})})});Cv.displayName=kv;var LO="HoverCardPortal",[YJ,KJ]=Nv(LO,{forceMount:void 0}),Ev=e=>{const{__scopeHoverCard:t,forceMount:o,children:n,container:r}=e,c=wM(LO,t);return l.jsx(YJ,{scope:t,forceMount:o,children:l.jsx(yt,{present:o||c.open,children:l.jsx(Ra,{asChild:!0,container:r,children:n})})})};Ev.displayName=LO;var ub="HoverCardContent",Sv=p.forwardRef((e,t)=>{const o=KJ(ub,e.__scopeHoverCard),{forceMount:n=o.forceMount,...r}=e,c=wM(ub,e.__scopeHoverCard);return l.jsx(yt,{present:n||c.open,children:l.jsx(ZJ,{"data-state":c.open?"open":"closed",...r,onPointerEnter:T0(e.onPointerEnter,db(c.onOpen)),onPointerLeave:T0(e.onPointerLeave,db(c.onClose)),ref:t})})});Sv.displayName=ub;var ZJ=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:i,...b}=e,z=wM(ub,o),u=LM(o),f=p.useRef(null),O=T1(t,f),[q,h]=p.useState(!1);return p.useEffect(()=>{if(q){const W=document.body;return a3=W.style.userSelect||W.style.webkitUserSelect,W.style.userSelect="none",W.style.webkitUserSelect="none",()=>{W.style.userSelect=a3,W.style.webkitUserSelect=a3}}},[q]),p.useEffect(()=>{if(f.current){const W=()=>{h(!1),z.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(z.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",W),()=>{document.removeEventListener("pointerup",W),z.hasSelectionRef.current=!1,z.isPointerDownOnContentRef.current=!1}}},[z.isPointerDownOnContentRef,z.hasSelectionRef]),p.useEffect(()=>{f.current&&t00(f.current).forEach(g=>g.setAttribute("tabindex","-1"))}),l.jsx(ya,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:T0(c,W=>{W.preventDefault()}),onDismiss:z.onDismiss,children:l.jsx(Db,{...u,...b,onPointerDown:T0(b.onPointerDown,W=>{W.currentTarget.contains(W.target)&&h(!0),z.hasSelectionRef.current=!1,z.isPointerDownOnContentRef.current=!0}),ref:O,style:{...b.style,userSelect:q?"text":void 0,WebkitUserSelect:q?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),JJ="HoverCardArrow",e00=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=LM(o);return l.jsx(Ib,{...r,...n,ref:t})});e00.displayName=JJ;function db(e){return t=>t.pointerType==="touch"?void 0:e()}function t00(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;o.nextNode();)t.push(o.currentNode);return t}var o00=_v,n00=Cv,r00=Ev,Bv=Sv;const a00=o00,c00=n00,Tv=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>l.jsx(r00,{children:l.jsx("div",{className:_n,children:l.jsx(Bv,{ref:r,align:t,className:L0("pointer-events-auto z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-hover-card-content-transform-origin)",e),sideOffset:o,...n})})}));Tv.displayName=Bv.displayName;const s00=Nn("rounded-full",{variants:{variant:{neutral:"bg-muted",info:"bg-state-info",success:"bg-state-success",error:"bg-state-danger",warning:"bg-state-warning"},state:{idle:"",active:"animate-pulse",inactive:"border-2 bg-transparent"},size:{sm:"size-2",md:"size-3",lg:"size-4"}},compoundVariants:[{variant:"neutral",state:"inactive",className:"border-muted-foreground"},{variant:"info",state:"inactive",className:"border-state-info"},{variant:"success",state:"inactive",className:"border-state-success"},{variant:"error",state:"inactive",className:"border-state-danger"},{variant:"warning",state:"inactive",className:"border-state-warning"}],defaultVariants:{variant:"success",state:"idle",size:"sm"}});function U6({className:e,variant:t,state:o,size:n,label:r,...c}){return l.jsxs("span",{className:"inline-flex items-center",...c,children:[l.jsx("span",{"aria-hidden":"true",className:L0(s00({variant:t,state:o,size:n}),e)}),r&&l.jsx("span",{className:"sr-only",children:r})]})}const Hr={base:"rounded-md border border-border-default bg-surface-elevated transition-colors",focusSelf:"focus-visible:outline-hidden focus-visible:bg-transparent focus-visible:border-focus-ring focus-visible:ring-2 focus-visible:ring-focus-ring/25",focusWithin:"has-[:focus-visible]:outline-hidden has-[:focus-visible]:bg-transparent has-[:focus-visible]:border-focus-ring has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus-ring/25",invalidSelf:"aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/20 dark:aria-[invalid=true]:ring-destructive/40",invalidWithin:"has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 dark:has-[[aria-invalid=true]]:ring-destructive/40",disabledSelf:"disabled:cursor-not-allowed disabled:opacity-50"};function i00(e="self"){return e==="self"?L0(Hr.base,Hr.focusSelf,Hr.invalidSelf,Hr.disabledSelf):L0(Hr.base,Hr.focusWithin,Hr.invalidWithin)}const xM=p.forwardRef(({className:e,type:t,...o},n)=>l.jsx("input",{ref:n,className:L0(i00("self"),"flex h-9 w-full px-3 py-1 text-base file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground",e),type:t,...o}));xM.displayName="Input";function p00({className:e,...t}){return l.jsx("kbd",{className:L0("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-xs px-1 font-sans text-xs font-medium m-0 shadow-none border-none text-shadow-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e),"data-slot":"kbd",...t})}function F1({containerClassName:e,count:t=1,randomize:o=!1,minWidth:n=70,maxWidth:r=100,className:c,...i}){const{randomWidths:b,keys:z}=p.useMemo(()=>{const u=[],f=[];for(let O=0;O<t;O++){if(o){const q=Math.floor((r-n)/5),h=Math.floor(Math.random()*(q+1)),W=n+h*5;u.push(`${W}%`)}f.push(`skeleton-${O}`)}return{randomWidths:u,keys:f}},[t,o,n,r]);return l.jsx("span",{className:e,children:Array.from({length:t}).map((u,f)=>l.jsxs(l0.Fragment,{children:[l.jsx("span",{className:L0("inline-flex w-full leading-none animate-pulse rounded-[2px] bg-primary/10",c),style:o?{width:b[f]}:void 0,...i,children:"‌"}),l.jsx("br",{})]},z[f]))})}const b00=l0.forwardRef(({className:e,lines:t=5,...o},n)=>t<1?l.jsx(l.Fragment,{}):l.jsx("div",{ref:n,className:L0("flex flex-col gap-2",e),...o,children:Array.from({length:t},(r,c)=>{let i="66%";switch(c%5){case 0:i="57%";break;case 1:i="33%";break;case 2:i="40%";break;case 3:i="48%";break;case 4:i="24%";break}return l.jsxs("div",{className:"flex justify-between gap-6",children:[l.jsx("div",{className:"grow",style:{maxWidth:i},children:l.jsx(F1,{})}),l.jsx(F1,{className:"w-[60px] self-end"})]},c)})}));b00.displayName="SkeletonTable";const Ob=({size:e="md",color:t="dark",className:o=""})=>{let n="relative mx-0 my-[-0.5] box-border inline-block animate-spin rounded-full before:z-10 before:block before:rounded-full before:content-['']";switch(e){case"sm":n+=" h-[16px] w-[16px] border-2 before:mt-[10px] before:h-[3px] before:w-[3px]";break;case"md":n+=" h-[20px] w-[20px] border-2 before:mt-[13px] before:h-[3px] before:w-[3px]";break;default:n+=" h-[50px] w-[50px] border before:mt-[7px] before:h-[7px] before:w-[7px]";break}return t==="light"?n+=" border-white/20 before:bg-white dark:border-black/10 dark:before:bg-black":n+=" border-black/10 before:bg-black dark:border-white/20 dark:before:bg-white",l.jsx("div",{className:`${n} ${o}`})},_a0=()=>l.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:l.jsx("div",{className:"flex size-20 items-center justify-center rounded-full",children:l.jsxs("div",{className:"-mt-1.5 flex items-end gap-2",children:[l.jsx(F1,{className:"h-10 w-3"}),l.jsx(F1,{className:"h-14 w-3"}),l.jsx(F1,{className:"h-6 w-3"})]})})}),M00=({className:e="",children:t})=>l.jsx("div",{className:`my-10 flex flex-col items-center gap-1 text-sm text-text-secondary ${e}`,children:t}),l00=({className:e="",children:t})=>l.jsx("div",{className:`text-text-tertiary [&>svg]:size-8 [&>svg]:stroke-[1px] ${e}`,children:t}),z00=({open:e,defaultOpen:t,onOpenChange:o,children:n,...r})=>{const c=e!==void 0,[i,b]=p.useState(t??!1),z=c?e:i,u=p.useCallback(O=>{c||b(O),o?.(O)},[c,o]),f=p.useRef(u);return p.useEffect(()=>{f.current=u},[u]),p.useEffect(()=>{if(!z)return;const O=q=>{q.key==="Escape"&&(q.preventDefault(),q.stopPropagation(),f.current(!1))};return document.addEventListener("keydown",O,{capture:!0}),()=>document.removeEventListener("keydown",O,{capture:!0})},[z]),l.jsx(Vj,{...r,open:z,onOpenChange:u,children:n})},u00=Gj,c3=Yj,Pv=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>l.jsx(Qj,{children:l.jsx("div",{className:_n,children:l.jsx(WW,{ref:r,align:t,className:L0("z-50 rounded-md bg-surface-overlay p-5 text-popover-foreground shadow-md border outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)",e),sideOffset:o,...n})})}));Pv.displayName=WW.displayName;const d00=WO,ka0=gO,O00=vO,Xv=p.forwardRef(({className:e,...t},o)=>l.jsx(_s,{className:L0("fixed inset-0 z-50 bg-black/10 data-[state=open]:animate-in duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));Xv.displayName=_s.displayName;const f00=Nn("fixed z-50 gap-4 bg-background p-8 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jv=p.forwardRef(({side:e="right",className:t,children:o,...n},r)=>l.jsx(O00,{children:l.jsxs("div",{className:_n,children:[l.jsx(Xv,{}),l.jsxs(ks,{ref:r,className:L0(f00({side:e}),t),...n,children:[l.jsxs(qM,{className:"fixed top-4 right-4 z-50 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(dO,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),o]})]})}));jv.displayName=ks.displayName;const A00=({className:e,...t})=>l.jsx("div",{className:L0("flex flex-col space-y-1 text-center sm:text-left",e),...t});A00.displayName="SheetHeader";const q00=p.forwardRef(({className:e,...t},o)=>l.jsx(Cs,{ref:o,className:L0("text-xl font-semibold text-foreground",e),...t}));q00.displayName=Cs.displayName;const h00=p.forwardRef(({className:e,...t},o)=>l.jsx(Es,{ref:o,className:L0("text-sm text-muted-foreground",e),...t}));h00.displayName=Es.displayName;const Dv=801;function s3(){return window.innerWidth<Dv}function m00(){const[e,t]=p.useState(s3());return p.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Dv-1}px)`),n=()=>{t(s3())};return o.addEventListener("change",n),t(s3()),()=>o.removeEventListener("change",n)},[]),e}const W00=TX,g00=PX,v00=XX,Iv=p.forwardRef(({className:e,sideOffset:t=4,...o},n)=>l.jsx(jX,{children:l.jsx("div",{className:_n,children:l.jsx($m,{ref:n,className:L0("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:t,...o})})}));Iv.displayName=$m.displayName;const y00="sidebar:state",R00=3600*24*7,L00="30rem",w00="28rem",x00="4rem",N00="b",NM="(--control-height)",Fv=p.createContext(null);function u2(){const e=p.useContext(Fv);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Uv=p.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:o,className:n,style:r,children:c,...i},b)=>{const z=m00(),[u,f]=p.useState(!1),[O,q]=p.useState(e),h=t??O,W=p.useCallback(N=>{const x=typeof N=="function"?N(h):N;o?o(x):q(x),document.cookie=`${y00}=${x}; path=/; max-age=${R00}`},[o,h]),g=p.useCallback(()=>z?f(N=>!N):W(N=>!N),[z,W,f]);p.useEffect(()=>{const N=x=>{x.key===N00&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[g]);const v=h?"expanded":"collapsed",w=p.useMemo(()=>({state:v,open:h,setOpen:W,isMobile:z,openMobile:u,setOpenMobile:f,toggleSidebar:g}),[v,h,W,z,u,f,g]);return l.jsx(Fv.Provider,{value:w,children:l.jsx(W00,{delayDuration:0,children:l.jsx("div",{ref:b,className:L0("group/sidebar-wrapper relative flex h-full w-full has-[[data-variant=inset]]:bg-sidebar",n),style:{"--sidebar-width":L00,"--sidebar-width-icon":x00,...r},...i,children:c})})})});Uv.displayName="SidebarProvider";const Hv=p.forwardRef(({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:n,children:r,...c},i)=>{const{isMobile:b,state:z,openMobile:u,setOpenMobile:f}=u2();return o==="none"?l.jsx("div",{ref:i,className:L0("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),role:"navigation",...c,children:r}):b?l.jsx(d00,{open:u,onOpenChange:f,...c,children:l.jsx(jv,{className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",role:"navigation",side:e,style:{"--sidebar-width":w00},children:l.jsx("div",{className:"flex size-full flex-col",children:r})})}):l.jsxs("div",{ref:i,className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":z==="collapsed"?o:"","data-side":e,"data-state":z,"data-variant":t,role:"navigation",children:[l.jsx("div",{className:L0("relative h-full w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1.6rem)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{className:L0("absolute inset-y-0 z-10 hidden h-full w-(--sidebar-width) md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1.6rem_+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) border-sidebar-border group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...c,children:l.jsx("div",{className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:r})})]})});Hv.displayName="Sidebar";const $v=p.forwardRef(({children:e,className:t,onClick:o,...n},r)=>{const{toggleSidebar:c}=u2();return l.jsx(z1,{ref:r,className:L0("h-7 w-7",t),"data-sidebar":"trigger",size:"icon",variant:"ghost",onClick:i=>{o?.(i),c()},...n,children:e||l.jsxs(l.Fragment,{children:[l.jsx(yK,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})});$v.displayName="SidebarTrigger";const _00=p.forwardRef(({className:e,...t},o)=>{const{toggleSidebar:n}=u2();return l.jsx("button",{ref:o,"aria-label":"Toggle Sidebar",className:L0("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),"data-sidebar":"rail",tabIndex:-1,title:"Toggle Sidebar",type:"button",onClick:n,...t})});_00.displayName="SidebarRail";const Vv=p.forwardRef(({className:e,...t},o)=>l.jsx("main",{ref:o,className:L0("relative flex h-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Vv.displayName="SidebarInset";const k00=p.forwardRef(({className:e,...t},o)=>l.jsx(xM,{ref:o,className:L0("w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",`h-${NM}`,e),"data-sidebar":"input",...t}));k00.displayName="SidebarInput";const Gv=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("flex flex-col gap-2 p-2",e),"data-sidebar":"header",...t}));Gv.displayName="SidebarHeader";const Qv=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("flex flex-col gap-2 p-2",e),"data-sidebar":"footer",...t}));Qv.displayName="SidebarFooter";const C00=p.forwardRef(({className:e,...t},o)=>l.jsx(xv,{ref:o,className:L0("mx-2 w-auto bg-sidebar-border",e),"data-sidebar":"separator",...t}));C00.displayName="SidebarSeparator";const Yv=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("flex min-h-0 flex-1 flex-col gap-4 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content",...t}));Yv.displayName="SidebarContent";const Ca=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group",...t}));Ca.displayName="SidebarGroup";const E00=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Wa:"div";return l.jsx(r,{ref:n,className:L0("duration-200 flex shrink-0 items-center rounded-md px-3 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-all ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",`h-${NM}`,e),"data-sidebar":"group-label",...o})});E00.displayName="SidebarGroupLabel";const S00=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Wa:"button";return l.jsx(r,{ref:n,className:L0("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"group-action",...o})});S00.displayName="SidebarGroupAction";const Bs=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("w-full text-sm",e),"data-sidebar":"group-content",...t}));Bs.displayName="SidebarGroupContent";const Ea=p.forwardRef(({className:e,...t},o)=>l.jsx("ul",{ref:o,className:L0("flex w-full min-w-0 flex-col gap-0.5",e),"data-sidebar":"menu",...t}));Ea.displayName="SidebarMenu";const wO=p.forwardRef(({className:e,...t},o)=>l.jsx("li",{ref:o,className:L0("group/menu-item relative",e),"data-sidebar":"menu-item",...t}));wO.displayName="SidebarMenuItem";const B00=Nn("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-md font-medium text-sidebar-foreground ring-sidebar-ring outline-hidden transition-all group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"border border-sidebar-border bg-background hover:border-sidebar-accent hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"},size:{default:`h-${NM} text-md`,sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),_M=p.forwardRef(({asChild:e=!1,isActive:t=!1,variant:o="default",size:n="default",tooltip:r,className:c,...i},b)=>{const z=e?Wa:"button",{isMobile:u,state:f}=u2(),O=l.jsx(z,{ref:b,className:L0(B00({variant:o,size:n}),c),"data-active":t,"data-sidebar":"menu-button","data-size":n,...i});return r?(typeof r=="string"&&(r={children:r}),l.jsxs(g00,{children:[l.jsx(v00,{asChild:!0,children:O}),l.jsx(Iv,{align:"center",hidden:f!=="collapsed"||u,side:"right",...r})]})):O});_M.displayName="SidebarMenuButton";const T00=p.forwardRef(({className:e,asChild:t=!1,showOnHover:o=!1,...n},r)=>{const c=t?Wa:"button";return l.jsx(c,{ref:r,className:L0("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",o&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),"data-sidebar":"menu-action",...n})});T00.displayName="SidebarMenuAction";const xO=p.forwardRef(({className:e,...t},o)=>l.jsx("div",{ref:o,className:L0("absolute right-2 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-sm font-medium tabular-nums text-text-secondary select-none pointer-events-none","peer-hover/menu-button: peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=default]/menu-button:top-2","peer-data-[size=lg]/menu-button:top-3","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-badge",...t}));xO.displayName="SidebarMenuBadge";const P00=p.forwardRef(({className:e,showIcon:t=!1,...o},n)=>{const r=p.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{ref:n,className:L0("rounded-md flex gap-2 px-3 items-center",`h-${NM}`,e),"data-sidebar":"menu-skeleton",...o,children:[t&&l.jsx(F1,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(F1,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});P00.displayName="SidebarMenuSkeleton";const X00=p.forwardRef(({className:e,...t},o)=>l.jsx("ul",{ref:o,className:L0("mx-3.5 flex min-w-0 translate-x-px flex-col gap-0.5 border-l border-sidebar-border px-3 py-0.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-sub",...t}));X00.displayName="SidebarMenuSub";const j00=p.forwardRef(({...e},t)=>l.jsx("li",{ref:t,...e}));j00.displayName="SidebarMenuSubItem";const D00=p.forwardRef(({asChild:e=!1,size:t="md",isActive:o,className:n,...r},c)=>{const i=e?Wa:"a";return l.jsx(i,{ref:c,className:L0("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-3 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),"data-active":o,"data-sidebar":"menu-sub-button","data-size":t,...r})});D00.displayName="SidebarMenuSubButton";const I00=Nn("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-5 w-9",sm:"h-4 w-7"}},defaultVariants:{size:"default"}}),F00=Nn("pointer-events-none block rounded-full bg-background ring-0 [filter:drop-shadow(0_1px_2px_rgba(0,0,0,0.07))] transition-transform data-[state=unchecked]:translate-x-0",{variants:{size:{default:"size-4 data-[state=checked]:translate-x-4",sm:"size-3 data-[state=checked]:translate-x-3"}},defaultVariants:{size:"default"}}),Kv=p.forwardRef(({className:e,size:t,...o},n)=>l.jsx(gm,{className:L0(I00({size:t,className:e})),...o,ref:n,children:l.jsx(FP,{className:L0(F00({size:t}))})}));Kv.displayName=gm.displayName;const Ts=vW,Ca0=LW({dataType:Ts,path:"/users/",defaultSearchParams:{limit:"100",include:"roles"},defaultNextPageParams:(e,t)=>({...t,page:(e.meta?.pagination.next||1).toString()}),returnData:e=>{const{pages:t}=e,o=t.flatMap(r=>r.users),n=t[t.length-1].meta;return{users:o,meta:n,isEnd:n?n.pagination.pages===n.pagination.page:!0}}}),Ea0=uD({dataType:Ts,path:e=>`/users/slug/${e}/`,defaultSearchParams:{include:"roles"}}),Zv=Xe({method:"PUT",path:e=>`/users/${e.id}/`,body:e=>({users:[e]}),searchParams:()=>({include:"roles"}),updateQueries:{dataType:Ts,emberUpdateType:"createOrUpdate",update:wW("users")}}),Sa0=Xe({method:"DELETE",path:e=>`/users/${e}/`,updateQueries:{dataType:Ts,emberUpdateType:"delete",update:mD("users")}}),Ba0=Xe({method:"PUT",path:()=>"/users/password/",body:({newPassword:e,confirmNewPassword:t,userId:o,oldPassword:n})=>({password:[{user_id:o,oldPassword:n||"",newPassword:e,ne2Password:t}]})}),Ta0=Xe({method:"PUT",path:()=>"/users/owner/",body:e=>({owner:[{id:e}]}),updateQueries:{dataType:Ts,emberUpdateType:"createOrUpdate",update:wW("users")}});function Sa(e){return e.roles.some(t=>t.name==="Owner")}function kM(e){return e.roles.some(t=>t.name==="Administrator")}function Jv(e){return e.roles.some(o=>o.name==="Editor")||e.roles.some(o=>o.name==="Super Editor")}function U00(e){return e.roles.some(t=>t.name==="Super Editor")}function H00(e){return e.roles.some(t=>t.name==="Author")}function Ps(e){return e.roles.some(t=>t.name==="Contributor")}function Pa0(e){return H00(e)||Ps(e)}function $00(e){return Sa(e)||kM(e)||Jv(e)}function e9(e){return Sa(e)||kM(e)||U00(e)}function V00(e){return Sa(e)||kM(e)||Jv(e)}function G00(e){return Sa(e)||kM(e)}const fa="SettingsResponseType",Ba=Yo({dataType:fa,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore,transistor"}}),Xa0=Xe({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:fa,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==fa}}}}),ja0=Xe({method:"POST",path:()=>"/settings/access_code/regenerate/",updateQueries:{dataType:fa,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==fa}}}}),Da0=Xe({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:fa}}),Ia0=Xe({method:"POST",path:()=>"/slack/test/"});function Fa0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function Ua0(e,t){return t.map(o=>e?.find(n=>n.key===o)?.value)}function Ao(e,t){return e&&e.find(n=>n.key===t)?.value||null}function Ha0(e,t){return e?e.find(n=>n.key===t)?.is_read_only||!1:void 0}function $a0(e,t){const o=c=>e.some(i=>i.key===c&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}const Q00="SiteResponseType",CM=Yo({dataType:Q00,path:"/site/"});function Va0(e){const t=new URL(e.url),o=t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`;return`${t.origin}${o}`}function Y00(e,t){if(sJ(t)&&iJ(t))return pJ(t)||"";const o=new URL(e.url).hostname||"";return o.startsWith("www.")?o.replace(/^(www)\.(?=[^/]*\..{2,5})/,""):o}function Ga0(e,t,o){const n=Y00(t,o);return e==="noreply"?`noreply@${n}`:e}const du=navigator.userAgent.indexOf("Mac")!==-1?"command":"ctrl",K00=du==="command"?"⌘K":"Ctrl+K",Z00=e=>{e.preventDefault();const t=new KeyboardEvent("keydown",{key:"k",keyCode:75,metaKey:du==="command",ctrlKey:du==="ctrl"});document.dispatchEvent(t)};function J00({...e}){const{data:t}=me(),o=CM(),n=Ba(),r=o.data?.site.title??"",c=o.data?.site.icon??"https://static.ghost.org/v4.0.0/images/ghost-orb-1.png",i=Ao(n.data?.settings,"is_private")??!1,b=t&&!Ps(t);return l.jsx(Gv,{...e,children:l.jsxs("div",{className:"flex flex-col items-stretch gap-6",children:[l.jsx("div",{className:"flex items-center justify-between",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx("div",{className:"h-8 w-8 flex-shrink-0 rounded-md border-0 bg-transparent",children:l.jsx("img",{src:c,alt:"Site icon",className:"h-full w-full rounded-md object-cover"})}),l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[l.jsx("div",{className:"min-w-0 overflow-hidden text-[15px] font-semibold text-ellipsis whitespace-nowrap text-foreground",children:r}),i&&l.jsx("a",{"aria-label":"Open access settings",className:"shrink-0",href:"#/settings/members",children:l.jsxs(yv,{className:"gap-1 border-transparent bg-orange-100 px-1.5 py-0 text-[11px] leading-5 font-semibold text-orange-700 transition-colors hover:bg-orange-200 dark:bg-orange-500/20 dark:text-orange-300 dark:hover:bg-orange-500/30",variant:"secondary",children:[l.jsx(bK,{className:"size-3",strokeWidth:2.25}),"Private"]})})]})]})}),b&&l.jsxs(z1,{variant:"outline",className:"flex h-[38px] items-center justify-between pr-2 text-base text-muted-foreground shadow-xs hover:border-gray-200 hover:bg-background hover:text-gray-700 hover:shadow-sm dark:bg-gray-950 dark:hover:border-gray-800 [&_svg]:stroke-2",onClick:Z00,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(zO,{className:"text-muted-foreground"}),"Search site"]}),l.jsx(p00,{className:"bg-transparent text-gray-500 shadow-none dark:text-gray-800",style:{textShadow:"none"},children:K00})]})]})})}function i0(e,t,o){function n(b,z){var u;Object.defineProperty(b,"_zod",{value:b._zod??{},enumerable:!1}),(u=b._zod).traits??(u.traits=new Set),b._zod.traits.add(e),t(b,z);for(const f in i.prototype)f in b||Object.defineProperty(b,f,{value:i.prototype[f].bind(b)});b._zod.constr=i,b._zod.def=z}const r=o?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function i(b){var z;const u=o?.Parent?new c:this;n(u,b),(z=u._zod).deferred??(z.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:b=>o?.Parent&&b instanceof o.Parent?!0:b?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class ba extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class t9 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const o9={};function Wr(e){return o9}function e10(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function Ou(e,t){return typeof t=="bigint"?t.toString():t}function NO(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function _O(e){return e==null}function kO(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}const H6=Symbol("evaluating");function E1(e,t,o){let n;Object.defineProperty(e,t,{get(){if(n!==H6)return n===void 0&&(n=H6,n=o()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function d2(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function O2(...e){const t={};for(const o of e){const n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function $6(e){return JSON.stringify(e)}const n9="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const t10=NO(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Aa(e){if(fb(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const o=t.prototype;return!(fb(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function r9(e){return Aa(e)?{...e}:Array.isArray(e)?[...e]:e}const o10=new Set(["string","number","symbol"]);function qa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xr(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function K0(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function n10(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function r10(e,t){const o=e._zod.def,n=O2(e._zod.def,{get shape(){const r={};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(r[c]=o.shape[c])}return d2(this,"shape",r),r},checks:[]});return xr(e,n)}function a10(e,t){const o=e._zod.def,n=O2(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete r[c]}return d2(this,"shape",r),r},checks:[]});return xr(e,n)}function c10(e,t){if(!Aa(t))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=O2(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return d2(this,"shape",c),c},checks:[]});return xr(e,r)}function s10(e,t){if(!Aa(t))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return d2(this,"shape",n),n},checks:e._zod.def.checks};return xr(e,o)}function i10(e,t){const o=O2(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return d2(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return xr(e,o)}function p10(e,t,o){const n=O2(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(o)for(const i in o){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(c[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)c[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return d2(this,"shape",c),c},checks:[]});return xr(t,n)}function b10(e,t,o){const n=O2(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(o)for(const i in o){if(!(i in c))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(c[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)c[i]=new e({type:"nonoptional",innerType:r[i]});return d2(this,"shape",c),c},checks:[]});return xr(t,n)}function ea(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function ta(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function zp(e){return typeof e=="string"?e:e?.message}function gr(e,t,o){const n={...e,path:e.path??[]};if(!e.message){const r=zp(e.inst?._zod.def?.error?.(e))??zp(t?.error?.(e))??zp(o.customError?.(e))??zp(o.localeError?.(e))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function CO(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ts(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const a9=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ou,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},c9=i0("$ZodError",a9),EM=i0("$ZodError",a9,{Parent:Error});function M10(e,t=o=>o.message){const o={},n=[];for(const r of e.issues)r.path.length>0?(o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:o}}function l10(e,t=o=>o.message){const o={_errors:[]},n=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(i=>n({issues:i}));else if(c.code==="invalid_key")n({issues:c.issues});else if(c.code==="invalid_element")n({issues:c.issues});else if(c.path.length===0)o._errors.push(t(c));else{let i=o,b=0;for(;b<c.path.length;){const z=c.path[b];b===c.path.length-1?(i[z]=i[z]||{_errors:[]},i[z]._errors.push(t(c))):i[z]=i[z]||{_errors:[]},i=i[z],b++}}};return n(e),o}const SM=e=>(t,o,n,r)=>{const c=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:o,issues:[]},c);if(i instanceof Promise)throw new ba;if(i.issues.length){const b=new(r?.Err??e)(i.issues.map(z=>gr(z,c,Wr())));throw n9(b,r?.callee),b}return i.value},Qa0=SM(EM),BM=e=>async(t,o,n,r)=>{const c=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:o,issues:[]},c);if(i instanceof Promise&&(i=await i),i.issues.length){const b=new(r?.Err??e)(i.issues.map(z=>gr(z,c,Wr())));throw n9(b,r?.callee),b}return i.value},Ya0=BM(EM),TM=e=>(t,o,n)=>{const r=n?{...n,async:!1}:{async:!1},c=t._zod.run({value:o,issues:[]},r);if(c instanceof Promise)throw new ba;return c.issues.length?{success:!1,error:new(e??c9)(c.issues.map(i=>gr(i,r,Wr())))}:{success:!0,data:c.value}},z10=TM(EM),PM=e=>async(t,o,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let c=t._zod.run({value:o,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(i=>gr(i,r,Wr())))}:{success:!0,data:c.value}},u10=PM(EM),d10=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return SM(e)(t,o,r)},O10=e=>(t,o,n)=>SM(e)(t,o,n),f10=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return BM(e)(t,o,r)},A10=e=>async(t,o,n)=>BM(e)(t,o,n),q10=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return TM(e)(t,o,r)},h10=e=>(t,o,n)=>TM(e)(t,o,n),m10=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return PM(e)(t,o,r)},W10=e=>async(t,o,n)=>PM(e)(t,o,n),g10=/^[cC][^\s-]{8,}$/,v10=/^[0-9a-z]+$/,y10=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,R10=/^[0-9a-vA-V]{20}$/,L10=/^[A-Za-z0-9]{27}$/,w10=/^[a-zA-Z0-9_-]{21}$/,x10=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,N10=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,V6=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_10=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,k10="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function C10(){return new RegExp(k10,"u")}const E10=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S10=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,B10=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,T10=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P10=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s9=/^[A-Za-z0-9_-]*$/,X10=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,j10=/^\+(?:[0-9]){6,14}[0-9]$/,i9="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",D10=new RegExp(`^${i9}$`);function p9(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function I10(e){return new RegExp(`^${p9(e)}$`)}function F10(e){const t=p9({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${i9}T(?:${n})$`)}const U10=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},H10=/^(?:true|false)$/i,$10=/^[^A-Z]*$/,V10=/^[^a-z]*$/,io=i0("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),b9={number:"number",bigint:"bigint",object:"date"},G10=i0("$ZodCheckLessThan",(e,t)=>{io.init(e,t);const o=b9[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:o,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Q10=i0("$ZodCheckGreaterThan",(e,t)=>{io.init(e,t);const o=b9[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:o,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Y10=i0("$ZodCheckMaxLength",(e,t)=>{var o;io.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!_O(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=CO(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),K10=i0("$ZodCheckMinLength",(e,t)=>{var o;io.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!_O(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=CO(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Z10=i0("$ZodCheckLengthEquals",(e,t)=>{var o;io.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!_O(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=n=>{const r=n.value,c=r.length;if(c===t.length)return;const i=CO(r),b=c>t.length;n.issues.push({origin:i,...b?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),XM=i0("$ZodCheckStringFormat",(e,t)=>{var o,n;io.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),J10=i0("$ZodCheckRegex",(e,t)=>{XM.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ee0=i0("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$10),XM.init(e,t)}),te0=i0("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=V10),XM.init(e,t)}),oe0=i0("$ZodCheckIncludes",(e,t)=>{io.init(e,t);const o=qa(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),ne0=i0("$ZodCheckStartsWith",(e,t)=>{io.init(e,t);const o=new RegExp(`^${qa(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),re0=i0("$ZodCheckEndsWith",(e,t)=>{io.init(e,t);const o=new RegExp(`.*${qa(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ae0=i0("$ZodCheckOverwrite",(e,t)=>{io.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class ce0{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
260
260
  `).filter(i=>i),r=Math.min(...n.map(i=>i.length-i.trimStart().length)),c=n.map(i=>i.slice(r)).map(i=>" ".repeat(this.indent*2)+i);for(const i of c)this.content.push(i)}compile(){const t=Function,o=this?.args,r=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...o,r.join(`
261
261
  `))}}const se0={major:4,minor:1,patch:12},ae=i0("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=se0;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const r of n)for(const c of r._zod.onattach)c(e);if(n.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(i,b,z)=>{let u=ea(i),f;for(const O of b){if(O._zod.def.when){if(!O._zod.def.when(i))continue}else if(u)continue;const q=i.issues.length,h=O._zod.check(i);if(h instanceof Promise&&z?.async===!1)throw new ba;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,i.issues.length!==q&&(u||(u=ea(i,q)))});else{if(i.issues.length===q)continue;u||(u=ea(i,q))}}return f?f.then(()=>i):i},c=(i,b,z)=>{if(ea(i))return i.aborted=!0,i;const u=r(b,n,z);if(u instanceof Promise){if(z.async===!1)throw new ba;return u.then(f=>e._zod.parse(f,z))}return e._zod.parse(u,z)};e._zod.run=(i,b)=>{if(b.skipChecks)return e._zod.parse(i,b);if(b.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...b,skipChecks:!0});return u instanceof Promise?u.then(f=>c(f,i,b)):c(u,i,b)}const z=e._zod.parse(i,b);if(z instanceof Promise){if(b.async===!1)throw new ba;return z.then(u=>r(u,n,b))}return r(z,n,b)}}e["~standard"]={validate:r=>{try{const c=z10(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return u10(e,r).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),jM=i0("$ZodString",(e,t)=>{ae.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??U10(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),ce=i0("$ZodStringFormat",(e,t)=>{XM.init(e,t),jM.init(e,t)}),ie0=i0("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=N10),ce.init(e,t)}),pe0=i0("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=V6(n))}else t.pattern??(t.pattern=V6());ce.init(e,t)}),be0=i0("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_10),ce.init(e,t)}),Me0=i0("$ZodURL",(e,t)=>{ce.init(e,t),e._zod.check=o=>{try{const n=o.value.trim(),r=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X10.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=r.href:o.value=n;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),le0=i0("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=C10()),ce.init(e,t)}),ze0=i0("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=w10),ce.init(e,t)}),ue0=i0("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=g10),ce.init(e,t)}),de0=i0("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=v10),ce.init(e,t)}),Oe0=i0("$ZodULID",(e,t)=>{t.pattern??(t.pattern=y10),ce.init(e,t)}),fe0=i0("$ZodXID",(e,t)=>{t.pattern??(t.pattern=R10),ce.init(e,t)}),Ae0=i0("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=L10),ce.init(e,t)}),qe0=i0("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=F10(t)),ce.init(e,t)}),he0=i0("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=D10),ce.init(e,t)}),me0=i0("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=I10(t)),ce.init(e,t)}),We0=i0("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=x10),ce.init(e,t)}),ge0=i0("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=E10),ce.init(e,t),e._zod.onattach.push(o=>{const n=o._zod.bag;n.format="ipv4"})}),ve0=i0("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=S10),ce.init(e,t),e._zod.onattach.push(o=>{const n=o._zod.bag;n.format="ipv6"}),e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),ye0=i0("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=B10),ce.init(e,t)}),Re0=i0("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=T10),ce.init(e,t),e._zod.check=o=>{const n=o.value.split("/");try{if(n.length!==2)throw new Error;const[r,c]=n;if(!c)throw new Error;const i=Number(c);if(`${i}`!==c)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function M9(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Le0=i0("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=P10),ce.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{M9(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function we0(e){if(!s9.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return M9(o)}const xe0=i0("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=s9),ce.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{we0(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Ne0=i0("$ZodE164",(e,t)=>{t.pattern??(t.pattern=j10),ce.init(e,t)});function _e0(e,t=null){try{const o=e.split(".");if(o.length!==3)return!1;const[n]=o;if(!n)return!1;const r=JSON.parse(atob(n));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const ke0=i0("$ZodJWT",(e,t)=>{ce.init(e,t),e._zod.check=o=>{_e0(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),l9=i0("$ZodBoolean",(e,t)=>{ae.init(e,t),e._zod.pattern=H10,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=!!o.value}catch{}const r=o.value;return typeof r=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),o}}),Ce0=i0("$ZodUnknown",(e,t)=>{ae.init(e,t),e._zod.parse=o=>o}),Ee0=i0("$ZodNever",(e,t)=>{ae.init(e,t),e._zod.parse=(o,n)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),Se0=i0("$ZodDate",(e,t)=>{ae.init(e,t),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=new Date(o.value)}catch{}const r=o.value,c=r instanceof Date;return c&&!Number.isNaN(r.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:r,...c?{received:"Invalid Date"}:{},inst:e}),o}});function G6(e,t,o){e.issues.length&&t.issues.push(...ta(o,e.issues)),t.value[o]=e.value}const Be0=i0("$ZodArray",(e,t)=>{ae.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),o;o.value=Array(r.length);const c=[];for(let i=0;i<r.length;i++){const b=r[i],z=t.element._zod.run({value:b,issues:[]},n);z instanceof Promise?c.push(z.then(u=>G6(u,o,i))):G6(z,o,i)}return c.length?Promise.all(c).then(()=>o):o}});function Ab(e,t,o,n){e.issues.length&&t.issues.push(...ta(o,e.issues)),e.value===void 0?o in n&&(t.value[o]=void 0):t.value[o]=e.value}function z9(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const o=n10(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function u9(e,t,o,n,r,c){const i=[],b=r.keySet,z=r.catchall._zod,u=z.def.type;for(const f of Object.keys(t)){if(b.has(f))continue;if(u==="never"){i.push(f);continue}const O=z.run({value:t[f],issues:[]},n);O instanceof Promise?e.push(O.then(q=>Ab(q,o,f,t))):Ab(O,o,f,t)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:c}),e.length?Promise.all(e).then(()=>o):o}const Te0=i0("$ZodObject",(e,t)=>{if(ae.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const b=t.shape;Object.defineProperty(t,"shape",{get:()=>{const z={...b};return Object.defineProperty(t,"shape",{value:z}),z}})}const n=NO(()=>z9(t));E1(e._zod,"propValues",()=>{const b=t.shape,z={};for(const u in b){const f=b[u]._zod;if(f.values){z[u]??(z[u]=new Set);for(const O of f.values)z[u].add(O)}}return z});const r=fb,c=t.catchall;let i;e._zod.parse=(b,z)=>{i??(i=n.value);const u=b.value;if(!r(u))return b.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),b;b.value={};const f=[],O=i.shape;for(const q of i.keys){const W=O[q]._zod.run({value:u[q],issues:[]},z);W instanceof Promise?f.push(W.then(g=>Ab(g,b,q,u))):Ab(W,b,q,u)}return c?u9(f,u,b,z,n.value,e):f.length?Promise.all(f).then(()=>b):b}}),Pe0=i0("$ZodObjectJIT",(e,t)=>{Te0.init(e,t);const o=e._zod.parse,n=NO(()=>z9(t)),r=q=>{const h=new ce0(["shape","payload","ctx"]),W=n.value,g=x=>{const R=$6(x);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let w=0;for(const x of W.keys)v[x]=`key_${w++}`;h.write("const newResult = {};");for(const x of W.keys){const R=v[x],_=$6(x);h.write(`const ${R} = ${g(x)};`),h.write(`
262
262
  if (${R}.issues.length) {
@@ -276,4 +276,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
276
276
  }
277
277
 
278
278
  `)}h.write("payload.value = newResult;"),h.write("return payload;");const N=h.compile();return(x,R)=>N(q,x,R)};let c;const i=fb,b=!o9.jitless,u=b&&t10.value,f=t.catchall;let O;e._zod.parse=(q,h)=>{O??(O=n.value);const W=q.value;return i(W)?b&&u&&h?.async===!1&&h.jitless!==!0?(c||(c=r(t.shape)),q=c(q,h),f?u9([],W,q,h,O,e):q):o(q,h):(q.issues.push({expected:"object",code:"invalid_type",input:W,inst:e}),q)}});function Q6(e,t,o,n){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!ea(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(c=>c.issues.map(i=>gr(i,n,Wr())))}),t)}const Xe0=i0("$ZodUnion",(e,t)=>{ae.init(e,t),E1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),E1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),E1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),E1(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>kO(c.source)).join("|")})$`)}});const o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(o)return n(r,c);let i=!1;const b=[];for(const z of t.options){const u=z._zod.run({value:r.value,issues:[]},c);if(u instanceof Promise)b.push(u),i=!0;else{if(u.issues.length===0)return u;b.push(u)}}return i?Promise.all(b).then(z=>Q6(z,r,e,c)):Q6(b,r,e,c)}}),je0=i0("$ZodIntersection",(e,t)=>{ae.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,c=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return c instanceof Promise||i instanceof Promise?Promise.all([c,i]).then(([z,u])=>Y6(o,z,u)):Y6(o,c,i)}});function fu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Aa(e)&&Aa(t)){const o=Object.keys(t),n=Object.keys(e).filter(c=>o.indexOf(c)!==-1),r={...e,...t};for(const c of n){const i=fu(e[c],t[c]);if(!i.valid)return{valid:!1,mergeErrorPath:[c,...i.mergeErrorPath]};r[c]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const r=e[n],c=t[n],i=fu(r,c);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Y6(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),ea(e))return e;const n=fu(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const De0=i0("$ZodRecord",(e,t)=>{ae.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Aa(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const c=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const z of i)if(typeof z=="string"||typeof z=="number"||typeof z=="symbol"){const u=t.valueType._zod.run({value:r[z],issues:[]},n);u instanceof Promise?c.push(u.then(f=>{f.issues.length&&o.issues.push(...ta(z,f.issues)),o.value[z]=f.value})):(u.issues.length&&o.issues.push(...ta(z,u.issues)),o.value[z]=u.value)}let b;for(const z in r)i.has(z)||(b=b??[],b.push(z));b&&b.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:b})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const b=t.keyType._zod.run({value:i,issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(u=>gr(u,n,Wr())),input:i,path:[i],inst:e}),o.value[b.value]=b.value;continue}const z=t.valueType._zod.run({value:r[i],issues:[]},n);z instanceof Promise?c.push(z.then(u=>{u.issues.length&&o.issues.push(...ta(i,u.issues)),o.value[b.value]=u.value})):(z.issues.length&&o.issues.push(...ta(i,z.issues)),o.value[b.value]=z.value)}}return c.length?Promise.all(c).then(()=>o):o}}),Ie0=i0("$ZodEnum",(e,t)=>{ae.init(e,t);const o=e10(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>o10.has(typeof r)).map(r=>typeof r=="string"?qa(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),Fe0=i0("$ZodLiteral",(e,t)=>{if(ae.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?qa(o):o?qa(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{const r=o.value;return e._zod.values.has(r)||o.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),o}}),Ue0=i0("$ZodTransform",(e,t)=>{ae.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new t9(e.constructor.name);const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new ba;return o.value=r,o}});function K6(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const He0=i0("$ZodOptional",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.optout="optional",E1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),E1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${kO(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(c=>K6(c,o.value)):K6(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),$e0=i0("$ZodNullable",(e,t)=>{ae.init(e,t),E1(e._zod,"optin",()=>t.innerType._zod.optin),E1(e._zod,"optout",()=>t.innerType._zod.optout),E1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${kO(o.source)}|null)$`):void 0}),E1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),Ve0=i0("$ZodDefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",E1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(c=>Z6(c,t)):Z6(r,t)}});function Z6(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ge0=i0("$ZodPrefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",E1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),Qe0=i0("$ZodNonOptional",(e,t)=>{ae.init(e,t),E1(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(c=>J6(c,e)):J6(r,e)}});function J6(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ye0=i0("$ZodCatch",(e,t)=>{ae.init(e,t),E1(e._zod,"optin",()=>t.innerType._zod.optin),E1(e._zod,"optout",()=>t.innerType._zod.optout),E1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(c=>(o.value=c.value,c.issues.length&&(o.value=t.catchValue({...o,error:{issues:c.issues.map(i=>gr(i,n,Wr()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(c=>gr(c,n,Wr()))},input:o.value}),o.issues=[]),o)}}),Ke0=i0("$ZodPipe",(e,t)=>{ae.init(e,t),E1(e._zod,"values",()=>t.in._zod.values),E1(e._zod,"optin",()=>t.in._zod.optin),E1(e._zod,"optout",()=>t.out._zod.optout),E1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const c=t.out._zod.run(o,n);return c instanceof Promise?c.then(i=>up(i,t.in,n)):up(c,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(c=>up(c,t.out,n)):up(r,t.out,n)}});function up(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const d9=i0("$ZodCodec",(e,t)=>{ae.init(e,t),E1(e._zod,"values",()=>t.in._zod.values),E1(e._zod,"optin",()=>t.in._zod.optin),E1(e._zod,"optout",()=>t.out._zod.optout),E1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){const c=t.in._zod.run(o,n);return c instanceof Promise?c.then(i=>dp(i,t,n)):dp(c,t,n)}else{const c=t.out._zod.run(o,n);return c instanceof Promise?c.then(i=>dp(i,t,n)):dp(c,t,n)}}});function dp(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(c=>Op(e,c,t.out,o)):Op(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(c=>Op(e,c,t.in,o)):Op(e,r,t.in,o)}}function Op(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const Ze0=i0("$ZodReadonly",(e,t)=>{ae.init(e,t),E1(e._zod,"propValues",()=>t.innerType._zod.propValues),E1(e._zod,"values",()=>t.innerType._zod.values),E1(e._zod,"optin",()=>t.innerType._zod.optin),E1(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(eq):eq(r)}});function eq(e){return e.value=Object.freeze(e.value),e}const Je0=i0("$ZodCustom",(e,t)=>{io.init(e,t),ae.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(c=>tq(c,o,n,e));tq(r,o,n,e)}});function tq(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(ts(r))}}class et0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function tt0(){return new et0}const fp=tt0();function ot0(e,t){return new e({type:"string",...K0(t)})}function nt0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...K0(t)})}function oq(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...K0(t)})}function rt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...K0(t)})}function at0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K0(t)})}function ct0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K0(t)})}function st0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K0(t)})}function it0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K0(t)})}function pt0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...K0(t)})}function bt0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...K0(t)})}function Mt0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...K0(t)})}function lt0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...K0(t)})}function zt0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...K0(t)})}function ut0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...K0(t)})}function dt0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...K0(t)})}function Ot0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...K0(t)})}function ft0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...K0(t)})}function At0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K0(t)})}function qt0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K0(t)})}function ht0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...K0(t)})}function mt0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...K0(t)})}function Wt0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...K0(t)})}function gt0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...K0(t)})}function vt0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K0(t)})}function yt0(e,t){return new e({type:"string",format:"date",check:"string_format",...K0(t)})}function Rt0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...K0(t)})}function Lt0(e,t){return new e({type:"string",format:"duration",check:"string_format",...K0(t)})}function wt0(e,t){return new e({type:"boolean",...K0(t)})}function xt0(e){return new e({type:"unknown"})}function Nt0(e,t){return new e({type:"never",...K0(t)})}function _t0(e,t){return new e({type:"date",...K0(t)})}function kt0(e,t){return new G10({check:"less_than",...K0(t),value:e,inclusive:!0})}function Ct0(e,t){return new Q10({check:"greater_than",...K0(t),value:e,inclusive:!0})}function O9(e,t){return new Y10({check:"max_length",...K0(t),maximum:e})}function qb(e,t){return new K10({check:"min_length",...K0(t),minimum:e})}function f9(e,t){return new Z10({check:"length_equals",...K0(t),length:e})}function Et0(e,t){return new J10({check:"string_format",format:"regex",...K0(t),pattern:e})}function St0(e){return new ee0({check:"string_format",format:"lowercase",...K0(e)})}function Bt0(e){return new te0({check:"string_format",format:"uppercase",...K0(e)})}function Tt0(e,t){return new oe0({check:"string_format",format:"includes",...K0(t),includes:e})}function Pt0(e,t){return new ne0({check:"string_format",format:"starts_with",...K0(t),prefix:e})}function Xt0(e,t){return new re0({check:"string_format",format:"ends_with",...K0(t),suffix:e})}function Xs(e){return new ae0({check:"overwrite",tx:e})}function jt0(e){return Xs(t=>t.normalize(e))}function Dt0(){return Xs(e=>e.trim())}function It0(){return Xs(e=>e.toLowerCase())}function Ft0(){return Xs(e=>e.toUpperCase())}function Ut0(e,t,o){return new e({type:"array",element:t,...K0(o)})}function Ht0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...K0(o)})}function $t0(e){const t=Vt0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(ts(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(ts(r))}},e(o.value,o)));return t}function Vt0(e,t){const o=new io({check:"custom",...K0(t)});return o._zod.check=e,o}function Gt0(e,t){const o=K0(t);let n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(n=n.map(h=>typeof h=="string"?h.toLowerCase():h),r=r.map(h=>typeof h=="string"?h.toLowerCase():h));const c=new Set(n),i=new Set(r),b=e.Codec??d9,z=e.Boolean??l9,u=e.String??jM,f=new u({type:"string",error:o.error}),O=new z({type:"boolean",error:o.error}),q=new b({type:"pipe",in:f,out:O,transform:((h,W)=>{let g=h;return o.case!=="sensitive"&&(g=g.toLowerCase()),c.has(g)?!0:i.has(g)?!1:(W.issues.push({code:"invalid_value",expected:"stringbool",values:[...c,...i],input:W.value,inst:q,continue:!1}),{})}),reverseTransform:((h,W)=>h===!0?n[0]||"true":r[0]||"false"),error:o.error});return q}const Qt0=i0("ZodISODateTime",(e,t)=>{qe0.init(e,t),Me.init(e,t)});function A9(e){return vt0(Qt0,e)}const Yt0=i0("ZodISODate",(e,t)=>{he0.init(e,t),Me.init(e,t)});function Kt0(e){return yt0(Yt0,e)}const Zt0=i0("ZodISOTime",(e,t)=>{me0.init(e,t),Me.init(e,t)});function Jt0(e){return Rt0(Zt0,e)}const eo0=i0("ZodISODuration",(e,t)=>{We0.init(e,t),Me.init(e,t)});function to0(e){return Lt0(eo0,e)}const oo0=(e,t)=>{c9.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>l10(e,o)},flatten:{value:o=>M10(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Ou,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Ou,2)}},isEmpty:{get(){return e.issues.length===0}}})},po=i0("ZodError",oo0,{Parent:Error}),no0=SM(po),ro0=BM(po),ao0=TM(po),co0=PM(po),so0=d10(po),io0=O10(po),po0=f10(po),bo0=A10(po),Mo0=q10(po),lo0=h10(po),zo0=m10(po),uo0=W10(po),Ae=i0("ZodType",(e,t)=>(ae.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone(O2(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>xr(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>no0(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>ao0(e,o,n),e.parseAsync=async(o,n)=>ro0(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>co0(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>so0(e,o,n),e.decode=(o,n)=>io0(e,o,n),e.encodeAsync=async(o,n)=>po0(e,o,n),e.decodeAsync=async(o,n)=>bo0(e,o,n),e.safeEncode=(o,n)=>Mo0(e,o,n),e.safeDecode=(o,n)=>lo0(e,o,n),e.safeEncodeAsync=async(o,n)=>zo0(e,o,n),e.safeDecodeAsync=async(o,n)=>uo0(e,o,n),e.refine=(o,n)=>e.check(an0(o,n)),e.superRefine=o=>e.check(cn0(o)),e.overwrite=o=>e.check(Xs(o)),e.optional=()=>rq(e),e.nullable=()=>aq(e),e.nullish=()=>rq(aq(e)),e.nonoptional=o=>Zo0(e,o),e.array=()=>EO(e),e.or=o=>Xo0([e,o]),e.and=o=>Do0(e,o),e.transform=o=>cq(e,$o0(o)),e.default=o=>Qo0(e,o),e.prefault=o=>Ko0(e,o),e.catch=o=>en0(e,o),e.pipe=o=>cq(e,o),e.readonly=()=>nn0(e),e.describe=o=>{const n=e.clone();return fp.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return fp.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return fp.get(e);const n=e.clone();return fp.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),q9=i0("_ZodString",(e,t)=>{jM.init(e,t),Ae.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(Et0(...n)),e.includes=(...n)=>e.check(Tt0(...n)),e.startsWith=(...n)=>e.check(Pt0(...n)),e.endsWith=(...n)=>e.check(Xt0(...n)),e.min=(...n)=>e.check(qb(...n)),e.max=(...n)=>e.check(O9(...n)),e.length=(...n)=>e.check(f9(...n)),e.nonempty=(...n)=>e.check(qb(1,...n)),e.lowercase=n=>e.check(St0(n)),e.uppercase=n=>e.check(Bt0(n)),e.trim=()=>e.check(Dt0()),e.normalize=(...n)=>e.check(jt0(...n)),e.toLowerCase=()=>e.check(It0()),e.toUpperCase=()=>e.check(Ft0())}),h9=i0("ZodString",(e,t)=>{jM.init(e,t),q9.init(e,t),e.email=o=>e.check(nt0(do0,o)),e.url=o=>e.check(it0(Oo0,o)),e.jwt=o=>e.check(gt0(_o0,o)),e.emoji=o=>e.check(pt0(fo0,o)),e.guid=o=>e.check(oq(nq,o)),e.uuid=o=>e.check(rt0(Ap,o)),e.uuidv4=o=>e.check(at0(Ap,o)),e.uuidv6=o=>e.check(ct0(Ap,o)),e.uuidv7=o=>e.check(st0(Ap,o)),e.nanoid=o=>e.check(bt0(Ao0,o)),e.guid=o=>e.check(oq(nq,o)),e.cuid=o=>e.check(Mt0(qo0,o)),e.cuid2=o=>e.check(lt0(ho0,o)),e.ulid=o=>e.check(zt0(mo0,o)),e.base64=o=>e.check(ht0(wo0,o)),e.base64url=o=>e.check(mt0(xo0,o)),e.xid=o=>e.check(ut0(Wo0,o)),e.ksuid=o=>e.check(dt0(go0,o)),e.ipv4=o=>e.check(Ot0(vo0,o)),e.ipv6=o=>e.check(ft0(yo0,o)),e.cidrv4=o=>e.check(At0(Ro0,o)),e.cidrv6=o=>e.check(qt0(Lo0,o)),e.e164=o=>e.check(Wt0(No0,o)),e.datetime=o=>e.check(A9(o)),e.date=o=>e.check(Kt0(o)),e.time=o=>e.check(Jt0(o)),e.duration=o=>e.check(to0(o))});function vt(e){return ot0(h9,e)}const Me=i0("ZodStringFormat",(e,t)=>{ce.init(e,t),q9.init(e,t)}),do0=i0("ZodEmail",(e,t)=>{be0.init(e,t),Me.init(e,t)}),nq=i0("ZodGUID",(e,t)=>{ie0.init(e,t),Me.init(e,t)}),Ap=i0("ZodUUID",(e,t)=>{pe0.init(e,t),Me.init(e,t)}),Oo0=i0("ZodURL",(e,t)=>{Me0.init(e,t),Me.init(e,t)}),fo0=i0("ZodEmoji",(e,t)=>{le0.init(e,t),Me.init(e,t)}),Ao0=i0("ZodNanoID",(e,t)=>{ze0.init(e,t),Me.init(e,t)}),qo0=i0("ZodCUID",(e,t)=>{ue0.init(e,t),Me.init(e,t)}),ho0=i0("ZodCUID2",(e,t)=>{de0.init(e,t),Me.init(e,t)}),mo0=i0("ZodULID",(e,t)=>{Oe0.init(e,t),Me.init(e,t)}),Wo0=i0("ZodXID",(e,t)=>{fe0.init(e,t),Me.init(e,t)}),go0=i0("ZodKSUID",(e,t)=>{Ae0.init(e,t),Me.init(e,t)}),vo0=i0("ZodIPv4",(e,t)=>{ge0.init(e,t),Me.init(e,t)}),yo0=i0("ZodIPv6",(e,t)=>{ve0.init(e,t),Me.init(e,t)}),Ro0=i0("ZodCIDRv4",(e,t)=>{ye0.init(e,t),Me.init(e,t)}),Lo0=i0("ZodCIDRv6",(e,t)=>{Re0.init(e,t),Me.init(e,t)}),wo0=i0("ZodBase64",(e,t)=>{Le0.init(e,t),Me.init(e,t)}),xo0=i0("ZodBase64URL",(e,t)=>{xe0.init(e,t),Me.init(e,t)}),No0=i0("ZodE164",(e,t)=>{Ne0.init(e,t),Me.init(e,t)}),_o0=i0("ZodJWT",(e,t)=>{ke0.init(e,t),Me.init(e,t)}),m9=i0("ZodBoolean",(e,t)=>{l9.init(e,t),Ae.init(e,t)});function jp(e){return wt0(m9,e)}const ko0=i0("ZodUnknown",(e,t)=>{Ce0.init(e,t),Ae.init(e,t)});function Au(){return xt0(ko0)}const Co0=i0("ZodNever",(e,t)=>{Ee0.init(e,t),Ae.init(e,t)});function Eo0(e){return Nt0(Co0,e)}const So0=i0("ZodDate",(e,t)=>{Se0.init(e,t),Ae.init(e,t),e.min=(n,r)=>e.check(Ct0(n,r)),e.max=(n,r)=>e.check(kt0(n,r));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function Bo0(e){return _t0(So0,e)}const To0=i0("ZodArray",(e,t)=>{Be0.init(e,t),Ae.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(qb(o,n)),e.nonempty=o=>e.check(qb(1,o)),e.max=(o,n)=>e.check(O9(o,n)),e.length=(o,n)=>e.check(f9(o,n)),e.unwrap=()=>e.element});function EO(e,t){return Ut0(To0,e,t)}const W9=i0("ZodObject",(e,t)=>{Pe0.init(e,t),Ae.init(e,t),E1(e,"shape",()=>t.shape),e.keyof=()=>g9(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Au()}),e.loose=()=>e.clone({...e._zod.def,catchall:Au()}),e.strict=()=>e.clone({...e._zod.def,catchall:Eo0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>c10(e,o),e.safeExtend=o=>s10(e,o),e.merge=o=>i10(e,o),e.pick=o=>r10(e,o),e.omit=o=>a10(e,o),e.partial=(...o)=>p10(v9,e,o[0]),e.required=(...o)=>b10(y9,e,o[0])});function hb(e,t){const o={type:"object",shape:e??{},...K0(t)};return new W9(o)}function js(e,t){return new W9({type:"object",shape:e,catchall:Au(),...K0(t)})}const Po0=i0("ZodUnion",(e,t)=>{Xe0.init(e,t),Ae.init(e,t),e.options=t.options});function Xo0(e,t){return new Po0({type:"union",options:e,...K0(t)})}const jo0=i0("ZodIntersection",(e,t)=>{je0.init(e,t),Ae.init(e,t)});function Do0(e,t){return new jo0({type:"intersection",left:e,right:t})}const Io0=i0("ZodRecord",(e,t)=>{De0.init(e,t),Ae.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Fo0(e,t,o){return new Io0({type:"record",keyType:e,valueType:t,...K0(o)})}const qu=i0("ZodEnum",(e,t)=>{Ie0.init(e,t),Ae.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const c={};for(const i of n)if(o.has(i))c[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new qu({...t,checks:[],...K0(r),entries:c})},e.exclude=(n,r)=>{const c={...t.entries};for(const i of n)if(o.has(i))delete c[i];else throw new Error(`Key ${i} not found in enum`);return new qu({...t,checks:[],...K0(r),entries:c})}});function g9(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new qu({type:"enum",entries:o,...K0(t)})}const Uo0=i0("ZodLiteral",(e,t)=>{Fe0.init(e,t),Ae.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ka0(e,t){return new Uo0({type:"literal",values:Array.isArray(e)?e:[e],...K0(t)})}const Ho0=i0("ZodTransform",(e,t)=>{Ue0.init(e,t),Ae.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new t9(e.constructor.name);o.addIssue=c=>{if(typeof c=="string")o.issues.push(ts(c,o.value,t));else{const i=c;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(ts(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(c=>(o.value=c,o)):(o.value=r,o)}});function $o0(e){return new Ho0({type:"transform",transform:e})}const v9=i0("ZodOptional",(e,t)=>{He0.init(e,t),Ae.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rq(e){return new v9({type:"optional",innerType:e})}const Vo0=i0("ZodNullable",(e,t)=>{$e0.init(e,t),Ae.init(e,t),e.unwrap=()=>e._zod.def.innerType});function aq(e){return new Vo0({type:"nullable",innerType:e})}const Go0=i0("ZodDefault",(e,t)=>{Ve0.init(e,t),Ae.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qo0(e,t){return new Go0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():r9(t)}})}const Yo0=i0("ZodPrefault",(e,t)=>{Ge0.init(e,t),Ae.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ko0(e,t){return new Yo0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():r9(t)}})}const y9=i0("ZodNonOptional",(e,t)=>{Qe0.init(e,t),Ae.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Zo0(e,t){return new y9({type:"nonoptional",innerType:e,...K0(t)})}const Jo0=i0("ZodCatch",(e,t)=>{Ye0.init(e,t),Ae.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function en0(e,t){return new Jo0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const R9=i0("ZodPipe",(e,t)=>{Ke0.init(e,t),Ae.init(e,t),e.in=t.in,e.out=t.out});function cq(e,t){return new R9({type:"pipe",in:e,out:t})}const L9=i0("ZodCodec",(e,t)=>{R9.init(e,t),d9.init(e,t)});function tn0(e,t,o){return new L9({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const on0=i0("ZodReadonly",(e,t)=>{Ze0.init(e,t),Ae.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nn0(e){return new on0({type:"readonly",innerType:e})}const rn0=i0("ZodCustom",(e,t)=>{Je0.init(e,t),Ae.init(e,t)});function an0(e,t={}){return Ht0(rn0,e,t)}function cn0(e){return $t0(e)}const sn0=(...e)=>Gt0({Codec:L9,Boolean:m9,String:h9},...e),SO=tn0(A9({offset:!0}),Bo0(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),in0=js({slug:vt(),title:vt(),custom_excerpt:vt().nullish(),url:vt().url(),published_at:SO,featured:sn0(),feature_image:vt().url().nullish(),html:vt().nullish()}).transform(e=>({slug:e.slug,title:e.title,customExcerpt:e.custom_excerpt,url:e.url,publishedAt:e.published_at,featured:e.featured,featureImage:e.feature_image,html:e.html})),pn0=hb({posts:EO(in0).default([]),changelogUrl:vt().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),Ds=()=>Pt({queryKey:["changelog"],queryFn:async()=>{const e=await fetch("https://ghost.org/changelog.json");if(!e.ok)throw new Error(`Failed to fetch changelog: ${e.status}`);const t=await e.json();return pn0.parse(t)},staleTime:1/0});function sq(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function w9(e,t){const o={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n],c=e[n];r!==void 0&&(sq(r)&&sq(c)?o[n]=w9(c,r):o[n]=r)}return o}const bn0=js({lastSeenDate:SO.optional().catch(void 0)}),Vr={completedSteps:[],checklistState:"pending",startedAt:void 0},Mn0=js({completedSteps:EO(vt()).default(Vr.completedSteps).catch(Vr.completedSteps),checklistState:g9(["pending","started","completed","dismissed"]).default(Vr.checklistState).catch(Vr.checklistState),startedAt:SO.optional().catch(Vr.startedAt)}),hu={expanded:{posts:!0,members:!0},menu:{visible:!0}},ln0=js({expanded:hb({posts:jp(),members:jp().default(!0)}),menu:hb({visible:jp()})}),mu=js({whatsNew:bn0.optional().catch(void 0),nightShift:jp().optional(),onboarding:Mn0.default(Vr).catch(Vr),navigation:ln0.default(hu).catch(hu)}),x9=e=>["userPreferences",e?.id,e?.accessibility];function Is(e){const{data:t}=me();return Pt({...e,queryKey:x9(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return mu.parse(n)},enabled:!!t,keepPreviousData:!0,staleTime:1/0,cacheTime:0})}const Fs=()=>{const e=v1(),{data:t}=me(),{mutateAsync:o}=Zv();return re({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(x9(t))??mu.parse({}),c=w9(r,n),i=mu.encode(c);await o({...t,accessibility:JSON.stringify(i)})}})};function zn0(){return{lastSeenDate:new Date}}const un0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],BO=()=>{const{data:e,isSuccess:t}=Is(),{data:o,isSuccess:n}=Ds(),{mutateAsync:r}=Fs(),c=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!c&&t&&r({whatsNew:zn0()})},[c,t,r]);const i=o?.entries[0];return Pt({queryKey:un0(e,i),queryFn:()=>{if(!i)return{hasNew:!1};const b=e.whatsNew.lastSeenDate;return{hasNew:i.publishedAt>b}},enabled:n&&c,staleTime:1/0,cacheTime:0})},N9=()=>{const{data:e}=Ds(),{mutateAsync:t}=Fs();return re({mutationFn:async()=>{const o=e?.entries[0];if(!o)return;const n={lastSeenDate:o.publishedAt};await t({whatsNew:n})}})};function dn0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function On0({entry:e}){return l.jsxs("a",{className:"-mx-2 flex items-start gap-6 rounded-md p-2 transition-colors hover:bg-muted/80","data-test-entry":!0,href:e.url,rel:"noopener noreferrer",target:"_blank",children:[e.featureImage&&l.jsx("img",{alt:e.title,className:"h-[110px] w-40 flex-shrink-0 rounded object-cover","data-test-entry-image":!0,src:e.featureImage}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[l.jsx("h2",{className:"mt-1.5 text-[17px] font-semibold text-foreground","data-test-entry-title":!0,children:e.title}),l.jsx("p",{className:"line-clamp-2 text-sm leading-[1.45] text-gray-700","data-test-entry-excerpt":!0,children:e.customExcerpt}),l.jsx("span",{className:"text-sm text-gray-600","data-test-entry-date":!0,children:dn0(e.publishedAt)})]})]})}function fn0({open:e,onOpenChange:t}){const{data:o}=Ds(),{mutate:n}=N9();return p.useEffect(()=>{e&&n()},[e,n]),l.jsx(Ss,{open:e,onOpenChange:t,children:l.jsxs(ka,{className:"flex max-h-[85vh] max-w-2xl flex-col","data-test-modal":"whats-new",role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-modal-title",children:[l.jsx(gM,{children:l.jsx(yM,{id:"whats-new-modal-title","data-test-modal-title":!0,className:"text-2xl tracking-tighter",children:"What’s new?"})}),o?l.jsxs(l.Fragment,{children:[l.jsx("section",{className:"-mx-6 flex-1 space-y-2 overflow-y-auto px-6","data-test-entries":!0,children:o.entries.map(r=>l.jsx(On0,{entry:r},r.slug))}),l.jsxs(vM,{className:"flex-row justify-between gap-3 sm:justify-between",children:[l.jsx(z1,{asChild:!0,variant:"outline",children:l.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:o.changelogUrl,rel:"noopener noreferrer",target:"_blank",children:"All updates →"})})]})]}):l.jsx("div",{className:"flex flex-1 items-center justify-center py-12",children:l.jsx(Ob,{size:"lg"})})]})})}function _9(){const e=k7(),t=!!e?.subscription?.isActiveTrial,o=e?.subscription?.trial_end?Math.ceil((new Date(e.subscription.trial_end).getTime()-Date.now())/(1e3*60*60*24)):0;return{showUpgradeBanner:t,trialDaysRemaining:o}}function An0({children:e,...t}){return l.jsx("span",{className:"flex-1",...t,children:e})}const it=({children:e,...t})=>l.jsx(R7,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});it.Label=An0;function mb(e){const t=me();return l.jsxs(RO,{...e,children:[t.data?.profile_image&&l.jsx(yO,{src:t.data?.profile_image}),l.jsx(mM,{className:"text-foreground-muted hover:text-foreground",children:l.jsx(OM,{})})]})}function k9({name:e,email:t,children:o}){return l.jsx("div",{className:"p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[o,l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.jsx("span",{className:"truncate text-base font-semibold text-foreground",children:e}),l.jsx("span",{className:"text-foreground-muted -mt-px truncate text-xs",children:t})]})]})})}function C9(){const e=me();return l.jsx(it,{children:l.jsxs(gs,{to:`/settings/staff/${e.data?.slug}`,children:[l.jsx(OM,{}),l.jsx(it.Label,{children:"Your profile"})]})})}function E9(){const{data:e}=Is(),{mutateAsync:t,isLoading:o}=Fs(),n=r=>{t({nightShift:r})};return l.jsxs(it,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[l.jsx(gK,{}),l.jsx(it.Label,{className:"flex-1",children:"Dark mode"}),l.jsx(Kv,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function S9(){const e=()=>{const{apiRoot:t,adminRoot:o}=Qb();fetch(`${t}/session`,{method:"DELETE"}).then(()=>{window.location.href=o}).catch(n=>{console.error(n)})};return l.jsxs(it,{asChild:!1,onSelect:e,children:[l.jsx(lK,{}),l.jsx(it.Label,{children:"Sign out"})]})}function qn0(e){const t=me(),{data:o}=BO(),{showUpgradeBanner:n}=_9();return l.jsxs(v7,{...e,children:[l.jsx(y7,{asChild:!0,className:"focus-visible:ring-0",children:l.jsxs(_M,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground","aria-label":"User menu",children:[l.jsxs("div",{className:"relative",children:[l.jsx(mb,{}),o?.hasNew&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:l.jsx(U6,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-avatar-badge":!0})})]}),l.jsxs("div",{className:"grid flex-1 text-left text-base leading-tight",children:[l.jsx("span",{className:"truncate font-semibold",children:t.data?.name}),l.jsx("span",{className:"-mt-px truncate text-xs text-muted-foreground",children:t.data?.email})]}),l.jsx(TY,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),l.jsxs(OO,{align:"start",sideOffset:10,className:`w-[var(--radix-dropdown-menu-trigger-width)] ${n?"shadow-[0_18px_80px_0_rgba(0,0,0,0.07),0_7.52px_33.422px_0_rgba(0,0,0,0.05),0_4.021px_17.869px_0_rgba(0,0,0,0.04),0_2.254px_10.017px_0_rgba(0,0,0,0.04),0_1.197px_5.32px_0_rgba(0,0,0,0.03),0_0.498px_2.214px_0_rgba(0,0,0,0.02)]":""}`,children:[l.jsx(k9,{name:t.data?.name,email:t.data?.email,children:l.jsx(mb,{})}),l.jsx(e2,{}),l.jsxs(it,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{e.onOpenWhatsNew?.()},children:[l.jsx(q7,{}),l.jsx(it.Label,{children:"What’s new?"}),o?.hasNew&&l.jsx("div",{className:"flex flex-1 justify-end",children:l.jsx(U6,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),l.jsx(C9,{}),l.jsx(e2,{}),l.jsx(it,{children:l.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[l.jsx(LY,{}),l.jsx(it.Label,{children:"Resources & guides"})]})}),l.jsx(E9,{}),l.jsx(e2,{}),l.jsx(S9,{})]})]})}function hn0(){const e=me(),o=CM().data?.site.url??"";return l.jsxs(v7,{children:[l.jsx(y7,{asChild:!0,children:l.jsx("button",{className:"flex items-center justify-center rounded-full border border-border bg-background p-0.5 shadow-lg transition-shadow hover:shadow-xl focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 dark:bg-muted","aria-label":"Open user menu",children:l.jsx(mb,{className:"h-11 w-11"})})}),l.jsxs(OO,{align:"start",side:"top",sideOffset:10,className:"mb-2 min-w-56",children:[l.jsx(k9,{name:e.data?.name,email:e.data?.email,children:l.jsx(mb,{})}),l.jsx(e2,{}),l.jsx(it,{children:l.jsxs(gs,{to:"/posts",children:[l.jsx(KY,{}),l.jsx(it.Label,{children:"Posts"})]})}),l.jsx(it,{children:l.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[l.jsx(bO,{}),l.jsx(it.Label,{children:"View site"})]})}),l.jsx(e2,{}),l.jsx(C9,{}),l.jsx(E9,{}),l.jsx(e2,{}),l.jsx(S9,{})]})]})}const Za0=null,TO="CustomThemeSettingsResponseType",mn0=TO,Ja0=Yo({dataType:TO,path:"/custom_theme_settings/"}),ec0=Xe({method:"PUT",path:()=>"/custom_theme_settings/",body:e=>({custom_theme_settings:e}),updateQueries:{emberUpdateType:"skip",dataType:TO,update:e=>e}}),Ta="ThemesResponseType",tc0=Yo({dataType:Ta,path:"/themes/"}),Wn0=Yo({dataType:Ta,path:"/themes/active/"}),oc0=Xe({method:"PUT",path:e=>`/themes/${e}/activate/`,updateQueries:{dataType:Ta,emberUpdateType:"createOrUpdate",update:(e,t)=>({...t,themes:t.themes.map(o=>{const n=e.themes.find(({name:r})=>r===o.name);return n||{...o,active:!1}})})},invalidateQueries:{dataType:mn0}}),nc0=Xe({method:"DELETE",path:e=>`/themes/${e}/`,updateQueries:{dataType:Ta,emberUpdateType:"delete",update:(e,t,o)=>({...t,themes:t.themes.filter(n=>n.name!==o)})}}),rc0=Xe({method:"POST",path:()=>"/themes/install/",searchParams:e=>({source:"github",ref:e}),updateQueries:{dataType:Ta,emberUpdateType:"createOrUpdate",update:(e,t)=>t&&{...t,themes:[...t.themes,...e.themes]}}}),ac0=Xe({method:"POST",path:()=>"/themes/upload/",body:({file:e})=>{const t=new FormData;return t.append("file",e),t},updateQueries:{dataType:Ta,emberUpdateType:"createOrUpdate",update:(e,t)=>t&&{...t,themes:[...t.themes,...e.themes]}}});function gn0(e){return e.active}function B9(e){return e.name.toLowerCase()==="source"}function T9(e){return e.name.toLowerCase()==="casper"}function cc0(e){return B9(e)||T9(e)}function sc0(e){return!B9(e)&&!T9(e)&&!gn0(e)}function vn0(e){return e.code==="GS110-NO-MISSING-PAGE-BUILDER-USAGE"&&!!e.failures?.[0]?.message?.includes("show_title_and_feature_image")}function P9(){const{data:e}=me(),t=e&&Ps(e),{data:o}=Wn0({enabled:!t}),n=o?.themes?.[0],r=n?.errors??[],c=n?.warnings??[],i=r.filter(z=>!vn0(z));return{hasErrors:i.length>0,errors:i,warnings:c}}function iq({error:e}){const[t,o]=p.useState(!1);return l.jsxs("li",{className:"border-b border-border last:border-0",children:[l.jsxs("button",{className:"flex w-full items-center gap-2 py-3 text-left text-sm font-medium",type:"button",onClick:()=>o(!t),children:[l.jsx(dM,{className:`size-4 shrink-0 text-muted-foreground transition-transform duration-200 ${t?"rotate-90":""}`}),l.jsx("span",{children:e.rule})]}),t&&l.jsxs("div",{className:"pb-3 pl-6 text-sm text-muted-foreground",children:[l.jsx("p",{dangerouslySetInnerHTML:{__html:e.details}}),e.failures?.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("h6",{className:"text-xs font-semibold text-muted-foreground uppercase",children:"Affected files:"}),l.jsx("ul",{className:"mt-1 list-disc pl-4",children:e.failures.map((n,r)=>l.jsxs("li",{children:[l.jsx("code",{className:"text-xs",children:n.ref}),n.message&&l.jsxs(l.Fragment,{children:[": ",n.message]})]},r))})]})]})]})}function yn0({open:e,onOpenChange:t,errors:o,warnings:n}){return l.jsx(Ss,{open:e,onOpenChange:t,children:l.jsxs(ka,{className:"flex max-h-[85vh] max-w-lg flex-col",children:[l.jsx(gM,{children:l.jsx(yM,{className:"text-2xl tracking-tighter",children:"Theme errors"})}),l.jsxs("section",{className:"-mx-6 flex-1 overflow-y-auto px-6",children:[o.length>0&&l.jsxs("div",{children:[l.jsx("h2",{className:"mb-1 text-sm font-semibold",children:"Errors"}),l.jsx("p",{className:"mb-2 text-xs text-muted-foreground",children:"Highly recommended to fix, functionality could be restricted"}),l.jsx("ul",{className:"border-t border-border",children:o.map((r,c)=>l.jsx(iq,{error:r},c))})]}),n.length>0&&l.jsxs("div",{className:o.length>0?"mt-4":"",children:[l.jsx("h2",{className:"mb-1 text-sm font-semibold",children:"Warnings"}),l.jsx("ul",{className:"border-t border-border",children:n.map((r,c)=>l.jsx(iq,{error:r},c))})]})]}),l.jsx(vM,{children:l.jsx(z1,{onClick:()=>t(!1),children:"OK"})})]})})}function Rn0(){const{hasErrors:e,errors:t,warnings:o}=P9(),[n,r]=p.useState(!1);return e?l.jsxs(l.Fragment,{children:[l.jsx(WM,{className:"mx-2 cursor-pointer",role:"status",size:"md",variant:"destructive",onClick:()=>r(!0),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(W7,{className:"mt-0.5 size-4 shrink-0 text-red"}),l.jsxs("div",{children:[l.jsx("div",{className:"font-semibold text-red",children:"Your theme has errors"}),l.jsx("div",{className:"text-sm text-foreground",children:"Some functionality on your site may be limited →"})]})]})}),l.jsx(yn0,{errors:t,open:n,warnings:o,onOpenChange:r})]}):null}const Ln0=""+new URL("ghost-pro-logo-B1sXD_MX.png",import.meta.url).href,wn0=""+new URL("ghost-pro-logo-dark-BeH8deo0.png",import.meta.url).href;function xn0({trialDaysRemaining:e}){return l.jsxs(WM,{variant:"gradient",size:"lg",className:"mx-2 flex flex-col items-stretch",children:[l.jsxs("div",{children:[l.jsx("img",{src:Ln0,alt:"Ghost Pro",className:"max-h-[33px] dark:hidden"}),l.jsx("img",{src:wn0,alt:"Ghost Pro",className:"hidden max-h-[33px] dark:block"})]}),l.jsx("div",{className:"mt-3 text-base font-semibold",children:"Unlock every feature"}),l.jsxs("div",{className:"mt-2 mb-4 text-sm text-gray-700",children:["Choose a plan to access the full power of Ghost right away, you have ",l.jsxs("span",{className:"font-semibold text-foreground",children:[e," days"]})," free trial remaining."]}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function Nn0(){const{data:e}=BO(),{data:t}=Ds(),{mutate:o}=N9(),[n,r]=p.useState(!1);if(n||!e?.hasNew)return null;const c=t?.entries[0];if(!c)return null;const i=()=>{r(!0),o()},b=()=>{o()};return l.jsx(WM,{"data-test-toast":"whats-new",className:"mx-2",role:"status","aria-label":"What’s new notification","aria-live":"polite",variant:"gradient",dismissible:!0,onDismiss:i,children:l.jsxs("a",{href:c.url,target:"_blank",rel:"noopener noreferrer",className:"block pr-8",onClick:b,"data-test-toast-link":!0,children:[l.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[l.jsx(q7,{className:"size-4 text-purple-600 dark:text-purple"}),l.jsx("span",{className:"text-xs font-semibold tracking-wide text-gray-700 uppercase dark:text-gray-400",children:"What’s new?"})]}),l.jsx("div",{className:"mb-1 text-base font-semibold text-gray-900 dark:text-foreground","data-test-toast-title":!0,children:c.title}),l.jsx("div",{className:"text-sm text-gray-700","data-test-toast-excerpt":!0,children:c.customExcerpt})]})})}function _n0(){const{data:e}=BO(),{data:t}=Ds(),o=t?.entries[0];return{showWhatsNewBanner:!!e?.hasNew&&!!o}}function PO(){const{hasErrors:e}=P9(),{showUpgradeBanner:t,trialDaysRemaining:o}=_9(),{showWhatsNewBanner:n}=_n0();return AO()?e?{bannerType:"theme-errors",banner:l.jsx(Rn0,{}),hasBanner:!0}:t?{bannerType:"upgrade",banner:l.jsx(xn0,{trialDaysRemaining:o}),hasBanner:!0}:n?{bannerType:"whats-new",banner:l.jsx(Nn0,{}),hasBanner:!0}:{bannerType:null,banner:null,hasBanner:!1}:{bannerType:null,banner:null,hasBanner:!1}}function kn0({...e}){const[t,o]=p.useState(!1),{hasBanner:n}=PO();return l.jsxs(l.Fragment,{children:[l.jsx(Qv,{...e,children:l.jsx(Ca,{className:n?"pt-3":"",children:l.jsx(Ea,{children:l.jsx(wO,{children:l.jsx(qn0,{onOpenWhatsNew:()=>o(!0)})})})})}),l.jsx(fn0,{open:t,onOpenChange:o})]})}function Cn0({banner:e}){const t=PO(),o=e??t.banner;return o?l.jsx("div",{className:"fixed bottom-[92px] left-3 z-50 max-w-[276px]",children:o}):null}const XO=[],X9=p.createContext(void 0),En0=({children:e})=>{const t=We(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):Sn0()});p.useEffect(()=>{const i=Bn0(t.search);Object.keys(i).length>0&&n(b=>{const z={...b,...i};return localStorage.setItem("featureFlags",JSON.stringify(z)),z})},[t.search]);const c={isEnabled:i=>o[i]??!1,flags:o,allFlags:XO};return l.jsx(X9.Provider,{value:c,children:e})},Sn0=()=>XO.reduce((e,t)=>({...e,[t]:!1}),{}),Bn0=e=>{const t=new URLSearchParams(e),o={};return XO.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},Tn0=()=>{const e=p.useContext(X9);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function DM(){const t=wd().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function Cn(){const e=L7(),t=DM();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o,n);return}o.startsWith("/")?e(`${t}${o}`,n):e(o,n)},[e,t])}const j9=({className:e,onClick:t})=>{const o=Cn(),{previousPath:n}=Jb();return l.jsx(z1,{className:L0("size-9 rounded-full bg-white/85 px-2 backdrop-blur-md dark:bg-black/85 dark:text-white [&_svg]:size-6 focus-visible:ring-0",e),variant:"ghost",onClick:()=>{if(t){t();return}o(n?-1:"/")},children:l.jsx(qY,{size:24,strokeWidth:1.25})})},Pn0=()=>{const e=We(),t=fn(oy,e.pathname);if(!t)return null;const o=t.map(n=>n.route).filter(n=>n.pageTitle);return o[o.length-1]||t[t.length-1].route};function D9(){const e=wd(),t=e.findIndex(z=>z.handle==="activitypub-basepath");if(t===-1)return"";const o=e[t+1];if(!o)return"";const r=e[t].pathname,c=o.pathname;let i=c.startsWith(r)?c.slice(r.length):c;return i=i.replace(/^\//,""),i.split("/")[0]}const Xn0=({title:e,backIcon:t})=>t?l.jsx(j9,{className:"-ml-2"}):l.jsx(f8,{className:"max-md:text-[2.4rem]",children:e}),pq=({onToggleMobileSidebar:e})=>l.jsx(z1,{className:"px:0 mr-[-9px] w-[34px] rounded-full bg-white/85 backdrop-blur-md lg:hidden dark:bg-black/85 dark:text-white",variant:"ghost",onClick:e,children:l.jsx(OK,{className:"size-5!"})}),jn0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=Jb(),n=D9(),r=tJ(),c=Pn0();let i=!1;n==="profile"&&(i=!0),n==="notes"&&o&&(i=!0);const b=o&&r||c?.showBackButton===!0;return l.jsx(l.Fragment,{children:i?l.jsxs("div",{className:"sticky top-8 left-0 z-50 inline-block max-lg:flex max-lg:items-center max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4",children:[l.jsx("div",{children:b&&l.jsx(j9,{className:"ml-6 max-md:ml-[10px]"})}),!b&&l.jsx(pq,{onToggleMobileSidebar:e})]}):l.jsx("div",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-black",children:l.jsxs("div",{className:`relative flex h-[102px] items-center justify-between gap-5 px-[min(4vw,32px)] max-md:h-[68px] ${t?'before:absolute before:inset-x-[min(4vw,32px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] before:dark:border-gray-950':""}`,children:[l.jsx(Xn0,{backIcon:b,title:c?.pageTitle||""}),l.jsx(pq,{onToggleMobileSidebar:e})]})})})};function ur(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}function Dn0(){return{destination:{handle:"",apId:""},aliases:[]}}function i3(e){return e===null||!("destination"in e)?Dn0():{destination:e.destination,aliases:"aliases"in e&&Array.isArray(e.aliases)?e.aliases:[]}}const bq={Article:1,Tombstone:2},In0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class Fn0{apiUrl;authApiUrl;handle;fetch;constructor(t,o,n,r=window.fetch.bind(window)){this.apiUrl=t,this.authApiUrl=o,this.handle=n,this.fetch=r}async getToken(){try{return(await(await this.fetch(this.authApiUrl)).json())?.identities?.[0]?.token||null}catch{return null}}async fetchJSON(t,o="GET",n){const r=await this.getToken(),c={method:o,headers:{Authorization:`Bearer ${r}`,Accept:"application/activity+json"}};n&&(c.body=JSON.stringify(n),c.headers["Content-Type"]="application/json");const i=await this.fetch(t,c);if(i.status===204||i.status===202)return null;if(!i.ok){const b={message:"Something went wrong, please try again.",statusCode:i.status};try{const z=await i.json(),u=z.message||z.error;u&&(b.message=u),z.code&&(b.code=z.code)}catch{}throw b}return await i.json()}async blockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/block/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async block(t){const o=new URL(`.ghost/activitypub/v1/actions/block/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblock(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async follow(t){const o=new URL(`.ghost/activitypub/v1/actions/follow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async unfollow(t){const o=new URL(`.ghost/activitypub/v1/actions/unfollow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async like(t){const o=new URL(`.ghost/activitypub/v1/actions/like/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async unlike(t){const o=new URL(`.ghost/activitypub/v1/actions/unlike/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async repost(t){const o=new URL(`.ghost/activitypub/v1/actions/repost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async derepost(t){const o=new URL(`.ghost/activitypub/v1/actions/derepost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async reply(t,o,n){const r=new URL(`.ghost/activitypub/v1/actions/reply/${encodeURIComponent(t)}`,this.apiUrl),c={content:o};return n&&(c.image=n),await this.fetchJSON(r,"POST",c)}async note(t,o){const n=new URL(".ghost/activitypub/v1/actions/note",this.apiUrl),r={content:t};return o&&(r.image=o),(await this.fetchJSON(n,"POST",r)).post}async delete(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"DELETE")}get userApiUrl(){return new URL(`.ghost/activitypub/users/${this.handle}`,this.apiUrl)}async getUser(){return await this.fetchJSON(this.userApiUrl)}get searchApiUrl(){return new URL(".ghost/activitypub/v1/actions/search",this.apiUrl)}async search(t){const o=this.searchApiUrl;o.searchParams.set("query",t);const n=await this.fetchJSON(o,"GET");return n&&"accounts"in n?n:{accounts:[]}}async getThread(t){const o=new URL(`.ghost/activitypub/v1/thread/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getAccount(t){const o=new URL(`.ghost/activitypub/v1/account/${t}`,this.apiUrl);return await this.fetchJSON(o)}async getAccountFollows(t,o,n){const r=new URL(`.ghost/activitypub/v1/account/${t}/follows/${o}`,this.apiUrl);n&&r.searchParams.set("next",n);const c=await this.fetchJSON(r);if(c===null)return{accounts:[],next:null};if(!("accounts"in c))return{accounts:[],next:null};const i=Array.isArray(c.accounts)?c.accounts:[],b="next"in c&&typeof c.next=="string"?c.next:null;return{accounts:i,next:b}}async getAccountAliases(){const t=new URL(".ghost/activitypub/v1/aliases",this.apiUrl),o=await this.fetchJSON(t);return i3(o)}async addAccountAlias(t){const o=new URL(".ghost/activitypub/v1/aliases",this.apiUrl),n=await this.fetchJSON(o,"POST",{sourceHandle:t});return i3(n)}async removeAccountAlias(t){const o=new URL(".ghost/activitypub/v1/aliases",this.apiUrl),n=await this.fetchJSON(o,"DELETE",{actorUri:t});return i3(n)}async getFeed(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/notes",t)}async getInbox(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/reader",t)}async getDiscoveryFeed(t,o){const n=`.ghost/activitypub/v1/feed/discover/${t}`;return this.getPaginatedPosts(n,o)}async getExploreAccounts(t,o){const n=`.ghost/activitypub/v1/explore/${t}`;return this.getPaginatedExploreAccounts(n,o)}async getTopics(){const t=new URL(".ghost/activitypub/v1/topics",this.apiUrl),o=await this.fetchJSON(t);return{topics:o&&"topics"in o&&Array.isArray(o.topics)?o.topics:[]}}async getRecommendations(t){const o=new URL(".ghost/activitypub/v1/recommendations",this.apiUrl);t&&o.searchParams.set("limit",t.toString());const n=await this.fetchJSON(o);return{accounts:n&&"accounts"in n&&Array.isArray(n.accounts)?n.accounts:[]}}async getPostsByAccount(t,o){return this.getPaginatedPosts(`.ghost/activitypub/v1/posts/${t}`,o)}async getPostsLikedByAccount(t){return this.getPaginatedPosts(".ghost/activitypub/v1/posts/me/liked",t)}async getPaginatedPosts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("posts"in r))return{posts:[],next:null};const c=Array.isArray(r.posts)?r.posts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{posts:c,next:i}}async getNotifications(t){const o=new URL(".ghost/activitypub/v1/notifications",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{notifications:[],next:null};if(!("notifications"in n))return{notifications:[],next:null};const r=Array.isArray(n.notifications)?n.notifications:[],c="next"in n&&typeof n.next=="string"?n.next:null;return{notifications:r,next:c}}async getNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/count",this.apiUrl),o=await this.fetchJSON(t);return o===null?{count:0}:{count:typeof o.count=="number"?o.count:0}}async resetNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/reset",this.apiUrl);return await this.fetchJSON(t,"PUT"),!0}async getBlockedAccounts(t){const o=new URL(".ghost/activitypub/v1/blocks/accounts",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{accounts:[],next:null};const r="blocked_accounts"in n&&Array.isArray(n.blocked_accounts)?n.blocked_accounts:[],c="next"in n&&typeof n.next=="string"?n.next:null;return{accounts:r,next:c}}async getBlockedDomains(t){const o=new URL(".ghost/activitypub/v1/blocks/domains",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{domains:[],next:null};const r="blocked_domains"in n&&Array.isArray(n.blocked_domains)?n.blocked_domains:[],c="next"in n&&typeof n.next=="string"?n.next:null;return{domains:r,next:c}}async getPaginatedExploreAccounts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("accounts"in r))return{accounts:[],next:null};const c=Array.isArray(r.accounts)?r.accounts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{accounts:c,next:i}}async getPost(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getReplies(t,o){const n=new URL(`.ghost/activitypub/v1/replies/${encodeURIComponent(t)}`,this.apiUrl);return o&&n.searchParams.set("next",o),await this.fetchJSON(n)}async updateAccount({name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:c}){const i=new URL(".ghost/activitypub/v1/account",this.apiUrl);await this.fetchJSON(i,"PUT",{name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:c})}async upload(t){const o=new URL(".ghost/activitypub/v1/upload/image",this.apiUrl),n=new FormData;n.append("file",t);const r=await this.getToken(),c=await this.fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:n});if(!c.ok)throw{message:"Upload failed",statusCode:c.status};return(await c.json()).fileUrl}async enableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/enable",this.apiUrl);await this.fetchJSON(t,"POST")}async disableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/disable",this.apiUrl);await this.fetchJSON(t,"POST")}async confirmBlueskyHandle(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/confirm-handle",this.apiUrl),o=await this.fetchJSON(t,"POST");return o===null||!("handle"in o)||typeof o.handle!="string"?"":String(o.handle)}}const I9="pending-";function F9(){return`${I9}${crypto.randomUUID()}`}function ic0(e){return e.startsWith(I9)}function Un0(e,t,o,n){const r={id:e.url,icon:e.icon,name:e.name,preferredUsername:e.preferredUsername,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};return{id:t,type:"Create",actor:r,object:{type:"Note",name:"",content:o,summary:null,url:"",attributedTo:r,image:n||"",published:new Date().toISOString(),attachment:[],preview:{type:"Note",content:o},id:t,replyCount:0,liked:!1,reposted:!1,repostCount:0,authored:!0,"@context":""},"@context":"",to:""}}function Hn0(e){return e.replace(/\n/g,"<br />")}function Pa(e){let t="";e.repostedBy!==null?t="Announce":t="Create";const o={id:e.author.url,icon:{url:e.author.avatarUrl},name:e.author.name,preferredUsername:e.author.handle.split("@")[1],followedByMe:e.author.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};let n=null;e.repostedBy!==null&&(n={id:e.repostedBy.url,icon:{url:e.repostedBy.avatarUrl},name:e.repostedBy.name,preferredUsername:e.repostedBy.handle.split("@")[1],followedByMe:e.repostedBy.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""});let r="Note";e.type===bq.Article?r="Article":e.type===bq.Tombstone&&(r="Tombstone");const c={type:r,name:e.title,content:e.content,summary:e.summary,url:e.url,attributedTo:o,image:e.featureImageUrl??"",published:e.publishedAt,attachment:e.attachments,preview:{type:"",content:e.excerpt},id:e.id,replyCount:e.replyCount,likeCount:e.likeCount,liked:e.likedByMe,reposted:e.repostedByMe,repostCount:e.repostCount,authored:e.authoredByMe===!0,metadata:e.metadata,"@context":""};return{id:e.id,type:t,actor:n!==null?n:o,object:c,"@context":"",to:""}}let p3;async function s1(){return p3||(p3=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),p3}function i1(e,t){return new Fn0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function Mt(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){He.error(e,{description:t})}function IM(e="Action failed",t="This user has restricted who can interact with their account."){He.error(e,{description:t})}const z0={outbox:e=>["outbox",e],liked:e=>["liked",e],user:e=>["user",e],profilePosts:e=>e===null?["profile_posts"]:["profile_posts",e],account:e=>["account",e],accountAliases:e=>["account_aliases",e],accountFollows:(e,t)=>["account_follows",e,t],searchResults:e=>["search_results",e],suggestedProfiles:(e,t)=>["suggested_profiles",e,t],exploreProfiles:e=>["explore_profiles",e],replyChain:e=>e===null?["reply_chain"]:["reply_chain",e],feed:["feed"],inbox:["inbox"],discoveryFeed:["discovery_feed"],postsByAccount:["account_posts"],postsLikedByAccount:["account_liked_posts"],notifications:e=>["notifications",e],notificationsCount:e=>["notifications_count",e],blockedAccounts:e=>["blocked_accounts",e],blockedDomains:e=>["blocked_domains",e],topics:()=>["topics"]};function Wu(e,t,o){const n=[z0.feed,z0.inbox,z0.discoveryFeed,z0.postsLikedByAccount,z0.profilePosts(null)];for(const r of n)e.setQueriesData(r,c=>c===void 0?c:{...c,pages:c.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,liked:o,likeCount:Math.max(o?(b.object.likeCount||0)+1:(b.object.likeCount||0)-1,0)}}:b)}))}),r===z0.postsLikedByAccount&&(e.setQueriesData(r,c=>c&&{...c,pages:c.pages.map(i=>({...i,posts:o?i.posts:i.posts.filter(b=>b.object.id!==t)}))}),o&&e.invalidateQueries({queryKey:z0.postsLikedByAccount}))}function U9(e,t,o,n){const r=[z0.feed,z0.inbox,z0.discoveryFeed,z0.profilePosts("index")],c=o.split("@")[1];for(const b of r)e.setQueriesData(b,z=>z===void 0?z:{...z,pages:z.pages.map(u=>({...u,posts:u.posts.map(f=>f.type!=="Announce"&&f.actor?.preferredUsername===c?{...f,actor:{...f.actor,followedByMe:n}}:f.type==="Announce"&&typeof f.object.attributedTo=="object"&&f.object.attributedTo&&!Array.isArray(f.object.attributedTo)&&"preferredUsername"in f.object.attributedTo&&f.object.attributedTo.preferredUsername===c?{...f,object:{...f.object,attributedTo:{...f.object.attributedTo,followedByMe:n}}}:f)}))});const i=z0.replyChain(null);e.setQueriesData(i,b=>{if(!b)return b;const z=u=>u.author.handle===o?{...u,author:{...u.author,followedByMe:n}}:u;return{...b,post:z(b.post),ancestors:{...b.ancestors,chain:b.ancestors.chain.map(z)},children:b.children.map(u=>({...u,post:z(u.post),chain:u.chain.map(z)}))}})}function H9(e,t,o){e.getQueryCache().getAll().forEach(c=>{const i=c.queryKey;Array.isArray(i)&&i[0]==="account_follows"&&e.setQueryData(i,b=>b?.pages?{...b,pages:b.pages.map(z=>({...z,accounts:z.accounts.map(u=>u.handle===t?{...u,isFollowing:o}:u)}))}:b)})}function gu(e,t,o){const n=z0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const c=i=>i.id===t?{...i,likedByMe:o,likeCount:Math.max(o?(i.likeCount||0)+1:(i.likeCount||0)-1,0)}:i;return{...r,post:c(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(c)},children:r.children.map(i=>({...i,post:c(i.post),chain:i.chain.map(c)}))}}),e.setQueryData(z0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function vu(e,t,o,n){const r=z0.notifications(t);e.setQueriesData({queryKey:r},c=>{if(!c||!c.pages)return c;try{return{...c,pages:c.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,likedByMe:n,likeCount:Math.max(n?b.post.likeCount+1:b.post.likeCount-1,0)}}:b)})}}catch{return c}})}function yu(e,t,o,n){const r=z0.notifications(t);e.setQueriesData({queryKey:r},c=>{if(!c||!c.pages)return c;try{return{...c,pages:c.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,repostedByMe:n,repostCount:Math.max(n?b.post.repostCount+1:b.post.repostCount-1,0)}}:b)})}}catch{return c}})}function Ru(e,t,o,n){const r=z0.notifications(t);e.setQueriesData({queryKey:r},c=>{if(!c||!c.pages)return c;try{return{...c,pages:c.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,replyCount:Math.max((b.post.replyCount??0)+n,0)}}:b)})}}catch{return c}})}function Mq(e,t,o){const n=[z0.feed,z0.inbox,z0.discoveryFeed,z0.profilePosts("index"),z0.postsLikedByAccount];for(const r of n)e.setQueriesData(r,c=>c&&{...c,pages:c.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,replyCount:Math.max((b.object.replyCount??0)+o,0)}}:b)}))})}function lq(e,t,o){const n=z0.replyChain(null);e.setQueriesData({queryKey:n,exact:!1},r=>{if(!r)return r;const c=i=>i.id===t?{...i,replyCount:Math.max((i.replyCount||0)+o,0)}:i;return{...r,post:c(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(c)},children:r.children.map(i=>({...i,post:c(i.post),chain:i.chain.map(c)}))}})}function pc0(e){return _o({queryKey:z0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await s1();return i1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function bc0(e){return _o({queryKey:z0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await s1();return i1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function $n0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).like(o)},onMutate:o=>{Wu(t,o,!0),gu(t,o,!0),vu(t,e,o,!0)},onError(o,n){Wu(t,n,!1),gu(t,n,!1),vu(t,e,n,!1),o.statusCode===403&&IM(),o.statusCode===429&&Mt()}})}function Vn0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).unlike(o)},onMutate:o=>{Wu(t,o,!1),gu(t,o,!1),vu(t,e,o,!1)},onError(o){o.statusCode===429&&Mt()}})}function Mc0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(z0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&Mt()}})}function lc0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(z0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&Mt()}})}function zc0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(z0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:z0.feed}),t.invalidateQueries({queryKey:z0.inbox}),t.invalidateQueries({queryKey:z0.discoveryFeed})},onError(o){o.statusCode===429&&Mt()}})}function uc0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(z0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&Mt()}})}function Lu(e,t,o){const n=[z0.feed,z0.inbox,z0.discoveryFeed,z0.profilePosts(null)];for(const r of n)e.setQueriesData(r,c=>c===void 0?c:{...c,pages:c.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,reposted:o,repostCount:Math.max(o?b.object.repostCount+1:b.object.repostCount-1,0)}}:b)}))})}function wu(e,t,o){const n=z0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const c=i=>i.id===t?{...i,repostedByMe:o,repostCount:Math.max(o?(i.repostCount||0)+1:(i.repostCount||0)-1,0)}:i;return{...r,post:c(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(c)},children:r.children.map(i=>({...i,post:c(i.post),chain:i.chain.map(c)}))}})}function Gn0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).repost(o)},onMutate:o=>{Lu(t,o,!0),wu(t,o,!0),yu(t,e,o,!0)},onError(o,n){Lu(t,n,!1),wu(t,n,!1),yu(t,e,n,!1),o.statusCode===403&&IM(),o.statusCode===429&&Mt()}})}function Qn0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).derepost(o)},onMutate:o=>{Lu(t,o,!1),wu(t,o,!1),yu(t,e,o,!1)},onError(o){o.statusCode===429&&Mt()}})}function Yn0(e){return Pt({queryKey:z0.user(e),async queryFn(){const t=await s1();return i1(e,t).getUser()}})}function jO(e,t,o){const n=v1();return re({async mutationFn(r){const c=await s1();return i1(e,c).unfollow(r)},onSuccess(r,c){const i=z0.account(c==="me"?"index":c);n.setQueryData(i,q=>q&&{...q,followedByMe:!1,followerCount:q.followerCount-1<0?0:q.followerCount-1});const b=z0.accountFollows(c,"followers");n.setQueryData(b,q=>{if(!q?.pages?.[0])return q;const h=n.getQueryData(z0.account("index"));return h?{...q,pages:q.pages.map(W=>({...W,accounts:W.accounts.filter(g=>g.name!==h.name)}))}:q});const z=z0.account("index");n.setQueryData(z,q=>q&&{...q,followingCount:q.followingCount-1});const f=z0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,q=>q?.pages?{...q,pages:q.pages.map(h=>({...h,accounts:h.accounts.filter(W=>W.handle!==c)}))}:q):n.invalidateQueries({queryKey:f}),H9(n,c,!1),n.setQueryData(z0.exploreProfiles(e),q=>{if(!q)return q;const h=q.pages.map(W=>{const g=Object.entries(W.results).reduce((v,[w,N])=>{const x=N.sites.map(R=>R.handle===c?{...R,followedByMe:!1,followerCount:Math.max(0,R.followerCount-1)}:R);return v[w]={...N,sites:x},v},{});return{...W,results:g}});return{...q,pages:h}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},q=>q&&q.map(h=>h.handle===c?{...h,followedByMe:!1,followerCount:Math.max(0,h.followerCount-1)}:h)),U9(n,e,c,!1),t()},onError:r=>{r.statusCode===429&&Mt(),o()}})}function DO(e,t,o){const n=v1();return re({async mutationFn(r){const c=await s1();return i1(e,c).follow(r)},onSuccess(r,c){const i=z0.account(c==="me"?"index":c);n.setQueryData(i,q=>q&&{...q,followedByMe:!0,followerCount:q.followerCount+1});const b=z0.account("index");n.setQueryData(b,q=>q&&{...q,followingCount:q.followingCount+1});const z=z0.accountFollows(c,"followers"),f=z0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,q=>{if(!q?.pages?.[0])return q;const h=n.getQueryData(z0.account(c==="me"?"index":c));if(!h)return q;const W={id:h.id,name:h.name,handle:h.handle,avatarUrl:h.avatarUrl,blockedByMe:h.blockedByMe,domainBlockedByMe:h.domainBlockedByMe,isFollowing:!0};return{...q,pages:[{...q.pages[0],accounts:[W,...q.pages[0].accounts]},...q.pages.slice(1)]}}):n.invalidateQueries({queryKey:f}),H9(n,c,!0),n.setQueryData(z0.exploreProfiles(e),q=>{if(!q)return q;const h=q.pages.map(W=>{const g=Object.entries(W.results).reduce((v,[w,N])=>{const x=N.sites.map(R=>R.handle===c?{...R,followedByMe:!0,followerCount:R.followerCount+1}:R);return v[w]={...N,sites:x},v},{});return{...W,results:g}});return{...q,pages:h}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},q=>q&&q.map(h=>h.handle===c?{...h,followedByMe:!0,followerCount:h.followerCount+1}:h)),n.setQueryData(z,q=>{if(!q?.pages?.[0])return q;const h=n.getQueryData(z0.account("index"));if(!h)return q;const W={id:h.url,type:"Person",preferredUsername:"index",name:h.name,url:h.url,handle:`index@${new URL(h.url).hostname}`,icon:{type:"Image",url:h.avatarUrl},isFollowing:!1};return{...q,pages:[{...q.pages[0],accounts:[W,...q.pages[0].accounts]},...q.pages.slice(1)]}}),U9(n,e,c,!0),t()},onError(r){o(),r.statusCode===429&&Mt(),r.statusCode===403&&IM()}})}function Kn0(e,t){const o=v1(),n=z0.searchResults(t);return{searchQuery:Pt({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await s1();return i1(e,i).search(t)}}),updateAccountSearchResult:(i,b)=>{o.setQueryData(n,z=>z&&{...z,accounts:z.accounts.map(u=>u.id===i?{...u,...b}:u)})}}}function b3(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map((c,i)=>i===0?{...c,[o]:[n,...c[o]]}:c)})}function Ar(e,t,o,n,r){e.setQueryData(t,c=>c&&{...c,pages:c.pages.map(i=>({...i,[o]:i[o].map(b=>b.id===n?r(b):b)}))})}function M3(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map(c=>({...c,[o]:c[o].filter(i=>i.id!==n)}))})}function Zn0(e,t){const o=v1();return re({async mutationFn({inReplyTo:n,content:r,imageUrl:c,altText:i}){const b=await s1(),z=i1(e,b),u=c?{url:c,altText:i}:void 0;return z.reply(n,r,u)},onMutate:({inReplyTo:n})=>{if(!t)throw new Error("Cannot create reply without actor props");const r=F9();return Mq(o,n,1),lq(o,n,1),Ru(o,e,n,1),{id:r}},onSuccess:(n,r)=>{if(n.id===void 0)throw new Error("Activity returned from API has no id");o.invalidateQueries({queryKey:z0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),Mq(o,r.inReplyTo,-1),lq(o,r.inReplyTo,-1),Ru(o,e,r.inReplyTo,-1),n.statusCode===403&&IM(),n.statusCode===429&&Mt(),He.error("An error occurred while sending your reply.")}})}function Jn0(e,t){const o=v1(),n=z0.feed,r=z0.outbox(e),c=z0.profilePosts("index");return re({async mutationFn({content:i,imageUrl:b,altText:z}){const u=await s1(),f=i1(e,u),O=b?{url:b,altText:z}:void 0;return f.note(i,O)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const z=Hn0(i),u=F9(),f=Un0(t,u,z,b);return b3(o,n,"posts",f),b3(o,r,"data",f),b3(o,c,"posts",f),{id:u}},onSuccess:(i,b,z)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=Pa(i);Ar(o,n,"posts",z?.id??"",()=>u),Ar(o,r,"data",z?.id??"",()=>u),Ar(o,c,"posts",z?.id??"",()=>u)},onError(i,b,z){console.error(i),M3(o,n,"posts",z?.id??""),M3(o,r,"data",z?.id??""),M3(o,c,"posts",z?.id??""),i.statusCode===429&&Mt(),He.error("An error occurred while posting your note.")}})}function IO(e,t,o){const n=o?.enabled!==!1;return Pt({queryKey:z0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await s1();return i1(e,r).getAccount(t)}})}function dc0(e,t){const o=v1();return _o({queryKey:z0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await s1(),i=await i1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(z0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function Oc0(e){return Pt({queryKey:z0.accountAliases(e),async queryFn(){const t=await s1();return i1(e,t).getAccountAliases()}})}function fc0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).addAccountAlias(o)},onSuccess(o){t.setQueryData(z0.accountAliases(e),o)}})}function Ac0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).removeAccountAlias(o)},onSuccess(o){t.setQueryData(z0.accountAliases(e),o)}})}function qc0(e){const t=z0.feed,o=v1();return{feedQuery:_o({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:c}){const i=await s1();return i1("index",i).getFeed(c).then(z=>({posts:z.posts.map(Pa),next:z.next}))},getNextPageParam(c){return c.next}}),updateFeedActivity:(c,i)=>{Ar(o,t,"posts",c,b=>({...b,...i}))}}}function hc0(e){const t=z0.inbox,o=v1();return{inboxQuery:_o({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:c}){const i=await s1();return i1("index",i).getInbox(c).then(z=>({posts:z.posts.map(Pa),next:z.next}))},getNextPageParam(c){return c.next}}),updateInboxActivity:(c,i)=>{Ar(o,t,"posts",c,b=>({...b,...i}))}}}function mc0(e){const t=[...z0.discoveryFeed,e.topic],o=v1();return{discoveryFeedQuery:_o({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:c}){const i=await s1();return i1("index",i).getDiscoveryFeed(e.topic,c).then(z=>({posts:z.posts.map(Pa),next:z.next}))},getNextPageParam(c){return c.next}}),updateDiscoveryFeedActivity:(c,i)=>{Ar(o,t,"posts",c,b=>({...b,...i}))}}}function Wc0(e,t){const o=z0.profilePosts(e==="me"?"index":e),n=v1();return{postsByAccountQuery:_o({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await s1();return i1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(Pa),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Ar(n,o,"posts",i,z=>({...z,...b}))}}}function gc0(e){const t=z0.postsLikedByAccount,o=v1();return{postsLikedByAccountQuery:_o({queryKey:t,enabled:e.enabled,async queryFn({pageParam:c}){const i=await s1();return i1("index",i).getPostsLikedByAccount(c).then(z=>({posts:z.posts.map(Pa),next:z.next}))},getNextPageParam(c){return c.next}}),updatePostsLikedByAccount:(c,i)=>{Ar(o,t,"posts",c,b=>({...b,...i}))}}}function er0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(z0.feed);t.setQueryData(z0.feed,R=>R&&{...R,pages:R.pages.map(_=>({..._,posts:_.posts.filter(T=>T.id!==o).map(T=>T.object.id===n?{...T,object:{...T.object,replyCount:T.object.replyCount-1}}:T)}))});const c=t.getQueryData(z0.inbox);t.setQueryData(z0.inbox,R=>R&&{...R,pages:R.pages.map(_=>({..._,posts:_.posts.filter(T=>T.id!==o).map(T=>T.object.id===n?{...T,object:{...T.object,replyCount:T.object.replyCount-1}}:T)}))}),n&&Ru(t,e,n,-1);const i=z0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,R=>R&&{...R,pages:R.pages.map(_=>({..._,data:_.data.filter(T=>T.object.id!==o)}))});const z=z0.liked(e),u=t.getQueryData(z);let f=!1;t.setQueryData(z,R=>R&&{...R,pages:R.pages.map(_=>(f=_.data.some(T=>T.object.id===o),{..._,data:_.data.filter(T=>T.object.id!==o)}))}),[z0.feed,z0.inbox,z0.discoveryFeed,z0.profilePosts("index"),z0.postsLikedByAccount].some(R=>t.getQueryData(R)?.pages.some(T=>T.posts.some(j=>j.id===o&&j.object.liked)))&&t.setQueryData(z0.account(e),R=>R&&{...R,likedCount:Math.max(0,R.likedCount-1)});const q=z0.profilePosts(null),h=t.getQueriesData(q);t.setQueriesData(q,R=>R&&{...R,pages:R.pages.map(_=>({..._,posts:_.posts.filter(T=>T.object.id!==o)}))});let W=[],g;f&&(W=z0.account(e),g=t.getQueryData(W),t.setQueryData(W,R=>R&&{...R,likedCount:R.likedCount-1<0?0:R.likedCount-1}));const v=z0.profilePosts("index"),w=t.getQueryData(v);t.setQueryData(v,R=>R&&{...R,pages:R.pages.map(_=>({..._,posts:_.posts.filter(T=>T.object.id!==o)}))});const N=z0.postsLikedByAccount,x=t.getQueryData(N);return t.setQueryData(N,R=>R&&{...R,pages:R.pages.map(_=>({..._,posts:_.posts.filter(T=>T.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},R=>{if(!R)return R;const _=R.children.filter(j=>j.post.id!==o).map(j=>({...j,chain:j.chain.filter(L=>L.id!==o)}));let T=R.post;return R.post.id===n&&(T={...R.post,replyCount:Math.max(0,(R.post.replyCount||0)-1)}),{...R,post:T,children:_}}),{previousFeed:{key:z0.feed,data:r},previousInbox:{key:z0.inbox,data:c},previousOutbox:{key:i,data:b},previousLiked:{key:z,data:u},previousProfilePosts:{key:q,data:h},previousAccount:f?{key:W,data:g}:null,previousPostsByAccount:{key:z0.profilePosts("index"),data:w},previousPostsLikedByAccount:{key:z0.postsLikedByAccount,data:x}}},onError:(o,n,r)=>{r&&(t.setQueryData(r.previousFeed.key,r.previousFeed.data),t.setQueryData(r.previousInbox.key,r.previousInbox.data),t.setQueryData(r.previousOutbox.key,r.previousOutbox.data),t.setQueryData(r.previousLiked.key,r.previousLiked.data),t.setQueriesData(r.previousProfilePosts.key,r.previousProfilePosts.data),r.previousAccount&&t.setQueryData(r.previousAccount.key,r.previousAccount.data),r.previousPostsByAccount&&t.setQueryData(z0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(z0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:z0.feed}),t.invalidateQueries({queryKey:z0.inbox}))}})}function vc0(e){return _o({queryKey:z0.notifications(e),async queryFn({pageParam:t}){const o=await s1();return i1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function yc0(e,t){const o=Pt({queryKey:z0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const f=await s1(),O=i1(e,f);try{return await O.getReplies(t)}catch(q){if(In0(q)&&q.statusCode===404)return await O.getPost(t),await O.getReplies(t);throw q}}}),[n,r]=p.useState(null),[c,i]=p.useState(null);p.useEffect(()=>{o.data?r(o.data):o.error&&i(o.error)},[o.data,o.error]);const b=p.useCallback(async()=>{if(!(!n?.ancestors.hasMore||!n?.ancestors.chain[0]))try{const f=await s1(),q=await i1(e,f).getReplies(n.ancestors.chain[0].id);r(h=>h&&{...h,ancestors:{chain:[...q.ancestors.chain,...h.ancestors.chain],hasMore:q.ancestors.hasMore}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),z=p.useCallback(async()=>{if(n?.next&&t)try{const f=await s1(),q=await i1(e,f).getReplies(t,n.next);r(h=>h&&{...h,children:[...h.children,...q.children],next:q.next})}catch(f){i(f instanceof Error?f:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async f=>{if(n?.children[f]?.hasMore)try{const O=await s1(),q=i1(e,O),h=n.children[f],W=h.chain.length>1?h.chain[h.chain.length-2]:h.post,g=await q.getReplies(W.id),v=g.children[0].chain;r(w=>{if(!w)return w;const N=[...w.children];return N[f]={...h,chain:[...h.chain,...v],hasMore:g.children[0].hasMore},{...w,children:N}})}catch(O){i(O instanceof Error?O:new Error("Failed to load more child replies"))}},[e,n]);return{data:n,isLoading:o.isLoading,error:c,loadMoreAncestors:b,loadMoreChildren:z,loadMoreChildReplies:u,hasMoreAncestors:!!n?.ancestors.hasMore,hasMoreChildren:!!n?.next,hasMoreChildReplies:f=>!!n?.children[f]?.hasMore}}function Rc0(e){const t=v1();return re({async mutationFn(o){const n=await s1();return i1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:z0.account("index")})}})}async function tr0(e){const t=await s1();return i1("index",t).upload(e)}function $9(e,t=!0){const o=p.useCallback(async()=>await s1(),[]),n=p.useCallback(async()=>{const r=await o();return i1(e,r)},[e,o]);return Pt({queryKey:z0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function or0(e){const t=v1(),o=p.useCallback(async()=>await s1(),[]),n=p.useCallback(async()=>{const r=await o();return i1(e,r)},[e,o]);return re({async mutationFn(){return t.setQueryData(z0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function Lc0(e,t){const o=v1(),n=[...z0.exploreProfiles(e),t];return{exploreProfilesQuery:_o({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await s1(),u=await i1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(f=>{o.setQueryData(z0.account(f.handle),f)}),{accounts:u.accounts,next:u.next}},getNextPageParam(i){return i.next}}),updateExploreProfile:(i,b)=>{o.setQueryData(n,z=>{if(!z)return z;const u=z.pages.map(f=>{const O=f.accounts.map(q=>q.id===i?{...q,...b}:q);return{...f,accounts:O}});return{...z,pages:u}})}}}function FO(e,t=3){const o=v1(),n=z0.suggestedProfiles(e,t);return{suggestedProfilesQuery:Pt({queryKey:n,async queryFn(){const i=await s1(),u=(await i1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(f=>{o.setQueryData(z0.account(f.handle),f)}),u.length>0?u:null},retry:!1,staleTime:3600*1e3}),updateSuggestedProfile:(i,b)=>{o.setQueryData(n,z=>z&&z.map(u=>u.id===i?{...u,...b}:u))}}}function UO(){return{topicsQuery:Pt({queryKey:z0.topics(),async queryFn(){const t=await s1();return i1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function HO(e,t){const o=z0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function wc0(e){const t=v1();return re({async mutationFn(){const o=await s1();return i1(e,o).enableBluesky()},onSuccess(){HO(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:z0.accountFollows("index","following")})},onError(o){o.statusCode===429&&Mt()}})}function xc0(e){const t=v1();return re({async mutationFn(){const o=await s1();return i1(e,o).disableBluesky()},onSuccess(){HO(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:z0.accountFollows("index","following")})},onError(o){o.statusCode===429&&Mt()}})}function Nc0(e){const t=v1();return re({async mutationFn(){const o=await s1();return i1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&HO(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&Mt()}})}let Dp=null;const zq=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=l0.useReducer(z=>z+1,0),i=Dp===o&&!n,b=z=>{i?(t(z),setTimeout(()=>{Dp=null,r()},0)):(Dp=o,r(),e(z))};return l.jsx(z1,{className:"absolute -right-1.5 bottom-px z-10 flex size-4 items-center justify-center rounded-full p-0 outline outline-2 outline-white transition-transform hover:scale-105 active:scale-100 dark:outline-black",title:i?"Unfollow":"Follow",onClick:b,children:i?l.jsx(u7,{className:"-mb-px size-3! stroke-[2.4]!"}):l.jsx(O7,{className:"size-[14px]! stroke-2!"})})},dr=({author:e,size:t,isLoading:o=!1,disabled:n=!1,className:r="",showFollowButton:c=!1})=>{let i=20,b=`shrink-0 items-center justify-center rounded-full relative z-10 flex bg-black/5 dark:bg-gray-900 ${t==="lg"||n?"":"cursor-pointer"} ${r}`,z="z-10 object-cover rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10";const[u,f]=p.useState(e?.icon?.url),O=Cn(),q=DO("index",()=>{He.success(`Followed ${e?.name}`)},()=>{He.error("Failed to follow")}),h=jO("index",()=>{He.info(`Unfollowed ${e?.name}`)},()=>{He.error("Failed to unfollow")});switch(p.useEffect(()=>{f(e?.icon?.url)},[e?.icon?.url]),t){case"2xs":i=10,b=de("size-4",b),z=de("size-4",z);break;case"xs":i=12,b=de("size-6",b),z=de("size-6",z);break;case"notification":i=16,b=de("size-9",b),z=de("size-9",z);break;case"sm":b=de("size-10",b),z=de("size-10",z);break;case"md":b=de("size-[60px]",b),z=de("size-[60px]",z);break;case"lg":i=32,b=de("size-22",b),z=de("size-22",z);break;default:b=de("size-10",b),z=de("size-10",z);break}if(!e||o)return l.jsx(F1,{className:z,containerClassName:b});const W=e?.handle||ur(e),g=R=>{R.stopPropagation(),O(`/profile/${W}`)},v=R=>{R.stopPropagation(),q.mutate(W)},w=R=>{R.stopPropagation(),h.mutate(W)},x=c||Dp===W;return u?l.jsxs("div",{className:b,onClick:t==="lg"||n?void 0:g,children:[l.jsx("img",{className:z,referrerPolicy:"no-referrer",src:u,onError:()=>f(void 0)}),x&&l.jsx(zq,{authorHandle:W,followedByMe:!1,onFollow:v,onUnfollow:w})]}):l.jsxs("div",{className:b,onClick:n?void 0:g,children:[l.jsx(uO,{className:"text-gray-600",size:i,strokeWidth:1.5}),x&&l.jsx(zq,{authorHandle:W,followedByMe:!1,onFollow:v,onUnfollow:w})]})},l3=({trigger:e,onCopyLink:t,onDelete:o,allowDelete:n=!1,disabled:r=!1,layout:c,followedByMe:i=!1,authoredByMe:b=!1,onFollow:z=()=>{},onUnfollow:u=()=>{}})=>{const f=h=>{h.stopPropagation(),t()},O=h=>{h.stopPropagation(),o()},q=h=>{h.stopPropagation(),i?u():z()};return l.jsxs(XJ,{children:[l.jsxs(z00,{children:[l.jsx(u00,{disabled:r,asChild:!0,onClick:h=>h.stopPropagation(),children:e}),l.jsx(Pv,{align:`${c==="modal"?"start":"end"}`,alignOffset:c==="modal"?-12:0,className:"p-2",children:l.jsxs("div",{className:"flex w-48 flex-col",children:[(!n||c==="inbox")&&l.jsx(c3,{asChild:!0,children:l.jsxs(z1,{className:"justify-start",variant:"ghost",onClick:f,children:[l.jsx(iK,{}),"Copy link"]})}),!b&&l.jsx(c3,{asChild:!0,children:l.jsxs(z1,{className:"justify-start",variant:"ghost",onClick:q,children:[i?l.jsx($K,{}):l.jsx(GK,{}),i?"Unfollow":"Follow"]})}),n&&l.jsx(jJ,{asChild:!0,children:l.jsx(c3,{asChild:!0,children:l.jsxs(z1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:h=>h.stopPropagation(),children:[l.jsx(h7,{}),"Delete"]})})})]})})]}),l.jsxs(fv,{onClick:h=>h.stopPropagation(),children:[l.jsxs(Av,{children:[l.jsx(hv,{children:"Delete this post?"}),l.jsx(mv,{children:c==="inbox"?"This will remove the post from the Ghost social web, but it will remain on your website.":l.jsx(l.Fragment,{children:"If you delete this post, you won't be able to restore it."})})]}),l.jsxs(qv,{children:[l.jsx(gv,{onClick:h=>h.stopPropagation(),children:"Cancel"}),l.jsx(Wv,{className:hM({variant:"destructive"}),onClick:O,children:"Delete"})]})]})]})};function nr0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const z=VO(b);if(!z)return[];if(Array.isArray(z))return z.map((u,f)=>({url:u.url,alt:u.name||`Image-${f}`}));if(z.mediaType?.startsWith("image/")||z.type==="Image")return[{url:z.url,alt:z.name||"Image"}];if(b.image){let u;if(typeof b.image=="string"?u=b.image:u=b.image?.url,u)return[{url:u,alt:"Image"}]}return[]};return{lightboxState:t,openLightbox:b=>{if(!e)return;const z=n(e),u=z.findIndex(f=>f.url===b);u!==-1&&o({images:z,currentIndex:u,isOpen:!0})},closeLightbox:()=>{o(b=>({...b,isOpen:!1}))},navigateToIndex:b=>{o(z=>({...z,currentIndex:b}))}}}const z3=({images:e,currentIndex:t,isOpen:o,onClose:n,onNavigate:r})=>{const c=t===0,i=t===e.length-1,b=p.useCallback(()=>{if(e.length<=1||i)return;const u=(t+1)%e.length;r(u)},[e.length,i,t,r]),z=p.useCallback(()=>{if(e.length<=1||c)return;const u=(t-1+e.length)%e.length;r(u)},[e.length,c,t,r]);return p.useEffect(()=>{const u=f=>{o&&(f.key==="ArrowRight"&&!i?b():f.key==="ArrowLeft"&&!c&&z())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[o,t,e.length,b,z,i,c]),!o||e.length===0?null:l.jsx(Ss,{open:o,onOpenChange:u=>{u||n()},children:l.jsxs(ka,{className:"top-[50%] h-[100vh] max-h-[100vh] w-[100vw] max-w-[100vw] translate-y-[-50%] items-center border-none bg-transparent p-0 shadow-none data-[state=closed]:zoom-out-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:zoom-in-100 data-[state=open]:slide-in-from-top-[50%]",onClick:()=>n(),children:[l.jsx("img",{alt:e[t].alt,className:"mx-auto max-h-[90vh] max-w-[90vw] object-contain",src:e[t].url,onClick:u=>u.stopPropagation()}),e.length>1&&l.jsxs(l.Fragment,{children:[l.jsxs(z1,{className:"absolute top-1/2 left-5 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70",disabled:c,onClick:u=>{u.stopPropagation(),z()},children:[l.jsx(EY,{className:"size-6!"}),l.jsx("span",{className:"sr-only",children:"Previous image"})]}),l.jsxs(z1,{className:"absolute top-1/2 right-5 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70",disabled:i,onClick:u=>{u.stopPropagation(),b()},children:[l.jsx(dM,{className:"size-6!"}),l.jsx("span",{className:"sr-only",children:"Next image"})]})]}),l.jsx(GJ,{asChild:!0,children:l.jsxs(z1,{className:"absolute top-5 right-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[l.jsx(dO,{className:"size-5!"}),l.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},uq=()=>{},$O=({className:e,following:t,handle:o,variant:n="default",onFollow:r=uq,onUnfollow:c=uq,"data-testid":i})=>{const[b,z]=p.useState(t),u=jO("index",()=>{},()=>{z(!0)}),f=DO("index",()=>{},()=>{z(!1)}),O=async()=>{b?(z(!1),c(),u.mutate(o)):(z(!0),r(),f.mutate(o))};p.useEffect(()=>{z(t)},[t]);const q=b?"Following":"Follow";return n==="link"?l.jsx(z1,{className:de("p-0 font-medium",b?"text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white":"text-purple hover:text-black dark:hover:text-white",e),"data-testid":i,variant:"link",onClick:h=>{h?.preventDefault(),h?.stopPropagation(),O()},children:q}):l.jsx(z1,{className:de("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:h=>{h?.preventDefault(),h?.stopPropagation(),O()},children:q})};const{entries:V9,setPrototypeOf:dq,isFrozen:rr0,getPrototypeOf:ar0,getOwnPropertyDescriptor:cr0}=Object;let{freeze:pt,seal:no,create:G2}=Object,{apply:xu,construct:Nu}=typeof Reflect<"u"&&Reflect;pt||(pt=function(t){return t});no||(no=function(t){return t});xu||(xu=function(t,o){for(var n=arguments.length,r=new Array(n>2?n-2:0),c=2;c<n;c++)r[c-2]=arguments[c];return t.apply(o,r)});Nu||(Nu=function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return new t(...n)});const yc=ye(Array.prototype.forEach),sr0=ye(Array.prototype.lastIndexOf),Oq=ye(Array.prototype.pop),Rc=ye(Array.prototype.push),ir0=ye(Array.prototype.splice),st=Array.isArray,Bc=ye(String.prototype.toLowerCase),u3=ye(String.prototype.toString),fq=ye(String.prototype.match),U2=ye(String.prototype.replace),Aq=ye(String.prototype.indexOf),pr0=ye(String.prototype.trim),br0=ye(Number.prototype.toString),Mr0=ye(Boolean.prototype.toString),qq=typeof BigInt>"u"?null:ye(BigInt.prototype.toString),hq=typeof Symbol>"u"?null:ye(Symbol.prototype.toString),ue=ye(Object.prototype.hasOwnProperty),Lc=ye(Object.prototype.toString),Ue=ye(RegExp.prototype.test),qp=lr0(TypeError);function ye(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return xu(e,t,n)}}function lr0(e){return function(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return Nu(e,o)}}function M1(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bc;if(dq&&dq(e,null),!st(t))return e;let n=t.length;for(;n--;){let r=t[n];if(typeof r=="string"){const c=o(r);c!==r&&(rr0(t)||(t[n]=c),r=c)}e[r]=!0}return e}function zr0(e){for(let t=0;t<e.length;t++)ue(e,t)||(e[t]=null);return e}function mt(e){const t=G2(null);for(const[o,n]of V9(e))ue(e,o)&&(st(n)?t[o]=zr0(n):n&&typeof n=="object"&&n.constructor===Object?t[o]=mt(n):t[o]=n);return t}function ur0(e){switch(typeof e){case"string":return e;case"number":return br0(e);case"boolean":return Mr0(e);case"bigint":return qq?qq(e):"0";case"symbol":return hq?hq(e):"Symbol()";case"undefined":return Lc(e);case"function":case"object":{if(e===null)return Lc(e);const t=e,o=Q2(t,"toString");if(typeof o=="function"){const n=o(t);return typeof n=="string"?n:Lc(n)}return Lc(e)}default:return Lc(e)}}function Q2(e,t){for(;e!==null;){const n=cr0(e,t);if(n){if(n.get)return ye(n.get);if(typeof n.value=="function")return ye(n.value)}e=ar0(e)}function o(){return null}return o}function dr0(e){try{return Ue(e,""),!0}catch{return!1}}const mq=pt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),d3=pt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),O3=pt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Or0=pt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),f3=pt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),fr0=pt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wq=pt(["#text"]),gq=pt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),A3=pt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vq=pt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),hp=pt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ar0=no(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qr0=no(/<%[\w\W]*|[\w\W]*%>/gm),hr0=no(/\$\{[\w\W]*/gm),mr0=no(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wr0=no(/^aria-[\-\w]+$/),G9=no(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gr0=no(/^(?:\w+script|data):/i),vr0=no(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Q9=no(/^html$/i),yr0=no(/^[a-z][.\w]*(-[.\w]+)+$/i);var yq=Object.freeze({__proto__:null,ARIA_ATTR:Wr0,ATTR_WHITESPACE:vr0,CUSTOM_ELEMENT:yr0,DATA_ATTR:mr0,DOCTYPE_NAME:Q9,ERB_EXPR:qr0,IS_ALLOWED_URI:G9,IS_SCRIPT_OR_DATA:gr0,MUSTACHE_EXPR:Ar0,TMPLIT_EXPR:hr0});const wc={element:1,text:3,progressingInstruction:7,comment:8,document:9},Rr0=function(){return typeof window>"u"?null:window},Lr0=function(t,o){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";o&&o.hasAttribute(r)&&(n=o.getAttribute(r));const c="dompurify"+(n?"#"+n:"");try{return t.createPolicy(c,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Rq=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Y9(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rr0();const t=w0=>Y9(w0);if(t.version="3.4.1",t.removed=[],!e||!e.document||e.document.nodeType!==wc.document||!e.Element)return t.isSupported=!1,t;let{document:o}=e;const n=o,r=n.currentScript,{DocumentFragment:c,HTMLTemplateElement:i,Node:b,Element:z,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:O,DOMParser:q,trustedTypes:h}=e,W=z.prototype,g=Q2(W,"cloneNode"),v=Q2(W,"remove"),w=Q2(W,"nextSibling"),N=Q2(W,"childNodes"),x=Q2(W,"parentNode");if(typeof i=="function"){const w0=o.createElement("template");w0.content&&w0.content.ownerDocument&&(o=w0.content.ownerDocument)}let R,_="";const{implementation:T,createNodeIterator:j,createDocumentFragment:L,getElementsByTagName:J}=o,{importNode:Q}=n;let Z=Rq();t.isSupported=typeof V9=="function"&&typeof x=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:t0,ERB_EXPR:b0,TMPLIT_EXPR:O0,DATA_ATTR:M0,ARIA_ATTR:Y,IS_SCRIPT_OR_DATA:c0,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:P}=yq;let{IS_ALLOWED_URI:I}=yq,k=null;const H=M1({},[...mq,...d3,...O3,...f3,...Wq]);let n0=null;const A0=M1({},[...gq,...A3,...vq,...hp]);let s0=Object.seal(G2(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q0=null,p0=null;const e0=Object.seal(G2(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let R0=!0,Z0=!0,J0=!1,u1=!0,B=!1,o0=!0,a0=!1,g0=!1,C0=!1,n1=!1,p1=!1,a1=!1,m1=!0,se=!1;const lt="user-content-";let So=!0,Ce=!1,ge={},Re=null;const tt=M1({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Le=null;const Q1=M1({},["audio","video","img","source","image","track"]);let ot=null;const Rt=M1({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lt="http://www.w3.org/1998/Math/MathML",bo="http://www.w3.org/2000/svg",Y1="http://www.w3.org/1999/xhtml";let Ve=Y1,Dt=!1,zt=null;const Ge=M1({},[Lt,bo,Y1],u3);let It=M1({},["mi","mo","mn","ms","mtext"]),je=M1({},["annotation-xml"]);const ut=M1({},["title","style","font","a","script"]);let nt=null;const o1=["application/xhtml+xml","text/html"],U1="text/html";let b1=null,H1=null;const rt=o.createElement("form"),P1=function(E){return E instanceof RegExp||E instanceof Function},K1=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(H1&&H1===E)return;(!E||typeof E!="object")&&(E={}),E=mt(E),nt=o1.indexOf(E.PARSER_MEDIA_TYPE)===-1?U1:E.PARSER_MEDIA_TYPE,b1=nt==="application/xhtml+xml"?u3:Bc,k=ue(E,"ALLOWED_TAGS")&&st(E.ALLOWED_TAGS)?M1({},E.ALLOWED_TAGS,b1):H,n0=ue(E,"ALLOWED_ATTR")&&st(E.ALLOWED_ATTR)?M1({},E.ALLOWED_ATTR,b1):A0,zt=ue(E,"ALLOWED_NAMESPACES")&&st(E.ALLOWED_NAMESPACES)?M1({},E.ALLOWED_NAMESPACES,u3):Ge,ot=ue(E,"ADD_URI_SAFE_ATTR")&&st(E.ADD_URI_SAFE_ATTR)?M1(mt(Rt),E.ADD_URI_SAFE_ATTR,b1):Rt,Le=ue(E,"ADD_DATA_URI_TAGS")&&st(E.ADD_DATA_URI_TAGS)?M1(mt(Q1),E.ADD_DATA_URI_TAGS,b1):Q1,Re=ue(E,"FORBID_CONTENTS")&&st(E.FORBID_CONTENTS)?M1({},E.FORBID_CONTENTS,b1):tt,q0=ue(E,"FORBID_TAGS")&&st(E.FORBID_TAGS)?M1({},E.FORBID_TAGS,b1):mt({}),p0=ue(E,"FORBID_ATTR")&&st(E.FORBID_ATTR)?M1({},E.FORBID_ATTR,b1):mt({}),ge=ue(E,"USE_PROFILES")?E.USE_PROFILES&&typeof E.USE_PROFILES=="object"?mt(E.USE_PROFILES):E.USE_PROFILES:!1,R0=E.ALLOW_ARIA_ATTR!==!1,Z0=E.ALLOW_DATA_ATTR!==!1,J0=E.ALLOW_UNKNOWN_PROTOCOLS||!1,u1=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,B=E.SAFE_FOR_TEMPLATES||!1,o0=E.SAFE_FOR_XML!==!1,a0=E.WHOLE_DOCUMENT||!1,n1=E.RETURN_DOM||!1,p1=E.RETURN_DOM_FRAGMENT||!1,a1=E.RETURN_TRUSTED_TYPE||!1,C0=E.FORCE_BODY||!1,m1=E.SANITIZE_DOM!==!1,se=E.SANITIZE_NAMED_PROPS||!1,So=E.KEEP_CONTENT!==!1,Ce=E.IN_PLACE||!1,I=dr0(E.ALLOWED_URI_REGEXP)?E.ALLOWED_URI_REGEXP:G9,Ve=typeof E.NAMESPACE=="string"?E.NAMESPACE:Y1,It=ue(E,"MATHML_TEXT_INTEGRATION_POINTS")&&E.MATHML_TEXT_INTEGRATION_POINTS&&typeof E.MATHML_TEXT_INTEGRATION_POINTS=="object"?mt(E.MATHML_TEXT_INTEGRATION_POINTS):M1({},["mi","mo","mn","ms","mtext"]),je=ue(E,"HTML_INTEGRATION_POINTS")&&E.HTML_INTEGRATION_POINTS&&typeof E.HTML_INTEGRATION_POINTS=="object"?mt(E.HTML_INTEGRATION_POINTS):M1({},["annotation-xml"]);const r0=ue(E,"CUSTOM_ELEMENT_HANDLING")&&E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING=="object"?mt(E.CUSTOM_ELEMENT_HANDLING):G2(null);if(s0=G2(null),ue(r0,"tagNameCheck")&&P1(r0.tagNameCheck)&&(s0.tagNameCheck=r0.tagNameCheck),ue(r0,"attributeNameCheck")&&P1(r0.attributeNameCheck)&&(s0.attributeNameCheck=r0.attributeNameCheck),ue(r0,"allowCustomizedBuiltInElements")&&typeof r0.allowCustomizedBuiltInElements=="boolean"&&(s0.allowCustomizedBuiltInElements=r0.allowCustomizedBuiltInElements),B&&(Z0=!1),p1&&(n1=!0),ge&&(k=M1({},Wq),n0=G2(null),ge.html===!0&&(M1(k,mq),M1(n0,gq)),ge.svg===!0&&(M1(k,d3),M1(n0,A3),M1(n0,hp)),ge.svgFilters===!0&&(M1(k,O3),M1(n0,A3),M1(n0,hp)),ge.mathMl===!0&&(M1(k,f3),M1(n0,vq),M1(n0,hp))),e0.tagCheck=null,e0.attributeCheck=null,ue(E,"ADD_TAGS")&&(typeof E.ADD_TAGS=="function"?e0.tagCheck=E.ADD_TAGS:st(E.ADD_TAGS)&&(k===H&&(k=mt(k)),M1(k,E.ADD_TAGS,b1))),ue(E,"ADD_ATTR")&&(typeof E.ADD_ATTR=="function"?e0.attributeCheck=E.ADD_ATTR:st(E.ADD_ATTR)&&(n0===A0&&(n0=mt(n0)),M1(n0,E.ADD_ATTR,b1))),ue(E,"ADD_URI_SAFE_ATTR")&&st(E.ADD_URI_SAFE_ATTR)&&M1(ot,E.ADD_URI_SAFE_ATTR,b1),ue(E,"FORBID_CONTENTS")&&st(E.FORBID_CONTENTS)&&(Re===tt&&(Re=mt(Re)),M1(Re,E.FORBID_CONTENTS,b1)),ue(E,"ADD_FORBID_CONTENTS")&&st(E.ADD_FORBID_CONTENTS)&&(Re===tt&&(Re=mt(Re)),M1(Re,E.ADD_FORBID_CONTENTS,b1)),So&&(k["#text"]=!0),a0&&M1(k,["html","head","body"]),k.table&&(M1(k,["tbody"]),delete q0.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw qp('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qp('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=E.TRUSTED_TYPES_POLICY,_=R.createHTML("")}else R===void 0&&(R=Lr0(h,r)),R!==null&&typeof _=="string"&&(_=R.createHTML(""));pt&&pt(E),H1=E},wt=M1({},[...d3,...O3,...Or0]),le=M1({},[...f3,...fr0]),S=function(E){let r0=x(E);(!r0||!r0.tagName)&&(r0={namespaceURI:Ve,tagName:"template"});const m0=Bc(E.tagName),$0=Bc(r0.tagName);return zt[E.namespaceURI]?E.namespaceURI===bo?r0.namespaceURI===Y1?m0==="svg":r0.namespaceURI===Lt?m0==="svg"&&($0==="annotation-xml"||It[$0]):!!wt[m0]:E.namespaceURI===Lt?r0.namespaceURI===Y1?m0==="math":r0.namespaceURI===bo?m0==="math"&&je[$0]:!!le[m0]:E.namespaceURI===Y1?r0.namespaceURI===bo&&!je[$0]||r0.namespaceURI===Lt&&!It[$0]?!1:!le[m0]&&(ut[m0]||!wt[m0]):!!(nt==="application/xhtml+xml"&&zt[E.namespaceURI]):!1},D=function(E){Rc(t.removed,{element:E});try{x(E).removeChild(E)}catch{v(E)}},U=function(E,r0){try{Rc(t.removed,{attribute:r0.getAttributeNode(E),from:r0})}catch{Rc(t.removed,{attribute:null,from:r0})}if(r0.removeAttribute(E),E==="is")if(n1||p1)try{D(r0)}catch{}else try{r0.setAttribute(E,"")}catch{}},u0=function(E){let r0=null,m0=null;if(C0)E="<remove></remove>"+E;else{const k1=fq(E,/^[\r\n\t ]+/);m0=k1&&k1[0]}nt==="application/xhtml+xml"&&Ve===Y1&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");const $0=R?R.createHTML(E):E;if(Ve===Y1)try{r0=new q().parseFromString($0,nt)}catch{}if(!r0||!r0.documentElement){r0=T.createDocument(Ve,"template",null);try{r0.documentElement.innerHTML=Dt?_:$0}catch{}}const $1=r0.body||r0.documentElement;return E&&m0&&$1.insertBefore(o.createTextNode(m0),$1.childNodes[0]||null),Ve===Y1?J.call(r0,a0?"html":"body")[0]:a0?r0.documentElement:$1},v0=function(E){return j.call(E.ownerDocument||E,E,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},H0=function(E){return E instanceof O&&(typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||!(E.attributes instanceof f)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function")},P0=function(E){return typeof b=="function"&&E instanceof b};function x0(w0,E,r0){yc(w0,m0=>{m0.call(t,E,r0,H1)})}const S0=function(E){let r0=null;if(x0(Z.beforeSanitizeElements,E,null),H0(E))return D(E),!0;const m0=b1(E.nodeName);if(x0(Z.uponSanitizeElement,E,{tagName:m0,allowedTags:k}),o0&&E.hasChildNodes()&&!P0(E.firstElementChild)&&Ue(/<[/\w!]/g,E.innerHTML)&&Ue(/<[/\w!]/g,E.textContent)||o0&&E.namespaceURI===Y1&&m0==="style"&&P0(E.firstElementChild)||E.nodeType===wc.progressingInstruction||o0&&E.nodeType===wc.comment&&Ue(/<[/\w]/g,E.data))return D(E),!0;if(q0[m0]||!(e0.tagCheck instanceof Function&&e0.tagCheck(m0))&&!k[m0]){if(!q0[m0]&&F0(m0)&&(s0.tagNameCheck instanceof RegExp&&Ue(s0.tagNameCheck,m0)||s0.tagNameCheck instanceof Function&&s0.tagNameCheck(m0)))return!1;if(So&&!Re[m0]){const $0=x(E)||E.parentNode,$1=N(E)||E.childNodes;if($1&&$0){const k1=$1.length;for(let V1=k1-1;V1>=0;--V1){const X1=g($1[V1],!0);$0.insertBefore(X1,w(E))}}}return D(E),!0}return E instanceof z&&!S(E)||(m0==="noscript"||m0==="noembed"||m0==="noframes")&&Ue(/<\/no(script|embed|frames)/i,E.innerHTML)?(D(E),!0):(B&&E.nodeType===wc.text&&(r0=E.textContent,yc([t0,b0,O0],$0=>{r0=U2(r0,$0," ")}),E.textContent!==r0&&(Rc(t.removed,{element:E.cloneNode()}),E.textContent=r0)),x0(Z.afterSanitizeElements,E,null),!1)},_0=function(E,r0,m0){if(p0[r0]||m1&&(r0==="id"||r0==="name")&&(m0 in o||m0 in rt))return!1;if(!(Z0&&!p0[r0]&&Ue(M0,r0))){if(!(R0&&Ue(Y,r0))){if(!(e0.attributeCheck instanceof Function&&e0.attributeCheck(r0,E))){if(!n0[r0]||p0[r0]){if(!(F0(E)&&(s0.tagNameCheck instanceof RegExp&&Ue(s0.tagNameCheck,E)||s0.tagNameCheck instanceof Function&&s0.tagNameCheck(E))&&(s0.attributeNameCheck instanceof RegExp&&Ue(s0.attributeNameCheck,r0)||s0.attributeNameCheck instanceof Function&&s0.attributeNameCheck(r0,E))||r0==="is"&&s0.allowCustomizedBuiltInElements&&(s0.tagNameCheck instanceof RegExp&&Ue(s0.tagNameCheck,m0)||s0.tagNameCheck instanceof Function&&s0.tagNameCheck(m0))))return!1}else if(!ot[r0]){if(!Ue(I,U2(m0,$,""))){if(!((r0==="src"||r0==="xlink:href"||r0==="href")&&E!=="script"&&Aq(m0,"data:")===0&&Le[E])){if(!(J0&&!Ue(c0,U2(m0,$,"")))){if(m0)return!1}}}}}}}return!0},G0=M1({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),F0=function(E){return!G0[Bc(E)]&&Ue(P,E)},g1=function(E){x0(Z.beforeSanitizeAttributes,E,null);const{attributes:r0}=E;if(!r0||H0(E))return;const m0={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:n0,forceKeepAttr:void 0};let $0=r0.length;for(;$0--;){const $1=r0[$0],{name:k1,namespaceURI:V1,value:X1}=$1,De=b1(k1),Ft=X1;let _1=k1==="value"?Ft:pr0(Ft);if(m0.attrName=De,m0.attrValue=_1,m0.keepAttr=!0,m0.forceKeepAttr=void 0,x0(Z.uponSanitizeAttribute,E,m0),_1=m0.attrValue,se&&(De==="id"||De==="name")&&Aq(_1,lt)!==0&&(U(k1,E),_1=lt+_1),o0&&Ue(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_1)){U(k1,E);continue}if(De==="attributename"&&fq(_1,"href")){U(k1,E);continue}if(m0.forceKeepAttr)continue;if(!m0.keepAttr){U(k1,E);continue}if(!u1&&Ue(/\/>/i,_1)){U(k1,E);continue}B&&yc([t0,b0,O0],Jo=>{_1=U2(_1,Jo," ")});const Ee=b1(E.nodeName);if(!_0(Ee,De,_1)){U(k1,E);continue}if(R&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!V1)switch(h.getAttributeType(Ee,De)){case"TrustedHTML":{_1=R.createHTML(_1);break}case"TrustedScriptURL":{_1=R.createScriptURL(_1);break}}if(_1!==Ft)try{V1?E.setAttributeNS(V1,k1,_1):E.setAttribute(k1,_1),H0(E)?D(E):Oq(t.removed)}catch{U(k1,E)}}x0(Z.afterSanitizeAttributes,E,null)},A1=function(E){let r0=null;const m0=v0(E);for(x0(Z.beforeSanitizeShadowDOM,E,null);r0=m0.nextNode();)x0(Z.uponSanitizeShadowNode,r0,null),S0(r0),g1(r0),r0.content instanceof c&&A1(r0.content);x0(Z.afterSanitizeShadowDOM,E,null)};return t.sanitize=function(w0){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r0=null,m0=null,$0=null,$1=null;if(Dt=!w0,Dt&&(w0="<!-->"),typeof w0!="string"&&!P0(w0)&&(w0=ur0(w0),typeof w0!="string"))throw qp("dirty is not a string, aborting");if(!t.isSupported)return w0;if(g0||K1(E),t.removed=[],typeof w0=="string"&&(Ce=!1),Ce){const X1=w0.nodeName;if(typeof X1=="string"){const De=b1(X1);if(!k[De]||q0[De])throw qp("root node is forbidden and cannot be sanitized in-place")}}else if(w0 instanceof b)r0=u0("<!---->"),m0=r0.ownerDocument.importNode(w0,!0),m0.nodeType===wc.element&&m0.nodeName==="BODY"||m0.nodeName==="HTML"?r0=m0:r0.appendChild(m0);else{if(!n1&&!B&&!a0&&w0.indexOf("<")===-1)return R&&a1?R.createHTML(w0):w0;if(r0=u0(w0),!r0)return n1?null:a1?_:""}r0&&C0&&D(r0.firstChild);const k1=v0(Ce?w0:r0);for(;$0=k1.nextNode();)S0($0),g1($0),$0.content instanceof c&&A1($0.content);if(Ce)return w0;if(n1){if(B){r0.normalize();let X1=r0.innerHTML;yc([t0,b0,O0],De=>{X1=U2(X1,De," ")}),r0.innerHTML=X1}if(p1)for($1=L.call(r0.ownerDocument);r0.firstChild;)$1.appendChild(r0.firstChild);else $1=r0;return(n0.shadowroot||n0.shadowrootmode)&&($1=Q.call(n,$1,!0)),$1}let V1=a0?r0.outerHTML:r0.innerHTML;return a0&&k["!doctype"]&&r0.ownerDocument&&r0.ownerDocument.doctype&&r0.ownerDocument.doctype.name&&Ue(Q9,r0.ownerDocument.doctype.name)&&(V1="<!DOCTYPE "+r0.ownerDocument.doctype.name+`>
279
- `+V1),B&&yc([t0,b0,O0],X1=>{V1=U2(V1,X1," ")}),R&&a1?R.createHTML(V1):V1},t.setConfig=function(){let w0=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};K1(w0),g0=!0},t.clearConfig=function(){H1=null,g0=!1},t.isValidAttribute=function(w0,E,r0){H1||K1({});const m0=b1(w0),$0=b1(E);return _0(m0,$0,r0)},t.addHook=function(w0,E){typeof E=="function"&&Rc(Z[w0],E)},t.removeHook=function(w0,E){if(E!==void 0){const r0=sr0(Z[w0],E);return r0===-1?void 0:ir0(Z[w0],r0,1)[0]}return Oq(Z[w0])},t.removeHooks=function(w0){Z[w0]=[]},t.removeAllHooks=function(){Z=Rq()},t}var wr0=Y9();const xr0=["http:","https:","mailto:"];function _c0(e){try{const t=new URL(e);return xr0.includes(t.protocol)}catch{return!1}}function kc0(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Y2(e){return wr0.sanitize(e)}function _u(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const f=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(f,O=>{const q=`__EXCLUDED_TAG_${r+=1}__`;return n[q]=O,q})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let z=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,f]of Object.entries(n))z=z.replace(u,f);return z}const Ip=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},Lq=e=>"preferredUsername"in e,br=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:c=!1})=>{const[i,b]=p.useState(!1),z=Cn();let u=e?.handle;!u&&e&&Lq(e)&&(u=ur(e));const f=o||!u&&!e,O=IO("index",u||"",{enabled:i&&!!u}),q=O.isFetching||O.isLoading,h=O.error,W=O.data?typeof O.data.followerCount=="number"&&typeof O.data.followingCount=="number"&&O.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!W&&!q&&!h&&O.refetch({cancelRefetch:!1})},[O,q,h,W,i,u]),f)return l.jsx(l.Fragment,{children:t});const v=O.data||e,w=v?.handle??u??"",N=v?.name??"",x=v?.avatarUrl??(e&&Lq(e)?e.icon?.url:null)??null,R=!!v?.followsMe,_=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,T=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,j=v?.bio?Ip(_u(v.bio,["a"])):void 0,L=()=>{w&&z(`/profile/${w}`)},J=()=>{w&&z(`/profile/${w}/following`)},Q=()=>{w&&z(`/profile/${w}/followers`)};return l.jsxs(a00,{onOpenChange:b,children:[l.jsx(c00,{asChild:!0,children:t}),l.jsx(Tv,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-hidden dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:Z=>Z.stopPropagation(),children:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex justify-between",children:[l.jsxs(RO,{className:"size-14 cursor-pointer",onClick:L,children:[x&&l.jsx(yO,{alt:N,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:x,onError:Z=>{Z.target.src="",Z.target.style.display="none"}}),l.jsx(mM,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:l.jsx(uO,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!c&&l.jsx($O,{following:!!v?.followedByMe,handle:w,type:"primary"})]}),l.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:L,children:[l.jsx(A8,{className:"w-full truncate",children:N}),l.jsxs("div",{className:"flex w-full gap-2",children:[l.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:w}),R&&!c&&l.jsx(yv,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),l.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:q?l.jsx(F1,{className:"h-4 w-32"}):!h&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"cursor-pointer hover:underline",onClick:J,children:[l.jsx("span",{className:"font-bold text-black dark:text-white",children:E6(_)})," ","Following"]}),l.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Q,children:[l.jsx("span",{className:"font-bold text-black dark:text-white",children:E6(T)})," ","Followers"]})]})}),q?l.jsx(F1,{className:"h-4 w-48"}):!h&&j?l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(j)},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a]:text-[#00a4eb] [&_a:hover]:underline"}):null]})})]})},K9=(e={})=>{const[t,o]=p.useState(!1),n=We();return p.useEffect(()=>{const r=c=>{if(c.target instanceof HTMLInputElement||c.target instanceof HTMLTextAreaElement||c.target instanceof HTMLElement&&c.target.isContentEditable||c.target instanceof HTMLSelectElement||c.metaKey||c.ctrlKey||c.altKey||c.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(c.key.toLowerCase()){case"n":i||(c.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(c.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},mp=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:c,disabled:i=!1,buttonClassName:b="",onLikeClick:z,onCommentClick:u,onReplyCountChange:f})=>{const[O,q]=p.useState(t.liked),[h,W]=p.useState(t.reposted),[g,v]=p.useState(!1),w=p.useRef(null);K9({isReplyAvailable:!u&&c!=="reply",onOpenReply:()=>v(!0),componentRef:w}),p.useEffect(()=>{q(t.liked),W(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{j(r)},[r]);const N=$n0("index"),x=Vn0("index"),R=Gn0("index"),_=Qn0("index"),[T,j]=p.useState(r),L=async Z=>{Z.stopPropagation(),O?x.mutate(t.id):N.mutate(t.id,{onError(){q(!1)}}),q(!O),z()},J=Z=>{Z.stopPropagation(),u?u():v(!0)},Q=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{ref:w,className:`flex ${c!=="inbox"&&"gap-1"}`,children:[l.jsxs(z1,{className:`${Q} ${O&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${O?"Undo like":"Like"}`,variant:"ghost",onClick:Z=>{Z?.stopPropagation(),Z&&L(Z)},children:[l.jsx(oK,{className:`${O&&"fill-pink-500 text-pink-500"}`}),c!=="inbox"&&l.jsx(F6,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),l.jsxs(z1,{className:`${Q}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:J,children:[l.jsx(MO,{className:"-mr-px"}),c!=="inbox"&&n>0&&MM(n)]}),l.jsxs(z1,{className:`${Q} ${h&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${h?"Undo repost":"Repost"}`,variant:"ghost",onClick:Z=>{Z?.stopPropagation(),h?(_.mutate(t.id),j(T-1)):(R.mutate(t.id,{onError(){W(!1),j(T-1)}}),j(T+1)),W(!h)},children:[l.jsx(f7,{className:`${h&&"text-green-500"}`}),c!=="inbox"&&l.jsx(F6,{className:T===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:T})]})]}),g&&l.jsx(GO,{open:g,replyTo:{object:t,actor:e},onOpenChange:Z=>{v(Z)},onReply:()=>{f?.(1),v(!1)},onReplyError:()=>{f?.(-1)}})]})};function Nr0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const rr=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||ur(e)}`)},_r0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),c=o(e);return c.getTime()===n.getTime()?kr0(e):c.getTime()===r.getTime()?"Yesterday":Cr0(e)},kr0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},Cr0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function Er0(e){return new Date(e).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(e).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"})}function Wp(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=Er0(o),r=_r0(o);return t&&!e.url?.includes("/.ghost/activitypub")?l.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:c=>c.stopPropagation(),children:r}):l.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function VO(e){let t;if(e.image&&(t=e.image),e.type==="Note"&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function xc(e,t,o,n){const r=VO(e);if(!r)return null;const c=z=>u=>{u.stopPropagation(),t&&t(z)},i=z=>{n&&n(z)},b=(z,u=!1)=>{const f=u?"min-h-[200px]":"";return l.jsx("div",{className:`${z} ${f} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:l.jsx(rK,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const z=r.length;let u="";return z===1?u="grid-cols-1":z>=2&&z<=4?u="grid-cols-2 auto-rows-[150px]":z>4&&(u="grid-cols-3 auto-rows-[150px]"),l.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((f,O)=>{const q=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${z===3&&O===0?"row-span-2":""}`;return o&&o.has(f.url)?b(q,z===1):l.jsx("img",{alt:f.name||`Image-${O}`,className:`${q} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:f.url,onClick:t?c(f.url):void 0,onError:()=>i(f.url)},f.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):l.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?c(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return l.jsx("div",{className:"relative mt-3 mb-4",children:l.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return l.jsx("div",{className:"relative mt-2 mb-4 w-full",children:l.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const z=e.type==="Article"?"cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover":"cursor-pointer mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(z,!0):l.jsx("img",{alt:r.name||"Image",className:z,referrerPolicy:"no-referrer",src:u,onClick:t?c(u):void 0,onError:()=>i(u)})}return null}}function Sr0(e,t){const o=VO(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative hidden @md/inbox-item:block",r=de("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return l.jsx(F1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return l.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return l.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return l.jsxs("div",{className:n,children:[l.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),l.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsx(wK,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return l.jsx("div",{className:"ml-8 w-[120px]",children:l.jsx("div",{className:"relative mt-2 mb-4 w-full",children:l.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?l.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const wq=()=>{},xq=l.jsx(f7,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),Br0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:c,commentCount:i=0,repostCount:b=0,likeCount:z=0,showHeader:u=!0,last:f,isLoading:O,isPending:q=!1,isCompact:h=!1,isChainContinuation:W=!1,isChainParent:g=!1,onClick:v=wq,onDelete:w=wq,showStats:N=!0})=>{const x=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,R]=p.useState(!1),[_,T]=p.useState(new Set),j=p.useRef(null),[L,J]=p.useState(!1),Q=er0("index"),Z=Cn(),t0=DO("index",()=>{He.success(`Followed ${P?.name}`)},()=>{He.error("Failed to follow")}),b0=jO("index",()=>{He.info(`Unfollowed ${P?.name}`)},()=>{He.error("Failed to unfollow")});p.useEffect(()=>{const J0=j.current;J0&&J(J0.scrollHeight>J0.clientHeight)},[o?.content]),p.useEffect(()=>{const J0=j.current;if(!J0)return;const u1=B=>{const a0=B.target.closest("a[data-profile]");if(a0){const g0=a0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(g0||"")&&g0&&(B.preventDefault(),B.stopPropagation(),rr(g0,Z))}};return J0.addEventListener("click",u1),()=>{J0.removeEventListener("click",u1)}},[Z,o?.content]);const O0=()=>{},M0=()=>{q||v()},Y=()=>{Q.mutate({id:o.id,parentId:n}),w()},c0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),R(!0),He.success("Link copied"),setTimeout(()=>R(!1),2e3))},$=J0=>{T(u1=>new Set(u1).add(J0))};let P=e;c==="Announce"&&(P=typeof o.attributedTo=="object"?o.attributedTo:e);const I=P?ur(P):null,k=P?.followedByMe||!1,H=c==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,n0=c==="Announce"?o.reposted??!1:o.authored,A0=()=>{I&&t0.mutate(I)},s0=()=>{I&&b0.mutate(I)},q0=l.jsx(z1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="modal"?"text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600":"text-gray-500 hover:text-gray-500"} dark:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:l.jsx(d7,{})}),{lightboxState:p0,openLightbox:e0,closeLightbox:R0,navigateToIndex:Z0}=nr0(o);return r==="feed"?l.jsxs(l.Fragment,{children:[o&&l.jsxs("div",{className:`group/article relative -mx-4 ${q?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:M0,children:[c==="Announce"&&l.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[xq,l.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[l.jsx(br,{actor:e,align:"center",isCurrentUser:n0,children:l.jsx("span",{className:"break-anywhere truncate hover:underline",onClick:J0=>{rr(e,Z,J0)},children:e.name})}),"reposted"]})]}),l.jsxs("div",{className:"flex flex-col gap-2.5","data-test-activity":!0,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(br,{actor:P,isCurrentUser:H,children:l.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[l.jsx(dr,{author:P,disabled:q,showFollowButton:!H&&!k}),l.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:J0=>{q||rr(P,Z,J0)},children:[l.jsx("span",{className:`break-anywhere min-w-0 truncate font-semibold ${h?"text-lg":"text-md"} ${q?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:O?l.jsx(F1,{className:"w-24"}):P.name}),l.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[l.jsx("span",{className:`truncate ${q?"":"hover-underline"}`,children:O?l.jsx(F1,{className:"w-56"}):ur(P)}),l.jsx("div",{className:`ml-1 before:mr-1 ${!O&&'before:content-["·"]'}`,title:`${x}`,children:O?l.jsx(F1,{className:"w-4"}):Wp(o,q===!1&&!o.authored)})]})]})]})}),l.jsx(l3,{allowDelete:t,authoredByMe:H,disabled:q,followedByMe:k,layout:"feed",trigger:q0,onCopyLink:c0,onDelete:Y,onFollow:A0,onUnfollow:s0})]}),l.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"",children:o.type==="Article"?l.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[xc(o,M0,_,$),l.jsxs("div",{className:"p-5",children:[l.jsx("div",{className:"break-anywhere mb-1 line-clamp-2 text-lg leading-tight font-semibold tracking-tight text-pretty","data-test-activity-heading":!0,children:o.name}),l.jsx("div",{className:"break-anywhere line-clamp-3 leading-[1.4em]",children:o.preview?.content})]})]}):l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"ap-note-content break-anywhere line-clamp-[10] leading-[1.4285714286] tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3",children:O?l.jsx(F1,{count:2}):l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(Ip(o.content||"")??"")},ref:j,onClick:J0=>{const u1=J0.target;(u1.tagName==="A"||u1.closest("a"))&&J0.stopPropagation()}})}),L&&l.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),xc(o,e0,_,$)]})}),l.jsx("div",{className:"space-between relative z-[30] mt-1 ml-[-8px] flex",children:O?l.jsx(F1,{className:"ml-2 w-18"}):N&&l.jsx(mp,{actor:P,commentCount:i,disabled:q,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0})})]})})]})]}),l.jsx(z3,{currentIndex:p0.currentIndex,images:p0.images,isOpen:p0.isOpen,onClose:R0,onNavigate:Z0})]}):r==="modal"?l.jsxs(l.Fragment,{children:[o&&l.jsxs("div",{"data-object-id":o.id,children:[l.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:M0,children:[l.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pt-4 pb-3","data-test-activity":!0,children:[u&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"relative z-10 pt-[3px]",children:l.jsx(dr,{author:P,showFollowButton:!H&&!k})}),l.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:J0=>{q||rr(P,Z,J0)},children:[l.jsxs("div",{className:"flex w-full",children:[l.jsx("span",{className:'break-anywhere min-w-0 truncate font-semibold whitespace-nowrap after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:P.name}),l.jsx("div",{children:Wp(o,!o.authored)})]}),l.jsx("div",{className:"flex w-full",children:l.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:ur(P)})})]})]}),l.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:l.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&l.jsx(Jt,{className:"break-anywhere mb-1 leading-tight","data-test-activity-heading":!0,children:o.name}),l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(Ip(o.content||"")??"")},ref:j,className:"ap-note-content-large break-anywhere text-[1.6rem] tracking-[-0.011em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3"}),xc(o,e0,_,$),l.jsx("div",{className:"space-between mt-3 ml-[-8px] flex",children:N&&l.jsx(mp,{actor:P,commentCount:i,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0})})]})})]}),l.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),l.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),l.jsx(z3,{currentIndex:p0.currentIndex,images:p0.images,isOpen:p0.isOpen,onClose:R0,onNavigate:Z0})]}):r==="reply"?l.jsxs(l.Fragment,{children:[o&&l.jsxs("div",{className:`group/article relative ${h?"pb-6":W?"pb-5":"py-5"} ${q?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:M0,children:[l.jsxs("div",{className:"flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(br,{actor:P,isCurrentUser:H,children:l.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[l.jsx(dr,{author:P,disabled:q,showFollowButton:!H&&!k}),l.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:J0=>{q||rr(P,Z,J0)},children:[l.jsxs("div",{className:"flex",children:[l.jsx("span",{className:'break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:P.name}),l.jsx("div",{children:Wp(o,q===!1&&!o.authored)})]}),l.jsx("div",{className:"flex",children:l.jsx("span",{className:"truncate text-gray-700",children:ur(P)})})]})]})}),!h&&l.jsx(l3,{allowDelete:t,authoredByMe:H,disabled:q,followedByMe:k,layout:"reply",trigger:q0,onCopyLink:c0,onDelete:Y,onFollow:A0,onUnfollow:s0})]}),l.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:l.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&xc(o,M0,_,$),o.name&&l.jsx(Jt,{className:"break-anywhere mt-2.5 leading-tight text-pretty","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?l.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(Ip(o.content||"")??"")},ref:j,className:"ap-note-content break-anywhere tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&xc(o,e0,_,$),o.type==="Article"&&l.jsx(z1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!h&&l.jsx("div",{className:"space-between mt-2 ml-[-8px] flex",children:N&&l.jsx(mp,{actor:P,commentCount:i,disabled:q,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0})})]})})]}),!f&&l.jsx("div",{className:`absolute left-[19px] ${h?"top-[51px] bottom-[8px]":W?"top-[51px] bottom-[5px]":g?"top-[71px] bottom-[5px]":"top-[71px] bottom-[-7px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),l.jsx(z3,{currentIndex:p0.currentIndex,images:p0.images,isOpen:p0.isOpen,onClose:R0,onNavigate:Z0})]}):r==="inbox"?l.jsx(l.Fragment,{children:o&&l.jsxs("div",{className:"group/article @container/inbox-item relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:M0,children:[l.jsxs("div",{className:"w-full min-w-0",children:[l.jsx("div",{className:"z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent",children:O?l.jsx(F1,{className:"w-24"}):l.jsxs(l.Fragment,{children:[l.jsx(br,{actor:P,isCurrentUser:H,children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(dr,{author:P,size:"2xs"}),l.jsx("span",{className:"min-w-0 truncate font-semibold text-gray-900 hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:J0=>{rr(P,Z,J0)},children:P.name})]})}),c==="Announce"&&l.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[xq,l.jsx(br,{actor:e,align:"center",isCurrentUser:n0,children:l.jsx("span",{className:"line-clamp-1 hover:underline",onClick:J0=>{rr(e,Z,J0)},children:e.name})})," reposted"]}),l.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${x}`,children:Wp(o,!o.authored)})]})}),l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[l.jsx(Jt,{className:"break-anywhere line-clamp-2 w-full max-w-[600px] leading-tight text-pretty","data-test-activity-heading":!0,children:O?l.jsx(F1,{className:"w-full max-w-96"}):o.name?o.name:l.jsx("span",{dangerouslySetInnerHTML:{__html:Y2(_u(o.content||""))}})}),l.jsx("div",{className:"ap-note-content break-anywhere line-clamp-2 w-full max-w-[600px] text-base leading-normal text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3",children:O?l.jsx(F1,{count:2}):l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(_u(o.preview?.content??o.content??""))}})}),l.jsx("span",{className:"mt-1 shrink-0 text-sm leading-none whitespace-nowrap text-gray-600",children:O?l.jsx(F1,{className:"w-16"}):o.content&&`${Nr0(o.content)}`})]}),l.jsxs("div",{className:"invisible absolute top-8 right-3 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[N&&l.jsx(mp,{actor:P,commentCount:i,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0}),l.jsx(l3,{allowDelete:t,authoredByMe:H,followedByMe:k,layout:"inbox",trigger:q0,onCopyLink:c0,onDelete:Y,onFollow:A0,onUnfollow:s0})]})]})]}),Sr0(o,O)]})}):l.jsx(l.Fragment,{})},Nq=5*1024*1024,_q="Image must be less than 5MB in size.",Cc0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const c=new FileReader;c.onload=()=>n(c.result),c.onerror=r,c.readAsDataURL(o)})}catch{return e}},Ec0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),Sc0="Image must be square.",GO=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...c})=>{const{data:i}=Yn0("index"),b=Jn0("index",i),z=Zn0("index",i),{data:u,isLoading:f}=IO("index","me"),[O,q]=p.useState(!1),h=p.useRef(null),W=p.useRef(null),[g,v]=p.useState(null),[w,N]=p.useState(!1),x=p.useRef(null),[R,_]=p.useState(""),[T,j]=p.useState(null),[L,J]=p.useState(""),[Q,Z]=p.useState(!1),[t0,b0]=p.useState(!1),[O0,M0]=p.useState(!1),Y=Cn(),c0=500;p.useEffect(()=>{c.open!==void 0&&q(c.open)},[c.open]),p.useEffect(()=>{if(c.open!==void 0?c.open:O){const R0=setTimeout(()=>{M0(!0)},300);return()=>clearTimeout(R0)}else M0(!1)},[O,c.open]);const $=!R.trim()||!i||t0||R.length>c0,P=p.useCallback(async()=>{const e0=R.trim();if(!(!e0||!i))try{b0(!0),t?(await z.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:T||void 0,altText:L||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:T||void 0,altText:L||void 0}),Y("/notes")),q(!1),r&&r(!1),He.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{b0(!1)}},[R,i,t,z,b,T,L,o,n,q,Y,r]),I=e0=>{_(e0.target.value)};p.useEffect(()=>{h.current&&(h.current.style.height="auto",h.current.style.height=`${h.current.scrollHeight}px`)},[R]),p.useEffect(()=>{if((c.open!==void 0?c.open:O)&&h.current){const R0=setTimeout(()=>{h.current?.focus()},100);return()=>clearTimeout(R0)}},[O,c.open]),p.useEffect(()=>{if(Q&&W.current){const e0=setTimeout(()=>{W.current?.focus()},100);return()=>clearTimeout(e0)}},[Q]),p.useEffect(()=>{const e0=Z0=>{(Z0.metaKey||Z0.ctrlKey)&&Z0.key==="Enter"&&(Z0.preventDefault(),!$&&!w&&P())};if(c.open!==void 0?c.open:O)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[O,c.open,$,w,P]);const k=p.useCallback(async e0=>{const R0=e0.clipboardData?.items;if(R0)for(let Z0=0;Z0<R0.length;Z0++){const J0=R0[Z0];if(J0.type.indexOf("image")!==-1){e0.preventDefault();const u1=J0.getAsFile();if(u1){if(u1.size>Nq){He.error(_q);return}const B=URL.createObjectURL(u1);v(B),await H(u1)}break}}},[]);p.useEffect(()=>{if(c.open!==void 0?c.open:O)return document.addEventListener("paste",k),()=>document.removeEventListener("paste",k)},[O,c.open,k]);const H=async e0=>{try{N(!0);const R0=await tr0(e0);j(R0)}catch(R0){v(null);let Z0="Failed to upload image. Try again.";if(R0&&typeof R0=="object"&&"statusCode"in R0)switch(R0.statusCode){case 413:Z0="Image size exceeds limit.";break;case 415:Z0="The file type is not supported.";break}He.error(Z0)}finally{N(!1)}},n0=async e0=>{const R0=e0.target.files;if(R0&&R0.length>0){const Z0=R0[0];if(Z0.size>Nq){He.error(_q),e0.target.value="";return}const J0=URL.createObjectURL(Z0);v(J0),await H(Z0)}},A0=e0=>{e0.stopPropagation(),v(null),j(null),J(""),Z(!1),g&&URL.revokeObjectURL(g),x.current&&(x.current.value="")},s0=e0=>{e0.stopPropagation(),Z(!Q)},q0=()=>{h.current?.focus()};p.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);let p0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(p0=`Reply to ${ur(e0)}...`)}return l.jsxs(Ss,{open:c.open!==void 0?c.open:O,onOpenChange:e0=>{e0&&(_(""),v(null),j(null),J(""),Z(!1),g&&URL.revokeObjectURL(g),x.current&&(x.current.value="")),q(e0),r&&r(e0)},...c.open!==void 0?{}:c,children:[l.jsx(Rv,{asChild:!0,children:e}),l.jsxs(ka,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[l.jsxs(gM,{className:"hidden",children:[l.jsx(yM,{children:t?"Reply":"New note"}),l.jsx(wv,{children:"Post your thoughts to the Social web"})]}),t&&l.jsx(Br0,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type==="Article"?"Article":"Note",onClick:()=>{}}),l.jsxs("div",{className:`flex ${g?"":"min-h-36"} cursor-text items-start gap-3`,onClick:q0,children:[l.jsx("div",{className:"sticky top-0",children:l.jsx(dr,{author:i})}),l.jsx(kT,{asChild:!0,children:l.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[f?l.jsx(F1,{className:"w-10"}):l.jsx("span",{className:"break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black dark:text-white",children:u?.name}),l.jsx(O5,{name:"content",asChild:!0,children:l.jsx(f5,{asChild:!0,children:l.jsx("textarea",{ref:h,autoFocus:!0,className:"ap-textarea break-anywhere w-full resize-none bg-transparent text-[1.5rem]","data-testid":"note-textarea",placeholder:p0,rows:1,value:R,onChange:I,onPaste:k})})}),l.jsx(O5,{name:"image",asChild:!0,children:l.jsx(f5,{asChild:!0,children:l.jsx("input",{ref:x,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:n0})})})]})})]}),g&&l.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[l.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${w&&"opacity-10"}`,src:g}),w&&l.jsx("div",{className:"absolute leading-[0]",children:l.jsx(Ob,{size:"md"})}),l.jsx(z1,{className:"absolute top-3 right-3 size-8 bg-black/60 text-white opacity-0 group-hover:opacity-100 hover:bg-black/80",onClick:A0,children:l.jsx(h7,{})}),!w&&l.jsx(z1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${Q?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:s0,children:"Alt"})]}),g&&!w&&Q&&l.jsx("div",{className:"mt-1",children:l.jsx(xM,{ref:W,className:"w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:L,onChange:e0=>J(e0.target.value)})}),l.jsxs(vM,{className:`${O0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[l.jsx(z1,{className:"mr-auto w-[34px] min-w-0!",variant:"outline",onClick:()=>x.current?.click(),children:l.jsx(cK,{})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:`text-sm ${R.length>=c0?"text-red-500":R.length>=c0*.9?"text-yellow-600":"text-gray-500"}`,children:[R.length,"/",c0]}),l.jsx(z1,{className:"min-w-16","data-testid":"post-button",disabled:$||w,onClick:P,children:t0?l.jsx(Ob,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function ku(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function Tr0(e,t){const o=ku(e);return JSON.stringify({...o,...t})}const Z9=()=>{const{data:e}=me(),{mutateAsync:t}=Zv(),o=l0.useMemo(()=>e?.accessibility?ku(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=l0.useCallback(async r=>{if(!e)return;const c=ku(e.accessibility),i=Tr0(e.accessibility,{apOnboarding:{...c.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},J9=()=>l.jsx("div",{className:"h-full pt-14",children:l.jsx(Or,{})}),Pr0=Object.freeze(Object.defineProperty({__proto__:null,default:J9,useOnboardingStatus:Z9},Symbol.toStringTag,{value:"Module"})),Xr0=()=>{const e=Cn();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return l.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[l.jsxs("div",{className:"flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-black",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qK,{className:"text-purple-500",size:20,strokeWidth:1.5}),l.jsx(Jt,{children:"Beta feedback"})]}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),l.jsx(z1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),l.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pt-4 pb-2 text-xs text-gray-400",children:[l.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://ghost.org/help/social-web/",rel:"noreferrer",target:"_blank",children:"Help"}),"⋅",l.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://activitypub.ghost.org/archive",rel:"noreferrer",target:"_blank",children:"Updates"})]})]})},Wb=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const c=l0.Children.toArray(e),i=l.jsx("div",{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:l.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[c[0],c[1],c[2]]})});return t?l.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},jr0=()=>{const e=Cn(),{suggestedProfilesQuery:t}=FO("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:c}=Jb(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:l.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[l.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(lb,{className:"text-purple-500",size:20,strokeWidth:1.5}),l.jsx(Jt,{children:"Follow suggestions"})]}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),l.jsx("ul",{className:"grow",children:r.map((b,z)=>{const u=b?.id||`loading-${z}`,f=b?.name||"",O=b?.handle||"",q=b?.avatarUrl||"";let h;switch(z){case 0:h="[@media(max-height:740px)]:hidden";break;case 1:h="[@media(max-height:800px)]:hidden";break;case 2:h="[@media(max-height:860px)]:hidden";break}return l.jsx(p.Fragment,{children:l.jsx("li",{className:h,children:l.jsx(br,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:l.jsx("div",{children:l.jsxs(Wb,{onClick:()=>{!n&&b&&rr(b,e)},children:[n?l.jsx(F1,{className:"z-10 size-10"}):l.jsx(dr,{author:{icon:{url:q},name:f,handle:O},showFollowButton:!0}),l.jsxs("div",{className:"flex min-w-0 flex-col",children:[l.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?l.jsx(F1,{className:"w-24"}):f}),l.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?l.jsx(F1,{className:"w-40"}):O})]})]})})})},u)},u)})}),l.jsx(z1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{c(),e("/explore")},children:"Find more →"})]})},Dr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},c=()=>{t(e.id,{followedByMe:!1})},i=Cn();return l.jsx(br,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:l.jsx("div",{children:l.jsxs(Wb,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[l.jsx(dr,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),l.jsxs("div",{className:"break-anywhere flex grow flex-col",children:[l.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?l.jsx(F1,{className:"w-full max-w-64"}):e.name}),l.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?l.jsx(F1,{className:"w-24"}):e.handle})]}),o?l.jsx("div",{className:"inline-flex items-center",children:l.jsx(F1,{className:"w-12"})}):l.jsx($O,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:c})]},e.id)})})},Ir0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=FO("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:l.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:l.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((c,i)=>l.jsx(l0.Fragment,{children:l.jsx(Dr0,{isLoading:r,profile:c||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},c?.id||`loading-${i}`))})})};function Fr0(e,t,o,n){var r=this,c=p.useRef(null),i=p.useRef(0),b=p.useRef(0),z=p.useRef(null),u=p.useRef([]),f=p.useRef(),O=p.useRef(),q=p.useRef(e),h=p.useRef(!0),W=p.useRef(),g=p.useRef();q.current=e;var v=typeof window<"u",w=!t&&t!==0&&v;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var N=!!(o=o||{}).leading,x=!("trailing"in o)||!!o.trailing,R=!!o.flushOnExit&&x,_="maxWait"in o,T="debounceOnServer"in o&&!!o.debounceOnServer,j=_?Math.max(+o.maxWait||0,t):null,L=p.useMemo(function(){var J=function(Y){var c0=u.current,$=f.current;return u.current=f.current=null,i.current=Y,b.current=b.current||Y,O.current=q.current.apply($,c0)},Q=function(Y,c0){w&&cancelAnimationFrame(z.current),z.current=w?requestAnimationFrame(Y):setTimeout(Y,c0)},Z=function(Y){if(!h.current)return!1;var c0=Y-c.current;return!c.current||c0>=t||c0<0||_&&Y-i.current>=j},t0=function(Y){return z.current=null,x&&u.current?J(Y):(u.current=f.current=null,O.current)},b0=function Y(){var c0=Date.now();if(N&&b.current===i.current&&O0(),Z(c0))return t0(c0);if(h.current){var $=t-(c0-c.current),P=_?Math.min($,j-(c0-i.current)):$;Q(Y,P)}},O0=function(){n&&n({})},M0=function(){if(v||T){var Y,c0=Date.now(),$=Z(c0);if(u.current=[].slice.call(arguments),f.current=r,c.current=c0,R&&!W.current&&(W.current=function(){var P;((P=globalThis.document)==null?void 0:P.visibilityState)==="hidden"&&g.current.flush()},(Y=globalThis.document)==null||Y.addEventListener==null||Y.addEventListener("visibilitychange",W.current)),$){if(!z.current&&h.current)return i.current=c.current,Q(b0,t),N?J(c.current):O.current;if(_)return Q(b0,t),J(c.current)}return z.current||Q(b0,t),O.current}};return M0.cancel=function(){var Y=z.current;Y&&(w?cancelAnimationFrame(z.current):clearTimeout(z.current)),i.current=0,u.current=c.current=f.current=z.current=null,Y&&n&&n({})},M0.isPending=function(){return!!z.current},M0.flush=function(){return z.current?t0(Date.now()):O.current},M0},[N,_,t,j,x,R,w,v,T,n]);return g.current=L,p.useEffect(function(){return h.current=!0,function(){var J;R&&g.current.flush(),W.current&&((J=globalThis.document)==null||J.removeEventListener==null||J.removeEventListener("visibilitychange",W.current),W.current=null),h.current=!1}},[R]),L}function Ur0(e,t){return e===t}function Hr0(e,t,o){var n=Ur0,r=p.useRef(e),c=p.useState({})[1],i=Fr0(p.useCallback(function(z){r.current=z,c({})},[c]),t,o,c),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const gp=80,$r0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),c=p.useRef(0),i=Cn(),[b]=Hr0(t,300),z=t.length>=2,{searchQuery:u,updateAccountSearchResult:f}=Kn0("index",z?b:""),{data:O,isFetching:q,isFetched:h}=u,{suggestedProfilesQuery:W}=FO("index",5),{data:g,isLoading:v}=W,w=v||g&&g.length>0,{topicsQuery:N}=UO(),{data:x}=N,R=IO("index","me"),{data:_}=R,[T,j]=p.useState([]),[L,J]=p.useState(null),[Q,Z]=p.useState(0),t0=p.useMemo(()=>{const P=x?.topics||[];if(!z||P.length===0)return[];const I=t.toLowerCase();return P.filter(k=>k.slug==="following"?!1:k.name.toLowerCase().startsWith(I)||k.slug.toLowerCase().startsWith(I))},[t,z,x?.topics]),b0=p.useMemo(()=>[...t0.map(P=>({type:"topic",data:P})),...T.map(P=>({type:"account",data:P}))],[t0,T]);p.useEffect(()=>{if(!z){j([]),J(null);return}h&&(O?.accounts&&O.accounts.length>0?(j(O.accounts),J("results"),Z(0)):(j([]),J("none"),Z(0)))},[O?.accounts,h,z]);const O0=q&&z,M0=t.length<2||!L&&z&&t0.length===0,Y=!M0&&L==="none"&&t0.length===0,c0=!M0&&(T.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const P=r.current[Q];if(!P)return;const I=P.closest("[data-radix-scroll-area-viewport]")||P.closest(".overflow-y-auto");if(!I){P.scrollIntoView({block:"nearest"});return}const k=I.getBoundingClientRect(),H=P.getBoundingClientRect();H.top<k.top+gp?I.scrollTo({top:I.scrollTop-(k.top+gp-H.top),behavior:"smooth"}):H.bottom>k.bottom-gp&&I.scrollTo({top:I.scrollTop+(H.bottom-k.bottom+gp),behavior:"smooth"})},[Q]);const $=P=>{if(!(!c0||b0.length===0)){if(P.key==="ArrowDown"||P.key==="ArrowUp"){P.preventDefault();const I=Date.now();if(I-c.current<50)return;c.current=I,P.key==="ArrowDown"?Z(k=>(k+1)%b0.length):Z(k=>(k-1+b0.length)%b0.length)}else if(P.key==="Enter"){const I=b0[Q];if(!I)return;P.preventDefault(),e?.(!1),I.type==="topic"?i(`/explore/${I.data.slug}`):i(`/profile/${I.data.handle}`)}}};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pt-3 pb-2 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[l.jsx(zO,{className:"text-gray-600",size:18,strokeWidth:1.5}),l.jsx(xM,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:P=>o(P.target.value),onKeyDown:$}),O0&&l.jsx(Ob,{className:"absolute! right-0 mr-0.5 shrink-0",size:"sm"})]}),l.jsxs("div",{className:"h-full",children:[Y&&l.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:l.jsxs(M00,{children:[l.jsx(l00,{children:l.jsx(uO,{})}),"No users matching this handle or account URL"]})}),c0&&l.jsx("div",{className:"mt-[-14px] pb-2",children:b0.map((P,I)=>{const k=I===Q;if(P.type==="topic")return l.jsx("div",{ref:A0=>r.current[I]=A0,children:l.jsxs(Wb,{isSelected:k,onClick:()=>{e?.(!1),i(`/explore/${P.data.slug}`)},children:[l.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:l.jsx(lb,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"font-semibold text-black dark:text-white",children:P.data.name}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},P.data.slug);const H=P.data,n0=H.handle===_?.handle;return l.jsx(br,{actor:H,align:"center",isCurrentUser:n0,side:"left",children:l.jsx("div",{ref:A0=>r.current[I]=A0,children:l.jsxs(Wb,{isSelected:k,onClick:()=>{e?.(!1),i(`/profile/${H.handle}`)},children:[l.jsx(dr,{author:{icon:{url:H.avatarUrl},name:H.name,handle:H.handle}}),l.jsxs("div",{className:"break-anywhere flex flex-col",children:[l.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:H.name}),l.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:H.handle})]}),H.blockedByMe||H.domainBlockedByMe?l.jsx(z1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):n0?null:l.jsx($O,{className:"ml-auto",following:H.followedByMe,handle:H.handle,type:"secondary",onFollow:()=>f(H.id,{followedByMe:!0}),onUnfollow:()=>f(H.id,{followedByMe:!1})})]})})},H.id)})}),M0&&w&&l.jsxs(l.Fragment,{children:[l.jsx(Jt,{children:"More people to follow"}),l.jsx(Ir0,{onOpenChange:e})]})]})]})},Vr0=()=>l.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[l.jsx(zO,{size:18,strokeWidth:1.5})," Search the social web"]}),$r=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const c=We(),{resetStack:i}=Jb(),b=DM(),z=e&&e.startsWith("/")?`${b}${e}`:e,u=z&&(c.pathname===z||c.pathname.startsWith(`${z}/`)),f=L0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),O=o&&o>0?l.jsx("span",{className:L0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:MM(o)}):null;return z?l.jsx(z1,{className:f,variant:"ghost",asChild:!0,children:l.jsxs(gs,{to:z,onClick:()=>{i(),ZZ(z)},children:[t,O]})}):l.jsxs(z1,{ref:r,className:f,variant:"ghost",onClick:n.onClick,...n,children:[t,O]})});$r.displayName="SidebarMenuLink";const ey=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=Tn0(),[n,r]=p.useState(!1),[c,i]=p.useState(""),{data:b}=me(),z=We(),u=DM(),{data:f}=$9(b?.slug||""),O=or0(b?.slug||""),{topicsQuery:q}=UO(),{data:h,isLoading:W}=q,g=!W&&h&&h.topics.length===0;p.useEffect(()=>{z.pathname===`${u}/notifications`&&f&&f>0&&O.mutate()},[z.pathname,u,f,O]);const v=p.useCallback(()=>{f&&f>0&&O.mutate()},[f,O]);return l.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?"max-lg:translate-x-0":"max-lg:translate-x-full"}`,children:l.jsxs("div",{className:"flex grow flex-col justify-between",children:[l.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pt-6 pl-6",children:[l.jsx("div",{className:"flex h-[52px] w-full items-center",children:l.jsxs(Ss,{open:n,onOpenChange:r,children:[l.jsx(Rv,{className:"mt-0.5 w-full",children:l.jsx(Vr0,{})}),l.jsx(ka,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:l.jsx($r0,{query:c,setQuery:i,onOpenChange:r})})]})}),l.jsxs("div",{className:"flex w-full flex-col gap-px",children:[l.jsxs($r,{to:"/reader",children:[l.jsx(yY,{size:18,strokeWidth:1.5}),"Reader"]}),l.jsxs($r,{to:"/notes",children:[l.jsx(MO,{size:18,strokeWidth:1.5}),"Notes"]}),l.jsxs($r,{count:z.pathname!==`${u}/notifications`?f:void 0,to:"/notifications",onClick:v,children:[l.jsx(gY,{size:18,strokeWidth:1.5}),"Notifications"]}),g?l.jsx(z1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:l.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[l.jsx(lb,{size:18,strokeWidth:1.5}),"Explore",l.jsx(bO,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):l.jsxs($r,{to:"/explore",children:[l.jsx(lb,{size:18,strokeWidth:1.5}),"Explore"]}),l.jsxs($r,{to:"/profile",children:[l.jsx(OM,{size:18,strokeWidth:1.5}),"Profile"]}),l.jsxs($r,{to:"/preferences",children:[l.jsx(SK,{size:18,strokeWidth:1.5}),"Preferences"]})]}),l.jsx(GO,{children:l.jsxs(z1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[l.jsx(QY,{}),"New note"]})}),l.jsx(jr0,{}),t.map(w=>o[w]?l.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[l.jsx("span",{className:"font-mono text-xs",children:w}),l.jsx("span",{className:"inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium text-green-800",children:"ON"})]},w):l.jsx(l.Fragment,{}))]}),l.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:l.jsx(Xr0,{})})]})})};ey.displayName="Sidebar";const Gr0=({children:e,...t})=>{const{isOnboarded:o}=Z9(),n=DM(),{data:r,isLoading:c}=me(),i=p.useRef(null),[b,z]=p.useState(!1),u=D9(),{topicsQuery:f}=UO(),{data:O}=f,q=O&&O.topics.length>0,{isNewNoteModalOpen:h,setIsNewNoteModalOpen:W}=K9(),g=()=>{z(!b)},v=()=>{z(!1)};return c||!r?null:o?l.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[l.jsx(JZ,{containerRef:i}),l.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[l.jsxs("div",{className:"z-0 min-w-0",children:[l.jsx(jn0,{showBorder:!(u==="reader"&&q)&&u!=="explore",onToggleMobileSidebar:g}),l.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),l.jsx(ey,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&l.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):l.jsx(J9,{})}),l.jsx(GO,{open:h,onOpenChange:W})]}):l.jsx(eo,{to:`${n}/welcome`,replace:!0})},Nc=({children:e})=>l.jsx("div",{className:"flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),_c=({children:e,className:t})=>l.jsx("div",{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||""}`,children:e}),ty=({statusCode:e,errorCode:t})=>{const o=cg(),n=L7(),r=c=>{c.preventDefault(),n("/analytics/",{crossApp:!0})};return o?l.jsx(Gr0,{children:l.jsxs(_c,{children:[l.jsx(Nc,{children:l.jsx(kK,{})}),l.jsx(Jt,{className:"-mb-4",children:"Oops, page not found!"}),l.jsx("div",{children:"We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place."})]})}):e===429?l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(W7,{})}),l.jsx(Jt,{className:"-mb-4",children:"Rate limit exceeded"}),l.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===403?t==="ROLE_MISSING"||t==="SITE_MISSING"?l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(A7,{})}),l.jsx(Jt,{className:"-mb-4",children:"Site not configured correctly"}),l.jsx("div",{children:"This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support."}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(mY,{})}),l.jsx(Jt,{className:"-mb-4",children:"Account suspended"}),l.jsx("div",{children:"Your account has been suspended due to policy violations."}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(FY,{})}),l.jsx(Jt,{className:"-mb-4",children:"New version available"}),l.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),l.jsx(z1,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):l.jsx("div",{className:"admin-x-container-error",children:l.jsxs("div",{className:"admin-x-error max-w-xl",children:[l.jsx("h1",{children:"Loading interrupted"}),l.jsx("p",{children:"They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again."}),l.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},Qr0=Object.freeze(Object.defineProperty({__proto__:null,default:ty},Symbol.toStringTag,{value:"Module"})),Yr0="activitypub",Kr0="preferences/move",oy=[{path:Yr0,element:l.jsx(Or,{}),errorElement:l.jsx(ty,{}),handle:"activitypub-basepath",children:[{index:!0,element:l.jsx(eo,{to:"reader"})},{path:"inbox",element:l.jsx(eo,{to:"../reader",replace:!0})},{path:"feed",element:l.jsx(eo,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>d1(()=>import("./index-D3LfHeBl.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>d1(()=>import("./index-D3LfHeBl.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>d1(()=>import("./feed-CygLK1Ad.js"),__vite__mapDeps([7,8]),import.meta.url)),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>d1(()=>import("./note-mUikaB-p.js"),__vite__mapDeps([9,2,3,8]),import.meta.url)),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>d1(()=>import("./index-Bjw2qAph.js"),__vite__mapDeps([10,11,12,13]),import.meta.url)),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>d1(()=>import("./index-CYPN5csJ.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>d1(()=>import("./index-CYPN5csJ.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>d1(()=>import("./index-C7xLyJVb.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>d1(()=>import("./index-C7xLyJVb.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>d1(()=>import("./index-C7xLyJVb.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>d1(()=>import("./index-C7xLyJVb.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>d1(()=>import("./index-C7xLyJVb.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>d1(()=>import("./index-D7Ui3Fih.js"),__vite__mapDeps([25,26,27,24,22,18,19,20,11]),import.meta.url)),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>d1(()=>import("./moderation-B2Tixfce.js"),__vite__mapDeps([28,21]),import.meta.url)),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>d1(()=>import("./bluesky-sharing-C2xwSoS-.js"),__vite__mapDeps([29,18,19,20,11,24]),import.meta.url)),showBackButton:!0},{path:Kr0,lazy:h1(()=>d1(()=>import("./account-migration-SYnE1jBW.js"),__vite__mapDeps([30,19]),import.meta.url)),pageTitle:"Account migration",showBackButton:!0},{path:"welcome",lazy:h1(()=>d1(()=>Promise.resolve().then(()=>Pr0),void 0,import.meta.url)),pageTitle:"Welcome",children:[{path:"",element:l.jsx(eo,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>d1(()=>import("./step-1-09wdjzdX.js"),__vite__mapDeps([31,24]),import.meta.url))},{path:"2",lazy:h1(()=>d1(()=>import("./step-2-8iaQ0efq.js"),__vite__mapDeps([32,33,13,34]),import.meta.url))},{path:"3",lazy:h1(()=>d1(()=>import("./step-3-BuHAZbdD.js"),__vite__mapDeps([35,33,13,34,36,6,8]),import.meta.url))},{path:"*",element:l.jsx(eo,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>d1(()=>Promise.resolve().then(()=>Qr0),void 0,import.meta.url))}]}];function Zr0(){return l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function os({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return XI(o||"")!==null}function I0({children:e,...t}){return l.jsx(wO,{...t,children:e})}const ny=l0.createContext(null);function ry(){const e=l0.useContext(ny);if(!e)throw new Error("NavMenuItem.Collapsible components must be used within NavMenuItem.Collapsible");return e}function Jr0({children:e,expanded:t,id:o,onExpandedChange:n}){const r={expanded:t,id:o,onExpandedChange:n};return l.jsx(ny.Provider,{value:r,children:e})}function e20({ariaLabel:e,children:t}){const{expanded:o,id:n,onExpandedChange:r}=ry();return l.jsxs(I0,{children:[l.jsx(z1,{"aria-controls":n,"aria-expanded":o,"aria-label":e,variant:"ghost",size:"icon",className:"hover:text-gray-black absolute top-0 left-3 h-[34px]! w-auto p-0 text-sidebar-accent-foreground transition-all group-hover/menu-item:opacity-100 hover:bg-transparent focus-visible:opacity-100 sidebar:opacity-0",onClick:()=>{r(!o)},children:l.jsx(dM,{size:16,className:`transition-all ${o?"rotate-[90deg]":""}`})}),t]})}function t20({children:e}){const{expanded:t,id:o}=ry();return l.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${t?"mb-5 grid-rows-[1fr]":"mb-0 grid-rows-[0fr]"}`,children:l.jsx("div",{className:"overflow-hidden",children:t?e:null})})}function o20({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:c,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,z=os({path:e,activeOnSubpath:n}),u=r!==void 0?r:z,{isMobile:f,setOpenMobile:O}=u2(),q=()=>{f&&O(!1)};return l.jsx(_M,{asChild:!0,isActive:u,...i,children:l.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:q,children:c})})}function n20({children:e,...t}){return l.jsx("span",{...t,children:e})}function r20({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=u2(),c=()=>{n&&r(!1),e?.()};return l.jsx(_M,{onClick:c,...o,children:t})}I0.Link=o20;I0.Label=n20;I0.Button=r20;I0.Collapsible=Jr0;I0.CollapsibleItem=e20;I0.CollapsibleMenu=t20;function a20({...e}){const{data:t}=me(),{data:o}=Ba(),n=Ao(o?.settings,"social_web_enabled")??!1,c=CM().data?.site.url,{data:i=0}=$9(t?.slug||"",n),b=os({path:"network",activeOnSubpath:!0}),z=os({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!z;return!t||!G00(t)?null:l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[l.jsx(I0,{children:l.jsxs(I0.Link,{to:"analytics",activeOnSubpath:!0,children:[l.jsx(m7,{}),l.jsx(I0.Label,{children:"Analytics"})]})}),n&&l.jsxs(I0,{children:[l.jsxs(I0.Link,{to:"network",isActive:b||z,children:[l.jsx(Zr0,{}),l.jsx(I0.Label,{children:"Network"})]}),u&&l.jsx(xO,{children:i})]}),l.jsxs(I0,{className:"group/viewsite relative",children:[l.jsxs(I0.Link,{to:"site",children:[l.jsx(fY,{}),l.jsx(I0.Label,{children:"View site"})]}),l.jsx("a",{href:c,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute top-0 right-0 flex size-8 items-center justify-center rounded-full text-gray-700 opacity-0 transition-all group-hover/viewsite:opacity-100 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",children:l.jsx(bO,{size:16})})]})]})})})}const Us="MembersResponseType",c20=Yo({dataType:Us,path:"/members/"}),Bc0=Xe({method:"POST",path:()=>"/members/",body:e=>({members:[e]}),invalidateQueries:{dataType:Us}}),Tc0=Xe({method:"POST",path:({id:e})=>`/members/${e}/commenting/disable`,body:({reason:e,hideComments:t})=>({reason:e,hide_comments:t}),invalidateQueries:{dataType:"CommentsResponseType"}}),Pc0=Xe({method:"POST",path:({id:e})=>`/members/${e}/commenting/enable`,body:()=>({}),invalidateQueries:{dataType:"CommentsResponseType"}}),Xc0=LW({dataType:Us,path:"/members/",defaultSearchParams:{include:"labels,tiers",limit:"100",order:"created_at desc"},defaultNextPageParams:(e,t)=>{if(e.meta?.pagination.next)return{...t,page:e.meta.pagination.next.toString()}},returnData:e=>{const{pages:t}=e,o=t.flatMap(r=>r.members),n=t[t.length-1].meta;return{members:o,meta:n,isEnd:n?n.pagination.pages===n.pagination.page:!0}}});function ay({filter:e,search:t,all:o}){if(!o&&!e&&!t)throw new Error("Bulk operation requires a filter, search, or all flag");const n={};return o&&(n.all="true"),e&&(n.filter=e),t&&(n.search=t),n}const jc0=Xe({method:"PUT",path:()=>"/members/bulk/",body:({action:e})=>({bulk:{action:e.type,meta:e.meta||{},newsletter:e.newsletter}}),searchParams:ay,invalidateQueries:{dataType:Us}}),Dc0=Xe({method:"DELETE",path:()=>"/members/",searchParams:ay,invalidateQueries:{dataType:Us}});function s20(){const{data:e}=c20({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const i20=()=>Is({select:e=>e.navigation}),p20=()=>{const{mutateAsync:e}=Fs();return re({mutationFn:async t=>{await e({navigation:t})}})},kq=e=>{const{data:t}=i20(),{mutateAsync:o}=p20();return[t?.expanded[e]??!0,async c=>o({expanded:{...t?.expanded??hu.expanded,[e]:c}})]},cy=p.createContext(void 0),Ic0=()=>{const e=p.useContext(cy);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},b20=({children:e,value:t})=>{const o=p.useContext(Yu),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return l.jsx(cy.Provider,{value:r,children:e})},M20=[{path:"",errorElement:l.jsx(pb,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([d1(()=>import("./post-analytics-context-BWDhMRq_.js").then(o=>o.p),__vite__mapDeps([37,38]),import.meta.url),d1(()=>import("./post-analytics-CWA8invj.js"),__vite__mapDeps([39,40,41,42,24,38,37]),import.meta.url)]);return{element:l.jsx(e,{children:l.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>d1(()=>import("./overview-yZ-7KJdx.js"),__vite__mapDeps([43,44,5,45,46,47,48,49,50,51,52,37,38,41,42,24,53,54,3,15,55,56,57,58,59,60,36,61,62,63,64,65,66,67,11,68,69,70,71,72,73,8,6,1,17,27,12,34,13,74,75,23,76,77,78,21,79]),import.meta.url))},{path:"web",lazy:h1(()=>d1(()=>import("./web-BRN2mUpo.js"),__vite__mapDeps([80,37,38,81,70,69,78,46,47,48,49,58,63,21,60,36,45,61,62,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,15,75,3,23,79,82,52,41,42,53,54,83,5]),import.meta.url))},{path:"growth",lazy:h1(()=>d1(()=>import("./growth-Fz3Oatml.js").then(e=>e.g),__vite__mapDeps([44,5,45,46,47,48,49,50,51,52,37,38,41,42,24,53,54,3,15,55,56,57]),import.meta.url))},{path:"newsletter",lazy:h1(()=>d1(()=>import("./newsletter-CbESXhxf.js"),__vite__mapDeps([84,49,85,63,21,64,65,66,67,51,52,37,38,41,42,24,53,54,3,47,15,58,76,77,55,57]),import.meta.url))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>d1(()=>import("./tags-DJrbEw5-.js"),__vite__mapDeps([86,40,87,50,17,5,26,88,75]),import.meta.url))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>d1(()=>import("./comments-BHru9ZQ8.js"),__vite__mapDeps([89,83,71,69,90,88,38,87,91,92,73,70,93,94,19,13,5,40,53]),import.meta.url))},{path:"automations",children:[{index:!0,lazy:h1(()=>d1(()=>import("./automations-DiGkcVt-.js"),__vite__mapDeps([95,96,50,40,88]),import.meta.url))},{path:":id",lazy:h1(()=>d1(()=>import("./editor-D3fcjt_F.js"),__vite__mapDeps([97,47,72,67,96,93,94,19,81,70,71,17,98]),import.meta.url))}]},{path:"*",element:l.jsx(pb,{onBackToDashboard:()=>{}})}]}],l20=hb({name:vt(),route:vt(),color:vt().optional(),icon:vt().optional(),filter:Fo0(vt(),vt().nullable())});function Cq(e){return e.trim().toLowerCase()}function z20(e,t){const o=Object.keys(e),n=Object.keys(t);return o.length!==n.length?!1:o.every(r=>e[r]===t[r])}function u20(e,t){return e.route===t.route&&z20(e.filter,t.filter)}function Fc0(e,t){return e.flatMap((o,n)=>u20(o,t)?[n]:[])}function Uc0(e,t,o){const n=Cq(t.name);return e.some((r,c)=>c!==o&&r.route===t.route&&Cq(r.name)===n)}function d20(e){try{const t=JSON.parse(e);return Array.isArray(t)?{ok:!0,views:t.flatMap(n=>{const r=l20.safeParse(n);return r.success?[r.data]:[]})}:(console.error("Failed to parse shared_views setting:",new Error("shared_views is not an array")),{ok:!0,views:[]})}catch{return{ok:!1,error:new Error("shared_views JSON parse failed")}}}function O20(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function sy(e){const{data:t}=Ba();return p.useMemo(()=>{const o=Ao(t?.settings,"shared_views")??"[]",n=d20(o);return n.ok?e?n.views.filter(r=>r.route===e):n.views:(console.error("Failed to parse shared_views setting:",n.error),[])},[t,e])}function iy({views:e}){return e.length===0?null:l.jsx(l.Fragment,{children:e.map(t=>l.jsx(I0,{children:l.jsxs(I0.Link,{className:"pl-9",to:t.to,isActive:t.isActive,children:[l.jsx(I0.Label,{className:t.color?"grow":void 0,children:t.name}),t.color&&l.jsx("span",{className:"mx-0.5 size-2 shrink-0 rounded-full",style:{backgroundColor:O20(t.color)},"data-color":t.color,"aria-hidden":"true"})]})},t.key))})}function py(e="posts"){const t=C7(),o=sy(e);return p.useMemo(()=>o.map(n=>{const r=t.getRouteUrl(e,n.filter);return{key:r,name:n.name,to:r,isActive:t.isRouteActive(e,n.filter),color:n.color}}),[e,t,o])}function f20({route:e="posts"}){const t=py(e);return l.jsx(iy,{views:t})}function A20(e){return e.route==="members"&&typeof e.filter.filter=="string"&&e.filter.filter.length>0}function q20(e){return`members?${new URLSearchParams({filter:e}).toString()}`}function h20(e,t,o){return e!=="/members"?!1:new URLSearchParams(t).get("filter")===o}function by(){const e=We(),t=sy("members");return p.useMemo(()=>t.filter(A20).map(o=>({key:`${o.name}:${o.filter.filter}`,name:o.name,to:q20(o.filter.filter),isActive:h20(e.pathname,e.search,o.filter.filter)})),[e.pathname,e.search,t])}function m20(){const e=by();return l.jsx(iy,{views:e})}const gb=e=>{const{data:t}=Ns();return t?.config.labs?.[e]??!1},W20=["member","member.new","members-activity"];function g20({isActive:e,to:t}){return l.jsxs(l.Fragment,{children:[l.jsxs(I0.Link,{to:t,isActive:e,children:[l.jsx(lO,{className:"pointer-events-none opacity-0 transition-all sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0"}),l.jsx(I0.Label,{children:"Posts"})]}),l.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"absolute top-0 right-0 flex size-8 items-center justify-center rounded-full p-0 text-gray-700 transition-all hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",children:l.jsx(O7,{size:20,className:"mt-px stroke-[1.5px]!"})})]})}function Eq({collapsible:e,count:t,isActive:o,to:n}){return l.jsxs(l.Fragment,{children:[l.jsxs(I0.Link,{to:n,isActive:o,children:[l.jsx(g7,{className:e?"pointer-events-none opacity-0 transition-all sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0":""}),l.jsx(I0.Label,{children:"Members"})]}),t!=null&&l.jsx(xO,{children:MM(t)})]})}function v20({...e}){const{data:t}=me(),{data:o}=Ba(),[n,r]=kq("posts"),[c,i]=kq("members"),b=py("posts"),z=by(),u=z.length>0,f=s20(),O=C7(),q=gb("commentModeration"),h=gb("automations"),W=os({path:"members",activeOnSubpath:!0}),g=t&&V00(t),v=t&&e9(t),w=Ao(o?.settings,"comments_enabled"),N=!!v&&q&&w!=="off",x=O.isRouteActive("posts",{type:"draft"}),R=O.isRouteActive("posts",{type:"scheduled"}),_=O.isRouteActive("posts",{type:"published"}),T=x||R||_||b.some(O0=>O0.isActive),j=n,L=u&&z.some(O0=>O0.isActive),J=c,Q=W?!L||!J:O.isRouteActive(W20),Z=O.getRouteUrl("posts"),b0=O.isRouteActive("posts")||!j&&T;return l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[l.jsxs(I0.Collapsible,{expanded:j,id:"posts-submenu",onExpandedChange:r,children:[l.jsx(I0.CollapsibleItem,{ariaLabel:"Toggle post views",children:l.jsx(g20,{isActive:b0,to:Z})}),l.jsxs(I0.CollapsibleMenu,{children:[l.jsx(I0,{children:l.jsx(I0.Link,{className:"pl-9",to:"posts?type=draft",isActive:x,children:l.jsx(I0.Label,{children:"Drafts"})})}),l.jsx(I0,{children:l.jsx(I0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:R,children:l.jsx(I0.Label,{children:"Scheduled"})})}),l.jsx(I0,{children:l.jsx(I0.Link,{className:"pl-9",to:"posts?type=published",isActive:_,children:l.jsx(I0.Label,{children:"Published"})})}),l.jsx(f20,{})]})]}),l.jsx(I0,{children:l.jsxs(I0.Link,{to:O.getRouteUrl("pages"),isActive:O.isRouteActive("pages"),children:[l.jsx(JY,{}),l.jsx(I0.Label,{children:"Pages"})]})}),g&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"tags",activeOnSubpath:!0,children:[l.jsx(XK,{}),l.jsx(I0.Label,{children:"Tags"})]})}),v&&l.jsx(l.Fragment,{children:u?l.jsxs(I0.Collapsible,{expanded:J,id:"members-submenu",onExpandedChange:i,children:[l.jsx(I0.CollapsibleItem,{ariaLabel:"Toggle member views",children:l.jsx(Eq,{collapsible:!0,count:f,isActive:Q,to:"members"})}),l.jsx(I0.CollapsibleMenu,{children:l.jsx(m20,{})})]}):l.jsx(I0,{children:l.jsx(Eq,{collapsible:!1,count:f,isActive:Q,to:"members"})})}),N&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"comments",activeOnSubpath:!0,children:[l.jsx(mK,{}),l.jsx(I0.Label,{children:"Comments"})]})}),v&&h&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"automations",activeOnSubpath:!0,children:[l.jsx(eZ,{}),l.jsx(I0.Label,{children:"Automations"})]})})]})})})}const Sq=function(){let t,o;return{promise:new Promise((r,c)=>{t=r,o=c}),resolve:t,reject:o}},q3="https://do.featurebase.app/js/sdk.js";let Tc=null;function y20(){return Tc||(Tc=new Promise((e,t)=>{if(document.querySelector(`script[src="${q3}"]`)){e();return}const n=document.createElement("script");n.src=q3,n.onload=()=>e(),n.onerror=r=>{n.remove(),Tc=null;const c=new Error(`[Featurebase] Failed to load SDK from ${q3}`,{cause:r});console.error(c),t(c)},document.head.appendChild(n)})),Tc}function R20(){const{data:e}=Ns(),{data:t}=Is(),o=gb("featurebaseFeedback"),[n,r]=p.useState(!1),{organization:c,enabled:i}=e?.config.featurebase??{},b=!!(o&&i),z=t?.nightShift?"dark":"light",{data:u}=aJ({enabled:b&&n}),f=u?.featurebase?.token;p.useEffect(()=>{n&&y20().catch(W=>{console.error("[Featurebase] Failed to load SDK:",W)})},[n]);const O=p.useRef(Sq());p.useEffect(()=>{!n||!c||!f||Tc?.then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:c,theme:z,featurebaseJwt:f},W=>{W?(console.error("[Featurebase] Failed to initialize widget:",W),O.current.reject(W),O.current=Sq(),r(!1)):O.current.resolve()})})},[c,z,f,n]);const q=p.useCallback(()=>{b&&r(!0)},[b]);return{openFeedbackWidget:p.useCallback(W=>{b&&(r(!0),O.current.promise.then(()=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...W?.board&&{setBoard:W.board}}},"*")}))},[b]),preloadFeedbackWidget:q}}function L20({...e}){const{data:t}=me(),{data:o}=Ns(),n=gb("featurebaseFeedback"),{openFeedbackWidget:r,preloadFeedbackWidget:c}=R20();if(!t)return null;const b=o?.config.hostSettings?.billing?.enabled&&Sa(t),z=n&&!Ps(t)&&o?.config.featurebase?.enabled;return!b&&!z?null:l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[b&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"pro",children:[l.jsx(HY,{}),l.jsx(I0.Label,{children:"Ghost(Pro)"})]})}),z&&l.jsx(I0,{children:l.jsxs(I0.Button,{onClick:r,onMouseEnter:c,onFocus:c,children:[l.jsx(MO,{}),l.jsx(I0.Label,{children:"Feedback"})]})})]})})})}function w20({...e}){const{data:t}=me(),o=t&&$00(t);return l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[o&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"settings",children:[l.jsx(A7,{}),l.jsx(I0.Label,{children:"Settings"})]})}),l.jsx(I0,{children:l.jsxs(I0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[l.jsx(XY,{}),l.jsx(I0.Label,{children:"Help"})]})})]})})})}function x20(){const{banner:e,bannerType:t}=PO();let o="";return t==="theme-errors"?o="pb-[110px]":t==="upgrade"?o="pb-[254px]":t==="whats-new"&&(o="pb-[180px]"),l.jsxs(Yv,{className:"justify-between px-3 pt-4",children:[l.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[l.jsx(a20,{}),l.jsx(v20,{}),l.jsx(L20,{})]}),l.jsxs("div",{className:`flex flex-col gap-2 sidebar:gap-4 ${o}`,children:[l.jsx(Cn0,{banner:e}),l.jsx(w20,{className:"pb-0"})]})]})}function N20({...e}){return l.jsxs(Hv,{...e,children:[l.jsx(J00,{className:"px-5 pt-6 pb-0"}),l.jsx(x20,{}),l.jsx(kn0,{className:"gap-0 p-3"})]})}const vp=1.5;function h3({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=os({path:e,activeOnSubpath:t});return l.jsx(z1,{asChild:!0,className:`w-full max-w-16 min-w-9 rounded-full hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:l.jsx("a",{href:e,children:o})})}function _20(){const{isMobile:e}=u2(),t=AO();return!e||!t?l.jsx(l.Fragment,{}):l.jsx("div",{className:"safe-area-inset-bottom fixed right-0 bottom-0 left-0 z-50 h-[var(--mobile-navbar-height)] border-t border-sidebar-border bg-sidebar/80 backdrop-blur-md sidebar:hidden",children:l.jsxs("div",{className:"mx-auto grid h-full w-full max-w-[300px] grid-cols-4 items-center justify-items-center px-5",children:[l.jsxs(h3,{activeOnSubpath:!0,to:"analytics",children:[l.jsx(m7,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Analytics"})]}),l.jsxs(h3,{activeOnSubpath:!0,to:"posts",children:[l.jsx(lO,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Posts"})]}),l.jsxs(h3,{activeOnSubpath:!0,to:"members",children:[l.jsx(g7,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Members"})]}),l.jsxs($v,{className:"h-9 rounded-full px-8 hover:bg-transparent",children:[l.jsx(d7,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})})}function k20({children:e}){const{data:t}=me(),o=AO();return t&&Ps(t)?l.jsxs("div",{className:"relative h-full bg-background",children:[l.jsx("main",{className:"flex h-full flex-col overflow-y-auto",children:l.jsx("div",{className:"flex-1",children:e})}),l.jsx("div",{className:"fixed bottom-3.5 left-3.5 z-20 lg:bottom-8 lg:left-8",children:l.jsx(hn0,{})})]}):l.jsxs(Uv,{open:!!t&&o,children:[l.jsx(N20,{}),l.jsxs(Vv,{className:`overflow-y-auto bg-background sidebar:max-h-full ${o?"max-h-[calc(100%-var(--mobile-navbar-height))]":"max-h-full"}`,children:[l.jsx("main",{className:"flex-1",children:e}),l.jsx(_20,{})]})]})}function C20(){const{data:e}=me();return lJ(),MJ(),l.jsx(cJ,{children:e?l.jsxs(k20,{children:[l.jsx(Or,{}),l.jsx(D6,{})]}):l.jsxs(l.Fragment,{children:[l.jsx(fO,{}),l.jsx(D6,{})]})})}const E20={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 90 days",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},S20=Object.values(E20),B20=2,Hc0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",unknown:"Unknown",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},$c0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],Vc0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Ma={PUBLIC:1,FREE:2,PAID:4},Gc0=Ma.PUBLIC|Ma.FREE|Ma.PAID,Qc0=[{name:"Public visitors",value:"undefined",bit:Ma.PUBLIC},{name:"Free members",value:"free",bit:Ma.FREE},{name:"Paid members",value:"paid",bit:Ma.PAID}],My=p.createContext(void 0),Yc0=()=>{const e=p.useContext(My);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},T20=({children:e})=>{const t=Ba(),o=CM(),n=Ns(),r=n.data?.config,c=!!r?.stats,i=hD({enabled:c}),[b,z]=p.useState(S20[B20].value),[u,f]=p.useState(null),O=[n,t,o],q=O.map(x=>x.error).find(Boolean),h=c?i.error:null,W=q||h,g=O.some(x=>x.isLoading),v=c?i.isLoading:!1,w=g||v;if(W)throw W;const N={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return l.jsx(My.Provider,{value:{data:r,site:N,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:w,range:b,setRange:z,settings:t.data?.settings||[],selectedNewsletterId:u,setSelectedNewsletterId:f},children:e})},P20=[{path:"analytics",children:[{index:!0,lazy:h1(()=>d1(()=>import("./index-Dd2BJRZH.js"),__vite__mapDeps([99,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,5,41,42,54,101,59,102,57,56,38]),import.meta.url))},{path:"web",lazy:h1(()=>d1(()=>import("./index-BYwL7gFN.js"),__vite__mapDeps([103,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,82,58,5,85,104,48,83,101,57,21,79]),import.meta.url))},{path:"growth",lazy:h1(()=>d1(()=>import("./index-2qcjFCQs.js"),__vite__mapDeps([105,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,5,21,79,101,106,50,104,56,48,57,107,108,77,102]),import.meta.url))},{path:"newsletters",lazy:h1(()=>d1(()=>import("./index-DPbi4ie_.js"),__vite__mapDeps([109,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,5,21,79,106,50,110,57]),import.meta.url))}]}],X20=()=>{const{data:e,isError:t,isLoading:o}=me();return e?l.jsx(eo,{replace:!0,to:`/settings/staff/${e.slug}`}):t||!o?l.jsx(eo,{replace:!0,to:"/"}):null};function j20(){const{data:e,isError:t,isLoading:o}=me();return e?e9(e)?l.jsx(Or,{}):l.jsx(eo,{replace:!0,to:"/"}):t||!o?l.jsx(eo,{replace:!0,to:"/"}):null}const Bq=[{description:"Craft a look that reflects your brand and style.",icon:xY,id:"customize-design",route:"/settings/design/edit?ref=setup",title:"Customize your design"},{description:"Get to know a writing experience you'll love.",icon:lO,id:"first-post",route:"/editor/post",title:"Explore the editor"},{description:"Add members and grow your readership.",icon:UK,id:"build-audience",route:"/members",title:"Build your audience"},{description:"Expand your reach on social media.",icon:uK,id:"share-publication",route:void 0,title:"Share your publication"}],D20=new Date("2026-04-30T00:00:00.000Z");function I20(e){return e?e>=D20:!1}function F20(){const{data:e,isLoading:t}=me(),{data:o,isLoading:n}=Is(),{mutateAsync:r}=Fs(),c=p.useRef(!1),i=p.useMemo(()=>o?.onboarding.completedSteps||[],[o?.onboarding.completedSteps]),b=p.useMemo(()=>new Set(i),[i]),z=o?.onboarding.checklistState||"pending",u=o?.onboarding.startedAt,f=I20(u),O=e?Sa(e):!1,q=O&&z==="started"&&f,h=Bq.find(R=>!b.has(R.id))?.id,W=Bq.every(R=>b.has(R.id)),g=p.useCallback(R=>r({onboarding:R}),[r]),v=p.useCallback(async R=>{b.has(R)||await g({completedSteps:[...i,R]})},[b,i,g]),w=p.useCallback(()=>g({checklistState:"dismissed"}),[g]);p.useEffect(()=>{t||n||!O||z!=="started"||f||c.current||(c.current=!0,w().catch(R=>{c.current=!1,console.error(R)}))},[z,w,f,O,n,t]);const N=p.useCallback(()=>g({completedSteps:[],checklistState:"started",startedAt:new Date}),[g]),x=p.useCallback(()=>g({checklistState:"completed"}),[g]);return{allStepsCompleted:W,checklistState:z,completeChecklist:x,completedSteps:i,dismissChecklist:w,hasActiveStartedAt:f,isOwner:O,shouldShowChecklist:q,isLoading:t||n,markStepCompleted:v,nextStep:h,startChecklist:N}}function U20({children:e}){const t=We(),o=F20();if(o.isLoading)return null;if(o.shouldShowChecklist){const n=`${t.pathname}${t.search}`;return l.jsx(eo,{replace:!0,to:`/setup/onboarding?returnTo=${encodeURIComponent(n)}`})}return e}function H20(){return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-2xl font-bold",children:"404"}),l.jsx("span",{className:"text-grey-500","aria-hidden":"true",children:"|"}),l.jsx("h2",{className:"text-lg text-grey-700",children:"Page not found"})]})})}const $20=["/","/dashboard","/site","/launch","/setup/*","/signin/*","/signout","/signup/*","/reset/*","/pro/*","/posts","/posts/analytics/:postId/mentions","/posts/analytics/:postId/debug","/restore","/pages","/editor/*","/tags/new","/explore/*","/migrate/*","/members/new","/members/:member_id","/members-activity","/designsandbox","/mentions"],QO={allowInForceUpgrade:!0},V20=$20.map(e=>({path:e,Component:fO,handle:QO})),G20={path:"/members",element:l.jsx(j20,{}),handle:QO,children:[{index:!0,lazy:h1(()=>d1(()=>import("./members-XkHao5Yf.js"),__vite__mapDeps([111,40,83,71,69,17,90,88,38,87,91,92,112,66,62,81,70,50,55,110,75,5,47,53,108,63]),import.meta.url))},{path:"import",lazy:h1(()=>d1(()=>import("./members-XkHao5Yf.js"),__vite__mapDeps([111,40,83,71,69,17,90,88,38,87,91,92,112,66,62,81,70,50,55,110,75,5,47,53,108,63]),import.meta.url))}]},Q20=[{element:l.jsx(OJ,{}),children:[{path:"/tags/:tagSlug",Component:fO,handle:QO},G20,{element:l.jsx(b20,{value:{fromAnalytics:!0},children:l.jsx(Or,{})}),children:M20[0].children.filter(e=>e.path!=="*")},{element:l.jsx(U20,{children:l.jsx(T20,{children:l.jsx(Or,{})})}),children:P20},{path:"setup/onboarding",lazy:h1(()=>d1(()=>import("./onboarding-route-Dqv2nP7b.js"),__vite__mapDeps([113,63,74,42,24]),import.meta.url))},{path:"network",loader:()=>GD("/activitypub")},{path:"my-profile",Component:X20,handle:{allowInForceUpgrade:!0}},{path:"",element:l.jsx(En0,{children:l.jsx(Or,{})}),children:oy},{path:"settings/*",lazy:h1(()=>d1(()=>import("./settings-66Zv8QvL.js").then(e=>e.bl),__vite__mapDeps([114,21,110,38,92,108,112,66,107,81,70,68,26,20]),import.meta.url)),handle:{allowInForceUpgrade:!0}},...V20,{path:"*",Component:H20}]}],Y20=["http:","https:","mailto:","tel:"];function K20(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return Y20.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function Z20({children:e}){const{data:t}=Ba(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Ao(n,"paid_members_enabled")??!1,newslettersEnabled:Ao(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Ao(n,"email_track_opens")??!1,emailTrackClicks:Ao(n,"email_track_clicks")??!1,membersTrackSources:Ao(n,"members_track_sources")??!1,outboundLinkTagging:Ao(n,"outbound_link_tagging")??!1,webAnalytics:Ao(n,"web_analytics_enabled")??!1}}},[t]);return l.jsx(xN,{appSettings:o,children:e})}const J20={ghostVersion:"",externalNavigate:e=>{K20(e.route)},unsplashConfig:{Authorization:"Client-ID 8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980","Accept-Version":"v1","Content-Type":"application/json","App-Pragma":"no-cache","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};tL.createRoot(document.getElementById("root")).render(l.jsx(p.StrictMode,{children:l.jsx(wN,{...J20,children:l.jsx(eJ,{prefix:"/",routes:Q20,children:l.jsx(Z20,{children:l.jsx($Z,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:l.jsx(C20,{})})})})})}));export{Nc0 as $,dr as A,z1 as B,dM as C,Ss as D,_c as E,Br0 as F,L0 as G,Jt as H,gs as I,pc0 as J,bc0 as K,Gr0 as L,zc0 as M,uc0 as N,Mc0 as O,br as P,lc0 as Q,eQ as R,F1 as S,M00 as T,l00 as U,mY as V,Wb as W,dO as X,He as Y,wc0 as Z,xc0 as _,Jb as a,xv as a$,A8 as a0,u7 as a1,XJ as a2,fv as a3,Av as a4,hv as a5,mv as a6,qv as a7,gv as a8,Wv as a9,tL as aA,as as aB,d1 as aC,yb as aD,oa0 as aE,de as aF,Oc0 as aG,fc0 as aH,Ac0 as aI,xM as aJ,h7 as aK,Ns as aL,CM as aM,Ba as aN,hD as aO,kb as aP,qY as aQ,Mm as aR,go as aS,TP as aT,zm as aU,PP as aV,y7 as aW,Ca0 as aX,Or as aY,L7 as aZ,_a0 as a_,hM as aa,i00 as ab,wv as ac,vM as ad,iK as ae,Yo as af,Xe as ag,uD as ah,LW as ai,wW as aj,wa0 as ak,ga0 as al,N0 as am,Aa0 as an,MM as ao,za0 as ap,Q0 as aq,Nn as ar,yt as as,L1 as at,s2 as au,T1 as av,T0 as aw,BN as ax,_h as ay,ro as az,Cn as b,fa0 as b$,tQ as b0,lb as b1,Ic0 as b2,La0 as b3,xa0 as b4,Wa as b5,qd as b6,v7 as b7,d7 as b8,OO as b9,_n as bA,GO as bB,FO as bC,EY as bD,QY as bE,qc0 as bF,Yn0 as bG,In0 as bH,ty as bI,yc0 as bJ,Pa as bK,oK as bL,vc0 as bM,gY as bN,xc as bO,mp as bP,m7 as bQ,RO as bR,yO as bS,mM as bT,d00 as bU,ka0 as bV,jv as bW,A00 as bX,q00 as bY,h00 as bZ,b00 as b_,ma0 as ba,R7 as bb,e2 as bc,f8 as bd,C6 as be,da0 as bf,ua0 as bg,QZ as bh,O7 as bi,jb as bj,Ro as bk,Rr as bl,bm,AX as bn,zs as bo,Ra as bp,$o as bq,fd as br,Od as bs,Vb as bt,Hb as bu,ya as bv,za as bw,Db as bx,Ib as by,kY as bz,Nc as c,$c0 as c$,UK as c0,OM as c1,Cu as c2,Gc0 as c3,Qc0 as c4,Ma as c5,Yc0 as c6,na0 as c7,Ra0 as c8,eo as c9,FJ as cA,QG as cB,vv as cC,Oa0 as cD,We as cE,KY as cF,va0 as cG,E20 as cH,E6 as cI,HY as cJ,S20 as cK,St as cL,v1 as cM,ra0 as cN,aa0 as cO,NN as cP,ca0 as cQ,jJ as cR,z00 as cS,u00 as cT,Pv as cU,c3 as cV,yv as cW,Wc0 as cX,dc0 as cY,gc0 as cZ,vb as c_,Qa0 as ca,Ya0 as cb,c9 as cc,Rc0 as cd,GK as ce,GJ as cf,Nq as cg,_q as ch,Ec0 as ci,Sc0 as cj,hb as ck,vt as cl,tr0 as cm,_a as cn,Cc0 as co,W00 as cp,g00 as cq,v00 as cr,Iv as cs,ha0 as ct,g7 as cu,XK as cv,Bq as cw,cK as cx,F20 as cy,Ao as cz,Wp as d,cc0 as d$,Hc0 as d0,lO as d1,ya0 as d2,Vc0 as d3,Na0 as d4,zO as d5,Hr0 as d6,DY as d7,Xc0 as d8,HJ as d9,Uc0 as dA,Xa0 as dB,VR as dC,ea0 as dD,uN as dE,eZ as dF,WO as dG,vO as dH,_s as dI,ks as dJ,ss as dK,Kv as dL,c_ as dM,u5 as dN,Ua0 as dO,$z as dP,pa0 as dQ,ba0 as dR,Iu as dS,Va0 as dT,Wn0 as dU,B9 as dV,T9 as dW,gn0 as dX,oc0 as dY,nc0 as dZ,sc0 as d_,Tc0 as da,Pc0 as db,MO as dc,qK as dd,j9 as de,Nr0 as df,kc0 as dg,_c0 as dh,hc0 as di,mc0 as dj,Hr as dk,c20 as dl,WM as dm,W7 as dn,Qb as dp,jc0 as dq,Dc0 as dr,la0 as ds,me as dt,Bc0 as du,d20 as dv,l20 as dw,Fo0 as dx,Ka0 as dy,Fc0 as dz,Ob as e,f7 as e$,aD as e0,La as e1,tc0 as e2,rc0 as e3,ac0 as e4,cs as e5,Za0 as e6,Fa0 as e7,Ja0 as e8,ec0 as e9,O5 as eA,f5 as eB,Fu as eC,AP as eD,gm as eE,FP as eF,TX as eG,PX as eH,XX as eI,$m as eJ,Jm as eK,eW as eL,tW as eM,r_ as eN,Vj as eO,ia0 as eP,Gj as eQ,WW as eR,Yb as eS,Uc as eT,Ma0 as eU,Ow as eV,Wa0 as eW,mD as eX,Ha0 as eY,Ps as eZ,ja0 as e_,vo as ea,sJ as eb,iJ as ec,pJ as ed,lT as ee,Ga0 as ef,Y00 as eg,$a0 as eh,Ia0 as ei,Da0 as ej,fe as ek,G00 as el,Ba0 as em,J3 as en,Sa as eo,Ea0 as ep,Zv as eq,Sa0 as er,Ta0 as es,$00 as et,Jv as eu,Pa0 as ev,kM as ew,Xh as ex,sa0 as ey,kT as ez,Z9 as f,bK as f0,Wh as f1,Nh as f2,fY as f3,LY as f4,yY as f5,xY as f6,TY as f7,XY as f8,FY as f9,JY as fa,rK as fb,lK as fc,uK as fd,OK as fe,mK as ff,gK as fg,yK as fh,wK as fi,kK as fj,A7 as fk,SK as fl,q7 as fm,uO as fn,$K as fo,dY as fp,ur as g,rr as h,ic0 as i,l as j,Lc0 as k,IO as l,$O as m,_u as n,Ip as o,UO as p,Rv as q,p as r,Y2 as s,l0 as t,FI as u,ka as v,gM as w,yM as x,bO as y,DM as z};
279
+ `+V1),B&&yc([t0,b0,O0],X1=>{V1=U2(V1,X1," ")}),R&&a1?R.createHTML(V1):V1},t.setConfig=function(){let w0=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};K1(w0),g0=!0},t.clearConfig=function(){H1=null,g0=!1},t.isValidAttribute=function(w0,E,r0){H1||K1({});const m0=b1(w0),$0=b1(E);return _0(m0,$0,r0)},t.addHook=function(w0,E){typeof E=="function"&&Rc(Z[w0],E)},t.removeHook=function(w0,E){if(E!==void 0){const r0=sr0(Z[w0],E);return r0===-1?void 0:ir0(Z[w0],r0,1)[0]}return Oq(Z[w0])},t.removeHooks=function(w0){Z[w0]=[]},t.removeAllHooks=function(){Z=Rq()},t}var wr0=Y9();const xr0=["http:","https:","mailto:"];function _c0(e){try{const t=new URL(e);return xr0.includes(t.protocol)}catch{return!1}}function kc0(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Y2(e){return wr0.sanitize(e)}function _u(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const f=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(f,O=>{const q=`__EXCLUDED_TAG_${r+=1}__`;return n[q]=O,q})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let z=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,f]of Object.entries(n))z=z.replace(u,f);return z}const Ip=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},Lq=e=>"preferredUsername"in e,br=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:c=!1})=>{const[i,b]=p.useState(!1),z=Cn();let u=e?.handle;!u&&e&&Lq(e)&&(u=ur(e));const f=o||!u&&!e,O=IO("index",u||"",{enabled:i&&!!u}),q=O.isFetching||O.isLoading,h=O.error,W=O.data?typeof O.data.followerCount=="number"&&typeof O.data.followingCount=="number"&&O.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!W&&!q&&!h&&O.refetch({cancelRefetch:!1})},[O,q,h,W,i,u]),f)return l.jsx(l.Fragment,{children:t});const v=O.data||e,w=v?.handle??u??"",N=v?.name??"",x=v?.avatarUrl??(e&&Lq(e)?e.icon?.url:null)??null,R=!!v?.followsMe,_=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,T=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,j=v?.bio?Ip(_u(v.bio,["a"])):void 0,L=()=>{w&&z(`/profile/${w}`)},J=()=>{w&&z(`/profile/${w}/following`)},Q=()=>{w&&z(`/profile/${w}/followers`)};return l.jsxs(a00,{onOpenChange:b,children:[l.jsx(c00,{asChild:!0,children:t}),l.jsx(Tv,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-hidden dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:Z=>Z.stopPropagation(),children:l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex justify-between",children:[l.jsxs(RO,{className:"size-14 cursor-pointer",onClick:L,children:[x&&l.jsx(yO,{alt:N,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:x,onError:Z=>{Z.target.src="",Z.target.style.display="none"}}),l.jsx(mM,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:l.jsx(uO,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!c&&l.jsx($O,{following:!!v?.followedByMe,handle:w,type:"primary"})]}),l.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:L,children:[l.jsx(A8,{className:"w-full truncate",children:N}),l.jsxs("div",{className:"flex w-full gap-2",children:[l.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:w}),R&&!c&&l.jsx(yv,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),l.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:q?l.jsx(F1,{className:"h-4 w-32"}):!h&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"cursor-pointer hover:underline",onClick:J,children:[l.jsx("span",{className:"font-bold text-black dark:text-white",children:E6(_)})," ","Following"]}),l.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Q,children:[l.jsx("span",{className:"font-bold text-black dark:text-white",children:E6(T)})," ","Followers"]})]})}),q?l.jsx(F1,{className:"h-4 w-48"}):!h&&j?l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(j)},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a]:text-[#00a4eb] [&_a:hover]:underline"}):null]})})]})},K9=(e={})=>{const[t,o]=p.useState(!1),n=We();return p.useEffect(()=>{const r=c=>{if(c.target instanceof HTMLInputElement||c.target instanceof HTMLTextAreaElement||c.target instanceof HTMLElement&&c.target.isContentEditable||c.target instanceof HTMLSelectElement||c.metaKey||c.ctrlKey||c.altKey||c.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(c.key.toLowerCase()){case"n":i||(c.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(c.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},mp=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:c,disabled:i=!1,buttonClassName:b="",onLikeClick:z,onCommentClick:u,onReplyCountChange:f})=>{const[O,q]=p.useState(t.liked),[h,W]=p.useState(t.reposted),[g,v]=p.useState(!1),w=p.useRef(null);K9({isReplyAvailable:!u&&c!=="reply",onOpenReply:()=>v(!0),componentRef:w}),p.useEffect(()=>{q(t.liked),W(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{j(r)},[r]);const N=$n0("index"),x=Vn0("index"),R=Gn0("index"),_=Qn0("index"),[T,j]=p.useState(r),L=async Z=>{Z.stopPropagation(),O?x.mutate(t.id):N.mutate(t.id,{onError(){q(!1)}}),q(!O),z()},J=Z=>{Z.stopPropagation(),u?u():v(!0)},Q=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{ref:w,className:`flex ${c!=="inbox"&&"gap-1"}`,children:[l.jsxs(z1,{className:`${Q} ${O&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${O?"Undo like":"Like"}`,variant:"ghost",onClick:Z=>{Z?.stopPropagation(),Z&&L(Z)},children:[l.jsx(oK,{className:`${O&&"fill-pink-500 text-pink-500"}`}),c!=="inbox"&&l.jsx(F6,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),l.jsxs(z1,{className:`${Q}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:J,children:[l.jsx(MO,{className:"-mr-px"}),c!=="inbox"&&n>0&&MM(n)]}),l.jsxs(z1,{className:`${Q} ${h&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${h?"Undo repost":"Repost"}`,variant:"ghost",onClick:Z=>{Z?.stopPropagation(),h?(_.mutate(t.id),j(T-1)):(R.mutate(t.id,{onError(){W(!1),j(T-1)}}),j(T+1)),W(!h)},children:[l.jsx(f7,{className:`${h&&"text-green-500"}`}),c!=="inbox"&&l.jsx(F6,{className:T===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:T})]})]}),g&&l.jsx(GO,{open:g,replyTo:{object:t,actor:e},onOpenChange:Z=>{v(Z)},onReply:()=>{f?.(1),v(!1)},onReplyError:()=>{f?.(-1)}})]})};function Nr0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const rr=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||ur(e)}`)},_r0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),c=o(e);return c.getTime()===n.getTime()?kr0(e):c.getTime()===r.getTime()?"Yesterday":Cr0(e)},kr0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},Cr0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function Er0(e){return new Date(e).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(e).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"})}function Wp(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=Er0(o),r=_r0(o);return t&&!e.url?.includes("/.ghost/activitypub")?l.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:c=>c.stopPropagation(),children:r}):l.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function VO(e){let t;if(e.image&&(t=e.image),e.type==="Note"&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function xc(e,t,o,n){const r=VO(e);if(!r)return null;const c=z=>u=>{u.stopPropagation(),t&&t(z)},i=z=>{n&&n(z)},b=(z,u=!1)=>{const f=u?"min-h-[200px]":"";return l.jsx("div",{className:`${z} ${f} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:l.jsx(rK,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const z=r.length;let u="";return z===1?u="grid-cols-1":z>=2&&z<=4?u="grid-cols-2 auto-rows-[150px]":z>4&&(u="grid-cols-3 auto-rows-[150px]"),l.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((f,O)=>{const q=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${z===3&&O===0?"row-span-2":""}`;return o&&o.has(f.url)?b(q,z===1):l.jsx("img",{alt:f.name||`Image-${O}`,className:`${q} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:f.url,onClick:t?c(f.url):void 0,onError:()=>i(f.url)},f.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):l.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?c(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return l.jsx("div",{className:"relative mt-3 mb-4",children:l.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return l.jsx("div",{className:"relative mt-2 mb-4 w-full",children:l.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const z=e.type==="Article"?"cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover":"cursor-pointer mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(z,!0):l.jsx("img",{alt:r.name||"Image",className:z,referrerPolicy:"no-referrer",src:u,onClick:t?c(u):void 0,onError:()=>i(u)})}return null}}function Sr0(e,t){const o=VO(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative hidden @md/inbox-item:block",r=de("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return l.jsx(F1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return l.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return l.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return l.jsxs("div",{className:n,children:[l.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),l.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsx(wK,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return l.jsx("div",{className:"ml-8 w-[120px]",children:l.jsx("div",{className:"relative mt-2 mb-4 w-full",children:l.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?l.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const wq=()=>{},xq=l.jsx(f7,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),Br0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:c,commentCount:i=0,repostCount:b=0,likeCount:z=0,showHeader:u=!0,last:f,isLoading:O,isPending:q=!1,isCompact:h=!1,isChainContinuation:W=!1,isChainParent:g=!1,onClick:v=wq,onDelete:w=wq,showStats:N=!0})=>{const x=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,R]=p.useState(!1),[_,T]=p.useState(new Set),j=p.useRef(null),[L,J]=p.useState(!1),Q=er0("index"),Z=Cn(),t0=DO("index",()=>{He.success(`Followed ${P?.name}`)},()=>{He.error("Failed to follow")}),b0=jO("index",()=>{He.info(`Unfollowed ${P?.name}`)},()=>{He.error("Failed to unfollow")});p.useEffect(()=>{const J0=j.current;J0&&J(J0.scrollHeight>J0.clientHeight)},[o?.content]),p.useEffect(()=>{const J0=j.current;if(!J0)return;const u1=B=>{const a0=B.target.closest("a[data-profile]");if(a0){const g0=a0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(g0||"")&&g0&&(B.preventDefault(),B.stopPropagation(),rr(g0,Z))}};return J0.addEventListener("click",u1),()=>{J0.removeEventListener("click",u1)}},[Z,o?.content]);const O0=()=>{},M0=()=>{q||v()},Y=()=>{Q.mutate({id:o.id,parentId:n}),w()},c0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),R(!0),He.success("Link copied"),setTimeout(()=>R(!1),2e3))},$=J0=>{T(u1=>new Set(u1).add(J0))};let P=e;c==="Announce"&&(P=typeof o.attributedTo=="object"?o.attributedTo:e);const I=P?ur(P):null,k=P?.followedByMe||!1,H=c==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,n0=c==="Announce"?o.reposted??!1:o.authored,A0=()=>{I&&t0.mutate(I)},s0=()=>{I&&b0.mutate(I)},q0=l.jsx(z1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="modal"?"text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600":"text-gray-500 hover:text-gray-500"} dark:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:l.jsx(d7,{})}),{lightboxState:p0,openLightbox:e0,closeLightbox:R0,navigateToIndex:Z0}=nr0(o);return r==="feed"?l.jsxs(l.Fragment,{children:[o&&l.jsxs("div",{className:`group/article relative -mx-4 ${q?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:M0,children:[c==="Announce"&&l.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[xq,l.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[l.jsx(br,{actor:e,align:"center",isCurrentUser:n0,children:l.jsx("span",{className:"break-anywhere truncate hover:underline",onClick:J0=>{rr(e,Z,J0)},children:e.name})}),"reposted"]})]}),l.jsxs("div",{className:"flex flex-col gap-2.5","data-test-activity":!0,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(br,{actor:P,isCurrentUser:H,children:l.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[l.jsx(dr,{author:P,disabled:q,showFollowButton:!H&&!k}),l.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:J0=>{q||rr(P,Z,J0)},children:[l.jsx("span",{className:`break-anywhere min-w-0 truncate font-semibold ${h?"text-lg":"text-md"} ${q?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:O?l.jsx(F1,{className:"w-24"}):P.name}),l.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[l.jsx("span",{className:`truncate ${q?"":"hover-underline"}`,children:O?l.jsx(F1,{className:"w-56"}):ur(P)}),l.jsx("div",{className:`ml-1 before:mr-1 ${!O&&'before:content-["·"]'}`,title:`${x}`,children:O?l.jsx(F1,{className:"w-4"}):Wp(o,q===!1&&!o.authored)})]})]})]})}),l.jsx(l3,{allowDelete:t,authoredByMe:H,disabled:q,followedByMe:k,layout:"feed",trigger:q0,onCopyLink:c0,onDelete:Y,onFollow:A0,onUnfollow:s0})]}),l.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsx("div",{className:"",children:o.type==="Article"?l.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[xc(o,M0,_,$),l.jsxs("div",{className:"p-5",children:[l.jsx("div",{className:"break-anywhere mb-1 line-clamp-2 text-lg leading-tight font-semibold tracking-tight text-pretty","data-test-activity-heading":!0,children:o.name}),l.jsx("div",{className:"break-anywhere line-clamp-3 leading-[1.4em]",children:o.preview?.content})]})]}):l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"ap-note-content break-anywhere line-clamp-[10] leading-[1.4285714286] tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3",children:O?l.jsx(F1,{count:2}):l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(Ip(o.content||"")??"")},ref:j,onClick:J0=>{const u1=J0.target;(u1.tagName==="A"||u1.closest("a"))&&J0.stopPropagation()}})}),L&&l.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),xc(o,e0,_,$)]})}),l.jsx("div",{className:"space-between relative z-[30] mt-1 ml-[-8px] flex",children:O?l.jsx(F1,{className:"ml-2 w-18"}):N&&l.jsx(mp,{actor:P,commentCount:i,disabled:q,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0})})]})})]})]}),l.jsx(z3,{currentIndex:p0.currentIndex,images:p0.images,isOpen:p0.isOpen,onClose:R0,onNavigate:Z0})]}):r==="modal"?l.jsxs(l.Fragment,{children:[o&&l.jsxs("div",{"data-object-id":o.id,children:[l.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:M0,children:[l.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pt-4 pb-3","data-test-activity":!0,children:[u&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"relative z-10 pt-[3px]",children:l.jsx(dr,{author:P,showFollowButton:!H&&!k})}),l.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:J0=>{q||rr(P,Z,J0)},children:[l.jsxs("div",{className:"flex w-full",children:[l.jsx("span",{className:'break-anywhere min-w-0 truncate font-semibold whitespace-nowrap after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:P.name}),l.jsx("div",{children:Wp(o,!o.authored)})]}),l.jsx("div",{className:"flex w-full",children:l.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:ur(P)})})]})]}),l.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:l.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&l.jsx(Jt,{className:"break-anywhere mb-1 leading-tight","data-test-activity-heading":!0,children:o.name}),l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(Ip(o.content||"")??"")},ref:j,className:"ap-note-content-large break-anywhere text-[1.6rem] tracking-[-0.011em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3"}),xc(o,e0,_,$),l.jsx("div",{className:"space-between mt-3 ml-[-8px] flex",children:N&&l.jsx(mp,{actor:P,commentCount:i,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0})})]})})]}),l.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),l.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),l.jsx(z3,{currentIndex:p0.currentIndex,images:p0.images,isOpen:p0.isOpen,onClose:R0,onNavigate:Z0})]}):r==="reply"?l.jsxs(l.Fragment,{children:[o&&l.jsxs("div",{className:`group/article relative ${h?"pb-6":W?"pb-5":"py-5"} ${q?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:M0,children:[l.jsxs("div",{className:"flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(br,{actor:P,isCurrentUser:H,children:l.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[l.jsx(dr,{author:P,disabled:q,showFollowButton:!H&&!k}),l.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:J0=>{q||rr(P,Z,J0)},children:[l.jsxs("div",{className:"flex",children:[l.jsx("span",{className:'break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:P.name}),l.jsx("div",{children:Wp(o,q===!1&&!o.authored)})]}),l.jsx("div",{className:"flex",children:l.jsx("span",{className:"truncate text-gray-700",children:ur(P)})})]})]})}),!h&&l.jsx(l3,{allowDelete:t,authoredByMe:H,disabled:q,followedByMe:k,layout:"reply",trigger:q0,onCopyLink:c0,onDelete:Y,onFollow:A0,onUnfollow:s0})]}),l.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:l.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&xc(o,M0,_,$),o.name&&l.jsx(Jt,{className:"break-anywhere mt-2.5 leading-tight text-pretty","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?l.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(Ip(o.content||"")??"")},ref:j,className:"ap-note-content break-anywhere tracking-[-0.006em] text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&xc(o,e0,_,$),o.type==="Article"&&l.jsx(z1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!h&&l.jsx("div",{className:"space-between mt-2 ml-[-8px] flex",children:N&&l.jsx(mp,{actor:P,commentCount:i,disabled:q,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0})})]})})]}),!f&&l.jsx("div",{className:`absolute left-[19px] ${h?"top-[51px] bottom-[8px]":W?"top-[51px] bottom-[5px]":g?"top-[71px] bottom-[5px]":"top-[71px] bottom-[-7px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),l.jsx(z3,{currentIndex:p0.currentIndex,images:p0.images,isOpen:p0.isOpen,onClose:R0,onNavigate:Z0})]}):r==="inbox"?l.jsx(l.Fragment,{children:o&&l.jsxs("div",{className:"group/article @container/inbox-item relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:M0,children:[l.jsxs("div",{className:"w-full min-w-0",children:[l.jsx("div",{className:"z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent",children:O?l.jsx(F1,{className:"w-24"}):l.jsxs(l.Fragment,{children:[l.jsx(br,{actor:P,isCurrentUser:H,children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(dr,{author:P,size:"2xs"}),l.jsx("span",{className:"min-w-0 truncate font-semibold text-gray-900 hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:J0=>{rr(P,Z,J0)},children:P.name})]})}),c==="Announce"&&l.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[xq,l.jsx(br,{actor:e,align:"center",isCurrentUser:n0,children:l.jsx("span",{className:"line-clamp-1 hover:underline",onClick:J0=>{rr(e,Z,J0)},children:e.name})})," reposted"]}),l.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${x}`,children:Wp(o,!o.authored)})]})}),l.jsxs("div",{className:"flex",children:[l.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[l.jsx(Jt,{className:"break-anywhere line-clamp-2 w-full max-w-[600px] leading-tight text-pretty","data-test-activity-heading":!0,children:O?l.jsx(F1,{className:"w-full max-w-96"}):o.name?o.name:l.jsx("span",{dangerouslySetInnerHTML:{__html:Y2(_u(o.content||""))}})}),l.jsx("div",{className:"ap-note-content break-anywhere line-clamp-2 w-full max-w-[600px] text-base leading-normal text-pretty text-gray-900 dark:text-gray-300 [&_p+p]:mt-3",children:O?l.jsx(F1,{count:2}):l.jsx("div",{dangerouslySetInnerHTML:{__html:Y2(_u(o.preview?.content??o.content??""))}})}),l.jsx("span",{className:"mt-1 shrink-0 text-sm leading-none whitespace-nowrap text-gray-600",children:O?l.jsx(F1,{className:"w-16"}):o.content&&`${Nr0(o.content)}`})]}),l.jsxs("div",{className:"invisible absolute top-8 right-3 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[N&&l.jsx(mp,{actor:P,commentCount:i,layout:r,likeCount:z,object:o,repostCount:b,onLikeClick:O0}),l.jsx(l3,{allowDelete:t,authoredByMe:H,followedByMe:k,layout:"inbox",trigger:q0,onCopyLink:c0,onDelete:Y,onFollow:A0,onUnfollow:s0})]})]})]}),Sr0(o,O)]})}):l.jsx(l.Fragment,{})},Nq=5*1024*1024,_q="Image must be less than 5MB in size.",Cc0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const c=new FileReader;c.onload=()=>n(c.result),c.onerror=r,c.readAsDataURL(o)})}catch{return e}},Ec0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),Sc0="Image must be square.",GO=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...c})=>{const{data:i}=Yn0("index"),b=Jn0("index",i),z=Zn0("index",i),{data:u,isLoading:f}=IO("index","me"),[O,q]=p.useState(!1),h=p.useRef(null),W=p.useRef(null),[g,v]=p.useState(null),[w,N]=p.useState(!1),x=p.useRef(null),[R,_]=p.useState(""),[T,j]=p.useState(null),[L,J]=p.useState(""),[Q,Z]=p.useState(!1),[t0,b0]=p.useState(!1),[O0,M0]=p.useState(!1),Y=Cn(),c0=500;p.useEffect(()=>{c.open!==void 0&&q(c.open)},[c.open]),p.useEffect(()=>{if(c.open!==void 0?c.open:O){const R0=setTimeout(()=>{M0(!0)},300);return()=>clearTimeout(R0)}else M0(!1)},[O,c.open]);const $=!R.trim()||!i||t0||R.length>c0,P=p.useCallback(async()=>{const e0=R.trim();if(!(!e0||!i))try{b0(!0),t?(await z.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:T||void 0,altText:L||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:T||void 0,altText:L||void 0}),Y("/notes")),q(!1),r&&r(!1),He.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{b0(!1)}},[R,i,t,z,b,T,L,o,n,q,Y,r]),I=e0=>{_(e0.target.value)};p.useEffect(()=>{h.current&&(h.current.style.height="auto",h.current.style.height=`${h.current.scrollHeight}px`)},[R]),p.useEffect(()=>{if((c.open!==void 0?c.open:O)&&h.current){const R0=setTimeout(()=>{h.current?.focus()},100);return()=>clearTimeout(R0)}},[O,c.open]),p.useEffect(()=>{if(Q&&W.current){const e0=setTimeout(()=>{W.current?.focus()},100);return()=>clearTimeout(e0)}},[Q]),p.useEffect(()=>{const e0=Z0=>{(Z0.metaKey||Z0.ctrlKey)&&Z0.key==="Enter"&&(Z0.preventDefault(),!$&&!w&&P())};if(c.open!==void 0?c.open:O)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[O,c.open,$,w,P]);const k=p.useCallback(async e0=>{const R0=e0.clipboardData?.items;if(R0)for(let Z0=0;Z0<R0.length;Z0++){const J0=R0[Z0];if(J0.type.indexOf("image")!==-1){e0.preventDefault();const u1=J0.getAsFile();if(u1){if(u1.size>Nq){He.error(_q);return}const B=URL.createObjectURL(u1);v(B),await H(u1)}break}}},[]);p.useEffect(()=>{if(c.open!==void 0?c.open:O)return document.addEventListener("paste",k),()=>document.removeEventListener("paste",k)},[O,c.open,k]);const H=async e0=>{try{N(!0);const R0=await tr0(e0);j(R0)}catch(R0){v(null);let Z0="Failed to upload image. Try again.";if(R0&&typeof R0=="object"&&"statusCode"in R0)switch(R0.statusCode){case 413:Z0="Image size exceeds limit.";break;case 415:Z0="The file type is not supported.";break}He.error(Z0)}finally{N(!1)}},n0=async e0=>{const R0=e0.target.files;if(R0&&R0.length>0){const Z0=R0[0];if(Z0.size>Nq){He.error(_q),e0.target.value="";return}const J0=URL.createObjectURL(Z0);v(J0),await H(Z0)}},A0=e0=>{e0.stopPropagation(),v(null),j(null),J(""),Z(!1),g&&URL.revokeObjectURL(g),x.current&&(x.current.value="")},s0=e0=>{e0.stopPropagation(),Z(!Q)},q0=()=>{h.current?.focus()};p.useEffect(()=>()=>{g&&URL.revokeObjectURL(g)},[g]);let p0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(p0=`Reply to ${ur(e0)}...`)}return l.jsxs(Ss,{open:c.open!==void 0?c.open:O,onOpenChange:e0=>{e0&&(_(""),v(null),j(null),J(""),Z(!1),g&&URL.revokeObjectURL(g),x.current&&(x.current.value="")),q(e0),r&&r(e0)},...c.open!==void 0?{}:c,children:[l.jsx(Rv,{asChild:!0,children:e}),l.jsxs(ka,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[l.jsxs(gM,{className:"hidden",children:[l.jsx(yM,{children:t?"Reply":"New note"}),l.jsx(wv,{children:"Post your thoughts to the Social web"})]}),t&&l.jsx(Br0,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type==="Article"?"Article":"Note",onClick:()=>{}}),l.jsxs("div",{className:`flex ${g?"":"min-h-36"} cursor-text items-start gap-3`,onClick:q0,children:[l.jsx("div",{className:"sticky top-0",children:l.jsx(dr,{author:i})}),l.jsx(kT,{asChild:!0,children:l.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[f?l.jsx(F1,{className:"w-10"}):l.jsx("span",{className:"break-anywhere min-w-0 truncate font-semibold whitespace-nowrap text-black dark:text-white",children:u?.name}),l.jsx(O5,{name:"content",asChild:!0,children:l.jsx(f5,{asChild:!0,children:l.jsx("textarea",{ref:h,autoFocus:!0,className:"ap-textarea break-anywhere w-full resize-none bg-transparent text-[1.5rem]","data-testid":"note-textarea",placeholder:p0,rows:1,value:R,onChange:I,onPaste:k})})}),l.jsx(O5,{name:"image",asChild:!0,children:l.jsx(f5,{asChild:!0,children:l.jsx("input",{ref:x,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:n0})})})]})})]}),g&&l.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[l.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${w&&"opacity-10"}`,src:g}),w&&l.jsx("div",{className:"absolute leading-[0]",children:l.jsx(Ob,{size:"md"})}),l.jsx(z1,{className:"absolute top-3 right-3 size-8 bg-black/60 text-white opacity-0 group-hover:opacity-100 hover:bg-black/80",onClick:A0,children:l.jsx(h7,{})}),!w&&l.jsx(z1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${Q?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:s0,children:"Alt"})]}),g&&!w&&Q&&l.jsx("div",{className:"mt-1",children:l.jsx(xM,{ref:W,className:"w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:L,onChange:e0=>J(e0.target.value)})}),l.jsxs(vM,{className:`${O0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[l.jsx(z1,{className:"mr-auto w-[34px] min-w-0!",variant:"outline",onClick:()=>x.current?.click(),children:l.jsx(cK,{})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:`text-sm ${R.length>=c0?"text-red-500":R.length>=c0*.9?"text-yellow-600":"text-gray-500"}`,children:[R.length,"/",c0]}),l.jsx(z1,{className:"min-w-16","data-testid":"post-button",disabled:$||w,onClick:P,children:t0?l.jsx(Ob,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function ku(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function Tr0(e,t){const o=ku(e);return JSON.stringify({...o,...t})}const Z9=()=>{const{data:e}=me(),{mutateAsync:t}=Zv(),o=l0.useMemo(()=>e?.accessibility?ku(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=l0.useCallback(async r=>{if(!e)return;const c=ku(e.accessibility),i=Tr0(e.accessibility,{apOnboarding:{...c.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},J9=()=>l.jsx("div",{className:"h-full pt-14",children:l.jsx(Or,{})}),Pr0=Object.freeze(Object.defineProperty({__proto__:null,default:J9,useOnboardingStatus:Z9},Symbol.toStringTag,{value:"Module"})),Xr0=()=>{const e=Cn();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return l.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[l.jsxs("div",{className:"flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-black",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qK,{className:"text-purple-500",size:20,strokeWidth:1.5}),l.jsx(Jt,{children:"Beta feedback"})]}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),l.jsx(z1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),l.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pt-4 pb-2 text-xs text-gray-400",children:[l.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://ghost.org/help/social-web/",rel:"noreferrer",target:"_blank",children:"Help"}),"⋅",l.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://activitypub.ghost.org/archive",rel:"noreferrer",target:"_blank",children:"Updates"})]})]})},Wb=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const c=l0.Children.toArray(e),i=l.jsx("div",{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:l.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[c[0],c[1],c[2]]})});return t?l.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},jr0=()=>{const e=Cn(),{suggestedProfilesQuery:t}=FO("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:c}=Jb(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:l.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[l.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(lb,{className:"text-purple-500",size:20,strokeWidth:1.5}),l.jsx(Jt,{children:"Follow suggestions"})]}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),l.jsx("ul",{className:"grow",children:r.map((b,z)=>{const u=b?.id||`loading-${z}`,f=b?.name||"",O=b?.handle||"",q=b?.avatarUrl||"";let h;switch(z){case 0:h="[@media(max-height:740px)]:hidden";break;case 1:h="[@media(max-height:800px)]:hidden";break;case 2:h="[@media(max-height:860px)]:hidden";break}return l.jsx(p.Fragment,{children:l.jsx("li",{className:h,children:l.jsx(br,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:l.jsx("div",{children:l.jsxs(Wb,{onClick:()=>{!n&&b&&rr(b,e)},children:[n?l.jsx(F1,{className:"z-10 size-10"}):l.jsx(dr,{author:{icon:{url:q},name:f,handle:O},showFollowButton:!0}),l.jsxs("div",{className:"flex min-w-0 flex-col",children:[l.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?l.jsx(F1,{className:"w-24"}):f}),l.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?l.jsx(F1,{className:"w-40"}):O})]})]})})})},u)},u)})}),l.jsx(z1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{c(),e("/explore")},children:"Find more →"})]})},Dr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},c=()=>{t(e.id,{followedByMe:!1})},i=Cn();return l.jsx(br,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:l.jsx("div",{children:l.jsxs(Wb,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[l.jsx(dr,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),l.jsxs("div",{className:"break-anywhere flex grow flex-col",children:[l.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?l.jsx(F1,{className:"w-full max-w-64"}):e.name}),l.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?l.jsx(F1,{className:"w-24"}):e.handle})]}),o?l.jsx("div",{className:"inline-flex items-center",children:l.jsx(F1,{className:"w-12"})}):l.jsx($O,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:c})]},e.id)})})},Ir0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=FO("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:l.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:l.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((c,i)=>l.jsx(l0.Fragment,{children:l.jsx(Dr0,{isLoading:r,profile:c||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},c?.id||`loading-${i}`))})})};function Fr0(e,t,o,n){var r=this,c=p.useRef(null),i=p.useRef(0),b=p.useRef(0),z=p.useRef(null),u=p.useRef([]),f=p.useRef(),O=p.useRef(),q=p.useRef(e),h=p.useRef(!0),W=p.useRef(),g=p.useRef();q.current=e;var v=typeof window<"u",w=!t&&t!==0&&v;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var N=!!(o=o||{}).leading,x=!("trailing"in o)||!!o.trailing,R=!!o.flushOnExit&&x,_="maxWait"in o,T="debounceOnServer"in o&&!!o.debounceOnServer,j=_?Math.max(+o.maxWait||0,t):null,L=p.useMemo(function(){var J=function(Y){var c0=u.current,$=f.current;return u.current=f.current=null,i.current=Y,b.current=b.current||Y,O.current=q.current.apply($,c0)},Q=function(Y,c0){w&&cancelAnimationFrame(z.current),z.current=w?requestAnimationFrame(Y):setTimeout(Y,c0)},Z=function(Y){if(!h.current)return!1;var c0=Y-c.current;return!c.current||c0>=t||c0<0||_&&Y-i.current>=j},t0=function(Y){return z.current=null,x&&u.current?J(Y):(u.current=f.current=null,O.current)},b0=function Y(){var c0=Date.now();if(N&&b.current===i.current&&O0(),Z(c0))return t0(c0);if(h.current){var $=t-(c0-c.current),P=_?Math.min($,j-(c0-i.current)):$;Q(Y,P)}},O0=function(){n&&n({})},M0=function(){if(v||T){var Y,c0=Date.now(),$=Z(c0);if(u.current=[].slice.call(arguments),f.current=r,c.current=c0,R&&!W.current&&(W.current=function(){var P;((P=globalThis.document)==null?void 0:P.visibilityState)==="hidden"&&g.current.flush()},(Y=globalThis.document)==null||Y.addEventListener==null||Y.addEventListener("visibilitychange",W.current)),$){if(!z.current&&h.current)return i.current=c.current,Q(b0,t),N?J(c.current):O.current;if(_)return Q(b0,t),J(c.current)}return z.current||Q(b0,t),O.current}};return M0.cancel=function(){var Y=z.current;Y&&(w?cancelAnimationFrame(z.current):clearTimeout(z.current)),i.current=0,u.current=c.current=f.current=z.current=null,Y&&n&&n({})},M0.isPending=function(){return!!z.current},M0.flush=function(){return z.current?t0(Date.now()):O.current},M0},[N,_,t,j,x,R,w,v,T,n]);return g.current=L,p.useEffect(function(){return h.current=!0,function(){var J;R&&g.current.flush(),W.current&&((J=globalThis.document)==null||J.removeEventListener==null||J.removeEventListener("visibilitychange",W.current),W.current=null),h.current=!1}},[R]),L}function Ur0(e,t){return e===t}function Hr0(e,t,o){var n=Ur0,r=p.useRef(e),c=p.useState({})[1],i=Fr0(p.useCallback(function(z){r.current=z,c({})},[c]),t,o,c),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const gp=80,$r0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),c=p.useRef(0),i=Cn(),[b]=Hr0(t,300),z=t.length>=2,{searchQuery:u,updateAccountSearchResult:f}=Kn0("index",z?b:""),{data:O,isFetching:q,isFetched:h}=u,{suggestedProfilesQuery:W}=FO("index",5),{data:g,isLoading:v}=W,w=v||g&&g.length>0,{topicsQuery:N}=UO(),{data:x}=N,R=IO("index","me"),{data:_}=R,[T,j]=p.useState([]),[L,J]=p.useState(null),[Q,Z]=p.useState(0),t0=p.useMemo(()=>{const P=x?.topics||[];if(!z||P.length===0)return[];const I=t.toLowerCase();return P.filter(k=>k.slug==="following"?!1:k.name.toLowerCase().startsWith(I)||k.slug.toLowerCase().startsWith(I))},[t,z,x?.topics]),b0=p.useMemo(()=>[...t0.map(P=>({type:"topic",data:P})),...T.map(P=>({type:"account",data:P}))],[t0,T]);p.useEffect(()=>{if(!z){j([]),J(null);return}h&&(O?.accounts&&O.accounts.length>0?(j(O.accounts),J("results"),Z(0)):(j([]),J("none"),Z(0)))},[O?.accounts,h,z]);const O0=q&&z,M0=t.length<2||!L&&z&&t0.length===0,Y=!M0&&L==="none"&&t0.length===0,c0=!M0&&(T.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const P=r.current[Q];if(!P)return;const I=P.closest("[data-radix-scroll-area-viewport]")||P.closest(".overflow-y-auto");if(!I){P.scrollIntoView({block:"nearest"});return}const k=I.getBoundingClientRect(),H=P.getBoundingClientRect();H.top<k.top+gp?I.scrollTo({top:I.scrollTop-(k.top+gp-H.top),behavior:"smooth"}):H.bottom>k.bottom-gp&&I.scrollTo({top:I.scrollTop+(H.bottom-k.bottom+gp),behavior:"smooth"})},[Q]);const $=P=>{if(!(!c0||b0.length===0)){if(P.key==="ArrowDown"||P.key==="ArrowUp"){P.preventDefault();const I=Date.now();if(I-c.current<50)return;c.current=I,P.key==="ArrowDown"?Z(k=>(k+1)%b0.length):Z(k=>(k-1+b0.length)%b0.length)}else if(P.key==="Enter"){const I=b0[Q];if(!I)return;P.preventDefault(),e?.(!1),I.type==="topic"?i(`/explore/${I.data.slug}`):i(`/profile/${I.data.handle}`)}}};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pt-3 pb-2 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[l.jsx(zO,{className:"text-gray-600",size:18,strokeWidth:1.5}),l.jsx(xM,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:P=>o(P.target.value),onKeyDown:$}),O0&&l.jsx(Ob,{className:"absolute! right-0 mr-0.5 shrink-0",size:"sm"})]}),l.jsxs("div",{className:"h-full",children:[Y&&l.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:l.jsxs(M00,{children:[l.jsx(l00,{children:l.jsx(uO,{})}),"No users matching this handle or account URL"]})}),c0&&l.jsx("div",{className:"mt-[-14px] pb-2",children:b0.map((P,I)=>{const k=I===Q;if(P.type==="topic")return l.jsx("div",{ref:A0=>r.current[I]=A0,children:l.jsxs(Wb,{isSelected:k,onClick:()=>{e?.(!1),i(`/explore/${P.data.slug}`)},children:[l.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:l.jsx(lb,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"font-semibold text-black dark:text-white",children:P.data.name}),l.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},P.data.slug);const H=P.data,n0=H.handle===_?.handle;return l.jsx(br,{actor:H,align:"center",isCurrentUser:n0,side:"left",children:l.jsx("div",{ref:A0=>r.current[I]=A0,children:l.jsxs(Wb,{isSelected:k,onClick:()=>{e?.(!1),i(`/profile/${H.handle}`)},children:[l.jsx(dr,{author:{icon:{url:H.avatarUrl},name:H.name,handle:H.handle}}),l.jsxs("div",{className:"break-anywhere flex flex-col",children:[l.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:H.name}),l.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:H.handle})]}),H.blockedByMe||H.domainBlockedByMe?l.jsx(z1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):n0?null:l.jsx($O,{className:"ml-auto",following:H.followedByMe,handle:H.handle,type:"secondary",onFollow:()=>f(H.id,{followedByMe:!0}),onUnfollow:()=>f(H.id,{followedByMe:!1})})]})})},H.id)})}),M0&&w&&l.jsxs(l.Fragment,{children:[l.jsx(Jt,{children:"More people to follow"}),l.jsx(Ir0,{onOpenChange:e})]})]})]})},Vr0=()=>l.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[l.jsx(zO,{size:18,strokeWidth:1.5})," Search the social web"]}),$r=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const c=We(),{resetStack:i}=Jb(),b=DM(),z=e&&e.startsWith("/")?`${b}${e}`:e,u=z&&(c.pathname===z||c.pathname.startsWith(`${z}/`)),f=L0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),O=o&&o>0?l.jsx("span",{className:L0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:MM(o)}):null;return z?l.jsx(z1,{className:f,variant:"ghost",asChild:!0,children:l.jsxs(gs,{to:z,onClick:()=>{i(),ZZ(z)},children:[t,O]})}):l.jsxs(z1,{ref:r,className:f,variant:"ghost",onClick:n.onClick,...n,children:[t,O]})});$r.displayName="SidebarMenuLink";const ey=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=Tn0(),[n,r]=p.useState(!1),[c,i]=p.useState(""),{data:b}=me(),z=We(),u=DM(),{data:f}=$9(b?.slug||""),O=or0(b?.slug||""),{topicsQuery:q}=UO(),{data:h,isLoading:W}=q,g=!W&&h&&h.topics.length===0;p.useEffect(()=>{z.pathname===`${u}/notifications`&&f&&f>0&&O.mutate()},[z.pathname,u,f,O]);const v=p.useCallback(()=>{f&&f>0&&O.mutate()},[f,O]);return l.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?"max-lg:translate-x-0":"max-lg:translate-x-full"}`,children:l.jsxs("div",{className:"flex grow flex-col justify-between",children:[l.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pt-6 pl-6",children:[l.jsx("div",{className:"flex h-[52px] w-full items-center",children:l.jsxs(Ss,{open:n,onOpenChange:r,children:[l.jsx(Rv,{className:"mt-0.5 w-full",children:l.jsx(Vr0,{})}),l.jsx(ka,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:l.jsx($r0,{query:c,setQuery:i,onOpenChange:r})})]})}),l.jsxs("div",{className:"flex w-full flex-col gap-px",children:[l.jsxs($r,{to:"/reader",children:[l.jsx(yY,{size:18,strokeWidth:1.5}),"Reader"]}),l.jsxs($r,{to:"/notes",children:[l.jsx(MO,{size:18,strokeWidth:1.5}),"Notes"]}),l.jsxs($r,{count:z.pathname!==`${u}/notifications`?f:void 0,to:"/notifications",onClick:v,children:[l.jsx(gY,{size:18,strokeWidth:1.5}),"Notifications"]}),g?l.jsx(z1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:l.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[l.jsx(lb,{size:18,strokeWidth:1.5}),"Explore",l.jsx(bO,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):l.jsxs($r,{to:"/explore",children:[l.jsx(lb,{size:18,strokeWidth:1.5}),"Explore"]}),l.jsxs($r,{to:"/profile",children:[l.jsx(OM,{size:18,strokeWidth:1.5}),"Profile"]}),l.jsxs($r,{to:"/preferences",children:[l.jsx(SK,{size:18,strokeWidth:1.5}),"Preferences"]})]}),l.jsx(GO,{children:l.jsxs(z1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[l.jsx(QY,{}),"New note"]})}),l.jsx(jr0,{}),t.map(w=>o[w]?l.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[l.jsx("span",{className:"font-mono text-xs",children:w}),l.jsx("span",{className:"inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium text-green-800",children:"ON"})]},w):l.jsx(l.Fragment,{}))]}),l.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:l.jsx(Xr0,{})})]})})};ey.displayName="Sidebar";const Gr0=({children:e,...t})=>{const{isOnboarded:o}=Z9(),n=DM(),{data:r,isLoading:c}=me(),i=p.useRef(null),[b,z]=p.useState(!1),u=D9(),{topicsQuery:f}=UO(),{data:O}=f,q=O&&O.topics.length>0,{isNewNoteModalOpen:h,setIsNewNoteModalOpen:W}=K9(),g=()=>{z(!b)},v=()=>{z(!1)};return c||!r?null:o?l.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[l.jsx(JZ,{containerRef:i}),l.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[l.jsxs("div",{className:"z-0 min-w-0",children:[l.jsx(jn0,{showBorder:!(u==="reader"&&q)&&u!=="explore",onToggleMobileSidebar:g}),l.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),l.jsx(ey,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&l.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):l.jsx(J9,{})}),l.jsx(GO,{open:h,onOpenChange:W})]}):l.jsx(eo,{to:`${n}/welcome`,replace:!0})},Nc=({children:e})=>l.jsx("div",{className:"flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),_c=({children:e,className:t})=>l.jsx("div",{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||""}`,children:e}),ty=({statusCode:e,errorCode:t})=>{const o=cg(),n=L7(),r=c=>{c.preventDefault(),n("/analytics/",{crossApp:!0})};return o?l.jsx(Gr0,{children:l.jsxs(_c,{children:[l.jsx(Nc,{children:l.jsx(kK,{})}),l.jsx(Jt,{className:"-mb-4",children:"Oops, page not found!"}),l.jsx("div",{children:"We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place."})]})}):e===429?l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(W7,{})}),l.jsx(Jt,{className:"-mb-4",children:"Rate limit exceeded"}),l.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===403?t==="ROLE_MISSING"||t==="SITE_MISSING"?l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(A7,{})}),l.jsx(Jt,{className:"-mb-4",children:"Site not configured correctly"}),l.jsx("div",{children:"This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support."}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(mY,{})}),l.jsx(Jt,{className:"-mb-4",children:"Account suspended"}),l.jsx("div",{children:"Your account has been suspended due to policy violations."}),l.jsx(z1,{asChild:!0,children:l.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?l.jsxs(_c,{className:"mt-[50vh] -translate-y-1/2",children:[l.jsx(Nc,{children:l.jsx(FY,{})}),l.jsx(Jt,{className:"-mb-4",children:"New version available"}),l.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),l.jsx(z1,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):l.jsx("div",{className:"admin-x-container-error",children:l.jsxs("div",{className:"admin-x-error max-w-xl",children:[l.jsx("h1",{children:"Loading interrupted"}),l.jsx("p",{children:"They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again."}),l.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},Qr0=Object.freeze(Object.defineProperty({__proto__:null,default:ty},Symbol.toStringTag,{value:"Module"})),Yr0="activitypub",Kr0="preferences/move",oy=[{path:Yr0,element:l.jsx(Or,{}),errorElement:l.jsx(ty,{}),handle:"activitypub-basepath",children:[{index:!0,element:l.jsx(eo,{to:"reader"})},{path:"inbox",element:l.jsx(eo,{to:"../reader",replace:!0})},{path:"feed",element:l.jsx(eo,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>d1(()=>import("./index-C5_ZKpC1.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>d1(()=>import("./index-C5_ZKpC1.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>d1(()=>import("./feed-D2wk4cCS.js"),__vite__mapDeps([7,8]),import.meta.url)),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>d1(()=>import("./note-CMZjeK8e.js"),__vite__mapDeps([9,2,3,8]),import.meta.url)),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>d1(()=>import("./index-Cdbufdfy.js"),__vite__mapDeps([10,11,12,13]),import.meta.url)),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>d1(()=>import("./index-BLWOUf31.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>d1(()=>import("./index-BLWOUf31.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>d1(()=>import("./index-DxB7NHpG.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>d1(()=>import("./index-DxB7NHpG.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>d1(()=>import("./index-DxB7NHpG.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>d1(()=>import("./index-DxB7NHpG.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>d1(()=>import("./index-DxB7NHpG.js"),__vite__mapDeps([16,17,18,19,20,11,21,22,23,24]),import.meta.url)),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>d1(()=>import("./index-BRBRkRqa.js"),__vite__mapDeps([25,26,27,24,22,18,19,20,11]),import.meta.url)),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>d1(()=>import("./moderation-BFrrwfvx.js"),__vite__mapDeps([28,21]),import.meta.url)),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>d1(()=>import("./bluesky-sharing-DVC3I9Um.js"),__vite__mapDeps([29,18,19,20,11,24]),import.meta.url)),showBackButton:!0},{path:Kr0,lazy:h1(()=>d1(()=>import("./account-migration-DsSHanIB.js"),__vite__mapDeps([30,19]),import.meta.url)),pageTitle:"Account migration",showBackButton:!0},{path:"welcome",lazy:h1(()=>d1(()=>Promise.resolve().then(()=>Pr0),void 0,import.meta.url)),pageTitle:"Welcome",children:[{path:"",element:l.jsx(eo,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>d1(()=>import("./step-1-CH8jWKi7.js"),__vite__mapDeps([31,24]),import.meta.url))},{path:"2",lazy:h1(()=>d1(()=>import("./step-2-CWy7Qi0Q.js"),__vite__mapDeps([32,33,13,34]),import.meta.url))},{path:"3",lazy:h1(()=>d1(()=>import("./step-3-CNiDFH17.js"),__vite__mapDeps([35,33,13,34,36,6,8]),import.meta.url))},{path:"*",element:l.jsx(eo,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>d1(()=>Promise.resolve().then(()=>Qr0),void 0,import.meta.url))}]}];function Zr0(){return l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),l.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function os({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return XI(o||"")!==null}function I0({children:e,...t}){return l.jsx(wO,{...t,children:e})}const ny=l0.createContext(null);function ry(){const e=l0.useContext(ny);if(!e)throw new Error("NavMenuItem.Collapsible components must be used within NavMenuItem.Collapsible");return e}function Jr0({children:e,expanded:t,id:o,onExpandedChange:n}){const r={expanded:t,id:o,onExpandedChange:n};return l.jsx(ny.Provider,{value:r,children:e})}function e20({ariaLabel:e,children:t}){const{expanded:o,id:n,onExpandedChange:r}=ry();return l.jsxs(I0,{children:[l.jsx(z1,{"aria-controls":n,"aria-expanded":o,"aria-label":e,variant:"ghost",size:"icon",className:"hover:text-gray-black absolute top-0 left-3 h-[34px]! w-auto p-0 text-sidebar-accent-foreground transition-all group-hover/menu-item:opacity-100 hover:bg-transparent focus-visible:opacity-100 sidebar:opacity-0",onClick:()=>{r(!o)},children:l.jsx(dM,{size:16,className:`transition-all ${o?"rotate-[90deg]":""}`})}),t]})}function t20({children:e}){const{expanded:t,id:o}=ry();return l.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${t?"mb-5 grid-rows-[1fr]":"mb-0 grid-rows-[0fr]"}`,children:l.jsx("div",{className:"overflow-hidden",children:t?e:null})})}function o20({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:c,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,z=os({path:e,activeOnSubpath:n}),u=r!==void 0?r:z,{isMobile:f,setOpenMobile:O}=u2(),q=()=>{f&&O(!1)};return l.jsx(_M,{asChild:!0,isActive:u,...i,children:l.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:q,children:c})})}function n20({children:e,...t}){return l.jsx("span",{...t,children:e})}function r20({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=u2(),c=()=>{n&&r(!1),e?.()};return l.jsx(_M,{onClick:c,...o,children:t})}I0.Link=o20;I0.Label=n20;I0.Button=r20;I0.Collapsible=Jr0;I0.CollapsibleItem=e20;I0.CollapsibleMenu=t20;function a20({...e}){const{data:t}=me(),{data:o}=Ba(),n=Ao(o?.settings,"social_web_enabled")??!1,c=CM().data?.site.url,{data:i=0}=$9(t?.slug||"",n),b=os({path:"network",activeOnSubpath:!0}),z=os({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!z;return!t||!G00(t)?null:l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[l.jsx(I0,{children:l.jsxs(I0.Link,{to:"analytics",activeOnSubpath:!0,children:[l.jsx(m7,{}),l.jsx(I0.Label,{children:"Analytics"})]})}),n&&l.jsxs(I0,{children:[l.jsxs(I0.Link,{to:"network",isActive:b||z,children:[l.jsx(Zr0,{}),l.jsx(I0.Label,{children:"Network"})]}),u&&l.jsx(xO,{children:i})]}),l.jsxs(I0,{className:"group/viewsite relative",children:[l.jsxs(I0.Link,{to:"site",children:[l.jsx(fY,{}),l.jsx(I0.Label,{children:"View site"})]}),l.jsx("a",{href:c,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute top-0 right-0 flex size-8 items-center justify-center rounded-full text-gray-700 opacity-0 transition-all group-hover/viewsite:opacity-100 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",children:l.jsx(bO,{size:16})})]})]})})})}const Us="MembersResponseType",c20=Yo({dataType:Us,path:"/members/"}),Bc0=Xe({method:"POST",path:()=>"/members/",body:e=>({members:[e]}),invalidateQueries:{dataType:Us}}),Tc0=Xe({method:"POST",path:({id:e})=>`/members/${e}/commenting/disable`,body:({reason:e,hideComments:t})=>({reason:e,hide_comments:t}),invalidateQueries:{dataType:"CommentsResponseType"}}),Pc0=Xe({method:"POST",path:({id:e})=>`/members/${e}/commenting/enable`,body:()=>({}),invalidateQueries:{dataType:"CommentsResponseType"}}),Xc0=LW({dataType:Us,path:"/members/",defaultSearchParams:{include:"labels,tiers",limit:"100",order:"created_at desc"},defaultNextPageParams:(e,t)=>{if(e.meta?.pagination.next)return{...t,page:e.meta.pagination.next.toString()}},returnData:e=>{const{pages:t}=e,o=t.flatMap(r=>r.members),n=t[t.length-1].meta;return{members:o,meta:n,isEnd:n?n.pagination.pages===n.pagination.page:!0}}});function ay({filter:e,search:t,all:o}){if(!o&&!e&&!t)throw new Error("Bulk operation requires a filter, search, or all flag");const n={};return o&&(n.all="true"),e&&(n.filter=e),t&&(n.search=t),n}const jc0=Xe({method:"PUT",path:()=>"/members/bulk/",body:({action:e})=>({bulk:{action:e.type,meta:e.meta||{},newsletter:e.newsletter}}),searchParams:ay,invalidateQueries:{dataType:Us}}),Dc0=Xe({method:"DELETE",path:()=>"/members/",searchParams:ay,invalidateQueries:{dataType:Us}});function s20(){const{data:e}=c20({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const i20=()=>Is({select:e=>e.navigation}),p20=()=>{const{mutateAsync:e}=Fs();return re({mutationFn:async t=>{await e({navigation:t})}})},kq=e=>{const{data:t}=i20(),{mutateAsync:o}=p20();return[t?.expanded[e]??!0,async c=>o({expanded:{...t?.expanded??hu.expanded,[e]:c}})]},cy=p.createContext(void 0),Ic0=()=>{const e=p.useContext(cy);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},b20=({children:e,value:t})=>{const o=p.useContext(Yu),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return l.jsx(cy.Provider,{value:r,children:e})},M20=[{path:"",errorElement:l.jsx(pb,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([d1(()=>import("./post-analytics-context-D7PgEMo8.js").then(o=>o.p),__vite__mapDeps([37,38]),import.meta.url),d1(()=>import("./post-analytics-DW-TKu-t.js"),__vite__mapDeps([39,40,41,42,24,38,37]),import.meta.url)]);return{element:l.jsx(e,{children:l.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>d1(()=>import("./overview-CS9dmE_6.js"),__vite__mapDeps([43,44,5,45,46,47,48,49,50,51,52,37,38,41,42,24,53,54,3,15,55,56,57,58,59,60,36,61,62,63,64,65,66,67,11,68,69,70,71,72,73,8,6,1,17,27,12,34,13,74,75,23,76,77,78,21,79]),import.meta.url))},{path:"web",lazy:h1(()=>d1(()=>import("./web-B_MLxGxZ.js"),__vite__mapDeps([80,37,38,81,70,69,78,46,47,48,49,58,63,21,60,36,45,61,62,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,15,75,3,23,79,82,52,41,42,53,54,83,5]),import.meta.url))},{path:"growth",lazy:h1(()=>d1(()=>import("./growth-CPNrBpHK.js").then(e=>e.g),__vite__mapDeps([44,5,45,46,47,48,49,50,51,52,37,38,41,42,24,53,54,3,15,55,56,57]),import.meta.url))},{path:"newsletter",lazy:h1(()=>d1(()=>import("./newsletter-n7kc6cxR.js"),__vite__mapDeps([84,49,85,63,21,64,65,66,67,51,52,37,38,41,42,24,53,54,3,47,15,58,76,77,55,57]),import.meta.url))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>d1(()=>import("./tags-74U6lgwY.js"),__vite__mapDeps([86,40,87,50,17,5,26,88,75]),import.meta.url))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>d1(()=>import("./comments-DMea0nul.js"),__vite__mapDeps([89,83,71,69,90,88,38,87,91,92,73,70,93,94,19,13,5,40,53]),import.meta.url))},{path:"automations",children:[{index:!0,lazy:h1(()=>d1(()=>import("./automations-CmulGWwu.js"),__vite__mapDeps([95,96,50,40,88]),import.meta.url))},{path:":id",lazy:h1(()=>d1(()=>import("./editor-CTO9FIUW.js"),__vite__mapDeps([97,47,72,67,96,93,94,19,81,70,71,17,98]),import.meta.url))}]},{path:"*",element:l.jsx(pb,{onBackToDashboard:()=>{}})}]}],l20=hb({name:vt(),route:vt(),color:vt().optional(),icon:vt().optional(),filter:Fo0(vt(),vt().nullable())});function Cq(e){return e.trim().toLowerCase()}function z20(e,t){const o=Object.keys(e),n=Object.keys(t);return o.length!==n.length?!1:o.every(r=>e[r]===t[r])}function u20(e,t){return e.route===t.route&&z20(e.filter,t.filter)}function Fc0(e,t){return e.flatMap((o,n)=>u20(o,t)?[n]:[])}function Uc0(e,t,o){const n=Cq(t.name);return e.some((r,c)=>c!==o&&r.route===t.route&&Cq(r.name)===n)}function d20(e){try{const t=JSON.parse(e);return Array.isArray(t)?{ok:!0,views:t.flatMap(n=>{const r=l20.safeParse(n);return r.success?[r.data]:[]})}:(console.error("Failed to parse shared_views setting:",new Error("shared_views is not an array")),{ok:!0,views:[]})}catch{return{ok:!1,error:new Error("shared_views JSON parse failed")}}}function O20(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function sy(e){const{data:t}=Ba();return p.useMemo(()=>{const o=Ao(t?.settings,"shared_views")??"[]",n=d20(o);return n.ok?e?n.views.filter(r=>r.route===e):n.views:(console.error("Failed to parse shared_views setting:",n.error),[])},[t,e])}function iy({views:e}){return e.length===0?null:l.jsx(l.Fragment,{children:e.map(t=>l.jsx(I0,{children:l.jsxs(I0.Link,{className:"pl-9",to:t.to,isActive:t.isActive,children:[l.jsx(I0.Label,{className:t.color?"grow":void 0,children:t.name}),t.color&&l.jsx("span",{className:"mx-0.5 size-2 shrink-0 rounded-full",style:{backgroundColor:O20(t.color)},"data-color":t.color,"aria-hidden":"true"})]})},t.key))})}function py(e="posts"){const t=C7(),o=sy(e);return p.useMemo(()=>o.map(n=>{const r=t.getRouteUrl(e,n.filter);return{key:r,name:n.name,to:r,isActive:t.isRouteActive(e,n.filter),color:n.color}}),[e,t,o])}function f20({route:e="posts"}){const t=py(e);return l.jsx(iy,{views:t})}function A20(e){return e.route==="members"&&typeof e.filter.filter=="string"&&e.filter.filter.length>0}function q20(e){return`members?${new URLSearchParams({filter:e}).toString()}`}function h20(e,t,o){return e!=="/members"?!1:new URLSearchParams(t).get("filter")===o}function by(){const e=We(),t=sy("members");return p.useMemo(()=>t.filter(A20).map(o=>({key:`${o.name}:${o.filter.filter}`,name:o.name,to:q20(o.filter.filter),isActive:h20(e.pathname,e.search,o.filter.filter)})),[e.pathname,e.search,t])}function m20(){const e=by();return l.jsx(iy,{views:e})}const gb=e=>{const{data:t}=Ns();return t?.config.labs?.[e]??!1},W20=["member","member.new","members-activity"];function g20({isActive:e,to:t}){return l.jsxs(l.Fragment,{children:[l.jsxs(I0.Link,{to:t,isActive:e,children:[l.jsx(lO,{className:"pointer-events-none opacity-0 transition-all sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0"}),l.jsx(I0.Label,{children:"Posts"})]}),l.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"absolute top-0 right-0 flex size-8 items-center justify-center rounded-full p-0 text-gray-700 transition-all hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",children:l.jsx(O7,{size:20,className:"mt-px stroke-[1.5px]!"})})]})}function Eq({collapsible:e,count:t,isActive:o,to:n}){return l.jsxs(l.Fragment,{children:[l.jsxs(I0.Link,{to:n,isActive:o,children:[l.jsx(g7,{className:e?"pointer-events-none opacity-0 transition-all sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0":""}),l.jsx(I0.Label,{children:"Members"})]}),t!=null&&l.jsx(xO,{children:MM(t)})]})}function v20({...e}){const{data:t}=me(),{data:o}=Ba(),[n,r]=kq("posts"),[c,i]=kq("members"),b=py("posts"),z=by(),u=z.length>0,f=s20(),O=C7(),q=gb("commentModeration"),h=gb("automations"),W=os({path:"members",activeOnSubpath:!0}),g=t&&V00(t),v=t&&e9(t),w=Ao(o?.settings,"comments_enabled"),N=!!v&&q&&w!=="off",x=O.isRouteActive("posts",{type:"draft"}),R=O.isRouteActive("posts",{type:"scheduled"}),_=O.isRouteActive("posts",{type:"published"}),T=x||R||_||b.some(O0=>O0.isActive),j=n,L=u&&z.some(O0=>O0.isActive),J=c,Q=W?!L||!J:O.isRouteActive(W20),Z=O.getRouteUrl("posts"),b0=O.isRouteActive("posts")||!j&&T;return l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[l.jsxs(I0.Collapsible,{expanded:j,id:"posts-submenu",onExpandedChange:r,children:[l.jsx(I0.CollapsibleItem,{ariaLabel:"Toggle post views",children:l.jsx(g20,{isActive:b0,to:Z})}),l.jsxs(I0.CollapsibleMenu,{children:[l.jsx(I0,{children:l.jsx(I0.Link,{className:"pl-9",to:"posts?type=draft",isActive:x,children:l.jsx(I0.Label,{children:"Drafts"})})}),l.jsx(I0,{children:l.jsx(I0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:R,children:l.jsx(I0.Label,{children:"Scheduled"})})}),l.jsx(I0,{children:l.jsx(I0.Link,{className:"pl-9",to:"posts?type=published",isActive:_,children:l.jsx(I0.Label,{children:"Published"})})}),l.jsx(f20,{})]})]}),l.jsx(I0,{children:l.jsxs(I0.Link,{to:O.getRouteUrl("pages"),isActive:O.isRouteActive("pages"),children:[l.jsx(JY,{}),l.jsx(I0.Label,{children:"Pages"})]})}),g&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"tags",activeOnSubpath:!0,children:[l.jsx(XK,{}),l.jsx(I0.Label,{children:"Tags"})]})}),v&&l.jsx(l.Fragment,{children:u?l.jsxs(I0.Collapsible,{expanded:J,id:"members-submenu",onExpandedChange:i,children:[l.jsx(I0.CollapsibleItem,{ariaLabel:"Toggle member views",children:l.jsx(Eq,{collapsible:!0,count:f,isActive:Q,to:"members"})}),l.jsx(I0.CollapsibleMenu,{children:l.jsx(m20,{})})]}):l.jsx(I0,{children:l.jsx(Eq,{collapsible:!1,count:f,isActive:Q,to:"members"})})}),N&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"comments",activeOnSubpath:!0,children:[l.jsx(mK,{}),l.jsx(I0.Label,{children:"Comments"})]})}),v&&h&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"automations",activeOnSubpath:!0,children:[l.jsx(eZ,{}),l.jsx(I0.Label,{children:"Automations"})]})})]})})})}const Sq=function(){let t,o;return{promise:new Promise((r,c)=>{t=r,o=c}),resolve:t,reject:o}},q3="https://do.featurebase.app/js/sdk.js";let Tc=null;function y20(){return Tc||(Tc=new Promise((e,t)=>{if(document.querySelector(`script[src="${q3}"]`)){e();return}const n=document.createElement("script");n.src=q3,n.onload=()=>e(),n.onerror=r=>{n.remove(),Tc=null;const c=new Error(`[Featurebase] Failed to load SDK from ${q3}`,{cause:r});console.error(c),t(c)},document.head.appendChild(n)})),Tc}function R20(){const{data:e}=Ns(),{data:t}=Is(),o=gb("featurebaseFeedback"),[n,r]=p.useState(!1),{organization:c,enabled:i}=e?.config.featurebase??{},b=!!(o&&i),z=t?.nightShift?"dark":"light",{data:u}=aJ({enabled:b&&n}),f=u?.featurebase?.token;p.useEffect(()=>{n&&y20().catch(W=>{console.error("[Featurebase] Failed to load SDK:",W)})},[n]);const O=p.useRef(Sq());p.useEffect(()=>{!n||!c||!f||Tc?.then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:c,theme:z,featurebaseJwt:f},W=>{W?(console.error("[Featurebase] Failed to initialize widget:",W),O.current.reject(W),O.current=Sq(),r(!1)):O.current.resolve()})})},[c,z,f,n]);const q=p.useCallback(()=>{b&&r(!0)},[b]);return{openFeedbackWidget:p.useCallback(W=>{b&&(r(!0),O.current.promise.then(()=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...W?.board&&{setBoard:W.board}}},"*")}))},[b]),preloadFeedbackWidget:q}}function L20({...e}){const{data:t}=me(),{data:o}=Ns(),n=gb("featurebaseFeedback"),{openFeedbackWidget:r,preloadFeedbackWidget:c}=R20();if(!t)return null;const b=o?.config.hostSettings?.billing?.enabled&&Sa(t),z=n&&!Ps(t)&&o?.config.featurebase?.enabled;return!b&&!z?null:l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[b&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"pro",children:[l.jsx(HY,{}),l.jsx(I0.Label,{children:"Ghost(Pro)"})]})}),z&&l.jsx(I0,{children:l.jsxs(I0.Button,{onClick:r,onMouseEnter:c,onFocus:c,children:[l.jsx(MO,{}),l.jsx(I0.Label,{children:"Feedback"})]})})]})})})}function w20({...e}){const{data:t}=me(),o=t&&$00(t);return l.jsx(Ca,{...e,children:l.jsx(Bs,{children:l.jsxs(Ea,{children:[o&&l.jsx(I0,{children:l.jsxs(I0.Link,{to:"settings",children:[l.jsx(A7,{}),l.jsx(I0.Label,{children:"Settings"})]})}),l.jsx(I0,{children:l.jsxs(I0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[l.jsx(XY,{}),l.jsx(I0.Label,{children:"Help"})]})})]})})})}function x20(){const{banner:e,bannerType:t}=PO();let o="";return t==="theme-errors"?o="pb-[110px]":t==="upgrade"?o="pb-[254px]":t==="whats-new"&&(o="pb-[180px]"),l.jsxs(Yv,{className:"justify-between px-3 pt-4",children:[l.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[l.jsx(a20,{}),l.jsx(v20,{}),l.jsx(L20,{})]}),l.jsxs("div",{className:`flex flex-col gap-2 sidebar:gap-4 ${o}`,children:[l.jsx(Cn0,{banner:e}),l.jsx(w20,{className:"pb-0"})]})]})}function N20({...e}){return l.jsxs(Hv,{...e,children:[l.jsx(J00,{className:"px-5 pt-6 pb-0"}),l.jsx(x20,{}),l.jsx(kn0,{className:"gap-0 p-3"})]})}const vp=1.5;function h3({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=os({path:e,activeOnSubpath:t});return l.jsx(z1,{asChild:!0,className:`w-full max-w-16 min-w-9 rounded-full hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:l.jsx("a",{href:e,children:o})})}function _20(){const{isMobile:e}=u2(),t=AO();return!e||!t?l.jsx(l.Fragment,{}):l.jsx("div",{className:"safe-area-inset-bottom fixed right-0 bottom-0 left-0 z-50 h-[var(--mobile-navbar-height)] border-t border-sidebar-border bg-sidebar/80 backdrop-blur-md sidebar:hidden",children:l.jsxs("div",{className:"mx-auto grid h-full w-full max-w-[300px] grid-cols-4 items-center justify-items-center px-5",children:[l.jsxs(h3,{activeOnSubpath:!0,to:"analytics",children:[l.jsx(m7,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Analytics"})]}),l.jsxs(h3,{activeOnSubpath:!0,to:"posts",children:[l.jsx(lO,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Posts"})]}),l.jsxs(h3,{activeOnSubpath:!0,to:"members",children:[l.jsx(g7,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Members"})]}),l.jsxs($v,{className:"h-9 rounded-full px-8 hover:bg-transparent",children:[l.jsx(d7,{strokeWidth:vp}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})})}function k20({children:e}){const{data:t}=me(),o=AO();return t&&Ps(t)?l.jsxs("div",{className:"relative h-full bg-background",children:[l.jsx("main",{className:"flex h-full flex-col overflow-y-auto",children:l.jsx("div",{className:"flex-1",children:e})}),l.jsx("div",{className:"fixed bottom-3.5 left-3.5 z-20 lg:bottom-8 lg:left-8",children:l.jsx(hn0,{})})]}):l.jsxs(Uv,{open:!!t&&o,children:[l.jsx(N20,{}),l.jsxs(Vv,{className:`overflow-y-auto bg-background sidebar:max-h-full ${o?"max-h-[calc(100%-var(--mobile-navbar-height))]":"max-h-full"}`,children:[l.jsx("main",{className:"flex-1",children:e}),l.jsx(_20,{})]})]})}function C20(){const{data:e}=me();return lJ(),MJ(),l.jsx(cJ,{children:e?l.jsxs(k20,{children:[l.jsx(Or,{}),l.jsx(D6,{})]}):l.jsxs(l.Fragment,{children:[l.jsx(fO,{}),l.jsx(D6,{})]})})}const E20={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 90 days",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},S20=Object.values(E20),B20=2,Hc0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",unknown:"Unknown",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},$c0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],Vc0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Ma={PUBLIC:1,FREE:2,PAID:4},Gc0=Ma.PUBLIC|Ma.FREE|Ma.PAID,Qc0=[{name:"Public visitors",value:"undefined",bit:Ma.PUBLIC},{name:"Free members",value:"free",bit:Ma.FREE},{name:"Paid members",value:"paid",bit:Ma.PAID}],My=p.createContext(void 0),Yc0=()=>{const e=p.useContext(My);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},T20=({children:e})=>{const t=Ba(),o=CM(),n=Ns(),r=n.data?.config,c=!!r?.stats,i=hD({enabled:c}),[b,z]=p.useState(S20[B20].value),[u,f]=p.useState(null),O=[n,t,o],q=O.map(x=>x.error).find(Boolean),h=c?i.error:null,W=q||h,g=O.some(x=>x.isLoading),v=c?i.isLoading:!1,w=g||v;if(W)throw W;const N={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return l.jsx(My.Provider,{value:{data:r,site:N,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:w,range:b,setRange:z,settings:t.data?.settings||[],selectedNewsletterId:u,setSelectedNewsletterId:f},children:e})},P20=[{path:"analytics",children:[{index:!0,lazy:h1(()=>d1(()=>import("./index-AkQJUr1z.js"),__vite__mapDeps([99,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,5,41,42,54,101,59,102,57,56,38]),import.meta.url))},{path:"web",lazy:h1(()=>d1(()=>import("./index-BxFFWYdP.js"),__vite__mapDeps([103,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,82,58,5,85,104,48,83,101,57,21,79]),import.meta.url))},{path:"growth",lazy:h1(()=>d1(()=>import("./index-DR74ulj2.js"),__vite__mapDeps([105,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,5,21,79,101,106,50,104,56,48,57,107,108,77,102]),import.meta.url))},{path:"newsletters",lazy:h1(()=>d1(()=>import("./index-CuGoX8Ub.js"),__vite__mapDeps([109,100,81,70,69,49,47,15,60,36,45,61,62,63,64,65,66,67,11,68,71,72,24,73,8,6,1,17,27,12,34,13,74,75,3,23,5,21,79,106,50,110,57]),import.meta.url))}]}],X20=()=>{const{data:e,isError:t,isLoading:o}=me();return e?l.jsx(eo,{replace:!0,to:`/settings/staff/${e.slug}`}):t||!o?l.jsx(eo,{replace:!0,to:"/"}):null};function j20(){const{data:e,isError:t,isLoading:o}=me();return e?e9(e)?l.jsx(Or,{}):l.jsx(eo,{replace:!0,to:"/"}):t||!o?l.jsx(eo,{replace:!0,to:"/"}):null}const Bq=[{description:"Craft a look that reflects your brand and style.",icon:xY,id:"customize-design",route:"/settings/design/edit?ref=setup",title:"Customize your design"},{description:"Get to know a writing experience you'll love.",icon:lO,id:"first-post",route:"/editor/post",title:"Explore the editor"},{description:"Add members and grow your readership.",icon:UK,id:"build-audience",route:"/members",title:"Build your audience"},{description:"Expand your reach on social media.",icon:uK,id:"share-publication",route:void 0,title:"Share your publication"}],D20=new Date("2026-04-30T00:00:00.000Z");function I20(e){return e?e>=D20:!1}function F20(){const{data:e,isLoading:t}=me(),{data:o,isLoading:n}=Is(),{mutateAsync:r}=Fs(),c=p.useRef(!1),i=p.useMemo(()=>o?.onboarding.completedSteps||[],[o?.onboarding.completedSteps]),b=p.useMemo(()=>new Set(i),[i]),z=o?.onboarding.checklistState||"pending",u=o?.onboarding.startedAt,f=I20(u),O=e?Sa(e):!1,q=O&&z==="started"&&f,h=Bq.find(R=>!b.has(R.id))?.id,W=Bq.every(R=>b.has(R.id)),g=p.useCallback(R=>r({onboarding:R}),[r]),v=p.useCallback(async R=>{b.has(R)||await g({completedSteps:[...i,R]})},[b,i,g]),w=p.useCallback(()=>g({checklistState:"dismissed"}),[g]);p.useEffect(()=>{t||n||!O||z!=="started"||f||c.current||(c.current=!0,w().catch(R=>{c.current=!1,console.error(R)}))},[z,w,f,O,n,t]);const N=p.useCallback(()=>g({completedSteps:[],checklistState:"started",startedAt:new Date}),[g]),x=p.useCallback(()=>g({checklistState:"completed"}),[g]);return{allStepsCompleted:W,checklistState:z,completeChecklist:x,completedSteps:i,dismissChecklist:w,hasActiveStartedAt:f,isOwner:O,shouldShowChecklist:q,isLoading:t||n,markStepCompleted:v,nextStep:h,startChecklist:N}}function U20({children:e}){const t=We(),o=F20();if(o.isLoading)return null;if(o.shouldShowChecklist){const n=`${t.pathname}${t.search}`;return l.jsx(eo,{replace:!0,to:`/setup/onboarding?returnTo=${encodeURIComponent(n)}`})}return e}function H20(){return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-2xl font-bold",children:"404"}),l.jsx("span",{className:"text-grey-500","aria-hidden":"true",children:"|"}),l.jsx("h2",{className:"text-lg text-grey-700",children:"Page not found"})]})})}const $20=["/","/dashboard","/site","/launch","/setup/*","/signin/*","/signout","/signup/*","/reset/*","/pro/*","/posts","/posts/analytics/:postId/mentions","/posts/analytics/:postId/debug","/restore","/pages","/editor/*","/tags/new","/explore/*","/migrate/*","/members/new","/members/:member_id","/members-activity","/designsandbox","/mentions"],QO={allowInForceUpgrade:!0},V20=$20.map(e=>({path:e,Component:fO,handle:QO})),G20={path:"/members",element:l.jsx(j20,{}),handle:QO,children:[{index:!0,lazy:h1(()=>d1(()=>import("./members-DkpEnvG5.js"),__vite__mapDeps([111,40,83,71,69,17,90,88,38,87,91,92,112,66,62,81,70,50,55,110,75,5,47,53,108,63]),import.meta.url))},{path:"import",lazy:h1(()=>d1(()=>import("./members-DkpEnvG5.js"),__vite__mapDeps([111,40,83,71,69,17,90,88,38,87,91,92,112,66,62,81,70,50,55,110,75,5,47,53,108,63]),import.meta.url))}]},Q20=[{element:l.jsx(OJ,{}),children:[{path:"/tags/:tagSlug",Component:fO,handle:QO},G20,{element:l.jsx(b20,{value:{fromAnalytics:!0},children:l.jsx(Or,{})}),children:M20[0].children.filter(e=>e.path!=="*")},{element:l.jsx(U20,{children:l.jsx(T20,{children:l.jsx(Or,{})})}),children:P20},{path:"setup/onboarding",lazy:h1(()=>d1(()=>import("./onboarding-route-BaX0a-pu.js"),__vite__mapDeps([113,63,74,42,24]),import.meta.url))},{path:"network",loader:()=>GD("/activitypub")},{path:"my-profile",Component:X20,handle:{allowInForceUpgrade:!0}},{path:"",element:l.jsx(En0,{children:l.jsx(Or,{})}),children:oy},{path:"settings/*",lazy:h1(()=>d1(()=>import("./settings-rRY210wx.js").then(e=>e.bl),__vite__mapDeps([114,21,110,38,92,108,112,66,107,81,70,68,26,20]),import.meta.url)),handle:{allowInForceUpgrade:!0}},...V20,{path:"*",Component:H20}]}],Y20=["http:","https:","mailto:","tel:"];function K20(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return Y20.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function Z20({children:e}){const{data:t}=Ba(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Ao(n,"paid_members_enabled")??!1,newslettersEnabled:Ao(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Ao(n,"email_track_opens")??!1,emailTrackClicks:Ao(n,"email_track_clicks")??!1,membersTrackSources:Ao(n,"members_track_sources")??!1,outboundLinkTagging:Ao(n,"outbound_link_tagging")??!1,webAnalytics:Ao(n,"web_analytics_enabled")??!1}}},[t]);return l.jsx(xN,{appSettings:o,children:e})}const J20={ghostVersion:"",externalNavigate:e=>{K20(e.route)},unsplashConfig:{Authorization:"Client-ID 8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980","Accept-Version":"v1","Content-Type":"application/json","App-Pragma":"no-cache","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};tL.createRoot(document.getElementById("root")).render(l.jsx(p.StrictMode,{children:l.jsx(wN,{...J20,children:l.jsx(eJ,{prefix:"/",routes:Q20,children:l.jsx(Z20,{children:l.jsx($Z,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:l.jsx(C20,{})})})})})}));export{Nc0 as $,dr as A,z1 as B,dM as C,Ss as D,_c as E,Br0 as F,L0 as G,Jt as H,gs as I,pc0 as J,bc0 as K,Gr0 as L,zc0 as M,uc0 as N,Mc0 as O,br as P,lc0 as Q,eQ as R,F1 as S,M00 as T,l00 as U,mY as V,Wb as W,dO as X,He as Y,wc0 as Z,xc0 as _,Jb as a,xv as a$,A8 as a0,u7 as a1,XJ as a2,fv as a3,Av as a4,hv as a5,mv as a6,qv as a7,gv as a8,Wv as a9,tL as aA,as as aB,d1 as aC,yb as aD,oa0 as aE,de as aF,Oc0 as aG,fc0 as aH,Ac0 as aI,xM as aJ,h7 as aK,Ns as aL,CM as aM,Ba as aN,hD as aO,kb as aP,qY as aQ,Mm as aR,go as aS,TP as aT,zm as aU,PP as aV,y7 as aW,Ca0 as aX,Or as aY,L7 as aZ,_a0 as a_,hM as aa,i00 as ab,wv as ac,vM as ad,iK as ae,Yo as af,Xe as ag,uD as ah,LW as ai,wW as aj,wa0 as ak,ga0 as al,N0 as am,Aa0 as an,MM as ao,za0 as ap,Q0 as aq,Nn as ar,yt as as,L1 as at,s2 as au,T1 as av,T0 as aw,BN as ax,_h as ay,ro as az,Cn as b,fa0 as b$,tQ as b0,lb as b1,Ic0 as b2,La0 as b3,xa0 as b4,Wa as b5,qd as b6,v7 as b7,d7 as b8,OO as b9,_n as bA,GO as bB,FO as bC,EY as bD,QY as bE,qc0 as bF,Yn0 as bG,In0 as bH,ty as bI,yc0 as bJ,Pa as bK,oK as bL,vc0 as bM,gY as bN,xc as bO,mp as bP,m7 as bQ,RO as bR,yO as bS,mM as bT,d00 as bU,ka0 as bV,jv as bW,A00 as bX,q00 as bY,h00 as bZ,b00 as b_,ma0 as ba,R7 as bb,e2 as bc,f8 as bd,C6 as be,da0 as bf,ua0 as bg,QZ as bh,O7 as bi,jb as bj,Ro as bk,Rr as bl,bm,AX as bn,zs as bo,Ra as bp,$o as bq,fd as br,Od as bs,Vb as bt,Hb as bu,ya as bv,za as bw,Db as bx,Ib as by,kY as bz,Nc as c,$c0 as c$,UK as c0,OM as c1,Cu as c2,Gc0 as c3,Qc0 as c4,Ma as c5,Yc0 as c6,na0 as c7,Ra0 as c8,eo as c9,FJ as cA,QG as cB,vv as cC,Oa0 as cD,We as cE,KY as cF,va0 as cG,E20 as cH,E6 as cI,HY as cJ,S20 as cK,St as cL,v1 as cM,ra0 as cN,aa0 as cO,NN as cP,ca0 as cQ,jJ as cR,z00 as cS,u00 as cT,Pv as cU,c3 as cV,yv as cW,Wc0 as cX,dc0 as cY,gc0 as cZ,vb as c_,Qa0 as ca,Ya0 as cb,c9 as cc,Rc0 as cd,GK as ce,GJ as cf,Nq as cg,_q as ch,Ec0 as ci,Sc0 as cj,hb as ck,vt as cl,tr0 as cm,_a as cn,Cc0 as co,W00 as cp,g00 as cq,v00 as cr,Iv as cs,ha0 as ct,g7 as cu,XK as cv,Bq as cw,cK as cx,F20 as cy,Ao as cz,Wp as d,cc0 as d$,Hc0 as d0,lO as d1,ya0 as d2,Vc0 as d3,Na0 as d4,zO as d5,Hr0 as d6,DY as d7,Xc0 as d8,HJ as d9,Uc0 as dA,Xa0 as dB,VR as dC,ea0 as dD,uN as dE,eZ as dF,WO as dG,vO as dH,_s as dI,ks as dJ,ss as dK,Kv as dL,c_ as dM,u5 as dN,Ua0 as dO,$z as dP,pa0 as dQ,ba0 as dR,Iu as dS,Va0 as dT,Wn0 as dU,B9 as dV,T9 as dW,gn0 as dX,oc0 as dY,nc0 as dZ,sc0 as d_,Tc0 as da,Pc0 as db,MO as dc,qK as dd,j9 as de,Nr0 as df,kc0 as dg,_c0 as dh,hc0 as di,mc0 as dj,Hr as dk,c20 as dl,WM as dm,W7 as dn,Qb as dp,jc0 as dq,Dc0 as dr,la0 as ds,me as dt,Bc0 as du,d20 as dv,l20 as dw,Fo0 as dx,Ka0 as dy,Fc0 as dz,Ob as e,Ps as e$,aD as e0,La as e1,tc0 as e2,rc0 as e3,ac0 as e4,cs as e5,Za0 as e6,Fa0 as e7,Ja0 as e8,ec0 as e9,sa0 as eA,kT as eB,O5 as eC,f5 as eD,Fu as eE,AP as eF,gm as eG,FP as eH,TX as eI,PX as eJ,XX as eK,$m as eL,Jm as eM,eW as eN,tW as eO,r_ as eP,Vj as eQ,ia0 as eR,Gj as eS,WW as eT,Yb as eU,Uc as eV,mD as eW,Ma0 as eX,Ow as eY,Wa0 as eZ,Ha0 as e_,vo as ea,sJ as eb,iJ as ec,pJ as ed,lT as ee,Ga0 as ef,Y00 as eg,$a0 as eh,Ia0 as ei,Da0 as ej,fe as ek,G00 as el,Ba0 as em,J3 as en,Sa as eo,Ea0 as ep,Zv as eq,Sa0 as er,Ta0 as es,$00 as et,Jv as eu,Pa0 as ev,kM as ew,Wh as ex,Nh as ey,Xh as ez,Z9 as f,ja0 as f0,f7 as f1,bK as f2,fY as f3,LY as f4,yY as f5,xY as f6,TY as f7,XY as f8,FY as f9,JY as fa,rK as fb,lK as fc,uK as fd,OK as fe,mK as ff,gK as fg,yK as fh,wK as fi,kK as fj,A7 as fk,SK as fl,q7 as fm,uO as fn,$K as fo,dY as fp,ur as g,rr as h,ic0 as i,l as j,Lc0 as k,IO as l,$O as m,_u as n,Ip as o,UO as p,Rv as q,p as r,Y2 as s,l0 as t,FI as u,ka as v,gM as w,yM as x,bO as y,DM as z};