decocms 4.584.3 → 4.584.5

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 (429) hide show
  1. package/dist/client/assets/{AlertCircle-CskIH_fW.js → AlertCircle-mj0sz0gj.js} +1 -1
  2. package/dist/client/assets/{AreaChart-TNwx8Yro.js → AreaChart-DSUaBnyJ.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-C5BB_E0S.js → ArrowLeft--TSM2Ux3.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DIxkFfbJ.js → ArrowRight-BVFSrvKf.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C6CxODIg.js → ArrowUp-D2bbOB2w.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-DsqzJN02.js → BookOpen01-CTUEdBiB.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-D4yzutPM.js → CartesianChart-DynFqoj3.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CU64V2HR.js → CategoricalChart-_BlSk5IS.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-Qojp4H9f.js → CheckCircle-BsBF4S8u.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-izQyrZHF.js → ChevronDown-CNlehUMA.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-CQi5paCV.js → ChevronSelectorVertical-BdBrg7yc.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-B-5-9hXJ.js → ChevronUp-BIaMfxq-.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-B2dONSLn.js → CreditCard01-gHUc2u28.js} +1 -1
  14. package/dist/client/assets/{Eye-wZ1k-Snw.js → Eye-Xo5rS9iJ.js} +1 -1
  15. package/dist/client/assets/{File02-DbXQkzJR.js → File02-uZRQiPOp.js} +1 -1
  16. package/dist/client/assets/{Globe04-we1am6C9.js → Globe04-DhsnPBDD.js} +1 -1
  17. package/dist/client/assets/{Image01-DLFC70j_.js → Image01-C5Xqhwp5.js} +1 -1
  18. package/dist/client/assets/{Key01-DR1WEokD.js → Key01-h9Y3uaT_.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CotbVucz.js → LayoutLeft-CPMSR00X.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-D3Zxp-Rk.js → LinkBroken01-CxV1rDqL.js} +1 -1
  21. package/dist/client/assets/{Minimize01-BlpbOmPN.js → Minimize01-BIynG3Ze.js} +1 -1
  22. package/dist/client/assets/{Minus-DeaTdWpF.js → Minus-D55MDhYc.js} +1 -1
  23. package/dist/client/assets/{Monitor01-W3mg9TWb.js → Monitor01-CBUOgSaC.js} +1 -1
  24. package/dist/client/assets/{Play-BIK7xiGY.js → Play-zsnTCnBK.js} +1 -1
  25. package/dist/client/assets/{Plus-D393VgSW.js → Plus-DAYIm6ow.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-CW0plYOb.js → ReferenceLine-Ccilwreq.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BrITMGt7.js → SearchMd-CTSUPag9.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-BzFnFHva.js → ShoppingBag01-CF4EYiC_.js} +1 -1
  29. package/dist/client/assets/{Sun-DensIvnG.js → Sun-B-xu6eHR.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Kti3AXOg.js → SwitchHorizontal01-qTGCOGX6.js} +1 -1
  31. package/dist/client/assets/{Tool01-BvaBONyM.js → Tool01-Bscrvuft.js} +1 -1
  32. package/dist/client/assets/{Tooltip-D0fKs0aB.js → Tooltip-EHWPdrLL.js} +1 -1
  33. package/dist/client/assets/{Trash01-BytHt_aS.js → Trash01-CevYpZEM.js} +1 -1
  34. package/dist/client/assets/{TrendUp01-Clw0UTvC.js → TrendUp01-DMf7H3tv.js} +1 -1
  35. package/dist/client/assets/{Upload01-Lx08Zck6.js → Upload01-C_8HEOMT.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-CNvIr_Bs.js → UserCheck01-4mEtfdkD.js} +1 -1
  37. package/dist/client/assets/{UserSquare-Bt9swQBx.js → UserSquare-oo1b4ulW.js} +1 -1
  38. package/dist/client/assets/{Users01-B9wah-LU.js → Users01-av_p4B03.js} +1 -1
  39. package/dist/client/assets/{XClose-GLz4aiio.js → XClose-WYCPZpkD.js} +1 -1
  40. package/dist/client/assets/{Zap-0CAagMpp.js → Zap-C-VVHO-P.js} +1 -1
  41. package/dist/client/assets/{access-gate-BtTxXcQp.js → access-gate-CBj6VxJ7.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-BY8lCHnH.js → add-connection-dialog-CVC64Gmd.js} +1 -1
  43. package/dist/client/assets/agent-app-Ba7JDwY6.js +1 -0
  44. package/dist/client/assets/{agent-assets-D8Py45Uz.js → agent-assets-DlGJDJr0.js} +1 -1
  45. package/dist/client/assets/{agent-automation-DljhJDBg.js → agent-automation-e9KFVJPg.js} +1 -1
  46. package/dist/client/assets/{agent-automations-DOS8FoiU.js → agent-automations-DHP9-Rvp.js} +1 -1
  47. package/dist/client/assets/{agent-blog-99wHBLkt.js → agent-blog-MchyO8b5.js} +2 -2
  48. package/dist/client/assets/{agent-blog-post-OytTPVN1.js → agent-blog-post-DUN7iPWt.js} +2 -2
  49. package/dist/client/assets/{agent-calendar-Cl55AuTg.js → agent-calendar-De-Im46e.js} +1 -1
  50. package/dist/client/assets/{agent-capabilities-C3VQ3u0A.js → agent-capabilities-DEMFK1PG.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-DdhP4OAl.js → agent-connect-sources-DkfqQk5b.js} +1 -1
  52. package/dist/client/assets/agent-deck-Cx2e4txV.js +1 -0
  53. package/dist/client/assets/{agent-e2e-CG35I5uK.js → agent-e2e-cuAg7vvT.js} +1 -1
  54. package/dist/client/assets/agent-experiments-CKleoVAf.js +1 -0
  55. package/dist/client/assets/agent-file-BrkmoibI.js +1 -0
  56. package/dist/client/assets/{agent-hosting-sbqKLsvS.js → agent-hosting-D__8hPs9.js} +1 -1
  57. package/dist/client/assets/{agent-icon-D5QYtdVU.js → agent-icon-Bq_Z7esB.js} +1 -1
  58. package/dist/client/assets/agent-library-BfblIp1v.js +1 -0
  59. package/dist/client/assets/agent-library-file-C7p2ZAks.js +1 -0
  60. package/dist/client/assets/agent-overview-NZBYrRRV.js +1 -0
  61. package/dist/client/assets/{agent-releases-CeKkBGv0.js → agent-releases-D4ESN3iT.js} +1 -1
  62. package/dist/client/assets/agent-settings-iY554avh.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-Cu4ODQP2.js → agent-site-editor-DBCTlamd.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-CaQ191md.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-4-gXvHBG.js +1 -0
  66. package/dist/client/assets/agent-site-editor-preview-BE075svj.js +1 -0
  67. package/dist/client/assets/agent-view-D12VaGvy.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-D1lO2vW8.js → agent-view-guard-BZTSZPH3.js} +1 -1
  69. package/dist/client/assets/{ai-providers-DQOj4mTY.js → ai-providers-Bd027SSh.js} +1 -1
  70. package/dist/client/assets/{alert-B1ykk3Se.js → alert-fpttYoSQ.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-Cz6R4Sr8.js → analytics-sections-BqryzJvo.js} +1 -1
  72. package/dist/client/assets/api-keys-CQkJKCWp.js +1 -0
  73. package/dist/client/assets/{api-keys-DIQICz5g.js → api-keys-DLlJejJF.js} +1 -1
  74. package/dist/client/assets/{app-editor-y0i4PDuA.js → app-editor-CPq25Dfa.js} +1 -1
  75. package/dist/client/assets/{asset-utils-BVsfeHMT.js → asset-utils-C_CFQkKi.js} +1 -1
  76. package/dist/client/assets/{auth-DqmRg67b.js → auth-BOZ5swZI.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-BWS6j8qC.js → auth-catchall-DXChUDcZ.js} +1 -1
  78. package/dist/client/assets/{auth-entry-DeuS0hmo.js → auth-entry-DMbaj7KI.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-Bv8njBJj.js → auth-split-layout-DNd6b-pH.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-3ervNAid.js → authenticate-and-persist-oauth-Cj46Ik0_.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-BmmU1BRl.js → automation-list-row-Cpitkm-C.js} +1 -1
  82. package/dist/client/assets/{automation-runs-DB872-04.js → automation-runs-BxBjhLC7.js} +1 -1
  83. package/dist/client/assets/{automations-CFVFCrV7.js → automations-DhtUKYcW.js} +1 -1
  84. package/dist/client/assets/{badge-DtQ2otcX.js → badge-CEYLDtOG.js} +1 -1
  85. package/dist/client/assets/{block-document-DaqfuEJg.js → block-document-DJdZyw2U.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-BxrrDSR_.js → blocks-preview-workspace-context-LI4fVaaR.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-Nf9dYIUl.js → blocks-tab-states-Bx0tgd5u.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-DYOtOfTF.js → blog-preview-url-6gNfi5Cv.js} +1 -1
  89. package/dist/client/assets/{blog-schema-CgT3z9DE.js → blog-schema-BKDvfgHw.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-fssHKEYj.js → blog-source-gate-BClmYTyo.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-V1kFVdot.js → blog-view-gate-eJ0uCj97.js} +1 -1
  92. package/dist/client/assets/{buckets-BZzsOzuI.js → buckets-DWNc5IQi.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-CUu0NcYy.js → build-improve-prompt-doc-CncoFUT6.js} +1 -1
  94. package/dist/client/assets/{calendar-BrtfWwHR.js → calendar-B0VrIuVV.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-Bg2ZZtwq.js → capability-load-error-D7_TKHDu.js} +1 -1
  96. package/dist/client/assets/{category-editor-GmBXzipw.js → category-editor-Jfh1FEbD.js} +1 -1
  97. package/dist/client/assets/{category-tree-DjteOax2.js → category-tree-T_JTuIiu.js} +1 -1
  98. package/dist/client/assets/{chart-CMRahf48.js → chart-Ef5OJL7Y.js} +1 -1
  99. package/dist/client/assets/{chat-context-CBri2v4z.js → chat-context-BUMEnIPW.js} +1 -1
  100. package/dist/client/assets/{chat-draft-CZrPo5ex.js → chat-draft-B7hvjq7e.js} +1 -1
  101. package/dist/client/assets/{checkbox-CPQZwsIU.js → checkbox-BUvWR-iD.js} +1 -1
  102. package/dist/client/assets/{choose-editor-DDWOzMsI.js → choose-editor-C_rrZDqX.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-C9GGJpAj.js → cli-auth-success-CIy6cPVO.js} +1 -1
  104. package/dist/client/assets/{cms-settings-editor-CzEwCO_d.js → cms-settings-editor-agl-pdfk.js} +1 -1
  105. package/dist/client/assets/{cms-store-drafts-C0xGLMK-.js → cms-store-drafts-BNAdDXxB.js} +1 -1
  106. package/dist/client/assets/{collapsible-BTBIoLOv.js → collapsible-DYCInqz3.js} +1 -1
  107. package/dist/client/assets/{collection-detail-C8TRCzbT.js → collection-detail-BX7pAFmI.js} +1 -1
  108. package/dist/client/assets/{collection-display-button-UrysGpFG.js → collection-display-button-C3xi0T_X.js} +1 -1
  109. package/dist/client/assets/{collection-search-DwSA3tBi.js → collection-search-CMlKHTQ0.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-DNGSYrfT.js → collection-table-wrapper-DbIa5pBT.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-D2T_5cZI.js → collection-tabs-ZW6Qb_Ul.js} +1 -1
  112. package/dist/client/assets/{combobox-D1SOJ26i.js → combobox-CMR7JQ5s.js} +1 -1
  113. package/dist/client/assets/{command-BQx6PdJK.js → command-DAachgGl.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-sWdiKDdE.js → companion-mcps-section-DFAviA9V.js} +1 -1
  115. package/dist/client/assets/{config-C1xp8gjV.js → config-CVrGKu1z.js} +1 -1
  116. package/dist/client/assets/{connect-Ci_x2fw3.js → connect-Dv780Ao_.js} +1 -1
  117. package/dist/client/assets/{connect-key-DkiQW8kq.js → connect-key-BcTw1Dit.js} +1 -1
  118. package/dist/client/assets/{connect-layout-D7MWpc_a.js → connect-layout-DVKIDoAk.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-C1INP371.js → connect-source-dialog-DmvQjMo_.js} +1 -1
  120. package/dist/client/assets/{connection-Dmlr1I48.js → connection-CqG6Tj46.js} +1 -1
  121. package/dist/client/assets/{connection-card-Cc0PqyDQ.js → connection-card-CMRGPAUW.js} +1 -1
  122. package/dist/client/assets/{connection-detail-CQ8U0Y2y.js → connection-detail-B2bDZqoS.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-DpLrG14n.js → connection-form-helpers-BliOgdtt.js} +1 -1
  124. package/dist/client/assets/{connection-slug-vfKrdCoS.js → connection-slug-BMyTAhb7.js} +1 -1
  125. package/dist/client/assets/{connections-CxLh8vBe.js → connections-osURCVgm.js} +1 -1
  126. package/dist/client/assets/{content-tab-BDfMY2gO.js → content-tab-B1BKIfBg.js} +3 -3
  127. package/dist/client/assets/{context-B2oAsWON.js → context-SebnQ-fG.js} +1 -1
  128. package/dist/client/assets/{context-menu-CB2myfv0.js → context-menu-dPQDOknl.js} +1 -1
  129. package/dist/client/assets/{context-shell-CP2ITMNQ.js → context-shell-CU-clPo7.js} +3 -3
  130. package/dist/client/assets/{create-organization-dialog-Dt_BzSOX.js → create-organization-dialog-BMVp8RKI.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-BDqTGNoL.js → daily-pulse-BIfjhIvm.js} +1 -1
  132. package/dist/client/assets/{delete-copy-DFx9_UPp.js → delete-copy-Dyr7i9lK.js} +1 -1
  133. package/dist/client/assets/{device-hint-CJUpMQMI.js → device-hint-DBfDHhL1.js} +1 -1
  134. package/dist/client/assets/{discover-CrPGz4AP.js → discover-4UiUWkTa.js} +1 -1
  135. package/dist/client/assets/{domain-settings-sBZEQLx0.js → domain-settings-l_JDVQfq.js} +1 -1
  136. package/dist/client/assets/{drawer-C2xp86Ob.js → drawer-BtNmmbgW.js} +1 -1
  137. package/dist/client/assets/{editor-CGJt_r4E.js → editor-DJNkhCaU.js} +1 -1
  138. package/dist/client/assets/{editor-classes-DT54mSVa.js → editor-classes-D6VscvFm.js} +1 -1
  139. package/dist/client/assets/{empty-message-CqlhlFCE.js → empty-message-BFHsH7_h.js} +1 -1
  140. package/dist/client/assets/{empty-state-BbWCdL3a.js → empty-state-FI4NppsL.js} +1 -1
  141. package/dist/client/assets/{empty-state-CD32p6hk.js → empty-state-Y9RPHES1.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-vqlSDWa2.js → experiments-tab-choice-Bp3jeDLT.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-CC3YJHpF.js → extract-connection-data-jaNfclWY.js} +1 -1
  144. package/dist/client/assets/{feature-gate-D-opfS1O.js → feature-gate-32y7GiUu.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-BY5puKwA.js → feature-paywall-nyy14OlO.js} +1 -1
  146. package/dist/client/assets/{file-explorer-CF1_K8FK.js → file-explorer-Berv-DjA.js} +1 -1
  147. package/dist/client/assets/{file-preview-B0ERgC1p.js → file-preview-DOlPWZsT.js} +1 -1
  148. package/dist/client/assets/{file-share-button-CWnV8AKp.js → file-share-button-fnsd2V0Q.js} +1 -1
  149. package/dist/client/assets/{file-type-icon-BIW0hyKt.js → file-type-icon-Bw6tHUJI.js} +1 -1
  150. package/dist/client/assets/{folder-icon-87oARTj6.js → folder-icon-A6dxvF3y.js} +1 -1
  151. package/dist/client/assets/{form-jLka6XRk.js → form-CE_i7Gc_.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-CKH88YcA.js → frame-navigation-D0o7MHwc.js} +1 -1
  153. package/dist/client/assets/{gateway-client-_i1HQU44.js → gateway-client-CuVQGtSK.js} +1 -1
  154. package/dist/client/assets/{general-CO62cXdH.js → general-CF4LBOhX.js} +1 -1
  155. package/dist/client/assets/{github-icon-7pXUwZ9H.js → github-icon-BBtraw32.js} +1 -1
  156. package/dist/client/assets/{held-block-view-C5dw_cIK.js → held-block-view-BCDffeao.js} +1 -1
  157. package/dist/client/assets/{home-CYvbKlsL.js → home-D5e51VDk.js} +1 -1
  158. package/dist/client/assets/{home-overview-DGJhRoD_.js → home-overview-CvjbBnOC.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-ytMUrHmd.js → hosted-reconcile-BV7FtBoJ.js} +1 -1
  160. package/dist/client/assets/{icon-button-C0zGF0XG.js → icon-button-vJpGdaXv.js} +1 -1
  161. package/dist/client/assets/{index-l98H0pqO.js → index-BBKDsc5X.js} +1 -1
  162. package/dist/client/assets/{index-BrIGv0lM.js → index-BDN2Il8W.js} +1 -1
  163. package/dist/client/assets/{index-DAJb2qp5.js → index-BFZAeRbT.js} +1 -1
  164. package/dist/client/assets/{index-DfBfkfSx.js → index-BO5G51Y2.js} +1 -1
  165. package/dist/client/assets/{index-DPOIY_Am.js → index-BfWp2Wnw.js} +3 -3
  166. package/dist/client/assets/{index-BzPwt0eH.js → index-Bq8aKp2l.js} +1 -1
  167. package/dist/client/assets/{index-DRv6EPiE.js → index-C-SbeINf.js} +1 -1
  168. package/dist/client/assets/{index-Bj5swkEO.js → index-CJvXv5nj.js} +1 -1
  169. package/dist/client/assets/{index-oI_u2kBo.js → index-C_tC1dxx.js} +1 -1
  170. package/dist/client/assets/{index-DLgMTWWc.js → index-CcEK8GbM.js} +1 -1
  171. package/dist/client/assets/{index-Hxzn04FB.js → index-Cu5PtngA.js} +1 -1
  172. package/dist/client/assets/{index-QeA7kseb.js → index-CvQo8gKP.js} +1 -1
  173. package/dist/client/assets/{index-28TTOZoW.js → index-DN6wMhlh.js} +1 -1
  174. package/dist/client/assets/{index-CogLvxvp.js → index-DVC5Xh86.js} +1 -1
  175. package/dist/client/assets/{index-BAv1oGjp.js → index-DqFWx3BB.js} +1 -1
  176. package/dist/client/assets/{index-BkW6CZ0q.js → index-DvdlZugw.js} +1 -1
  177. package/dist/client/assets/{index-B3gUNYbE.js → index-FE1RDBz7.js} +1 -1
  178. package/dist/client/assets/{index-redirect-C8V2b59q.js → index-redirect-Bl5G9WWk.js} +1 -1
  179. package/dist/client/assets/{infiniteQueryObserver-DJGFKTxU.js → infiniteQueryObserver-1nr0P0K0.js} +1 -1
  180. package/dist/client/assets/{infra-billing-NTUbCctn.js → infra-billing-ho67U0rR.js} +1 -1
  181. package/dist/client/assets/{input-0zme4RkK.js → input-BJ5cUSYm.js} +3 -3
  182. package/dist/client/assets/{input-CsHX4qLN.js → input-BNlFS4tL.js} +1 -1
  183. package/dist/client/assets/{integration-icon-0IRz-_BB.js → integration-icon-C4zzzxaS.js} +1 -1
  184. package/dist/client/assets/{item-actions-Conwh7gT.js → item-actions-B-wWhBMR.js} +1 -1
  185. package/dist/client/assets/{jira-icon-OeOgPje5.js → jira-icon-geKtCB2v.js} +1 -1
  186. package/dist/client/assets/{label-BdMRZwGH.js → label-CWaQ3ANC.js} +1 -1
  187. package/dist/client/assets/{layout-Dl8uG_dr.js → layout-D8a54-AV.js} +1 -1
  188. package/dist/client/assets/{legacy-admin-welcome-dialog-D89y9ynC.js → legacy-admin-welcome-dialog-BnEG9TvC.js} +1 -1
  189. package/dist/client/assets/{legacy-agents-deep-BXEBG0CI.js → legacy-agents-deep-D40bR2el.js} +1 -1
  190. package/dist/client/assets/{legacy-main-redirect-C1RiG4K9.js → legacy-main-redirect-Fa4p1NoA.js} +1 -1
  191. package/dist/client/assets/library-OBxcrPA6.js +1 -0
  192. package/dist/client/assets/{library-tab-Br-uF_Hm.js → library-tab-Bxyd3n6f.js} +1 -1
  193. package/dist/client/assets/{login-Rizq57SZ.js → login-Cdi7iEkU.js} +1 -1
  194. package/dist/client/assets/{markdown-CUtNphAW.js → markdown-NetMLX1B.js} +1 -1
  195. package/dist/client/assets/{mcp-app-renderer-DLdEcCTg.js → mcp-app-renderer-OOnse3pT.js} +1 -1
  196. package/dist/client/assets/{mcp-oauth-CbFCmvqW.js → mcp-oauth-C138KPCE.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-B_j2wUbc.js → mcp-oauth-DOaDVyhA.js} +1 -1
  198. package/dist/client/assets/{members-BAwhZD_m.js → members-r0zAY-Qq.js} +1 -1
  199. package/dist/client/assets/{memory-iwCqu4BE.js → memory-aLB_WhbI.js} +1 -1
  200. package/dist/client/assets/{mock-board-eIJajpTE.js → mock-board-Dl0qBjh7.js} +3 -3
  201. package/dist/client/assets/{monaco-editor-DXM9A4pG.js → monaco-editor-BJmxWrxj.js} +1 -1
  202. package/dist/client/assets/{monitoring-DVvJc9ir.js → monitoring-Cd-32_wp.js} +1 -1
  203. package/dist/client/assets/{monitoring-stats-row-CXoFBfjI.js → monitoring-stats-row-C4l9QgAZ.js} +1 -1
  204. package/dist/client/assets/{multi-select-Cs9XWnUI.js → multi-select-B_L-qOo_.js} +1 -1
  205. package/dist/client/assets/{mustache-DPWycY9y.js → mustache-DsBc8nE5.js} +1 -1
  206. package/dist/client/assets/{named-rule-step-DkPkMD9a.js → named-rule-step-C6gSKxIZ.js} +1 -1
  207. package/dist/client/assets/{named-rule-view-Mm4igRMb.js → named-rule-view-D6a00Kd0.js} +1 -1
  208. package/dist/client/assets/{new-project-dialog-DEn-QBff.js → new-project-dialog-B6Lwo0Gj.js} +1 -1
  209. package/dist/client/assets/{new-project-store-DCJGQtnb.js → new-project-store-DQsI7Up8.js} +1 -1
  210. package/dist/client/assets/{oauth-callback-qqItb-3_.js → oauth-callback-ZiXhFHTL.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-ai-provider-iGz6D9uv.js → oauth-callback-ai-provider-G3iL8oeJ.js} +1 -1
  212. package/dist/client/assets/{oauth-consent-DAmvNoUu.js → oauth-consent-BXyh0gna.js} +1 -1
  213. package/dist/client/assets/{onboarding-DC2-kgmu.js → onboarding-DAsPAll8.js} +1 -1
  214. package/dist/client/assets/{openai-conversation-B2CSBZOi.js → openai-conversation-BAjqwRPV.js} +1 -1
  215. package/dist/client/assets/{optimistic-project-sidebar-views-CkgA6jNz.js → optimistic-project-sidebar-views-DFcCZ-o3.js} +1 -1
  216. package/dist/client/assets/{order-monitor-day-pAn5f12v.js → order-monitor-day-C70gELqf.js} +1 -1
  217. package/dist/client/assets/{organization-choice-BnFDGIwf.js → organization-choice-DU0Iu2sl.js} +1 -1
  218. package/dist/client/assets/{orgs-CTr2DmZn.js → orgs-BX0lk0zT.js} +1 -1
  219. package/dist/client/assets/{own-accounts-section-DMizx5il.js → own-accounts-section-F5Hyapdn.js} +1 -1
  220. package/dist/client/assets/{pair-DBiqK3oA.js → pair-B9IOPXjq.js} +1 -1
  221. package/dist/client/assets/{parse-sections-CCSnY5DZ.js → parse-sections--l6s_VwH.js} +2 -2
  222. package/dist/client/assets/{plan-ladder-BmWod578.js → plan-ladder-NC686t6f.js} +1 -1
  223. package/dist/client/assets/{plan-usage-card-CzSwSuMg.js → plan-usage-card-WBfanqrN.js} +1 -1
  224. package/dist/client/assets/{plan-C_4OssgN.js → plan-vHZHG0_E.js} +1 -1
  225. package/dist/client/assets/{popover-DlkpRzCF.js → popover-oFcDtUvN.js} +1 -1
  226. package/dist/client/assets/{post-calendar-zQCpyE5h.js → post-calendar-DzBDM3b2.js} +1 -1
  227. package/dist/client/assets/{post-editor-DPJOSAuw.js → post-editor-CcQmW5GV.js} +1 -1
  228. package/dist/client/assets/{preview-content-PWBpYYtT.js → preview-content-MbQf8RGA.js} +1 -1
  229. package/dist/client/assets/{preview-dialog-CGJjJMVz.js → preview-dialog-Cded3kAU.js} +1 -1
  230. package/dist/client/assets/{preview-panel-CoPKvTvM.js → preview-panel-rChZiu-N.js} +1 -1
  231. package/dist/client/assets/{preview-tab-_tfQ-S2y.js → preview-tab-zxzhDMiQ.js} +3 -3
  232. package/dist/client/assets/{product-picker-dialog-BGaSpLBM.js → product-picker-dialog-CX9KvtZh.js} +1 -1
  233. package/dist/client/assets/{profile-Cr5i6qGO.js → profile-NWB9QWdA.js} +1 -1
  234. package/dist/client/assets/{project-app-view-BQzokVS3.js → project-app-view-gJDZKZ8F.js} +1 -1
  235. package/dist/client/assets/{project-apps-WVs7TAih.js → project-apps-D28U2fPi.js} +1 -1
  236. package/dist/client/assets/{project-icon-CXJHY_ba.js → project-icon-WyFXKdgN.js} +1 -1
  237. package/dist/client/assets/{project-index-CJ35rtAt.js → project-index-COi5kduS.js} +1 -1
  238. package/dist/client/assets/project-reports-DFICoZ3P.js +1 -0
  239. package/dist/client/assets/project-tasks-DHsoMFaC.js +1 -0
  240. package/dist/client/assets/{projects-DvnUTZ0j.js → projects-Cm9td8_E.js} +1 -1
  241. package/dist/client/assets/{projects-empty-state-C8AdRKAE.js → projects-empty-state-Dvqp2Zzy.js} +1 -1
  242. package/dist/client/assets/{prompts-Bk21ISW_.js → prompts-DhLlttmt.js} +1 -1
  243. package/dist/client/assets/record-editor-BaN-J3uT.js +1 -0
  244. package/dist/client/assets/{redirect-editor-D8wP49VM.js → redirect-editor-Dk4GjAcP.js} +1 -1
  245. package/dist/client/assets/reports-BjhUDxT0.js +1 -0
  246. package/dist/client/assets/{reports-D47eS2QU.js → reports-CREVrO7v.js} +1 -1
  247. package/dist/client/assets/{reports-onboarding-CojRleC3.js → reports-onboarding-DlCteX2-.js} +1 -1
  248. package/dist/client/assets/{reports-tab-N2lgxCzG.js → reports-tab-C197xYdE.js} +2 -2
  249. package/dist/client/assets/{repositories-BCpcKEQp.js → repositories-CWMzkWDA.js} +1 -1
  250. package/dist/client/assets/repositories-CpGjSRVu.js +1 -0
  251. package/dist/client/assets/{repository-binding-BKMgK4Io.js → repository-binding-BDu0tU0n.js} +1 -1
  252. package/dist/client/assets/{repository-picker-CVrSd_t5.js → repository-picker-DKoD0HVQ.js} +1 -1
  253. package/dist/client/assets/{require-capability-DbuSTrZt.js → require-capability-DXiZ0OON.js} +1 -1
  254. package/dist/client/assets/{required-auth-layout-BUmwoOyO.js → required-auth-layout-ZTLOobSH.js} +1 -1
  255. package/dist/client/assets/{reset-password-BNMFFUYV.js → reset-password-DiEnHrUJ.js} +1 -1
  256. package/dist/client/assets/{resizable-D1QL_pk1.js → resizable-BArMfXUk.js} +1 -1
  257. package/dist/client/assets/{resolve-tab-icon-Dc9fL1_q.js → resolve-tab-icon-C99S9oDL.js} +1 -1
  258. package/dist/client/assets/{review-settings-DpYcre3r.js → review-settings-Brit3pLv.js} +1 -1
  259. package/dist/client/assets/{role-color-nf2sxe8V.js → role-color-Ddqyp0w6.js} +1 -1
  260. package/dist/client/assets/roles-C9wYF2gv.js +1 -0
  261. package/dist/client/assets/route-Bhee4AVm.js +1 -0
  262. package/dist/client/assets/{route-D-F54mDA.js → route-C0X_ekZH.js} +1 -1
  263. package/dist/client/assets/{route-eJrZbPdb.js → route-cMh_8Xc3.js} +1 -1
  264. package/dist/client/assets/{route-page-header-DrwKWE7S.js → route-page-header-BeG7kyQP.js} +1 -1
  265. package/dist/client/assets/{sandbox-git-api-AGfLcW5t.js → sandbox-git-api-Bwhb8cKq.js} +1 -1
  266. package/dist/client/assets/{sandbox-lifecycle-context-BDviy_OO.js → sandbox-lifecycle-context-Dq2ETPAf.js} +1 -1
  267. package/dist/client/assets/{save-status-Djka_Qyj.js → save-status-BXxefOdA.js} +1 -1
  268. package/dist/client/assets/{schema-DiGDa5-A.js → schema-BJIhJXy6.js} +1 -1
  269. package/dist/client/assets/{schema-C89b6vEO.js → schema-CI1Jg9rW.js} +1 -1
  270. package/dist/client/assets/{scroll-area-C25d35EM.js → scroll-area-Dt-NcLdT.js} +1 -1
  271. package/dist/client/assets/{search-input-CDHAHj2Z.js → search-input-BjRiuWL9.js} +1 -1
  272. package/dist/client/assets/{search-toggle-DrjJg-yN.js → search-toggle-BOD5VZ7W.js} +1 -1
  273. package/dist/client/assets/{secret-picker-B2t0d6pu.js → secret-picker-CHt8ZrjG.js} +1 -1
  274. package/dist/client/assets/{secrets-Ck_pxO8-.js → secrets-DGZeS_5r.js} +1 -1
  275. package/dist/client/assets/{section-array-field-mJNGevl7.js → section-array-field-CYFq6Yfv.js} +1 -1
  276. package/dist/client/assets/{sections-DYjDfzd8.js → sections-DBJ1YFK4.js} +1 -1
  277. package/dist/client/assets/{sections-editor-Dt8FPmGd.js → sections-editor--Z8msN1o.js} +1 -1
  278. package/dist/client/assets/{select-43sB6t-n.js → select-BXZoshA8.js} +1 -1
  279. package/dist/client/assets/{select-model-D3b3NgsN.js → select-model-Corsllp1.js} +1 -1
  280. package/dist/client/assets/{seo-editor-Dh01mkLc.js → seo-editor-CG0nowoP.js} +1 -1
  281. package/dist/client/assets/{separator-DlKhPrzR.js → separator-Jij0j-j1.js} +1 -1
  282. package/dist/client/assets/{session-runtime-Cds1bHwk.js → session-runtime-DFmRKpVg.js} +1 -1
  283. package/dist/client/assets/settings-tab-PpyKi5jL.js +1 -0
  284. package/dist/client/assets/{sheet-DRbCBFle.js → sheet-DT44IVE2.js} +1 -1
  285. package/dist/client/assets/{shell-layout-B7ir0OH3.js → shell-layout-CQs-sSUy.js} +1 -1
  286. package/dist/client/assets/{site-draft-actions-CAAm6S7o.js → site-draft-actions-ChPsoqte.js} +1 -1
  287. package/dist/client/assets/{site-draft-view-CV5xEwuh.js → site-draft-view-CIc7HrWU.js} +1 -1
  288. package/dist/client/assets/site-editor-89VkH7GW.js +1 -0
  289. package/dist/client/assets/{site-editor-toast-BVSUbQbL.js → site-editor-toast-D2nHZREM.js} +1 -1
  290. package/dist/client/assets/{skills-BfMBw663.js → skills-CgUWJjrb.js} +1 -1
  291. package/dist/client/assets/{slider-DHaMIxXo.js → slider-DCaB9Ine.js} +1 -1
  292. package/dist/client/assets/{sortable.esm-LPMzYASJ.js → sortable.esm-CfU7eu9S.js} +1 -1
  293. package/dist/client/assets/{sso-B-tNyxWZ.js → sso-BEMT6JJw.js} +1 -1
  294. package/dist/client/assets/{suggestion-BahdAltZ.js → suggestion-BO6GNdWk.js} +1 -1
  295. package/dist/client/assets/{super-agent-icon-BiI_N592.js → super-agent-icon-Cu5ZQ2qC.js} +1 -1
  296. package/dist/client/assets/{switch-C3NgdaQ-.js → switch-CfCCzQdg.js} +1 -1
  297. package/dist/client/assets/{synced-repos-DYCGgRTS.js → synced-repos-gHf8sPwV.js} +1 -1
  298. package/dist/client/assets/{tab-icon-glyph-obsxNvyr.js → tab-icon-glyph-hPo-Gg9t.js} +1 -1
  299. package/dist/client/assets/{table-DYppV64B.js → table-BG-lRGNn.js} +1 -1
  300. package/dist/client/assets/{tabs-CUynC-MP.js → tabs-DQRKyhjY.js} +1 -1
  301. package/dist/client/assets/{task-board-Cfset9MO.js → task-board-B-hxKp5U.js} +1 -1
  302. package/dist/client/assets/{task-key-_tZm34Ts.js → task-key-DjK7Kw8s.js} +1 -1
  303. package/dist/client/assets/{task-route-Ba35C-o6.js → task-route-BwC6Um2K.js} +1 -1
  304. package/dist/client/assets/{task-status-CSrjjj4d.js → task-status-BiZeTmx1.js} +1 -1
  305. package/dist/client/assets/{taskboard-analytics-DVDfROrr.js → taskboard-analytics-C1hsIKyF.js} +1 -1
  306. package/dist/client/assets/tasks-Cvrxb3RD.js +1 -0
  307. package/dist/client/assets/{tasks-DXmgQxQZ.js → tasks-Dac_YLSj.js} +1 -1
  308. package/dist/client/assets/{textarea-CxaeNM2g.js → textarea-DAZ3avm9.js} +1 -1
  309. package/dist/client/assets/{thread-analytics-WaOf3IfR.js → thread-analytics-DGVyUEMu.js} +1 -1
  310. package/dist/client/assets/{thread-button-B3WqZBtr.js → thread-button-Dy4pRky4.js} +1 -1
  311. package/dist/client/assets/{thread-intent-Chcb1cgt.js → thread-intent-BtcwbxTJ.js} +1 -1
  312. package/dist/client/assets/{thread-route-CD4mZI96.js → thread-route-BKnIUDl3.js} +1 -1
  313. package/dist/client/assets/{thread-route-2gqMIzEM.js → thread-route-Ds6Wombz.js} +1 -1
  314. package/dist/client/assets/{thread-sheet-body-wqAKax-M.js → thread-sheet-body-Kjk5YJ_A.js} +1 -1
  315. package/dist/client/assets/{time-range-picker-DkO27CRA.js → time-range-picker-y-R1DMgB.js} +1 -1
  316. package/dist/client/assets/{toggle-group-BlHT_eQJ.js → toggle-group-BgBCZLaa.js} +1 -1
  317. package/dist/client/assets/{tool-set-selector-H0JOuDt5.js → tool-set-selector-tZKV1bCv.js} +1 -1
  318. package/dist/client/assets/{toolbar-icon-button-qHG6EBvv.js → toolbar-icon-button-CaY1wsmY.js} +1 -1
  319. package/dist/client/assets/{tooltip-t1fF0XB_.js → tooltip-CqV-qcYU.js} +1 -1
  320. package/dist/client/assets/{tooltipContext-DYrIxh_J.js → tooltipContext-5-7GWaNH.js} +1 -1
  321. package/dist/client/assets/{track-C4aeoFlr.js → track-qijzY7O9.js} +1 -1
  322. package/dist/client/assets/{types-C8Pq2I-Q.js → types-DRaoZ_4I.js} +1 -1
  323. package/dist/client/assets/{url-slug-DCym6L1-.js → url-slug-CTOX8lQF.js} +1 -1
  324. package/dist/client/assets/{usage-stats-BP3RFx-W.js → usage-stats-BXxRbW0f.js} +1 -1
  325. package/dist/client/assets/{use-ai-providers-hjjdwt3a.js → use-ai-providers-DgsrHLV3.js} +1 -1
  326. package/dist/client/assets/{use-api-keys-CGI18dQ5.js → use-api-keys-1S0yfr-w.js} +1 -1
  327. package/dist/client/assets/{use-apply-named-rule-DQcQcY2Z.js → use-apply-named-rule-DK9k5f8X.js} +1 -1
  328. package/dist/client/assets/use-ask-in-chat-CC9ew9W1.js +1 -0
  329. package/dist/client/assets/{use-automations-4FRwc0q0.js → use-automations-lWDVj-CU.js} +1 -1
  330. package/dist/client/assets/{use-autosave-C6MauLtM.js → use-autosave-CQIToQsM.js} +1 -1
  331. package/dist/client/assets/use-blocks-v8-project-DwTQhXO1.js +1 -0
  332. package/dist/client/assets/use-blog-view-9w6CHFwT.js +1 -0
  333. package/dist/client/assets/{use-chat-layout-state-p7r6M8ce.js → use-chat-layout-state-CS1wv5hl.js} +1 -1
  334. package/dist/client/assets/{use-cms-publish-actions-BuFGWO_V.js → use-cms-publish-actions-BoXieLUR.js} +1 -1
  335. package/dist/client/assets/{use-connect-companion-CUSxmmG_.js → use-connect-companion-C2Xf2qzV.js} +1 -1
  336. package/dist/client/assets/{use-connection-dG9YSsjP.js → use-connection-Df8_gpBB.js} +1 -1
  337. package/dist/client/assets/{use-content-sync-Cdkdq_40.js → use-content-sync-DzzCDnXY.js} +1 -1
  338. package/dist/client/assets/{use-copy-CyYzB7m6.js → use-copy-CCrC_M79.js} +1 -1
  339. package/dist/client/assets/{use-current-view-CxN5GETM.js → use-current-view-B5rf1h54.js} +1 -1
  340. package/dist/client/assets/{use-date-fns-locale-D-rfu-GG.js → use-date-fns-locale-Csnyj6_G.js} +1 -1
  341. package/dist/client/assets/{use-debounced-autosave-C0szJ-Sw.js → use-debounced-autosave-BNJwBoKC.js} +1 -1
  342. package/dist/client/assets/{use-debounced-value-CHQeG59Z.js → use-debounced-value-DFWDa0qH.js} +1 -1
  343. package/dist/client/assets/{use-deco-credits-C96HUaam.js → use-deco-credits-CuB-vVK3.js} +1 -1
  344. package/dist/client/assets/{use-decopilot-events-CPHiiMGY.js → use-decopilot-events-B7ke0MhO.js} +1 -1
  345. package/dist/client/assets/{use-delete-block-BW5kKKWR.js → use-delete-block-ZPB3I9Ns.js} +1 -1
  346. package/dist/client/assets/{use-delete-connection-CGAQKLnY.js → use-delete-connection-Zvzh2eht.js} +1 -1
  347. package/dist/client/assets/{use-deployment-admin-DDqd8B9e.js → use-deployment-admin-B4GqO2uv.js} +1 -1
  348. package/dist/client/assets/{use-entitlements-BbdsTwSB.js → use-entitlements-CQZj5lkl.js} +1 -1
  349. package/dist/client/assets/{use-fast-preview-draft-url-BUnyzFnZ.js → use-fast-preview-draft-url-DYyM21UT.js} +1 -1
  350. package/dist/client/assets/{use-file-configs-vR7bDtOC.js → use-file-configs-CyAC1Jn2.js} +1 -1
  351. package/dist/client/assets/{use-id-selection-CTKSjiEu.js → use-id-selection-CE2G3E6f.js} +1 -1
  352. package/dist/client/assets/{use-in-settings-CbO5uykc.js → use-in-settings-CRUM5hPE.js} +1 -1
  353. package/dist/client/assets/{use-inbox-feed-BoL8mZCx.js → use-inbox-feed-uWC2MWJH.js} +1 -1
  354. package/dist/client/assets/{use-infinite-scroll-VPnxSLfm.js → use-infinite-scroll-Cz_t92ww.js} +1 -1
  355. package/dist/client/assets/{use-join-requests-Xe2if9yQ.js → use-join-requests-CS1fqgjk.js} +1 -1
  356. package/dist/client/assets/{use-main-panel-tabs-CfTK_QgS.js → use-main-panel-tabs-DwCoiX2k.js} +1 -1
  357. package/dist/client/assets/{use-mcp-auth-status-DGn4OAED.js → use-mcp-auth-status-CyjIfVIk.js} +1 -1
  358. package/dist/client/assets/{use-mcp-client-B-wVa8u0.js → use-mcp-client-HASDr5yn.js} +1 -1
  359. package/dist/client/assets/{use-mcp-prompts-BsO-eiOc.js → use-mcp-prompts-CEtDj9VE.js} +1 -1
  360. package/dist/client/assets/{use-mcp-tools-B1VggSwJ.js → use-mcp-tools-CLfN0BYV.js} +1 -1
  361. package/dist/client/assets/{use-mobile-D-TLPrvO.js → use-mobile-UoyYEGbQ.js} +1 -1
  362. package/dist/client/assets/{use-move-blocks-Crapk8CO.js → use-move-blocks-CFb10aGP.js} +1 -1
  363. package/dist/client/assets/{use-navigate-to-agent-DuNN_hGy.js → use-navigate-to-agent-C4y9eC4A.js} +1 -1
  364. package/dist/client/assets/{use-never-published-CX5FVn_l.js → use-never-published-D71BtZNY.js} +1 -1
  365. package/dist/client/assets/{use-org-fs-BGORZXRY.js → use-org-fs-BAgR3Jkh.js} +1 -1
  366. package/dist/client/assets/{use-org-notice-DieWFUit.js → use-org-notice-DQ7N3XWA.js} +1 -1
  367. package/dist/client/assets/{use-org-repo-syncs-DF9fGaS3.js → use-org-repo-syncs-C556S9To.js} +1 -1
  368. package/dist/client/assets/{use-org-sso-C40URVuD.js → use-org-sso-DrDj5K7f.js} +1 -1
  369. package/dist/client/assets/{use-organization-settings-Cc32ci7B.js → use-organization-settings-BliP9B1t.js} +1 -1
  370. package/dist/client/assets/{use-panel-navigate-C9YlWWPn.js → use-panel-navigate-db4k7dl4.js} +1 -1
  371. package/dist/client/assets/{use-project-native-view-presence-c5h_yjC-.js → use-project-native-view-presence-DPg5UqE1.js} +1 -1
  372. package/dist/client/assets/{use-project-scope-aZyY3ntO.js → use-project-scope-CFftAYVY.js} +1 -1
  373. package/dist/client/assets/{use-recent-apps-CSsKMKwu.js → use-recent-apps-CS-hhWwQ.js} +1 -1
  374. package/dist/client/assets/{use-reports-diagnostic-DbMoz7IJ.js → use-reports-diagnostic-CYymDS51.js} +1 -1
  375. package/dist/client/assets/{use-sandbox-events-CBh8sLnm.js → use-sandbox-events-rgvK0R-0.js} +1 -1
  376. package/dist/client/assets/{use-secrets-B7iVfZoB.js → use-secrets-Y_pjIaUL.js} +1 -1
  377. package/dist/client/assets/{use-section-preview-base-BIu_tEmB.js → use-section-preview-base-Bkq2jdsn.js} +1 -1
  378. package/dist/client/assets/{use-sidebar-collapsed-Dfwqn3HW.js → use-sidebar-collapsed-BtrwP1AE.js} +1 -1
  379. package/dist/client/assets/{use-tags-DBDQfu0t.js → use-tags-CFlTqeDj.js} +1 -1
  380. package/dist/client/assets/{use-task-board-analytics-ByLlXOj2.js → use-task-board-analytics-Bm2Eiqvn.js} +1 -1
  381. package/dist/client/assets/{use-task-board-item-prs-Cbcql5d4.js → use-task-board-item-prs-BCP6vVwh.js} +1 -1
  382. package/dist/client/assets/{use-task-board-items-BZZLKLjF.js → use-task-board-items-CQPrgy8Z.js} +1 -1
  383. package/dist/client/assets/{use-task-board-prompts-DwLszR98.js → use-task-board-prompts-CywAfsLX.js} +1 -1
  384. package/dist/client/assets/{use-task-metadata-CiW_7IWN.js → use-task-metadata-BIpPNwtn.js} +1 -1
  385. package/dist/client/assets/{use-thread-outputs-B8BJcksR.js → use-thread-outputs-BMHx59-u.js} +1 -1
  386. package/dist/client/assets/{use-view-draft-kind-hWydH0Wf.js → use-view-draft-kind-DkapSxnZ.js} +1 -1
  387. package/dist/client/assets/{use-voice-input-CN2HjttA.js → use-voice-input-DyQL3diM.js} +1 -1
  388. package/dist/client/assets/useInfiniteQuery-D5Avp4ip.js +1 -0
  389. package/dist/client/assets/{useQueries-CepN8xQB.js → useQueries-Bay3GQsV.js} +1 -1
  390. package/dist/client/assets/useSuspenseInfiniteQuery-BlIdZ7Pt.js +1 -0
  391. package/dist/client/assets/{users-CdFy5Ycf.js → users-DTrW9ZIm.js} +1 -1
  392. package/dist/client/assets/{utils-Dvb--LrS.js → utils-D1ABa-c2.js} +1 -1
  393. package/dist/client/assets/{variant-calendar-Dy-9A9oL.js → variant-calendar-CK1882s5.js} +1 -1
  394. package/dist/client/assets/{variant-matcher-override-sIys-Vqh.js → variant-matcher-override-y-sjVy0V.js} +1 -1
  395. package/dist/client/assets/{view-header-BXeo64AZ.js → view-header-CJ8vxIod.js} +1 -1
  396. package/dist/client/assets/{virtual-mcp-DHABb4z4.js → virtual-mcp-m1o-7tiO.js} +1 -1
  397. package/dist/client/assets/{watch-sse-pool-YDiUBcwq.js → watch-sse-pool-gEMXX-QL.js} +1 -1
  398. package/dist/client/index.html +1 -1
  399. package/dist/server/server.js +626 -626
  400. package/package.json +1 -1
  401. package/dist/client/assets/agent-app-CVMxZ008.js +0 -1
  402. package/dist/client/assets/agent-deck-Dh63bgjz.js +0 -1
  403. package/dist/client/assets/agent-experiments-CaLTl0ur.js +0 -1
  404. package/dist/client/assets/agent-file-DOGPw2nD.js +0 -1
  405. package/dist/client/assets/agent-library-CVPbskzR.js +0 -1
  406. package/dist/client/assets/agent-library-file-DJTwSDvs.js +0 -1
  407. package/dist/client/assets/agent-overview-ANIUNLov.js +0 -1
  408. package/dist/client/assets/agent-settings-BgOaL-TW.js +0 -1
  409. package/dist/client/assets/agent-site-editor-code-B5gKlKPe.js +0 -2
  410. package/dist/client/assets/agent-site-editor-content-CDSv2ulU.js +0 -1
  411. package/dist/client/assets/agent-site-editor-preview-m4V2tU0p.js +0 -1
  412. package/dist/client/assets/agent-view-C1V_rp1q.js +0 -1
  413. package/dist/client/assets/api-keys-CZEK4y85.js +0 -1
  414. package/dist/client/assets/library-C79MtZgu.js +0 -1
  415. package/dist/client/assets/project-reports-ymRgHixA.js +0 -1
  416. package/dist/client/assets/project-tasks-jSnT12UO.js +0 -1
  417. package/dist/client/assets/record-editor-Cnm6o3WY.js +0 -1
  418. package/dist/client/assets/reports-06qM3bu1.js +0 -1
  419. package/dist/client/assets/repositories-D4LpfLqR.js +0 -1
  420. package/dist/client/assets/roles-ht1A484v.js +0 -1
  421. package/dist/client/assets/route-BF4FB0rC.js +0 -1
  422. package/dist/client/assets/settings-tab-B6UxteFe.js +0 -1
  423. package/dist/client/assets/site-editor-CxjaC6e_.js +0 -1
  424. package/dist/client/assets/tasks-CChceK1N.js +0 -1
  425. package/dist/client/assets/use-ask-in-chat-CZ898xy-.js +0 -1
  426. package/dist/client/assets/use-blocks-v8-project-oaHZ3IYa.js +0 -1
  427. package/dist/client/assets/use-blog-view-CLeYZBHD.js +0 -1
  428. package/dist/client/assets/useInfiniteQuery-DiZrq1wi.js +0 -1
  429. package/dist/client/assets/useSuspenseInfiniteQuery-BpBpPIuX.js +0 -1
