decocms 4.592.0 → 4.592.1

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 (431) hide show
  1. package/dist/client/assets/{AlertCircle-BGWLSshM.js → AlertCircle-BwkppllA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DvvVRWZu.js → AreaChart-Bqp7TlUc.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DReeZpcU.js → ArrowLeft-DCCL1rt6.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-B7_56WME.js → ArrowRight-BqeXFq9l.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CfEiMLOY.js → ArrowUp-BYIR9bD7.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-D-Wd8Qq1.js → BookOpen01-CzEiBc3s.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-BiBbBS-W.js → CartesianChart-B0KWWZWU.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CHRHnUui.js → CategoricalChart-BROFl5qI.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-BbXMAEK-.js → CheckCircle-QBxzzhxK.js} +1 -1
  10. package/dist/client/assets/{ChevronDown--wvnefas.js → ChevronDown-CrnnSDct.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BADS8fJy.js → ChevronSelectorVertical-H_ow2sst.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DV6a5Bif.js → ChevronUp-B9LG8rHq.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DyDBEJY1.js → CreditCard01-DaKNNhgS.js} +1 -1
  14. package/dist/client/assets/{Eye-DaoChYM8.js → Eye-CZBvYwD9.js} +1 -1
  15. package/dist/client/assets/{File02-BVf9L744.js → File02-Bl7zscmz.js} +1 -1
  16. package/dist/client/assets/{Fingerprint04-Dl0wETkL.js → Fingerprint04-D0mp-wxT.js} +1 -1
  17. package/dist/client/assets/{Globe04-DCOvKEI-.js → Globe04-zZ_Wo2qr.js} +1 -1
  18. package/dist/client/assets/{Image01-g0Qpwsg-.js → Image01-CXgWX1gU.js} +1 -1
  19. package/dist/client/assets/{Key01-CeUrJaXm.js → Key01-XFXwjSrw.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-DU_hmlS5.js → LayoutLeft-CF1BwDgf.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-hmHUMbkN.js → LinkBroken01-BvskzXGY.js} +1 -1
  22. package/dist/client/assets/{MessageCircle01-D_41NVFl.js → MessageCircle01-CLnacrAG.js} +1 -1
  23. package/dist/client/assets/{Minus-DMNAPYJG.js → Minus-BYPaVl5J.js} +1 -1
  24. package/dist/client/assets/{Monitor01-BrHm7MI1.js → Monitor01-CyQEs2jU.js} +1 -1
  25. package/dist/client/assets/{Play-LbnCPWUh.js → Play-BJlRROdi.js} +1 -1
  26. package/dist/client/assets/{Plus-DLC2MUIS.js → Plus-5_DrSljh.js} +1 -1
  27. package/dist/client/assets/{ReferenceLine-BvnhZpMn.js → ReferenceLine-DSOZotrL.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CgW8m-OY.js → SearchMd-DnsuptGJ.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-Nwq4iGo3.js → ShoppingBag01-BtSrcSQh.js} +1 -1
  30. package/dist/client/assets/{Sun-XUxnU0zs.js → Sun-armY2g2l.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CCAeHZQO.js → SwitchHorizontal01-CmGrpTEn.js} +1 -1
  32. package/dist/client/assets/{Tool01-DwtWIyI8.js → Tool01-Btvxanci.js} +1 -1
  33. package/dist/client/assets/{Tooltip-DD7E-4c4.js → Tooltip-DCVdpX1E.js} +1 -1
  34. package/dist/client/assets/{Trash01-CfgJ0vnb.js → Trash01-CrhSQVx7.js} +1 -1
  35. package/dist/client/assets/{TrendUp01-BzLqIDRM.js → TrendUp01-L5-C5DWT.js} +1 -1
  36. package/dist/client/assets/{Upload01-SqJigCs8.js → Upload01-EwdxuUFt.js} +1 -1
  37. package/dist/client/assets/{UserCheck01-B5KMtRAe.js → UserCheck01-yJ-iclQD.js} +1 -1
  38. package/dist/client/assets/{UserSquare-DPxtV6bo.js → UserSquare-BgpEmNUd.js} +1 -1
  39. package/dist/client/assets/{Users01-D6KNDwlB.js → Users01-wmNju8Yl.js} +1 -1
  40. package/dist/client/assets/{XClose-_y_ZhMzi.js → XClose-KDmX3bNw.js} +1 -1
  41. package/dist/client/assets/{Zap-DFvVKMr_.js → Zap-Cm02NTI9.js} +1 -1
  42. package/dist/client/assets/{access-gate-BV7KsMxd.js → access-gate-DUkWnbL9.js} +1 -1
  43. package/dist/client/assets/{add-connection-dialog-BkbR2Smc.js → add-connection-dialog-CP7m20vG.js} +1 -1
  44. package/dist/client/assets/agent-app-C476zqxe.js +1 -0
  45. package/dist/client/assets/{agent-assets-DbQ2YOPj.js → agent-assets-T1ss7IMm.js} +1 -1
  46. package/dist/client/assets/{agent-automation-CPDYFs_V.js → agent-automation-iOzHTb5G.js} +1 -1
  47. package/dist/client/assets/{agent-automations-BuZbsy9X.js → agent-automations-ByGyxgCv.js} +1 -1
  48. package/dist/client/assets/{agent-blog-tIL_zJY-.js → agent-blog-hr56gNc0.js} +2 -2
  49. package/dist/client/assets/{agent-blog-post-DgjZ8R1B.js → agent-blog-post-DxC2FRbG.js} +2 -2
  50. package/dist/client/assets/{agent-calendar-Bs_5Q6on.js → agent-calendar-wVwvmsMs.js} +1 -1
  51. package/dist/client/assets/{agent-capabilities-BxyN0qEj.js → agent-capabilities-Bx87_2q6.js} +1 -1
  52. package/dist/client/assets/{agent-connect-sources-DuU-H9z2.js → agent-connect-sources-Bidp6mkp.js} +1 -1
  53. package/dist/client/assets/agent-deck-DgkiMDdk.js +1 -0
  54. package/dist/client/assets/{agent-e2e-DqKljclF.js → agent-e2e-DUnztQXJ.js} +1 -1
  55. package/dist/client/assets/agent-experiments-OG9mU0cG.js +1 -0
  56. package/dist/client/assets/agent-file-BCNKyIo9.js +1 -0
  57. package/dist/client/assets/{agent-hosting-DQnTuLa_.js → agent-hosting-COkf0Xps.js} +1 -1
  58. package/dist/client/assets/{agent-icon-uUDeuFRJ.js → agent-icon-JwKotWCA.js} +1 -1
  59. package/dist/client/assets/agent-library-9PmbKS0u.js +1 -0
  60. package/dist/client/assets/agent-library-file-CyqTcQ9K.js +1 -0
  61. package/dist/client/assets/agent-overview-CYuDWTnI.js +1 -0
  62. package/dist/client/assets/{agent-releases-3rb6mE5O.js → agent-releases-DezKC__w.js} +1 -1
  63. package/dist/client/assets/agent-settings-ByfXBNBt.js +1 -0
  64. package/dist/client/assets/{agent-site-editor-BP1UclqH.js → agent-site-editor-DZwFS9UM.js} +1 -1
  65. package/dist/client/assets/agent-site-editor-code-DUdVemTF.js +2 -0
  66. package/dist/client/assets/agent-site-editor-content-7ioJRVW9.js +1 -0
  67. package/dist/client/assets/agent-site-editor-preview-BePCK2cf.js +1 -0
  68. package/dist/client/assets/agent-view-WvONE3hx.js +1 -0
  69. package/dist/client/assets/{agent-view-guard-BjTSp1DE.js → agent-view-guard-CdcXTQgu.js} +1 -1
  70. package/dist/client/assets/{ai-providers-Ds4RGzQn.js → ai-providers-dGj2AA_J.js} +1 -1
  71. package/dist/client/assets/{alert-Ck2ZtlXq.js → alert-Bg_W81J9.js} +1 -1
  72. package/dist/client/assets/{analytics-sections-MswMODeG.js → analytics-sections-uMEj8-Hb.js} +1 -1
  73. package/dist/client/assets/api-keys-ChKWGsxY.js +1 -0
  74. package/dist/client/assets/{api-keys-BmVlV9Mh.js → api-keys-DGU4qsbo.js} +1 -1
  75. package/dist/client/assets/{app-editor-BD2QFJTU.js → app-editor-CTf2Codj.js} +1 -1
  76. package/dist/client/assets/{asset-utils-Tu0oAk_e.js → asset-utils-QJRtG4Ap.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-CTYtIuZl.js → auth-catchall-JoxUbX-9.js} +1 -1
  78. package/dist/client/assets/{auth-entry-BTi0-9yd.js → auth-entry-BUAsjeB9.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-AgcK2Tjx.js → auth-split-layout-Br7d39De.js} +1 -1
  80. package/dist/client/assets/{auth-CO8gX7IE.js → auth-uzA6NxRV.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-u9bAGIHO.js → authenticate-and-persist-oauth-DrMSwytZ.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-BSlUX76i.js → automation-list-row-BJDRsDXZ.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DF3ytM3I.js → automation-runs-DgVpzY5m.js} +1 -1
  84. package/dist/client/assets/{automations-DYglstd4.js → automations-B3Ego_ZW.js} +1 -1
  85. package/dist/client/assets/{badge-DMitqkrF.js → badge-CLRefmEY.js} +1 -1
  86. package/dist/client/assets/{block-document-DJnb7z6x.js → block-document-hjmJJi3l.js} +1 -1
  87. package/dist/client/assets/{blocks-preview-workspace-context-CerGJVlc.js → blocks-preview-workspace-context-DJOofIr5.js} +1 -1
  88. package/dist/client/assets/{blocks-tab-states-hhmWy_1Z.js → blocks-tab-states-C4eMNdLC.js} +1 -1
  89. package/dist/client/assets/{blog-preview-url-BIG84MpD.js → blog-preview-url-BUR2_eXn.js} +1 -1
  90. package/dist/client/assets/{blog-schema-CRJFV-9p.js → blog-schema-YpY3AVs4.js} +1 -1
  91. package/dist/client/assets/blog-source-gate-CoJgsCam.js +1 -0
  92. package/dist/client/assets/{blog-view-gate-DkGyKjur.js → blog-view-gate-BuErg0s0.js} +1 -1
  93. package/dist/client/assets/{buckets-CysJC29Y.js → buckets-imNapc0_.js} +1 -1
  94. package/dist/client/assets/{build-improve-prompt-doc-VqJWZSWI.js → build-improve-prompt-doc-B4dJn1up.js} +1 -1
  95. package/dist/client/assets/{calendar-CDheIOSX.js → calendar-f3gREBVB.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-D1AgP89e.js → capability-load-error-iBRjmX5q.js} +1 -1
  97. package/dist/client/assets/{category-editor-BH_MZ4-M.js → category-editor-DEiTQ4lA.js} +1 -1
  98. package/dist/client/assets/{category-tree-DbNcgQGR.js → category-tree-xeQiGiia.js} +1 -1
  99. package/dist/client/assets/{chart-CST09ZCZ.js → chart-UT9f3sXv.js} +1 -1
  100. package/dist/client/assets/{chat-context-BIT6FUh3.js → chat-context-D1UPj8PY.js} +1 -1
  101. package/dist/client/assets/{chat-draft-BfVWq0UA.js → chat-draft-Zo_haAh9.js} +1 -1
  102. package/dist/client/assets/{checkbox-C4K_x5Ar.js → checkbox-DcCmvMho.js} +1 -1
  103. package/dist/client/assets/{choose-editor-CjE008p6.js → choose-editor-DdBb2fRj.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-CzQFYrcF.js → cli-auth-success-D68lx63J.js} +1 -1
  105. package/dist/client/assets/{cms-settings-editor-RK9GJiMD.js → cms-settings-editor-C15u73Y2.js} +1 -1
  106. package/dist/client/assets/{cms-store-drafts-0xwIV9ox.js → cms-store-drafts-C-hyfgpJ.js} +1 -1
  107. package/dist/client/assets/{collapsible-BKEosa36.js → collapsible-u0jU6NPm.js} +1 -1
  108. package/dist/client/assets/{collection-detail-Co4beo3Q.js → collection-detail-BkTfht50.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-CgmoK2Pb.js → collection-display-button-DWQz13cg.js} +1 -1
  110. package/dist/client/assets/{collection-search-DbU2-Zro.js → collection-search-CHpPqIPY.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-trIsYNdF.js → collection-table-wrapper-DSnmQNf6.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-xSzlWPpK.js → collection-tabs-DwugvhJ1.js} +1 -1
  113. package/dist/client/assets/{combobox-DfNcTXOm.js → combobox-DaTUIVWs.js} +1 -1
  114. package/dist/client/assets/{command-yq-0pcV5.js → command-eqO7hJ8F.js} +1 -1
  115. package/dist/client/assets/{companion-mcps-section-CKU9ZCi7.js → companion-mcps-section-DsIxfRy8.js} +1 -1
  116. package/dist/client/assets/{config-Gp6kk-a9.js → config-dw4Olpza.js} +1 -1
  117. package/dist/client/assets/{connect-GDKyqRDB.js → connect-D66GbpNl.js} +1 -1
  118. package/dist/client/assets/{connect-key-DFND7gAR.js → connect-key-BVhplRmH.js} +1 -1
  119. package/dist/client/assets/{connect-layout-Cqgbp_e1.js → connect-layout-D10-cc6P.js} +1 -1
  120. package/dist/client/assets/{connect-source-dialog-Bzm0T5Kr.js → connect-source-dialog-Db36efRh.js} +1 -1
  121. package/dist/client/assets/{connection-o54QPkq8.js → connection-B7M6nU1x.js} +1 -1
  122. package/dist/client/assets/{connection-card-25b1J01G.js → connection-card-CcU9JcT0.js} +1 -1
  123. package/dist/client/assets/{connection-detail-Cu1qIJI1.js → connection-detail-Cg9g-ENG.js} +1 -1
  124. package/dist/client/assets/{connection-form-helpers-C0OEispw.js → connection-form-helpers-CxUhMJ7p.js} +1 -1
  125. package/dist/client/assets/{connection-slug-re_P7idV.js → connection-slug-Cf1O7MNR.js} +1 -1
  126. package/dist/client/assets/{connections-BKfgT0NR.js → connections-D08YBLXR.js} +1 -1
  127. package/dist/client/assets/content-tab-Bhc-PUDG.js +19 -0
  128. package/dist/client/assets/{context-DYnh0GOy.js → context-BdoPaIvJ.js} +1 -1
  129. package/dist/client/assets/{context-menu-D6ora32O.js → context-menu-DhMwIZXo.js} +1 -1
  130. package/dist/client/assets/{context-shell-C_jozAA5.js → context-shell-Czc43ADi.js} +3 -3
  131. package/dist/client/assets/{create-organization-dialog-D0dn7O2p.js → create-organization-dialog-CLZMX0-O.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-CvVFZgVf.js → daily-pulse-wcNja5Nj.js} +1 -1
  133. package/dist/client/assets/{delete-copy-CFePpsd4.js → delete-copy-DdHtycuJ.js} +1 -1
  134. package/dist/client/assets/{device-hint-r6HxMslX.js → device-hint-C3k8o5yB.js} +1 -1
  135. package/dist/client/assets/{discover-CNkZcsZY.js → discover-Bi4qgpKg.js} +1 -1
  136. package/dist/client/assets/{domain-settings-DG9JhYw8.js → domain-settings-C6VVQQXw.js} +1 -1
  137. package/dist/client/assets/{drawer-WkW5KBWk.js → drawer-CW9vnbpB.js} +1 -1
  138. package/dist/client/assets/{editor-classes-BZDGMPii.js → editor-classes-fgKMeEWS.js} +1 -1
  139. package/dist/client/assets/{editor-DAl9TrDr.js → editor-trq0ZKwr.js} +1 -1
  140. package/dist/client/assets/{empty-message-CgoIDyGS.js → empty-message-DdynAHqO.js} +1 -1
  141. package/dist/client/assets/{empty-state-cBneaE_p.js → empty-state-ClambJ61.js} +1 -1
  142. package/dist/client/assets/{empty-state-BXrxj8zc.js → empty-state-CuQAe6Uw.js} +1 -1
  143. package/dist/client/assets/{experiments-tab-choice-DEWmd27s.js → experiments-tab-choice-AG3p6svg.js} +1 -1
  144. package/dist/client/assets/{extract-connection-data-BH59EoXU.js → extract-connection-data-BVP6dlZP.js} +1 -1
  145. package/dist/client/assets/{feature-gate-Bac4UnnI.js → feature-gate-teaNQlJZ.js} +1 -1
  146. package/dist/client/assets/{feature-paywall-CQKPP9P2.js → feature-paywall-Czz_ywh1.js} +1 -1
  147. package/dist/client/assets/{file-explorer-CLIBUqSF.js → file-explorer-BEI6SPmv.js} +1 -1
  148. package/dist/client/assets/{file-preview-DP5Gt5bX.js → file-preview-OaKRZWAJ.js} +1 -1
  149. package/dist/client/assets/{file-share-button-fB2kTwCP.js → file-share-button-D3h2-Zhn.js} +1 -1
  150. package/dist/client/assets/{file-type-icon-BzlYjHIx.js → file-type-icon-DFjotUbk.js} +1 -1
  151. package/dist/client/assets/{folder-icon-BzmsomEF.js → folder-icon-CpIb_oEp.js} +1 -1
  152. package/dist/client/assets/{form-0BG9ubSE.js → form-Dndv--cv.js} +1 -1
  153. package/dist/client/assets/{frame-navigation-BwvKneZT.js → frame-navigation-CZ2vrtVQ.js} +1 -1
  154. package/dist/client/assets/{gateway-client-C6VJWnlN.js → gateway-client-03fm5JRg.js} +1 -1
  155. package/dist/client/assets/{general-DFkk0AKv.js → general-B3zfl282.js} +1 -1
  156. package/dist/client/assets/{github-icon-CXKJLjvW.js → github-icon-y_XGzms1.js} +1 -1
  157. package/dist/client/assets/{held-block-view-DeppID9A.js → held-block-view-Cn3NohXd.js} +1 -1
  158. package/dist/client/assets/{home-D11IJKuw.js → home-BDyn6OYG.js} +1 -1
  159. package/dist/client/assets/{home-overview-D1CyDMFD.js → home-overview-Bax1lxi2.js} +1 -1
  160. package/dist/client/assets/{hosted-reconcile-DkuUB6Yl.js → hosted-reconcile-DulbkBi6.js} +1 -1
  161. package/dist/client/assets/{icon-button-BA8scPiS.js → icon-button-oEP30sMT.js} +1 -1
  162. package/dist/client/assets/{index-CEQQhaHZ.js → index-1ntgBZGp.js} +1 -1
  163. package/dist/client/assets/{index-C3571NoM.js → index-BelX3qTU.js} +1 -1
  164. package/dist/client/assets/{index-RUXm8O3_.js → index-BnZXClz2.js} +1 -1
  165. package/dist/client/assets/{index-JvqLI_YO.js → index-CjCwAO3W.js} +1 -1
  166. package/dist/client/assets/{index-CuoRBXaZ.js → index-Ct2ibJG-.js} +1 -1
  167. package/dist/client/assets/{index-C79dQYFm.js → index-DE1AT2y_.js} +1 -1
  168. package/dist/client/assets/{index-B4Nq7Mtp.js → index-DYCKpMVL.js} +1 -1
  169. package/dist/client/assets/{index-hfOhqjb-.js → index-DeJgiPG8.js} +1 -1
  170. package/dist/client/assets/{index-BXMityY0.js → index-DjrvwZRK.js} +1 -1
  171. package/dist/client/assets/{index-C9enSz0-.js → index-Dk6jfsr-.js} +1 -1
  172. package/dist/client/assets/{index-DFvi77VY.js → index-DvPZxMwK.js} +1 -1
  173. package/dist/client/assets/{index-2isAF09I.js → index-DvyyCm5n.js} +1 -1
  174. package/dist/client/assets/{index-5OLplgEg.js → index-Ow5WSw-5.js} +1 -1
  175. package/dist/client/assets/{index-3ICS5XUm.js → index-a3KGRbV0.js} +1 -1
  176. package/dist/client/assets/{index-CHtbc-KN.js → index-aE825l0i.js} +1 -1
  177. package/dist/client/assets/{index-DjOrtNe_.js → index-j_yRx5Gd.js} +3 -3
  178. package/dist/client/assets/{index-Cpd8RXwD.js → index-qBmQKs_B.js} +1 -1
  179. package/dist/client/assets/{index-redirect-DeORVvBy.js → index-redirect-DLg7ZvAv.js} +1 -1
  180. package/dist/client/assets/{infiniteQueryObserver-BSbNrWKg.js → infiniteQueryObserver-BPTR7bwa.js} +1 -1
  181. package/dist/client/assets/{infra-billing-CElw9aHf.js → infra-billing-CS3QUNEw.js} +1 -1
  182. package/dist/client/assets/{input-BBvStRsc.js → input-7IHe6mCK.js} +1 -1
  183. package/dist/client/assets/{input-Cu-5ubqp.js → input-CXb8CftG.js} +3 -3
  184. package/dist/client/assets/{integration-icon-BauURQgv.js → integration-icon-Cgc3RM_Z.js} +1 -1
  185. package/dist/client/assets/{item-actions-BjmNa2Qh.js → item-actions-BHmHS5sV.js} +1 -1
  186. package/dist/client/assets/{jira-icon-C91q6LxL.js → jira-icon-W410b_QH.js} +1 -1
  187. package/dist/client/assets/{label-ScqGxGOH.js → label-Cb7nOoKu.js} +1 -1
  188. package/dist/client/assets/{layout-DB1bwPgg.js → layout-CNFPEyN9.js} +1 -1
  189. package/dist/client/assets/{legacy-admin-welcome-dialog-DQangVbA.js → legacy-admin-welcome-dialog-C6Cjwh-T.js} +1 -1
  190. package/dist/client/assets/{legacy-agents-deep-DQbbP1qW.js → legacy-agents-deep-DLDugYOa.js} +1 -1
  191. package/dist/client/assets/{legacy-main-redirect-NrxGhINR.js → legacy-main-redirect-FnzNHZ-H.js} +1 -1
  192. package/dist/client/assets/library-BXsY9YY7.js +1 -0
  193. package/dist/client/assets/{library-tab-DjXzDC5a.js → library-tab-DranLwIk.js} +1 -1
  194. package/dist/client/assets/{login-mzVdy09F.js → login-BxHl5mSO.js} +1 -1
  195. package/dist/client/assets/{markdown-DP8ElRB3.js → markdown-XCs9eqI7.js} +1 -1
  196. package/dist/client/assets/{mcp-app-renderer-qdVHwvKN.js → mcp-app-renderer-BlV9sIgT.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-CyfMgBB7.js → mcp-oauth-CxcwkHDS.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-3unQC92M.js → mcp-oauth-YcVTNxBt.js} +1 -1
  199. package/dist/client/assets/{members-fRpSqzFi.js → members-B-noNQ3U.js} +1 -1
  200. package/dist/client/assets/{memory-BUVJjYvT.js → memory-d3rT7hG5.js} +1 -1
  201. package/dist/client/assets/{mock-board-C3tk_pNz.js → mock-board-BHQbaErv.js} +3 -3
  202. package/dist/client/assets/{monaco-editor-CT6udpkQ.js → monaco-editor-B57mEFAa.js} +1 -1
  203. package/dist/client/assets/{monitoring-DArQ0SJf.js → monitoring-L-fLS0wA.js} +1 -1
  204. package/dist/client/assets/{monitoring-stats-row-PVcFt43L.js → monitoring-stats-row-Cy9dYm32.js} +1 -1
  205. package/dist/client/assets/{multi-select-BV9tp6cQ.js → multi-select-Ch7D2jL5.js} +1 -1
  206. package/dist/client/assets/{mustache-65w1NpDI.js → mustache-BtFL52JS.js} +1 -1
  207. package/dist/client/assets/{named-rule-step-DSQqNIFP.js → named-rule-step-Duj-yWYX.js} +1 -1
  208. package/dist/client/assets/{named-rule-view-KIXWMaTq.js → named-rule-view-B5R_-YHM.js} +1 -1
  209. package/dist/client/assets/{new-project-dialog-DIVryrt6.js → new-project-dialog-CEvYXixv.js} +1 -1
  210. package/dist/client/assets/{new-project-store-b6Om-vA8.js → new-project-store-CP8aeL-2.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-C5PK1Xk3.js → oauth-callback-Bw-TbNnk.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-ai-provider-BmEf26HD.js → oauth-callback-ai-provider-7mYYjG69.js} +1 -1
  213. package/dist/client/assets/{oauth-consent-B9IiDn0h.js → oauth-consent-MmqcV_yh.js} +1 -1
  214. package/dist/client/assets/{onboarding-C-O462iM.js → onboarding-9NzL6Eas.js} +1 -1
  215. package/dist/client/assets/{openai-conversation-Dk41ELjU.js → openai-conversation-B1-HnK6T.js} +1 -1
  216. package/dist/client/assets/{optimistic-project-sidebar-views-Btip0_zY.js → optimistic-project-sidebar-views-DPipCHWv.js} +1 -1
  217. package/dist/client/assets/{order-monitor-day-BkKRfmW1.js → order-monitor-day-BFa42XfL.js} +1 -1
  218. package/dist/client/assets/{organization-choice-CTceHKog.js → organization-choice-cKFx-Ysc.js} +1 -1
  219. package/dist/client/assets/{orgs-DHo6oGoq.js → orgs-ClGbtP87.js} +1 -1
  220. package/dist/client/assets/{own-accounts-section-b14XOERk.js → own-accounts-section-n0axkohG.js} +1 -1
  221. package/dist/client/assets/{pair-QqDUti2N.js → pair-D22ye8XR.js} +1 -1
  222. package/dist/client/assets/{parse-sections-BNs1uCur.js → parse-sections-Q5_Dt-lp.js} +2 -2
  223. package/dist/client/assets/{plan-gEddFM_d.js → plan-DodJXYm2.js} +1 -1
  224. package/dist/client/assets/{plan-ladder-DFcgtfL1.js → plan-ladder-DajxtWfK.js} +1 -1
  225. package/dist/client/assets/{plan-usage-card-D_MrZMBu.js → plan-usage-card-D3lgS5Uw.js} +1 -1
  226. package/dist/client/assets/{popover-2M1H2elB.js → popover-BArjIkyE.js} +1 -1
  227. package/dist/client/assets/{post-calendar-zwU4-BGO.js → post-calendar-BGAKZKHJ.js} +1 -1
  228. package/dist/client/assets/{post-editor-u4PeDoWx.js → post-editor-BZoBicO2.js} +1 -1
  229. package/dist/client/assets/{preview-content-BCoGo5yU.js → preview-content-QCUy5sdV.js} +1 -1
  230. package/dist/client/assets/{preview-dialog-B9N4q0pv.js → preview-dialog-DL37aLxL.js} +1 -1
  231. package/dist/client/assets/{preview-panel-DCmtYSeP.js → preview-panel-frLnBjeu.js} +1 -1
  232. package/dist/client/assets/{preview-tab-v4ejXmTN.js → preview-tab-DR3dhbPi.js} +3 -3
  233. package/dist/client/assets/{product-picker-dialog-CnL-wjnh.js → product-picker-dialog-DvnyMXCT.js} +1 -1
  234. package/dist/client/assets/{profile-C3dSLsOu.js → profile-C_-Dl8bQ.js} +1 -1
  235. package/dist/client/assets/{project-app-view-DfI5VhUD.js → project-app-view-BlAtN3qJ.js} +1 -1
  236. package/dist/client/assets/{project-apps-CwT_AMzE.js → project-apps-DKk8TKRM.js} +1 -1
  237. package/dist/client/assets/{project-icon-BuW7e6zO.js → project-icon-Dl1h22aG.js} +1 -1
  238. package/dist/client/assets/{project-index-CocoOoYy.js → project-index-DCowj0f3.js} +1 -1
  239. package/dist/client/assets/project-reports-D7YXddPg.js +1 -0
  240. package/dist/client/assets/project-tasks-CurJDvAu.js +1 -0
  241. package/dist/client/assets/{projects-BlP6WD-z.js → projects-BhAOfqsb.js} +1 -1
  242. package/dist/client/assets/{projects-empty-state-BwrrJUvb.js → projects-empty-state-DMI235bS.js} +1 -1
  243. package/dist/client/assets/{prompts-DXYM3q-Y.js → prompts-CfWG62oW.js} +1 -1
  244. package/dist/client/assets/record-editor-D9Skyb4t.js +1 -0
  245. package/dist/client/assets/{redirect-editor-prdkN5Kx.js → redirect-editor-D15tw0Fx.js} +1 -1
  246. package/dist/client/assets/{reports-CP8B3Qzx.js → reports-BY9QsHV3.js} +1 -1
  247. package/dist/client/assets/reports-Dhz_8tAW.js +1 -0
  248. package/dist/client/assets/{reports-onboarding-BsT3mZFE.js → reports-onboarding-DqCrqt-8.js} +1 -1
  249. package/dist/client/assets/{reports-tab-BKdz_aRz.js → reports-tab-Cgot84ZO.js} +2 -2
  250. package/dist/client/assets/{repositories-C7FADMgG.js → repositories-B4bRY8ha.js} +1 -1
  251. package/dist/client/assets/repositories-CCC3ZEIa.js +1 -0
  252. package/dist/client/assets/{repository-binding-FZFMxEXP.js → repository-binding-C9PB8Pam.js} +1 -1
  253. package/dist/client/assets/{repository-picker-Cq8vFQSh.js → repository-picker-DapPUhIH.js} +1 -1
  254. package/dist/client/assets/{require-capability-nMzWld1A.js → require-capability-BSNdaJw-.js} +1 -1
  255. package/dist/client/assets/{required-auth-layout-DIluekev.js → required-auth-layout-Cl3FuXfT.js} +1 -1
  256. package/dist/client/assets/{reset-password-DRKlIsAt.js → reset-password-D7YCYRud.js} +1 -1
  257. package/dist/client/assets/{resizable-WXwkWn4Q.js → resizable-CeAdD2Vt.js} +1 -1
  258. package/dist/client/assets/{resolve-tab-icon-BVUZYPDI.js → resolve-tab-icon-DKnDrWMJ.js} +1 -1
  259. package/dist/client/assets/{review-settings-C8D0MYk6.js → review-settings-wMilFUTO.js} +1 -1
  260. package/dist/client/assets/{role-color-CzAI1qy0.js → role-color-DADxmg9z.js} +1 -1
  261. package/dist/client/assets/{roles-BT_Gbxi7.js → roles-D3bsiTMe.js} +1 -1
  262. package/dist/client/assets/route-BPA7N7MV.js +1 -0
  263. package/dist/client/assets/{route-BxISsGAK.js → route-C_UbtV7U.js} +1 -1
  264. package/dist/client/assets/{route-DqZmDUT4.js → route-ENhUqbuj.js} +1 -1
  265. package/dist/client/assets/{route-page-header-Bfs-DXn9.js → route-page-header-DRqRE4Na.js} +1 -1
  266. package/dist/client/assets/{sandbox-git-api-BjpW3ok7.js → sandbox-git-api-CXBLgyeq.js} +1 -1
  267. package/dist/client/assets/{sandbox-lifecycle-context-YmqQd0lJ.js → sandbox-lifecycle-context-BfAaHqsY.js} +1 -1
  268. package/dist/client/assets/{save-status-DJuOqT9O.js → save-status-TyLJf7b7.js} +1 -1
  269. package/dist/client/assets/{schema-Dt9nx5T6.js → schema-C-1dDbOf.js} +1 -1
  270. package/dist/client/assets/{schema-CtN9HeLs.js → schema-_y2Ibkxz.js} +1 -1
  271. package/dist/client/assets/{scroll-area-CKTCOxf8.js → scroll-area-mP_Gdu4R.js} +1 -1
  272. package/dist/client/assets/{search-input-8oD3gxJv.js → search-input-C0zqUjwd.js} +1 -1
  273. package/dist/client/assets/{search-toggle-wEOcAKxs.js → search-toggle-DUEGgRoy.js} +1 -1
  274. package/dist/client/assets/{secret-picker-C0gUdX1X.js → secret-picker-DnQ5aAOL.js} +1 -1
  275. package/dist/client/assets/{secrets-DNRdIbhp.js → secrets-D2WBufJz.js} +1 -1
  276. package/dist/client/assets/{section-array-field-EMfjCUSg.js → section-array-field-CihuyTVg.js} +1 -1
  277. package/dist/client/assets/{sections-VMkbNyIX.js → sections-bRZSj2Ky.js} +1 -1
  278. package/dist/client/assets/{sections-editor-D8Wqyt6Q.js → sections-editor-Btf0Wxxy.js} +1 -1
  279. package/dist/client/assets/{select-BRzUD7eO.js → select-_0XQMEZ6.js} +1 -1
  280. package/dist/client/assets/{select-model-CmTK4EA1.js → select-model-B0JrDF1E.js} +1 -1
  281. package/dist/client/assets/{seo-editor-DoV7bTZg.js → seo-editor-BND3F_QG.js} +1 -1
  282. package/dist/client/assets/{separator-Du38ToZ0.js → separator-BefnH7ic.js} +1 -1
  283. package/dist/client/assets/{session-runtime-DmF4cnQg.js → session-runtime-Dc7WrpCe.js} +1 -1
  284. package/dist/client/assets/settings-tab-Dvz_gGHb.js +1 -0
  285. package/dist/client/assets/{sheet-C7pIUG3k.js → sheet-CQ-Sl7DR.js} +1 -1
  286. package/dist/client/assets/{shell-layout-B2ekmJch.js → shell-layout-BOc4h8Nx.js} +1 -1
  287. package/dist/client/assets/{site-draft-actions-Bep2SPSQ.js → site-draft-actions-KK9QL8Zd.js} +1 -1
  288. package/dist/client/assets/{site-draft-view-0GL4-gON.js → site-draft-view-DJEtaz9d.js} +1 -1
  289. package/dist/client/assets/site-editor-BaUKJrec.js +1 -0
  290. package/dist/client/assets/{site-editor-toast-1oASJn2v.js → site-editor-toast-CQzulbYg.js} +1 -1
  291. package/dist/client/assets/{skills-C18Y-RfB.js → skills-DFWtCt4t.js} +1 -1
  292. package/dist/client/assets/{slider-HvfNpAfl.js → slider-izH1Xbrf.js} +1 -1
  293. package/dist/client/assets/{sortable.esm-kgqWEV5d.js → sortable.esm-FLvesVgG.js} +1 -1
  294. package/dist/client/assets/{sso-5b1Zkqzd.js → sso-CfWeESd9.js} +1 -1
  295. package/dist/client/assets/{suggestion-DiYPzeP7.js → suggestion-BqQeH-fD.js} +1 -1
  296. package/dist/client/assets/{super-agent-icon-DUc2-efP.js → super-agent-icon-DGiTUS90.js} +1 -1
  297. package/dist/client/assets/{switch-7e305rGg.js → switch-DMQFizVx.js} +1 -1
  298. package/dist/client/assets/{synced-repos-DuYLf5gg.js → synced-repos-t6D5BVqE.js} +1 -1
  299. package/dist/client/assets/{tab-icon-glyph-PrshLevD.js → tab-icon-glyph-DfUCMX5j.js} +1 -1
  300. package/dist/client/assets/{table-Cw8oDoQy.js → table-Bm4dVJcq.js} +1 -1
  301. package/dist/client/assets/{tabs-_DQUDRNk.js → tabs-DoCsLYC4.js} +1 -1
  302. package/dist/client/assets/{task-board-CZB7FlUa.js → task-board-C_hEaCmp.js} +1 -1
  303. package/dist/client/assets/{task-key-B4W-4ygE.js → task-key-D_XTdd0F.js} +1 -1
  304. package/dist/client/assets/{task-route-OI0tZ-L7.js → task-route-BOK9gNeu.js} +1 -1
  305. package/dist/client/assets/{task-status-Pq8vxYBo.js → task-status-XtCwDul8.js} +1 -1
  306. package/dist/client/assets/{taskboard-analytics-jOzWVUNX.js → taskboard-analytics-FDUxRKSU.js} +1 -1
  307. package/dist/client/assets/tasks-CXI5r2Nc.js +1 -0
  308. package/dist/client/assets/{tasks-D94-JBfe.js → tasks-CsiFG-j5.js} +1 -1
  309. package/dist/client/assets/{textarea-CHhWzApp.js → textarea-DMh_9jVf.js} +1 -1
  310. package/dist/client/assets/{thread-analytics-C1h3IMic.js → thread-analytics-BJ0Y313P.js} +1 -1
  311. package/dist/client/assets/{thread-button-C4guwY4S.js → thread-button-BIkWPKi2.js} +1 -1
  312. package/dist/client/assets/{thread-intent-B_xHSfDq.js → thread-intent-NtyupwLZ.js} +1 -1
  313. package/dist/client/assets/{thread-route-BH8Dp5TM.js → thread-route-Cea4Rgso.js} +1 -1
  314. package/dist/client/assets/{thread-route-RiS68EpT.js → thread-route-D_O45Jgw.js} +1 -1
  315. package/dist/client/assets/{thread-sheet-body-C-MtqVTO.js → thread-sheet-body-mQO28M9m.js} +1 -1
  316. package/dist/client/assets/{time-range-picker-OJoX3VPC.js → time-range-picker-DNJl5IGA.js} +1 -1
  317. package/dist/client/assets/{toggle-group-CNJY6agL.js → toggle-group-D5t_q-4-.js} +1 -1
  318. package/dist/client/assets/{tool-set-selector-29-AheMj.js → tool-set-selector-BeeO9y_5.js} +1 -1
  319. package/dist/client/assets/{toolbar-icon-button-B3DV-HBg.js → toolbar-icon-button-D3O9O6Pc.js} +1 -1
  320. package/dist/client/assets/{tooltip-DepzWntQ.js → tooltip-FWYqBBwo.js} +1 -1
  321. package/dist/client/assets/{tooltipContext-DkjquS8A.js → tooltipContext-BjOTYmPV.js} +1 -1
  322. package/dist/client/assets/{track-dqnukbk5.js → track-DkA0w_rc.js} +1 -1
  323. package/dist/client/assets/{types-D1tcWwWJ.js → types-ByKX7b1h.js} +1 -1
  324. package/dist/client/assets/{url-slug-CbQwNTlw.js → url-slug-DNup9EYL.js} +1 -1
  325. package/dist/client/assets/{usage-stats-C7oMqzbx.js → usage-stats-DfMCfXyw.js} +1 -1
  326. package/dist/client/assets/{use-ai-providers-ahkCZB_7.js → use-ai-providers-DKNO4X5l.js} +1 -1
  327. package/dist/client/assets/{use-api-keys-Dl3tzBy1.js → use-api-keys-C5KLyWSq.js} +1 -1
  328. package/dist/client/assets/{use-apply-named-rule-XZAQSuaB.js → use-apply-named-rule-DEk9ttXw.js} +1 -1
  329. package/dist/client/assets/use-ask-in-chat-BAGJo-64.js +1 -0
  330. package/dist/client/assets/{use-automations-BGpps-1B.js → use-automations-B7IF6C0F.js} +1 -1
  331. package/dist/client/assets/{use-autosave-CZS8hRGd.js → use-autosave-DcgpSv8j.js} +1 -1
  332. package/dist/client/assets/use-blocks-v8-project-UkX2VsA0.js +1 -0
  333. package/dist/client/assets/use-blog-view-BLcyDwC6.js +1 -0
  334. package/dist/client/assets/{use-chat-layout-state-BfXhFcsd.js → use-chat-layout-state-D2oXSxI4.js} +1 -1
  335. package/dist/client/assets/{use-cms-publish-actions-D0F5sJAT.js → use-cms-publish-actions-CnkQso_R.js} +1 -1
  336. package/dist/client/assets/{use-connect-companion-D5JLUUK8.js → use-connect-companion-Bi3y9qxu.js} +1 -1
  337. package/dist/client/assets/{use-connection-ilMrBYAG.js → use-connection-DlcGRgl8.js} +1 -1
  338. package/dist/client/assets/{use-content-sync-rM2KSh4h.js → use-content-sync-BGRbbpp4.js} +1 -1
  339. package/dist/client/assets/{use-copy-Qx1ZVdh_.js → use-copy-Ch54vC-t.js} +1 -1
  340. package/dist/client/assets/{use-current-view-D15QfUUv.js → use-current-view-CVXGOq2-.js} +1 -1
  341. package/dist/client/assets/{use-date-fns-locale-UBrakgq1.js → use-date-fns-locale-BjARjrxr.js} +1 -1
  342. package/dist/client/assets/{use-debounced-autosave-DiGAjcdV.js → use-debounced-autosave-D-Vg4p72.js} +1 -1
  343. package/dist/client/assets/{use-debounced-value-CqQkh-vH.js → use-debounced-value-f7V1zqmB.js} +1 -1
  344. package/dist/client/assets/{use-deco-credits-uv4C_HiM.js → use-deco-credits-B6cSRUoE.js} +1 -1
  345. package/dist/client/assets/{use-decopilot-events-B2UzE4wx.js → use-decopilot-events-B0ZxUeCW.js} +1 -1
  346. package/dist/client/assets/{use-delete-block-CfAaElXN.js → use-delete-block-BixGITkn.js} +1 -1
  347. package/dist/client/assets/{use-delete-connection-BgBNK-ls.js → use-delete-connection-CBGf0wfJ.js} +1 -1
  348. package/dist/client/assets/{use-deployment-admin-CQOMW3UL.js → use-deployment-admin-BSVoLNjn.js} +1 -1
  349. package/dist/client/assets/{use-entitlements-BqusZvK-.js → use-entitlements-D950Bkkb.js} +1 -1
  350. package/dist/client/assets/{use-fast-preview-draft-url-BDntU4D4.js → use-fast-preview-draft-url-DEHKCkxn.js} +1 -1
  351. package/dist/client/assets/{use-file-configs-BwuIpzNO.js → use-file-configs-p-Uum-4o.js} +1 -1
  352. package/dist/client/assets/{use-id-selection-DcnUGAe9.js → use-id-selection-BAyigtAn.js} +1 -1
  353. package/dist/client/assets/{use-in-settings-s7f9f0HN.js → use-in-settings-Bk56IO-M.js} +1 -1
  354. package/dist/client/assets/{use-inbox-feed-DNrkgJKC.js → use-inbox-feed-CsGHnFXa.js} +1 -1
  355. package/dist/client/assets/{use-infinite-scroll-ByCTopJt.js → use-infinite-scroll-BWI-IeTp.js} +1 -1
  356. package/dist/client/assets/{use-join-requests-DDIsjtr5.js → use-join-requests-BE5wgJlo.js} +1 -1
  357. package/dist/client/assets/{use-main-panel-tabs-C7u5Qe7A.js → use-main-panel-tabs-CxE7dI5k.js} +1 -1
  358. package/dist/client/assets/{use-mcp-auth-status-BW5zsf67.js → use-mcp-auth-status-BkhBraJN.js} +1 -1
  359. package/dist/client/assets/{use-mcp-client-CUwxC23T.js → use-mcp-client-ChId32b3.js} +1 -1
  360. package/dist/client/assets/{use-mcp-prompts-BS7vzUgu.js → use-mcp-prompts-BNyoze-A.js} +1 -1
  361. package/dist/client/assets/{use-mcp-tools-DtrBJPMM.js → use-mcp-tools-D67gmNhG.js} +1 -1
  362. package/dist/client/assets/{use-mobile-BOP1Rcgw.js → use-mobile-K0HhtzLO.js} +1 -1
  363. package/dist/client/assets/{use-move-blocks-Bd48i-hA.js → use-move-blocks-Bywrd3b8.js} +1 -1
  364. package/dist/client/assets/{use-navigate-to-agent-C44AE-9y.js → use-navigate-to-agent-DpiPNwgn.js} +1 -1
  365. package/dist/client/assets/{use-never-published-pEGaModp.js → use-never-published-D42VAL7s.js} +1 -1
  366. package/dist/client/assets/{use-org-fs-DcXeaCd7.js → use-org-fs-DjcFvOh2.js} +1 -1
  367. package/dist/client/assets/{use-org-notice-D2iQcNXc.js → use-org-notice-D6Trmusu.js} +1 -1
  368. package/dist/client/assets/{use-org-repo-syncs-BoaMQNmt.js → use-org-repo-syncs-oEUSrGAk.js} +1 -1
  369. package/dist/client/assets/{use-org-sso-CAvkJngp.js → use-org-sso-DnaQP_2k.js} +1 -1
  370. package/dist/client/assets/{use-organization-settings-Cq7DX8I9.js → use-organization-settings-Bs3FNPGA.js} +1 -1
  371. package/dist/client/assets/{use-panel-navigate-B1StQL0s.js → use-panel-navigate-E5z2LBx3.js} +1 -1
  372. package/dist/client/assets/{use-project-native-view-presence-B5SieHiQ.js → use-project-native-view-presence-C2sc-Voo.js} +1 -1
  373. package/dist/client/assets/{use-project-scope-RhXEC_wd.js → use-project-scope-BPsfOFds.js} +1 -1
  374. package/dist/client/assets/{use-recent-apps-4PSWLEoM.js → use-recent-apps-CZeef7PE.js} +1 -1
  375. package/dist/client/assets/{use-reports-diagnostic-ASuoYHCk.js → use-reports-diagnostic-CcaMiDPA.js} +1 -1
  376. package/dist/client/assets/{use-sandbox-events-C2scQfpn.js → use-sandbox-events-DSNW5zRO.js} +1 -1
  377. package/dist/client/assets/{use-secrets-fA-0LUaJ.js → use-secrets-DSpVCNcn.js} +1 -1
  378. package/dist/client/assets/{use-section-preview-base-baWOxmdP.js → use-section-preview-base-CblLAfEH.js} +1 -1
  379. package/dist/client/assets/{use-sidebar-collapsed-Mfkk3eM_.js → use-sidebar-collapsed-OyoeFCDb.js} +1 -1
  380. package/dist/client/assets/{use-tags-kAfcVX1C.js → use-tags-BYMLGRzB.js} +1 -1
  381. package/dist/client/assets/{use-task-board-analytics-DCZICpZQ.js → use-task-board-analytics-B_eiZYIe.js} +1 -1
  382. package/dist/client/assets/{use-task-board-item-prs-B4SPp6Qy.js → use-task-board-item-prs-DRtLG5d6.js} +1 -1
  383. package/dist/client/assets/{use-task-board-items-CSce_i0G.js → use-task-board-items-Bt59ZCVF.js} +1 -1
  384. package/dist/client/assets/{use-task-board-prompts-ChMaTLtF.js → use-task-board-prompts-BSy6fFBL.js} +1 -1
  385. package/dist/client/assets/{use-task-metadata-O2sOtTyX.js → use-task-metadata-Cvpjoc3v.js} +1 -1
  386. package/dist/client/assets/{use-thread-outputs-DWxSmAps.js → use-thread-outputs-CGMBznEP.js} +1 -1
  387. package/dist/client/assets/{use-view-draft-kind-Damr_KjI.js → use-view-draft-kind-CMmZoMS7.js} +1 -1
  388. package/dist/client/assets/{use-voice-input-Cj--8EfI.js → use-voice-input-CJUe3xbJ.js} +1 -1
  389. package/dist/client/assets/useInfiniteQuery-DwCy1LUY.js +1 -0
  390. package/dist/client/assets/{useQueries-Cz0B1oDm.js → useQueries-8SZN3Lcj.js} +1 -1
  391. package/dist/client/assets/useSuspenseInfiniteQuery-BiS_nbF8.js +1 -0
  392. package/dist/client/assets/{users-BH0k65XB.js → users-CF--hX6e.js} +1 -1
  393. package/dist/client/assets/{utils-DwV2EW_l.js → utils-CnQnO2Ns.js} +1 -1
  394. package/dist/client/assets/{variant-calendar-BW1v-zbL.js → variant-calendar-Dn_uZu6Y.js} +1 -1
  395. package/dist/client/assets/{variant-matcher-override-BMWPn2mF.js → variant-matcher-override-DqTh3tJh.js} +1 -1
  396. package/dist/client/assets/{view-header-DXK8KimB.js → view-header-DIehQSbk.js} +1 -1
  397. package/dist/client/assets/{virtual-mcp-CGNO_bAd.js → virtual-mcp-C28A8jBt.js} +1 -1
  398. package/dist/client/assets/{watch-sse-pool-DkkjMzN_.js → watch-sse-pool-C_8BQRgd.js} +1 -1
  399. package/dist/client/index.html +1 -1
  400. package/dist/server/server.js +1 -1
  401. package/package.json +1 -1
  402. package/dist/client/assets/agent-app-CMS20pGS.js +0 -1
  403. package/dist/client/assets/agent-deck-DoqjVbcM.js +0 -1
  404. package/dist/client/assets/agent-experiments-Dag1l0Sz.js +0 -1
  405. package/dist/client/assets/agent-file-DQvaovMj.js +0 -1
  406. package/dist/client/assets/agent-library-BBpwgazc.js +0 -1
  407. package/dist/client/assets/agent-library-file-DrUTdYVj.js +0 -1
  408. package/dist/client/assets/agent-overview-D6unDiw2.js +0 -1
  409. package/dist/client/assets/agent-settings-5VQZ_cNH.js +0 -1
  410. package/dist/client/assets/agent-site-editor-code-B195jIQR.js +0 -2
  411. package/dist/client/assets/agent-site-editor-content-C5WSM4ik.js +0 -1
  412. package/dist/client/assets/agent-site-editor-preview-BHx5H-Tc.js +0 -1
  413. package/dist/client/assets/agent-view-CunTm2O_.js +0 -1
  414. package/dist/client/assets/api-keys-BZDYp3WI.js +0 -1
  415. package/dist/client/assets/blog-source-gate-CQU_sj5o.js +0 -1
  416. package/dist/client/assets/content-tab-DWQql9MJ.js +0 -19
  417. package/dist/client/assets/library-DlsGakRt.js +0 -1
  418. package/dist/client/assets/project-reports-CgfDsd9I.js +0 -1
  419. package/dist/client/assets/project-tasks-CraX4ieM.js +0 -1
  420. package/dist/client/assets/record-editor-C6BSWqMW.js +0 -1
  421. package/dist/client/assets/reports-DJjcOf2s.js +0 -1
  422. package/dist/client/assets/repositories-Bi3qv6k5.js +0 -1
  423. package/dist/client/assets/route-BsaeuhMg.js +0 -1
  424. package/dist/client/assets/settings-tab-YG9Crmad.js +0 -1
  425. package/dist/client/assets/site-editor-aTVCpguR.js +0 -1
  426. package/dist/client/assets/tasks-CdJvWWb_.js +0 -1
  427. package/dist/client/assets/use-ask-in-chat-3s2rpK49.js +0 -1
  428. package/dist/client/assets/use-blocks-v8-project-DERVKbRw.js +0 -1
  429. package/dist/client/assets/use-blog-view-Dk2r4WTC.js +0 -1
  430. package/dist/client/assets/useInfiniteQuery-Dn7t_7Zt.js +0 -1
  431. package/dist/client/assets/useSuspenseInfiniteQuery-cK0bTfJm.js +0 -1