@@ -1 +1 @@
1
- import{r as i,j as t,c4 as o}from"./index-DPOIY_Am.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
1
+ import{r as i,j as t,c4 as o}from"./index-BfWp2Wnw.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
@@ -1,4 +1,4 @@
1
- import{c as $,b as j,r as _,j as f,m as B,aW as at,t as se,b3 as Oe,a4 as ot,hh as lt,i as ct,K as ut,c8 as ht,h as De,o as pt}from"./index-DPOIY_Am.js";import{u as dt,t as Be,f as ue,A as ft,v as gt,Y as P,Z as mt,_ as kt,H as xt,I as D,$ as ve,a0 as bt,e as wt,a1 as Se,a2 as yt,a3 as G,N as Fe,a4 as he,c as qe,a5 as pe,a6 as Tt,a7 as vt,s as St,a8 as Mt,a as Et,E as At}from"./usage-stats-BP3RFx-W.js";import{T as C,n as Rt,i as _t,E as $t}from"./editor-classes-DT54mSVa.js";import{a as Ct,e as Ue,s as It,S as Lt}from"./suggestion-BahdAltZ.js";import{B as zt}from"./index-BrIGv0lM.js";import{aE as Pt,ai as jt,aj as Nt,al as Ht,K as Ot,aY as Dt,aJ as Bt}from"./agent-icon-D5QYtdVU.js";import{i as Ft}from"./SwitchHorizontal01-Kti3AXOg.js";import{s as qt}from"./Trash01-BytHt_aS.js";import{k as Ut,a as Zt}from"./use-org-fs-BGORZXRY.js";import{E as Me,i as Ze,b as Gt,c as Kt,d as Ge,A as Wt,e as Qt,f as Xt,g as Vt,j as Yt}from"./markdown-CUtNphAW.js";import{s as Jt,T as en}from"./index-BAv1oGjp.js";import{f as tn,a as nn,c as rn,C as sn,b as Ee}from"./command-BQx6PdJK.js";import{I as an}from"./icon-button-C0zGF0XG.js";function on(t){const e=$.c(30),{editor:n}=t,s=j(),[r,a]=_.useState(!1),[i,l]=_.useState(""),[o,h]=_.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const u=c;let p;e[2]!==n||e[3]!==r?(p=()=>{if(r){a(!1);return}const T=n.getAttributes("link").href;l(typeof T=="string"?T:""),h(!1),a(!0)},e[2]=n,e[3]=r,e[4]=p):p=e[4];const d=p;let g;e[5]!==n?(g=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=g):g=e[6];const x=g;let w;e[7]!==i||e[8]!==n||e[9]!==x?(w=()=>{const T=Rt(i);if(T===""){x();return}if(!_t(T)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=x,e[10]=w):w=e[10];const b=w;let y;e[11]!==s?(y=s("markdownEditor.link"),e[11]=s,e[12]=y):y=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=f.jsx(Pt,{size:14}),e[13]=v):v=e[13];let M;e[14]!==u||e[15]!==y||e[16]!==d?(M=f.jsx(C,{active:u,label:y,onClick:d,children:v}),e[14]=u,e[15]=y,e[16]=d,e[17]=M):M=e[17];let m;e[18]!==u||e[19]!==b||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==x||e[25]!==s?(m=r&&f.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||a(!1)},children:[f.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:T=>{l(T.target.value),h(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),b()):T.key==="Escape"&&(T.preventDefault(),a(!1),n.chain().focus().run())},className:B("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),f.jsx(C,{active:!1,label:s("markdownEditor.linkApply"),onClick:b,children:f.jsx(at,{size:14})}),u&&f.jsx(C,{active:!1,label:s("markdownEditor.linkRemove"),onClick:x,children:f.jsx(qt,{size:14})})]}),e[18]=u,e[19]=b,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=x,e[25]=s,e[26]=m):m=e[26];let k;return e[27]!==M||e[28]!==m?(k=f.jsxs("div",{className:"relative",children:[M,m]}),e[27]=M,e[28]=m,e[29]=k):k=e[29],k}const ne=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=f.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Ae=t=>{const e=$.c(2),{children:n}=t;let s;return e[0]!==n?(s=f.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},Ke=[1,2,3],ln=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function cn(t){const e=$.c(20),{editor:n}=t,s=j(),[r,a]=_.useState(null);let i;e[0]!==n?(i={editor:n,selector:un},e[0]=n,e[1]=i):i=e[1];const l=dt(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let h;e[4]!==s?(h=s("markdownEditor.heading2"),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==s?(c=s("markdownEditor.heading3"),e[6]=s,e[7]=c):c=e[7];let u;e[8]!==o||e[9]!==h||e[10]!==c?(u={1:o,2:h,3:c},e[8]=o,e[9]=h,e[10]=c,e[11]=u):u=e[11];const p=u;let d;e[12]!==n||e[13]!==p||e[14]!==r||e[15]!==l||e[16]!==s?(d=r&&f.jsxs(zt,{editor:n,shouldShow:ln,appendTo:r,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[f.jsx(C,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:f.jsx(jt,{size:14})}),f.jsx(C,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:f.jsx(Nt,{size:14})}),f.jsx(C,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:f.jsx(Ht,{size:14})}),f.jsx(C,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:f.jsx(Ot,{size:14})}),f.jsx(ne,{}),Ke.map((x,w)=>f.jsx(C,{active:l.headings[w]??!1,label:p[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:f.jsx(Ae,{children:`H${x}`})},x)),f.jsx(ne,{}),f.jsx(C,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:f.jsx(Ft,{size:14})}),f.jsx(C,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:f.jsx(Ae,{children:"1."})}),f.jsx(C,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:f.jsx(Dt,{size:14})}),f.jsx(ne,{}),f.jsx(on,{editor:n})]}),e[12]=n,e[13]=p,e[14]=r,e[15]=l,e[16]=s,e[17]=d):d=e[17];let g;return e[18]!==d?(g=f.jsx("div",{ref:a,className:"relative z-20",children:d}),e[18]=d,e[19]=g):g=e[19],g}function un(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Ke.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const hn=10,pn=25,dn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function fn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dn[t.type]??""}function gn(){const t=$.c(4),e=j(),{upload:n}=Ut(Me),s=Zt(Me);let r;return t[0]!==s||t[1]!==e||t[2]!==n?(r={uploadFile:async i=>{const l=Ze(i),o=l?hn:pn;if(i.size>o*1024*1024)return se.error(e("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const h=l?Gt:Kt,c=`${crypto.randomUUID()}${fn(i)}`;try{return await n.mutateAsync({dir:h,files:[new File([i],c,{type:i.type})]}),s(`${h}/${c}`)}catch{return se.error(e("markdownEditor.uploadFailed",{name:i.name})),null}}},t[0]=s,t[1]=e,t[2]=n,t[3]=r):r=t[3],r}const X=new Be("uploadSlots"),mn=ue.create({name:"uploadSlots",addProseMirrorPlugins(){return[new ft({key:X,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(X);if(!t.docChanged&&!n)return e;const s=new Map;for(const[r,a]of e)s.set(r,t.mapping.map(a));if(n){const[r,a]=n;a===null?s.delete(r):s.set(r,a)}return s}}})]}});function ie(t,e,n){return t.setMeta(X,[e,n])}function kn(t,e){return X.getState(t)?.get(e)}function xn(t,e,n,s,r){const{schema:a}=t.state,i=a.nodes[n];if(!i)return;const l=i.create(s),o=t.state.selection.to===e,h=t.state.doc.resolve(e),c=h.parent.textBetween(Math.max(0,h.parentOffset-1),h.parentOffset,void 0,""),u=()=>a.text(" "),p=l.isInline?[...c&&!/\s/.test(c)?[u()]:[],l,u()]:l,d=t.state.tr.replaceWith(e,e,p);let g=e,x=e;d.mapping.maps.at(-1)?.forEach((M,m,k,T)=>{g=k,x=T});let w;d.doc.nodesBetween(g,x,(M,m)=>{M===l&&(w=m+M.nodeSize)});let b=w??x;w!==void 0&&l.isInline&&(b+=1);const y=a.nodes.paragraph;w!==void 0&&l.isBlock&&y&&(d.doc.resolve(w).nodeAfter?.isTextblock||d.insert(w,y.create()),b=w+1);const v=gt.near(d.doc.resolve(b));o&&d.setSelection(v),r&&ie(d,r,v.to),t.dispatch(d)}function bn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function wn(t=!0){const e=j(),{uploadFile:n}=gn(),s=_.useRef(n);s.current=n;const[r,a]=_.useState(0),i=_.useRef(0),l=u=>{i.current+=u,a(i.current)},o=(u,p,d)=>{if(!t||p.length===0)return!1;l(p.length);const g=Symbol("upload");return u.dispatch(ie(u.state.tr,g,d)),(async()=>{for(const x of p)try{const w=await s.current(x);if(!w||u.isDestroyed)continue;const b=Ze(x);xn(u,kn(u.state,g)??u.state.selection.to,b?"image":"attachment",b?{src:w,alt:x.name}:{href:w,name:x.name},g)}catch{se.error(e("markdownEditor.uploadFailed",{name:x.name}))}finally{l(-1)}u.isDestroyed||u.dispatch(ie(u.state.tr,g,null))})(),!0};return{pending:r,uploading:()=>i.current>0,uploadInto:o,handlePaste:(u,p)=>{const d=bn(p.clipboardData);return d.length===0?!1:(p.stopPropagation(),o(u,d,u.state.selection.to))},handleDrop:(u,p,d,g)=>{if(g)return!1;const x=Array.from(p.dataTransfer?.files??[]);if(x.length===0)return!1;const w=u.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return w===void 0?!1:(p.stopPropagation(),o(u,x,w))}}}function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=de();function We(t){O=t}var N={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var yn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Tn=/^(?:[ \t]*(?:\n|$))+/,vn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),En=S(Qe).replace(/bull/g,fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,An=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_n=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),ee="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$n=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ke).replace("tag",ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex(),Cn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),xe={blockquote:Cn,code:vn,def:Rn,fences:Sn,heading:Mn,hr:K,html:$n,lheading:Xe,list:_n,newline:Tn,paragraph:Ve,table:N,text:An},Re=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex(),In={...xe,lheading:En,table:Re,paragraph:S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex()},Ln={...xe,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(ge).replace("hr",K).replace("heading",` *#{1,6} *[^
1
+ import{c as $,b as j,r as _,j as f,m as B,aW as at,t as se,b3 as Oe,a4 as ot,hh as lt,i as ct,K as ut,c8 as ht,h as De,o as pt}from"./index-BfWp2Wnw.js";import{u as dt,t as Be,f as ue,A as ft,v as gt,Y as P,Z as mt,_ as kt,H as xt,I as D,$ as ve,a0 as bt,e as wt,a1 as Se,a2 as yt,a3 as G,N as Fe,a4 as he,c as qe,a5 as pe,a6 as Tt,a7 as vt,s as St,a8 as Mt,a as Et,E as At}from"./usage-stats-BXxRbW0f.js";import{T as C,n as Rt,i as _t,E as $t}from"./editor-classes-D6VscvFm.js";import{a as Ct,e as Ue,s as It,S as Lt}from"./suggestion-BO6GNdWk.js";import{B as zt}from"./index-BDN2Il8W.js";import{aE as Pt,ai as jt,aj as Nt,al as Ht,K as Ot,aY as Dt,aJ as Bt}from"./agent-icon-Bq_Z7esB.js";import{i as Ft}from"./SwitchHorizontal01-qTGCOGX6.js";import{s as qt}from"./Trash01-CevYpZEM.js";import{k as Ut,a as Zt}from"./use-org-fs-BAgR3Jkh.js";import{E as Me,i as Ze,b as Gt,c as Kt,d as Ge,A as Wt,e as Qt,f as Xt,g as Vt,j as Yt}from"./markdown-NetMLX1B.js";import{s as Jt,T as en}from"./index-DqFWx3BB.js";import{f as tn,a as nn,c as rn,C as sn,b as Ee}from"./command-DAachgGl.js";import{I as an}from"./icon-button-vJpGdaXv.js";function on(t){const e=$.c(30),{editor:n}=t,s=j(),[r,a]=_.useState(!1),[i,l]=_.useState(""),[o,h]=_.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const u=c;let p;e[2]!==n||e[3]!==r?(p=()=>{if(r){a(!1);return}const T=n.getAttributes("link").href;l(typeof T=="string"?T:""),h(!1),a(!0)},e[2]=n,e[3]=r,e[4]=p):p=e[4];const d=p;let g;e[5]!==n?(g=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),a(!1)},e[5]=n,e[6]=g):g=e[6];const x=g;let w;e[7]!==i||e[8]!==n||e[9]!==x?(w=()=>{const T=Rt(i);if(T===""){x();return}if(!_t(T)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T}).run(),a(!1)},e[7]=i,e[8]=n,e[9]=x,e[10]=w):w=e[10];const b=w;let y;e[11]!==s?(y=s("markdownEditor.link"),e[11]=s,e[12]=y):y=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=f.jsx(Pt,{size:14}),e[13]=v):v=e[13];let M;e[14]!==u||e[15]!==y||e[16]!==d?(M=f.jsx(C,{active:u,label:y,onClick:d,children:v}),e[14]=u,e[15]=y,e[16]=d,e[17]=M):M=e[17];let m;e[18]!==u||e[19]!==b||e[20]!==i||e[21]!==n||e[22]!==o||e[23]!==r||e[24]!==x||e[25]!==s?(m=r&&f.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||a(!1)},children:[f.jsx("input",{autoFocus:!0,type:"text","aria-label":s("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:s("markdownEditor.linkPlaceholder"),value:i,onChange:T=>{l(T.target.value),h(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),b()):T.key==="Escape"&&(T.preventDefault(),a(!1),n.chain().focus().run())},className:B("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),f.jsx(C,{active:!1,label:s("markdownEditor.linkApply"),onClick:b,children:f.jsx(at,{size:14})}),u&&f.jsx(C,{active:!1,label:s("markdownEditor.linkRemove"),onClick:x,children:f.jsx(qt,{size:14})})]}),e[18]=u,e[19]=b,e[20]=i,e[21]=n,e[22]=o,e[23]=r,e[24]=x,e[25]=s,e[26]=m):m=e[26];let k;return e[27]!==M||e[28]!==m?(k=f.jsxs("div",{className:"relative",children:[M,m]}),e[27]=M,e[28]=m,e[29]=k):k=e[29],k}const ne=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=f.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Ae=t=>{const e=$.c(2),{children:n}=t;let s;return e[0]!==n?(s=f.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=s):s=e[1],s},Ke=[1,2,3],ln=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function cn(t){const e=$.c(20),{editor:n}=t,s=j(),[r,a]=_.useState(null);let i;e[0]!==n?(i={editor:n,selector:un},e[0]=n,e[1]=i):i=e[1];const l=dt(i);let o;e[2]!==s?(o=s("markdownEditor.heading1"),e[2]=s,e[3]=o):o=e[3];let h;e[4]!==s?(h=s("markdownEditor.heading2"),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==s?(c=s("markdownEditor.heading3"),e[6]=s,e[7]=c):c=e[7];let u;e[8]!==o||e[9]!==h||e[10]!==c?(u={1:o,2:h,3:c},e[8]=o,e[9]=h,e[10]=c,e[11]=u):u=e[11];const p=u;let d;e[12]!==n||e[13]!==p||e[14]!==r||e[15]!==l||e[16]!==s?(d=r&&f.jsxs(zt,{editor:n,shouldShow:ln,appendTo:r,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":s("markdownEditor.toolbarAriaLabel"),children:[f.jsx(C,{active:l.bold,label:s("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:f.jsx(jt,{size:14})}),f.jsx(C,{active:l.italic,label:s("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:f.jsx(Nt,{size:14})}),f.jsx(C,{active:l.strike,label:s("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:f.jsx(Ht,{size:14})}),f.jsx(C,{active:l.code,label:s("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:f.jsx(Ot,{size:14})}),f.jsx(ne,{}),Ke.map((x,w)=>f.jsx(C,{active:l.headings[w]??!1,label:p[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:f.jsx(Ae,{children:`H${x}`})},x)),f.jsx(ne,{}),f.jsx(C,{active:l.bulletList,label:s("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:f.jsx(Ft,{size:14})}),f.jsx(C,{active:l.orderedList,label:s("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:f.jsx(Ae,{children:"1."})}),f.jsx(C,{active:l.blockquote,label:s("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:f.jsx(Dt,{size:14})}),f.jsx(ne,{}),f.jsx(on,{editor:n})]}),e[12]=n,e[13]=p,e[14]=r,e[15]=l,e[16]=s,e[17]=d):d=e[17];let g;return e[18]!==d?(g=f.jsx("div",{ref:a,className:"relative z-20",children:d}),e[18]=d,e[19]=g):g=e[19],g}function un(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Ke.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const hn=10,pn=25,dn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function fn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dn[t.type]??""}function gn(){const t=$.c(4),e=j(),{upload:n}=Ut(Me),s=Zt(Me);let r;return t[0]!==s||t[1]!==e||t[2]!==n?(r={uploadFile:async i=>{const l=Ze(i),o=l?hn:pn;if(i.size>o*1024*1024)return se.error(e("markdownEditor.fileTooLarge",{name:i.name,max:String(o)})),null;const h=l?Gt:Kt,c=`${crypto.randomUUID()}${fn(i)}`;try{return await n.mutateAsync({dir:h,files:[new File([i],c,{type:i.type})]}),s(`${h}/${c}`)}catch{return se.error(e("markdownEditor.uploadFailed",{name:i.name})),null}}},t[0]=s,t[1]=e,t[2]=n,t[3]=r):r=t[3],r}const X=new Be("uploadSlots"),mn=ue.create({name:"uploadSlots",addProseMirrorPlugins(){return[new ft({key:X,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(X);if(!t.docChanged&&!n)return e;const s=new Map;for(const[r,a]of e)s.set(r,t.mapping.map(a));if(n){const[r,a]=n;a===null?s.delete(r):s.set(r,a)}return s}}})]}});function ie(t,e,n){return t.setMeta(X,[e,n])}function kn(t,e){return X.getState(t)?.get(e)}function xn(t,e,n,s,r){const{schema:a}=t.state,i=a.nodes[n];if(!i)return;const l=i.create(s),o=t.state.selection.to===e,h=t.state.doc.resolve(e),c=h.parent.textBetween(Math.max(0,h.parentOffset-1),h.parentOffset,void 0,""),u=()=>a.text(" "),p=l.isInline?[...c&&!/\s/.test(c)?[u()]:[],l,u()]:l,d=t.state.tr.replaceWith(e,e,p);let g=e,x=e;d.mapping.maps.at(-1)?.forEach((M,m,k,T)=>{g=k,x=T});let w;d.doc.nodesBetween(g,x,(M,m)=>{M===l&&(w=m+M.nodeSize)});let b=w??x;w!==void 0&&l.isInline&&(b+=1);const y=a.nodes.paragraph;w!==void 0&&l.isBlock&&y&&(d.doc.resolve(w).nodeAfter?.isTextblock||d.insert(w,y.create()),b=w+1);const v=gt.near(d.doc.resolve(b));o&&d.setSelection(v),r&&ie(d,r,v.to),t.dispatch(d)}function bn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function wn(t=!0){const e=j(),{uploadFile:n}=gn(),s=_.useRef(n);s.current=n;const[r,a]=_.useState(0),i=_.useRef(0),l=u=>{i.current+=u,a(i.current)},o=(u,p,d)=>{if(!t||p.length===0)return!1;l(p.length);const g=Symbol("upload");return u.dispatch(ie(u.state.tr,g,d)),(async()=>{for(const x of p)try{const w=await s.current(x);if(!w||u.isDestroyed)continue;const b=Ze(x);xn(u,kn(u.state,g)??u.state.selection.to,b?"image":"attachment",b?{src:w,alt:x.name}:{href:w,name:x.name},g)}catch{se.error(e("markdownEditor.uploadFailed",{name:x.name}))}finally{l(-1)}u.isDestroyed||u.dispatch(ie(u.state.tr,g,null))})(),!0};return{pending:r,uploading:()=>i.current>0,uploadInto:o,handlePaste:(u,p)=>{const d=bn(p.clipboardData);return d.length===0?!1:(p.stopPropagation(),o(u,d,u.state.selection.to))},handleDrop:(u,p,d,g)=>{if(g)return!1;const x=Array.from(p.dataTransfer?.files??[]);if(x.length===0)return!1;const w=u.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return w===void 0?!1:(p.stopPropagation(),o(u,x,w))}}}function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var O=de();function We(t){O=t}var N={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(R.caret,"$1"),n=n.replace(r,i),s},getRegex:()=>new RegExp(n,e)};return s}var yn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Tn=/^(?:[ \t]*(?:\n|$))+/,vn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Sn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),En=S(Qe).replace(/bull/g,fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,An=/^[^\n]+/,me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_n=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fe).getRegex(),ee="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$n=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ke).replace("tag",ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex(),Cn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),xe={blockquote:Cn,code:vn,def:Rn,fences:Sn,heading:Mn,hr:K,html:$n,lheading:Xe,list:_n,newline:Tn,paragraph:Ve,table:N,text:An},Re=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex(),In={...xe,lheading:En,table:Re,paragraph:S(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ee).getRegex()},Ln={...xe,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:N,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(ge).replace("hr",K).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ye=/^( {2,}|\\)\n(?!\s*$)/,jn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,F=/[\p{P}\p{S}]/u,te=/[\s\p{P}\p{S}]/u,be=/[^\s\p{P}\p{S}]/u,Nn=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,te).getRegex(),Je=/(?!~)[\p{P}\p{S}]/u,Hn=/(?!~)[\s\p{P}\p{S}]/u,On=/(?:[^\s\p{P}\p{S}]|~)/u,Dn=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",yn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),et=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bn=S(et,"u").replace(/punct/g,F).getRegex(),Fn=S(et,"u").replace(/punct/g,Je).getRegex(),tt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qn=S(tt,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Un=S(tt,"gu").replace(/notPunctSpace/g,On).replace(/punctSpace/g,Hn).replace(/punct/g,Je).getRegex(),Zn=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Gn=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,F).getRegex(),Kn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Wn=S(Kn,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,te).replace(/punct/g,F).getRegex(),Qn=S(/\\(punct)/,"gu").replace(/punct/g,F).getRegex(),Xn=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Vn=S(ke).replace("(?:-->|$)","-->").getRegex(),Yn=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Vn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),V=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Jn=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",V).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nt=S(/^!?\[(label)\]\[(ref)\]/).replace("label",V).replace("ref",me).getRegex(),rt=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),er=S("reflink|nolink(?!\\()","g").replace("reflink",nt).replace("nolink",rt).getRegex(),_e=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,we={_backpedal:N,anyPunctuation:Qn,autolink:Xn,blockSkip:Dn,br:Ye,code:Pn,del:N,delLDelim:N,delRDelim:N,emStrongLDelim:Bn,emStrongRDelimAst:qn,emStrongRDelimUnd:Zn,escape:zn,link:Jn,nolink:rt,punctuation:Nn,reflink:nt,reflinkSearch:er,tag:Yn,text:jn,url:N},tr={...we,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",V).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V).getRegex()},ae={...we,emStrongRDelimAst:Un,emStrongLDelim:Fn,delLDelim:Gn,delRDelim:Wn,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_e).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",_e).getRegex()},nr={...ae,br:S(Ye).replace("{2,}","*").getRegex(),text:S(ae.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},W={normal:xe,gfm:In,pedantic:Ln},q={normal:we,gfm:ae,breaks:nr,pedantic:tr},rr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$e=t=>rr[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,$e)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,$e);return t}function Ce(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function Ie(t,e){let n=t.replace(R.findPipe,(a,i,l)=>{let o=!1,h=i;for(;--h>=0&&l[h]==="\\";)o=!o;return o?"|":" |"}),s=n.split(R.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(R.slashPipe,"|");return s}function U(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function sr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function ir(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let a=4-n%4;s+=" ".repeat(a),n+=a}else s+=r,n++;return s}function Le(t,e,n,s,r){let a=e.href,i=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function ar(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
3
3
  `).map(a=>{let i=a.match(n.other.beginningSpace);if(i===null)return a;let[l]=i;return l.length>=r.length?a.slice(r.length):a}).join(`
4
4
  `)}var Y=class{options;rules;lexer;constructor(t){this.options=t||O}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:U(n,`
@@ -1 +1 @@
1
- import{c as y,ar as W,at as q,b as E,r as _,d as G,j as o,aR as $,R as I,P as N,n as U,B as k,b5 as V}from"./index-DPOIY_Am.js";import{u as K}from"./use-mobile-D-TLPrvO.js";import{T as Y,a as Z,c as J}from"./tooltip-t1fF0XB_.js";import{b as Q,a as X}from"./Minimize01-BlpbOmPN.js";import{s as ee}from"./XClose-GLz4aiio.js";import{b as te}from"./thread-button-B3WqZBtr.js";import{T as ne}from"./toolbar-icon-button-qHG6EBvv.js";import{b as se,R as oe,a as D}from"./resizable-D1QL_pk1.js";import{c as re,r as ie,m as le}from"./use-chat-layout-state-p7r6M8ce.js";import{R as ae}from"./route-page-header-DrwKWE7S.js";import"./index-QeA7kseb.js";import"./use-sidebar-collapsed-Dfwqn3HW.js";import"./sheet-DRbCBFle.js";import"./use-in-settings-CbO5uykc.js";import"./use-panel-navigate-C9YlWWPn.js";import"./thread-route-2gqMIzEM.js";import"./use-project-scope-aZyY3ntO.js";import"./repository-binding-BKMgK4Io.js";import"./use-mcp-client-B-wVa8u0.js";import"./auth-DqmRg67b.js";import"./LayoutLeft-CotbVucz.js";import"./use-current-view-CxN5GETM.js";function A(t,e){const n=typeof t=="number"?t:Number(t);return!Number.isFinite(n)||n<=0||n>=100?e:n}function ce(t,e){const n=y.c(8);let i;n[0]!==e?(i=c=>A(c,e),n[0]=e,n[1]=i):i=n[1];const[r,l]=W(t,i);let s;n[2]!==e||n[3]!==r?(s=A(r,e),n[2]=e,n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==l||n[6]!==s?(a=[s,l],n[5]=l,n[6]=s,n[7]=a):a=n[7],a}const ue=33;function de(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=q.sidePanelWidth(),t[0]=e):e=t[0],ce(e,ue)}const P="chat-layout-thread",M="chat-layout-content",H="320px",O=_.createContext(null);function Fe(){return T()}function fe(){return _.use(O)}function T(){const t=_.use(O);if(!t)throw new Error("ChatLayout regions require a ChatLayout");return t}function me(t){const e=y.c(22),{children:n,...i}=t,r=K(),l=G(),s=_.useRef(null),[a,c]=de(),{threadOpen:u,contentOpen:d}=i,m=re(i),h=u&&d?a:m.side,p=100-h,j=b=>{const S=b.getLayout(),w=S[P],v=S[M];typeof w!="number"||typeof v!="number"||Math.abs(w-h)<.001&&Math.abs(v-p)<.001||b.setLayout({[P]:h,[M]:p})},C=ie(i);let x;e[0]!==r||e[1]!==i||e[2]!==C?(x={...i,isMobile:r,mobileSurface:C},e[0]=r,e[1]=i,e[2]=C,e[3]=x):x=e[3];const f=x;let g;e[4]!==r||e[5]!==i||e[6]!==l||e[7]!==f?(g=r&&!i.threadless&&o.jsx(te,{open:f.mobileSurface==="chat",onToggle:()=>{l({to:".",search:b=>({...b,...le(f.mobileSurface==="chat"?"main":"chat")}),replace:!0})}}),e[4]=r,e[5]=i,e[6]=l,e[7]=f,e[8]=g):g=e[8];let L;e[9]!==n||e[10]!==d||e[11]!==p||e[12]!==r||e[13]!==c||e[14]!==j||e[15]!==u||e[16]!==h?(L=r?o.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:n}):o.jsx(oe,{ref:b=>{if(s.current=b,!b)return;let S=!0;return queueMicrotask(()=>{S&&j(b)}),()=>{S=!1,s.current===b&&(s.current=null)}},defaultLayout:{[P]:h,[M]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0",style:{overflow:"visible"},onLayoutChanged:(b,S)=>{const{isUserInteraction:w}=S;if(!w){const B=s.current;B&&j(B);return}const v=b[P];u&&d&&typeof v=="number"&&v>0&&v<100&&c(v)},children:n}),e[9]=n,e[10]=d,e[11]=p,e[12]=r,e[13]=c,e[14]=j,e[15]=u,e[16]=h,e[17]=L):L=e[17];let z;return e[18]!==g||e[19]!==L||e[20]!==f?(z=o.jsxs(O,{value:f,children:[g,L]}),e[18]=g,e[19]=L,e[20]=f,e[21]=z):z=e[21],z}function he(t){const e=y.c(14),{children:n,topbar:i}=t,r=T();if(r.isMobile){let u;return e[0]!==n||e[1]!==r.mobileSurface||e[2]!==i?(u=r.mobileSurface==="chat"?o.jsxs(N,{variant:"plain","data-slot":"chat-layout-thread",children:[i,o.jsx(N.Content,{"data-testid":"chat-panel",children:n})]}):null,e[0]=n,e[1]=r.mobileSurface,e[2]=i,e[3]=u):u=e[3],u}if(!r.threadOpen)return null;let l;e[4]!==r.contentOpen?(l=r.contentOpen&&o.jsx(se,{className:"bg-sidebar"}),e[4]=r.contentOpen,e[5]=l):l=e[5];let s;e[6]!==n?(s=o.jsx(N.Content,{"data-testid":"chat-panel",children:n}),e[6]=n,e[7]=s):s=e[7];let a;e[8]!==s||e[9]!==i?(a=o.jsx(D,{id:P,defaultSize:"33%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsx("div",{className:"h-full min-h-0 p-0.5",children:o.jsxs(N,{"data-testid":"side-panel",children:[i,s]})})}),e[8]=s,e[9]=i,e[10]=a):a=e[10];let c;return e[11]!==l||e[12]!==a?(c=o.jsxs(o.Fragment,{children:[l,a]}),e[11]=l,e[12]=a,e[13]=c):c=e[13],c}function F(t){const e=y.c(10),{label:n,pressed:i,onClick:r,children:l}=t;let s;e[0]!==l||e[1]!==n||e[2]!==r||e[3]!==i?(s=o.jsx(Y,{asChild:!0,children:o.jsx(ne,{"aria-label":n,"aria-pressed":i,onClick:r,children:l})}),e[0]=l,e[1]=n,e[2]=r,e[3]=i,e[4]=s):s=e[4];let a;e[5]!==n?(a=o.jsx(Z,{side:"bottom",children:n}),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==s||e[8]!==a?(c=o.jsxs(J,{children:[s,a]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}function pe(){const t=y.c(14),e=E(),n=T();if(n.isMobile||n.threadless)return null;const i=!n.threadOpen;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{"aria-hidden":!0,className:"mr-1.5 h-4 w-px shrink-0 bg-border"}),t[0]=r):r=t[0];let l;t[1]!==i||t[2]!==n.toggleFullscreen||t[3]!==e?(l=i?o.jsxs(k,{variant:"ghost",size:"sm","aria-pressed":!0,className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:n.toggleFullscreen,children:[o.jsx(Q,{size:16}),e("page.exitFullscreen")]}):o.jsx(F,{label:e("page.enterFullscreen"),onClick:n.toggleFullscreen,children:o.jsx(X,{size:16})}),t[1]=i,t[2]=n.toggleFullscreen,t[3]=e,t[4]=l):l=t[4];let s;t[5]!==e?(s=e("page.closeMainPanel"),t[5]=e,t[6]=s):s=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(ee,{size:16}),t[7]=a):a=t[7];let c;t[8]!==n.toggleContent||t[9]!==s?(c=o.jsx(F,{label:s,onClick:n.toggleContent,children:a}),t[8]=n.toggleContent,t[9]=s,t[10]=c):c=t[10];let u;return t[11]!==l||t[12]!==c?(u=o.jsxs("div",{className:"flex items-center gap-0.5",children:[r,l,c]}),t[11]=l,t[12]=c,t[13]=u):u=t[13],u}function Ke(){const t=y.c(9),e=E(),n=K(),i=fe();if(n||!i||i.threadless||i.contentOpen)return null;const r=i.toggleContent;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(xe,{}),t[0]=l):l=t[0];let s;t[1]!==e?(s=e("page.openMainPanel"),t[1]=e,t[2]=s):s=t[2];let a;t[3]!==i.toggleContent||t[4]!==s?(a=o.jsxs(k,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:r,children:[l,s]}),t[3]=i.toggleContent,t[4]=s,t[5]=a):a=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border"}),t[6]=c):c=t[6];let u;return t[7]!==a?(u=o.jsxs(o.Fragment,{children:[a,c]}),t[7]=a,t[8]=u):u=t[8],u}function xe(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"shrink-0",children:o.jsx("path",{d:"M4 5v14M8 12h12m0 0-6-6m6 6-6 6"})}),t[0]=e):e=t[0],e}function ge({children:t,routeId:e}){return t}function R(t){const e=y.c(26),{children:n,actions:i,drawer:r,aside:l}=t,s=T();if(s.isMobile&&s.mobileSurface!=="main")return null;const a=s.isMobile?"plain":"card";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(pe,{}),e[0]=c):c=e[0];let u;e[1]!==i||e[2]!==s.contentNavigation?(u=o.jsx(ae,{navigation:s.contentNavigation,actions:i,trailingActions:c}),e[1]=i,e[2]=s.contentNavigation,e[3]=u):u=e[3];let d;e[4]!==n||e[5]!==s.contentKey?(d=o.jsx($,{children:o.jsx(ge,{routeId:s.contentKey,children:n})}),e[4]=n,e[5]=s.contentKey,e[6]=d):d=e[6];let m;e[7]!==s.contentKey||e[8]!==d?(m=o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(I,{children:d},s.contentKey)}),e[7]=s.contentKey,e[8]=d,e[9]=m):m=e[9];let h;e[10]!==r||e[11]!==m?(h=o.jsxs(N.Content,{children:[m,r]}),e[10]=r,e[11]=m,e[12]=h):h=e[12];let p;e[13]!==u||e[14]!==h?(p=o.jsxs(U.Breadcrumbs.Provider,{children:[u,h]}),e[13]=u,e[14]=h,e[15]=p):p=e[15];let j;e[16]!==a||e[17]!==p?(j=o.jsx(N,{"data-testid":"main-panel",variant:a,children:p}),e[16]=a,e[17]=p,e[18]=j):j=e[18];const C=j;if(s.isMobile)return C;if(!s.contentOpen)return null;let x;e[19]!==C?(x=o.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:C}),e[19]=C,e[20]=x):x=e[20];let f;e[21]!==l?(f=l&&o.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:o.jsx(N,{"data-testid":"aside-panel",children:o.jsx(I,{children:o.jsx($,{children:l})},_.isValidElement(l)?l.key??void 0:void 0)})}),e[21]=l,e[22]=f):f=e[22];let g;return e[23]!==f||e[24]!==x?(g=o.jsx(D,{id:M,defaultSize:"67%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsxs("div",{className:"flex h-full min-h-0",children:[x,f]})}),e[23]=f,e[24]=x,e[25]=g):g=e[25],g}function De(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(R,{children:o.jsx(V,{})}),t[0]=e):e=t[0],e}function He(t){const e=y.c(18),{error:n,reset:i}=t,r=E();let l;e[0]!==r?(l=r("common.errorBoundary.somethingWentWrong"),e[0]=r,e[1]=l):l=e[1];let s;e[2]!==l?(s=o.jsx("h2",{className:"text-lg font-medium",children:l}),e[2]=l,e[3]=s):s=e[3];let a;e[4]!==n.message||e[5]!==r?(a=n.message||r("common.errorBoundary.unexpectedError"),e[4]=n.message,e[5]=r,e[6]=a):a=e[6];let c;e[7]!==a?(c=o.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:a}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==r?(u=r("common.errorBoundary.tryAgain"),e[9]=r,e[10]=u):u=e[10];let d;e[11]!==i||e[12]!==u?(d=o.jsx(k,{variant:"outline",onClick:i,children:u}),e[11]=i,e[12]=u,e[13]=d):d=e[13];let m;return e[14]!==s||e[15]!==c||e[16]!==d?(m=o.jsx(R,{children:o.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[s,c,d]})}),e[14]=s,e[15]=c,e[16]=d,e[17]=m):m=e[17],m}const We=Object.assign(me,{Thread:he,Content:R});export{We as ChatLayout,He as ChatLayoutError,De as ChatLayoutPending,Ke as OpenMainPanelButton,Fe as useChatLayout,fe as useOptionalChatLayout};
1
+ import{c as y,ar as W,at as q,b as E,r as _,d as G,j as o,aR as $,R as I,P as N,n as U,B as k,b5 as V}from"./index-BfWp2Wnw.js";import{u as K}from"./use-mobile-UoyYEGbQ.js";import{T as Y,a as Z,c as J}from"./tooltip-CqV-qcYU.js";import{b as Q,a as X}from"./Minimize01-BIynG3Ze.js";import{s as ee}from"./XClose-WYCPZpkD.js";import{b as te}from"./thread-button-Dy4pRky4.js";import{T as ne}from"./toolbar-icon-button-CaY1wsmY.js";import{b as se,R as oe,a as D}from"./resizable-BArMfXUk.js";import{c as re,r as ie,m as le}from"./use-chat-layout-state-CS1wv5hl.js";import{R as ae}from"./route-page-header-BeG7kyQP.js";import"./index-CvQo8gKP.js";import"./use-sidebar-collapsed-BtrwP1AE.js";import"./sheet-DT44IVE2.js";import"./use-in-settings-CRUM5hPE.js";import"./use-panel-navigate-db4k7dl4.js";import"./thread-route-Ds6Wombz.js";import"./use-project-scope-CFftAYVY.js";import"./repository-binding-BDu0tU0n.js";import"./use-mcp-client-HASDr5yn.js";import"./auth-BOZ5swZI.js";import"./LayoutLeft-CPMSR00X.js";import"./use-current-view-B5rf1h54.js";function A(t,e){const n=typeof t=="number"?t:Number(t);return!Number.isFinite(n)||n<=0||n>=100?e:n}function ce(t,e){const n=y.c(8);let i;n[0]!==e?(i=c=>A(c,e),n[0]=e,n[1]=i):i=n[1];const[r,l]=W(t,i);let s;n[2]!==e||n[3]!==r?(s=A(r,e),n[2]=e,n[3]=r,n[4]=s):s=n[4];let a;return n[5]!==l||n[6]!==s?(a=[s,l],n[5]=l,n[6]=s,n[7]=a):a=n[7],a}const ue=33;function de(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=q.sidePanelWidth(),t[0]=e):e=t[0],ce(e,ue)}const P="chat-layout-thread",M="chat-layout-content",H="320px",O=_.createContext(null);function Fe(){return T()}function fe(){return _.use(O)}function T(){const t=_.use(O);if(!t)throw new Error("ChatLayout regions require a ChatLayout");return t}function me(t){const e=y.c(22),{children:n,...i}=t,r=K(),l=G(),s=_.useRef(null),[a,c]=de(),{threadOpen:u,contentOpen:d}=i,m=re(i),h=u&&d?a:m.side,p=100-h,j=b=>{const S=b.getLayout(),w=S[P],v=S[M];typeof w!="number"||typeof v!="number"||Math.abs(w-h)<.001&&Math.abs(v-p)<.001||b.setLayout({[P]:h,[M]:p})},C=ie(i);let x;e[0]!==r||e[1]!==i||e[2]!==C?(x={...i,isMobile:r,mobileSurface:C},e[0]=r,e[1]=i,e[2]=C,e[3]=x):x=e[3];const f=x;let g;e[4]!==r||e[5]!==i||e[6]!==l||e[7]!==f?(g=r&&!i.threadless&&o.jsx(te,{open:f.mobileSurface==="chat",onToggle:()=>{l({to:".",search:b=>({...b,...le(f.mobileSurface==="chat"?"main":"chat")}),replace:!0})}}),e[4]=r,e[5]=i,e[6]=l,e[7]=f,e[8]=g):g=e[8];let L;e[9]!==n||e[10]!==d||e[11]!==p||e[12]!==r||e[13]!==c||e[14]!==j||e[15]!==u||e[16]!==h?(L=r?o.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:n}):o.jsx(oe,{ref:b=>{if(s.current=b,!b)return;let S=!0;return queueMicrotask(()=>{S&&j(b)}),()=>{S=!1,s.current===b&&(s.current=null)}},defaultLayout:{[P]:h,[M]:p},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0",style:{overflow:"visible"},onLayoutChanged:(b,S)=>{const{isUserInteraction:w}=S;if(!w){const B=s.current;B&&j(B);return}const v=b[P];u&&d&&typeof v=="number"&&v>0&&v<100&&c(v)},children:n}),e[9]=n,e[10]=d,e[11]=p,e[12]=r,e[13]=c,e[14]=j,e[15]=u,e[16]=h,e[17]=L):L=e[17];let z;return e[18]!==g||e[19]!==L||e[20]!==f?(z=o.jsxs(O,{value:f,children:[g,L]}),e[18]=g,e[19]=L,e[20]=f,e[21]=z):z=e[21],z}function he(t){const e=y.c(14),{children:n,topbar:i}=t,r=T();if(r.isMobile){let u;return e[0]!==n||e[1]!==r.mobileSurface||e[2]!==i?(u=r.mobileSurface==="chat"?o.jsxs(N,{variant:"plain","data-slot":"chat-layout-thread",children:[i,o.jsx(N.Content,{"data-testid":"chat-panel",children:n})]}):null,e[0]=n,e[1]=r.mobileSurface,e[2]=i,e[3]=u):u=e[3],u}if(!r.threadOpen)return null;let l;e[4]!==r.contentOpen?(l=r.contentOpen&&o.jsx(se,{className:"bg-sidebar"}),e[4]=r.contentOpen,e[5]=l):l=e[5];let s;e[6]!==n?(s=o.jsx(N.Content,{"data-testid":"chat-panel",children:n}),e[6]=n,e[7]=s):s=e[7];let a;e[8]!==s||e[9]!==i?(a=o.jsx(D,{id:P,defaultSize:"33%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsx("div",{className:"h-full min-h-0 p-0.5",children:o.jsxs(N,{"data-testid":"side-panel",children:[i,s]})})}),e[8]=s,e[9]=i,e[10]=a):a=e[10];let c;return e[11]!==l||e[12]!==a?(c=o.jsxs(o.Fragment,{children:[l,a]}),e[11]=l,e[12]=a,e[13]=c):c=e[13],c}function F(t){const e=y.c(10),{label:n,pressed:i,onClick:r,children:l}=t;let s;e[0]!==l||e[1]!==n||e[2]!==r||e[3]!==i?(s=o.jsx(Y,{asChild:!0,children:o.jsx(ne,{"aria-label":n,"aria-pressed":i,onClick:r,children:l})}),e[0]=l,e[1]=n,e[2]=r,e[3]=i,e[4]=s):s=e[4];let a;e[5]!==n?(a=o.jsx(Z,{side:"bottom",children:n}),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==s||e[8]!==a?(c=o.jsxs(J,{children:[s,a]}),e[7]=s,e[8]=a,e[9]=c):c=e[9],c}function pe(){const t=y.c(14),e=E(),n=T();if(n.isMobile||n.threadless)return null;const i=!n.threadOpen;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("span",{"aria-hidden":!0,className:"mr-1.5 h-4 w-px shrink-0 bg-border"}),t[0]=r):r=t[0];let l;t[1]!==i||t[2]!==n.toggleFullscreen||t[3]!==e?(l=i?o.jsxs(k,{variant:"ghost",size:"sm","aria-pressed":!0,className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:n.toggleFullscreen,children:[o.jsx(Q,{size:16}),e("page.exitFullscreen")]}):o.jsx(F,{label:e("page.enterFullscreen"),onClick:n.toggleFullscreen,children:o.jsx(X,{size:16})}),t[1]=i,t[2]=n.toggleFullscreen,t[3]=e,t[4]=l):l=t[4];let s;t[5]!==e?(s=e("page.closeMainPanel"),t[5]=e,t[6]=s):s=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(ee,{size:16}),t[7]=a):a=t[7];let c;t[8]!==n.toggleContent||t[9]!==s?(c=o.jsx(F,{label:s,onClick:n.toggleContent,children:a}),t[8]=n.toggleContent,t[9]=s,t[10]=c):c=t[10];let u;return t[11]!==l||t[12]!==c?(u=o.jsxs("div",{className:"flex items-center gap-0.5",children:[r,l,c]}),t[11]=l,t[12]=c,t[13]=u):u=t[13],u}function Ke(){const t=y.c(9),e=E(),n=K(),i=fe();if(n||!i||i.threadless||i.contentOpen)return null;const r=i.toggleContent;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(xe,{}),t[0]=l):l=t[0];let s;t[1]!==e?(s=e("page.openMainPanel"),t[1]=e,t[2]=s):s=t[2];let a;t[3]!==i.toggleContent||t[4]!==s?(a=o.jsxs(k,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 px-2 text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground",onClick:r,children:[l,s]}),t[3]=i.toggleContent,t[4]=s,t[5]=a):a=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("span",{"aria-hidden":!0,className:"mx-1 h-4 w-px shrink-0 bg-border"}),t[6]=c):c=t[6];let u;return t[7]!==a?(u=o.jsxs(o.Fragment,{children:[a,c]}),t[7]=a,t[8]=u):u=t[8],u}function xe(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"shrink-0",children:o.jsx("path",{d:"M4 5v14M8 12h12m0 0-6-6m6 6-6 6"})}),t[0]=e):e=t[0],e}function ge({children:t,routeId:e}){return t}function R(t){const e=y.c(26),{children:n,actions:i,drawer:r,aside:l}=t,s=T();if(s.isMobile&&s.mobileSurface!=="main")return null;const a=s.isMobile?"plain":"card";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(pe,{}),e[0]=c):c=e[0];let u;e[1]!==i||e[2]!==s.contentNavigation?(u=o.jsx(ae,{navigation:s.contentNavigation,actions:i,trailingActions:c}),e[1]=i,e[2]=s.contentNavigation,e[3]=u):u=e[3];let d;e[4]!==n||e[5]!==s.contentKey?(d=o.jsx($,{children:o.jsx(ge,{routeId:s.contentKey,children:n})}),e[4]=n,e[5]=s.contentKey,e[6]=d):d=e[6];let m;e[7]!==s.contentKey||e[8]!==d?(m=o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(I,{children:d},s.contentKey)}),e[7]=s.contentKey,e[8]=d,e[9]=m):m=e[9];let h;e[10]!==r||e[11]!==m?(h=o.jsxs(N.Content,{children:[m,r]}),e[10]=r,e[11]=m,e[12]=h):h=e[12];let p;e[13]!==u||e[14]!==h?(p=o.jsxs(U.Breadcrumbs.Provider,{children:[u,h]}),e[13]=u,e[14]=h,e[15]=p):p=e[15];let j;e[16]!==a||e[17]!==p?(j=o.jsx(N,{"data-testid":"main-panel",variant:a,children:p}),e[16]=a,e[17]=p,e[18]=j):j=e[18];const C=j;if(s.isMobile)return C;if(!s.contentOpen)return null;let x;e[19]!==C?(x=o.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:C}),e[19]=C,e[20]=x):x=e[20];let f;e[21]!==l?(f=l&&o.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:o.jsx(N,{"data-testid":"aside-panel",children:o.jsx(I,{children:o.jsx($,{children:l})},_.isValidElement(l)?l.key??void 0:void 0)})}),e[21]=l,e[22]=f):f=e[22];let g;return e[23]!==f||e[24]!==x?(g=o.jsx(D,{id:M,defaultSize:"67%",minSize:H,className:"min-w-0 overflow-hidden bg-sidebar",children:o.jsxs("div",{className:"flex h-full min-h-0",children:[x,f]})}),e[23]=f,e[24]=x,e[25]=g):g=e[25],g}function De(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(R,{children:o.jsx(V,{})}),t[0]=e):e=t[0],e}function He(t){const e=y.c(18),{error:n,reset:i}=t,r=E();let l;e[0]!==r?(l=r("common.errorBoundary.somethingWentWrong"),e[0]=r,e[1]=l):l=e[1];let s;e[2]!==l?(s=o.jsx("h2",{className:"text-lg font-medium",children:l}),e[2]=l,e[3]=s):s=e[3];let a;e[4]!==n.message||e[5]!==r?(a=n.message||r("common.errorBoundary.unexpectedError"),e[4]=n.message,e[5]=r,e[6]=a):a=e[6];let c;e[7]!==a?(c=o.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:a}),e[7]=a,e[8]=c):c=e[8];let u;e[9]!==r?(u=r("common.errorBoundary.tryAgain"),e[9]=r,e[10]=u):u=e[10];let d;e[11]!==i||e[12]!==u?(d=o.jsx(k,{variant:"outline",onClick:i,children:u}),e[11]=i,e[12]=u,e[13]=d):d=e[13];let m;return e[14]!==s||e[15]!==c||e[16]!==d?(m=o.jsx(R,{children:o.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[s,c,d]})}),e[14]=s,e[15]=c,e[16]=d,e[17]=m):m=e[17],m}const We=Object.assign(me,{Thread:he,Content:R});export{We as ChatLayout,He as ChatLayoutError,De as ChatLayoutPending,Ke as OpenMainPanelButton,Fe as useChatLayout,fe as useOptionalChatLayout};
@@ -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-BP3RFx-W.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-BXxRbW0f.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=`
@@ -1 +1 @@
1
- import{r as l,b$ as ce,j as p,c5 as _,c4 as T,c2 as C,ca as le,b_ as de,cm as ue,ci as fe,cb as me}from"./index-DPOIY_Am.js";import{c as Y}from"./index-BdQq_4o_.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[H,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:w=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),x=r==="horizontal"?ge:ve,[S=[],K]=ce({prop:h,defaultProp:w,onChange:b=>{[...m.current][f.current]?.focus(),i(b)}}),j=l.useRef(S);function B(b){const y=ye(S,b);I(b,y)}function se(b){I(b,f.current)}function ae(){const b=j.current[f.current];S[f.current]!==b&&d(S)}function I(b,y,{commit:k}={commit:!1}){const U=_e(c),z=Ce(Math.round((b-n)/c)*c+n,U),A=Y(z,[n,s]);K((E=[])=>{const P=be(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(H.Provider,{scope:e.__scopeSlider,children:p.jsx(H.Slot,{scope:e.__scopeSlider,children:p.jsx(x,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&I(n,0,{commit:!0}),onEndKeyDown:()=>!a&&I(s,S.length-1,{commit:!0}),onStepKeyDown:({event:b,direction:y})=>{if(!a){const z=$.includes(b.key)||b.shiftKey&&X.includes(b.key)?10:1,A=f.current,E=S[A],P=c*z*y;I(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:w,...h}=e,[i,d]=l.useState(null),v=C(t,x=>d(x)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(x){const S=R.current||i.getBoundingClientRect(),K=[0,S.width],B=O(K,f?[o,n]:[n,o]);return R.current=S,B(x-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const S=D(x.clientX);r?.(S)},onSlideMove:x=>{const S=D(x.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:x=>{const K=G[f?"from-left":"from-right"].includes(x.key);w?.({event:x,direction:K?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...w}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],x=O(f,v?[n,o]:[o,n]);return d.current=m,x(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...w,ref:i,style:{...w.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...w}=e,h=V(M,o);return p.jsx(T.span,{...w,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,w=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...w):0,i=100-Math.max(...w);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(we,{...e,ref:c,index:r})}),we=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,w]=l.useState(null),h=C(t,D=>w(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(H.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var xe="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=xe;function be(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ie=q,Ae=te,Te=ne,Ve=oe;export{Te as R,Ae as T,Ie as a,Ve as b};
1
+ import{r as l,b$ as ce,j as p,c5 as _,c4 as T,c2 as C,ca as le,b_ as de,cm as ue,ci as fe,cb as me}from"./index-BfWp2Wnw.js";import{c as Y}from"./index-BdQq_4o_.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[H,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:w=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),x=r==="horizontal"?ge:ve,[S=[],K]=ce({prop:h,defaultProp:w,onChange:b=>{[...m.current][f.current]?.focus(),i(b)}}),j=l.useRef(S);function B(b){const y=ye(S,b);I(b,y)}function se(b){I(b,f.current)}function ae(){const b=j.current[f.current];S[f.current]!==b&&d(S)}function I(b,y,{commit:k}={commit:!1}){const U=_e(c),z=Ce(Math.round((b-n)/c)*c+n,U),A=Y(z,[n,s]);K((E=[])=>{const P=be(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(H.Provider,{scope:e.__scopeSlider,children:p.jsx(H.Slot,{scope:e.__scopeSlider,children:p.jsx(x,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&I(n,0,{commit:!0}),onEndKeyDown:()=>!a&&I(s,S.length-1,{commit:!0}),onStepKeyDown:({event:b,direction:y})=>{if(!a){const z=$.includes(b.key)||b.shiftKey&&X.includes(b.key)?10:1,A=f.current,E=S[A],P=c*z*y;I(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:w,...h}=e,[i,d]=l.useState(null),v=C(t,x=>d(x)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(x){const S=R.current||i.getBoundingClientRect(),K=[0,S.width],B=O(K,f?[o,n]:[n,o]);return R.current=S,B(x-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const S=D(x.clientX);r?.(S)},onSlideMove:x=>{const S=D(x.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:x=>{const K=G[f?"from-left":"from-right"].includes(x.key);w?.({event:x,direction:K?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...w}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],x=O(f,v?[n,o]:[o,n]);return d.current=m,x(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...w,ref:i,style:{...w.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...w}=e,h=V(M,o);return p.jsx(T.span,{...w,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,w=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...w):0,i=100-Math.max(...w);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(we,{...e,ref:c,index:r})}),we=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,w]=l.useState(null),h=C(t,D=>w(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(H.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var xe="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=xe;function be(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ie=q,Ae=te,Te=ne,Ve=oe;export{Te as R,Ae as T,Ie as a,Ve as b};
@@ -1 +1 @@
1
- import{r as s,b_ as L,b$ as B,j as c,f_ as q,c4 as x,c2 as E,fZ as K,c5 as C,f$ as I,d$ as T,ci as w,cb as U,cm as V}from"./index-DPOIY_Am.js";var _="Radio",[$,P]=w(_),[z,H]=$(_),k=s.forwardRef((t,d)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(d,b=>m(b)),u=s.useRef(!1),h=p?R||!!p.closest("form"):!0;return c.jsxs(z,{scope:o,checked:e,disabled:a,children:[c.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,b=>{e||f?.(),h&&(u.current=b.isPropagationStopped(),u.current||b.stopPropagation())})}),h&&c.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=_;var g="RadioIndicator",G=s.forwardRef((t,d)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=H(g,o);return c.jsx(T,{present:n||r.checked,children:c.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:d})})});G.displayName=g;var W="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:d,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=U(o),R=V(d);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),c.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=W;function A(t){return t?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=w(y,[I,P]),j=I(),N=P(),[Z,J]=Y(y),D=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=j(o),u=L(R),[h,b]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return c.jsx(Z,{scope:o,name:n,required:a,disabled:l,value:h,onValueChange:b,children:c.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:c.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:d})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=J(M,o),a=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(d,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=h=>{X.includes(h.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),c.jsx(K,{asChild:!0,...l,focusable:!a,active:p,children:c.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var Q="RadioGroupIndicator",F=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return c.jsx(G,{...e,...n,ref:d})});F.displayName=Q;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};
1
+ import{r as s,b_ as L,b$ as B,j as c,f_ as q,c4 as x,c2 as E,fZ as K,c5 as C,f$ as I,d$ as T,ci as w,cb as U,cm as V}from"./index-BfWp2Wnw.js";var _="Radio",[$,P]=w(_),[z,H]=$(_),k=s.forwardRef((t,d)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(d,b=>m(b)),u=s.useRef(!1),h=p?R||!!p.closest("form"):!0;return c.jsxs(z,{scope:o,checked:e,disabled:a,children:[c.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,b=>{e||f?.(),h&&(u.current=b.isPropagationStopped(),u.current||b.stopPropagation())})}),h&&c.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=_;var g="RadioIndicator",G=s.forwardRef((t,d)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=H(g,o);return c.jsx(T,{present:n||r.checked,children:c.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:d})})});G.displayName=g;var W="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:d,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=U(o),R=V(d);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),c.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=W;function A(t){return t?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=w(y,[I,P]),j=I(),N=P(),[Z,J]=Y(y),D=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=j(o),u=L(R),[h,b]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return c.jsx(Z,{scope:o,name:n,required:a,disabled:l,value:h,onValueChange:b,children:c.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:c.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:d})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=J(M,o),a=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(d,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=h=>{X.includes(h.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),c.jsx(K,{asChild:!0,...l,focusable:!a,active:p,children:c.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var Q="RadioGroupIndicator",F=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return c.jsx(G,{...e,...n,ref:d})});F.displayName=Q;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};
@@ -1 +1 @@
1
- import{c as f,f as p,av as u,j as s,b5 as x,N as a}from"./index-DPOIY_Am.js";import{C as j}from"./capability-load-error-Bg2ZZtwq.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
1
+ import{c as f,f as p,av as u,j as s,b5 as x,N as a}from"./index-BfWp2Wnw.js";import{C as j}from"./capability-load-error-D7_TKHDu.js";function d(){const t=f.c(19);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:g,error:c}=u();if(g){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(x,{}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("monitoring:view")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("members:manage")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}let n;return t[17]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[17]=r,t[18]=n):n=t[18],n}export{d as default};
@@ -1 +1 @@
1
- import{e2 as g,e3 as d,e4 as v}from"./index-DPOIY_Am.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
1
+ import{e2 as g,e3 as d,e4 as v}from"./index-BfWp2Wnw.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
@@ -1 +1 @@
1
- import{c as k,j as s,i2 as de,b as G,i3 as ue,r as le,i4 as xe,i5 as re,gE as T,gT as W,B as J,d_ as V,a7 as pe}from"./index-DPOIY_Am.js";import{i as he}from"./CreditCard01-B2dONSLn.js";import{B as L}from"./badge-DtQ2otcX.js";import{M as je}from"./multi-select-Cs9XWnUI.js";import{S as be,d as ve,c as Be,a as Ne,b as Se}from"./select-43sB6t-n.js";import{T as $,a as ye,b as ie,c as F,d as Te,e as we}from"./table-DYppV64B.js";import{C as ke,X as Ue,Y as Ce}from"./CartesianChart-D4yzutPM.js";import{T as De}from"./Tooltip-D0fKs0aB.js";import{a as _e,A as Me}from"./AreaChart-TNwx8Yro.js";import{c2 as Re}from"./CategoricalChart-CU64V2HR.js";import{R as Le}from"./require-capability-DbuSTrZt.js";import"./checkbox-CPQZwsIU.js";import"./Minus-DeaTdWpF.js";import"./ChevronDown-izQyrZHF.js";import"./command-BQx6PdJK.js";import"./index-oI_u2kBo.js";import"./SearchMd-BrITMGt7.js";import"./popover-DlkpRzCF.js";import"./index-BdQq_4o_.js";import"./index-QeA7kseb.js";import"./ChevronUp-B-5-9hXJ.js";import"./index-l98H0pqO.js";import"./access-gate-BtTxXcQp.js";import"./capability-load-error-Bg2ZZtwq.js";const Q=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),ne=["B","KB","MB","GB","TB","PB"];function oe(t){if(t<=0)return"0 B";const e=Math.min(ne.length-1,Math.floor(Math.log(t)/Math.log(1024))),n=t/1024**e;return`${n.toFixed(n>=100||e===0?0:1)} ${ne[e]}`}const X=50,$e="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",Fe=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function ce(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function ee(t){return ce(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function Ie(){const t=new Date;return Array.from({length:12},(e,n)=>{const l=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1));return{value:l.toISOString().slice(0,10),label:l.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function Pe(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ae(t){const e=k.c(30),{usage:n,metric:l,colorNum:o,formatValue:f,height:i}=t,a=`var(--chart-${o})`,d=`infra-billing-${l}`;let g;e[0]!==n?(g=n.map(Ae),e[0]=n,e[1]=g):g=e[1];const x=g;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b={left:0,right:4,top:8,bottom:0},e[2]=b):b=e[2];let r,p;e[3]!==a?(r=s.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.25}),p=s.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),e[3]=a,e[4]=r,e[5]=p):(r=e[4],p=e[5]);let h;e[6]!==d||e[7]!==r||e[8]!==p?(h=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[r,p]})}),e[6]=d,e[7]=r,e[8]=p,e[9]=h):h=e[9];let u;e[10]!==f||e[11]!==i?(u=i>100&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(Ue,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(Ce,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:f,width:68})]}),e[10]=f,e[11]=i,e[12]=u):u=e[12];let B,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={stroke:"var(--border)",strokeDasharray:"4 4"},v={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=B,e[14]=v):(B=e[13],v=e[14]);let j;e[15]!==f?(j=s.jsx(De,{cursor:B,contentStyle:v,formatter:C=>f(Number(C)||0)}),e[15]=f,e[16]=j):j=e[16];const y=`url(#${d})`;let N;e[17]!==a||e[18]!==l||e[19]!==y?(N=s.jsx(_e,{type:"linear",dataKey:l,stroke:a,strokeWidth:2,fill:y,dot:!1}),e[17]=a,e[18]=l,e[19]=y,e[20]=N):N=e[20];let m;e[21]!==x||e[22]!==N||e[23]!==h||e[24]!==u||e[25]!==j?(m=s.jsxs(Me,{data:x,margin:b,children:[h,u,j,N]}),e[21]=x,e[22]=N,e[23]=h,e[24]=u,e[25]=j,e[26]=m):m=e[26];let S;return e[27]!==i||e[28]!==m?(S=s.jsx(Re,{width:"100%",height:i,children:m}),e[27]=i,e[28]=m,e[29]=S):S=e[29],S}function Ae(t){return{...t,label:Pe(t.date)}}function Z(t,e){return t.reduce((n,l)=>n+l[e],0)}function Ee(){const t=k.c(39),e=G(),{sites:n,isLoading:l}=ue(),[o,f]=le.useState(null),i=Ie(),[a,d]=le.useState(i[0].value);let g;t[0]!==o||t[1]!==n?(g=o??n.slice(0,X),t[0]=o,t[1]=n,t[2]=g):g=t[2];const x=g,b=!o&&n.length>X,{data:r,isLoading:p}=xe(x,a),h=re();if(l){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(V,{className:"h-64 w-full"}),t[3]=c):c=t[3],c}if(n.length===0){let c;t[4]!==e?(c=e("settings.infraBilling.noSites"),t[4]=e,t[5]=c):c=t[5];let w;return t[6]!==c?(w=s.jsx(T,{className:"p-6 text-sm text-muted-foreground",children:c}),t[6]=c,t[7]=w):w=t[7],w}const u=r?.usage??[],B=r?.pageviewsAvailable??!1,v=!!r&&!r.usageUnavailable,j=(c,w)=>v?w(Z(u,c)):"—",y=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:B&&v?Q.format(Z(u,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:j("requests",Ze)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:j("dataTransferBytes",oe)}],N=Oe;let m;t[8]!==r?.teams?(m=r?.teams??[],t[8]=r?.teams,t[9]=m):m=t[9];const S=m;let C;t[10]!==r?.siteSlugsWithoutTeam?(C=r?.siteSlugsWithoutTeam??[],t[10]=r?.siteSlugsWithoutTeam,t[11]=C):C=t[11];const Y=C,U=S.length===1?S[0]:void 0,D=U?.billing??null,te=S.length+(Y.length>0?1:0)>1,K=Z(u,"pageviews"),se=K>0?Z(u,"requests")/K:0,me=B&&v&&K>0?se.toFixed(se<10?1:0):"—";let I;t[12]!==r?.billingUnavailable||t[13]!==U||t[14]!==e||t[15]!==S.length?(I=r?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):S.length>1?e("settings.infraBilling.multipleTeams",{count:String(S.length)}):U?fe(U,e):e("settings.infraBilling.noTeam"),t[12]=r?.billingUnavailable,t[13]=U,t[14]=e,t[15]=S.length,t[16]=I):I=t[16];const ge=I;let _;t[17]!==n?(_=n.map(qe),t[17]=n,t[18]=_):_=t[18];let M;t[19]!==e?(M=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=M):M=t[20];let P;t[21]!==x||t[22]!==_||t[23]!==M?(P=s.jsx(je,{className:"w-auto min-w-56 max-w-full",options:_,defaultValue:x,maxCount:2,placeholder:M,onValueChange:f}),t[21]=x,t[22]=_,t[23]=M,t[24]=P):P=t[24];let R;t[25]!==e?(R=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=R):R=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{}),t[27]=A):A=t[27];let E;t[28]!==R?(E=s.jsx(Se,{className:"w-48","aria-label":R,children:A}),t[28]=R,t[29]=E):E=t[29];let z;t[30]!==x.length||t[31]!==e?(z=x.length===0&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=x.length,t[31]=e,t[32]=z):z=t[32];let q;t[33]!==e||t[34]!==b?(q=b&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(X)})}),t[33]=e,t[34]=b,t[35]=q):q=t[35];let O;return t[36]!==r?.usageUnavailable||t[37]!==e?(O=r?.usageUnavailable&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=r?.usageUnavailable,t[37]=e,t[38]=O):O=t[38],s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[P,s.jsxs(be,{value:a,onValueChange:d,children:[E,s.jsx(ve,{children:i.map(ze)})]})]}),z,q,O,x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(T,{className:"flex-1 flex flex-col gap-4 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),U&&D?.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>h.mutate(U.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[D?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.currentPlan")}),p?s.jsx(V,{className:"h-5 w-16"}):s.jsx(L,{variant:D.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${D.planType}`)})]}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:D.nextBillingDate?ee(D.nextBillingDate):"—"})]})]}):!p&&s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.requestsPerPageview")}),s.jsx("span",{className:"font-medium tabular-nums",children:me})]})]})]}),y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-2 p-4",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.find(w=>w.value===a)?.label})]}),p?s.jsx(V,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:c.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:64})})]},c.key))]})}),s.jsx(W,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-3 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:220})]},c.key))})}),s.jsx(W,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:r?r.billingUnavailable?s.jsx(T,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[S.map(c=>s.jsx(Ge,{team:c,showSites:te},c.siteSlugs.join(","))),Y.length>0&&s.jsxs(T,{className:"flex flex-col gap-1 p-4",children:[te&&s.jsx("span",{className:"text-sm font-medium",children:Y.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(T,{size:"flush",children:s.jsx(V,{className:"m-4 h-24"})})})})]})]})}function ze(t){return s.jsx(Be,{value:t.value,children:t.label},t.value)}function qe(t){return{label:t,value:t}}function Oe(t){return t==="dataTransferBytes"?oe:Ve}function Ve(t){return Q.format(t)}function Ze(t){return Q.format(t)}function fe(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Ge(t){const e=k.c(13),{team:n,showSites:l}=t,o=G(),f=re(),i=n.billing;let a;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==o||e[4]!==n.siteSlugs?(a=l&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[s.jsx("span",{className:"text-sm font-medium",children:n.siteSlugs.join(", ")}),i&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(L,{variant:i.planType==="free"?"secondary":"success",children:o(`settings.infraBilling.plan.${i.planType}`)}),i.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:o("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:ee(i.nextBillingDate)})]}),i.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:f.isPending,onClick:()=>f.mutate(n.siteSlugs),children:o("settings.infraBilling.manageButton")})]})]}),e[0]=i,e[1]=f,e[2]=l,e[3]=o,e[4]=n.siteSlugs,e[5]=a):a=e[5];let d;e[6]!==i||e[7]!==o||e[8]!==n?(d=i?i.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:o("settings.infraBilling.noInvoices")}):s.jsx(Ye,{invoices:i.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:fe(n,o)}),e[6]=i,e[7]=o,e[8]=n,e[9]=d):d=e[9];let g;return e[10]!==a||e[11]!==d?(g=s.jsxs(T,{size:"flush",className:"gap-0 overflow-x-auto",children:[a,d]}),e[10]=a,e[11]=d,e[12]=g):g=e[12],g}function Ye(t){const e=k.c(40),{invoices:n}=t,l=G();let o;e[0]!==n?(o=n.some(Ke),e[0]=n,e[1]=o):o=e[1];const f=o;let i;e[2]!==l?(i=l("settings.infraBilling.invoiceReference"),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==i?(a=s.jsx($,{children:i}),e[4]=i,e[5]=a):a=e[5];let d;e[6]!==l?(d=l("settings.infraBilling.invoiceDue"),e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=s.jsx($,{children:d}),e[8]=d,e[9]=g):g=e[9];let x;e[10]!==l?(x=l("settings.infraBilling.invoiceAmount"),e[10]=l,e[11]=x):x=e[11];let b;e[12]!==x?(b=s.jsx($,{children:x}),e[12]=x,e[13]=b):b=e[13];let r;e[14]!==l?(r=l("settings.infraBilling.invoiceStatus"),e[14]=l,e[15]=r):r=e[15];let p;e[16]!==r?(p=s.jsx($,{children:r}),e[16]=r,e[17]=p):p=e[17];let h;e[18]!==l?(h=l("settings.infraBilling.invoiceDocuments"),e[18]=l,e[19]=h):h=e[19];let u;e[20]!==h?(u=s.jsx($,{children:h}),e[20]=h,e[21]=u):u=e[21];let B;e[22]!==u||e[23]!==a||e[24]!==g||e[25]!==b||e[26]!==p?(B=s.jsx(ye,{children:s.jsxs(ie,{children:[a,g,b,p,u]})}),e[22]=u,e[23]=a,e[24]=g,e[25]=b,e[26]=p,e[27]=B):B=e[27];let v;if(e[28]!==n||e[29]!==l||e[30]!==f){let N;e[32]!==l||e[33]!==f?(N=m=>s.jsxs(ie,{children:[s.jsx(F,{children:m.referenceMonth?ce(m.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(F,{children:m.dueDate?ee(m.dueDate):"—"}),s.jsx(F,{className:"tabular-nums",children:Fe.format(m.value)}),s.jsx(F,{children:s.jsx(We,{status:m.status})}),s.jsxs(F,{className:"flex gap-2",children:[m.nfUrl&&s.jsx(H,{href:m.nfUrl,label:l("settings.infraBilling.invoiceNf")}),m.bankSlipUrl&&s.jsx(H,{href:m.bankSlipUrl,label:l("settings.infraBilling.invoiceBankSlip")}),!m.bankSlipUrl&&!f&&m.nfUrl&&s.jsx(H,{href:$e,label:l("settings.infraBilling.invoiceBankTransfer")}),!m.nfUrl&&!m.bankSlipUrl&&"—"]})]},m.id),e[32]=l,e[33]=f,e[34]=N):N=e[34],v=n.map(N),e[28]=n,e[29]=l,e[30]=f,e[31]=v}else v=e[31];let j;e[35]!==v?(j=s.jsx(Te,{children:v}),e[35]=v,e[36]=j):j=e[36];let y;return e[37]!==B||e[38]!==j?(y=s.jsxs(we,{children:[B,j]}),e[37]=B,e[38]=j,e[39]=y):y=e[39],y}function Ke(t){return!!t.bankSlipUrl}function H(t){const e=k.c(4),{href:n,label:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{size:14}),e[0]=o):o=e[0];let f;return e[1]!==n||e[2]!==l?(f=s.jsx(J,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",children:[o,l]})}),e[1]=n,e[2]=l,e[3]=f):f=e[3],f}function We(t){const e=k.c(14),{status:n}=t,l=G(),o=n.toLowerCase();if(o==="paid"){let i;e[0]!==l?(i=l("settings.infraBilling.statusPaid"),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==i?(a=s.jsx(L,{variant:"success",children:i}),e[2]=i,e[3]=a):a=e[3],a}if(o==="overdue"){let i;e[4]!==l?(i=l("settings.infraBilling.statusOverdue"),e[4]=l,e[5]=i):i=e[5];let a;return e[6]!==i?(a=s.jsx(L,{variant:"destructive",children:i}),e[6]=i,e[7]=a):a=e[7],a}if(o==="registered"){let i;e[8]!==l?(i=l("settings.infraBilling.statusPending"),e[8]=l,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(L,{variant:"warning",children:i}),e[10]=i,e[11]=a):a=e[11],a}let f;return e[12]!==n?(f=s.jsx(L,{variant:"secondary",children:n}),e[12]=n,e[13]=f):f=e[13],f}function Xe(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(de,{group:"billing",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Bt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Le,{capability:"members:manage",area:"billing",children:s.jsx(Xe,{})}),t[0]=e):e=t[0],e}export{Bt as default};
1
+ import{c as k,j as s,i2 as de,b as G,i3 as ue,r as le,i4 as xe,i5 as re,gE as T,gT as W,B as J,d_ as V,a7 as pe}from"./index-BfWp2Wnw.js";import{i as he}from"./CreditCard01-gHUc2u28.js";import{B as L}from"./badge-CEYLDtOG.js";import{M as je}from"./multi-select-B_L-qOo_.js";import{S as be,d as ve,c as Be,a as Ne,b as Se}from"./select-BXZoshA8.js";import{T as $,a as ye,b as ie,c as F,d as Te,e as we}from"./table-BG-lRGNn.js";import{C as ke,X as Ue,Y as Ce}from"./CartesianChart-DynFqoj3.js";import{T as De}from"./Tooltip-EHWPdrLL.js";import{a as _e,A as Me}from"./AreaChart-DSUaBnyJ.js";import{c2 as Re}from"./CategoricalChart-_BlSk5IS.js";import{R as Le}from"./require-capability-DXiZ0OON.js";import"./checkbox-BUvWR-iD.js";import"./Minus-D55MDhYc.js";import"./ChevronDown-CNlehUMA.js";import"./command-DAachgGl.js";import"./index-C_tC1dxx.js";import"./SearchMd-CTSUPag9.js";import"./popover-oFcDtUvN.js";import"./index-BdQq_4o_.js";import"./index-CvQo8gKP.js";import"./ChevronUp-BIaMfxq-.js";import"./index-BBKDsc5X.js";import"./access-gate-CBj6VxJ7.js";import"./capability-load-error-D7_TKHDu.js";const Q=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}),ne=["B","KB","MB","GB","TB","PB"];function oe(t){if(t<=0)return"0 B";const e=Math.min(ne.length-1,Math.floor(Math.log(t)/Math.log(1024))),n=t/1024**e;return`${n.toFixed(n>=100||e===0?0:1)} ${ne[e]}`}const X=50,$e="https://assets.decocache.com/decocms/45f9e905-046b-4aeb-8420-0377a7d0d041/deco_Transferencia.pdf",Fe=new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"});function ce(t){return new Date(`${t.slice(0,10)}T00:00:00Z`)}function ee(t){return ce(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric",timeZone:"UTC"})}function Ie(){const t=new Date;return Array.from({length:12},(e,n)=>{const l=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1));return{value:l.toISOString().slice(0,10),label:l.toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"})}})}function Pe(t){return new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function ae(t){const e=k.c(30),{usage:n,metric:l,colorNum:o,formatValue:f,height:i}=t,a=`var(--chart-${o})`,d=`infra-billing-${l}`;let g;e[0]!==n?(g=n.map(Ae),e[0]=n,e[1]=g):g=e[1];const x=g;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b={left:0,right:4,top:8,bottom:0},e[2]=b):b=e[2];let r,p;e[3]!==a?(r=s.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.25}),p=s.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),e[3]=a,e[4]=r,e[5]=p):(r=e[4],p=e[5]);let h;e[6]!==d||e[7]!==r||e[8]!==p?(h=s.jsx("defs",{children:s.jsxs("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[r,p]})}),e[6]=d,e[7]=r,e[8]=p,e[9]=h):h=e[9];let u;e[10]!==f||e[11]!==i?(u=i>100&&s.jsxs(s.Fragment,{children:[s.jsx(ke,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(Ue,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),s.jsx(Ce,{orientation:"right",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},tickFormatter:f,width:68})]}),e[10]=f,e[11]=i,e[12]=u):u=e[12];let B,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={stroke:"var(--border)",strokeDasharray:"4 4"},v={background:"var(--background)",border:"1px solid var(--border)",borderRadius:8,fontSize:12},e[13]=B,e[14]=v):(B=e[13],v=e[14]);let j;e[15]!==f?(j=s.jsx(De,{cursor:B,contentStyle:v,formatter:C=>f(Number(C)||0)}),e[15]=f,e[16]=j):j=e[16];const y=`url(#${d})`;let N;e[17]!==a||e[18]!==l||e[19]!==y?(N=s.jsx(_e,{type:"linear",dataKey:l,stroke:a,strokeWidth:2,fill:y,dot:!1}),e[17]=a,e[18]=l,e[19]=y,e[20]=N):N=e[20];let m;e[21]!==x||e[22]!==N||e[23]!==h||e[24]!==u||e[25]!==j?(m=s.jsxs(Me,{data:x,margin:b,children:[h,u,j,N]}),e[21]=x,e[22]=N,e[23]=h,e[24]=u,e[25]=j,e[26]=m):m=e[26];let S;return e[27]!==i||e[28]!==m?(S=s.jsx(Re,{width:"100%",height:i,children:m}),e[27]=i,e[28]=m,e[29]=S):S=e[29],S}function Ae(t){return{...t,label:Pe(t.date)}}function Z(t,e){return t.reduce((n,l)=>n+l[e],0)}function Ee(){const t=k.c(39),e=G(),{sites:n,isLoading:l}=ue(),[o,f]=le.useState(null),i=Ie(),[a,d]=le.useState(i[0].value);let g;t[0]!==o||t[1]!==n?(g=o??n.slice(0,X),t[0]=o,t[1]=n,t[2]=g):g=t[2];const x=g,b=!o&&n.length>X,{data:r,isLoading:p}=xe(x,a),h=re();if(l){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(V,{className:"h-64 w-full"}),t[3]=c):c=t[3],c}if(n.length===0){let c;t[4]!==e?(c=e("settings.infraBilling.noSites"),t[4]=e,t[5]=c):c=t[5];let w;return t[6]!==c?(w=s.jsx(T,{className:"p-6 text-sm text-muted-foreground",children:c}),t[6]=c,t[7]=w):w=t[7],w}const u=r?.usage??[],B=r?.pageviewsAvailable??!1,v=!!r&&!r.usageUnavailable,j=(c,w)=>v?w(Z(u,c)):"—",y=[{key:"pageviews",title:e("settings.infraBilling.pageviews"),description:e("settings.infraBilling.pageviewsDescription"),colorNum:1,total:B&&v?Q.format(Z(u,"pageviews")):"—"},{key:"requests",title:e("settings.infraBilling.requests"),description:e("settings.infraBilling.requestsDescription"),colorNum:2,total:j("requests",Ze)},{key:"dataTransferBytes",title:e("settings.infraBilling.dataTransfer"),description:e("settings.infraBilling.dataTransferDescription"),colorNum:3,total:j("dataTransferBytes",oe)}],N=Oe;let m;t[8]!==r?.teams?(m=r?.teams??[],t[8]=r?.teams,t[9]=m):m=t[9];const S=m;let C;t[10]!==r?.siteSlugsWithoutTeam?(C=r?.siteSlugsWithoutTeam??[],t[10]=r?.siteSlugsWithoutTeam,t[11]=C):C=t[11];const Y=C,U=S.length===1?S[0]:void 0,D=U?.billing??null,te=S.length+(Y.length>0?1:0)>1,K=Z(u,"pageviews"),se=K>0?Z(u,"requests")/K:0,me=B&&v&&K>0?se.toFixed(se<10?1:0):"—";let I;t[12]!==r?.billingUnavailable||t[13]!==U||t[14]!==e||t[15]!==S.length?(I=r?.billingUnavailable?e("settings.infraBilling.billingUnavailable"):S.length>1?e("settings.infraBilling.multipleTeams",{count:String(S.length)}):U?fe(U,e):e("settings.infraBilling.noTeam"),t[12]=r?.billingUnavailable,t[13]=U,t[14]=e,t[15]=S.length,t[16]=I):I=t[16];const ge=I;let _;t[17]!==n?(_=n.map(qe),t[17]=n,t[18]=_):_=t[18];let M;t[19]!==e?(M=e("settings.infraBilling.siteLabel"),t[19]=e,t[20]=M):M=t[20];let P;t[21]!==x||t[22]!==_||t[23]!==M?(P=s.jsx(je,{className:"w-auto min-w-56 max-w-full",options:_,defaultValue:x,maxCount:2,placeholder:M,onValueChange:f}),t[21]=x,t[22]=_,t[23]=M,t[24]=P):P=t[24];let R;t[25]!==e?(R=e("settings.infraBilling.monthLabel"),t[25]=e,t[26]=R):R=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{}),t[27]=A):A=t[27];let E;t[28]!==R?(E=s.jsx(Se,{className:"w-48","aria-label":R,children:A}),t[28]=R,t[29]=E):E=t[29];let z;t[30]!==x.length||t[31]!==e?(z=x.length===0&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.pickASite")}),t[30]=x.length,t[31]=e,t[32]=z):z=t[32];let q;t[33]!==e||t[34]!==b?(q=b&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.tooManySites",{count:String(X)})}),t[33]=e,t[34]=b,t[35]=q):q=t[35];let O;return t[36]!==r?.usageUnavailable||t[37]!==e?(O=r?.usageUnavailable&&s.jsx(T,{className:"mx-4 p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.warehouseUnavailable")}),t[36]=r?.usageUnavailable,t[37]=e,t[38]=O):O=t[38],s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4",children:[P,s.jsxs(be,{value:a,onValueChange:d,children:[E,s.jsx(ve,{children:i.map(ze)})]})]}),z,q,O,x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(W,{title:e("settings.infraBilling.summaryTitle"),children:s.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 px-4",children:[s.jsxs(T,{className:"flex-1 flex flex-col gap-4 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:e("settings.infraBilling.detailsTitle")})]}),U&&D?.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>h.mutate(U.siteSlugs),children:e("settings.infraBilling.manageButton")})]}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[D?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.currentPlan")}),p?s.jsx(V,{className:"h-5 w-16"}):s.jsx(L,{variant:D.planType==="free"?"secondary":"success",children:e(`settings.infraBilling.plan.${D.planType}`)})]}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:D.nextBillingDate?ee(D.nextBillingDate):"—"})]})]}):!p&&s.jsx("p",{className:"text-xs text-muted-foreground",children:ge}),s.jsxs("div",{className:"flex justify-between gap-3",children:[s.jsx("span",{className:"text-muted-foreground",children:e("settings.infraBilling.requestsPerPageview")}),s.jsx("span",{className:"font-medium tabular-nums",children:me})]})]})]}),y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-2 p-4",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i.find(w=>w.value===a)?.label})]}),p?s.jsx(V,{className:"h-8 w-24"}):s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:c.total}),s.jsx("div",{className:"-mx-2",children:s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:64})})]},c.key))]})}),s.jsx(W,{title:e("settings.infraBilling.metricsTitle"),children:s.jsx("div",{className:"flex flex-col xl:flex-row gap-4 px-4",children:y.map(c=>s.jsxs(T,{className:"flex-1 flex flex-col gap-3 p-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:c.title}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsx(ae,{usage:u,metric:c.key,colorNum:c.colorNum,formatValue:N(c.key),height:220})]},c.key))})}),s.jsx(W,{title:e("settings.infraBilling.invoicesTitle"),children:s.jsx("div",{className:"flex flex-col gap-4 px-4",children:r?r.billingUnavailable?s.jsx(T,{className:"p-4 text-sm text-muted-foreground",children:e("settings.infraBilling.billingUnavailable")}):s.jsxs(s.Fragment,{children:[S.map(c=>s.jsx(Ge,{team:c,showSites:te},c.siteSlugs.join(","))),Y.length>0&&s.jsxs(T,{className:"flex flex-col gap-1 p-4",children:[te&&s.jsx("span",{className:"text-sm font-medium",children:Y.join(", ")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.infraBilling.noTeam")})]})]}):s.jsx(T,{size:"flush",children:s.jsx(V,{className:"m-4 h-24"})})})})]})]})}function ze(t){return s.jsx(Be,{value:t.value,children:t.label},t.value)}function qe(t){return{label:t,value:t}}function Oe(t){return t==="dataTransferBytes"?oe:Ve}function Ve(t){return Q.format(t)}function Ze(t){return Q.format(t)}function fe(t,e){return t.unavailableReason==="partial_team"?e("settings.infraBilling.partialTeam"):e("settings.infraBilling.billingUnavailable")}function Ge(t){const e=k.c(13),{team:n,showSites:l}=t,o=G(),f=re(),i=n.billing;let a;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==o||e[4]!==n.siteSlugs?(a=l&&s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[s.jsx("span",{className:"text-sm font-medium",children:n.siteSlugs.join(", ")}),i&&s.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm",children:[s.jsx(L,{variant:i.planType==="free"?"secondary":"success",children:o(`settings.infraBilling.plan.${i.planType}`)}),i.nextBillingDate&&s.jsxs("span",{className:"flex gap-1.5",children:[s.jsx("span",{className:"text-muted-foreground",children:o("settings.infraBilling.nextBilling")}),s.jsx("span",{className:"font-medium tabular-nums",children:ee(i.nextBillingDate)})]}),i.canManageSubscription&&s.jsx(J,{variant:"outline",size:"sm",disabled:f.isPending,onClick:()=>f.mutate(n.siteSlugs),children:o("settings.infraBilling.manageButton")})]})]}),e[0]=i,e[1]=f,e[2]=l,e[3]=o,e[4]=n.siteSlugs,e[5]=a):a=e[5];let d;e[6]!==i||e[7]!==o||e[8]!==n?(d=i?i.invoices.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:o("settings.infraBilling.noInvoices")}):s.jsx(Ye,{invoices:i.invoices}):s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:fe(n,o)}),e[6]=i,e[7]=o,e[8]=n,e[9]=d):d=e[9];let g;return e[10]!==a||e[11]!==d?(g=s.jsxs(T,{size:"flush",className:"gap-0 overflow-x-auto",children:[a,d]}),e[10]=a,e[11]=d,e[12]=g):g=e[12],g}function Ye(t){const e=k.c(40),{invoices:n}=t,l=G();let o;e[0]!==n?(o=n.some(Ke),e[0]=n,e[1]=o):o=e[1];const f=o;let i;e[2]!==l?(i=l("settings.infraBilling.invoiceReference"),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==i?(a=s.jsx($,{children:i}),e[4]=i,e[5]=a):a=e[5];let d;e[6]!==l?(d=l("settings.infraBilling.invoiceDue"),e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=s.jsx($,{children:d}),e[8]=d,e[9]=g):g=e[9];let x;e[10]!==l?(x=l("settings.infraBilling.invoiceAmount"),e[10]=l,e[11]=x):x=e[11];let b;e[12]!==x?(b=s.jsx($,{children:x}),e[12]=x,e[13]=b):b=e[13];let r;e[14]!==l?(r=l("settings.infraBilling.invoiceStatus"),e[14]=l,e[15]=r):r=e[15];let p;e[16]!==r?(p=s.jsx($,{children:r}),e[16]=r,e[17]=p):p=e[17];let h;e[18]!==l?(h=l("settings.infraBilling.invoiceDocuments"),e[18]=l,e[19]=h):h=e[19];let u;e[20]!==h?(u=s.jsx($,{children:h}),e[20]=h,e[21]=u):u=e[21];let B;e[22]!==u||e[23]!==a||e[24]!==g||e[25]!==b||e[26]!==p?(B=s.jsx(ye,{children:s.jsxs(ie,{children:[a,g,b,p,u]})}),e[22]=u,e[23]=a,e[24]=g,e[25]=b,e[26]=p,e[27]=B):B=e[27];let v;if(e[28]!==n||e[29]!==l||e[30]!==f){let N;e[32]!==l||e[33]!==f?(N=m=>s.jsxs(ie,{children:[s.jsx(F,{children:m.referenceMonth?ce(m.referenceMonth).toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"—"}),s.jsx(F,{children:m.dueDate?ee(m.dueDate):"—"}),s.jsx(F,{className:"tabular-nums",children:Fe.format(m.value)}),s.jsx(F,{children:s.jsx(We,{status:m.status})}),s.jsxs(F,{className:"flex gap-2",children:[m.nfUrl&&s.jsx(H,{href:m.nfUrl,label:l("settings.infraBilling.invoiceNf")}),m.bankSlipUrl&&s.jsx(H,{href:m.bankSlipUrl,label:l("settings.infraBilling.invoiceBankSlip")}),!m.bankSlipUrl&&!f&&m.nfUrl&&s.jsx(H,{href:$e,label:l("settings.infraBilling.invoiceBankTransfer")}),!m.nfUrl&&!m.bankSlipUrl&&"—"]})]},m.id),e[32]=l,e[33]=f,e[34]=N):N=e[34],v=n.map(N),e[28]=n,e[29]=l,e[30]=f,e[31]=v}else v=e[31];let j;e[35]!==v?(j=s.jsx(Te,{children:v}),e[35]=v,e[36]=j):j=e[36];let y;return e[37]!==B||e[38]!==j?(y=s.jsxs(we,{children:[B,j]}),e[37]=B,e[38]=j,e[39]=y):y=e[39],y}function Ke(t){return!!t.bankSlipUrl}function H(t){const e=k.c(4),{href:n,label:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{size:14}),e[0]=o):o=e[0];let f;return e[1]!==n||e[2]!==l?(f=s.jsx(J,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",children:[o,l]})}),e[1]=n,e[2]=l,e[3]=f):f=e[3],f}function We(t){const e=k.c(14),{status:n}=t,l=G(),o=n.toLowerCase();if(o==="paid"){let i;e[0]!==l?(i=l("settings.infraBilling.statusPaid"),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==i?(a=s.jsx(L,{variant:"success",children:i}),e[2]=i,e[3]=a):a=e[3],a}if(o==="overdue"){let i;e[4]!==l?(i=l("settings.infraBilling.statusOverdue"),e[4]=l,e[5]=i):i=e[5];let a;return e[6]!==i?(a=s.jsx(L,{variant:"destructive",children:i}),e[6]=i,e[7]=a):a=e[7],a}if(o==="registered"){let i;e[8]!==l?(i=l("settings.infraBilling.statusPending"),e[8]=l,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(L,{variant:"warning",children:i}),e[10]=i,e[11]=a):a=e[11],a}let f;return e[12]!==n?(f=s.jsx(L,{variant:"secondary",children:n}),e[12]=n,e[13]=f):f=e[13],f}function Xe(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(de,{group:"billing",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Bt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Le,{capability:"members:manage",area:"billing",children:s.jsx(Xe,{})}),t[0]=e):e=t[0],e}export{Bt as default};