@@ -1 +1 @@
1
- import{c as M,b as Z,J as X,a as V,r as z,j as r,as as re,n as R,a6 as oe,h as ie}from"./index-DjOrtNe_.js";import{ChatLayout as ne}from"./index-BXMityY0.js";import{b as se}from"./input-Cu-5ubqp.js";import{D as ae,a as me}from"./chat-context-BIT6FUh3.js";import{a as le}from"./use-organization-settings-Cq7DX8I9.js";import{C as pe,u as ce,F as fe,R as ue,M as ge}from"./home-overview-D1CyDMFD.js";import{I as de}from"./icon-button-BA8scPiS.js";import{T as he,a as W}from"./toggle-group-CNJY6agL.js";import{a as xe}from"./MessageCircle01-D_41NVFl.js";import{i as be}from"./sprints-C1z9xhcL.js";import{F as ye}from"./file-preview-DP5Gt5bX.js";import{u as q,a as je}from"./use-org-fs-DcXeaCd7.js";import{L as Se}from"./preview-dialog-B9N4q0pv.js";import{t as _e,r as we,s as De}from"./daily-pulse-CvVFZgVf.js";import{N as ke}from"./new-project-dialog-DIVryrt6.js";import{P as ve}from"./projects-empty-state-BwrrJUvb.js";import{b as Be}from"./project-index-CocoOoYy.js";import{u as Ce}from"./use-inbox-feed-DNrkgJKC.js";import{b as Ne}from"./use-recent-apps-4PSWLEoM.js";import{s as Pe}from"./use-project-scope-RhXEC_wd.js";import{u as $e}from"./repository-binding-FZFMxEXP.js";import"./use-mobile-BOP1Rcgw.js";import"./tooltip-DepzWntQ.js";import"./index-Cpd8RXwD.js";import"./XClose-_y_ZhMzi.js";import"./thread-button-C4guwY4S.js";import"./use-sidebar-collapsed-Mfkk3eM_.js";import"./sheet-C7pIUG3k.js";import"./use-chat-layout-state-BfXhFcsd.js";import"./use-panel-navigate-B1StQL0s.js";import"./thread-route-RiS68EpT.js";import"./toolbar-icon-button-B3DV-HBg.js";import"./use-in-settings-s7f9f0HN.js";import"./resizable-WXwkWn4Q.js";import"./route-page-header-Bfs-DXn9.js";import"./LayoutLeft-DU_hmlS5.js";import"./use-current-view-D15QfUUv.js";import"./usage-stats-C7oMqzbx.js";import"./utils-CVEq3hMx.js";import"./markdown-DP8ElRB3.js";import"./use-copy-Qx1ZVdh_.js";import"./agent-icon-uUDeuFRJ.js";import"./AlertCircle-BGWLSshM.js";import"./UserCheck01-B5KMtRAe.js";import"./Tool01-DwtWIyI8.js";import"./ArrowUp-CfEiMLOY.js";import"./ArrowLeft-DReeZpcU.js";import"./ArrowRight-B7_56WME.js";import"./BookOpen01-D-Wd8Qq1.js";import"./Globe04-DCOvKEI-.js";import"./CheckCircle-BbXMAEK-.js";import"./TrendUp01-BzLqIDRM.js";import"./ChevronDown--wvnefas.js";import"./ChevronSelectorVertical-BADS8fJy.js";import"./ChevronUp-DV6a5Bif.js";import"./UserSquare-DPxtV6bo.js";import"./LinkBroken01-hmHUMbkN.js";import"./CreditCard01-DyDBEJY1.js";import"./File02-BVf9L744.js";import"./SwitchHorizontal01-CCAeHZQO.js";import"./Eye-DaoChYM8.js";import"./Fingerprint04-Dl0wETkL.js";import"./Image01-g0Qpwsg-.js";import"./Key01-CeUrJaXm.js";import"./Minus-DMNAPYJG.js";import"./Monitor01-BrHm7MI1.js";import"./Sun-XUxnU0zs.js";import"./Play-LbnCPWUh.js";import"./Plus-DLC2MUIS.js";import"./SearchMd-CgW8m-OY.js";import"./ShoppingBag01-Nwq4iGo3.js";import"./Trash01-CfgJ0vnb.js";import"./Upload01-SqJigCs8.js";import"./Users01-D6KNDwlB.js";import"./Zap-DFvVKMr_.js";import"./task-board-CZB7FlUa.js";import"./schema-CtN9HeLs.js";import"./gateway-client-C6VJWnlN.js";import"./form-0BG9ubSE.js";import"./label-ScqGxGOH.js";import"./use-entitlements-BqusZvK-.js";import"./file-type-icon-BzlYjHIx.js";import"./use-view-draft-kind-Damr_KjI.js";import"./use-blog-view-Dk2r4WTC.js";import"./thread-intent-B_xHSfDq.js";import"./use-mcp-client-CUwxC23T.js";import"./auth-CO8gX7IE.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DkkjMzN_.js";import"./session-runtime-DmF4cnQg.js";import"./chat-draft-BfVWq0UA.js";import"./use-voice-input-Cj--8EfI.js";import"./popover-2M1H2elB.js";import"./drawer-WkW5KBWk.js";import"./use-ai-providers-ahkCZB_7.js";import"./index-B4Nq7Mtp.js";import"./checkbox-C4K_x5Ar.js";import"./select-BRzUD7eO.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./tabs-_DQUDRNk.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-uv4C_HiM.js";import"./input-BBvStRsc.js";import"./suggestion-DiYPzeP7.js";import"./use-mcp-prompts-BS7vzUgu.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-CQKPP9P2.js";import"./plan-ladder-DFcgtfL1.js";import"./add-connection-dialog-BkbR2Smc.js";import"./collection-search-DbU2-Zro.js";import"./extract-connection-data-BH59EoXU.js";import"./metadata-D72DunRR.js";import"./connection-o54QPkq8.js";import"./url-slug-CbQwNTlw.js";import"./connection-card-25b1J01G.js";import"./useInfiniteQuery-Dn7t_7Zt.js";import"./infiniteQueryObserver-BSbNrWKg.js";import"./connection-slug-re_P7idV.js";import"./integration-icon-BauURQgv.js";import"./textarea-CHhWzApp.js";import"./use-connection-ilMrBYAG.js";import"./schema-Dt9nx5T6.js";import"./connection-form-helpers-C0OEispw.js";import"./authenticate-and-persist-oauth-u9bAGIHO.js";import"./mcp-oauth-CyfMgBB7.js";import"./mcp-oauth-3unQC92M.js";import"./collection-tabs-xSzlWPpK.js";import"./badge-DMitqkrF.js";import"./use-infinite-scroll-ByCTopJt.js";import"./useSuspenseInfiniteQuery-cK0bTfJm.js";import"./use-task-board-items-CSce_i0G.js";import"./use-decopilot-events-B2UzE4wx.js";import"./connect-key-DFND7gAR.js";import"./use-api-keys-Dl3tzBy1.js";import"./chart-CST09ZCZ.js";import"./CategoricalChart-CHRHnUui.js";import"./index-JvqLI_YO.js";import"./tooltipContext-DkjquS8A.js";import"./CartesianChart-BiBbBS-W.js";import"./project-icon-BuW7e6zO.js";import"./project-apps-CwT_AMzE.js";import"./config-Gp6kk-a9.js";import"./task-key-B4W-4ygE.js";import"./task-route-OI0tZ-L7.js";import"./ReferenceLine-BvnhZpMn.js";import"./utils-DwV2EW_l.js";import"./editor-DAl9TrDr.js";import"./preview-content-BCoGo5yU.js";import"./file-share-button-fB2kTwCP.js";import"./use-navigate-to-agent-C44AE-9y.js";import"./repository-picker-Cq8vFQSh.js";import"./github-icon-CXKJLjvW.js";import"./use-debounced-value-CqQkh-vH.js";import"./new-project-store-b6Om-vA8.js";const O="home",Q="brief";function ee(e){return`users/${e}/brief`}function Ee(e,t){return`${e}/${t}.html`}function Fe(e){const t=String(e.getFullYear()).padStart(4,"0"),i=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${s}`}function Ie(e){if(!e.endsWith(".html"))return null;const t=e.slice(0,-5);return be(t)?t:null}const Te=7;function te(e,t){return Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5)}function Me(e,t){let i=null;for(const s of e){const a=Ie(s);if(!a||i&&a<=i.day)continue;const n=te(a,t);n>=0&&n<Te&&(i={name:s,day:a})}return i}const K=e=>e.slice(e.lastIndexOf("/")+1);function J(e,t,i,s){const a=i.filter(o=>o.kind==="file"),n=Me(a.map(o=>K(o.path)),s),l=n&&a.find(o=>K(o.path)===n.name);return n&&l?{scope:e,path:Ee(t,n.day),filename:n.name,size:l.size,day:n.day,ageDays:te(n.day,s)}:null}function Ae({userId:e,personal:t,org:i,today:s}){return[e?J("personal",ee(e),t,s):null,J("org",Q,i,s)].filter(a=>a!==null)}function Le(e,t){return t===0?e("home.dailyBrief.today"):t===1?e("home.dailyBrief.yesterday"):e("home.dailyBrief.daysAgo",{count:t})}function He(e,t){return new Date(`${t}T12:00:00Z`).toLocaleDateString(e,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"})}function Re(){const e=M.c(54),t=Z(),[i]=X(),{data:s}=V.useSession(),a=s?.user?.id,n=q(O,Q),l=a??"";let o;e[0]!==l?(o=ee(l),e[0]=l,e[1]=o):o=e[1];const D=!!a;let h;e[2]!==D?(h={enabled:D},e[2]=D,e[3]=h):h=e[3];const d=q(O,o,h),p=je(O),[k,v]=z.useState(null),[x,u]=z.useState(!1);let f,m,c,b,g,y,j,B,S,_;if(e[4]!==n.data||e[5]!==d.data||e[6]!==i||e[7]!==p||e[8]!==k||e[9]!==t||e[10]!==a){b=Symbol.for("react.early_return_sentinel");e:{const G=Ae({userId:a,personal:d.data??[],org:n.data??[],today:Fe(new Date)});if(m=G.find(T=>T.scope===k)??G[0],!m){b=null;break e}_="flex flex-col overflow-hidden surface";let A;e[21]!==t?(A=t("home.dailyBrief.title"),e[21]=t,e[22]=A):A=e[22];const U=r.jsxs("h2",{className:"flex min-w-0 items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[A,r.jsxs("span",{className:"truncate text-xs font-normal text-muted-foreground",children:[Le(t,m.ageDays)," ·"," ",He(i.language,m.day)]})]}),Y=G.length>1&&r.jsxs(he,{type:"single",variant:"segmented",size:"sm",value:m.scope,onValueChange:T=>{(T==="personal"||T==="org")&&v(T)},children:[r.jsx(W,{value:"personal",className:"px-2.5 text-xs",children:t("home.dailyBrief.personal")}),r.jsx(W,{value:"org",className:"px-2.5 text-xs",children:t("home.dailyBrief.org")})]});let E;e[23]!==t?(E=t("home.dailyBrief.fullscreen"),e[23]=t,e[24]=E):E=e[24];let L,H;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=()=>u(!0),H=r.jsx(xe,{size:14}),e[25]=L,e[26]=H):(L=e[25],H=e[26]);let F;e[27]!==E?(F=r.jsx(de,{label:E,onClick:L,children:H}),e[27]=E,e[28]=F):F=e[28];let I;e[29]!==Y||e[30]!==F?(I=r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Y,F]}),e[29]=Y,e[30]=F,e[31]=I):I=e[31],e[32]!==U||e[33]!==I?(c=r.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[U,I]}),e[32]=U,e[33]=I,e[34]=c):c=e[34],S="h-[32rem]",f=ye,g=m.path,y=m.filename,j=m.size,B=p(m.path)}e[4]=n.data,e[5]=d.data,e[6]=i,e[7]=p,e[8]=k,e[9]=t,e[10]=a,e[11]=f,e[12]=m,e[13]=c,e[14]=b,e[15]=g,e[16]=y,e[17]=j,e[18]=B,e[19]=S,e[20]=_}else f=e[11],m=e[12],c=e[13],b=e[14],g=e[15],y=e[16],j=e[17],B=e[18],S=e[19],_=e[20];if(b!==Symbol.for("react.early_return_sentinel"))return b;let w;e[35]!==g||e[36]!==y||e[37]!==j||e[38]!==B?(w={key:g,filename:y,size:j,downloadUrl:B},e[35]=g,e[36]=y,e[37]=j,e[38]=B,e[39]=w):w=e[39];let C;e[40]!==f||e[41]!==w?(C=r.jsx(f,{file:w}),e[40]=f,e[41]=w,e[42]=C):C=e[42];let N;e[43]!==C||e[44]!==S?(N=r.jsx("div",{className:S,children:C}),e[43]=C,e[44]=S,e[45]=N):N=e[45];let $;e[46]!==m||e[47]!==x?($=x&&r.jsx(Se,{previewPath:`${O}/${m.path}`,onClose:()=>u(!1),showSeeInLibrary:!0}),e[46]=m,e[47]=x,e[48]=$):$=e[48];let P;return e[49]!==c||e[50]!==N||e[51]!==$||e[52]!==_?(P=r.jsxs("section",{className:_,children:[c,N,$]}),e[49]=c,e[50]=N,e[51]=$,e[52]=_,e[53]=P):P=e[53],P}function Oe(e){return e<12?"morning":e<18?"afternoon":"evening"}function ze(e){const t=(e??"").trim().split(/\s+/)[0];return t||null}function Ge(e,t){return t.toLocaleDateString(e,{weekday:"long",day:"numeric",month:"long"})}function Ue(e){return e==="morning"?"overnight":"today"}function Ye(e,t){const i=new Date(t);return i.setHours(0,0,0,0),e==="morning"&&i.setHours(-6),i.getTime()}const Ze={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function Ve(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx("div",{className:"flex min-h-64 items-center justify-center",children:r.jsx(ie,{className:"size-5 text-muted-foreground"})}),e[0]=t):t=e[0],t}function We(e,t,i,s,a){const n=Ue(i)==="overnight",l=[];if(t>0){const o=e(t===1?"home.brief.changeOne":"home.brief.changeMany",{count:t});l.push(e(n?"home.brief.overnightShipped":"home.brief.todayShipped",{changes:o}))}else s===0&&l.push(e(a>0?"home.brief.working":n?"home.brief.quietNight":"home.brief.quietDay"));return l.push(s===0?e("home.brief.waitingNone"):e(s===1?"home.brief.waitingOne":"home.brief.waitingMany",{count:s})),l.join(" ")}function qe(e){const t=M.c(41),{canManageProjects:i,eyebrow:s,greeting:a,slot:n}=e,l=Z(),{org:o}=oe(),{data:D}=V.useSession();let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h={pageSize:1e3},t[0]=h):h=t[0];const d=$e(h),p=ce(),k=Ce(),{recent:v}=Ne(o.slug);let x,u;if(t[1]!==d||t[2]!==i||t[3]!==o.id){u=Symbol.for("react.early_return_sentinel");e:{let N;t[6]!==o.id?(N=P=>P.id!==o.id,t[6]=o.id,t[7]=N):N=t[7];const $=Pe(d).filter(N);if($.length===0){let P;t[8]!==i?(P=r.jsx(ve,{canCreate:i}),t[8]=i,t[9]=P):P=t[9],u=P;break e}x=Be($)}t[1]=d,t[2]=i,t[3]=o.id,t[4]=x,t[5]=u}else x=t[4],u=t[5];if(u!==Symbol.for("react.early_return_sentinel"))return u;const f=x;let m,c;t[10]!==D?.user?.id||t[11]!==n||t[12]!==l||t[13]!==p?(c=_e(p,D?.user?.id),m=We(l,De(p,Ye(n,new Date)),n,c.length,we(p).length),t[10]=D?.user?.id,t[11]=n,t[12]=l,t[13]=p,t[14]=m,t[15]=c):(m=t[14],c=t[15]);const b=m;let g;t[16]!==s?(g=r.jsx("span",{className:"text-xs text-muted-foreground",children:s}),t[16]=s,t[17]=g):g=t[17];let y;t[18]!==b||t[19]!==a?(y=r.jsxs("h1",{className:"max-w-[40ch] text-2xl font-medium text-balance text-foreground",children:[a," ",b]}),t[18]=b,t[19]=a,t[20]=y):y=t[20];let j;t[21]!==g||t[22]!==y?(j=r.jsxs("div",{className:"flex flex-col gap-1",children:[g,y]}),t[21]=g,t[22]=y,t[23]=j):j=t[23];let B;t[24]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(Re,{}),t[24]=B):B=t[24];let S;t[25]!==k.updates||t[26]!==f||t[27]!==o.slug||t[28]!==p||t[29]!==c?(S=r.jsx(fe,{waiting:c,tasks:p,mentions:k.updates,index:f,orgSlug:o.slug}),t[25]=k.updates,t[26]=f,t[27]=o.slug,t[28]=p,t[29]=c,t[30]=S):S=t[30];let _;t[31]!==o.slug||t[32]!==v?(_=r.jsx(ue,{recent:v,orgSlug:o.slug}),t[31]=o.slug,t[32]=v,t[33]=_):_=t[33];let w;t[34]!==p?(w=r.jsx(ge,{tasks:p}),t[34]=p,t[35]=w):w=t[35];let C;return t[36]!==_||t[37]!==w||t[38]!==j||t[39]!==S?(C=r.jsxs("div",{className:"flex flex-col gap-8",children:[j,B,S,_,w]}),t[36]=_,t[37]=w,t[38]=j,t[39]=S,t[40]=C):C=t[40],C}function Ke(){const e=M.c(25),t=Z(),[i]=X(),s=le("home_task_intake_enabled"),{data:a}=V.useSession(),{granted:n}=re("agents:manage");let l,o,D;if(e[0]!==i.language||e[1]!==a?.user?.name||e[2]!==t){const c=new Date,b=ze(a?.user?.name);o=Oe(c.getHours());const g=Ze[o];l=Ge(i.language,c),D=b?t(g.named,{name:b}):t(g.bare),e[0]=i.language,e[1]=a?.user?.name,e[2]=t,e[3]=l,e[4]=o,e[5]=D}else l=e[3],o=e[4],D=e[5];const h=D;let d;e[6]!==n?(d=n&&r.jsx(ke,{source:"org_home_header"}),e[6]=n,e[7]=d):d=e[7];let p;e[8]!==d?(p=r.jsx(R.Actions,{children:d}),e[8]=d,e[9]=p):p=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(pe,{}),e[10]=k):k=e[10];let v;e[11]!==s?(v=s&&r.jsx(z.Suspense,{fallback:null,children:r.jsx(ae,{children:r.jsx(me,{children:r.jsx(se,{homeTaskComposer:!0})})})}),e[11]=s,e[12]=v):v=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx(Ve,{}),e[13]=x):x=e[13];let u;e[14]!==n||e[15]!==l||e[16]!==h||e[17]!==o?(u=r.jsx(z.Suspense,{fallback:x,children:r.jsx(qe,{canManageProjects:n,eyebrow:l,greeting:h,slot:o})}),e[14]=n,e[15]=l,e[16]=h,e[17]=o,e[18]=u):u=e[18];let f;e[19]!==v||e[20]!==u?(f=r.jsx(R.Content,{children:r.jsxs(R.Container,{width:"wide",className:"flex min-h-full flex-col gap-10",children:[k,v,u]})}),e[19]=v,e[20]=u,e[21]=f):f=e[21];let m;return e[22]!==p||e[23]!==f?(m=r.jsxs(R,{children:[p,f]}),e[22]=p,e[23]=f,e[24]=m):m=e[24],m}function Vo(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(ne.Content,{children:r.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{Vo as default};
1
+ import{c as M,b as Z,J as X,a as V,r as z,j as r,as as re,n as R,a6 as oe,h as ie}from"./index-j_yRx5Gd.js";import{ChatLayout as ne}from"./index-DjrvwZRK.js";import{b as se}from"./input-CXb8CftG.js";import{D as ae,a as me}from"./chat-context-D1UPj8PY.js";import{a as le}from"./use-organization-settings-Bs3FNPGA.js";import{C as pe,u as ce,F as fe,R as ue,M as ge}from"./home-overview-Bax1lxi2.js";import{I as de}from"./icon-button-oEP30sMT.js";import{T as he,a as W}from"./toggle-group-D5t_q-4-.js";import{a as xe}from"./MessageCircle01-CLnacrAG.js";import{i as be}from"./sprints-C1z9xhcL.js";import{F as ye}from"./file-preview-OaKRZWAJ.js";import{u as q,a as je}from"./use-org-fs-DjcFvOh2.js";import{L as Se}from"./preview-dialog-DL37aLxL.js";import{t as _e,r as we,s as De}from"./daily-pulse-wcNja5Nj.js";import{N as ke}from"./new-project-dialog-CEvYXixv.js";import{P as ve}from"./projects-empty-state-DMI235bS.js";import{b as Be}from"./project-index-DCowj0f3.js";import{u as Ce}from"./use-inbox-feed-CsGHnFXa.js";import{b as Ne}from"./use-recent-apps-CZeef7PE.js";import{s as Pe}from"./use-project-scope-BPsfOFds.js";import{u as $e}from"./repository-binding-C9PB8Pam.js";import"./use-mobile-K0HhtzLO.js";import"./tooltip-FWYqBBwo.js";import"./index-qBmQKs_B.js";import"./XClose-KDmX3bNw.js";import"./thread-button-BIkWPKi2.js";import"./use-sidebar-collapsed-OyoeFCDb.js";import"./sheet-CQ-Sl7DR.js";import"./use-chat-layout-state-D2oXSxI4.js";import"./use-panel-navigate-E5z2LBx3.js";import"./thread-route-D_O45Jgw.js";import"./toolbar-icon-button-D3O9O6Pc.js";import"./use-in-settings-Bk56IO-M.js";import"./resizable-CeAdD2Vt.js";import"./route-page-header-DRqRE4Na.js";import"./LayoutLeft-CF1BwDgf.js";import"./use-current-view-CVXGOq2-.js";import"./usage-stats-DfMCfXyw.js";import"./utils-CVEq3hMx.js";import"./markdown-XCs9eqI7.js";import"./use-copy-Ch54vC-t.js";import"./agent-icon-JwKotWCA.js";import"./AlertCircle-BwkppllA.js";import"./UserCheck01-yJ-iclQD.js";import"./Tool01-Btvxanci.js";import"./ArrowUp-BYIR9bD7.js";import"./ArrowLeft-DCCL1rt6.js";import"./ArrowRight-BqeXFq9l.js";import"./BookOpen01-CzEiBc3s.js";import"./Globe04-zZ_Wo2qr.js";import"./CheckCircle-QBxzzhxK.js";import"./TrendUp01-L5-C5DWT.js";import"./ChevronDown-CrnnSDct.js";import"./ChevronSelectorVertical-H_ow2sst.js";import"./ChevronUp-B9LG8rHq.js";import"./UserSquare-BgpEmNUd.js";import"./LinkBroken01-BvskzXGY.js";import"./CreditCard01-DaKNNhgS.js";import"./File02-Bl7zscmz.js";import"./SwitchHorizontal01-CmGrpTEn.js";import"./Eye-CZBvYwD9.js";import"./Fingerprint04-D0mp-wxT.js";import"./Image01-CXgWX1gU.js";import"./Key01-XFXwjSrw.js";import"./Minus-BYPaVl5J.js";import"./Monitor01-CyQEs2jU.js";import"./Sun-armY2g2l.js";import"./Play-BJlRROdi.js";import"./Plus-5_DrSljh.js";import"./SearchMd-DnsuptGJ.js";import"./ShoppingBag01-BtSrcSQh.js";import"./Trash01-CrhSQVx7.js";import"./Upload01-EwdxuUFt.js";import"./Users01-wmNju8Yl.js";import"./Zap-Cm02NTI9.js";import"./task-board-C_hEaCmp.js";import"./schema-_y2Ibkxz.js";import"./gateway-client-03fm5JRg.js";import"./form-Dndv--cv.js";import"./label-Cb7nOoKu.js";import"./use-entitlements-D950Bkkb.js";import"./file-type-icon-DFjotUbk.js";import"./use-view-draft-kind-CMmZoMS7.js";import"./use-blog-view-BLcyDwC6.js";import"./thread-intent-NtyupwLZ.js";import"./use-mcp-client-ChId32b3.js";import"./auth-uzA6NxRV.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C_8BQRgd.js";import"./session-runtime-Dc7WrpCe.js";import"./chat-draft-Zo_haAh9.js";import"./use-voice-input-CJUe3xbJ.js";import"./popover-BArjIkyE.js";import"./drawer-CW9vnbpB.js";import"./use-ai-providers-DKNO4X5l.js";import"./index-DYCKpMVL.js";import"./checkbox-DcCmvMho.js";import"./select-_0XQMEZ6.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./tabs-DoCsLYC4.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-B6cSRUoE.js";import"./input-7IHe6mCK.js";import"./suggestion-BqQeH-fD.js";import"./use-mcp-prompts-BNyoze-A.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-Czz_ywh1.js";import"./plan-ladder-DajxtWfK.js";import"./add-connection-dialog-CP7m20vG.js";import"./collection-search-CHpPqIPY.js";import"./extract-connection-data-BVP6dlZP.js";import"./metadata-D72DunRR.js";import"./connection-B7M6nU1x.js";import"./url-slug-DNup9EYL.js";import"./connection-card-CcU9JcT0.js";import"./useInfiniteQuery-DwCy1LUY.js";import"./infiniteQueryObserver-BPTR7bwa.js";import"./connection-slug-Cf1O7MNR.js";import"./integration-icon-Cgc3RM_Z.js";import"./textarea-DMh_9jVf.js";import"./use-connection-DlcGRgl8.js";import"./schema-C-1dDbOf.js";import"./connection-form-helpers-CxUhMJ7p.js";import"./authenticate-and-persist-oauth-DrMSwytZ.js";import"./mcp-oauth-CxcwkHDS.js";import"./mcp-oauth-YcVTNxBt.js";import"./collection-tabs-DwugvhJ1.js";import"./badge-CLRefmEY.js";import"./use-infinite-scroll-BWI-IeTp.js";import"./useSuspenseInfiniteQuery-BiS_nbF8.js";import"./use-task-board-items-Bt59ZCVF.js";import"./use-decopilot-events-B0ZxUeCW.js";import"./connect-key-BVhplRmH.js";import"./use-api-keys-C5KLyWSq.js";import"./chart-UT9f3sXv.js";import"./CategoricalChart-BROFl5qI.js";import"./index-CjCwAO3W.js";import"./tooltipContext-BjOTYmPV.js";import"./CartesianChart-B0KWWZWU.js";import"./project-icon-Dl1h22aG.js";import"./project-apps-DKk8TKRM.js";import"./config-dw4Olpza.js";import"./task-key-D_XTdd0F.js";import"./task-route-BOK9gNeu.js";import"./ReferenceLine-DSOZotrL.js";import"./utils-CnQnO2Ns.js";import"./editor-trq0ZKwr.js";import"./preview-content-QCUy5sdV.js";import"./file-share-button-D3h2-Zhn.js";import"./use-navigate-to-agent-DpiPNwgn.js";import"./repository-picker-DapPUhIH.js";import"./github-icon-y_XGzms1.js";import"./use-debounced-value-f7V1zqmB.js";import"./new-project-store-CP8aeL-2.js";const O="home",Q="brief";function ee(e){return`users/${e}/brief`}function Ee(e,t){return`${e}/${t}.html`}function Fe(e){const t=String(e.getFullYear()).padStart(4,"0"),i=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${s}`}function Ie(e){if(!e.endsWith(".html"))return null;const t=e.slice(0,-5);return be(t)?t:null}const Te=7;function te(e,t){return Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5)}function Me(e,t){let i=null;for(const s of e){const a=Ie(s);if(!a||i&&a<=i.day)continue;const n=te(a,t);n>=0&&n<Te&&(i={name:s,day:a})}return i}const K=e=>e.slice(e.lastIndexOf("/")+1);function J(e,t,i,s){const a=i.filter(o=>o.kind==="file"),n=Me(a.map(o=>K(o.path)),s),l=n&&a.find(o=>K(o.path)===n.name);return n&&l?{scope:e,path:Ee(t,n.day),filename:n.name,size:l.size,day:n.day,ageDays:te(n.day,s)}:null}function Ae({userId:e,personal:t,org:i,today:s}){return[e?J("personal",ee(e),t,s):null,J("org",Q,i,s)].filter(a=>a!==null)}function Le(e,t){return t===0?e("home.dailyBrief.today"):t===1?e("home.dailyBrief.yesterday"):e("home.dailyBrief.daysAgo",{count:t})}function He(e,t){return new Date(`${t}T12:00:00Z`).toLocaleDateString(e,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"})}function Re(){const e=M.c(54),t=Z(),[i]=X(),{data:s}=V.useSession(),a=s?.user?.id,n=q(O,Q),l=a??"";let o;e[0]!==l?(o=ee(l),e[0]=l,e[1]=o):o=e[1];const D=!!a;let h;e[2]!==D?(h={enabled:D},e[2]=D,e[3]=h):h=e[3];const d=q(O,o,h),p=je(O),[k,v]=z.useState(null),[x,u]=z.useState(!1);let f,m,c,b,g,y,j,B,S,_;if(e[4]!==n.data||e[5]!==d.data||e[6]!==i||e[7]!==p||e[8]!==k||e[9]!==t||e[10]!==a){b=Symbol.for("react.early_return_sentinel");e:{const G=Ae({userId:a,personal:d.data??[],org:n.data??[],today:Fe(new Date)});if(m=G.find(T=>T.scope===k)??G[0],!m){b=null;break e}_="flex flex-col overflow-hidden surface";let A;e[21]!==t?(A=t("home.dailyBrief.title"),e[21]=t,e[22]=A):A=e[22];const U=r.jsxs("h2",{className:"flex min-w-0 items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[A,r.jsxs("span",{className:"truncate text-xs font-normal text-muted-foreground",children:[Le(t,m.ageDays)," ·"," ",He(i.language,m.day)]})]}),Y=G.length>1&&r.jsxs(he,{type:"single",variant:"segmented",size:"sm",value:m.scope,onValueChange:T=>{(T==="personal"||T==="org")&&v(T)},children:[r.jsx(W,{value:"personal",className:"px-2.5 text-xs",children:t("home.dailyBrief.personal")}),r.jsx(W,{value:"org",className:"px-2.5 text-xs",children:t("home.dailyBrief.org")})]});let E;e[23]!==t?(E=t("home.dailyBrief.fullscreen"),e[23]=t,e[24]=E):E=e[24];let L,H;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=()=>u(!0),H=r.jsx(xe,{size:14}),e[25]=L,e[26]=H):(L=e[25],H=e[26]);let F;e[27]!==E?(F=r.jsx(de,{label:E,onClick:L,children:H}),e[27]=E,e[28]=F):F=e[28];let I;e[29]!==Y||e[30]!==F?(I=r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Y,F]}),e[29]=Y,e[30]=F,e[31]=I):I=e[31],e[32]!==U||e[33]!==I?(c=r.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[U,I]}),e[32]=U,e[33]=I,e[34]=c):c=e[34],S="h-[32rem]",f=ye,g=m.path,y=m.filename,j=m.size,B=p(m.path)}e[4]=n.data,e[5]=d.data,e[6]=i,e[7]=p,e[8]=k,e[9]=t,e[10]=a,e[11]=f,e[12]=m,e[13]=c,e[14]=b,e[15]=g,e[16]=y,e[17]=j,e[18]=B,e[19]=S,e[20]=_}else f=e[11],m=e[12],c=e[13],b=e[14],g=e[15],y=e[16],j=e[17],B=e[18],S=e[19],_=e[20];if(b!==Symbol.for("react.early_return_sentinel"))return b;let w;e[35]!==g||e[36]!==y||e[37]!==j||e[38]!==B?(w={key:g,filename:y,size:j,downloadUrl:B},e[35]=g,e[36]=y,e[37]=j,e[38]=B,e[39]=w):w=e[39];let C;e[40]!==f||e[41]!==w?(C=r.jsx(f,{file:w}),e[40]=f,e[41]=w,e[42]=C):C=e[42];let N;e[43]!==C||e[44]!==S?(N=r.jsx("div",{className:S,children:C}),e[43]=C,e[44]=S,e[45]=N):N=e[45];let $;e[46]!==m||e[47]!==x?($=x&&r.jsx(Se,{previewPath:`${O}/${m.path}`,onClose:()=>u(!1),showSeeInLibrary:!0}),e[46]=m,e[47]=x,e[48]=$):$=e[48];let P;return e[49]!==c||e[50]!==N||e[51]!==$||e[52]!==_?(P=r.jsxs("section",{className:_,children:[c,N,$]}),e[49]=c,e[50]=N,e[51]=$,e[52]=_,e[53]=P):P=e[53],P}function Oe(e){return e<12?"morning":e<18?"afternoon":"evening"}function ze(e){const t=(e??"").trim().split(/\s+/)[0];return t||null}function Ge(e,t){return t.toLocaleDateString(e,{weekday:"long",day:"numeric",month:"long"})}function Ue(e){return e==="morning"?"overnight":"today"}function Ye(e,t){const i=new Date(t);return i.setHours(0,0,0,0),e==="morning"&&i.setHours(-6),i.getTime()}const Ze={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function Ve(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx("div",{className:"flex min-h-64 items-center justify-center",children:r.jsx(ie,{className:"size-5 text-muted-foreground"})}),e[0]=t):t=e[0],t}function We(e,t,i,s,a){const n=Ue(i)==="overnight",l=[];if(t>0){const o=e(t===1?"home.brief.changeOne":"home.brief.changeMany",{count:t});l.push(e(n?"home.brief.overnightShipped":"home.brief.todayShipped",{changes:o}))}else s===0&&l.push(e(a>0?"home.brief.working":n?"home.brief.quietNight":"home.brief.quietDay"));return l.push(s===0?e("home.brief.waitingNone"):e(s===1?"home.brief.waitingOne":"home.brief.waitingMany",{count:s})),l.join(" ")}function qe(e){const t=M.c(41),{canManageProjects:i,eyebrow:s,greeting:a,slot:n}=e,l=Z(),{org:o}=oe(),{data:D}=V.useSession();let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h={pageSize:1e3},t[0]=h):h=t[0];const d=$e(h),p=ce(),k=Ce(),{recent:v}=Ne(o.slug);let x,u;if(t[1]!==d||t[2]!==i||t[3]!==o.id){u=Symbol.for("react.early_return_sentinel");e:{let N;t[6]!==o.id?(N=P=>P.id!==o.id,t[6]=o.id,t[7]=N):N=t[7];const $=Pe(d).filter(N);if($.length===0){let P;t[8]!==i?(P=r.jsx(ve,{canCreate:i}),t[8]=i,t[9]=P):P=t[9],u=P;break e}x=Be($)}t[1]=d,t[2]=i,t[3]=o.id,t[4]=x,t[5]=u}else x=t[4],u=t[5];if(u!==Symbol.for("react.early_return_sentinel"))return u;const f=x;let m,c;t[10]!==D?.user?.id||t[11]!==n||t[12]!==l||t[13]!==p?(c=_e(p,D?.user?.id),m=We(l,De(p,Ye(n,new Date)),n,c.length,we(p).length),t[10]=D?.user?.id,t[11]=n,t[12]=l,t[13]=p,t[14]=m,t[15]=c):(m=t[14],c=t[15]);const b=m;let g;t[16]!==s?(g=r.jsx("span",{className:"text-xs text-muted-foreground",children:s}),t[16]=s,t[17]=g):g=t[17];let y;t[18]!==b||t[19]!==a?(y=r.jsxs("h1",{className:"max-w-[40ch] text-2xl font-medium text-balance text-foreground",children:[a," ",b]}),t[18]=b,t[19]=a,t[20]=y):y=t[20];let j;t[21]!==g||t[22]!==y?(j=r.jsxs("div",{className:"flex flex-col gap-1",children:[g,y]}),t[21]=g,t[22]=y,t[23]=j):j=t[23];let B;t[24]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(Re,{}),t[24]=B):B=t[24];let S;t[25]!==k.updates||t[26]!==f||t[27]!==o.slug||t[28]!==p||t[29]!==c?(S=r.jsx(fe,{waiting:c,tasks:p,mentions:k.updates,index:f,orgSlug:o.slug}),t[25]=k.updates,t[26]=f,t[27]=o.slug,t[28]=p,t[29]=c,t[30]=S):S=t[30];let _;t[31]!==o.slug||t[32]!==v?(_=r.jsx(ue,{recent:v,orgSlug:o.slug}),t[31]=o.slug,t[32]=v,t[33]=_):_=t[33];let w;t[34]!==p?(w=r.jsx(ge,{tasks:p}),t[34]=p,t[35]=w):w=t[35];let C;return t[36]!==_||t[37]!==w||t[38]!==j||t[39]!==S?(C=r.jsxs("div",{className:"flex flex-col gap-8",children:[j,B,S,_,w]}),t[36]=_,t[37]=w,t[38]=j,t[39]=S,t[40]=C):C=t[40],C}function Ke(){const e=M.c(25),t=Z(),[i]=X(),s=le("home_task_intake_enabled"),{data:a}=V.useSession(),{granted:n}=re("agents:manage");let l,o,D;if(e[0]!==i.language||e[1]!==a?.user?.name||e[2]!==t){const c=new Date,b=ze(a?.user?.name);o=Oe(c.getHours());const g=Ze[o];l=Ge(i.language,c),D=b?t(g.named,{name:b}):t(g.bare),e[0]=i.language,e[1]=a?.user?.name,e[2]=t,e[3]=l,e[4]=o,e[5]=D}else l=e[3],o=e[4],D=e[5];const h=D;let d;e[6]!==n?(d=n&&r.jsx(ke,{source:"org_home_header"}),e[6]=n,e[7]=d):d=e[7];let p;e[8]!==d?(p=r.jsx(R.Actions,{children:d}),e[8]=d,e[9]=p):p=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(pe,{}),e[10]=k):k=e[10];let v;e[11]!==s?(v=s&&r.jsx(z.Suspense,{fallback:null,children:r.jsx(ae,{children:r.jsx(me,{children:r.jsx(se,{homeTaskComposer:!0})})})}),e[11]=s,e[12]=v):v=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx(Ve,{}),e[13]=x):x=e[13];let u;e[14]!==n||e[15]!==l||e[16]!==h||e[17]!==o?(u=r.jsx(z.Suspense,{fallback:x,children:r.jsx(qe,{canManageProjects:n,eyebrow:l,greeting:h,slot:o})}),e[14]=n,e[15]=l,e[16]=h,e[17]=o,e[18]=u):u=e[18];let f;e[19]!==v||e[20]!==u?(f=r.jsx(R.Content,{children:r.jsxs(R.Container,{width:"wide",className:"flex min-h-full flex-col gap-10",children:[k,v,u]})}),e[19]=v,e[20]=u,e[21]=f):f=e[21];let m;return e[22]!==p||e[23]!==f?(m=r.jsxs(R,{children:[p,f]}),e[22]=p,e[23]=f,e[24]=m):m=e[24],m}function Vo(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(ne.Content,{children:r.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{Vo as default};
@@ -1 +1 @@
1
- import{c as A,b as B,a6 as q,as as ne,j as o,m as K,L as P,E as V,am as oe,V as re,h as ae,ag as ie,$ as le,o as ce}from"./index-DjOrtNe_.js";import{i as Z}from"./ArrowRight-B7_56WME.js";import{C as me,a as fe,b as de,c as ue}from"./connect-key-DFND7gAR.js";import{u as xe}from"./use-api-keys-Dl3tzBy1.js";import{u as pe,t as ge}from"./use-task-board-items-CSce_i0G.js";import{i as he}from"./AlertCircle-BGWLSshM.js";import{i as Q}from"./CheckCircle-BbXMAEK-.js";import{s as je}from"./Eye-DaoChYM8.js";import{u as ve,A as ke}from"./agent-icon-uUDeuFRJ.js";import{C as be,a as we,B as ye,b as Ne,c as _e}from"./chart-CST09ZCZ.js";import{P as Se}from"./project-icon-BuW7e6zO.js";import{T as X,P as Ce,A as Ie}from"./project-apps-CwT_AMzE.js";import{a as Te}from"./config-Gp6kk-a9.js";import{t as ze}from"./task-route-OI0tZ-L7.js";import{p as $e}from"./project-index-CocoOoYy.js";import{a as Re,b as Ee,c as Ae,d as Me,R as F,f as G}from"./daily-pulse-CvVFZgVf.js";import{R as De}from"./ReferenceLine-BvnhZpMn.js";import{C as Le,X as Be,Y as Ke}from"./CartesianChart-BiBbBS-W.js";const ee=[{name:"Claude",Icon:me,size:[11,14],bg:"#D97757",fg:"#fff"},{name:"Cursor",Icon:fe,size:[10,12],bg:"#000",fg:"#fff"},{name:"Codex",Icon:de,size:[10,12],bg:"#4F46E5",fg:"#fff"}];function wt(t){const e=A.c(22),{dense:a}=t,s=a===void 0?!0:a,l=B(),{org:n}=q();let i;e[0]!==n.slug?(i={org:n.slug},e[0]=n.slug,e[1]=i):i=e[1];const c=s?"h-7 shrink-0 gap-x-2 whitespace-nowrap pl-3 pr-1.5":"flex-wrap gap-x-3 gap-y-2 py-1.5 pl-4 pr-2.5";let r;e[2]!==c?(r=K("group hidden max-w-full @3xl/panel-header:inline-flex items-center justify-center rounded-full bg-card text-sm shadow-edge transition-colors hover:bg-accent",c),e[2]=c,e[3]=r):r=e[3];let m;e[4]!==l?(m=l("home.orgHome.connectPill"),e[4]=l,e[5]=m):m=e[5];let d;e[6]!==m?(d=o.jsx("span",{className:"font-medium text-foreground",children:m}),e[6]=m,e[7]=d):d=e[7];let f;e[8]!==s?(f=ee.map(j=>{const{name:v,Icon:z,size:_,bg:S,fg:$}=j;return o.jsx("span",{title:v,className:K("flex items-center justify-center rounded-full",s?"size-5":"size-6"),style:{backgroundColor:S,color:$},children:o.jsx(z,{size:s?_[0]:_[1]})},v)}),e[8]=s,e[9]=f):f=e[9];let u;e[10]!==f?(u=o.jsx("span",{"aria-hidden":"true",className:"flex items-center gap-1",children:f}),e[10]=f,e[11]=u):u=e[11];const x=s?"size-3":"size-3.5";let p;e[12]!==x?(p=K(x,"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"),e[12]=x,e[13]=p):p=e[13];let g;e[14]!==p?(g=o.jsx(Z,{className:p}),e[14]=p,e[15]=g):g=e[15];let h;return e[16]!==g||e[17]!==i||e[18]!==r||e[19]!==d||e[20]!==u?(h=o.jsxs(P,{to:"/$org/settings/connect",params:i,onClick:Oe,className:r,children:[d,u,g]}),e[16]=g,e[17]=i,e[18]=r,e[19]=d,e[20]=u,e[21]=h):h=e[21],h}function Oe(){return V("connect_clients_opened",{source:"org_home"})}function yt(){const t=A.c(13),e=B(),{org:a}=q(),{granted:s}=ne("api-keys:manage");let l;t[0]!==s?(l={enabled:s},t[0]=s,t[1]=l):l=t[1];const{data:n}=xe(l);if(s&&!n||n?.some(Fe))return null;let i;t[2]!==a.slug?(i={org:a.slug},t[2]=a.slug,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("span",{"aria-hidden":"true",className:"flex items-center gap-1",children:ee.map(Ye)}),t[4]=c):c=t[4];let r;t[5]!==e?(r=e("home.orgHome.connectPill"),t[5]=e,t[6]=r):r=t[6];let m;t[7]!==r?(m=o.jsx("span",{className:"font-medium text-foreground",children:r}),t[7]=r,t[8]=m):m=t[8];let d;t[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Z,{className:"ml-auto size-3.5 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),t[9]=d):d=t[9];let f;return t[10]!==i||t[11]!==m?(f=o.jsxs(P,{to:"/$org/settings/connect",params:i,onClick:Pe,className:"group hidden items-center gap-3 rounded-xl bg-card px-4 py-2.5 text-sm shadow-edge transition-colors hover:bg-accent md:flex",children:[c,m,d]}),t[10]=i,t[11]=m,t[12]=f):f=t[12],f}function Ye(t){const{name:e,Icon:a,size:s,bg:l,fg:n}=t;return o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full",style:{backgroundColor:l,color:n},children:o.jsx(a,{size:s[0]})},e)}function Pe(){return V("connect_clients_opened",{source:"org_home"})}function Fe(t){return t.name.startsWith(ue)}function Nt(){const t=A.c(3),{locator:e}=q(),a=oe();pe();let s;t[0]!==e||t[1]!==a?(s=ge(e,a),t[0]=e,t[1]=a,t[2]=s):s=t[2];const{data:l}=re(s);return l.items}function _t(t){const e=A.c(16),{recent:a,orgSlug:s}=t,l=B();let n,i,c,r;if(e[0]!==s||e[1]!==a||e[2]!==l){r=Symbol.for("react.early_return_sentinel");e:{let d;e[7]!==s||e[8]!==l?(d=u=>{const x={org:s,agentId:u.projectId};if(u.connection){const{label:g,icon:h,id:j,toolName:v}=u.connection;return[{key:`${j}:${v}:${u.projectId}`,label:g,project:u.projectTitle,link:{to:le.app,params:{...x,connectionId:j,toolName:v}},glyph:o.jsx(ke,{icon:h,name:g,size:"md",className:X})}]}const p=Ce[u.app];return p?[{key:`${u.app}:${u.projectId}`,label:l(p.labelKey),project:u.projectTitle,link:{to:p.to,params:x},glyph:o.jsx("span",{className:K(X,"flex items-center",p.tone),children:o.jsx(p.Icon,{size:24})})}]:[]},e[7]=s,e[8]=l,e[9]=d):d=e[9];const f=a.slice(0,8).flatMap(d);if(f.length===0){r=null;break e}n=Ie,e[10]!==l?(i=l("home.overview.recentApps"),e[10]=l,e[11]=i):i=e[11],c=f.map(Ue)}e[0]=s,e[1]=a,e[2]=l,e[3]=n,e[4]=i,e[5]=c,e[6]=r}else n=e[3],i=e[4],c=e[5],r=e[6];if(r!==Symbol.for("react.early_return_sentinel"))return r;let m;return e[12]!==n||e[13]!==i||e[14]!==c?(m=o.jsx(n,{title:i,children:c}),e[12]=n,e[13]=i,e[14]=c,e[15]=m):m=e[15],m}function Ue(t){return o.jsxs(P,{to:t.link.to,params:t.link.params,className:"group flex shrink-0 flex-col items-center gap-2.5 rounded-xl p-3 text-center transition-[background-color,transform] duration-150 ease-out hover:bg-accent active:scale-[0.97]",children:[t.glyph,o.jsxs("span",{className:"flex w-full min-w-0 flex-col",children:[o.jsx("span",{className:"line-clamp-2 text-xs font-medium break-words text-foreground",children:t.label}),o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.project})]})]},t.key)}function He(t,e){return{to:ie.tasks,params:{org:t,taskKey:ze(t,e)}}}const Qe={answer:{Icon:ve,tone:"text-warning",reasonKey:"home.needsYou.reasonAnswer"},failed:{Icon:he,tone:"text-destructive",reasonKey:"home.overview.reasonFailed"},review:{Icon:je,tone:"text-warning",reasonKey:"home.needsYou.reasonReview"},running:{Icon:Q,tone:"text-muted-foreground",reasonKey:"home.overview.reasonRunning"},assigned:{Icon:Q,tone:"text-muted-foreground",reasonKey:"home.needsYou.reasonAssigned"}},J=["answer","failed","review","running","assigned"];function qe(t,e){const a=new Set,s=[],l=(n,i)=>{a.has(n.id)||(a.add(n.id),s.push({task:n,kind:i}))};for(const n of t)l(n,Re(n));for(const n of e){if(n.status==="done"||n.status==="archived")continue;const i=Te(n);i==="failed"?l(n,"failed"):i==="running"&&l(n,"running")}return s.sort((n,i)=>J.indexOf(n.kind)-J.indexOf(i.kind))}function Xe(t,e){const a=new Map;for(const r of e){if(r.action!=="mentioned"&&r.action!=="commented")continue;const m=a.get(r.taskBoardItemId);(!m||m.action!=="mentioned"&&r.action==="mentioned")&&a.set(r.taskBoardItemId,r)}const s=new Set(t.map(r=>r.task.id)),l=[...a.values()].filter(r=>!s.has(r.taskBoardItemId)).map(r=>({kind:"mention",task:null,mention:r})),n=t.map(({task:r,kind:m})=>({kind:m,task:r,mention:a.get(r.id)??null})),i=n.filter(r=>r.kind==="answer"),c=n.filter(r=>r.kind!=="answer");return[...i,...l,...c]}const Ge=7;function W(t){const e=A.c(6),{mention:a}=t,s=B();let l;e[0]!==a.actorName||e[1]!==s?(l=a.actorName??s("home.overview.someone"),e[0]=a.actorName,e[1]=s,e[2]=l):l=e[2];const n=l,i=a.actorImage??void 0;let c;return e[3]!==n||e[4]!==i?(c=o.jsx(ce,{url:i,fallback:n,shape:"circle",size:"2xs"}),e[3]=n,e[4]=i,e[5]=c):c=e[5],c}function Je(t,e){const a=t.actorName??e("home.overview.someone");return e(t.action==="mentioned"?"home.overview.mentioned":"home.overview.commented",{actor:a})}function St(t){const e=A.c(12),{waiting:a,tasks:s,mentions:l,index:n,orgSlug:i}=t,c=B();let r;if(e[0]!==n||e[1]!==l||e[2]!==i||e[3]!==c||e[4]!==s||e[5]!==a){const m=Xe(qe(a,s),l);let d;e[7]!==c?(d=c("home.overview.forYou"),e[7]=c,e[8]=d):d=e[8];const f=m.length>0&&o.jsx("span",{className:"text-muted-foreground tabular-nums",children:m.length});let u;e[9]!==d||e[10]!==f?(u=o.jsxs("h2",{className:"flex items-center gap-2 px-2 pt-1 pb-1 text-sm font-medium text-foreground",children:[d,f]}),e[9]=d,e[10]=f,e[11]=u):u=e[11],r=o.jsxs("section",{className:"flex flex-col gap-2 surface p-3",children:[u,m.length===0?o.jsxs("div",{className:"flex flex-col items-center gap-3 px-2 py-10 text-center",children:[o.jsx("span",{className:"flex size-10 items-center justify-center rounded-full bg-success/10 text-success",children:o.jsx(Q,{size:20})}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:c("home.overview.allClearTitle")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:c("home.overview.allClearDescription")})]})]}):o.jsx("div",{className:"flex flex-col",children:m.slice(0,Ge).map(x=>{const p=x.kind==="mention"?{id:x.mention.taskBoardItemId,keySeq:x.mention.taskKeySeq,title:x.mention.taskTitle}:x.task,g=x.task?$e(x.task,n):null,h=x.kind==="mention"?null:Qe[x.kind],j=x.mention?Je(x.mention,c):h?c(h.reasonKey):"";return o.jsxs(P,{...He(i,p),className:"group flex h-10 items-center gap-3 rounded-lg px-2 transition-colors hover:bg-accent",children:[o.jsx("span",{"aria-hidden":"true",className:K("flex size-4 shrink-0 items-center justify-center",h?.tone),children:x.kind==="mention"?o.jsx(W,{mention:x.mention}):x.kind==="running"?o.jsx(ae,{className:"size-3.5"}):h?o.jsx(h.Icon,{size:16}):null}),o.jsx("span",{className:"min-w-0 truncate text-sm text-foreground",children:p.title}),o.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-sm text-muted-foreground",children:[x.kind!=="mention"&&x.mention&&o.jsx("span",{"aria-hidden":"true",children:o.jsx(W,{mention:x.mention})}),o.jsx("span",{className:"truncate",children:j})]}),g&&o.jsxs("span",{className:"hidden max-w-48 shrink-0 items-center gap-1.5 text-xs text-muted-foreground md:flex",children:[o.jsx(Se,{icon:g.icon,name:g.title}),o.jsx("span",{className:"truncate",children:g.title})]})]},p.id)})})]}),e[0]=n,e[1]=l,e[2]=i,e[3]=c,e[4]=s,e[5]=a,e[6]=r}else r=e[6];return r}function We(t){if(t<=0)return 1;const e=10**Math.floor(Math.log10(t));for(const a of[1,2,2.5,5,10])if(a*e>=t)return a*e;return 10*e}const Ve=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function U(t){const e=A.c(52),{series:a,start:s,format:l,label:n,averageLabel:i}=t,c=We(Math.max(...a,0));let r;e[0]!==a?(r=a.length===0?0:a.reduce(et,0)/a.length,e[0]=a,e[1]=r):r=e[1];const m=r;let d;if(e[2]!==a||e[3]!==s){let E;e[5]!==s?(E=(te,se)=>({day:Ve.format(new Date(s.getTime()+se*864e5)),value:te}),e[5]=s,e[6]=E):E=e[6],d=a.map(E),e[2]=a,e[3]=s,e[4]=d}else d=e[4];const f=d,u=Math.max(f.length-1,0),x=f[0]?.day;let p;e[7]!==u||e[8]!==f?(p=f[Math.round(u/2)]?.day,e[7]=u,e[8]=f,e[9]=p):p=e[9];const g=f[u]?.day;let h;e[10]!==x||e[11]!==p||e[12]!==g?(h=[x,p,g].filter(Ze),e[10]=x,e[11]=p,e[12]=g,e[13]=h):h=e[13];const j=h;let v;e[14]!==n?(v={value:{label:n,color:"var(--chart-1)"}},e[14]=n,e[15]=v):v=e[15];const z=v;let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_={top:8,right:0,bottom:0,left:0},e[16]=_):_=e[16];let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(Le,{vertical:!1,strokeDasharray:"4 4",stroke:"var(--border)"}),e[17]=S):S=e[17];let $,R;e[18]===Symbol.for("react.memo_cache_sentinel")?($={stroke:"var(--border)"},R={fontSize:12,fill:"var(--muted-foreground)"},e[18]=$,e[19]=R):($=e[18],R=e[19]);let b;e[20]!==j?(b=o.jsx(Be,{dataKey:"day",ticks:j,interval:"preserveStartEnd",tickLine:!1,axisLine:$,tick:R,tickMargin:8}),e[20]=j,e[21]=b):b=e[21];let I;e[22]!==c?(I=[0,c],e[22]=c,e[23]=I):I=e[23];const T=c/2;let w;e[24]!==c||e[25]!==T?(w=[0,T,c],e[24]=c,e[25]=T,e[26]=w):w=e[26];let y;e[27]!==l?(y=E=>E===0?"0":l(E),e[27]=l,e[28]=y):y=e[28];let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M={fontSize:12,fill:"var(--muted-foreground)"},e[29]=M):M=e[29];let N;e[30]!==I||e[31]!==w||e[32]!==y?(N=o.jsx(Ke,{orientation:"right",domain:I,ticks:w,tickFormatter:y,tickLine:!1,axisLine:!1,tick:M,width:44}),e[30]=I,e[31]=w,e[32]=y,e[33]=N):N=e[33];let C;e[34]===Symbol.for("react.memo_cache_sentinel")?(C={fill:"var(--muted)",opacity:.6},e[34]=C):C=e[34];let k;e[35]!==l||e[36]!==n?(k=o.jsx(be,{cursor:C,content:o.jsx(we,{indicator:"line",formatter:E=>o.jsxs("div",{className:"flex flex-1 items-center justify-between gap-3 leading-none",children:[o.jsx("span",{className:"text-muted-foreground",children:n}),o.jsx("span",{className:"font-medium text-foreground tabular-nums",children:l(Number(E))})]})})}),e[35]=l,e[36]=n,e[37]=k):k=e[37];let D;e[38]!==m||e[39]!==i||e[40]!==l?(D=m>0&&o.jsx(De,{y:m,stroke:"var(--foreground)",strokeOpacity:.6,strokeDasharray:"2 2",label:{value:i(l(m)),position:"insideBottomLeft",fontSize:12,fill:"var(--foreground)"}}),e[38]=m,e[39]=i,e[40]=l,e[41]=D):D=e[41];let O;e[42]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx(ye,{dataKey:"value",fill:"var(--color-value)",radius:[2,2,0,0],maxBarSize:4,animationDuration:300}),e[42]=O):O=e[42];let L;e[43]!==f||e[44]!==b||e[45]!==N||e[46]!==k||e[47]!==D?(L=o.jsxs(Ne,{data:f,margin:_,barCategoryGap:"30%",children:[S,b,N,k,D,O]}),e[43]=f,e[44]=b,e[45]=N,e[46]=k,e[47]=D,e[48]=L):L=e[48];let Y;return e[49]!==z||e[50]!==L?(Y=o.jsx(_e,{config:z,className:"aspect-auto h-[159px] w-full",children:L}),e[49]=z,e[50]=L,e[51]=Y):Y=e[51],Y}function Ze(t){return!!t}function et(t,e){return t+e}function H(t){const e=A.c(10),{label:a,value:s,chart:l}=t;let n;e[0]!==a?(n=o.jsx("span",{className:"text-sm font-medium text-foreground",children:a}),e[0]=a,e[1]=n):n=e[1];let i;e[2]!==s?(i=o.jsx("span",{className:"text-[32px] leading-none font-medium tracking-tight tabular-nums text-foreground",children:s}),e[2]=s,e[3]=i):i=e[3];let c;e[4]!==n||e[5]!==i?(c=o.jsxs("div",{className:"flex flex-col gap-2.5",children:[n,i]}),e[4]=n,e[5]=i,e[6]=c):c=e[6];let r;return e[7]!==l||e[8]!==c?(r=o.jsxs("section",{className:"flex flex-col gap-6 surface p-5",children:[c,l]}),e[7]=l,e[8]=c,e[9]=r):r=e[9],r}function Ct(t){const e=A.c(58),{tasks:a}=t,s=B();let l,n,i,c,r,m,d,f,u;if(e[0]!==s||e[1]!==a){const j=Ee(a,F),v=Ae(a,F);i=Me(a);const z=st;let _,S;if(e[11]===Symbol.for("react.memo_cache_sentinel")){const k=new Date;S=new Date(k.getFullYear(),k.getMonth(),k.getDate()-(F-1)),_=new Date(k.getFullYear(),k.getMonth(),1),e[11]=_,e[12]=S}else _=e[11],S=e[12];c=_;const $=tt;let R;e[13]!==s?(R=k=>s("home.overview.average",{value:k}),e[13]=s,e[14]=R):R=e[14],n=R,d="grid gap-4 md:grid-cols-3";let b;e[15]!==s?(b=s("home.overview.delivered"),e[15]=s,e[16]=b):b=e[16];const I=String(z(j));let T;e[17]!==s?(T=s("home.overview.delivered"),e[17]=s,e[18]=T):T=e[18];let w;e[19]!==n||e[20]!==j||e[21]!==T?(w=o.jsx(U,{label:T,series:j,start:S,format:$,averageLabel:n}),e[19]=n,e[20]=j,e[21]=T,e[22]=w):w=e[22],e[23]!==w||e[24]!==b||e[25]!==I?(f=o.jsx(H,{label:b,value:I,chart:w}),e[23]=w,e[24]=b,e[25]=I,e[26]=f):f=e[26];let y;e[27]!==s?(y=s("home.overview.agentRuns"),e[27]=s,e[28]=y):y=e[28];const M=String(z(v));let N;e[29]!==s?(N=s("home.overview.agentRuns"),e[29]=s,e[30]=N):N=e[30];let C;e[31]!==n||e[32]!==v||e[33]!==N?(C=o.jsx(U,{label:N,series:v,start:S,format:$,averageLabel:n}),e[31]=n,e[32]=v,e[33]=N,e[34]=C):C=e[34],e[35]!==y||e[36]!==M||e[37]!==C?(u=o.jsx(H,{label:y,value:M,chart:C}),e[35]=y,e[36]=M,e[37]=C,e[38]=u):u=e[38],l=H,e[39]!==s?(r=s("home.overview.agentCost"),e[39]=s,e[40]=r):r=e[40],m=G(z(i)),e[0]=s,e[1]=a,e[2]=l,e[3]=n,e[4]=i,e[5]=c,e[6]=r,e[7]=m,e[8]=d,e[9]=f,e[10]=u}else l=e[2],n=e[3],i=e[4],c=e[5],r=e[6],m=e[7],d=e[8],f=e[9],u=e[10];let x;e[41]!==s?(x=s("home.overview.agentCost"),e[41]=s,e[42]=x):x=e[42];let p;e[43]!==n||e[44]!==i||e[45]!==c||e[46]!==x?(p=o.jsx(U,{label:x,series:i,start:c,format:G,averageLabel:n}),e[43]=n,e[44]=i,e[45]=c,e[46]=x,e[47]=p):p=e[47];let g;e[48]!==l||e[49]!==r||e[50]!==m||e[51]!==p?(g=o.jsx(l,{label:r,value:m,chart:p}),e[48]=l,e[49]=r,e[50]=m,e[51]=p,e[52]=g):g=e[52];let h;return e[53]!==d||e[54]!==f||e[55]!==u||e[56]!==g?(h=o.jsxs("div",{className:d,children:[f,u,g]}),e[53]=d,e[54]=f,e[55]=u,e[56]=g,e[57]=h):h=e[57],h}function tt(t){return String(Math.round(t*10)/10)}function st(t){return t.reduce(nt,0)}function nt(t,e){return t+e}export{yt as C,St as F,Ct as M,_t as R,wt as a,Nt as u};
1
+ import{c as A,b as B,a6 as q,as as ne,j as o,m as K,L as P,E as V,am as oe,V as re,h as ae,ag as ie,$ as le,o as ce}from"./index-j_yRx5Gd.js";import{i as Z}from"./ArrowRight-BqeXFq9l.js";import{C as me,a as fe,b as de,c as ue}from"./connect-key-BVhplRmH.js";import{u as xe}from"./use-api-keys-C5KLyWSq.js";import{u as pe,t as ge}from"./use-task-board-items-Bt59ZCVF.js";import{i as he}from"./AlertCircle-BwkppllA.js";import{i as Q}from"./CheckCircle-QBxzzhxK.js";import{s as je}from"./Eye-CZBvYwD9.js";import{u as ve,A as ke}from"./agent-icon-JwKotWCA.js";import{C as be,a as we,B as ye,b as Ne,c as _e}from"./chart-UT9f3sXv.js";import{P as Se}from"./project-icon-Dl1h22aG.js";import{T as X,P as Ce,A as Ie}from"./project-apps-DKk8TKRM.js";import{a as Te}from"./config-dw4Olpza.js";import{t as ze}from"./task-route-BOK9gNeu.js";import{p as $e}from"./project-index-DCowj0f3.js";import{a as Re,b as Ee,c as Ae,d as Me,R as F,f as G}from"./daily-pulse-wcNja5Nj.js";import{R as De}from"./ReferenceLine-DSOZotrL.js";import{C as Le,X as Be,Y as Ke}from"./CartesianChart-B0KWWZWU.js";const ee=[{name:"Claude",Icon:me,size:[11,14],bg:"#D97757",fg:"#fff"},{name:"Cursor",Icon:fe,size:[10,12],bg:"#000",fg:"#fff"},{name:"Codex",Icon:de,size:[10,12],bg:"#4F46E5",fg:"#fff"}];function wt(t){const e=A.c(22),{dense:a}=t,s=a===void 0?!0:a,l=B(),{org:n}=q();let i;e[0]!==n.slug?(i={org:n.slug},e[0]=n.slug,e[1]=i):i=e[1];const c=s?"h-7 shrink-0 gap-x-2 whitespace-nowrap pl-3 pr-1.5":"flex-wrap gap-x-3 gap-y-2 py-1.5 pl-4 pr-2.5";let r;e[2]!==c?(r=K("group hidden max-w-full @3xl/panel-header:inline-flex items-center justify-center rounded-full bg-card text-sm shadow-edge transition-colors hover:bg-accent",c),e[2]=c,e[3]=r):r=e[3];let m;e[4]!==l?(m=l("home.orgHome.connectPill"),e[4]=l,e[5]=m):m=e[5];let d;e[6]!==m?(d=o.jsx("span",{className:"font-medium text-foreground",children:m}),e[6]=m,e[7]=d):d=e[7];let f;e[8]!==s?(f=ee.map(j=>{const{name:v,Icon:z,size:_,bg:S,fg:$}=j;return o.jsx("span",{title:v,className:K("flex items-center justify-center rounded-full",s?"size-5":"size-6"),style:{backgroundColor:S,color:$},children:o.jsx(z,{size:s?_[0]:_[1]})},v)}),e[8]=s,e[9]=f):f=e[9];let u;e[10]!==f?(u=o.jsx("span",{"aria-hidden":"true",className:"flex items-center gap-1",children:f}),e[10]=f,e[11]=u):u=e[11];const x=s?"size-3":"size-3.5";let p;e[12]!==x?(p=K(x,"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"),e[12]=x,e[13]=p):p=e[13];let g;e[14]!==p?(g=o.jsx(Z,{className:p}),e[14]=p,e[15]=g):g=e[15];let h;return e[16]!==g||e[17]!==i||e[18]!==r||e[19]!==d||e[20]!==u?(h=o.jsxs(P,{to:"/$org/settings/connect",params:i,onClick:Oe,className:r,children:[d,u,g]}),e[16]=g,e[17]=i,e[18]=r,e[19]=d,e[20]=u,e[21]=h):h=e[21],h}function Oe(){return V("connect_clients_opened",{source:"org_home"})}function yt(){const t=A.c(13),e=B(),{org:a}=q(),{granted:s}=ne("api-keys:manage");let l;t[0]!==s?(l={enabled:s},t[0]=s,t[1]=l):l=t[1];const{data:n}=xe(l);if(s&&!n||n?.some(Fe))return null;let i;t[2]!==a.slug?(i={org:a.slug},t[2]=a.slug,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("span",{"aria-hidden":"true",className:"flex items-center gap-1",children:ee.map(Ye)}),t[4]=c):c=t[4];let r;t[5]!==e?(r=e("home.orgHome.connectPill"),t[5]=e,t[6]=r):r=t[6];let m;t[7]!==r?(m=o.jsx("span",{className:"font-medium text-foreground",children:r}),t[7]=r,t[8]=m):m=t[8];let d;t[9]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Z,{className:"ml-auto size-3.5 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),t[9]=d):d=t[9];let f;return t[10]!==i||t[11]!==m?(f=o.jsxs(P,{to:"/$org/settings/connect",params:i,onClick:Pe,className:"group hidden items-center gap-3 rounded-xl bg-card px-4 py-2.5 text-sm shadow-edge transition-colors hover:bg-accent md:flex",children:[c,m,d]}),t[10]=i,t[11]=m,t[12]=f):f=t[12],f}function Ye(t){const{name:e,Icon:a,size:s,bg:l,fg:n}=t;return o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full",style:{backgroundColor:l,color:n},children:o.jsx(a,{size:s[0]})},e)}function Pe(){return V("connect_clients_opened",{source:"org_home"})}function Fe(t){return t.name.startsWith(ue)}function Nt(){const t=A.c(3),{locator:e}=q(),a=oe();pe();let s;t[0]!==e||t[1]!==a?(s=ge(e,a),t[0]=e,t[1]=a,t[2]=s):s=t[2];const{data:l}=re(s);return l.items}function _t(t){const e=A.c(16),{recent:a,orgSlug:s}=t,l=B();let n,i,c,r;if(e[0]!==s||e[1]!==a||e[2]!==l){r=Symbol.for("react.early_return_sentinel");e:{let d;e[7]!==s||e[8]!==l?(d=u=>{const x={org:s,agentId:u.projectId};if(u.connection){const{label:g,icon:h,id:j,toolName:v}=u.connection;return[{key:`${j}:${v}:${u.projectId}`,label:g,project:u.projectTitle,link:{to:le.app,params:{...x,connectionId:j,toolName:v}},glyph:o.jsx(ke,{icon:h,name:g,size:"md",className:X})}]}const p=Ce[u.app];return p?[{key:`${u.app}:${u.projectId}`,label:l(p.labelKey),project:u.projectTitle,link:{to:p.to,params:x},glyph:o.jsx("span",{className:K(X,"flex items-center",p.tone),children:o.jsx(p.Icon,{size:24})})}]:[]},e[7]=s,e[8]=l,e[9]=d):d=e[9];const f=a.slice(0,8).flatMap(d);if(f.length===0){r=null;break e}n=Ie,e[10]!==l?(i=l("home.overview.recentApps"),e[10]=l,e[11]=i):i=e[11],c=f.map(Ue)}e[0]=s,e[1]=a,e[2]=l,e[3]=n,e[4]=i,e[5]=c,e[6]=r}else n=e[3],i=e[4],c=e[5],r=e[6];if(r!==Symbol.for("react.early_return_sentinel"))return r;let m;return e[12]!==n||e[13]!==i||e[14]!==c?(m=o.jsx(n,{title:i,children:c}),e[12]=n,e[13]=i,e[14]=c,e[15]=m):m=e[15],m}function Ue(t){return o.jsxs(P,{to:t.link.to,params:t.link.params,className:"group flex shrink-0 flex-col items-center gap-2.5 rounded-xl p-3 text-center transition-[background-color,transform] duration-150 ease-out hover:bg-accent active:scale-[0.97]",children:[t.glyph,o.jsxs("span",{className:"flex w-full min-w-0 flex-col",children:[o.jsx("span",{className:"line-clamp-2 text-xs font-medium break-words text-foreground",children:t.label}),o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.project})]})]},t.key)}function He(t,e){return{to:ie.tasks,params:{org:t,taskKey:ze(t,e)}}}const Qe={answer:{Icon:ve,tone:"text-warning",reasonKey:"home.needsYou.reasonAnswer"},failed:{Icon:he,tone:"text-destructive",reasonKey:"home.overview.reasonFailed"},review:{Icon:je,tone:"text-warning",reasonKey:"home.needsYou.reasonReview"},running:{Icon:Q,tone:"text-muted-foreground",reasonKey:"home.overview.reasonRunning"},assigned:{Icon:Q,tone:"text-muted-foreground",reasonKey:"home.needsYou.reasonAssigned"}},J=["answer","failed","review","running","assigned"];function qe(t,e){const a=new Set,s=[],l=(n,i)=>{a.has(n.id)||(a.add(n.id),s.push({task:n,kind:i}))};for(const n of t)l(n,Re(n));for(const n of e){if(n.status==="done"||n.status==="archived")continue;const i=Te(n);i==="failed"?l(n,"failed"):i==="running"&&l(n,"running")}return s.sort((n,i)=>J.indexOf(n.kind)-J.indexOf(i.kind))}function Xe(t,e){const a=new Map;for(const r of e){if(r.action!=="mentioned"&&r.action!=="commented")continue;const m=a.get(r.taskBoardItemId);(!m||m.action!=="mentioned"&&r.action==="mentioned")&&a.set(r.taskBoardItemId,r)}const s=new Set(t.map(r=>r.task.id)),l=[...a.values()].filter(r=>!s.has(r.taskBoardItemId)).map(r=>({kind:"mention",task:null,mention:r})),n=t.map(({task:r,kind:m})=>({kind:m,task:r,mention:a.get(r.id)??null})),i=n.filter(r=>r.kind==="answer"),c=n.filter(r=>r.kind!=="answer");return[...i,...l,...c]}const Ge=7;function W(t){const e=A.c(6),{mention:a}=t,s=B();let l;e[0]!==a.actorName||e[1]!==s?(l=a.actorName??s("home.overview.someone"),e[0]=a.actorName,e[1]=s,e[2]=l):l=e[2];const n=l,i=a.actorImage??void 0;let c;return e[3]!==n||e[4]!==i?(c=o.jsx(ce,{url:i,fallback:n,shape:"circle",size:"2xs"}),e[3]=n,e[4]=i,e[5]=c):c=e[5],c}function Je(t,e){const a=t.actorName??e("home.overview.someone");return e(t.action==="mentioned"?"home.overview.mentioned":"home.overview.commented",{actor:a})}function St(t){const e=A.c(12),{waiting:a,tasks:s,mentions:l,index:n,orgSlug:i}=t,c=B();let r;if(e[0]!==n||e[1]!==l||e[2]!==i||e[3]!==c||e[4]!==s||e[5]!==a){const m=Xe(qe(a,s),l);let d;e[7]!==c?(d=c("home.overview.forYou"),e[7]=c,e[8]=d):d=e[8];const f=m.length>0&&o.jsx("span",{className:"text-muted-foreground tabular-nums",children:m.length});let u;e[9]!==d||e[10]!==f?(u=o.jsxs("h2",{className:"flex items-center gap-2 px-2 pt-1 pb-1 text-sm font-medium text-foreground",children:[d,f]}),e[9]=d,e[10]=f,e[11]=u):u=e[11],r=o.jsxs("section",{className:"flex flex-col gap-2 surface p-3",children:[u,m.length===0?o.jsxs("div",{className:"flex flex-col items-center gap-3 px-2 py-10 text-center",children:[o.jsx("span",{className:"flex size-10 items-center justify-center rounded-full bg-success/10 text-success",children:o.jsx(Q,{size:20})}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:c("home.overview.allClearTitle")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:c("home.overview.allClearDescription")})]})]}):o.jsx("div",{className:"flex flex-col",children:m.slice(0,Ge).map(x=>{const p=x.kind==="mention"?{id:x.mention.taskBoardItemId,keySeq:x.mention.taskKeySeq,title:x.mention.taskTitle}:x.task,g=x.task?$e(x.task,n):null,h=x.kind==="mention"?null:Qe[x.kind],j=x.mention?Je(x.mention,c):h?c(h.reasonKey):"";return o.jsxs(P,{...He(i,p),className:"group flex h-10 items-center gap-3 rounded-lg px-2 transition-colors hover:bg-accent",children:[o.jsx("span",{"aria-hidden":"true",className:K("flex size-4 shrink-0 items-center justify-center",h?.tone),children:x.kind==="mention"?o.jsx(W,{mention:x.mention}):x.kind==="running"?o.jsx(ae,{className:"size-3.5"}):h?o.jsx(h.Icon,{size:16}):null}),o.jsx("span",{className:"min-w-0 truncate text-sm text-foreground",children:p.title}),o.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-sm text-muted-foreground",children:[x.kind!=="mention"&&x.mention&&o.jsx("span",{"aria-hidden":"true",children:o.jsx(W,{mention:x.mention})}),o.jsx("span",{className:"truncate",children:j})]}),g&&o.jsxs("span",{className:"hidden max-w-48 shrink-0 items-center gap-1.5 text-xs text-muted-foreground md:flex",children:[o.jsx(Se,{icon:g.icon,name:g.title}),o.jsx("span",{className:"truncate",children:g.title})]})]},p.id)})})]}),e[0]=n,e[1]=l,e[2]=i,e[3]=c,e[4]=s,e[5]=a,e[6]=r}else r=e[6];return r}function We(t){if(t<=0)return 1;const e=10**Math.floor(Math.log10(t));for(const a of[1,2,2.5,5,10])if(a*e>=t)return a*e;return 10*e}const Ve=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function U(t){const e=A.c(52),{series:a,start:s,format:l,label:n,averageLabel:i}=t,c=We(Math.max(...a,0));let r;e[0]!==a?(r=a.length===0?0:a.reduce(et,0)/a.length,e[0]=a,e[1]=r):r=e[1];const m=r;let d;if(e[2]!==a||e[3]!==s){let E;e[5]!==s?(E=(te,se)=>({day:Ve.format(new Date(s.getTime()+se*864e5)),value:te}),e[5]=s,e[6]=E):E=e[6],d=a.map(E),e[2]=a,e[3]=s,e[4]=d}else d=e[4];const f=d,u=Math.max(f.length-1,0),x=f[0]?.day;let p;e[7]!==u||e[8]!==f?(p=f[Math.round(u/2)]?.day,e[7]=u,e[8]=f,e[9]=p):p=e[9];const g=f[u]?.day;let h;e[10]!==x||e[11]!==p||e[12]!==g?(h=[x,p,g].filter(Ze),e[10]=x,e[11]=p,e[12]=g,e[13]=h):h=e[13];const j=h;let v;e[14]!==n?(v={value:{label:n,color:"var(--chart-1)"}},e[14]=n,e[15]=v):v=e[15];const z=v;let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_={top:8,right:0,bottom:0,left:0},e[16]=_):_=e[16];let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(Le,{vertical:!1,strokeDasharray:"4 4",stroke:"var(--border)"}),e[17]=S):S=e[17];let $,R;e[18]===Symbol.for("react.memo_cache_sentinel")?($={stroke:"var(--border)"},R={fontSize:12,fill:"var(--muted-foreground)"},e[18]=$,e[19]=R):($=e[18],R=e[19]);let b;e[20]!==j?(b=o.jsx(Be,{dataKey:"day",ticks:j,interval:"preserveStartEnd",tickLine:!1,axisLine:$,tick:R,tickMargin:8}),e[20]=j,e[21]=b):b=e[21];let I;e[22]!==c?(I=[0,c],e[22]=c,e[23]=I):I=e[23];const T=c/2;let w;e[24]!==c||e[25]!==T?(w=[0,T,c],e[24]=c,e[25]=T,e[26]=w):w=e[26];let y;e[27]!==l?(y=E=>E===0?"0":l(E),e[27]=l,e[28]=y):y=e[28];let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M={fontSize:12,fill:"var(--muted-foreground)"},e[29]=M):M=e[29];let N;e[30]!==I||e[31]!==w||e[32]!==y?(N=o.jsx(Ke,{orientation:"right",domain:I,ticks:w,tickFormatter:y,tickLine:!1,axisLine:!1,tick:M,width:44}),e[30]=I,e[31]=w,e[32]=y,e[33]=N):N=e[33];let C;e[34]===Symbol.for("react.memo_cache_sentinel")?(C={fill:"var(--muted)",opacity:.6},e[34]=C):C=e[34];let k;e[35]!==l||e[36]!==n?(k=o.jsx(be,{cursor:C,content:o.jsx(we,{indicator:"line",formatter:E=>o.jsxs("div",{className:"flex flex-1 items-center justify-between gap-3 leading-none",children:[o.jsx("span",{className:"text-muted-foreground",children:n}),o.jsx("span",{className:"font-medium text-foreground tabular-nums",children:l(Number(E))})]})})}),e[35]=l,e[36]=n,e[37]=k):k=e[37];let D;e[38]!==m||e[39]!==i||e[40]!==l?(D=m>0&&o.jsx(De,{y:m,stroke:"var(--foreground)",strokeOpacity:.6,strokeDasharray:"2 2",label:{value:i(l(m)),position:"insideBottomLeft",fontSize:12,fill:"var(--foreground)"}}),e[38]=m,e[39]=i,e[40]=l,e[41]=D):D=e[41];let O;e[42]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx(ye,{dataKey:"value",fill:"var(--color-value)",radius:[2,2,0,0],maxBarSize:4,animationDuration:300}),e[42]=O):O=e[42];let L;e[43]!==f||e[44]!==b||e[45]!==N||e[46]!==k||e[47]!==D?(L=o.jsxs(Ne,{data:f,margin:_,barCategoryGap:"30%",children:[S,b,N,k,D,O]}),e[43]=f,e[44]=b,e[45]=N,e[46]=k,e[47]=D,e[48]=L):L=e[48];let Y;return e[49]!==z||e[50]!==L?(Y=o.jsx(_e,{config:z,className:"aspect-auto h-[159px] w-full",children:L}),e[49]=z,e[50]=L,e[51]=Y):Y=e[51],Y}function Ze(t){return!!t}function et(t,e){return t+e}function H(t){const e=A.c(10),{label:a,value:s,chart:l}=t;let n;e[0]!==a?(n=o.jsx("span",{className:"text-sm font-medium text-foreground",children:a}),e[0]=a,e[1]=n):n=e[1];let i;e[2]!==s?(i=o.jsx("span",{className:"text-[32px] leading-none font-medium tracking-tight tabular-nums text-foreground",children:s}),e[2]=s,e[3]=i):i=e[3];let c;e[4]!==n||e[5]!==i?(c=o.jsxs("div",{className:"flex flex-col gap-2.5",children:[n,i]}),e[4]=n,e[5]=i,e[6]=c):c=e[6];let r;return e[7]!==l||e[8]!==c?(r=o.jsxs("section",{className:"flex flex-col gap-6 surface p-5",children:[c,l]}),e[7]=l,e[8]=c,e[9]=r):r=e[9],r}function Ct(t){const e=A.c(58),{tasks:a}=t,s=B();let l,n,i,c,r,m,d,f,u;if(e[0]!==s||e[1]!==a){const j=Ee(a,F),v=Ae(a,F);i=Me(a);const z=st;let _,S;if(e[11]===Symbol.for("react.memo_cache_sentinel")){const k=new Date;S=new Date(k.getFullYear(),k.getMonth(),k.getDate()-(F-1)),_=new Date(k.getFullYear(),k.getMonth(),1),e[11]=_,e[12]=S}else _=e[11],S=e[12];c=_;const $=tt;let R;e[13]!==s?(R=k=>s("home.overview.average",{value:k}),e[13]=s,e[14]=R):R=e[14],n=R,d="grid gap-4 md:grid-cols-3";let b;e[15]!==s?(b=s("home.overview.delivered"),e[15]=s,e[16]=b):b=e[16];const I=String(z(j));let T;e[17]!==s?(T=s("home.overview.delivered"),e[17]=s,e[18]=T):T=e[18];let w;e[19]!==n||e[20]!==j||e[21]!==T?(w=o.jsx(U,{label:T,series:j,start:S,format:$,averageLabel:n}),e[19]=n,e[20]=j,e[21]=T,e[22]=w):w=e[22],e[23]!==w||e[24]!==b||e[25]!==I?(f=o.jsx(H,{label:b,value:I,chart:w}),e[23]=w,e[24]=b,e[25]=I,e[26]=f):f=e[26];let y;e[27]!==s?(y=s("home.overview.agentRuns"),e[27]=s,e[28]=y):y=e[28];const M=String(z(v));let N;e[29]!==s?(N=s("home.overview.agentRuns"),e[29]=s,e[30]=N):N=e[30];let C;e[31]!==n||e[32]!==v||e[33]!==N?(C=o.jsx(U,{label:N,series:v,start:S,format:$,averageLabel:n}),e[31]=n,e[32]=v,e[33]=N,e[34]=C):C=e[34],e[35]!==y||e[36]!==M||e[37]!==C?(u=o.jsx(H,{label:y,value:M,chart:C}),e[35]=y,e[36]=M,e[37]=C,e[38]=u):u=e[38],l=H,e[39]!==s?(r=s("home.overview.agentCost"),e[39]=s,e[40]=r):r=e[40],m=G(z(i)),e[0]=s,e[1]=a,e[2]=l,e[3]=n,e[4]=i,e[5]=c,e[6]=r,e[7]=m,e[8]=d,e[9]=f,e[10]=u}else l=e[2],n=e[3],i=e[4],c=e[5],r=e[6],m=e[7],d=e[8],f=e[9],u=e[10];let x;e[41]!==s?(x=s("home.overview.agentCost"),e[41]=s,e[42]=x):x=e[42];let p;e[43]!==n||e[44]!==i||e[45]!==c||e[46]!==x?(p=o.jsx(U,{label:x,series:i,start:c,format:G,averageLabel:n}),e[43]=n,e[44]=i,e[45]=c,e[46]=x,e[47]=p):p=e[47];let g;e[48]!==l||e[49]!==r||e[50]!==m||e[51]!==p?(g=o.jsx(l,{label:r,value:m,chart:p}),e[48]=l,e[49]=r,e[50]=m,e[51]=p,e[52]=g):g=e[52];let h;return e[53]!==d||e[54]!==f||e[55]!==u||e[56]!==g?(h=o.jsxs("div",{className:d,children:[f,u,g]}),e[53]=d,e[54]=f,e[55]=u,e[56]=g,e[57]=h):h=e[57],h}function tt(t){return String(Math.round(t*10)/10)}function st(t){return t.reduce(nt,0)}function nt(t,e){return t+e}export{yt as C,St as F,Ct as M,_t as R,wt as a,Nt as u};
@@ -1 +1 @@
1
- import{fX as q,eA as B,fY as Y,c as J,r as U,fN as N,fO as M,fT as K,fP as P,K as F,fQ as X,fS as z,fR as G,fL as R}from"./index-DjOrtNe_.js";import{ax as Z,au as x,aF as ee,av as te,aw as C,aJ as ne,ay as re,aA as se}from"./site-editor-toast-1oASJn2v.js";import{a5 as V,ak as oe,a8 as ie,a4 as ae}from"./blocks-tab-states-hhmWy_1Z.js";async function ce(e,t){return e.inDraft?e.value===void 0?B:Y(e.value):await q(null,e.value,t)??null}class Ce{constructor(t){this.now=t,this.loaded=t()}now;copies=new Map;generations=new Map;loaded;settle(){this.loaded||(this.loaded=this.now())}get(t){const n=this.copies.get(t);if(n)return n;if(this.loaded)return{value:this.loaded.blocks[t],inDraft:this.loaded.versionOf(t)!==null}}generation(t){return this.generations.get(t)??0}edited(t){return{generation:this.generation(t),copy:this.get(t)}}guardOf(t,n){return n&&n.generation!==this.generation(t)?n.copy:this.get(t)}hold(t){this.generations.set(t,this.generation(t)+1);const n=this.now();!n||!Object.hasOwn(n.blocks,t)||this.copies.set(t,{value:n.blocks[t],inDraft:n.versionOf(t)!==null})}saved(t,n){this.copies.set(t,{value:n,inDraft:!0})}}const g=new Map,k=new Set,E=new Map;function ke(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Ee(e,t){const n=new Map(g.get(e)??E);n.set(t,(n.get(t)??0)+1),g.set(e,n);for(const s of k)s()}function le(e){return k.add(e),()=>k.delete(e)}const A=new WeakMap;function fe(e){let t=A.get(e);return t||(t=n=>e.get(n)??0,A.set(e,t)),t}function De(e){const t=J.c(5);let n,s;t[0]!==e?(n=()=>g.get(e)??E,s=()=>g.get(e)??E,t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);const r=U.useSyncExternalStore(le,n,s);let o;return t[3]!==r?(o=fe(r),t[3]=r,t[4]=o):o=t[4],o}class p extends Error{constructor(t){super("kept their version"),this.deleted=t,this.name="HostedKeptTheirsError"}deleted}const ue=3;function de(e,t,n,s){const r={},o={},i={};for(const a of e)t&&Object.hasOwn(t,a)&&(r[a]=t[a]),Object.hasOwn(n.writes,a)&&(o[a]=n.writes[a]),Object.hasOwn(s,a)&&(i[a]=s[a]);return X({ancestor:r,mine:o,theirs:i})}function he(e,t,n){const s={},r=[];for(const o of e){const i=t[o];_(i)?s[o]=i:Object.hasOwn(n,o)&&r.push(o)}return{writes:s,deletes:r}}function we(e,t){for(const[n,s]of Object.entries(e.writes))if(!Object.hasOwn(t,n)||R(t[n])!==R(s))return!1;return e.deletes.every(n=>!Object.hasOwn(t,n))}function Oe(e,t){if(!_(t))return null;if(V(e,t))return oe(t);const n=typeof t.name=="string"?t.name.trim():"";return n&&n!==e?n:I(e)}function I(e){const t=V(e);if(t)return ie(t);const n=e.split("/").pop()??e;return ae(n).trim()||n}function L(e,...t){for(const n of t){const s=Oe(e,n);if(s)return s}return I(e)}function H(e,t,n){return Object.keys(e.writes).some(r=>!t||!Object.hasOwn(t,r))?e.deletes.filter(r=>!Object.hasOwn(e.writes,r)&&n(r)):[]}async function T(e,t,n){const s=Object.keys(e.writes).filter(i=>!t||!Object.hasOwn(t,i)).map(i=>e.writes[i]),r=n[0];if(await P({kind:"theyDeleted",label:L(r,t?.[r],...s)})==="theirs")throw new p(!0);return{writes:e.writes,deletes:e.deletes.filter(i=>!n.includes(i))}}function Q(e){if(e.pointers.length!==1)return null;const t=e.pointers[0],n=t.split("/");if(n.length!==2)return null;const s=n[1].replaceAll("~1","/").replaceAll("~0","~"),r=e.mine[s],o=e.theirs[s];return r===void 0==(o===void 0)?null:{pointer:t,conflict:{kind:o===void 0?"theyDeleted":"youDeleted",label:L(s,r,o,e.ancestor[s])}}}async function pe(e,t,n,s){const r=Q(e);if(r)return{[r.pointer]:await P(r.conflict)};const o=z(e,t);return G(e,s?o.map(s):o,n?.author?{...n,author:{...n.author,keyed:!0}}:n)}function Se(e){const t=e.split("/")[1];return t?t.replaceAll("~1","/").replaceAll("~0","~"):null}function ge(e){const t=Object.values(e);return t.length>0&&t.every(n=>n==="theirs")}async function ve(e,t,n){const s=o=>se(e.queryClient,e.cacheKey,o,e.backend);if(t.some(o=>s(o)===void 0))try{await te(e.queryClient,e.backend,e.params,e.cacheKey)}catch{throw new C}const r={};for(const o of t){const i=s(o);if(i===void 0)throw new C;const a=n&&Object.hasOwn(n,o)?await q(i,n[o],N(e.queryClient,e.cacheKey,o)):i;if(a===void 0)throw new C;r[o]=a}return r}async function me(e,t,n,s){if(s&&w(e,t,r=>Object.hasOwn(s,r)?{value:s[r]}:null),!ne(e.queryClient,e.backend,e.cacheKey,n))for(const r of t)await re(e.queryClient,e.backend,e.params,e.cacheKey,r,n);return e.queryClient.getQueryData(F.decofile(e.cacheKey))??{}}async function Me(e,t,n,s){let r=t;const o=s?Object.keys(s):[];let i=o.length===0?n:{...n,...Object.fromEntries(o.map(a=>[a,s[a].value]))};for(let a=0;;a++){const v=r.deletes.filter(l=>!Object.hasOwn(r.writes,l)),d=[...Object.keys(r.writes),...v],O=await ve(e,d,a===0?i:void 0);if(a===0)for(const l of o)Object.hasOwn(O,l)&&(O[l]=await ce(s[l],N(e.queryClient,e.cacheKey,l)));const m=H(r,i,l=>O[l]===B);if(m.length>0){try{if(!M())throw new p(!0);r=await T(r,i,m)}catch(l){throw w(e,d,c=>m.includes(c)||!i||!Object.hasOwn(i,c)?null:{value:i[c]}),l}continue}try{const l=await Z(e.queryClient,e.backend,e.params,e.cacheKey,{set:r.writes,...v.length>0?{delete:v}:{}},O);return w(e,d,c=>Object.hasOwn(r.writes,c)?{value:r.writes[c]}:null),{...l,change:r}}catch(l){if(!x(l))throw l;const c=await me(e,d,l,i);if(a+1>=ue)throw new ee;if(!M())throw l;const D=Object.keys(r.writes).filter(u=>!i||!Object.hasOwn(i,u)),$=r;w(e,D,u=>({value:$.writes[u]}));const S=()=>w(e,D,u=>Object.hasOwn(c,u)?{value:c[u]}:null);try{const u=H(r,i,f=>!!i&&Object.hasOwn(i,f)&&!Object.hasOwn(c,f));if(u.length>0){r=await T(r,i,u),i=Object.fromEntries(d.filter(f=>Object.hasOwn(c,f)).map(f=>[f,c[f]]));continue}const h=de(d,i,r,c),b=h.pointers.length===0?{}:await pe(h),y=Q(h);if(y&&b[y.pointer]==="theirs")throw new p(y.conflict.kind==="theyDeleted");const W=h.pointers.length===0?h.merged:K(h,b),j=he(d,W,c);if(we(j,c)){if(ge(b))throw new p(d.some(f=>!Object.hasOwn(c,f)));return S(),{revision:"",versions:{},change:j}}r=j,i=Object.fromEntries(d.filter(f=>Object.hasOwn(c,f)).map(f=>[f,c[f]]))}catch(u){throw S(),u}}}}function w(e,t,n){e.queryClient.setQueryData(F.decofile(e.cacheKey),s=>{if(!s)return s;const r={...s};for(const o of t){const i=n(o);i?r[o]=i.value:delete r[o]}return r})}function _(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}export{p as H,ve as a,Ee as b,ke as c,ue as d,L as e,ge as f,Ce as g,ce as h,Me as i,pe as j,Se as k,he as l,we as m,de as p,De as u};
1
+ import{fX as q,eA as B,fY as Y,c as J,r as U,fN as N,fO as M,fT as K,fP as P,K as F,fQ as X,fS as z,fR as G,fL as R}from"./index-j_yRx5Gd.js";import{ax as Z,au as x,aF as ee,av as te,aw as C,aJ as ne,ay as re,aA as se}from"./site-editor-toast-CQzulbYg.js";import{a5 as V,ak as oe,a8 as ie,a4 as ae}from"./blocks-tab-states-C4eMNdLC.js";async function ce(e,t){return e.inDraft?e.value===void 0?B:Y(e.value):await q(null,e.value,t)??null}class Ce{constructor(t){this.now=t,this.loaded=t()}now;copies=new Map;generations=new Map;loaded;settle(){this.loaded||(this.loaded=this.now())}get(t){const n=this.copies.get(t);if(n)return n;if(this.loaded)return{value:this.loaded.blocks[t],inDraft:this.loaded.versionOf(t)!==null}}generation(t){return this.generations.get(t)??0}edited(t){return{generation:this.generation(t),copy:this.get(t)}}guardOf(t,n){return n&&n.generation!==this.generation(t)?n.copy:this.get(t)}hold(t){this.generations.set(t,this.generation(t)+1);const n=this.now();!n||!Object.hasOwn(n.blocks,t)||this.copies.set(t,{value:n.blocks[t],inDraft:n.versionOf(t)!==null})}saved(t,n){this.copies.set(t,{value:n,inDraft:!0})}}const g=new Map,k=new Set,E=new Map;function ke(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Ee(e,t){const n=new Map(g.get(e)??E);n.set(t,(n.get(t)??0)+1),g.set(e,n);for(const s of k)s()}function le(e){return k.add(e),()=>k.delete(e)}const A=new WeakMap;function fe(e){let t=A.get(e);return t||(t=n=>e.get(n)??0,A.set(e,t)),t}function De(e){const t=J.c(5);let n,s;t[0]!==e?(n=()=>g.get(e)??E,s=()=>g.get(e)??E,t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);const r=U.useSyncExternalStore(le,n,s);let o;return t[3]!==r?(o=fe(r),t[3]=r,t[4]=o):o=t[4],o}class p extends Error{constructor(t){super("kept their version"),this.deleted=t,this.name="HostedKeptTheirsError"}deleted}const ue=3;function de(e,t,n,s){const r={},o={},i={};for(const a of e)t&&Object.hasOwn(t,a)&&(r[a]=t[a]),Object.hasOwn(n.writes,a)&&(o[a]=n.writes[a]),Object.hasOwn(s,a)&&(i[a]=s[a]);return X({ancestor:r,mine:o,theirs:i})}function he(e,t,n){const s={},r=[];for(const o of e){const i=t[o];_(i)?s[o]=i:Object.hasOwn(n,o)&&r.push(o)}return{writes:s,deletes:r}}function we(e,t){for(const[n,s]of Object.entries(e.writes))if(!Object.hasOwn(t,n)||R(t[n])!==R(s))return!1;return e.deletes.every(n=>!Object.hasOwn(t,n))}function Oe(e,t){if(!_(t))return null;if(V(e,t))return oe(t);const n=typeof t.name=="string"?t.name.trim():"";return n&&n!==e?n:I(e)}function I(e){const t=V(e);if(t)return ie(t);const n=e.split("/").pop()??e;return ae(n).trim()||n}function L(e,...t){for(const n of t){const s=Oe(e,n);if(s)return s}return I(e)}function H(e,t,n){return Object.keys(e.writes).some(r=>!t||!Object.hasOwn(t,r))?e.deletes.filter(r=>!Object.hasOwn(e.writes,r)&&n(r)):[]}async function T(e,t,n){const s=Object.keys(e.writes).filter(i=>!t||!Object.hasOwn(t,i)).map(i=>e.writes[i]),r=n[0];if(await P({kind:"theyDeleted",label:L(r,t?.[r],...s)})==="theirs")throw new p(!0);return{writes:e.writes,deletes:e.deletes.filter(i=>!n.includes(i))}}function Q(e){if(e.pointers.length!==1)return null;const t=e.pointers[0],n=t.split("/");if(n.length!==2)return null;const s=n[1].replaceAll("~1","/").replaceAll("~0","~"),r=e.mine[s],o=e.theirs[s];return r===void 0==(o===void 0)?null:{pointer:t,conflict:{kind:o===void 0?"theyDeleted":"youDeleted",label:L(s,r,o,e.ancestor[s])}}}async function pe(e,t,n,s){const r=Q(e);if(r)return{[r.pointer]:await P(r.conflict)};const o=z(e,t);return G(e,s?o.map(s):o,n?.author?{...n,author:{...n.author,keyed:!0}}:n)}function Se(e){const t=e.split("/")[1];return t?t.replaceAll("~1","/").replaceAll("~0","~"):null}function ge(e){const t=Object.values(e);return t.length>0&&t.every(n=>n==="theirs")}async function ve(e,t,n){const s=o=>se(e.queryClient,e.cacheKey,o,e.backend);if(t.some(o=>s(o)===void 0))try{await te(e.queryClient,e.backend,e.params,e.cacheKey)}catch{throw new C}const r={};for(const o of t){const i=s(o);if(i===void 0)throw new C;const a=n&&Object.hasOwn(n,o)?await q(i,n[o],N(e.queryClient,e.cacheKey,o)):i;if(a===void 0)throw new C;r[o]=a}return r}async function me(e,t,n,s){if(s&&w(e,t,r=>Object.hasOwn(s,r)?{value:s[r]}:null),!ne(e.queryClient,e.backend,e.cacheKey,n))for(const r of t)await re(e.queryClient,e.backend,e.params,e.cacheKey,r,n);return e.queryClient.getQueryData(F.decofile(e.cacheKey))??{}}async function Me(e,t,n,s){let r=t;const o=s?Object.keys(s):[];let i=o.length===0?n:{...n,...Object.fromEntries(o.map(a=>[a,s[a].value]))};for(let a=0;;a++){const v=r.deletes.filter(l=>!Object.hasOwn(r.writes,l)),d=[...Object.keys(r.writes),...v],O=await ve(e,d,a===0?i:void 0);if(a===0)for(const l of o)Object.hasOwn(O,l)&&(O[l]=await ce(s[l],N(e.queryClient,e.cacheKey,l)));const m=H(r,i,l=>O[l]===B);if(m.length>0){try{if(!M())throw new p(!0);r=await T(r,i,m)}catch(l){throw w(e,d,c=>m.includes(c)||!i||!Object.hasOwn(i,c)?null:{value:i[c]}),l}continue}try{const l=await Z(e.queryClient,e.backend,e.params,e.cacheKey,{set:r.writes,...v.length>0?{delete:v}:{}},O);return w(e,d,c=>Object.hasOwn(r.writes,c)?{value:r.writes[c]}:null),{...l,change:r}}catch(l){if(!x(l))throw l;const c=await me(e,d,l,i);if(a+1>=ue)throw new ee;if(!M())throw l;const D=Object.keys(r.writes).filter(u=>!i||!Object.hasOwn(i,u)),$=r;w(e,D,u=>({value:$.writes[u]}));const S=()=>w(e,D,u=>Object.hasOwn(c,u)?{value:c[u]}:null);try{const u=H(r,i,f=>!!i&&Object.hasOwn(i,f)&&!Object.hasOwn(c,f));if(u.length>0){r=await T(r,i,u),i=Object.fromEntries(d.filter(f=>Object.hasOwn(c,f)).map(f=>[f,c[f]]));continue}const h=de(d,i,r,c),b=h.pointers.length===0?{}:await pe(h),y=Q(h);if(y&&b[y.pointer]==="theirs")throw new p(y.conflict.kind==="theyDeleted");const W=h.pointers.length===0?h.merged:K(h,b),j=he(d,W,c);if(we(j,c)){if(ge(b))throw new p(d.some(f=>!Object.hasOwn(c,f)));return S(),{revision:"",versions:{},change:j}}r=j,i=Object.fromEntries(d.filter(f=>Object.hasOwn(c,f)).map(f=>[f,c[f]]))}catch(u){throw S(),u}}}}function w(e,t,n){e.queryClient.setQueryData(F.decofile(e.cacheKey),s=>{if(!s)return s;const r={...s};for(const o of t){const i=n(o);i?r[o]=i.value:delete r[o]}return r})}function _(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}export{p as H,ve as a,Ee as b,ke as c,ue as d,L as e,ge as f,Ce as g,ce as h,Me as i,pe as j,Se as k,he as l,we as m,de as p,De as u};
@@ -1 +1 @@
1
- import{c as f,j as p,B as h}from"./index-DjOrtNe_.js";import{T as j,a as v,c as T}from"./tooltip-DepzWntQ.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
1
+ import{c as f,j as p,B as h}from"./index-j_yRx5Gd.js";import{T as j,a as v,c as T}from"./tooltip-FWYqBBwo.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
@@ -1 +1 @@
1
- import{r as n,c3 as q,dX as R,dY as Ee,dZ as ke,d_ as Se,aS as xe,d$ as j}from"./index-DjOrtNe_.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")Y(),W(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{Y(),W(),r.current.value||X(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{Y(),s?.getAttribute("id")===e&&X(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function X(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function Y(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function G(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function J(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):J(e)}let ie=()=>G(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):J(1)},ce=e=>{e.preventDefault(),e.metaKey?G(0):e.altKey?ue(-1):J(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),G(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Ye},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Je=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Xe(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Xe(l),{ref:l.ref},r(l.props.children)):r(l)}var Ye={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Je as _};
1
+ import{r as n,c3 as q,dX as R,dY as Ee,dZ as ke,d_ as Se,aS as xe,d$ as j}from"./index-j_yRx5Gd.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")Y(),W(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{Y(),W(),r.current.value||X(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{Y(),s?.getAttribute("id")===e&&X(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function X(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function Y(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function G(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function J(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):J(e)}let ie=()=>G(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):J(1)},ce=e=>{e.preventDefault(),e.metaKey?G(0):e.altKey?ue(-1):J(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),G(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Ye},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Je=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Xe(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Xe(l),{ref:l.ref},r(l.props.children)):r(l)}var Ye={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Je as _};
@@ -1,4 +1,4 @@
1
- import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-C7oMqzbx.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?`![${i}](${c} "${a}")`:`![${i}](${c})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
1
+ import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-DfMCfXyw.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?`![${i}](${c} "${a}")`:`![${i}](${c})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
2
2
  `).map(t=>!t.includes("|")||!t.includes("`")?t:ln(t)).join(`
3
3
  `)}function sn(e){return(e||"").replace(/\s+/g," ").trim()}function cn(e,t,n={}){var o;const l=(o=n.cellLineSeparator)!==null&&o!==void 0?o:"";if(!e||!e.content||e.content.length===0)return"";const r=[];e.content.forEach(h=>{const g=[];h.content&&h.content.forEach(m=>{let w="";m.content&&Array.isArray(m.content)&&m.content.length>1?w=m.content.map(R=>t.renderChildren(R)).join(l):w=m.content?t.renderChildren(m.content):"";const S=sn(w.split(l).join(`
4
4
  `).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",A=qt(m.attrs);g.push({text:S,isHeader:y,align:A})}),r.push(g)});const s=r.reduce((h,g)=>Math.max(h,g.length),0);if(s===0)return"";const c=Array.from({length:s}).fill(0);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;const w=(((g=h[m])===null||g===void 0?void 0:g.text)||"").length;w>c[m]&&(c[m]=w),c[m]<3&&(c[m]=3)}});const i=(h,g)=>h+" ".repeat(Math.max(0,g-h.length)),a=r[0],d=a.some(h=>h.isHeader),u=Array.from({length:s}).fill(null);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=h[m])===null||g===void 0)&&g.align)&&(u[m]=h[m].align)}});let f=`