decocms 4.156.0 → 4.157.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/dist/client/assets/{AlertCircle-DIE8Yl7q.js → AlertCircle-BVRdcAr7.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CxfkXDS2.js → AreaChart-BZd2BMDX.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CUadM4UH.js → ArrowUp-CEnxQhJa.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CukVRk_O.js → ArrowUpRight-c4UbenX2.js} +1 -1
  5. package/dist/client/assets/{Check-m8l7nXYC.js → Check-PvwAFW5_.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DsV-85gr.js → CheckCircle-tNfHHzqR.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DauO9LIH.js → ChevronDown-DhOhINAM.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-RhUxDXM4.js → ChevronRight-Dia-WW4B.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-VgPRldUL.js → ChevronUp-DYAPwS7D.js} +1 -1
  10. package/dist/client/assets/{Copy01-DDHrac6D.js → Copy01-DxBV3dt3.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-C_pS3iXs.js → CpuChip01-DnKRaqtj.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DpkPZP3G.js → DotsVertical-CKorlk4R.js} +1 -1
  13. package/dist/client/assets/{Eye-SbVzZaRw.js → Eye-Bc6OKV-y.js} +1 -1
  14. package/dist/client/assets/{FilterLines-C9Uzxfyp.js → FilterLines-DxJRwle6.js} +1 -1
  15. package/dist/client/assets/{HardDrive-C4ZotvXA.js → HardDrive-BiWDyH7C.js} +1 -1
  16. package/dist/client/assets/{Key01-Bj3E-INr.js → Key01-Bmye11fH.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-Dwmo2JPm.js → LayoutLeft-Dn612JDh.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BX291_B1.js → LinkExternal01-BRfN9dRJ.js} +1 -1
  19. package/dist/client/assets/{LogOut01-DbLJctZk.js → LogOut01-CHgz8ujG.js} +1 -1
  20. package/dist/client/assets/{Monitor01-Ddd_-GLg.js → Monitor01-8Zn_oQLH.js} +1 -1
  21. package/dist/client/assets/{Palette-7eDk0BFv.js → Palette-CLRvU0eK.js} +1 -1
  22. package/dist/client/assets/{Play-AYDZzTxe.js → Play-GbRXM_X_.js} +1 -1
  23. package/dist/client/assets/{Plus-5juoSUgr.js → Plus-L2K4KGAP.js} +1 -1
  24. package/dist/client/assets/{SearchLg-CZMDF1Dn.js → SearchLg-DD_M63q4.js} +1 -1
  25. package/dist/client/assets/{SearchMd-Cx4Aj3yg.js → SearchMd-DSheghKh.js} +1 -1
  26. package/dist/client/assets/{Settings02-DrPqulYB.js → Settings02-CVwE6_LX.js} +1 -1
  27. package/dist/client/assets/{Shield01-Dji-WmdR.js → Shield01-BtLPYIWD.js} +1 -1
  28. package/dist/client/assets/{Star01-0jkGhzKG.js → Star01-Bb-AArDe.js} +1 -1
  29. package/dist/client/assets/{Stars01-DA5aTxFS.js → Stars01-BabGpMQS.js} +1 -1
  30. package/dist/client/assets/{Stars02-BsLqrEAA.js → Stars02-CKPBAOIU.js} +1 -1
  31. package/dist/client/assets/{Sun-BZehch0c.js → Sun-CvM5J-FW.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01--qjrwFhx.js → SwitchHorizontal01-n8F4B6uE.js} +1 -1
  33. package/dist/client/assets/{Tool01-DXW8AwoP.js → Tool01-DN0PeFAX.js} +1 -1
  34. package/dist/client/assets/{Tool02-D2CdZ0b6.js → Tool02-RPFrSRbs.js} +1 -1
  35. package/dist/client/assets/{Trash01-ngTvmlyP.js → Trash01-DwKFwhTe.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-BYXDpvFL.js → TrendUp01-5fmO9zBH.js} +1 -1
  37. package/dist/client/assets/{Upload01-BHMlI4vP.js → Upload01-CEZ0vqHA.js} +1 -1
  38. package/dist/client/assets/{User01-OD5mhCfH.js → User01-CMegumei.js} +1 -1
  39. package/dist/client/assets/{Users01-C3fPwkwr.js → Users01-C2x7fgEw.js} +1 -1
  40. package/dist/client/assets/{Users03-CHdfTiff.js → Users03-B_aCu_uX.js} +1 -1
  41. package/dist/client/assets/{X-iM5RIuoD.js → X-C9xR6k_q.js} +1 -1
  42. package/dist/client/assets/{XCircle-Dhlq6071.js → XCircle-qIYKCuWZ.js} +1 -1
  43. package/dist/client/assets/{XClose-CZsPzFDX.js → XClose-D6PNomGP.js} +1 -1
  44. package/dist/client/assets/{Zap-bnqye7hL.js → Zap-BCvJyZqp.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-vuQJMDLK.js → ZapSquare-B_xZPtA0.js} +1 -1
  46. package/dist/client/assets/{access-gate-8__AMZit.js → access-gate-CgBkF5HO.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-CEQMp89n.js → add-section-modal-Bgum13n2.js} +1 -1
  48. package/dist/client/assets/{agent-icon-C6w7DCzZ.js → agent-icon-CtiUyn5V.js} +1 -1
  49. package/dist/client/assets/{agents-list-CqViz3If.js → agents-list-DHwxl85B.js} +1 -1
  50. package/dist/client/assets/{ai-providers-Bj4NYscp.js → ai-providers-BAOWMEQx.js} +1 -1
  51. package/dist/client/assets/{alert-R-DidQyC.js → alert-CgJLRqED.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-Di-fkqgM.js → alert-dialog-Cy_KM5bI.js} +2 -2
  53. package/dist/client/assets/{app-editor-Caii655j.js → app-editor-BWRR4WKU.js} +1 -1
  54. package/dist/client/assets/{auth-Bw-R94qi.js → auth-B6wLv_ge.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-BTo8ec-4.js → auth-catchall-CK8jbGrb.js} +1 -1
  56. package/dist/client/assets/{auth-entry-D3PgF2BK.js → auth-entry-umz9GY8P.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-BWNUGgIw.js → auth-split-layout-CFi1gMlG.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-Bdwv2acE.js → authenticate-and-persist-oauth-UMzs9VZn.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-03qTi_QS.js → automation-list-row-CqpWerJJ.js} +1 -1
  60. package/dist/client/assets/{automation-runs-DG3St-Eo.js → automation-runs-D22hl0By.js} +72 -112
  61. package/dist/client/assets/{automations-CQh0kCEp.js → automations-DEf3LLpY.js} +1 -1
  62. package/dist/client/assets/{avatar-FMEoovKa.js → avatar-DTq8LB7h.js} +1 -1
  63. package/dist/client/assets/{badge-CGUKmyet.js → badge-DCJPq-TC.js} +1 -1
  64. package/dist/client/assets/{block-document-BIyJRpgf.js → block-document-DgfQnX34.js} +3 -3
  65. package/dist/client/assets/{brand-context-CiUCKNGK.js → brand-context-JpMxWj1R.js} +1 -1
  66. package/dist/client/assets/{buckets-CuhjO4D8.js → buckets-DaCkmXEf.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-BaAkW_Ti.js → bulk-category-panel-Brm62LQU.js} +1 -1
  68. package/dist/client/assets/calendar-DiPJMbZr.js +142 -0
  69. package/dist/client/assets/{capability-load-error-DWDD3H50.js → capability-load-error-wbvMQZ3s.js} +1 -1
  70. package/dist/client/assets/{card-naXaf7wc.js → card-CrBmylnL.js} +1 -1
  71. package/dist/client/assets/category-editor-DHxskdpJ.js +1 -0
  72. package/dist/client/assets/{chat-context-CXWS4uIM.js → chat-context-DQXfzeZ1.js} +1 -1
  73. package/dist/client/assets/{checkbox-CoyvgDKZ.js → checkbox-CCkUa9zL.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-DRtCdrsS.js → cli-auth-success-C59WlVJX.js} +1 -1
  75. package/dist/client/assets/{collection-detail-DwCjVxjs.js → collection-detail-pmRAIQhn.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-CC35t0JS.js → collection-display-button-C3GUuD7t.js} +1 -1
  77. package/dist/client/assets/{collection-search-DPzRvidX.js → collection-search-CQ4hmVx6.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-DQ-0XGTI.js → collection-table-wrapper-DWQTzM0N.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-ECdM1rQN.js → collection-tabs-BGGP3Q4Q.js} +1 -1
  80. package/dist/client/assets/{command-DXTdCpUs.js → command-Bw3jNeoH.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-V92XOq0d.js → commerce-onboarding-DEK9436h.js} +1 -1
  82. package/dist/client/assets/{companions-core-DYXU6NnK.js → companions-core-Be1fT7Qa.js} +1 -1
  83. package/dist/client/assets/{connect-DrQmztxz.js → connect-CWFRWKGd.js} +1 -1
  84. package/dist/client/assets/{connection-C1aWI6ot.js → connection-DYDdJHYT.js} +1 -1
  85. package/dist/client/assets/{connection-card-DU3oYzwO.js → connection-card-rF4iZROi.js} +1 -1
  86. package/dist/client/assets/{connection-detail-C-oWnAOI.js → connection-detail-B17jcN2-.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-DG2Iquy2.js → connection-form-helpers-BZGXkBOU.js} +1 -1
  88. package/dist/client/assets/{connections-Dd2VUQDg.js → connections-BwDvvI81.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-CWeSvzci.js → decopilot-sse-pool-dCMollnS.js} +1 -1
  90. package/dist/client/assets/{dialog-BO-_w1_0.js → dialog-BEE2ieIv.js} +1 -1
  91. package/dist/client/assets/{domain-settings-D6F40WgW.js → domain-settings-DfyYMoAI.js} +1 -1
  92. package/dist/client/assets/{drawer-e6as_9Cb.js → drawer-D_zlJSIa.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-C7FVnVnI.js → dropdown-menu-CScom-4o.js} +1 -1
  94. package/dist/client/assets/{empty-state-BFtOLD4c.js → empty-state-BW9CnFTA.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-DOA4FF8t.js → extract-connection-data-CQ3H7X46.js} +1 -1
  96. package/dist/client/assets/{file-explorer-Pja2-HMO.js → file-explorer-DPUaYjU-.js} +2 -2
  97. package/dist/client/assets/{form-B1PAcj-j.js → form-BBxBIdP7.js} +1 -1
  98. package/dist/client/assets/{general-BnqyGLrs.js → general-CtJ3KRAc.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-Dci_EUxV.js → github-repo-picker-_fOGWT5B.js} +1 -1
  100. package/dist/client/assets/{hooks-C3mxa8Ta.js → hooks-D2DXSkUb.js} +1 -1
  101. package/dist/client/assets/{index-BJuRblVo.js → index-BYebWbkH.js} +1 -1
  102. package/dist/client/assets/{index-CUXKLBxk.css → index-CYhSS9zf.css} +1 -1
  103. package/dist/client/assets/{index-CW2MXLgG.js → index-CZrBPeSF.js} +41 -41
  104. package/dist/client/assets/index-Ck4HNDeL.js +77 -0
  105. package/dist/client/assets/index-CwBzuD_m.js +663 -0
  106. package/dist/client/assets/{index-_qch4ouE.js → index-DTrEhN5C.js} +1 -1
  107. package/dist/client/assets/{index-CdUnpkjK.js → index-DrIBFZ81.js} +2 -2
  108. package/dist/client/assets/{index-CQmYYJbc.js → index-FLb6-l5J.js} +1 -1
  109. package/dist/client/assets/{index-C27ozl0b.js → index-L22QcARJ.js} +1 -1
  110. package/dist/client/assets/{index-BZXS0RhN.js → index-NKgRHLP_.js} +1 -1
  111. package/dist/client/assets/{index-DCwmOYoa.js → index-dQDZUsRB.js} +1 -1
  112. package/dist/client/assets/{index-redirect-fCMVFASL.js → index-redirect-B8BYdzj2.js} +1 -1
  113. package/dist/client/assets/{index-BYSPN-Gx.js → index-u4kSn-Ka.js} +1 -1
  114. package/dist/client/assets/{input-aBsfiIMy.js → input-DfW0n64T.js} +1 -1
  115. package/dist/client/assets/{integration-icon-Cfk9jQ7N.js → integration-icon-BriL0gdd.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-B65duRZf.js → invite-member-dialog-C1b9xa_q.js} +1 -1
  117. package/dist/client/assets/{label-DYYqi2zg.js → label-u1FnGPif.js} +1 -1
  118. package/dist/client/assets/{layout-D3PDW6u4.js → layout-91MOct-x.js} +1 -1
  119. package/dist/client/assets/{login-JSr0zCqg.js → login-ComSuoop.js} +1 -1
  120. package/dist/client/assets/{mcp-oauth-GpVLRT_P.js → mcp-oauth-BNg8UA_R.js} +1 -1
  121. package/dist/client/assets/{members-C_gTuc9C.js → members-BVot0E3a.js} +1 -1
  122. package/dist/client/assets/{monaco-editor-BaKXEMK1.js → monaco-editor-Cq8a3e0Q.js} +4 -4
  123. package/dist/client/assets/{monitoring-stats-row-WRLyoERY.js → monitoring-stats-row-7EEfSN_H.js} +1 -1
  124. package/dist/client/assets/{multi-select-DiPJ_uGV.js → multi-select-B_LPMXUc.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-CZ1fcMme.js → oauth-callback-BJNIPi5Z.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-BCDXL5O3.js → oauth-callback-ai-provider-sBE6HXoD.js} +1 -1
  127. package/dist/client/assets/{onboarding-yErTzkEx.js → onboarding-rMKgR3te.js} +1 -1
  128. package/dist/client/assets/{org-layout-BS8V79hB.js → org-layout-FWtpNVPK.js} +1 -1
  129. package/dist/client/assets/{organization-choice-nBY5NVGe.js → organization-choice-Ds2qQKu8.js} +1 -1
  130. package/dist/client/assets/{orgs-Cp-Ck2Bo.js → orgs-CNBDLBm5.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-C94Or46H.js → page-seo-form-BnD0FsnZ.js} +1 -1
  132. package/dist/client/assets/{popover-DJKxNtgJ.js → popover-AjzmM7C7.js} +1 -1
  133. package/dist/client/assets/{post-editor-D3lT_yPc.js → post-editor-DVGbQJGA.js} +1 -1
  134. package/dist/client/assets/{primitives-0bug_wG4.js → primitives-BORxjSOf.js} +1 -1
  135. package/dist/client/assets/{profile-KgTN5olc.js → profile-B3tCocQY.js} +1 -1
  136. package/dist/client/assets/project-app-view-CboRisYT.js +1 -0
  137. package/dist/client/assets/record-editor-DKjGmqDW.js +1 -0
  138. package/dist/client/assets/{redirect-editor-CpD36ttp.js → redirect-editor-DQqTPtyS.js} +1 -1
  139. package/dist/client/assets/registry-BlxkoTJz.js +2 -0
  140. package/dist/client/assets/{registry-layout-BHVIaA-d.js → registry-layout-CQpVcGyd.js} +1 -1
  141. package/dist/client/assets/{reports-BE3HoQiP.js → reports-B7bHou75.js} +1 -1
  142. package/dist/client/assets/{require-capability-Dz44BqV5.js → require-capability-BWp_ugtq.js} +1 -1
  143. package/dist/client/assets/{required-auth-layout-hjeo4ah1.js → required-auth-layout-CX-j8fcs.js} +1 -1
  144. package/dist/client/assets/{reset-password-DMvXZenJ.js → reset-password-B_mSf-fh.js} +1 -1
  145. package/dist/client/assets/{roles-CTTeonNA.js → roles-CbO21DnZ.js} +1 -1
  146. package/dist/client/assets/{search-input-yz3n7Gs4.js → search-input-B6b2ZnBA.js} +1 -1
  147. package/dist/client/assets/{secrets-DUvfI1Lu.js → secrets-DHRDRmvb.js} +1 -1
  148. package/dist/client/assets/{sections-editor-BicOH3QF.js → sections-editor-2UGRHd2L.js} +2 -2
  149. package/dist/client/assets/{select-model-BGUyl-xh.js → select-model-DLYysGmM.js} +1 -1
  150. package/dist/client/assets/{select-Bm-nLQzq.js → select-n4tYtSWP.js} +1 -1
  151. package/dist/client/assets/{self-tool-result-aVG7Uzjx.js → self-tool-result-9g5XXNrJ.js} +1 -1
  152. package/dist/client/assets/{seo-editor-hLyJ0AlV.js → seo-editor-Dp4dSKcE.js} +1 -1
  153. package/dist/client/assets/{settings-layout-C-Zl2dJA.js → settings-layout-DB_Q64RJ.js} +1 -1
  154. package/dist/client/assets/{settings-section-BtfQLMIM.js → settings-section-B4sxMatG.js} +1 -1
  155. package/dist/client/assets/{shell-controls-BXxvLe1v.js → shell-controls-zZvgboKB.js} +1 -1
  156. package/dist/client/assets/{shell-layout-CRDRimQL.js → shell-layout-BLNXlEs8.js} +1 -1
  157. package/dist/client/assets/{sidebar-BM7WlCJl.js → sidebar-BTOMGewK.js} +1 -1
  158. package/dist/client/assets/{skeleton-B9ABD0bu.js → skeleton-BSh29Pqn.js} +1 -1
  159. package/dist/client/assets/{spinner-BRB2yKwd.js → spinner-BruVqM08.js} +1 -1
  160. package/dist/client/assets/{sso-CdubQB6u.js → sso-CkQZtYP5.js} +1 -1
  161. package/dist/client/assets/{store-CzwvP8Ir.js → store-Dura68P-.js} +1 -1
  162. package/dist/client/assets/store-registry-Cpq2Y3v7.js +2 -0
  163. package/dist/client/assets/{studio-tools-CjZ36wid.js → studio-tools-DZ4A4LK4.js} +1 -1
  164. package/dist/client/assets/{switch-DJXTeeGv.js → switch-Capnufwf.js} +1 -1
  165. package/dist/client/assets/{tab-id-BkVuCNeZ.js → tab-id-TIvCa4AH.js} +1 -1
  166. package/dist/client/assets/{table-DsXlq-Oe.js → table-BhXfGt_D.js} +1 -1
  167. package/dist/client/assets/{tabs-DyKk7_Wq.js → tabs-CmlSCOKE.js} +1 -1
  168. package/dist/client/assets/{textarea-DREmN0_0.js → textarea-CzJQ4jof.js} +1 -1
  169. package/dist/client/assets/{toggle-group-CWVqFyEf.js → toggle-group-DJogx7Sw.js} +1 -1
  170. package/dist/client/assets/{toolbar-BZq1PZo-.js → toolbar-4Xs9gQqE.js} +1 -1
  171. package/dist/client/assets/{tooltip-BsZLs6jb.js → tooltip-DlGzqhnP.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-bb0CrIV5.js → use-ai-providers-CIIrncdr.js} +1 -1
  173. package/dist/client/assets/{use-automations-B9qN-UcT.js → use-automations-oR1lkik8.js} +1 -1
  174. package/dist/client/assets/{use-autosave-C7v0Gxwd.js → use-autosave-B62TGEph.js} +1 -1
  175. package/dist/client/assets/{use-capability-BjRnqY4q.js → use-capability-D8lE65Qq.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-EGCsB_mn.js → use-clock-tick-CV-pJYBs.js} +1 -1
  177. package/dist/client/assets/{use-connection-Ddy_oyAc.js → use-connection-BzoGO_rZ.js} +1 -1
  178. package/dist/client/assets/{use-copy-CFvofHr8.js → use-copy-CUMl3QMe.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-BhZdy5aw.js → use-create-virtual-mcp-CtHfYunD.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-14pxy4Ym.js → use-debounced-autosave-6rt-rF4t.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-Ct2HSsGg.js → use-debounced-value-CXreFFvV.js} +1 -1
  182. package/dist/client/assets/{use-deco-credits-ckaLmECo.js → use-deco-credits-CRRWJZpL.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-B78lAOQr.js → use-decopilot-events-BQ6ItOFo.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-BUfitEOA.js → use-delete-connection-D7g881JG.js} +1 -1
  185. package/dist/client/assets/{use-deployment-admin-t_RnHgVE.js → use-deployment-admin-Cei02Kx3.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-BashThUD.js → use-file-configs-CfPB3s7t.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-BhhVPogQ.js → use-infinite-scroll-BIsiRuqk.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-MyWYW4VZ.js → use-join-requests-Dv3eHJh5.js} +1 -1
  189. package/dist/client/assets/{use-mcp-auth-status-Bz42MqD5.js → use-mcp-auth-status-2CuEn9Ao.js} +1 -1
  190. package/dist/client/assets/{use-mcp-client-C5W65sTb.js → use-mcp-client-C-LnBBuJ.js} +2 -2
  191. package/dist/client/assets/{use-mcp-tools-MLcFg-Xs.js → use-mcp-tools-BxFrq8sY.js} +1 -1
  192. package/dist/client/assets/{use-members-BdtA1RQO.js → use-members-6mtN34eU.js} +1 -1
  193. package/dist/client/assets/{use-mobile-ChCiWCDf.js → use-mobile-hjfr3xoA.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-D7aHIZfQ.js → use-navigate-to-agent-DLULuM6_.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-CEhqAVio.js → use-org-auth-client-Dd2A-3_W.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-BxLmvCMr.js → use-org-sso-mDWe3mwz.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-FaC38DQv.js → use-organization-roles-UFDl0kli.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-B_ugVmUa.js → use-organization-settings-VTvhO8RM.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-Cm6M6CXk.js → use-registry-connections-6V_OOVJn.js} +1 -1
  200. package/dist/client/assets/{use-secrets-DOzaf9x3.js → use-secrets-C3APoSVc.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-B71fAKSA.js → use-status-sounds-0NlGQGcq.js} +1 -1
  202. package/dist/client/assets/{use-tags-BisOMRBR.js → use-tags-CNwvMQjY.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-PjwVWmZw.js → use-view-mode-DasG8IDi.js} +1 -1
  204. package/dist/client/assets/use-virtual-mcp-333MNW6F.js +1 -0
  205. package/dist/client/assets/useInfiniteQuery-jDP8kOiZ.js +1 -0
  206. package/dist/client/assets/{useQueries-BJvZT85S.js → useQueries-CJIQxjbc.js} +1 -1
  207. package/dist/client/assets/{useRouterState-D1fHr9_s.js → useRouterState-k_6bFC93.js} +1 -1
  208. package/dist/client/assets/useSuspenseInfiniteQuery-BKk4QAmj.js +1 -0
  209. package/dist/client/assets/{users-HpGwaqgM.js → users-Dx28SD_Z.js} +1 -1
  210. package/dist/client/assets/{variant-calendar-CLYvE3Vh.js → variant-calendar-4-b9myOJ.js} +1 -1
  211. package/dist/client/assets/{view-mode-toggle-BvUE6GJ4.js → view-mode-toggle-CwXiquMd.js} +1 -1
  212. package/dist/client/index.html +2 -2
  213. package/dist/server/cli.js +1 -1
  214. package/dist/server/server.js +1 -1
  215. package/package.json +1 -1
  216. package/dist/client/assets/calendar-BNp5D4zb.js +0 -102
  217. package/dist/client/assets/category-editor-D-Mf1J7D.js +0 -1
  218. package/dist/client/assets/index-Bh_FY8wj.js +0 -663
  219. package/dist/client/assets/index-DC7ZsTjI.js +0 -12
  220. package/dist/client/assets/project-app-view-CcVe5zYb.js +0 -1
  221. package/dist/client/assets/record-editor-Dbyt6WSq.js +0 -1
  222. package/dist/client/assets/registry-DHNy9BpQ.js +0 -2
  223. package/dist/client/assets/store-registry-BBJuirLi.js +0 -2
  224. package/dist/client/assets/use-virtual-mcp-BTyFwT2C.js +0 -1
  225. package/dist/client/assets/useInfiniteQuery-DlNWxtew.js +0 -1
  226. package/dist/client/assets/useSuspenseInfiniteQuery-BW-nMm4l.js +0 -1
@@ -0,0 +1,77 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CwBzuD_m.js","assets/index-CZrBPeSF.js","assets/index-CYhSS9zf.css","assets/ArrowUp-CEnxQhJa.js","assets/chat-context-DQXfzeZ1.js","assets/tab-id-TIvCa4AH.js","assets/dialog-BEE2ieIv.js","assets/X-C9xR6k_q.js","assets/Check-PvwAFW5_.js","assets/Copy01-DxBV3dt3.js","assets/hooks-D2DXSkUb.js","assets/use-mcp-client-C-LnBBuJ.js","assets/auth-B6wLv_ge.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/decopilot-sse-pool-dCMollnS.js","assets/studio-tools-DZ4A4LK4.js","assets/use-virtual-mcp-333MNW6F.js","assets/use-ai-providers-CIIrncdr.js","assets/use-decopilot-events-BQ6ItOFo.js","assets/use-organization-settings-VTvhO8RM.js","assets/automation-runs-D22hl0By.js","assets/select-n4tYtSWP.js","assets/tooltip-DlGzqhnP.js","assets/ChevronDown-DhOhINAM.js","assets/ChevronUp-DYAPwS7D.js","assets/useInfiniteQuery-jDP8kOiZ.js","assets/use-infinite-scroll-BIsiRuqk.js","assets/use-connection-BzoGO_rZ.js","assets/card-CrBmylnL.js","assets/sidebar-BTOMGewK.js","assets/LayoutLeft-Dn612JDh.js","assets/use-mobile-hjfr3xoA.js","assets/table-BhXfGt_D.js","assets/empty-state-BW9CnFTA.js","assets/use-members-6mtN34eU.js","assets/use-org-auth-client-Dd2A-3_W.js","assets/use-clock-tick-CV-pJYBs.js","assets/AlertCircle-BVRdcAr7.js","assets/CheckCircle-tNfHHzqR.js","assets/DotsVertical-CKorlk4R.js","assets/agent-icon-CtiUyn5V.js","assets/Tool01-DN0PeFAX.js","assets/Settings02-CVwE6_LX.js","assets/Tool02-RPFrSRbs.js","assets/XCircle-qIYKCuWZ.js","assets/ArrowUpRight-c4UbenX2.js","assets/TrendUp01-5fmO9zBH.js","assets/ZapSquare-B_xZPtA0.js","assets/Users03-B_aCu_uX.js","assets/ChevronRight-Dia-WW4B.js","assets/Stars02-CKPBAOIU.js","assets/CpuChip01-DnKRaqtj.js","assets/Eye-Bc6OKV-y.js","assets/FilterLines-DxJRwle6.js","assets/Star01-Bb-AArDe.js","assets/Palette-CLRvU0eK.js","assets/SwitchHorizontal01-n8F4B6uE.js","assets/HardDrive-BiWDyH7C.js","assets/Key01-Bmye11fH.js","assets/LinkExternal01-BRfN9dRJ.js","assets/LogOut01-CHgz8ujG.js","assets/Monitor01-8Zn_oQLH.js","assets/Sun-CvM5J-FW.js","assets/Play-GbRXM_X_.js","assets/Plus-L2K4KGAP.js","assets/SearchLg-DD_M63q4.js","assets/SearchMd-DSheghKh.js","assets/Shield01-BtLPYIWD.js","assets/Stars01-BabGpMQS.js","assets/Trash01-DwKFwhTe.js","assets/Upload01-CEZ0vqHA.js","assets/User01-CMegumei.js","assets/Users01-C2x7fgEw.js","assets/XClose-D6PNomGP.js","assets/Zap-BCvJyZqp.js","assets/use-automations-oR1lkik8.js","assets/useSuspenseInfiniteQuery-BKk4QAmj.js","assets/avatar-DTq8LB7h.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-CUMl3QMe.js","assets/monaco-editor-Cq8a3e0Q.js","assets/spinner-BruVqM08.js","assets/index-L22QcARJ.js","assets/calendar-DiPJMbZr.js","assets/shell-layout-BLNXlEs8.js","assets/use-is-desktop-app-BNujXJc_.js","assets/required-auth-layout-CX-j8fcs.js","assets/use-org-sso-mDWe3mwz.js","assets/integration-icon-BriL0gdd.js","assets/use-navigate-to-agent-DLULuM6_.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-BZd2BMDX.js","assets/form-BBxBIdP7.js","assets/label-u1FnGPif.js","assets/input-DfW0n64T.js","assets/drawer-D_zlJSIa.js","assets/collection-search-CQ4hmVx6.js","assets/tabs-CmlSCOKE.js","assets/toggle-group-DJogx7Sw.js","assets/use-deco-credits-CRRWJZpL.js","assets/popover-AjzmM7C7.js","assets/alert-dialog-Cy_KM5bI.js","assets/toolbar-4Xs9gQqE.js","assets/skeleton-BSh29Pqn.js","assets/github-repo-picker-_fOGWT5B.js","assets/use-debounced-value-CXreFFvV.js","assets/authenticate-and-persist-oauth-UMzs9VZn.js","assets/mcp-oauth-BNg8UA_R.js","assets/use-mcp-tools-BxFrq8sY.js","assets/extract-connection-data-CQ3H7X46.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-C2RHf8fG.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-rF4iZROi.js","assets/use-registry-connections-6V_OOVJn.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-CzJQ4jof.js","assets/connection-form-helpers-BZGXkBOU.js","assets/collection-tabs-BGGP3Q4Q.js","assets/badge-DCJPq-TC.js","assets/select-model-DLYysGmM.js","assets/checkbox-CCkUa9zL.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-B4sxMatG.js","assets/dropdown-menu-CScom-4o.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-0NlGQGcq.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-D8lE65Qq.js","assets/pt-BR-CLy76QW2.js","assets/use-mcp-auth-status-2CuEn9Ao.js","assets/use-debounced-autosave-6rt-rF4t.js","assets/index-NKgRHLP_.js","assets/search-input-B6b2ZnBA.js","assets/switch-Capnufwf.js","assets/use-secrets-C3APoSVc.js","assets/command-Bw3jNeoH.js","assets/index-DTrEhN5C.js","assets/useQueries-CJIQxjbc.js","assets/use-file-configs-CfPB3s7t.js","assets/automation-list-row-CqpWerJJ.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
2
+ import{G as Al,r as w,c as P,x as _l,K as De,F as Ae,o as Zn,e as _t,n as lt,aV as Pi,aw as Se,af as Ft,a as Ol,t as Kt,$ as Bl,m as ne,j as d,aW as Fi,aX as Ui,aY as Hi,aZ as qi,a_ as Ki,a$ as Vi,b0 as Wi,b1 as Gi,b2 as Qi,b as de,B as at,E as $l,d as Xi,p as ei,k as mr,u as Ml,aF as zl}from"./index-CZrBPeSF.js";import{g as jt}from"./get-initials-D-f_fDFw.js";import{A as Dt}from"./avatar-DTq8LB7h.js";import{aD as xr,ag as Ll,ah as Pl,aj as Fl,a7 as Ul,aE as Hl,C as ql,q as Kl,aF as Yi,Y as Zi,e as Ji,af as Vl,j as eo,aG as Wl,aC as Ks,$ as wn,at as to,aH as Gl,n as br,aA as Ql}from"./agent-icon-CtiUyn5V.js";import{i as no}from"./SwitchHorizontal01-n8F4B6uE.js";import{s as Gn}from"./Plus-L2K4KGAP.js";import{i as vn}from"./X-C9xR6k_q.js";import{a as kn,b as Hn,P as qn}from"./popover-AjzmM7C7.js";import{a as Tt,D as Cn,b as Tn,c as jn,d as _n,e as On,f as Bn,i as Xl}from"./dropdown-menu-CScom-4o.js";import{W as Yl,m as ti,S as so,C as ro,g as Zl,u as Jl,h as ea,a as ta}from"./use-mcp-client-C-LnBBuJ.js";import{u as na,G as tr,a as sa}from"./github-repo-picker-_fOGWT5B.js";import{b as yr,d as kr,e as wr,h as ra,a as ia,c as oa}from"./dialog-BEE2ieIv.js";import{b as la,u as aa}from"./use-connection-BzoGO_rZ.js";import{b as ca,i as ua}from"./provision-repo-scoped-github-connection-C2RHf8fG.js";import{a as da}from"./authenticate-and-persist-oauth-UMzs9VZn.js";import{e as fa}from"./extract-connection-data-CQ3H7X46.js";import{u as io}from"./use-members-6mtN34eU.js";import{u as Jn}from"./studio-tools-DZ4A4LK4.js";import{t as ha,T as pa,S as nt}from"./decopilot-sse-pool-dCMollnS.js";import{u as ga}from"./use-decopilot-events-BQ6ItOFo.js";import{a as oo}from"./format-time-BnbuEtat.js";import{i as lo}from"./AlertCircle-BVRdcAr7.js";import{i as vr}from"./CheckCircle-tNfHHzqR.js";import{i as ma}from"./DotsVertical-CKorlk4R.js";import{s as xa}from"./Eye-Bc6OKV-y.js";import{u as ao,a as ba,b as ya}from"./use-tags-CNwvMQjY.js";import{l as ka,P as Ut,a as Sr,D as wa,n as va,o as Sa,S as At,p as Ca,T as co,F as Vs,q as Pn,r as Ta,s as ja,v as uo,N as Da,h as Cr,w as Na,x as Ra,d as fo,k as Ea,y as $t,z as Ia,A as $n,B as Aa,G as ho,R as po,m as go,H as mo,I as _a,J as Oa,K as Ba,e as $a,u as Ma,f as za,C as xo,c as La}from"./calendar-DiPJMbZr.js";import{u as Pa}from"./use-copy-CUMl3QMe.js";import{i as _s}from"./Check-PvwAFW5_.js";import{i as Fa}from"./ChevronRight-Dia-WW4B.js";import{a as Ua}from"./Copy01-DxBV3dt3.js";import{n as Ha,i as qa}from"./Tool02-RPFrSRbs.js";import{n as bo}from"./LinkExternal01-BRfN9dRJ.js";import{b as yo,i as ko}from"./XCircle-qIYKCuWZ.js";import{s as wo}from"./Trash01-DwKFwhTe.js";import{d as Tr,a as jr,c as Lt,b as Dn,e as Dr,C as Nr}from"./command-Bw3jNeoH.js";import{s as nr}from"./User01-CMegumei.js";import{d as Ka,b as Va,f as Wa,g as Ga,a as Qa,D as Xa}from"./drawer-D_zlJSIa.js";import{t as Rr}from"./ChevronDown-DhOhINAM.js";import{i as vo}from"./FilterLines-DxJRwle6.js";import{s as Ya}from"./TrendUp01-5fmO9zBH.js";import{u as Za}from"./shell-layout-BLNXlEs8.js";import{b as Ja}from"./hooks-D2DXSkUb.js";import{a as ec}from"./use-organization-settings-VTvhO8RM.js";import{f as tc}from"./tab-id-TIvCa4AH.js";import{u as sr}from"./companions-core-Be1fT7Qa.js";function nc(t){return!t||!t.content||t.content.length===0?!0:t.content.every(e=>e.type==="paragraph"?!e.content||e.content.length===0?!0:e.content.every(n=>n.type==="hardBreak"||n.type==="text"&&(!n.text||n.text.trim()==="")):!1)}const vg="__home__";function Er(t,e){return Al.chatDraft(t,e)}function sc(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object"||typeof e.updatedAt!="number")return null;const n=e.tiptapDoc;return!n||typeof n!="object"||n.type!=="doc"||!Array.isArray(n.content)?null:n}function rc(t,e,n,r,s){const i=Er(e,n);if(nc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},l=JSON.stringify(o);try{t.setItem(i,l)}catch(a){if(ic(a)){const u=new TextEncoder().encode(l).byteLength;s?.onQuotaExceeded?.({docSizeBytes:u});return}throw a}}function Sg(t,e,n){const r=Er(e,n),s=t.getItem(r),i=sc(s);return s!==null&&i===null&&t.removeItem(r),i}function Cg(t,e,n){t.removeItem(Er(e,n))}function ic(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}var oc=ka;function lc(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,u=Sa(n),f=new RegExp(`\\s${u}$`),c=o?"^":"",h=s?"":u,p=a?new RegExp(`${c}${u}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${c}(?:^)?${u}[^\\s${h}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const x=l.pos-m.length,b=Array.from(m.matchAll(p)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const g=b.input.slice(Math.max(0,b.index-1),b.index),y=new RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!y)return null;const k=x+b.index;let v=k+b[0].length;return a&&f.test(m.slice(v-1,v+1))&&(b[0]+=" ",v+=1),k<l.pos&&v>=l.pos?{range:{from:k,to:v},query:b[0].slice(n.length),text:b[0]}:null}var ac=new Ut("suggestion");function cc({pluginKey:t=ac,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:u="",decorationEmptyClass:f="is-empty",command:c=()=>null,items:h=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:x=lc,shouldShow:b}){let g;const y=p?.(),k=()=>{const S=e.state.selection.$anchor.pos,j=e.view.coordsAtPos(S),{top:N,right:R,bottom:D,left:B}=j;try{return new DOMRect(B,N,R-B,D-N)}catch{return null}},v=(S,j)=>j?()=>{const N=t.getState(e.state),R=N?.decorationId,D=S.dom.querySelector(`[data-decoration-id="${R}"]`);return D?.getBoundingClientRect()||null}:k;function C(S,j){var N;try{const D=t.getState(S.state),B=D?.decorationId?S.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`):null,z={editor:e,range:D?.range||{from:0,to:0},query:D?.query||null,text:D?.text||null,items:[],command:M=>c({editor:e,range:D?.range||{from:0,to:0},props:M}),decorationNode:B,clientRect:v(S,B)};(N=y?.onExit)==null||N.call(y,z)}catch{}const R=S.state.tr.setMeta(j,{exit:!0});S.dispatch(R)}const T=new Sr({key:t,view(){return{update:async(S,j)=>{var N,R,D,B,z,M,L;const A=(N=this.key)==null?void 0:N.getState(j),I=(R=this.key)==null?void 0:R.getState(S.state),_=A.active&&I.active&&A.range.from!==I.range.from,q=!A.active&&I.active,Z=A.active&&!I.active,F=!q&&!Z&&A.query!==I.query,U=q||_&&F,G=F||_,X=Z||_&&F;if(!U&&!G&&!X)return;const Y=X&&!U?A:I,V=S.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`);g={editor:e,range:Y.range,query:Y.query,text:Y.text,items:[],command:se=>c({editor:e,range:Y.range,props:se}),decorationNode:V,clientRect:v(S,V)},U&&((D=y?.onBeforeStart)==null||D.call(y,g)),G&&((B=y?.onBeforeUpdate)==null||B.call(y,g)),(G||U)&&(g.items=await h({editor:e,query:Y.query})),X&&((z=y?.onExit)==null||z.call(y,g)),G&&((M=y?.onUpdate)==null||M.call(y,g)),U&&((L=y?.onStart)==null||L.call(y,g))},destroy:()=>{var S;g&&((S=y?.onExit)==null||S.call(y,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,j,N,R){const{isEditable:D}=e,{composing:B}=e.view,{selection:z}=S,{empty:M,from:L}=z,A={...j},I=S.getMeta(t);if(I&&I.exit)return A.active=!1,A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null,A;if(A.composing=B,D&&(M||e.view.composing)){(L<j.range.from||L>j.range.to)&&!B&&!j.composing&&(A.active=!1);const _=x({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:z.$from}),q=`id_${Math.floor(Math.random()*4294967295)}`;_&&m({editor:e,state:R,range:_.range,isActive:j.active})&&(!b||b({editor:e,range:_.range,query:_.query,text:_.text,transaction:S}))?(A.active=!0,A.decorationId=j.decorationId?j.decorationId:q,A.range=_.range,A.query=_.query,A.text=_.text):A.active=!1}else A.active=!1;return A.active||(A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null),A}},props:{handleKeyDown(S,j){var N,R,D,B;const{active:z,range:M}=T.getState(S.state);if(!z)return!1;if(j.key==="Escape"||j.key==="Esc"){const A=T.getState(S.state),I=(N=g?.decorationNode)!=null?N:null,_=I??(A?.decorationId?S.dom.querySelector(`[data-decoration-id="${A.decorationId}"]`):null);if(((R=y?.onKeyDown)==null?void 0:R.call(y,{view:S,event:j,range:A.range}))||!1)return!0;const Z={editor:e,range:A.range,query:A.query,text:A.text,items:[],command:F=>c({editor:e,range:A.range,props:F}),decorationNode:_,clientRect:_?()=>_.getBoundingClientRect()||null:null};return(D=y?.onExit)==null||D.call(y,Z),C(S,t),!0}return((B=y?.onKeyDown)==null?void 0:B.call(y,{view:S,event:j,range:M}))||!1},decorations(S){const{active:j,range:N,decorationId:R,query:D}=T.getState(S);if(!j)return null;const B=!D?.length,z=[a];return B&&z.push(f),wa.create(S.doc,[va.inline(N.from,N.to,{nodeName:l,class:z.join(" "),"data-decoration-id":R,"data-decoration-content":u})])}}});return T}function uc(t){const e=P.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[l,a]=w.useState(0),u=w.useRef(s),f=w.useRef(l),c=w.useRef(i),h=w.useRef(o),p=w.useDeferredValue(r);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{a(0)},e[0]=m):m=e[0];let x;e[1]!==p?(x=[p],e[1]=p,e[2]=x):x=e[2],w.useEffect(m,x);let b,g;e[3]!==s.length||e[4]!==l?(b=()=>{l>=s.length&&s.length>0&&a(0)},g=[s.length,l],e[3]=s.length,e[4]=l,e[5]=b,e[6]=g):(b=e[5],g=e[6]),w.useEffect(b,g);let y,k;e[7]!==s?(y=()=>{u.current=s},k=[s],e[7]=s,e[8]=y,e[9]=k):(y=e[8],k=e[9]),w.useEffect(y,k);let v,C;e[10]!==l?(v=()=>{f.current=l},C=[l],e[10]=l,e[11]=v,e[12]=C):(v=e[11],C=e[12]),w.useEffect(v,C);let T,S;e[13]!==i?(S=()=>{c.current=i},T=[i],e[13]=i,e[14]=T,e[15]=S):(T=e[14],S=e[15]),w.useEffect(S,T);let j,N;e[16]!==o?(j=()=>{h.current=o},N=[o],e[16]=o,e[17]=j,e[18]=N):(j=e[17],N=e[18]),w.useEffect(j,N);let R,D;e[19]!==n?(R=()=>{if(n?.isDestroyed)return;let M;try{M=n.view.dom}catch{return}if(!M)return;const L=I=>{const _=u.current;if(!_.length)return!1;const q=()=>a(F=>(F+1)%_.length),Z=()=>a(F=>(F-1+_.length)%_.length);switch(I.key){case"ArrowUp":return I.preventDefault(),Z(),!0;case"ArrowDown":return I.preventDefault(),q(),!0;case"Tab":return I.preventDefault(),I.shiftKey?Z():q(),!0;case"Home":return I.preventDefault(),a(0),!0;case"End":return I.preventDefault(),a(_.length-1),!0;case"Enter":{if(I.isComposing)return!1;I.preventDefault();const F=f.current;return F!==-1&&_[F]&&c.current?.(_[F],F),!0}case"Escape":return I.preventDefault(),h.current?.(),!0;default:return!1}},A=I=>{L(I)};return M.addEventListener("keydown",A,!0),()=>{M?.removeEventListener("keydown",A,!0)}},D=[n],e[19]=n,e[20]=R,e[21]=D):(R=e[20],D=e[21]),w.useEffect(R,D);const B=s.length?l:void 0;let z;return e[22]!==B?(z={selectedIndex:B,setSelectedIndex:a},e[22]=B,e[23]=z):z=e[23],z}function dc(t,e){switch(e.type){case"SET_SELECTED_ITEM":return{...t,selectedItem:e.payload};case"ON_START":return{...t,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...t,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return t}}const fc=w.createContext(void 0);function hc(){const t=w.useContext(fc);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Tg(t){const e=P.c(16),{editor:n,char:r,pluginKey:s,allow:i,onOpenChange:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=l):l=e[0];const[a,u]=w.useReducer(dc,l);let f;e[1]!==o?(f=x=>{o?.(x)},e[1]=o,e[2]=f):f=e[2];const c=w.useEffectEvent(f);let h;e[3]!==r||e[4]!==i||e[5]!==n||e[6]!==c||e[7]!==s?(h=()=>{if(n?.isDestroyed)return;const x=s instanceof Ut?s:new Ut(s);n.state.plugins.find(y=>y.spec.key===x)&&n.unregisterPlugin(x);const g=cc({pluginKey:x,editor:n,char:r,allow(y){const k=n.state.doc.resolve(y.range.from);for(let v=k.depth;v>0;v--)if(k.node(v).type.name==="image")return!1;return!(i&&!i(y))},command(){},render:()=>({onStart:y=>{u({type:"ON_START",payload:{element:y.decorationNode??null,query:y.query,range:y.range}}),c(!0)},onUpdate:y=>{u({type:"ON_UPDATE",payload:{element:y.decorationNode??null,query:y.query,range:y.range}})},onKeyDown:y=>y.event.key==="Escape"?(u({type:"ON_EXIT"}),!0):!1,onExit:()=>{u({type:"ON_EXIT"}),c(!1)}}),items:pc});return n.registerPlugin(g),()=>{n?.isDestroyed||n.unregisterPlugin(x)}},e[3]=r,e[4]=i,e[5]=n,e[6]=c,e[7]=s,e[8]=h):h=e[8];let p;e[9]!==r||e[10]!==i||e[11]!==n||e[12]!==s?(p=[n,s,r,u,i],e[9]=r,e[10]=i,e[11]=n,e[12]=s,e[13]=p):p=e[13],w.useEffect(h,p);let m;return e[14]!==a?(m={state:a,dispatch:u},e[14]=a,e[15]=m):m=e[15],m}function pc(){return[]}function jg({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=hc(),o=w.useDeferredValue(s.query),{data:l}=_l({queryKey:De.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),a=()=>{i({type:"ON_EXIT"})},u=async(c,h)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:c});try{const{view:p}=t,x=p.state.selection.$to.nodeAfter?.text?.startsWith(" "),b=s.range?{...s.range}:{from:0,to:0};x&&s.range&&(b.to+=1),await r({range:b,item:c})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):a()}catch{a()}}},{selectedIndex:f}=uc({editor:t,query:o,items:l,onSelect:u,onClose:a});return{selectedItem:s.selectedItem,items:l,selectedIndex:f,close:a,onSelect:u}}function Dg(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function ht(t,e,n,r){const s=new URLSearchParams(r).toString();return`/api/${encodeURIComponent(t)}/fs/${encodeURIComponent(e)}/${n}${s?`?${s}`:""}`}async function Ye(t,e,n){const r=await fetch(t,e);if(r.ok||n?.allow404&&r.status===404)return r;let s="";try{s=(await r.json()).error??""}catch{}throw new Error(s||`HTTP ${r.status}`)}function Ng(t,e){const n=P.c(11),{org:r}=Ae();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=De.orgFsList(r.id,t,e),n[0]=r.id,n[1]=e,n[2]=t,n[3]=s):s=n[3];let i;n[4]!==r.slug||n[5]!==e||n[6]!==t?(i=async()=>(await(await Ye(ht(r.slug,t,"list",{path:e}))).json()).entries.toSorted(gc),n[4]=r.slug,n[5]=e,n[6]=t,n[7]=i):i=n[7];let o;return n[8]!==s||n[9]!==i?(o={queryKey:s,placeholderData:Pi,queryFn:i},n[8]=s,n[9]=i,n[10]=o):o=n[10],lt(o)}function gc(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function Rg(t,e,n){const r=P.c(15),{org:s}=Ae();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=De.orgFsStat(s.id,t??"",e),r[0]=s.id,r[1]=e,r[2]=t,r[3]=i):i=r[3];const o=t!==null;let l;r[4]!==n?(l=n?.refetchIntervalWhenAbsent?f=>f.state.data?!1:n.refetchIntervalWhenAbsent??!1:void 0,r[4]=n,r[5]=l):l=r[5];let a;r[6]!==s.slug||r[7]!==e||r[8]!==t?(a=async()=>{const f=await Ye(ht(s.slug,t??"","stat",{path:e}),void 0,{allow404:!0});return f.status===404?null:(await f.json()).entry},r[6]=s.slug,r[7]=e,r[8]=t,r[9]=a):a=r[9];let u;return r[10]!==i||r[11]!==o||r[12]!==l||r[13]!==a?(u={queryKey:i,enabled:o,refetchInterval:l,queryFn:a},r[10]=i,r[11]=o,r[12]=l,r[13]=a,r[14]=u):u=r[14],lt(u)}function Eg(t){const e=P.c(9),{org:n}=Ae();let r;e[0]!==n.id||e[1]!==t?(r=De.orgFsUsage(n.id,t),e[0]=n.id,e[1]=t,e[2]=r):r=e[2];let s;e[3]!==n.slug||e[4]!==t?(s=async()=>await(await Ye(ht(n.slug,t,"usage"))).json(),e[3]=n.slug,e[4]=t,e[5]=s):s=e[5];let i;return e[6]!==r||e[7]!==s?(i={queryKey:r,queryFn:s},e[6]=r,e[7]=s,e[8]=i):i=e[8],lt(i)}function Ig(t,e){const n=P.c(9),r=t===void 0?60:t,{org:s}=Ae();let i;n[0]!==s.id?(i=De.orgFsRecent(s.id),n[0]=s.id,n[1]=i):i=n[1];const o=e?.enabled;let l;n[2]!==r||n[3]!==s.slug?(l=async()=>(await(await Ye(`/api/${encodeURIComponent(s.slug)}/fs/recent?limit=${r}`)).json()).entries,n[2]=r,n[3]=s.slug,n[4]=l):l=n[4];let a;return n[5]!==i||n[6]!==o||n[7]!==l?(a={queryKey:i,enabled:o,queryFn:l},n[5]=i,n[6]=o,n[7]=l,n[8]=a):a=n[8],lt(a)}function Ag(t,e){const n=P.c(11),r=50,{org:s}=Ae();let i;n[0]!==s.id||n[1]!==t?(i=De.orgFsSearch(s.id,t),n[0]=s.id,n[1]=t,n[2]=i):i=n[2];const o=t.length>0;let l;n[3]!==r||n[4]!==s.slug||n[5]!==t?(l=async()=>(await(await Ye(`/api/${encodeURIComponent(s.slug)}/fs/search?q=${encodeURIComponent(t)}&limit=${r}`)).json()).entries,n[3]=r,n[4]=s.slug,n[5]=t,n[6]=l):l=n[6];let a;return n[7]!==i||n[8]!==o||n[9]!==l?(a={queryKey:i,enabled:o,placeholderData:Pi,queryFn:l},n[7]=i,n[8]=o,n[9]=l,n[10]=a):a=n[10],lt(a)}function _g(t){const e=P.c(8),{org:n}=Ae();let r;e[0]!==n.id?(r=De.orgFsSkills(n.id),e[0]=n.id,e[1]=r):r=e[1];const s=t?.enabled;let i;e[2]!==n.slug?(i=async()=>{const l=await Ye(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:a}=await l.json();return a.map(mc)},e[2]=n.slug,e[3]=i):i=e[3];let o;return e[4]!==r||e[5]!==s||e[6]!==i?(o={queryKey:r,enabled:s,queryFn:i},e[4]=r,e[5]=s,e[6]=i,e[7]=o):o=e[7],lt(o)}function mc(t){return{volume:t.volume,path:t.path}}async function Og(t){const e=await Ye(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function xc(t,e,n){return(await Ye(ht(t,e,"read",{path:n}))).text()}const bc=new Set(["md","mdx","markdown","txt","text"]),yc=25,kc=64*1024,wc=256*1024,vc=4;function Sc(t){const e=t.lastIndexOf(".");return e===-1?!1:bc.has(t.slice(e+1).toLowerCase())}async function Bg(t,e,n){const r=n?`${n}/`:"",s=c=>c.startsWith(r)?c.slice(r.length):c,i=[],o=[],l=[{path:n,depth:0}];for(;l.length>0;){const c=l.shift();if(!c)break;let h;try{h=(await(await Ye(ht(t,e,"list",{path:c.path}))).json()).entries}catch{continue}for(const p of[...h].sort((m,x)=>m.path.localeCompare(x.path))){if(p.kind==="dir"){c.depth<vc&&l.push({path:p.path,depth:c.depth+1});continue}Sc(p.path)&&p.size<=kc&&i.length<yc?i.push(p.path):o.push(s(p.path))}}const a=await Promise.all(i.map(c=>xc(t,e,c).catch(()=>null))),u=[];let f=0;return i.forEach((c,h)=>{const p=a[h];if(p==null||f+p.length>wc){o.push(s(c));return}f+=p.length,u.push({relPath:s(c),content:p})}),u.sort((c,h)=>c.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:c.relPath.localeCompare(h.relPath)),o.sort(),{files:u,omittedPaths:o}}function $g(){const t=P.c(7),{org:e}=Ae();let n;t[0]!==e.id?(n=De.orgFsPublicSets(e.id),t[0]=e.id,t[1]=n):n=t[1];let r;t[2]!==e.slug?(r=async()=>(await(await Ye(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,t[2]=e.slug,t[3]=r):r=t[3];let s;return t[4]!==n||t[5]!==r?(s={queryKey:n,staleTime:3e5,queryFn:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],lt(s)}function Cc(t){const e=P.c(3),{org:n}=Ae();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>ht(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function Mg(){const t=P.c(2),{org:e}=Ae();let n;return t[0]!==e.slug?(n=(r,s)=>ht(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function zg(t){const e=P.c(3),{org:n}=Ae();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await Ye(ht(n.slug,t,"file",{path:s.path}),{method:"PUT",headers:{"content-type":s.contentType??"text/html; charset=utf-8"},body:s.body})).json()).entry},e[0]=n,e[1]=t,e[2]=r):r=e[2],_t(r)}function Lg(t){const e=P.c(18),{org:n}=Ae(),r=Zn();let s;e[0]!==n||e[1]!==t?(s=async u=>(await(await Ye(ht(n.slug,t,"public",{path:u.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:u.mode,password:u.password})})).json()).entry,e[0]=n,e[1]=t,e[2]=s):s=e[2];let i;e[3]!==n||e[4]!==r||e[5]!==t?(i=async u=>{const f=De.orgFsStat(n.id,t,u.path);await r.cancelQueries({queryKey:f});const c=r.getQueryData(f),h=u.mode!=="private";return r.setQueryData(f,p=>p&&{...p,readPublic:h,effectivePublic:h,shareMode:u.mode}),{key:f,previous:c}},e[3]=n,e[4]=r,e[5]=t,e[6]=i):i=e[6];let o;e[7]!==r?(o=(u,f,c)=>{c&&r.setQueryData(c.key,c.previous)},e[7]=r,e[8]=o):o=e[8];let l;e[9]!==n||e[10]!==r||e[11]!==t?(l=(u,f,c)=>{r.invalidateQueries({queryKey:De.orgFsStat(n.id,t,c.path)}),r.invalidateQueries({queryKey:De.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:De.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:De.orgFsSearchRoot(n.id)})},e[9]=n,e[10]=r,e[11]=t,e[12]=l):l=e[12];let a;return e[13]!==s||e[14]!==i||e[15]!==o||e[16]!==l?(a={mutationFn:s,onMutate:i,onError:o,onSettled:l},e[13]=s,e[14]=i,e[15]=o,e[16]=l,e[17]=a):a=e[17],_t(a)}function Tc(t){const e=P.c(33),{org:n}=Ae(),r=Zn();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:De.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:De.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:De.orgFsSearchRoot(n.id)})},e[0]=n,e[1]=r,e[2]=t,e[3]=s):s=e[3];const i=s;let o;e[4]!==n||e[5]!==t?(o=async k=>{const C=(await Promise.allSettled(k.files.map(T=>{const S=k.dir?`${k.dir}/${T.name}`:T.name;return Ye(ht(n.slug,t,"file",{path:S}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(jc);if(C)throw C.reason},e[4]=n,e[5]=t,e[6]=o):o=e[6];let l;e[7]!==i||e[8]!==o?(l={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=l):l=e[9];const a=_t(l);let u;e[10]!==n||e[11]!==t?(u=async k=>{await Ye(ht(n.slug,t,"dir",{path:k}),{method:"POST"})},e[10]=n,e[11]=t,e[12]=u):u=e[12];let f;e[13]!==i||e[14]!==u?(f={mutationFn:u,onSuccess:i},e[13]=i,e[14]=u,e[15]=f):f=e[15];const c=_t(f);let h;e[16]!==n||e[17]!==t?(h=async k=>{await Ye(ht(n.slug,t,"file",{path:k}),{method:"DELETE"})},e[16]=n,e[17]=t,e[18]=h):h=e[18];let p;e[19]!==i||e[20]!==h?(p={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=p):p=e[21];const m=_t(p);let x;e[22]!==n||e[23]!==t?(x=async k=>{await Ye(ht(n.slug,t,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)})},e[22]=n,e[23]=t,e[24]=x):x=e[24];let b;e[25]!==i||e[26]!==x?(b={mutationFn:x,onSuccess:i},e[25]=i,e[26]=x,e[27]=b):b=e[27];const g=_t(b);let y;return e[28]!==c||e[29]!==g||e[30]!==m||e[31]!==a?(y={upload:a,mkdir:c,remove:m,move:g},e[28]=c,e[29]=g,e[30]=m,e[31]=a,e[32]=y):y=e[32],y}function jc(t){return t.status==="rejected"}function Dc(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const Nc=2e4;function Rc(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function Ec(){const t=P.c(17),{org:e}=Ae(),n=Yl.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=ti({connectionId:so,orgId:e.id,orgSlug:e.slug}),t[0]=e.id,t[1]=e.slug,t[2]=r):r=t[2];const{data:s}=lt(r),o=lt({queryKey:De.commerceDiscoveryConnection(e.id,n),enabled:!!s,retry:!1,staleTime:6e4,queryFn:async()=>{if(!s)throw new Error("selfClient not ready");const k=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}});return sr(k)}}).data?.item??null,{data:l}=lt({...ti({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),a=De.commerceDiscoveryDiagnostic(e.id,n),u=!!l;let f;t[3]!==l?(f=async()=>{if(!l)throw new Error("cdClient not ready");const k=await l.callTool({name:ro,arguments:{}});return sr(k).diagnostic??null},t[3]=l,t[4]=f):f=t[4];let c;t[5]!==a||t[6]!==u||t[7]!==f?(c={queryKey:a,enabled:u,retry:1,refetchInterval:Ic,queryFn:f},t[5]=a,t[6]=u,t[7]=f,t[8]=c):c=t[8];const h=lt(c),p=h.data??null,m=h.isSuccess,x=o?.metadata?.siteUrl;let b;t[9]!==x?(b=Rc(x),t[9]=x,t[10]=b):b=t[10];const g=l??null;let y;return t[11]!==n||t[12]!==h.isSuccess||t[13]!==p||t[14]!==b||t[15]!==g?(y={diagnostic:p,isSuccess:m,host:b,connectionId:n,cdClient:g},t[11]=n,t[12]=h.isSuccess,t[13]=p,t[14]=b,t[15]=g,t[16]=y):y=t[16],y}function Ic(t){return t.state.status!=="error"&&Dc(t.state.data)==="generating"?Nc:!1}function Ac(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:Zl(t.id),main:tc(e,ro)}}}function _c(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const Os=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nn(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Ir(t){return"nodeType"in t}function rt(t){var e,n;return t?Nn(t)?t:Ir(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Ar(t){const{Document:e}=rt(t);return t instanceof e}function es(t){return Nn(t)?!1:t instanceof rt(t).HTMLElement}function So(t){return t instanceof rt(t).SVGElement}function Rn(t){return t?Nn(t)?t.document:Ir(t)?Ar(t)?t:es(t)||So(t)?t.ownerDocument:document:document:document}const Nt=Os?w.useLayoutEffect:w.useEffect;function Bs(t){const e=w.useRef(t);return Nt(()=>{e.current=t}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function Oc(){const t=w.useRef(null),e=w.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=w.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Qn(t,e){e===void 0&&(e=[t]);const n=w.useRef(t);return Nt(()=>{n.current!==t&&(n.current=t)},e),n}function ts(t,e){const n=w.useRef();return w.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function ks(t){const e=Bs(t),n=w.useRef(null),r=w.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function ws(t){const e=w.useRef();return w.useEffect(()=>{e.current=t},[t]),e.current}let Ws={};function ns(t,e){return w.useMemo(()=>{if(e)return e;const n=Ws[t]==null?0:Ws[t]+1;return Ws[t]=n,t+"-"+n},[t,e])}function Co(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const l=Object.entries(o);for(const[a,u]of l){const f=i[a];f!=null&&(i[a]=f+t*u)}return i},{...e})}}const Sn=Co(1),Xn=Co(-1);function Bc(t){return"clientX"in t&&"clientY"in t}function $s(t){if(!t)return!1;const{KeyboardEvent:e}=rt(t.target);return e&&t instanceof e}function $c(t){if(!t)return!1;const{TouchEvent:e}=rt(t.target);return e&&t instanceof e}function vs(t){if($c(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Bc(t)?{x:t.clientX,y:t.clientY}:null}const Ht=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Ht.Translate.toString(t),Ht.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),ni="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Mc(t){return t.matches(ni)?t:t.querySelector(ni)}const zc={display:"none"};function Lc(t){let{id:e,value:n}=t;return Se.createElement("div",{id:e,style:zc},n)}function Pc(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Se.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Fc(){const[t,e]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const To=w.createContext(null);function Uc(t){const e=w.useContext(To);w.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Hc(){const[t]=w.useState(()=>new Set),e=w.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[w.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var l;return(l=o[s])==null?void 0:l.call(o,i)})},[t]),e]}const qc={draggable:`
3
+ To pick up a draggable item, press the space bar.
4
+ While dragging, use the arrow keys to move the item.
5
+ Press space again to drop the item in its new position, or press escape to cancel.
6
+ `},Kc={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Vc(t){let{announcements:e=Kc,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=qc}=t;const{announce:i,announcement:o}=Fc(),l=ns("DndLiveRegion"),[a,u]=w.useState(!1);if(w.useEffect(()=>{u(!0)},[]),Uc(w.useMemo(()=>({onDragStart(c){let{active:h}=c;i(e.onDragStart({active:h}))},onDragMove(c){let{active:h,over:p}=c;e.onDragMove&&i(e.onDragMove({active:h,over:p}))},onDragOver(c){let{active:h,over:p}=c;i(e.onDragOver({active:h,over:p}))},onDragEnd(c){let{active:h,over:p}=c;i(e.onDragEnd({active:h,over:p}))},onDragCancel(c){let{active:h,over:p}=c;i(e.onDragCancel({active:h,over:p}))}}),[i,e])),!a)return null;const f=Se.createElement(Se.Fragment,null,Se.createElement(Lc,{id:r,value:s.draggable}),Se.createElement(Pc,{id:l,announcement:o}));return n?Ft.createPortal(f,n):f}var ze;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ze||(ze={}));function Ss(){}function si(t,e){return w.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Wc(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Rt=Object.freeze({x:0,y:0});function jo(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Gc(t,e){const n=vs(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function Do(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Qc(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function ri(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function No(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function ii(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Pg=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=ii(e,e.left,e.top),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const u=jo(ii(a),s);i.push({id:l,data:{droppableContainer:o,value:u}})}}return i.sort(Do)},Ro=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=ri(e),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const u=ri(a),f=s.reduce((h,p,m)=>h+jo(u[m],p),0),c=Number((f/4).toFixed(4));i.push({id:l,data:{droppableContainer:o,value:c}})}}return i.sort(Do)};function Xc(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,l=i-n;if(r<s&&n<i){const a=e.width*e.height,u=t.width*t.height,f=o*l,c=f/(a+u-f);return Number(c.toFixed(4))}return 0}const Yc=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,l=n.get(o);if(l){const a=Xc(l,e);a>0&&s.push({id:o,data:{droppableContainer:i,value:a}})}}return s.sort(Qc)};function Zc(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function Eo(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Rt}function Jc(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,l)=>({...o,top:o.top+t*l.y,bottom:o.bottom+t*l.y,left:o.left+t*l.x,right:o.right+t*l.x}),{...n})}}const eu=Jc(1);function Io(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function tu(t,e,n){const r=Io(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:l}=r,a=t.left-o-(1-s)*parseFloat(n),u=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,c=i?t.height/i:t.height;return{width:f,height:c,top:u,right:a+f,bottom:u+c,left:a}}const nu={ignoreTransform:!1};function En(t,e){e===void 0&&(e=nu);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:f}=rt(t).getComputedStyle(t);u&&(n=tu(n,u,f))}const{top:r,left:s,width:i,height:o,bottom:l,right:a}=n;return{top:r,left:s,width:i,height:o,bottom:l,right:a}}function oi(t){return En(t,{ignoreTransform:!0})}function su(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function ru(t,e){return e===void 0&&(e=rt(t).getComputedStyle(t)),e.position==="fixed"}function iu(t,e){e===void 0&&(e=rt(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function Ms(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(Ar(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!es(s)||So(s)||n.includes(s))return n;const i=rt(t).getComputedStyle(s);return s!==t&&iu(s,i)&&n.push(s),ru(s,i)?n:r(s.parentNode)}return t?r(t):n}function Ao(t){const[e]=Ms(t,1);return e??null}function Gs(t){return!Os||!t?null:Nn(t)?t:Ir(t)?Ar(t)||t===Rn(t).scrollingElement?window:es(t)?t:null:null}function _o(t){return Nn(t)?t.scrollX:t.scrollLeft}function Oo(t){return Nn(t)?t.scrollY:t.scrollTop}function rr(t){return{x:_o(t),y:Oo(t)}}var Fe;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Fe||(Fe={}));function Bo(t){return!Os||!t?!1:t===document.scrollingElement}function $o(t){const e={x:0,y:0},n=Bo(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:l,maxScroll:r,minScroll:e}}const ou={x:.2,y:.2};function lu(t,e,n,r,s){let{top:i,left:o,right:l,bottom:a}=n;r===void 0&&(r=10),s===void 0&&(s=ou);const{isTop:u,isBottom:f,isLeft:c,isRight:h}=$o(t),p={x:0,y:0},m={x:0,y:0},x={height:e.height*s.y,width:e.width*s.x};return!u&&i<=e.top+x.height?(p.y=Fe.Backward,m.y=r*Math.abs((e.top+x.height-i)/x.height)):!f&&a>=e.bottom-x.height&&(p.y=Fe.Forward,m.y=r*Math.abs((e.bottom-x.height-a)/x.height)),!h&&l>=e.right-x.width?(p.x=Fe.Forward,m.x=r*Math.abs((e.right-x.width-l)/x.width)):!c&&o<=e.left+x.width&&(p.x=Fe.Backward,m.x=r*Math.abs((e.left+x.width-o)/x.width)),{direction:p,speed:m}}function au(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function Mo(t){return t.reduce((e,n)=>Sn(e,rr(n)),Rt)}function cu(t){return t.reduce((e,n)=>e+_o(n),0)}function uu(t){return t.reduce((e,n)=>e+Oo(n),0)}function zo(t,e){if(e===void 0&&(e=En),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);Ao(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const du=[["x",["left","right"],cu],["y",["top","bottom"],uu]];class _r{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ms(n),s=Mo(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,l]of du)for(const a of o)Object.defineProperty(this,a,{get:()=>{const u=l(r),f=s[i]-u;return this.rect[a]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Kn{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function fu(t){const{EventTarget:e}=rt(t);return t instanceof e?t:Rn(t)}function Qs(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var xt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(xt||(xt={}));function li(t){t.preventDefault()}function hu(t){t.stopPropagation()}var oe;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(oe||(oe={}));const Lo={start:[oe.Space,oe.Enter],cancel:[oe.Esc],end:[oe.Space,oe.Enter,oe.Tab]},pu=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case oe.Right:return{...n,x:n.x+25};case oe.Left:return{...n,x:n.x-25};case oe.Down:return{...n,y:n.y+25};case oe.Up:return{...n,y:n.y-25}}};class Or{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Kn(Rn(n)),this.windowListeners=new Kn(rt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&zo(r),n(Rt)}handleKeyDown(e){if($s(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=Lo,coordinateGetter:o=pu,scrollBehavior:l="smooth"}=s,{code:a}=e;if(i.end.includes(a)){this.handleEnd(e);return}if(i.cancel.includes(a)){this.handleCancel(e);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=f);const c=o(e,{active:n,context:r.current,currentCoordinates:f});if(c){const h=Xn(c,f),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const x of m){const b=e.code,{isTop:g,isRight:y,isLeft:k,isBottom:v,maxScroll:C,minScroll:T}=$o(x),S=au(x),j={x:Math.min(b===oe.Right?S.right-S.width/2:S.right,Math.max(b===oe.Right?S.left:S.left+S.width/2,c.x)),y:Math.min(b===oe.Down?S.bottom-S.height/2:S.bottom,Math.max(b===oe.Down?S.top:S.top+S.height/2,c.y))},N=b===oe.Right&&!y||b===oe.Left&&!k,R=b===oe.Down&&!v||b===oe.Up&&!g;if(N&&j.x!==c.x){const D=x.scrollLeft+h.x,B=b===oe.Right&&D<=C.x||b===oe.Left&&D>=T.x;if(B&&!h.y){x.scrollTo({left:D,behavior:l});return}B?p.x=x.scrollLeft-D:p.x=b===oe.Right?x.scrollLeft-C.x:x.scrollLeft-T.x,p.x&&x.scrollBy({left:-p.x,behavior:l});break}else if(R&&j.y!==c.y){const D=x.scrollTop+h.y,B=b===oe.Down&&D<=C.y||b===oe.Up&&D>=T.y;if(B&&!h.x){x.scrollTo({top:D,behavior:l});return}B?p.y=x.scrollTop-D:p.y=b===oe.Down?x.scrollTop-C.y:x.scrollTop-T.y,p.y&&x.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(e,Sn(Xn(c,this.referenceCoordinates),p))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Or.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=Lo,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function ai(t){return!!(t&&"distance"in t)}function ci(t){return!!(t&&"delay"in t)}class Br{constructor(e,n,r){var s;r===void 0&&(r=fu(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=Rn(o),this.documentListeners=new Kn(this.document),this.listeners=new Kn(r),this.windowListeners=new Kn(rt(o)),this.initialCoordinates=(s=vs(i))!=null?s:Rt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(xt.Resize,this.handleCancel),this.windowListeners.add(xt.DragStart,li),this.windowListeners.add(xt.VisibilityChange,this.handleCancel),this.windowListeners.add(xt.ContextMenu,li),this.documentListeners.add(xt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ci(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(ai(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(xt.Click,hu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xt.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:l}}=i;if(!s)return;const a=(n=vs(e))!=null?n:Rt,u=Xn(s,a);if(!r&&l){if(ai(l)){if(l.tolerance!=null&&Qs(u,l.tolerance))return this.handleCancel();if(Qs(u,l.distance))return this.handleStart()}if(ci(l)&&Qs(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}e.cancelable&&e.preventDefault(),o(a)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===oe.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const gu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $r extends Br{constructor(e){const{event:n}=e,r=Rn(n.target);super(e,gu,r)}}$r.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const mu={move:{name:"mousemove"},end:{name:"mouseup"}};var ir;(function(t){t[t.RightClick=2]="RightClick"})(ir||(ir={}));class xu extends Br{constructor(e){super(e,mu,Rn(e.event.target))}}xu.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===ir.RightClick?!1:(r?.({event:n}),!0)}}];const Xs={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class bu extends Br{constructor(e){super(e,Xs)}static setup(){return window.addEventListener(Xs.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Xs.move.name,e)};function e(){}}}bu.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var Vn;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Vn||(Vn={}));var Cs;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Cs||(Cs={}));function yu(t){let{acceleration:e,activator:n=Vn.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:l=Cs.TreeOrder,pointerCoordinates:a,scrollableAncestors:u,scrollableAncestorRects:f,delta:c,threshold:h}=t;const p=wu({delta:c,disabled:!i}),[m,x]=Oc(),b=w.useRef({x:0,y:0}),g=w.useRef({x:0,y:0}),y=w.useMemo(()=>{switch(n){case Vn.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case Vn.DraggableRect:return s}},[n,s,a]),k=w.useRef(null),v=w.useCallback(()=>{const T=k.current;if(!T)return;const S=b.current.x*g.current.x,j=b.current.y*g.current.y;T.scrollBy(S,j)},[]),C=w.useMemo(()=>l===Cs.TreeOrder?[...u].reverse():u,[l,u]);w.useEffect(()=>{if(!i||!u.length||!y){x();return}for(const T of C){if(r?.(T)===!1)continue;const S=u.indexOf(T),j=f[S];if(!j)continue;const{direction:N,speed:R}=lu(T,j,y,e,h);for(const D of["x","y"])p[D][N[D]]||(R[D]=0,N[D]=0);if(R.x>0||R.y>0){x(),k.current=T,m(v,o),b.current=R,g.current=N;return}}b.current={x:0,y:0},g.current={x:0,y:0},x()},[e,v,r,x,i,o,JSON.stringify(y),JSON.stringify(p),m,u,C,f,JSON.stringify(h)])}const ku={x:{[Fe.Backward]:!1,[Fe.Forward]:!1},y:{[Fe.Backward]:!1,[Fe.Forward]:!1}};function wu(t){let{delta:e,disabled:n}=t;const r=ws(e);return ts(s=>{if(n||!r||!s)return ku;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Fe.Backward]:s.x[Fe.Backward]||i.x===-1,[Fe.Forward]:s.x[Fe.Forward]||i.x===1},y:{[Fe.Backward]:s.y[Fe.Backward]||i.y===-1,[Fe.Forward]:s.y[Fe.Forward]||i.y===1}}},[n,e,r])}function vu(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return ts(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function Su(t,e){return w.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var Yn;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Yn||(Yn={}));var or;(function(t){t.Optimized="optimized"})(or||(or={}));const ui=new Map;function Cu(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=w.useState(null),{frequency:l,measure:a,strategy:u}=s,f=w.useRef(t),c=b(),h=Qn(c),p=w.useCallback(function(g){g===void 0&&(g=[]),!h.current&&o(y=>y===null?g:y.concat(g.filter(k=>!y.includes(k))))},[h]),m=w.useRef(null),x=ts(g=>{if(c&&!n)return ui;if(!g||g===ui||f.current!==t||i!=null){const y=new Map;for(let k of t){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){y.set(k.id,k.rect.current);continue}const v=k.node.current,C=v?new _r(a(v),v):null;k.rect.current=C,C&&y.set(k.id,C)}return y}return g},[t,i,n,c,a]);return w.useEffect(()=>{f.current=t},[t]),w.useEffect(()=>{c||p()},[n,c]),w.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),w.useEffect(()=>{c||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},l))},[l,c,p,...r]),{droppableRects:x,measureDroppableContainers:p,measuringScheduled:i!=null};function b(){switch(u){case Yn.Always:return!1;case Yn.BeforeDragging:return n;default:return!n}}}function Mr(t,e){return ts(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Tu(t,e){return Mr(t,e)}function ju(t){let{callback:e,disabled:n}=t;const r=Bs(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function zs(t){let{callback:e,disabled:n}=t;const r=Bs(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function Du(t){return new _r(En(t),t)}function di(t,e,n){e===void 0&&(e=Du);const[r,s]=w.useState(null);function i(){s(a=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=a??n)!=null?u:null}const f=e(t);return JSON.stringify(a)===JSON.stringify(f)?a:f})}const o=ju({callback(a){if(t)for(const u of a){const{type:f,target:c}=u;if(f==="childList"&&c instanceof HTMLElement&&c.contains(t)){i();break}}}}),l=zs({callback:i});return Nt(()=>{i(),t?(l?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),o?.disconnect())},[t]),r}function Nu(t){const e=Mr(t);return Eo(t,e)}const fi=[];function Ru(t){const e=w.useRef(t),n=ts(r=>t?r&&r!==fi&&t&&e.current&&t.parentNode===e.current.parentNode?r:Ms(t):fi,[t]);return w.useEffect(()=>{e.current=t},[t]),n}function Eu(t){const[e,n]=w.useState(null),r=w.useRef(t),s=w.useCallback(i=>{const o=Gs(i.target);o&&n(l=>l?(l.set(o,rr(o)),new Map(l)):null)},[]);return w.useEffect(()=>{const i=r.current;if(t!==i){o(i);const l=t.map(a=>{const u=Gs(a);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,rr(u)]):null}).filter(a=>a!=null);n(l.length?new Map(l):null),r.current=t}return()=>{o(t),o(i)};function o(l){l.forEach(a=>{const u=Gs(a);u?.removeEventListener("scroll",s)})}},[s,t]),w.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Sn(i,o),Rt):Mo(t):Rt,[t,e])}function hi(t,e){e===void 0&&(e=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},e),w.useEffect(()=>{const r=t!==Rt;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Xn(t,n.current):Rt}function Iu(t){w.useEffect(()=>{if(!Os)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function Au(t,e){return w.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function Po(t){return w.useMemo(()=>t?su(t):null,[t])}const pi=[];function _u(t,e){e===void 0&&(e=En);const[n]=t,r=Po(n?rt(n):null),[s,i]=w.useState(pi);function o(){i(()=>t.length?t.map(a=>Bo(a)?r:new _r(e(a),a)):pi)}const l=zs({callback:o});return Nt(()=>{l?.disconnect(),o(),t.forEach(a=>l?.observe(a))},[t]),s}function Fo(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return es(e)?e:t}function Ou(t){let{measure:e}=t;const[n,r]=w.useState(null),s=w.useCallback(u=>{for(const{target:f}of u)if(es(f)){r(c=>{const h=e(f);return c?{...c,width:h.width,height:h.height}:h});break}},[e]),i=zs({callback:s}),o=w.useCallback(u=>{const f=Fo(u);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[l,a]=ks(o);return w.useMemo(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}const Bu=[{sensor:$r,options:{}},{sensor:Or,options:{}}],$u={current:{}},bs={draggable:{measure:oi},droppable:{measure:oi,strategy:Yn.WhileDragging,frequency:or.Optimized},dragOverlay:{measure:En}};class Wn extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const Mu={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Wn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ss},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bs,measureDroppableContainers:Ss,windowRect:null,measuringScheduled:!1},Uo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ss,draggableNodes:new Map,over:null,measureDroppableContainers:Ss},ss=w.createContext(Uo),Ho=w.createContext(Mu);function zu(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Wn}}}function Lu(t,e){switch(e.type){case ze.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case ze.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case ze.DragEnd:case ze.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ze.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new Wn(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case ze.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const o=new Wn(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case ze.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new Wn(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Pu(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=w.useContext(ss),i=ws(r),o=ws(n?.id);return w.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!$s(i)||document.activeElement===i.target)return;const l=s.get(o);if(!l)return;const{activatorNode:a,node:u}=l;if(!a.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[a.current,u.current]){if(!f)continue;const c=Mc(f);if(c){c.focus();break}}})}},[r,e,s,o,i]),null}function qo(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function Fu(t){return w.useMemo(()=>({draggable:{...bs.draggable,...t?.draggable},droppable:{...bs.droppable,...t?.droppable},dragOverlay:{...bs.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Uu(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=w.useRef(!1),{x:o,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Nt(()=>{if(!o&&!l||!e){i.current=!1;return}if(i.current||!r)return;const u=e?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),c=Eo(f,r);if(o||(c.x=0),l||(c.y=0),i.current=!0,Math.abs(c.x)>0||Math.abs(c.y)>0){const h=Ao(u);h&&h.scrollBy({top:c.y,left:c.x})}},[e,o,l,r,n])}const Ls=w.createContext({...Rt,scaleX:1,scaleY:1});var Pt;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Pt||(Pt={}));const Hu=w.memo(function(e){var n,r,s,i;let{id:o,accessibility:l,autoScroll:a=!0,children:u,sensors:f=Bu,collisionDetection:c=Yc,measuring:h,modifiers:p,...m}=e;const x=w.useReducer(Lu,void 0,zu),[b,g]=x,[y,k]=Hc(),[v,C]=w.useState(Pt.Uninitialized),T=v===Pt.Initialized,{draggable:{active:S,nodes:j,translate:N},droppable:{containers:R}}=b,D=S!=null?j.get(S):null,B=w.useRef({initial:null,translated:null}),z=w.useMemo(()=>{var ce;return S!=null?{id:S,data:(ce=D?.data)!=null?ce:$u,rect:B}:null},[S,D]),M=w.useRef(null),[L,A]=w.useState(null),[I,_]=w.useState(null),q=Qn(m,Object.values(m)),Z=ns("DndDescribedBy",o),F=w.useMemo(()=>R.getEnabled(),[R]),U=Fu(h),{droppableRects:G,measureDroppableContainers:X,measuringScheduled:Y}=Cu(F,{dragging:T,dependencies:[N.x,N.y],config:U.droppable}),V=vu(j,S),se=w.useMemo(()=>I?vs(I):null,[I]),te=tt(),J=Tu(V,U.draggable.measure);Uu({activeNode:S!=null?j.get(S):null,config:te.layoutShiftCompensation,initialRect:J,measure:U.draggable.measure});const O=di(V,U.draggable.measure,J),H=di(V?V.parentElement:null),Q=w.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=R.getNodeFor((n=Q.current.over)==null?void 0:n.id),E=Ou({measure:U.dragOverlay.measure}),W=(r=E.nodeRef.current)!=null?r:V,ee=T?(s=E.rect)!=null?s:O:null,ae=!!(E.nodeRef.current&&E.rect),me=Nu(ae?null:O),Ce=Po(W?rt(W):null),ke=Ru(T?re??V:null),we=_u(ke),Le=qo(p,{transform:{x:N.x-me.x,y:N.y-me.y,scaleX:1,scaleY:1},activatorEvent:I,active:z,activeNodeRect:O,containerNodeRect:H,draggingNodeRect:ee,over:Q.current.over,overlayNodeRect:E.rect,scrollableAncestors:ke,scrollableAncestorRects:we,windowRect:Ce}),_e=se?Sn(se,N):null,kt=Eu(ke),xe=hi(kt),he=hi(kt,[O]),Pe=Sn(Le,xe),pe=ee?eu(ee,Le):null,pt=z&&pe?c({active:z,collisionRect:pe,droppableRects:G,droppableContainers:F,pointerCoordinates:_e}):null,Ve=No(pt,"id"),[Ie,We]=w.useState(null),Ze=ae?Le:Sn(Le,he),gt=Zc(Ze,(i=Ie?.rect)!=null?i:null,O),Ue=w.useRef(null),Ge=w.useCallback((ce,ve)=>{let{sensor:ge,options:Ne}=ve;if(M.current==null)return;const be=j.get(M.current);if(!be)return;const Te=ce.nativeEvent,je=new ge({active:M.current,activeNode:be,event:Te,options:Ne,context:Q,onAbort(fe){if(!j.get(fe))return;const{onDragAbort:Ee}=q.current,qe={id:fe};Ee?.(qe),y({type:"onDragAbort",event:qe})},onPending(fe,Oe,Ee,qe){if(!j.get(fe))return;const{onDragPending:$e}=q.current,Re={id:fe,constraint:Oe,initialCoordinates:Ee,offset:qe};$e?.(Re),y({type:"onDragPending",event:Re})},onStart(fe){const Oe=M.current;if(Oe==null)return;const Ee=j.get(Oe);if(!Ee)return;const{onDragStart:qe}=q.current,Be={activatorEvent:Te,active:{id:Oe,data:Ee.data,rect:B}};Ft.unstable_batchedUpdates(()=>{qe?.(Be),C(Pt.Initializing),g({type:ze.DragStart,initialCoordinates:fe,active:Oe}),y({type:"onDragStart",event:Be}),A(Ue.current),_(Te)})},onMove(fe){g({type:ze.DragMove,coordinates:fe})},onEnd:He(ze.DragEnd),onCancel:He(ze.DragCancel)});Ue.current=je;function He(fe){return async function(){const{active:Ee,collisions:qe,over:Be,scrollAdjustedTranslate:$e}=Q.current;let Re=null;if(Ee&&$e){const{cancelDrop:Me}=q.current;Re={activatorEvent:Te,active:Ee,collisions:qe,delta:$e,over:Be},fe===ze.DragEnd&&typeof Me=="function"&&await Promise.resolve(Me(Re))&&(fe=ze.DragCancel)}M.current=null,Ft.unstable_batchedUpdates(()=>{g({type:fe}),C(Pt.Uninitialized),We(null),A(null),_(null),Ue.current=null;const Me=fe===ze.DragEnd?"onDragEnd":"onDragCancel";if(Re){const Ke=q.current[Me];Ke?.(Re),y({type:Me,event:Re})}})}}},[j]),Je=w.useCallback((ce,ve)=>(ge,Ne)=>{const be=ge.nativeEvent,Te=j.get(Ne);if(M.current!==null||!Te||be.dndKit||be.defaultPrevented)return;const je={active:Te};ce(ge,ve.options,je)===!0&&(be.dndKit={capturedBy:ve.sensor},M.current=Ne,Ge(ge,ve))},[j,Ge]),ct=Su(f,Je);Iu(f),Nt(()=>{O&&v===Pt.Initializing&&C(Pt.Initialized)},[O,v]),w.useEffect(()=>{const{onDragMove:ce}=q.current,{active:ve,activatorEvent:ge,collisions:Ne,over:be}=Q.current;if(!ve||!ge)return;const Te={active:ve,activatorEvent:ge,collisions:Ne,delta:{x:Pe.x,y:Pe.y},over:be};Ft.unstable_batchedUpdates(()=>{ce?.(Te),y({type:"onDragMove",event:Te})})},[Pe.x,Pe.y]),w.useEffect(()=>{const{active:ce,activatorEvent:ve,collisions:ge,droppableContainers:Ne,scrollAdjustedTranslate:be}=Q.current;if(!ce||M.current==null||!ve||!be)return;const{onDragOver:Te}=q.current,je=Ne.get(Ve),He=je&&je.rect.current?{id:je.id,rect:je.rect.current,data:je.data,disabled:je.disabled}:null,fe={active:ce,activatorEvent:ve,collisions:ge,delta:{x:be.x,y:be.y},over:He};Ft.unstable_batchedUpdates(()=>{We(He),Te?.(fe),y({type:"onDragOver",event:fe})})},[Ve]),Nt(()=>{Q.current={activatorEvent:I,active:z,activeNode:V,collisionRect:pe,collisions:pt,droppableRects:G,draggableNodes:j,draggingNode:W,draggingNodeRect:ee,droppableContainers:R,over:Ie,scrollableAncestors:ke,scrollAdjustedTranslate:Pe},B.current={initial:ee,translated:pe}},[z,V,pt,pe,j,W,ee,G,R,Ie,ke,Pe]),yu({...te,delta:N,draggingRect:pe,pointerCoordinates:_e,scrollableAncestors:ke,scrollableAncestorRects:we});const ut=w.useMemo(()=>({active:z,activeNode:V,activeNodeRect:O,activatorEvent:I,collisions:pt,containerNodeRect:H,dragOverlay:E,draggableNodes:j,droppableContainers:R,droppableRects:G,over:Ie,measureDroppableContainers:X,scrollableAncestors:ke,scrollableAncestorRects:we,measuringConfiguration:U,measuringScheduled:Y,windowRect:Ce}),[z,V,O,I,pt,H,E,j,R,G,Ie,X,ke,we,U,Y,Ce]),et=w.useMemo(()=>({activatorEvent:I,activators:ct,active:z,activeNodeRect:O,ariaDescribedById:{draggable:Z},dispatch:g,draggableNodes:j,over:Ie,measureDroppableContainers:X}),[I,ct,z,O,g,Z,j,Ie,X]);return Se.createElement(To.Provider,{value:k},Se.createElement(ss.Provider,{value:et},Se.createElement(Ho.Provider,{value:ut},Se.createElement(Ls.Provider,{value:gt},u)),Se.createElement(Pu,{disabled:l?.restoreFocus===!1})),Se.createElement(Vc,{...l,hiddenTextDescribedById:Z}));function tt(){const ce=L?.autoScrollEnabled===!1,ve=typeof a=="object"?a.enabled===!1:a===!1,ge=T&&!ce&&!ve;return typeof a=="object"?{...a,enabled:ge}:{enabled:ge}}}),qu=w.createContext(null),gi="button",Ku="Draggable";function Vu(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=ns(Ku),{activators:o,activatorEvent:l,active:a,activeNodeRect:u,ariaDescribedById:f,draggableNodes:c,over:h}=w.useContext(ss),{role:p=gi,roleDescription:m="draggable",tabIndex:x=0}=s??{},b=a?.id===e,g=w.useContext(b?Ls:qu),[y,k]=ks(),[v,C]=ks(),T=Au(o,e),S=Qn(n);Nt(()=>(c.set(e,{id:e,key:i,node:y,activatorNode:v,data:S}),()=>{const N=c.get(e);N&&N.key===i&&c.delete(e)}),[c,e]);const j=w.useMemo(()=>({role:p,tabIndex:x,"aria-disabled":r,"aria-pressed":b&&p===gi?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,p,x,b,m,f.draggable]);return{active:a,activatorEvent:l,activeNodeRect:u,attributes:j,isDragging:b,listeners:r?void 0:T,node:y,over:h,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Ko(){return w.useContext(Ho)}const Wu="Droppable",Gu={timeout:25};function Vo(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=ns(Wu),{active:o,dispatch:l,over:a,measureDroppableContainers:u}=w.useContext(ss),f=w.useRef({disabled:n}),c=w.useRef(!1),h=w.useRef(null),p=w.useRef(null),{disabled:m,updateMeasurementsFor:x,timeout:b}={...Gu,...s},g=Qn(x??r),y=w.useCallback(()=>{if(!c.current){c.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),p.current=null},b)},[b]),k=zs({callback:y,disabled:m||!o}),v=w.useCallback((j,N)=>{k&&(N&&(k.unobserve(N),c.current=!1),j&&k.observe(j))},[k]),[C,T]=ks(v),S=Qn(e);return w.useEffect(()=>{!k||!C.current||(k.disconnect(),c.current=!1,k.observe(C.current))},[C,k]),w.useEffect(()=>(l({type:ze.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:h,data:S}}),()=>l({type:ze.UnregisterDroppable,key:i,id:r})),[r]),w.useEffect(()=>{n!==f.current.disabled&&(l({type:ze.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,l]),{active:o,rect:h,isOver:a?.id===r,node:C,over:a,setNodeRef:T}}function Qu(t){let{animation:e,children:n}=t;const[r,s]=w.useState(null),[i,o]=w.useState(null),l=ws(n);return!n&&!r&&l&&s(l),Nt(()=>{if(!i)return;const a=r?.key,u=r?.props.id;if(a==null||u==null){s(null);return}Promise.resolve(e(u,i)).then(()=>{s(null)})},[e,r,i]),Se.createElement(Se.Fragment,null,n,r?w.cloneElement(r,{ref:o}):null)}const Xu={x:0,y:0,scaleX:1,scaleY:1};function Yu(t){let{children:e}=t;return Se.createElement(ss.Provider,{value:Uo},Se.createElement(Ls.Provider,{value:Xu},e))}const Zu={position:"fixed",touchAction:"none"},Ju=t=>$s(t)?"transform 250ms ease":void 0,ed=w.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:l,style:a,transform:u,transition:f=Ju}=t;if(!l)return null;const c=s?u:{...u,scaleX:1,scaleY:1},h={...Zu,width:l.width,height:l.height,top:l.top,left:l.left,transform:Ht.Transform.toString(c),transformOrigin:s&&r?Gc(r,l):void 0,transition:typeof f=="function"?f(r):f,...a};return Se.createElement(n,{className:o,style:h,ref:e},i)}),td=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[l,a]of Object.entries(i.active))a!==void 0&&(s[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,a));if(i!=null&&i.dragOverlay)for(const[l,a]of Object.entries(i.dragOverlay))a!==void 0&&r.node.style.setProperty(l,a);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[a,u]of Object.entries(s))n.node.style.setProperty(a,u);o!=null&&o.active&&n.node.classList.remove(o.active)}},nd=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Ht.Transform.toString(e)},{transform:Ht.Transform.toString(n)}]},sd={duration:250,easing:"ease",keyframes:nd,sideEffects:td({styles:{active:{opacity:"0"}}})};function rd(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return Bs((i,o)=>{if(e===null)return;const l=n.get(i);if(!l)return;const a=l.node.current;if(!a)return;const u=Fo(o);if(!u)return;const{transform:f}=rt(o).getComputedStyle(o),c=Io(f);if(!c)return;const h=typeof e=="function"?e:id(e);return zo(a,s.draggable.measure),h({active:{id:i,data:l.data,node:a,rect:s.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:c})})}function id(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...sd,...t};return i=>{let{active:o,dragOverlay:l,transform:a,...u}=i;if(!e)return;const f={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},c={scaleX:a.scaleX!==1?o.rect.width*a.scaleX/l.rect.width:1,scaleY:a.scaleY!==1?o.rect.height*a.scaleY/l.rect.height:1},h={x:a.x-f.x,y:a.y-f.y,...c},p=s({...u,active:o,dragOverlay:l,transform:{initial:a,final:h}}),[m]=p,x=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(x))return;const b=r?.({active:o,dragOverlay:l,...u}),g=l.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(y=>{g.onfinish=()=>{b?.(),y()}})}}let mi=0;function od(t){return w.useMemo(()=>{if(t!=null)return mi++,mi},[t])}const ld=Se.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:l="div",className:a,zIndex:u=999}=t;const{activatorEvent:f,active:c,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:x,dragOverlay:b,over:g,measuringConfiguration:y,scrollableAncestors:k,scrollableAncestorRects:v,windowRect:C}=Ko(),T=w.useContext(Ls),S=od(c?.id),j=qo(o,{activatorEvent:f,active:c,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:v,transform:T,windowRect:C}),N=Mr(h),R=rd({config:r,draggableNodes:m,droppableContainers:x,measuringConfiguration:y}),D=N?b.setRef:void 0;return Se.createElement(Yu,null,Se.createElement(Qu,{animation:R},c&&S?Se.createElement(ed,{key:S,id:c.id,ref:D,as:l,activatorEvent:f,adjustScale:e,className:a,transition:i,rect:N,style:{zIndex:u,...s},transform:j},n):null))});function ad(t){const{org:e}=Ae(),{data:n}=Ol.useSession(),r=la(),s=Zn(),i=Jl({connectionId:so,orgId:e.id,orgSlug:e.slug}),[o,l]=w.useState(!1),a=na(t,{enabled:!1});return{connect:async()=>{if(!(o||!n?.user?.id||!e)){l(!0);try{const f=a.data??(await a.refetch()).data;if(!f){Kt.error("Could not find this integration in the registry");return}const c=fa(f,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url){Kt.error("This integration has no connection method available");return}const h=c.app_name?await cd(i,c.app_name):null,p=!h,m=h?.id??(await r.create.mutateAsync(c)).id,x=await da({connectionId:m,orgId:e.id,orgSlug:e.slug,persistFallback:b=>r.update.mutateAsync({id:m,data:{connection_token:b}}).then(()=>{})});if(x.ran&&!x.ok){if(p)try{await r.delete.mutateAsync(m)}catch{}Kt.error(`Authentication failed: ${x.error??"no token"}`);return}Bl(s,e.id),Kt.success(p?"Connected successfully":"Already connected")}catch(f){Kt.error(`Failed to connect: ${f instanceof Error?f.message:String(f)}`)}finally{l(!1)}}},isConnecting:o}}async function cd(t,e){return(await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_name"],operator:"eq",value:e},limit:1}})).structuredContent?.items?.[0]??null}function zr(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function ud(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function ds(t){return t!==null&&t>=0}function dd(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function fd(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Wo=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=zr(e,r,n),o=e[s],l=i[s];return!l||!o?null:{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}},fs={scaleX:1,scaleY:1},hd=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const l=(e=i[n])!=null?e:r;if(!l)return null;if(s===n){const u=i[o];return u?{x:0,y:n<o?u.top+u.height-(l.top+l.height):u.top-l.top,...fs}:null}const a=pd(i,s,n);return s>n&&s<=o?{x:0,y:-l.height-a,...fs}:s<n&&s>=o?{x:0,y:l.height+a,...fs}:{x:0,y:0,...fs}};function pd(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?n<e?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const Go="Sortable",Qo=Se.createContext({activeIndex:-1,containerId:Go,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Wo,disabled:{draggable:!1,droppable:!1}});function gd(t){let{children:e,id:n,items:r,strategy:s=Wo,disabled:i=!1}=t;const{active:o,dragOverlay:l,droppableRects:a,over:u,measureDroppableContainers:f}=Ko(),c=ns(Go,n),h=l.rect!==null,p=w.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),m=o!=null,x=o?p.indexOf(o.id):-1,b=u?p.indexOf(u.id):-1,g=w.useRef(p),y=!dd(p,g.current),k=b!==-1&&x===-1||y,v=fd(i);Nt(()=>{y&&m&&f(p)},[y,p,m,f]),w.useEffect(()=>{g.current=p},[p]);const C=w.useMemo(()=>({activeIndex:x,containerId:c,disabled:v,disableTransforms:k,items:p,overIndex:b,useDragOverlay:h,sortedRects:ud(p,a),strategy:s}),[x,c,v.draggable,v.droppable,k,p,b,a,h,s]);return Se.createElement(Qo.Provider,{value:C},e)}const md=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return zr(n,r,s).indexOf(e)},xd=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:l,previousContainerId:a,transition:u}=t;return!u||!r||l!==i&&s===o?!1:n?!0:o!==s&&e===a},bd={duration:200,easing:"ease"},Xo="transform",yd=Ht.Transition.toString({property:Xo,duration:0,easing:"linear"}),kd={roleDescription:"sortable"};function wd(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=w.useState(null),l=w.useRef(n);return Nt(()=>{if(!e&&n!==l.current&&r.current){const a=s.current;if(a){const u=En(r.current,{ignoreTransform:!0}),f={x:a.left-u.left,y:a.top-u.top,scaleX:a.width/u.width,scaleY:a.height/u.height};(f.x||f.y)&&o(f)}}n!==l.current&&(l.current=n)},[e,n,r,s]),w.useEffect(()=>{i&&o(null)},[i]),i}function vd(t){let{animateLayoutChanges:e=xd,attributes:n,disabled:r,data:s,getNewIndex:i=md,id:o,strategy:l,resizeObserverConfig:a,transition:u=bd}=t;const{items:f,containerId:c,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:x,overIndex:b,useDragOverlay:g,strategy:y}=w.useContext(Qo),k=Sd(r,p),v=f.indexOf(o),C=w.useMemo(()=>({sortable:{containerId:c,index:v,items:f},...s}),[c,s,v,f]),T=w.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:S,node:j,isOver:N,setNodeRef:R}=Vo({id:o,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...a}}),{active:D,activatorEvent:B,activeNodeRect:z,attributes:M,setNodeRef:L,listeners:A,isDragging:I,over:_,setActivatorNodeRef:q,transform:Z}=Vu({id:o,data:C,attributes:{...kd,...n},disabled:k.draggable}),F=_c(R,L),U=!!D,G=U&&!m&&ds(h)&&ds(b),X=!g&&I,Y=X&&G?Z:null,se=G?Y??(l??y)({rects:x,activeNodeRect:z,activeIndex:h,overIndex:b,index:v}):null,te=ds(h)&&ds(b)?i({id:o,items:f,activeIndex:h,overIndex:b}):v,J=D?.id,O=w.useRef({activeId:J,items:f,newIndex:te,containerId:c}),H=f!==O.current.items,Q=e({active:D,containerId:c,isDragging:I,isSorting:U,id:o,index:v,items:f,newIndex:O.current.newIndex,previousItems:O.current.items,previousContainerId:O.current.containerId,transition:u,wasDragging:O.current.activeId!=null}),re=wd({disabled:!Q,index:v,node:j,rect:S});return w.useEffect(()=>{U&&O.current.newIndex!==te&&(O.current.newIndex=te),c!==O.current.containerId&&(O.current.containerId=c),f!==O.current.items&&(O.current.items=f)},[U,te,c,f]),w.useEffect(()=>{if(J===O.current.activeId)return;if(J!=null&&O.current.activeId==null){O.current.activeId=J;return}const W=setTimeout(()=>{O.current.activeId=J},50);return()=>clearTimeout(W)},[J]),{active:D,activeIndex:h,attributes:M,data:C,rect:S,index:v,newIndex:te,items:f,isOver:N,isSorting:U,isDragging:I,listeners:A,node:j,overIndex:b,over:_,setNodeRef:F,setActivatorNodeRef:q,setDroppableNodeRef:R,setDraggableNodeRef:L,transform:re??se,transition:E()};function E(){if(re||H&&O.current.newIndex===v)return yd;if(!(X&&!$s(B)||!u)&&(U||Q))return Ht.Transition.toString({...u,property:Xo})}}function Sd(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function Ts(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const Cd=[oe.Down,oe.Right,oe.Up,oe.Left],Td=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:l}}=e;if(Cd.includes(t.code)){if(t.preventDefault(),!n||!r)return;const a=[];i.getEnabled().forEach(c=>{if(!c||c!=null&&c.disabled)return;const h=s.get(c.id);if(h)switch(t.code){case oe.Down:r.top<h.top&&a.push(c);break;case oe.Up:r.top>h.top&&a.push(c);break;case oe.Left:r.left>h.left&&a.push(c);break;case oe.Right:r.left<h.left&&a.push(c);break}});const u=Ro({collisionRect:r,droppableRects:s,droppableContainers:a});let f=No(u,"id");if(f===o?.id&&u.length>1&&(f=u[1].id),f!=null){const c=i.get(n.id),h=i.get(f),p=h?s.get(h.id):null,m=h?.node.current;if(m&&p&&c&&h){const b=Ms(m).some((T,S)=>l[S]!==T),g=Yo(c,h),y=jd(c,h),k=b||!g?{x:0,y:0}:{x:y?r.width-p.width:0,y:y?r.height-p.height:0},v={x:p.left,y:p.top};return k.x&&k.y?v:Xn(v,k)}}}};function Yo(t,e){return!Ts(t)||!Ts(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function jd(t,e){return!Ts(t)||!Ts(e)||!Yo(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function Ot(t){const e=P.c(8),{size:n,className:r}=t,s=n===void 0?16:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=ne("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==o?(l=d.jsx("img",{src:ea,alt:"Super Agent",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const xi=()=>0;function Dd(t){const{orgSlug:e,enabled:n=!0,onUpdate:r,onDelete:s}=t,i=w.useRef(r);i.current=r;const o=w.useRef(s);o.current=s;const l=w.useRef(null),a=w.useRef(n),u=w.useRef(e);(!l.current||a.current!==n||u.current!==e)&&(a.current=n,u.current=e,l.current=c=>{if(!n||!e)return()=>{};const h=p=>{let m;try{m=JSON.parse(p.data)}catch{return}m.data&&(p.type===pa?o.current?.(m.data.id):i.current(m.data)),c()};return ha.subscribe(e,h)}),w.useSyncExternalStore(l.current,xi,xi)}function Nd(){const t=P.c(27),{org:e,locator:n}=Ae(),r=Jn(),s=Zn();let i;t[0]!==n?(i=De.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const o=i;let l;t[2]!==r?(l=async()=>(await r.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=r,t[3]=l):l=t[3];let a;t[4]!==o||t[5]!==l?(a={queryKey:o,queryFn:l},t[4]=o,t[5]=l,t[6]=a):a=t[6];const u=lt(a);let f,c;t[7]!==s||t[8]!==o?(f=g=>{s.setQueryData(o,y=>{const k=y??[],v=g;return k.some(C=>C.id===v.id)?k.map(C=>C.id===v.id?v:C):[v,...k]})},c=g=>{s.setQueryData(o,y=>y?.filter(k=>k.id!==g))},t[7]=s,t[8]=o,t[9]=f,t[10]=c):(f=t[9],c=t[10]);let h;t[11]!==e.slug||t[12]!==f||t[13]!==c?(h={orgSlug:e.slug,onUpdate:f,onDelete:c},t[11]=e.slug,t[12]=f,t[13]=c,t[14]=h):h=t[14],Dd(h);let p;t[15]!==s||t[16]!==o?(p=g=>{const y=g.subject,k=g.data.status;s.setQueryData(o,v=>v?.map(C=>C.threads.some(T=>T.threadId===y)?{...C,threads:C.threads.map(T=>T.threadId===y?{...T,status:k}:T)}:C))},t[15]=s,t[16]=o,t[17]=p):p=t[17];let m;t[18]!==e.slug||t[19]!==p?(m={orgSlug:e.slug,onTaskStatus:p},t[18]=e.slug,t[19]=p,t[20]=m):m=t[20],ga(m);let x;t[21]!==u.data?(x=u.data??[],t[21]=u.data,t[22]=x):x=t[22];let b;return t[23]!==u.error||t[24]!==u.isLoading||t[25]!==x?(b={items:x,isLoading:u.isLoading,error:u.error},t[23]=u.error,t[24]=u.isLoading,t[25]=x,t[26]=b):b=t[26],b}function Rd(){const t=P.c(40),{locator:e}=Ae(),n=Jn(),r=Zn();let s;t[0]!==e?(s=De.taskBoardItems(e),t[0]=e,t[1]=s):s=t[1];const i=s;let o;t[2]!==r||t[3]!==i?(o=()=>r.invalidateQueries({queryKey:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4];const l=o;let a;t[5]!==n?(a=j=>n.call("TASK_BOARD_ITEM_CREATE",j),t[5]=n,t[6]=a):a=t[6];let u;t[7]!==l||t[8]!==a?(u={mutationFn:a,onSuccess:l},t[7]=l,t[8]=a,t[9]=u):u=t[9];const f=_t(u);let c;t[10]!==n?(c=j=>n.call("TASK_BOARD_ITEM_UPDATE",j),t[10]=n,t[11]=c):c=t[11];let h,p;t[12]!==r||t[13]!==i?(h=async j=>{await r.cancelQueries({queryKey:i});const N=r.getQueryData(i);return r.setQueryData(i,R=>R?.map(D=>D.id===j.id?{...D,...j}:D)),{previous:N}},p=(j,N,R)=>{R?.previous&&r.setQueryData(i,R.previous)},t[12]=r,t[13]=i,t[14]=h,t[15]=p):(h=t[14],p=t[15]);let m;t[16]!==l||t[17]!==e||t[18]!==r?(m=(j,N,R)=>{l(),r.invalidateQueries({queryKey:De.taskBoardActivity(e,R.id)})},t[16]=l,t[17]=e,t[18]=r,t[19]=m):m=t[19];let x;t[20]!==c||t[21]!==h||t[22]!==p||t[23]!==m?(x={mutationFn:c,onMutate:h,onError:p,onSettled:m},t[20]=c,t[21]=h,t[22]=p,t[23]=m,t[24]=x):x=t[24];const b=_t(x);let g;t[25]!==n?(g=j=>n.call("TASK_BOARD_ITEM_DELETE",{id:j}),t[25]=n,t[26]=g):g=t[26];let y;t[27]!==l||t[28]!==g?(y={mutationFn:g,onSuccess:l},t[27]=l,t[28]=g,t[29]=y):y=t[29];const k=_t(y);let v;t[30]!==n?(v=j=>n.call("TASK_BOARD_ITEM_UPDATE",j),t[30]=n,t[31]=v):v=t[31];let C;t[32]!==l||t[33]!==v?(C={mutationFn:v,onSuccess:l},t[32]=l,t[33]=v,t[34]=C):C=t[34];const T=_t(C);let S;return t[35]!==f||t[36]!==T||t[37]!==k||t[38]!==b?(S={create:f,update:b,remove:k,link:T},t[35]=f,t[36]=T,t[37]=k,t[38]=b,t[39]=S):S=t[39],S}function js(t){return t.threads.some(e=>e.status==="requires_action")}function Lr(t){return t.status==="in_progress"&&js(t)?"text-warning animate-pulse":bt[t.status].iconClassName}function Ed(t){return t.threads[0]}function bi(t,e,n){const r=t.findIndex(f=>f.id===n),s=e===n?t[r+1]?.id??null:e,i=t.filter(f=>f.id!==n),o=s?i.findIndex(f=>f.id===s):-1,l=o===-1?i.length:o,a=i[l-1],u=i[l];return a&&u?(a.sortOrder+u.sortOrder)/2:a?a.sortOrder+1:u?u.sortOrder-1:0}function Zo(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const Ds=["triage","todo","in_progress","in_review","done"],bt={triage:{labelKey:"taskBoard.config.statusBacklog",icon:lo,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:ma,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:xr,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:xa,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:vr,iconClassName:"text-success"}},Pr=["none","low","medium","high","urgent"],yt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive"}},lr=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],Jo=lr[0];function rs(t){return t??Jo}function Id(t){return lr[t%lr.length]??Jo}let ar,cr;if(typeof WeakMap<"u"){let t=new WeakMap;ar=e=>t.get(e),cr=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;ar=r=>{for(let s=0;s<t.length;s+=2)if(t[s]==r)return t[s+1]},cr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var zt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,s=e/this.width|0;let i=r+1,o=s+1;for(let l=1;i<this.width&&this.map[e+l]==n;l++)i++;for(let l=1;o<this.height&&this.map[e+this.width*l]==n;l++)o++;return{left:r,top:s,right:i,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:s,top:i,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?r==0:s==this.width)?null:this.map[i*this.width+(n<0?r-1:s)]:(n<0?i==0:o==this.height)?null:this.map[r+this.width*(n<0?i-1:o)]}rectBetween(t,e){const{left:n,right:r,top:s,bottom:i}=this.findCell(t),{left:o,right:l,top:a,bottom:u}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(s,a),right:Math.max(r,l),bottom:Math.max(i,u)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let s=t.left;s<t.right;s++){const i=r*this.width+s,o=this.map[i];n[o]||(n[o]=!0,!(s==t.left&&s&&this.map[i-1]==o||r==t.top&&r&&this.map[i-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let r=0,s=0;;r++){const i=s+n.child(r).nodeSize;if(r==t){let o=e+t*this.width;const l=(t+1)*this.width;for(;o<l&&this.map[o]<s;)o++;return o==l?i-1:this.map[o]}s=i}}static get(t){return ar(t)||cr(t,Ad(t))}};function Ad(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=_d(t),n=t.childCount,r=[];let s=0,i=null;const o=[];for(let u=0,f=e*n;u<f;u++)r[u]=0;for(let u=0,f=0;u<n;u++){const c=t.child(u);f++;for(let m=0;;m++){for(;s<r.length&&r[s]!=0;)s++;if(m==c.childCount)break;const x=c.child(m),{colspan:b,rowspan:g,colwidth:y}=x.attrs;for(let k=0;k<g;k++){if(k+u>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:f,n:g-k});break}const v=s+k*e;for(let C=0;C<b;C++){r[v+C]==0?r[v+C]=f:(i||(i=[])).push({type:"collision",row:u,pos:f,n:b-C});const T=y&&y[C];if(T){const S=(v+C)%e*2,j=o[S];j==null||j!=T&&o[S+1]==1?(o[S]=T,o[S+1]=1):j==T&&o[S+1]++}}}s+=b,f+=x.nodeSize}const h=(u+1)*e;let p=0;for(;s<h;)r[s++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:u,n:p}),f++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const l=new zt(e,n,r,i);let a=!1;for(let u=0;!a&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(a=!0);return a&&Od(l,o,t),l}function _d(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const s=t.child(r);let i=0;if(n)for(let o=0;o<r;o++){const l=t.child(o);for(let a=0;a<l.childCount;a++){const u=l.child(a);o+u.attrs.rowspan>r&&(i+=u.attrs.colspan)}}for(let o=0;o<s.childCount;o++){const l=s.child(o);i+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function Od(t,e,n){t.problems||(t.problems=[]);const r={};for(let s=0;s<t.map.length;s++){const i=t.map[s];if(r[i])continue;r[i]=!0;const o=n.nodeAt(i);if(!o)throw new RangeError(`No cell with offset ${i} found`);let l=null;const a=o.attrs;for(let u=0;u<a.colspan;u++){const f=e[(s+u)%t.width*2];f!=null&&(!a.colwidth||a.colwidth[u]!=f)&&((l||(l=Bd(a)))[u]=f)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function Bd(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Fr(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],s=r.spec.tableRole;s&&(e[s]=r)}}return e}new Ut("selectingCells");function $d(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function el(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Md(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=$d(e.$head)||zd(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function zd(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function yi(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function tl(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function nl(t,e,n){const r=t.node(-1),s=zt.get(r),i=t.start(-1),o=s.nextCell(t.pos-i,e,n);return o==null?null:t.node(0).resolve(i+o)}function ki(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(s=>s>0)||(r.colwidth=null)),r}var Bt=class Mt extends At{constructor(e,n=e){const r=e.node(-1),s=zt.get(r),i=e.start(-1),o=s.rectBetween(e.pos-i,n.pos-i),l=e.node(0),a=s.cellsInRect(o).filter(f=>f!=n.pos-i);a.unshift(n.pos-i);const u=a.map(f=>{const c=r.nodeAt(f);if(!c)throw new RangeError(`No cell with offset ${f} found`);const h=i+f+1;return new Ca(l.resolve(h),l.resolve(h+c.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),s=e.resolve(n.map(this.$headCell.pos));if(yi(r)&&yi(s)&&tl(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Mt.rowSelection(r,s):i&&this.isColSelection()?Mt.colSelection(r,s):new Mt(r,s)}return co.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=zt.get(e),r=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},o=[];for(let a=s.top;a<s.bottom;a++){const u=[];for(let f=a*n.width+s.left,c=s.left;c<s.right;c++,f++){const h=n.map[f];if(i[h])continue;i[h]=!0;const p=n.findCell(h);let m=e.nodeAt(h);if(!m)throw new RangeError(`No cell with offset ${h} found`);const x=s.left-p.left,b=p.right-s.right;if(x>0||b>0){let g=m.attrs;if(x>0&&(g=ki(g,0,x)),b>0&&(g=ki(g,g.colspan-b,b)),p.left<s.left){if(m=m.type.createAndFill(g),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else m=m.type.create(g,m.content)}if(p.top<s.top||p.bottom>s.bottom){const g={...m.attrs,rowspan:Math.min(p.bottom,s.bottom)-Math.max(p.top,s.top)};p.top<s.top?m=m.type.createAndFill(g):m=m.type.create(g,m.content)}u.push(m)}o.push(e.child(a).copy(Vs.from(u)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new Pn(Vs.from(l),1,1)}replace(e,n=Pn.empty){const r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){const{$from:l,$to:a}=s[o],u=e.mapping.slice(r);e.replace(u.map(l.pos),u.map(a.pos),o?Pn.empty:n)}const i=At.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new Pn(Vs.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=zt.get(n),s=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-s,this.$headCell.pos-s));for(let o=0;o<i.length;o++)e(n.nodeAt(i[o]),s+i[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,s=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,s)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),s=zt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.top<=l.top?(o.top>0&&(e=a.resolve(i+s.map[o.left])),l.bottom<s.height&&(n=a.resolve(i+s.map[s.width*(s.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(i+s.map[l.left])),o.bottom<s.height&&(e=a.resolve(i+s.map[s.width*(s.height-1)+o.right-1]))),new Mt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=zt.get(e),r=this.$anchorCell.start(-1),s=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(s,i)>0)return!1;const o=s+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(e){return e instanceof Mt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=zt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.left<=l.left?(o.left>0&&(e=a.resolve(i+s.map[o.top*s.width])),l.right<s.width&&(n=a.resolve(i+s.map[s.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(i+s.map[l.top*s.width])),o.right<s.width&&(e=a.resolve(i+s.map[s.width*(o.top+1)-1]))),new Mt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Mt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Mt(e.resolve(n),e.resolve(r))}getBookmark(){return new Ld(this.$anchorCell.pos,this.$headCell.pos)}};Bt.prototype.visible=!1;At.jsonID("cell",Bt);var Ld=class sl{constructor(e,n){this.anchor=e,this.head=n}map(e){return new sl(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&tl(n,r)?new Bt(n,r):At.near(r,1)}};new Ut("fix-tables");function rl(t){const e=t.selection,n=Md(t),r=n.node(-1),s=n.start(-1),i=zt.get(r);return{...e instanceof Bt?i.rectBetween(e.$anchorCell.pos-s,e.$headCell.pos-s):i.findCell(n.pos-s),tableStart:s,map:i,table:r}}function Pd(t){return function(e,n){if(!el(e))return!1;if(n){const r=Fr(e.schema),s=rl(e),i=e.tr,o=s.map.cellsInRect(t=="column"?{left:s.left,top:0,right:s.right,bottom:s.map.height}:t=="row"?{left:0,top:s.top,right:s.map.width,bottom:s.bottom}:s),l=o.map(a=>s.table.nodeAt(a));for(let a=0;a<o.length;a++)l[a].type==r.header_cell&&i.setNodeMarkup(s.tableStart+o[a],r.cell,l[a].attrs);if(i.steps.length===0)for(let a=0;a<o.length;a++)i.setNodeMarkup(s.tableStart+o[a],r.header_cell,l[a].attrs);n(i)}return!0}}function wi(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let s=0;s<r.length;s++){const i=e.table.nodeAt(r[s]);if(i&&i.type!==n.header_cell)return!1}return!0}function Ur(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Pd(t):function(n,r){if(!el(n))return!1;if(r){const s=Fr(n.schema),i=rl(n),o=n.tr,l=wi("row",i,s),a=wi("column",i,s),u=(t==="column"?l:t==="row"&&a)?1:0,f=t=="column"?{left:0,top:u,right:1,bottom:i.map.height}:t=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,c=t=="column"?a?s.cell:s.header_cell:t=="row"?l?s.cell:s.header_cell:s.cell;i.map.cellsInRect(f).forEach(h=>{const p=h+i.tableStart,m=o.doc.nodeAt(p);m&&o.setNodeMarkup(p,c,m.attrs)}),r(o)}return!0}}Ur("row",{useDeprecatedLogic:!0});Ur("column",{useDeprecatedLogic:!0});Ur("cell",{useDeprecatedLogic:!0});function hs(t,e){const n=t.selection;if(!(n instanceof Bt))return!1;if(e){const r=t.tr,s=Fr(t.schema).cell.createAndFill().content;n.forEachCell((i,o)=>{i.content.eq(s)||r.replace(r.mapping.map(o+1),r.mapping.map(o+i.nodeSize-1),new Pn(s,0,0))}),r.docChanged&&e(r)}return!0}Ta({ArrowLeft:ps("horiz",-1),ArrowRight:ps("horiz",1),ArrowUp:ps("vert",-1),ArrowDown:ps("vert",1),"Shift-ArrowLeft":gs("horiz",-1),"Shift-ArrowRight":gs("horiz",1),"Shift-ArrowUp":gs("vert",-1),"Shift-ArrowDown":gs("vert",1),Backspace:hs,"Mod-Backspace":hs,Delete:hs,"Mod-Delete":hs});function ys(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function ps(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof Bt)return ys(n,r,At.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=il(s,t,e);if(o==null)return!1;if(t=="horiz")return ys(n,r,At.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(o),a=nl(l,t,e);let u;return a?u=At.near(a,1):e<0?u=At.near(n.doc.resolve(l.before(-1)),-1):u=At.near(n.doc.resolve(l.after(-1)),1),ys(n,r,u)}}}function gs(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;let o;if(i instanceof Bt)o=i;else{const a=il(s,t,e);if(a==null)return!1;o=new Bt(n.doc.resolve(a))}const l=nl(o.$headCell,t,e);return l?ys(n,r,new Bt(o.$anchorCell,l)):!1}}function il(t,e,n){if(!(t.state.selection instanceof co))return null;const{$head:r}=t.state.selection;for(let s=r.depth-1;s>=0;s--){const i=r.node(s);if((n<0?r.index(s):r.indexAfter(s))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const o=r.before(s),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?o:null}}return null}new Ut("tableColumnResizing");function Fd(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),s=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-s,l=r-n,a=s,u=n;return new DOMRect(a,u,o,l)}var Ud=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:s=250,resizeDelay:i=60,shouldShow:o,appendTo:l,getReferencedVirtualElement:a,options:u}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:c,state:h,from:p,to:m})=>{const{doc:x,selection:b}=h,{empty:g}=b,y=!x.textBetween(p,m).length&&ja(h.selection),k=this.element.contains(document.activeElement);return!(!(c.hasFocus()||k)||g||y||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:c})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}c?.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(c.relatedTarget))||c?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(c,h)=>{const p=!h?.selection.eq(c.state.selection),m=!h?.doc.eq(c.state.doc);!p&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(c,p,m,h)},this.updateDelay))},this.updateHandler=(c,h,p,m)=>{const{composing:x}=c;if(x||!h&&!p)return;if(!this.getShouldShow(m)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:c})=>{const h=c.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())};var f;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(f=u?.scrollTarget)!=null?f:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...u},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Fi(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Ui(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Hi(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(qi(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Ki(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Vi(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Wi(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(Gi(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e,n;const{selection:r}=this.editor.state,s=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(s)return s;if(!((n=(e=this.view)==null?void 0:e.dom)!=null&&n.parentNode))return;const i=uo(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof Da){let l=this.view.nodeDOM(r.from);const a=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");a&&(l=a),l&&(o={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(r instanceof Bt){const{$anchorCell:l,$headCell:a}=r,u=l?l.pos:a.pos,f=a?a.pos:l.pos,c=this.view.nodeDOM(u),h=this.view.nodeDOM(f);if(!c||!h)return;const p=c===h?c.getBoundingClientRect():Fd(c.getBoundingClientRect(),h.getBoundingClientRect());o={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&Qi(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:r,middlewareData:s})=>{var i,o;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((i=s.hide)!=null&&i.referenceHidden||(o=s.hide)!=null&&o.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:n}=t,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(t,e);return}const s=!e?.selection.eq(t.state.selection),i=!e?.doc.eq(t.state.doc);this.updateHandler(t,s,i,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:s}=r,i=Math.min(...s.map(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:i,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},ol=t=>new Sr({key:typeof t.pluginKey=="string"?new Ut(t.pluginKey):t.pluginKey,view:e=>new Ud({view:e,...t})});Cr.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ol({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Hd=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:s=250,resizeDelay:i=60,options:o,appendTo:l,shouldShow:a}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:f,state:c})=>{const{selection:h}=c,{$anchor:p,empty:m}=h,x=p.depth===1,b=p.parent.isTextblock&&!p.parent.type.spec.code&&!p.parent.textContent&&p.parent.childCount===0&&!this.getTextContent(p.parent);return!(!f.hasFocus()||!m||!x||!b||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(f,c,h,p)=>{const{composing:m}=f;if(m||!c&&!h)return;if(!this.getShouldShow(p)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:f})=>{var c;if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((c=this.element.parentNode)!=null&&c.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:f})=>{const c=f.getMeta(this.pluginKey);c==="updatePosition"?this.updatePosition():c&&typeof c=="object"&&c.type==="updateOptions"?this.updateOptions(c.options):c==="hide"?this.hide():c==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var u;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(u=o?.scrollTarget)!=null?u:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return Na(t,{textSerializers:Ra(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Fi(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Ui(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Hi(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(qi(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Ki(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Vi(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Wi(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(Gi(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:s}=r,i=Math.min(...s.map(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:n,oldState:t,from:i,to:o})}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){const{selection:t}=this.editor.state,e=uo(this.view,t.from,t.to);Qi({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:r,y:s,strategy:i,middlewareData:o})=>{var l,a;if((l=o.hide)!=null&&l.referenceHidden||(a=o.hide)!=null&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${r}px`,this.element.style.top=`${s}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const n=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,n,r,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},ll=t=>new Sr({key:typeof t.pluginKey=="string"?new Ut(t.pluginKey):t.pluginKey,view:e=>new Hd({view:e,...t})});Cr.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[ll({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var qd=Se.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,getReferencedVirtualElement:o,options:l,children:a,...u},f)=>{const c=w.useRef(document.createElement("div"));typeof f=="function"?f(c.current):f&&(f.current=c.current);const{editor:h}=fo(),p=e||h,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:l},x=w.useRef(m);x.current=m;const[b,g]=w.useState(!1),y=w.useRef(!0);return w.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const k=c.current;k.style.visibility="hidden",k.style.position="absolute";const v=ol({...x.current,editor:p,element:k});p.registerPlugin(v);const C=x.current.pluginKey;return y.current=!0,g(!0),()=>{g(!1),p.unregisterPlugin(C),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[p]),w.useEffect(()=>{if(!(!b||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:x.current}))}},[b,p,n,r,i,l,s,o]),Ft.createPortal(d.jsx("div",{...u,children:a}),c.current)});Se.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,options:o,children:l,...a},u)=>{const f=w.useRef(document.createElement("div"));typeof u=="function"?u(f.current):u&&(u.current=f.current);const{editor:c}=fo(),h=e||c,p={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,options:o},m=w.useRef(p);m.current=p;const[x,b]=w.useState(!1),g=w.useRef(!0);return w.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=f.current;y.style.visibility="hidden",y.style.position="absolute";const k=ll({...m.current,editor:h,element:y});h.registerPlugin(k);const v=m.current.pluginKey;return g.current=!0,b(!0),()=>{b(!1),h.unregisterPlugin(v),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[h]),w.useEffect(()=>{if(!(!x||!h||h.isDestroyed)){if(g.current){g.current=!1;return}h.view.dispatch(h.state.tr.setMeta(t,{type:"updateOptions",options:m.current}))}},[x,h,n,r,i,o,s]),Ft.createPortal(d.jsx("div",{...a,children:l}),f.current)});const Kd=new Set(["http:","https:","mailto:","tel:","ftp:"]);function al(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return Kd.has(e.protocol)}catch{return!1}}function cl(t){const e=t.trim();return e?e.startsWith("/")||e.startsWith(".")||e.startsWith("#")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)?e:`https://${e}`:""}const Vd="noopener noreferrer nofollow";function ot(t){const e=P.c(8),{active:n,label:r,onClick:s,children:i}=t,o=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==o?(l=ne("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",o),e[0]=o,e[1]=l):l=e[1];let a;return e[2]!==n||e[3]!==i||e[4]!==r||e[5]!==s||e[6]!==l?(a=d.jsx("button",{type:"button","aria-label":r,"aria-pressed":n,onMouseDown:Wd,onClick:s,className:l,children:i}),e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=l,e[7]=a):a=e[7],a}function Wd(t){return t.preventDefault()}function vi(t){const e=P.c(7),{active:n,label:r,onSelect:s}=t,i=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let o;e[0]!==i?(o=ne("flex-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer",i),e[0]=i,e[1]=o):o=e[1];let l;return e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==o?(l=d.jsx("button",{type:"button","aria-pressed":n,onMouseDown:Gd,onClick:s,className:o,children:r}),e[2]=n,e[3]=r,e[4]=s,e[5]=o,e[6]=l):l=e[6],l}function Gd(t){return t.preventDefault()}function Fg(t){const e=P.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=de(),[l,a]=w.useState(""),[u,f]=w.useState(!0),[c,h]=w.useState(!1);let p;e[0]!==r||e[1]!==n||e[2]!==i?(p=()=>{const D=n.getAttributes("link");a(typeof D.href=="string"?D.href:""),f(r?D.target==="_blank":!0),h(!1),i(!0)},e[0]=r,e[1]=n,e[2]=i,e[3]=p):p=e[3];const m=p;let x;e[4]!==n||e[5]!==i?(x=()=>{i(!1),n.chain().focus().run()},e[4]=n,e[5]=i,e[6]=x):x=e[6];const b=x;let g;e[7]!==l||e[8]!==n||e[9]!==u||e[10]!==i?(g=()=>{const D=cl(l);if(D===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!al(D)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:D,target:u?"_blank":null,rel:u?Vd:null}).run(),i(!1)},e[7]=l,e[8]=n,e[9]=u,e[10]=i,e[11]=g):g=e[11];const y=g;let k;e[12]!==n||e[13]!==i?(k=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[12]=n,e[13]=i,e[14]=k):k=e[14];const v=k;let C;e[15]!==o?(C=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=C):C=e[16];const T=s?b:m;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=d.jsx(yo,{size:14}),e[17]=S):S=e[17];let j;e[18]!==r||e[19]!==C||e[20]!==T?(j=d.jsx(ot,{active:r,label:C,onClick:T,children:S}),e[18]=r,e[19]=C,e[20]=T,e[21]=j):j=e[21];let N;e[22]!==r||e[23]!==y||e[24]!==b||e[25]!==l||e[26]!==c||e[27]!==u||e[28]!==i||e[29]!==s||e[30]!==v||e[31]!==o?(N=s&&d.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 flex-col gap-1 rounded-md border bg-popover p-1 shadow-md",onBlur:D=>{D.currentTarget.contains(D.relatedTarget)||i(!1)},children:[d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx("input",{autoFocus:!0,type:"text","aria-label":o("sectionsEditor.richTextLinkControl.urlInputAriaLabel"),"aria-invalid":c,placeholder:o("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:l,onChange:D=>{a(D.target.value),h(!1)},onKeyDown:D=>{D.key==="Enter"?(D.preventDefault(),y()):D.key==="Escape"&&(D.preventDefault(),b())},className:ne("h-7 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",c&&"text-destructive")}),d.jsx(ot,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:y,children:d.jsx(_s,{size:14})}),r&&d.jsx(ot,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:v,children:d.jsx(wo,{size:14})})]}),d.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[d.jsx(vi,{active:!u,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>f(!1)}),d.jsx(vi,{active:u,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>f(!0)})]})]}),e[22]=r,e[23]=y,e[24]=b,e[25]=l,e[26]=c,e[27]=u,e[28]=i,e[29]=s,e[30]=v,e[31]=o,e[32]=N):N=e[32];let R;return e[33]!==j||e[34]!==N?(R=d.jsxs("div",{className:"relative",children:[j,N]}),e[33]=j,e[34]=N,e[35]=R):R=e[35],R}function Qd(t){const e=P.c(30),{editor:n}=t,r=de(),[s,i]=w.useState(!1),[o,l]=w.useState(""),[a,u]=w.useState(!1);let f;e[0]!==n?(f=n.isActive("link"),e[0]=n,e[1]=f):f=e[1];const c=f;let h;e[2]!==n||e[3]!==s?(h=()=>{if(s){i(!1);return}const S=n.getAttributes("link").href;l(typeof S=="string"?S:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=h):h=e[4];const p=h;let m;e[5]!==n?(m=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=m):m=e[6];const x=m;let b;e[7]!==o||e[8]!==n||e[9]!==x?(b=()=>{const S=cl(o);if(S===""){x();return}if(!al(S)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:S}).run(),i(!1)},e[7]=o,e[8]=n,e[9]=x,e[10]=b):b=e[10];const g=b;let y;e[11]!==r?(y=r("markdownEditor.link"),e[11]=r,e[12]=y):y=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=d.jsx(yo,{size:14}),e[13]=k):k=e[13];let v;e[14]!==c||e[15]!==y||e[16]!==p?(v=d.jsx(ot,{active:c,label:y,onClick:p,children:k}),e[14]=c,e[15]=y,e[16]=p,e[17]=v):v=e[17];let C;e[18]!==c||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==a||e[23]!==s||e[24]!==x||e[25]!==r?(C=s&&d.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:S=>{S.currentTarget.contains(S.relatedTarget)||i(!1)},children:[d.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":a,placeholder:r("markdownEditor.linkPlaceholder"),value:o,onChange:S=>{l(S.target.value),u(!1)},onKeyDown:S=>{S.key==="Enter"?(S.preventDefault(),g()):S.key==="Escape"&&(S.preventDefault(),i(!1),n.chain().focus().run())},className:ne("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",a&&"text-destructive")}),d.jsx(ot,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:d.jsx(_s,{size:14})}),c&&d.jsx(ot,{active:!1,label:r("markdownEditor.linkRemove"),onClick:x,children:d.jsx(wo,{size:14})})]}),e[18]=c,e[19]=g,e[20]=o,e[21]=n,e[22]=a,e[23]=s,e[24]=x,e[25]=r,e[26]=C):C=e[26];let T;return e[27]!==v||e[28]!==C?(T=d.jsxs("div",{className:"relative",children:[v,C]}),e[27]=v,e[28]=C,e[29]=T):T=e[29],T}const Ys=()=>{const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},Si=t=>{const e=P.c(2),{children:n}=t;let r;return e[0]!==n?(r=d.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},ul=[1,2,3],Xd=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Yd(t){const e=P.c(20),{editor:n}=t,r=de(),[s,i]=w.useState(null);let o;e[0]!==n?(o={editor:n,selector:Zd},e[0]=n,e[1]=o):o=e[1];const l=Ea(o);let a;e[2]!==r?(a=r("markdownEditor.heading1"),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let f;e[6]!==r?(f=r("markdownEditor.heading3"),e[6]=r,e[7]=f):f=e[7];let c;e[8]!==a||e[9]!==u||e[10]!==f?(c={1:a,2:u,3:f},e[8]=a,e[9]=u,e[10]=f,e[11]=c):c=e[11];const h=c;let p;e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==l||e[16]!==r?(p=s&&d.jsxs(qd,{editor:n,shouldShow:Xd,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[d.jsx(ot,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:d.jsx(Ll,{size:14})}),d.jsx(ot,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:d.jsx(Pl,{size:14})}),d.jsx(ot,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:d.jsx(Fl,{size:14})}),d.jsx(ot,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:d.jsx(Ul,{size:14})}),d.jsx(Ys,{}),ul.map((x,b)=>d.jsx(ot,{active:l.headings[b]??!1,label:h[x],onClick:()=>n.chain().focus().toggleHeading({level:x}).run(),children:d.jsx(Si,{children:`H${x}`})},x)),d.jsx(Ys,{}),d.jsx(ot,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:d.jsx(no,{size:14})}),d.jsx(ot,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:d.jsx(Si,{children:"1."})}),d.jsx(ot,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:d.jsx(Hl,{size:14})}),d.jsx(Ys,{}),d.jsx(Qd,{editor:n})]}),e[12]=n,e[13]=h,e[14]=s,e[15]=l,e[16]=r,e[17]=p):p=e[17];let m;return e[18]!==p?(m=d.jsx("div",{ref:i,className:"relative z-20",children:p}),e[18]=p,e[19]=m):m=e[19],m}function Zd(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:ul.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function Hr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Gt=Hr();function dl(t){Gt=t}var Vt={exec:()=>null};function le(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(st.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,e)};return r}var Jd=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),st={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)}}>`)},ef=/^(?:[ \t]*(?:\n|$))+/,tf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,nf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,is=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,sf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,fl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hl=le(fl).replace(/bull/g,qr).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(),rf=le(fl).replace(/bull/g,qr).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(),Kr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,of=/^[^\n]+/,Vr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lf=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),af=le(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qr).getRegex(),Ps="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",Wr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cf=le("^ {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",Wr).replace("tag",Ps).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pl=le(Kr).replace("hr",is).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",Ps).getRegex(),uf=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",pl).getRegex(),Gr={blockquote:uf,code:tf,def:lf,fences:nf,heading:sf,hr:is,html:cf,lheading:hl,list:af,newline:ef,paragraph:pl,table:Vt,text:of},Ci=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",is).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",Ps).getRegex(),df={...Gr,lheading:rf,table:Ci,paragraph:le(Kr).replace("hr",is).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ci).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",Ps).getRegex()},ff={...Gr,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wr).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:Vt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Kr).replace("hr",is).replace("heading",` *#{1,6} *[^
7
+ ]`).replace("lheading",hl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gl=/^( {2,}|\\)\n(?!\s*$)/,gf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,In=/[\p{P}\p{S}]/u,Fs=/[\s\p{P}\p{S}]/u,Qr=/[^\s\p{P}\p{S}]/u,mf=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Fs).getRegex(),ml=/(?!~)[\p{P}\p{S}]/u,xf=/(?!~)[\s\p{P}\p{S}]/u,bf=/(?:[^\s\p{P}\p{S}]|~)/u,yf=le(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Jd?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kf=le(xl,"u").replace(/punct/g,In).getRegex(),wf=le(xl,"u").replace(/punct/g,ml).getRegex(),bl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vf=le(bl,"gu").replace(/notPunctSpace/g,Qr).replace(/punctSpace/g,Fs).replace(/punct/g,In).getRegex(),Sf=le(bl,"gu").replace(/notPunctSpace/g,bf).replace(/punctSpace/g,xf).replace(/punct/g,ml).getRegex(),Cf=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qr).replace(/punctSpace/g,Fs).replace(/punct/g,In).getRegex(),Tf=le(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,In).getRegex(),jf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Df=le(jf,"gu").replace(/notPunctSpace/g,Qr).replace(/punctSpace/g,Fs).replace(/punct/g,In).getRegex(),Nf=le(/\\(punct)/,"gu").replace(/punct/g,In).getRegex(),Rf=le(/^<(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(),Ef=le(Wr).replace("(?:-->|$)","-->").getRegex(),If=le("^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",Ef).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ns=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Af=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ns).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yl=le(/^!?\[(label)\]\[(ref)\]/).replace("label",Ns).replace("ref",Vr).getRegex(),kl=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vr).getRegex(),_f=le("reflink|nolink(?!\\()","g").replace("reflink",yl).replace("nolink",kl).getRegex(),Ti=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xr={_backpedal:Vt,anyPunctuation:Nf,autolink:Rf,blockSkip:yf,br:gl,code:pf,del:Vt,delLDelim:Vt,delRDelim:Vt,emStrongLDelim:kf,emStrongRDelimAst:vf,emStrongRDelimUnd:Cf,escape:hf,link:Af,nolink:kl,punctuation:mf,reflink:yl,reflinkSearch:_f,tag:If,text:gf,url:Vt},Of={...Xr,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",Ns).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ns).getRegex()},ur={...Xr,emStrongRDelimAst:Sf,emStrongLDelim:wf,delLDelim:Tf,delRDelim:Df,url:le(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ti).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:le(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ti).getRegex()},Bf={...ur,br:le(gl).replace("{2,}","*").getRegex(),text:le(ur.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ms={normal:Gr,gfm:df,pedantic:ff},Mn={normal:Xr,gfm:ur,breaks:Bf,pedantic:Of},$f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ji=t=>$f[t];function It(t,e){if(e){if(st.escapeTest.test(t))return t.replace(st.escapeReplace,ji)}else if(st.escapeTestNoEncode.test(t))return t.replace(st.escapeReplaceNoEncode,ji);return t}function Di(t){try{t=encodeURI(t).replace(st.percentDecode,"%")}catch{return null}return t}function Ni(t,e){let n=t.replace(st.findPipe,(i,o,l)=>{let a=!1,u=o;for(;--u>=0&&l[u]==="\\";)a=!a;return a?"|":" |"}),r=n.split(st.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(st.slashPipe,"|");return r}function zn(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function Mf(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function zf(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Ri(t,e,n,r,s){let i=e.href,o=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function Lf(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
8
+ `).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[l]=o;return l.length>=s.length?i.slice(s.length):i}).join(`
9
+ `)}var Rs=class{options;rules;lexer;constructor(t){this.options=t||Gt}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:zn(n,`
10
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Lf(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=zn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:zn(e[0],`
11
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=zn(e[0],`
12
+ `).split(`
13
+ `),r="",s="",i=[];for(;n.length>0;){let o=!1,l=[],a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),o=!0;else if(!o)l.push(n[a]);else break;n=n.slice(a);let u=l.join(`
14
+ `),f=u.replace(this.rules.other.blockquoteSetextReplace,`
15
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
16
+ ${u}`:u,s=s?`${s}
17
+ ${f}`:f;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,i,!0),this.lexer.state.top=c,n.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let p=h,m=p.raw+`
18
+ `+n.join(`
19
+ `),x=this.blockquote(m);i[i.length-1]=x,r=r.substring(0,r.length-p.raw.length)+x.raw,s=s.substring(0,s.length-p.text.length)+x.text;break}else if(h?.type==="list"){let p=h,m=p.raw+`
20
+ `+n.join(`
21
+ `),x=this.list(m);i[i.length-1]=x,r=r.substring(0,r.length-h.raw.length)+x.raw,s=s.substring(0,s.length-p.raw.length)+x.raw,n=m.substring(i.at(-1).raw.length).split(`
22
+ `);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),o=!1;for(;t;){let a=!1,u="",f="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let c=zf(e[2].split(`
23
+ `,1)[0],e[1].length),h=t.split(`
24
+ `,1)[0],p=!c.trim(),m=0;if(this.options.pedantic?(m=2,f=c.trimStart()):p?m=e[1].length+1:(m=c.search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=c.slice(m),m+=e[1].length),p&&this.rules.other.blankLine.test(h)&&(u+=h+`
25
+ `,t=t.substring(h.length+1),a=!0),!a){let x=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),g=this.rules.other.fencesBeginRegex(m),y=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),v=this.rules.other.blockquoteBeginRegex(m);for(;t;){let C=t.split(`
26
+ `,1)[0],T;if(h=C,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),T=h):T=h.replace(this.rules.other.tabCharGlobal," "),g.test(h)||y.test(h)||k.test(h)||v.test(h)||x.test(h)||b.test(h))break;if(T.search(this.rules.other.nonSpaceChar)>=m||!h.trim())f+=`
27
+ `+T.slice(m);else{if(p||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(c)||y.test(c)||b.test(c))break;f+=`
28
+ `+h}p=!h.trim(),u+=C+`
29
+ `,t=t.substring(C.length+1),c=T.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0)),s.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),s.raw+=u}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let a of s.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(a.raw);if(u){let f={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};a.checked=f.checked,s.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=f.raw+a.tokens[0].raw,a.tokens[0].text=f.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(f)):a.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):a.tokens.unshift(f)}}if(!s.loose){let u=a.tokens.filter(c=>c.type==="space"),f=u.length>0&&u.some(c=>this.rules.other.anyLine.test(c.raw));s.loose=f}}if(s.loose)for(let a of s.items){a.loose=!0;for(let u of a.tokens)u.type==="text"&&(u.type="paragraph")}return s}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:s}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Ni(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of s)i.rows.push(Ni(o,i.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[a]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
31
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=zn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Mf(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Ri(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Ri(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+s);(r=u.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let f=[...r[0]][0].length,c=t.slice(0,s+r.index+f+o);if(Math.min(s,o)%2){let p=c.slice(1,-1);return{type:"em",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}let h=c.slice(2,-2);return{type:"strong",raw:c,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*t.length+s);(r=a.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let u=[...r[0]][0].length,f=t.slice(0,s+r.index+u+o),c=f.slice(s,-s);return{type:"del",raw:f,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},St=class dr{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Gt,this.options.tokenizer=this.options.tokenizer||new Rs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:st,block:ms.normal,inline:Mn.normal};this.options.pedantic?(n.block=ms.pedantic,n.inline=Mn.pedantic):this.options.gfm&&(n.block=ms.gfm,this.options.breaks?n.inline=Mn.breaks:n.inline=Mn.gfm),this.tokenizer.rules=n}static get rules(){return{block:ms,inline:Mn}}static lex(e,n){return new dr(n).lex(e)}static lexInline(e,n){return new dr(n).inlineTokens(e)}lex(e){e=e.replace(st.carriageReturn,`
32
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(st.tabCharGlobal," ").replace(st.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=n.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
33
+ `:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
34
+ `)?"":`
35
+ `)+s.raw,o.text+=`
36
+ `+s.text,this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
37
+ `)?"":`
38
+ `)+s.raw,o.text+=`
39
+ `+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),a;this.options.extensions.startBlock.forEach(u=>{a=u.call({lexer:this},l),typeof a=="number"&&a>=0&&(o=Math.min(o,a))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
40
+ `)?"":`
41
+ `)+s.raw,o.text+=`
42
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
43
+ `)?"":`
44
+ `)+s.raw,o.text+=`
45
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,l="";for(;e;){o||(l=""),o=!1;let a;if(this.options.extensions?.inline?.some(f=>(a=f.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let f=n.at(-1);a.type==="text"&&f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let u=e;if(this.options.extensions?.startInline){let f=1/0,c=e.slice(1),h;this.options.extensions.startInline.forEach(p=>{h=p.call({lexer:this},c),typeof h=="number"&&h>=0&&(f=Math.min(f,h))}),f<1/0&&f>=0&&(u=e.substring(0,f+1))}if(a=this.tokenizer.inlineText(u)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),o=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):n.push(a);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},Es=class{options;parser;constructor(t){this.options=t||Gt}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(st.notSpaceStart)?.[0],s=t.replace(st.endingNewline,"")+`
46
+ `;return r?'<pre><code class="language-'+It(r)+'">'+(n?s:It(s,!0))+`</code></pre>
47
+ `:"<pre><code>"+(n?s:It(s,!0))+`</code></pre>
48
+ `}blockquote({tokens:t}){return`<blockquote>
49
+ ${this.parser.parse(t)}</blockquote>
50
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
51
+ `}hr(t){return`<hr>
52
+ `}list(t){let e=t.ordered,n=t.start,r="";for(let o=0;o<t.items.length;o++){let l=t.items[o];r+=this.listitem(l)}let s=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
53
+ `+r+"</"+s+`>
54
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
55
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
56
+ `}table(t){let e="",n="";for(let s=0;s<t.header.length;s++)n+=this.tablecell(t.header[s]);e+=this.tablerow({text:n});let r="";for(let s=0;s<t.rows.length;s++){let i=t.rows[s];n="";for(let o=0;o<i.length;o++)n+=this.tablecell(i[o]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
57
+ <thead>
58
+ `+e+`</thead>
59
+ `+r+`</table>
60
+ `}tablerow({text:t}){return`<tr>
61
+ ${t}</tr>
62
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
63
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${It(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),s=Di(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+It(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=Di(t);if(s===null)return It(n);t=s;let i=`<img src="${t}" alt="${It(n)}"`;return e&&(i+=` title="${It(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:It(t.text)}},Yr=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Ct=class fr{options;renderer;textRenderer;constructor(e){this.options=e||Gt,this.options.renderer=this.options.renderer||new Es,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yr}static parse(e,n){return new fr(n).parse(e)}static parseInline(e,n){return new fr(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let o=s,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}let o=i;switch(o.type){case"escape":{r+=n.text(o);break}case"html":{r+=n.html(o);break}case"link":{r+=n.link(o);break}case"image":{r+=n.image(o);break}case"checkbox":{r+=n.checkbox(o);break}case"strong":{r+=n.strong(o);break}case"em":{r+=n.em(o);break}case"codespan":{r+=n.codespan(o);break}case"br":{r+=n.br(o);break}case"del":{r+=n.del(o);break}case"text":{r+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},Fn=class{options;block;constructor(t){this.options=t||Gt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?St.lex:St.lexInline}provideParser(t=this.block){return t?Ct.parse:Ct.parseInline}},Pf=class{defaults=Hr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ct;Renderer=Es;TextRenderer=Yr;Lexer=St;Tokenizer=Rs;Hooks=Fn;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of s.rows)for(let o of i)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let o=s[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){let s=this.defaults.renderer||new Es(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=n.renderer[o],a=s[o];s[o]=(...u)=>{let f=l.apply(s,u);return f===!1&&(f=a.apply(s,u)),f||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new Rs(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=n.tokenizer[o],a=s[o];s[o]=(...u)=>{let f=l.apply(s,u);return f===!1&&(f=a.apply(s,u)),f}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Fn;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=n.hooks[o],a=s[o];Fn.passThroughHooks.has(i)?s[o]=u=>{if(this.defaults.async&&Fn.passThroughHooksRespectAsync.has(i))return(async()=>{let c=await l.call(s,u);return a.call(s,c)})();let f=l.call(s,u);return a.call(s,f)}:s[o]=(...u)=>{if(this.defaults.async)return(async()=>{let c=await l.apply(s,u);return c===!1&&(c=await a.apply(s,u)),c})();let f=l.apply(s,u);return f===!1&&(f=a.apply(s,u)),f}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return St.lex(t,e??this.defaults)}parser(t,e){return Ct.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(t):t?St.lex:St.lexInline)(o,s),a=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(a,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser(t):t?Ct.parse:Ct.parseInline)(a,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer(t):t?St.lex:St.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(t):t?Ct.parse:Ct.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=`
64
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+It(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Wt=new Pf;function ue(t,e){return Wt.parse(t,e)}ue.options=ue.setOptions=function(t){return Wt.setOptions(t),ue.defaults=Wt.defaults,dl(ue.defaults),ue};ue.getDefaults=Hr;ue.defaults=Gt;ue.use=function(...t){return Wt.use(...t),ue.defaults=Wt.defaults,dl(ue.defaults),ue};ue.walkTokens=function(t,e){return Wt.walkTokens(t,e)};ue.parseInline=Wt.parseInline;ue.Parser=Ct;ue.parser=Ct.parse;ue.Renderer=Es;ue.TextRenderer=Yr;ue.Lexer=St;ue.lexer=St.lex;ue.Tokenizer=Rs;ue.Hooks=Fn;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Ct.parse;St.lex;function Ff(t,e){const r=e.split(`
65
+ `).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
66
+ `);return r.slice(0,r.length-1)}function Uf(t,e){const n=[];return Array.from(t.keys()).forEach(r=>{(!e||!e.marks||!e.marks.map(s=>s.type).includes(r))&&n.push(r)}),n}function Hf(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{t.has(r)||n.push({type:r,mark:s})}),n}function qf(t,e,n,r){const s=!n,i=n&&n.type==="text"&&(!n.marks||n.marks.length===0),o=n&&n.type==="text"&&n.marks&&!r(e,new Map(n.marks.map(a=>[a.type,a]))),l=[];if(s||i||o)if(n&&n.type==="text"&&n.marks){const a=new Map(n.marks.map(u=>[u.type,u]));Array.from(t.keys()).forEach(u=>{a.has(u)||l.push(u)})}else(s||i)&&l.push(...Array.from(t.keys()));return l}function Kf(t,e){let n="";return Array.from(t.keys()).reverse().forEach(r=>{const s=t.get(r),i=e(r,s);i&&(n=i+n)}),t.clear(),n}function Vf(t,e,n){let r="";return Array.from(t.entries()).forEach(([s,i])=>{const o=n(s,i);o&&(r+=o),e.set(s,i)}),r}function Zs(t){const n=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return n?{isTask:!0,checked:n[2].toLowerCase()==="x",indentLevel:n[1].length}:{isTask:!1,indentLevel:0}}function xs(t,e){return typeof t!="string"?"json":e}var Wf=class{constructor(t){this.baseExtensions=[],this.extensions=[],this.lastParseResult=null;var e,n,r,s,i;this.markedInstance=(e=t?.marked)!=null?e:ue,this.lexer=new this.markedInstance.Lexer,this.indentStyle=(r=(n=t?.indentation)==null?void 0:n.style)!=null?r:"space",this.indentSize=(i=(s=t?.indentation)==null?void 0:s.size)!=null?i:2,this.baseExtensions=t?.extensions||[],t?.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t?.extensions&&(this.baseExtensions=t.extensions,Ia(t.extensions).forEach(l=>this.registerExtension(l,!1))),this.lexer=new this.markedInstance.Lexer}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t,e=!0){var n,r;this.extensions.push(t);const s=t.name,i=$n(t,"markdownTokenName")||s,o=$n(t,"parseMarkdown"),l=$n(t,"renderMarkdown"),a=$n(t,"markdownTokenizer"),u=(n=$n(t,"markdownOptions"))!=null?n:null,f=(r=u?.indentsContent)!=null?r:!1,c={tokenName:i,nodeName:s,parseMarkdown:o,renderMarkdown:l,isIndenting:f,tokenizer:a};if(i&&o){const h=this.registry.get(i)||[];h.push(c),this.registry.set(i,h)}if(l){const h=this.nodeTypeRegistry.get(s)||[];h.push(c),this.nodeTypeRegistry.set(s,h)}a&&this.hasMarked()&&(this.registerTokenizer(a),e&&(this.lexer=new this.markedInstance.Lexer))}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:r="inline",tokenize:s}=t,l={inlineTokens:f=>this.lexer.inlineTokens(f),blockTokens:f=>this.lexer.blockTokens(f)};let a;n?a=typeof n=="function"?n:f=>f.indexOf(n):a=f=>{const c=s(f,[],l);return c&&c.raw?f.indexOf(c.raw):-1};const u={name:e,level:r,start:a,tokenizer:(f,c)=>{const h=s(f,c,l);if(h&&h.type)return{...h,type:h.type||e,raw:h.raw||"",tokens:h.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[u]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/&nbsp;/g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.markedInstance.lexer(t);return{type:"doc",content:this.parseTokens(e,!0)}}parseTokens(t,e=!1){const n=t.reduce((i,o,l)=>(o.type!=="space"&&i.push(l),i),[]);let r=-1,s=0;return t.flatMap((i,o)=>{for(var l;s<n.length&&n[s]<o;)r=n[s],s+=1;if(e&&i.type==="space"){const u=(l=n[s])!=null?l:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,u)}const a=this.parseToken(i,e);return a===null?[]:Array.isArray(a)?a:[a]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const r=this.countParagraphSeparators(t.raw||"");if(r===0)return[];const i=Math.max(r-(e===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
67
+ `).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(n.find(i=>{if(!i.parseMarkdown)return!1;const o=i.parseMarkdown(t,r),l=this.normalizeParseResult(o);return l&&(!Array.isArray(l)||l.length>0)?(this.lastParseResult=l,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>Zs(l).isTask),n=t.items.some(l=>!Zs(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let l=0;l<t.items.length;l+=1){const a=t.items[l],{isTask:u,checked:f,indentLevel:c}=Zs(a);let h=a;if(u){const x=(a.raw||a.text||"").split(`
68
+ `),b=x[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),g=b?b[2]:"";let y=[];if(x.length>1&&x.slice(1).join(`
69
+ `).trim()){const v=x.slice(1),C=v.filter(T=>T.trim());if(C.length>0){const T=Math.min(...C.map(N=>N.length-N.trimStart().length)),j=v.map(N=>N.trim()?N.slice(T):"").join(`
70
+ `).trim();j&&(y=this.markedInstance.lexer(`${j}
71
+ `))}}h={type:"taskItem",raw:"",mainContent:g,indentLevel:c,checked:f??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:y}}const p=u?"taskList":"list";i!==p?(s.length>0&&r.push({type:i,items:s}),s=[h],i=p):s.push(h)}s.length>0&&r.push({type:i,items:s});const o=[];for(let l=0;l<r.length;l+=1){const a=r[l],u={...t,type:a.type,items:a.items},f=this.parseToken(u);f&&(Array.isArray(f)?o.push(...f):o.push(f))}return o.length>0?o:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(t,n),o=this.normalizeParseResult(i);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){var e,n,r,s;const i=[];for(let o=0;o<t.length;o+=1){const l=t[o];if(l.type==="text")i.push({type:"text",text:l.text||""});else if(l.type==="html"){const a=((n=(e=l.raw)!=null?e:l.text)!=null?n:"").toString(),u=/^<\/[\s]*[\w-]+/i.test(a),f=a.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!u&&f&&!/\/>$/.test(a)){const h=f[1],p=this.escapeRegex(h),m=new RegExp(`^<\\/\\s*${p}\\b`,"i");let x=-1;const b=[a];for(let g=o+1;g<t.length;g+=1){const y=t[g],k=((s=(r=y.raw)!=null?r:y.text)!=null?s:"").toString();if(b.push(k),y.type==="html"&&m.test(k)){x=g;break}}if(x!==-1){const g=b.join(""),y={type:"html",raw:g,text:g,block:!1},k=this.parseHTMLToken(y);if(k){const v=this.normalizeParseResult(k);Array.isArray(v)?i.push(...v):v&&i.push(v)}o=x;continue}}const c=this.parseHTMLToken(l);if(c){const h=this.normalizeParseResult(c);Array.isArray(h)?i.push(...h):h&&i.push(h)}}else if(l.type){const a=this.getHandlerForToken(l.type);if(a&&a.parseMarkdown){const u=this.createParseHelpers(),f=a.parseMarkdown(l,u);if(this.isMarkResult(f)){const c=this.applyMarkToContent(f.mark,f.content,f.attrs);i.push(...c)}else{const c=this.normalizeParseResult(f);Array.isArray(c)?i.push(...c):c&&i.push(c)}}else l.tokens&&i.push(...this.parseInlineTokens(l.tokens))}}return i}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:t.text||""};case"html":return this.parseHTMLToken(t);case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(typeof window>"u")return t.block?{type:"paragraph",content:[{type:"text",text:e}]}:{type:"text",text:e};try{const n=Aa(e,this.baseExtensions);return n.type==="doc"&&n.content?t.block?n.content:n.content.length===1&&n.content[0].type==="paragraph"&&n.content[0].content?n.content[0].content:n.content:n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return t.text||"";if(!t.type)return"";const o=this.getHandlerForToken(t.type);if(!o)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,a={renderChildren:(c,h)=>{const p=o.isIndenting?r+1:r;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,h||"",n,p):this.renderNodes(c,t,h||"",n,p)},renderChild:(c,h)=>{const p=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(c,t,h,p)},indent:c=>this.indentString+c,wrapInBlock:Ff},u={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=o.renderMarkdown)==null?void 0:i.call(o,t,a,u))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map;return t.forEach((o,l)=>{const a=l<t.length-1?t[l+1]:null;if(o.type)if(o.type==="text"){let u=o.text||"";const f=new Map((o.marks||[]).map(g=>[g.type,g])),c=Hf(i,f),h=Uf(f,a);let p="";if(h.length>0){const g=u.match(/(\s+)$/);g&&(p=g[1],u=u.slice(0,-p.length))}h.forEach(g=>{const y=f.get(g),k=this.getMarkClosing(g,y);k&&(u+=k),i.has(g)&&i.delete(g)});let m="";if(c.length>0){const g=u.match(/^(\s+)/);g&&(m=g[1],u=u.slice(m.length))}c.forEach(({type:g,mark:y})=>{const k=this.getMarkOpening(g,y);k&&(u=k+u),h.includes(g)||i.set(g,y)}),u=m+u;const x=qf(i,f,a,this.markSetsEqual.bind(this));let b="";if(x.length>0){const g=u.match(/(\s+)$/);g&&(b=g[1],u=u.slice(0,-b.length))}x.forEach(g=>{const y=i.get(g),k=this.getMarkClosing(g,y);k&&(u+=k),i.delete(g)}),u+=b,u+=p,s.push(u)}else{const u=new Map(i),f=Kf(i,this.getMarkClosing.bind(this)),c=this.renderNodeToMarkdown(o,e,l,r),h=o.type==="hardBreak"?"":Vf(u,i,this.getMarkOpening.bind(this));s.push(f+c+h)}}),s.join(n)}getMarkOpening(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:a=>a,wrapInBlock:(a,u)=>a+u},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s);return l>=0?o.substring(0,l):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:u=>u,wrapInBlock:(u,f)=>u+f},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s),a=l+s.length;return l>=0?o.substring(a):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.keys()).every(n=>e.has(n))}},Ei=Wf,Gf=Cr.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return $t.setContent(t,e);if(xs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return $t.setContent(t,e);const r=this.editor.markdown.parse(t);return $t.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return $t.insertContent(t,e);if(xs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return $t.insertContent(t,e);const r=this.editor.markdown.parse(t);return $t.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return $t.insertContentAt(t,e,n);if(xs(e,n?.contentType)!=="markdown"||!this.editor.markdown)return $t.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return $t.insertContentAt(t,s,n)}}},addStorage(){return{manager:new Ei({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new Ei({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||xs(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);this.editor.options.content=e}});function Qf(t){const e=P.c(25),{node:n,selected:r,editor:s,deleteNode:i}=t,o=de(),l=typeof n.attrs.href=="string"?n.attrs.href:"",a=typeof n.attrs.name=="string"?n.attrs.name:"";let u;e[0]!==a||e[1]!==o?(u=a||o("markdownEditor.fileNameFallback"),e[0]=a,e[1]=o,e[2]=u):u=e[2];const f=u,c=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==c?(h=ne("mx-0.5 inline-flex max-w-full select-none items-center gap-1.5 rounded-lg border border-border bg-card px-2 py-1 align-middle text-sm text-foreground",c),e[3]=c,e[4]=h):h=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx(ql,{size:14,className:"shrink-0 text-muted-foreground"}),e[5]=p):p=e[5];let m;e[6]!==f?(m=d.jsx("span",{className:"min-w-0 truncate",children:f}),e[6]=f,e[7]=m):m=e[7];let x;e[8]!==f||e[9]!==o?(x=o("markdownEditor.downloadFile",{name:f}),e[8]=f,e[9]=o,e[10]=x):x=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=d.jsx(Ha,{size:14}),e[11]=b):b=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==x?(g=d.jsx("a",{href:l,download:f,"aria-label":x,onMouseDown:Yf,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:b}),e[12]=l,e[13]=f,e[14]=x,e[15]=g):g=e[15];let y;e[16]!==i||e[17]!==s.isEditable||e[18]!==o?(y=s.isEditable&&d.jsx("button",{type:"button","aria-label":o("markdownEditor.removeFile"),onMouseDown:Xf,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:d.jsx(vn,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=y):y=e[19];let k;return e[20]!==h||e[21]!==m||e[22]!==g||e[23]!==y?(k=d.jsxs(mo,{as:"span",className:h,children:[p,m,g,y]}),e[20]=h,e[21]=m,e[22]=g,e[23]=y,e[24]=k):k=e[24],k}function Xf(t){return t.preventDefault()}function Yf(t){return t.preventDefault()}function Zf(t){return t.replace(/([[\]])/g,"\\$1")}const Jf=ho.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]"}]},renderHTML({HTMLAttributes:t,node:e}){return["a",go(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${Zf(n)}](${e})`},addNodeView(){return po(Qf)}});var eh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,th=ho.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:t}){return["img",go(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",u=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return u?`![${a}](${l} "${u}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([c,h])=>{if(h!=null)switch(c){case"width":case"height":break;default:a.setAttribute(c,h);break}}),a.src=o.src;const u=new Oa({element:a,editor:l,node:s,getPos:i,onResize:(c,h)=>{a.style.width=`${c}px`,a.style.height=`${h}px`},onCommit:(c,h)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:c,height:h}).run()},onUpdate:(c,h,p)=>c.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),f=u.dom;return f.style.visibility="hidden",f.style.pointerEvents="none",a.onload=()=>{f.style.visibility="",f.style.pointerEvents=""},u}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[_a({find:eh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),nh=th;function sh(t){const e=P.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,o=de(),l=typeof n.attrs.src=="string"?n.attrs.src:"",a=typeof n.attrs.alt=="string"?n.attrs.alt:"";let u;e[0]!==a||e[1]!==o?(u=a||o("markdownEditor.imageAltFallback"),e[0]=a,e[1]=o,e[2]=u):u=e[2];const f=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let c;e[3]!==f?(c=ne("max-h-[420px] max-w-full rounded-lg border border-border object-contain",f),e[3]=f,e[4]=c):c=e[4];let h;e[5]!==l||e[6]!==u||e[7]!==c?(h=d.jsx("img",{src:l,alt:u,draggable:!1,className:c}),e[5]=l,e[6]=u,e[7]=c,e[8]=h):h=e[8];let p;e[9]!==i||e[10]!==s.isEditable||e[11]!==o?(p=s.isEditable&&d.jsx("button",{type:"button","aria-label":o("markdownEditor.removeImage"),onMouseDown:rh,onClick:i,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-md border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:d.jsx(vn,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=o,e[12]=p):p=e[12];let m;return e[13]!==h||e[14]!==p?(m=d.jsxs(mo,{className:"group/image relative my-3 w-fit max-w-full",children:[h,p]}),e[13]=h,e[14]=p,e[15]=m):m=e[15],m}function rh(t){return t.preventDefault()}const ih=nh.extend({addNodeView(){return po(sh)}}).configure({inline:!1,allowBase64:!1}),hr="uploads",oh="editor-images",wl="editor-files",lh=new RegExp(`^/api/[^/]+/fs/${hr}/read$`),Ii="http://relative.invalid";function ah(t){let e;try{e=new URL(t,Ii)}catch{return!1}return e.origin!==Ii||!lh.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${wl}/`)}const ch={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},uh=Ba.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return ah(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function dh(t=""){return[$a.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),uh.configure(ch),oc.configure({placeholder:t}),ih,Jf,Gf.configure({markedOptions:{breaks:!0}})]}const fh=10,hh=25,ph={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function gh(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??ph[t.type]??(Zr(t)?".png":"")}function Zr(t){return t.type.startsWith("image/")}function mh(){const t=de(),{upload:e}=Tc(hr),n=Cc(hr),[r,s]=w.useState(0);return{uploadFile:async o=>{const l=Zr(o),a=l?fh:hh;if(o.size>a*1024*1024)return Kt.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(a)})),null;const u=l?oh:wl,f=`${crypto.randomUUID()}${gh(o)}`;s(c=>c+1);try{return await e.mutateAsync({dir:u,files:[new File([o],f,{type:o.type})]}),n(`${u}/${f}`)}catch{return Kt.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(c=>c-1)}},pending:r}}const xh=["outline-none","min-h-[200px] sm:min-h-[320px]","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-2 [&_p]:leading-relaxed","[&_h1]:mb-2 [&_h1]:mt-5 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-snug","[&_h2]:mb-1.5 [&_h2]:mt-4 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-snug","[&_h3]:mb-1 [&_h3]:mt-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-snug","[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-[13px]","[&_pre_code]:bg-transparent [&_pre_code]:p-0","[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2","[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold"].join(" "),bh=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function Ai(t,e,n,r){const s=t.state.schema.nodes[n];if(!s)return e;const i=t.state.tr.replaceWith(e,e,s.create(r)),o=i.mapping.map(e,1);return i.setSelection(At.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function yh({defaultValue:t,onChange:e,placeholder:n}){const r=de(),{uploadFile:s,pending:i}=mh(),o=w.useRef(null),l=w.useRef(e),a=w.useRef(s);l.current=e,a.current=s;const u=(h,p,m)=>p.length===0?!1:((async()=>{let x=m;for(const b of p){const g=await a.current(b);g&&(x=Zr(b)?Ai(h,x,"image",{src:g,alt:b.name}):Ai(h,x,"attachment",{href:g,name:b.name}))}})(),!0),f=Ma({extensions:dh(n),content:t,contentType:"markdown",editorProps:{attributes:{class:ne(xh,bh)},handlePaste:(h,p)=>u(h,Array.from(p.clipboardData?.files??[]),h.state.selection.to),handleDrop:(h,p,m,x)=>{if(x)return!1;const b=Array.from(p.dataTransfer?.files??[]),g=h.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return g===void 0?!1:u(h,b,g)}},onUpdate:({editor:h})=>l.current(h.getMarkdown())});if(!f)return null;const c=h=>{!h||h.length===0||u(f.view,Array.from(h),f.state.selection.to)};return d.jsxs("div",{className:"flex flex-col",children:[d.jsx(Yd,{editor:f}),d.jsx(za,{editor:f,className:"text-[15px] text-foreground"}),d.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground",children:[d.jsx(at,{type:"button",variant:"ghost",size:"icon-sm","aria-label":r("markdownEditor.attachFile"),onClick:()=>o.current?.click(),children:d.jsx(Kl,{size:14})}),i>0&&d.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[d.jsx(xr,{size:12,className:"animate-spin"}),i===1?r("markdownEditor.uploading"):r("markdownEditor.uploadingCount",{count:String(i)})]})]}),d.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",onChange:h=>{c(h.target.files),h.target.value=""}})]})}function kh(t){const e=P.c(10),{locator:n}=Ae(),r=Jn();let s;e[0]!==t||e[1]!==n?(s=De.taskBoardItemPrs(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:t})).prs,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],lt(l)}function wh(t){const e=P.c(10),{locator:n}=Ae(),r=Jn();let s;e[0]!==t||e[1]!==n?(s=De.taskBoardActivity(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ACTIVITY_LIST",{taskBoardItemId:t})).activity,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],lt(l)}function Jr(t){const e=P.c(27),{members:n,onSelect:r}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=d.jsx(Tr,{placeholder:"Assign to…",className:"h-9"}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(jr,{children:"No members found."}),e[1]=i):i=e[1];let o;e[2]!==r?(o=()=>r(nt),e[2]=r,e[3]=o):o=e[3];let l,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=d.jsx(Ot,{size:16}),a=d.jsx("span",{className:"truncate",children:"Super Agent"}),e[4]=l,e[5]=a):(l=e[4],a=e[5]);let u;e[6]!==o?(u=d.jsxs(Lt,{value:"Super Agent",onSelect:o,className:"gap-2",children:[l,a]}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==r?(f=()=>r(null),e[8]=r,e[9]=f):f=e[9];let c,h;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(nr,{size:16,className:"text-muted-foreground"}),h=d.jsx("span",{className:"truncate",children:"Unassigned"}),e[10]=c,e[11]=h):(c=e[10],h=e[11]);let p;e[12]!==f?(p=d.jsxs(Lt,{value:"Unassigned",onSelect:f,className:"gap-2",children:[c,h]}),e[12]=f,e[13]=p):p=e[13];let m;e[14]!==p||e[15]!==u?(m=d.jsxs(Dn,{children:[u,p]}),e[14]=p,e[15]=u,e[16]=m):m=e[16];let x;if(e[17]!==n||e[18]!==r){let y;e[20]!==r?(y=k=>d.jsxs(Lt,{value:k.user?.name??k.userId,onSelect:()=>r(k.userId),className:"gap-2",children:[d.jsx(Dt,{url:k.user?.image??void 0,fallback:jt(k.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:k.user?.name??k.userId})]},k.userId),e[20]=r,e[21]=y):y=e[21],x=n.map(y),e[17]=n,e[18]=r,e[19]=x}else x=e[19];let b;e[22]!==x?(b=d.jsx(Dn,{heading:"Members",children:x}),e[22]=x,e[23]=b):b=e[23];let g;return e[24]!==m||e[25]!==b?(g=d.jsxs(Dr,{children:[s,d.jsxs(Nr,{children:[i,m,b]})]}),e[24]=m,e[25]=b,e[26]=g):g=e[26],g}function vh({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=de(),[l,a]=w.useState(""),[u,f]=w.useState(!1),[c,h]=w.useState(n),p=l.trim(),m=t.some(b=>b.name.toLowerCase()===p.toLowerCase()),x=async()=>{if(!(!p||m||u)){f(!0);try{await s(p,c),a("")}finally{f(!1)}}};return d.jsxs(Dr,{children:[d.jsx(Tr,{value:l,onValueChange:a,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),d.jsxs(Nr,{children:[p&&!m?d.jsx(Dn,{children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{type:"color",value:c,onChange:b=>h(b.target.value),"aria-label":o("taskBoard.taskDialog.pickTagColorAriaLabel"),className:"ml-2 size-4 shrink-0 cursor-pointer appearance-none rounded-full border-0 bg-transparent p-0 [&::-moz-color-swatch]:rounded-full [&::-moz-color-swatch]:border-0 [&::-webkit-color-swatch]:rounded-full [&::-webkit-color-swatch]:border-0 [&::-webkit-color-swatch-wrapper]:p-0"}),d.jsxs(Lt,{value:`create-${p}`,disabled:u,onSelect:x,className:"flex-1 gap-2",children:[d.jsx(Gn,{size:16,className:"text-muted-foreground"}),d.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:p})})]})]})}):d.jsx(jr,{children:o("taskBoard.taskDialog.noTagsFound")}),d.jsx(Dn,{children:t.map(b=>{const g=e.includes(b.id);return d.jsxs(Lt,{value:b.name,onSelect:()=>r(b.id),className:"group gap-2",children:[d.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:rs(b.color)}}),d.jsx("span",{className:"flex-1 truncate",children:b.name}),d.jsx("button",{type:"button","aria-label":o("taskBoard.taskDialog.deleteTagAriaLabel",{name:b.name}),className:"flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground opacity-0 hover:bg-background hover:text-destructive group-hover:opacity-100",onClick:y=>{y.stopPropagation(),i(b.id)},children:d.jsx(Yi,{size:13})}),g&&d.jsx(_s,{size:14,className:"shrink-0 text-foreground"})]},b.id)})})]})]})}function Sh(t){if(!t)return[];const e=[],n=new Set,r=(o,l)=>{n.has(o)||(n.add(o),e.push({url:o,label:l.trim()||o}))},s=t.replace(/!\[[^\]]*\]\([^)]*\)/g,"");for(const o of s.matchAll(/\[([^\]]*)\]\((https?:\/\/[^)\s]+)[^)]*\)/g))r(o[2]??"",o[1]??"");const i=s.replace(/\[[^\]]*\]\([^)]*\)/g,"");for(const o of i.matchAll(/https?:\/\/[^\s)]+/g))r(o[0],o[0]);return e}function vl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function pr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const Sl=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),bn="inline-flex h-9 items-center justify-start gap-2 rounded-lg border border-border px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted sm:border-transparent";function Ch(t){const e=P.c(240),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:l,onOpenThread:a,onNewChat:u,isSaving:f}=t,c=de(),{data:h}=io();let p;e[0]!==h?.data?.members?(p=h?.data?.members??[],e[0]=h?.data?.members,e[1]=p):p=e[1];const m=p,{handleCopy:x,copied:b}=Pa(),{data:g}=ao();let y;e[2]!==g?(y=g===void 0?[]:g,e[2]=g,e[3]=y):y=e[3];const k=y,v=ba(),C=ya(),[T,S]=w.useState(s?.title??""),[j,N]=w.useState(s?.description??""),[R,D]=w.useState(s?.status??i??"triage"),[B,z]=w.useState(s?.priority??"medium"),[M,L]=w.useState(s?.assigneeId??null),A=s?.dueDate;let I;e[4]!==A?(I=pr(A),e[4]=A,e[5]=I):I=e[5];const[_,q]=w.useState(I);let Z;e[6]!==s?.tags?(Z=s?.tags.map(Nh)??[],e[6]=s?.tags,e[7]=Z):Z=e[7];const[F,U]=w.useState(Z),[G,X]=w.useState(!1),[Y,V]=w.useState(!1),[se,te]=w.useState(!1);let J;e[8]!==i||e[9]!==s?.assigneeId||e[10]!==s?.description||e[11]!==s?.dueDate||e[12]!==s?.priority||e[13]!==s?.status||e[14]!==s?.tags||e[15]!==s?.title?(J=()=>{S(s?.title??""),N(s?.description??""),D(s?.status??i??"triage"),z(s?.priority??"medium"),L(s?.assigneeId??null),q(pr(s?.dueDate)),U(s?.tags.map(Dh)??[])},e[8]=i,e[9]=s?.assigneeId,e[10]=s?.description,e[11]=s?.dueDate,e[12]=s?.priority,e[13]=s?.status,e[14]=s?.tags,e[15]=s?.title,e[16]=J):J=e[16];const O=J;let H;e[17]!==r||e[18]!==O?(H=()=>{r(),O()},e[17]=r,e[18]=O,e[19]=H):H=e[19];const Q=H;let re;e[20]!==v?(re=async(K,Xe)=>{const it=await v.mutateAsync({name:K,color:Xe});U(An=>[...An,it.id])},e[20]=v,e[21]=re):re=e[21];const E=re;let W;e[22]!==C?(W=K=>{C.mutate(K),U(Xe=>Xe.filter(it=>it!==K))},e[22]=C,e[23]=W):W=e[23];const ee=W;let ae;e[24]!==M||e[25]!==j||e[26]!==_||e[27]!==o||e[28]!==B||e[29]!==R||e[30]!==F||e[31]!==T?(ae=()=>{const K=T.trim();K&&o({title:K,description:j.trim()||null,status:R,priority:B,assigneeId:M,dueDate:_?vl(_):null,tagIds:F})},e[24]=M,e[25]=j,e[26]=_,e[27]=o,e[28]=B,e[29]=R,e[30]=F,e[31]=T,e[32]=ae):ae=e[32];const me=ae,Ce=M===nt;let ke;if(e[33]!==M||e[34]!==m){let K;e[36]!==M?(K=Xe=>Xe.userId===M,e[36]=M,e[37]=K):K=e[37],ke=m.find(K),e[33]=M,e[34]=m,e[35]=ke}else ke=e[35];const we=ke;let Le;e[38]!==s||e[39]!==m?(Le=s?.assignedBy?m.find(K=>K.userId===s.assignedBy):void 0,e[38]=s,e[39]=m,e[40]=Le):Le=e[40];const _e=Le,kt=bt[R].icon;let xe;e[41]!==Q?(xe=K=>!K&&Q(),e[41]=Q,e[42]=xe):xe=e[42];let he;e[43]!==s||e[44]!==c?(he=c(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[43]=s,e[44]=c,e[45]=he):he=e[45];let Pe;e[46]!==he?(Pe=d.jsx(yr,{className:"sr-only",children:he}),e[46]=he,e[47]=Pe):Pe=e[47];let pe;e[48]!==c?(pe=c("taskBoard.taskDialog.closeAriaLabel"),e[48]=c,e[49]=pe):pe=e[49];let pt;e[50]===Symbol.for("react.memo_cache_sentinel")?(pt=d.jsx(vn,{size:16}),e[50]=pt):pt=e[50];let Ve;e[51]!==Q||e[52]!==pe?(Ve=d.jsx("button",{type:"button","aria-label":pe,onClick:Q,className:"absolute right-2.5 top-2.5 z-10 flex size-10 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:pt}),e[51]=Q,e[52]=pe,e[53]=Ve):Ve=e[53];let Ie;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ie=K=>{S(K.target.value),K.target.style.height="auto",K.target.style.height=`${K.target.scrollHeight}px`},e[54]=Ie):Ie=e[54];let We;e[55]!==c?(We=c("taskBoard.taskDialog.taskTitlePlaceholder"),e[55]=c,e[56]=We):We=e[56];let Ze;e[57]!==We||e[58]!==T?(Ze=d.jsx("div",{className:"sticky top-0 z-10 bg-background p-6 pb-0 sm:p-8 sm:pb-0",children:d.jsx("textarea",{ref:jh,value:T,onChange:Ie,onKeyDown:Th,placeholder:We,autoFocus:!0,rows:1,className:"w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30"})}),e[57]=We,e[58]=T,e[59]=Ze):Ze=e[59];let gt;e[60]!==c?(gt=c("taskBoard.taskDialog.descriptionPlaceholder"),e[60]=c,e[61]=gt):gt=e[61];let Ue;e[62]!==j||e[63]!==gt?(Ue=d.jsx(yh,{defaultValue:j,onChange:N,placeholder:gt}),e[62]=j,e[63]=gt,e[64]=Ue):Ue=e[64];let Ge;e[65]!==b||e[66]!==j||e[67]!==x||e[68]!==c?(Ge=j&&d.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":c("taskBoard.taskDialog.copyDescriptionAriaLabel"),className:"absolute right-0 top-0 size-7 rounded-md border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground group-hover:opacity-100",onClick:()=>x(j),children:b?d.jsx(_s,{size:14}):d.jsx(Ua,{size:14})}),e[65]=b,e[66]=j,e[67]=x,e[68]=c,e[69]=Ge):Ge=e[69];let Je;e[70]!==Ue||e[71]!==Ge?(Je=d.jsxs("div",{className:"group relative flex flex-col",children:[Ue,Ge]}),e[70]=Ue,e[71]=Ge,e[72]=Je):Je=e[72];let ct;e[73]!==s?(ct=s&&d.jsx("hr",{className:"border-border"}),e[73]=s,e[74]=ct):ct=e[74];let ut;e[75]!==j||e[76]!==s||e[77]!==a?(ut=s?.id&&d.jsx(Ah,{item:s,description:j,onOpenThread:a}),e[75]=j,e[76]=s,e[77]=a,e[78]=ut):ut=e[78];let et;e[79]!==_e||e[80]!==we||e[81]!==s||e[82]!==m||e[83]!==a?(et=s&&d.jsx(Bh,{item:s,members:m,startedBy:_e??we,onOpenThread:a}),e[79]=_e,e[80]=we,e[81]=s,e[82]=m,e[83]=a,e[84]=et):et=e[84];let tt;e[85]!==Je||e[86]!==ct||e[87]!==ut||e[88]!==et?(tt=d.jsxs("div",{className:"flex flex-col gap-6 p-6 pt-6 sm:p-8 sm:pt-6",children:[Je,ct,ut,et]}),e[85]=Je,e[86]=ct,e[87]=ut,e[88]=et,e[89]=tt):tt=e[89];let ce;e[90]!==Ze||e[91]!==tt?(ce=d.jsxs("div",{className:"flex min-w-0 flex-col sm:flex-1 sm:overflow-y-auto",children:[Ze,tt]}),e[90]=Ze,e[91]=tt,e[92]=ce):ce=e[92];let ve;e[93]!==c?(ve=c("taskBoard.taskDialog.propertiesLabel"),e[93]=c,e[94]=ve):ve=e[94];let ge;e[95]!==ve?(ge=d.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:ve}),e[95]=ve,e[96]=ge):ge=e[96];let Ne;e[97]!==s||e[98]!==R?(Ne=ne(s?Lr({...s,status:R}):bt[R].iconClassName),e[97]=s,e[98]=R,e[99]=Ne):Ne=e[99];let be;e[100]!==kt||e[101]!==Ne?(be=d.jsx(kt,{size:16,className:Ne}),e[100]=kt,e[101]=Ne,e[102]=be):be=e[102];const Te=bt[R];let je;e[103]!==c||e[104]!==Te.labelKey?(je=c(Te.labelKey),e[103]=c,e[104]=Te.labelKey,e[105]=je):je=e[105];let He;e[106]!==be||e[107]!==je?(He=d.jsx(Cn,{asChild:!0,children:d.jsxs("button",{type:"button",className:bn,children:[be,je]})}),e[106]=be,e[107]=je,e[108]=He):He=e[108];let fe;e[109]!==c?(fe=Ds.map(K=>{const Xe=bt[K].icon;return d.jsxs(Tt,{onSelect:()=>D(K),className:"gap-2",children:[d.jsx(Xe,{size:16,className:bt[K].iconClassName}),c(bt[K].labelKey)]},K)}),e[109]=c,e[110]=fe):fe=e[110];let Oe;e[111]!==fe?(Oe=d.jsx(Tn,{align:"start",className:"w-44",children:fe}),e[111]=fe,e[112]=Oe):Oe=e[112];let Ee;e[113]!==He||e[114]!==Oe?(Ee=d.jsxs(jn,{children:[He,Oe]}),e[113]=He,e[114]=Oe,e[115]=Ee):Ee=e[115];const qe=B==="none"&&"text-muted-foreground";let Be;e[116]!==qe?(Be=ne(bn,qe),e[116]=qe,e[117]=Be):Be=e[117];let $e;e[118]!==B||e[119]!==c?($e=B==="none"?d.jsxs(d.Fragment,{children:[d.jsx(Zi,{size:16}),c("taskBoard.taskDialog.setPriorityButton")]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:ne("size-2 rounded-full",yt[B].dotClassName)}),c(yt[B].labelKey)]}),e[118]=B,e[119]=c,e[120]=$e):$e=e[120];let Re;e[121]!==Be||e[122]!==$e?(Re=d.jsx(Cn,{asChild:!0,children:d.jsx("button",{type:"button",className:Be,children:$e})}),e[121]=Be,e[122]=$e,e[123]=Re):Re=e[123];let Me;e[124]!==c?(Me=Pr.map(K=>d.jsxs(Tt,{onSelect:()=>z(K),children:[d.jsx("span",{className:ne("size-2 rounded-full",yt[K].dotClassName)}),c(yt[K].labelKey)]},K)),e[124]=c,e[125]=Me):Me=e[125];let Ke;e[126]!==Me?(Ke=d.jsx(Tn,{align:"start",className:"w-40",children:Me}),e[126]=Me,e[127]=Ke):Ke=e[127];let wt;e[128]!==Re||e[129]!==Ke?(wt=d.jsxs(jn,{children:[Re,Ke]}),e[128]=Re,e[129]=Ke,e[130]=wt):wt=e[130];const Et=!M&&"text-muted-foreground";let dt;e[131]!==Et?(dt=ne(bn,Et),e[131]=Et,e[132]=dt):dt=e[132];let ft;e[133]!==_e||e[134]!==we||e[135]!==Ce||e[136]!==c?(ft=Ce&&_e?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[d.jsx(Dt,{url:_e.user?.image??void 0,fallback:jt(_e.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:_e.user?.name??c("taskBoard.taskDialog.superAgentDefaultName")})]}),d.jsxs("span",{className:"flex items-center gap-2 sm:hidden",children:[d.jsxs("span",{className:"inline-flex items-center",children:[d.jsx(Dt,{url:_e.user?.image??void 0,fallback:jt(_e.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),d.jsx(Ot,{size:16,className:"ring-2 ring-background"})]}),c("taskBoard.taskDialog.superAgentLabel")]})]}):Ce?d.jsxs(d.Fragment,{children:[d.jsx(Ot,{size:16}),c("taskBoard.taskDialog.superAgentLabel")]}):we?d.jsxs(d.Fragment,{children:[d.jsx(Dt,{url:we.user?.image??void 0,fallback:jt(we.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:we.user?.name??c("taskBoard.taskDialog.unassignedLabel")})]}):d.jsxs(d.Fragment,{children:[d.jsx(Ji,{size:16,className:"text-muted-foreground"}),c("taskBoard.taskDialog.assignButton")]}),e[133]=_e,e[134]=we,e[135]=Ce,e[136]=c,e[137]=ft):ft=e[137];let vt;e[138]!==dt||e[139]!==ft?(vt=d.jsx(kn,{asChild:!0,children:d.jsx("button",{type:"button",className:dt,children:ft})}),e[138]=dt,e[139]=ft,e[140]=vt):vt=e[140];let $;e[141]===Symbol.for("react.memo_cache_sentinel")?($=K=>{L(K),V(!1)},e[141]=$):$=e[141];let ie;e[142]!==m?(ie=d.jsx(Hn,{align:"start",className:"w-56 p-0",children:d.jsx(Jr,{members:m,onSelect:$})}),e[142]=m,e[143]=ie):ie=e[143];let ye;e[144]!==Y||e[145]!==vt||e[146]!==ie?(ye=d.jsxs(qn,{open:Y,onOpenChange:V,modal:!0,children:[vt,ie]}),e[144]=Y,e[145]=vt,e[146]=ie,e[147]=ye):ye=e[147];let Qe;e[148]!==_e||e[149]!==Ce||e[150]!==c?(Qe=Ce&&_e&&d.jsxs("div",{className:"relative mt-1.5 hidden items-center pl-5 sm:flex",children:[d.jsx("span",{className:"absolute -top-1.5 left-5 h-[calc(50%+0.375rem)] w-2.5 rounded-bl-md border-b border-l border-border"}),d.jsxs("span",{className:ne(bn,"pointer-events-none"),children:[d.jsx(Ot,{size:16}),c("taskBoard.taskDialog.superAgentLabel")]})]}),e[148]=_e,e[149]=Ce,e[150]=c,e[151]=Qe):Qe=e[151];let mt;e[152]!==ye||e[153]!==Qe?(mt=d.jsxs("div",{className:"flex flex-col",children:[ye,Qe]}),e[152]=ye,e[153]=Qe,e[154]=mt):mt=e[154];const qt=!_&&"text-muted-foreground";let Qt;e[155]!==qt?(Qt=ne(bn,qt),e[155]=qt,e[156]=Qt):Qt=e[156];let ls;e[157]===Symbol.for("react.memo_cache_sentinel")?(ls=d.jsx(wn,{size:16,className:"text-muted-foreground"}),e[157]=ls):ls=e[157];let Xt;e[158]!==_||e[159]!==c?(Xt=_?Sl.format(_):c("taskBoard.taskDialog.dueDateLabel"),e[158]=_,e[159]=c,e[160]=Xt):Xt=e[160];let Yt;e[161]!==_||e[162]!==c?(Yt=_&&d.jsx("span",{role:"button",tabIndex:0,"aria-label":c("taskBoard.taskDialog.clearDueDateAriaLabel"),className:"-mr-1 ml-0.5 flex size-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground",onClick:K=>{K.stopPropagation(),q(null)},onKeyDown:K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),K.stopPropagation(),q(null))},children:d.jsx(vn,{size:12})}),e[161]=_,e[162]=c,e[163]=Yt):Yt=e[163];let Zt;e[164]!==Qt||e[165]!==Xt||e[166]!==Yt?(Zt=d.jsx(kn,{asChild:!0,children:d.jsxs("button",{type:"button",className:Qt,children:[ls,Xt,Yt]})}),e[164]=Qt,e[165]=Xt,e[166]=Yt,e[167]=Zt):Zt=e[167];const Hs=_??void 0;let as;e[168]===Symbol.for("react.memo_cache_sentinel")?(as=K=>{q(K??null),K&&X(!1)},e[168]=as):as=e[168];let Jt;e[169]!==Hs?(Jt=d.jsx(Hn,{className:"w-auto p-0",align:"start",children:d.jsx(xo,{mode:"single",selected:Hs,onSelect:as,initialFocus:!0})}),e[169]=Hs,e[170]=Jt):Jt=e[170];let en;e[171]!==G||e[172]!==Zt||e[173]!==Jt?(en=d.jsxs(qn,{open:G,onOpenChange:X,children:[Zt,Jt]}),e[171]=G,e[172]=Zt,e[173]=Jt,e[174]=en):en=e[174];let tn;e[175]!==k||e[176]!==c||e[177]!==F?(tn=F.length===0?d.jsx(kn,{asChild:!0,children:d.jsxs("button",{type:"button",className:ne(bn,"text-muted-foreground"),children:[d.jsx(Vl,{size:16}),c("taskBoard.taskDialog.tagsButton")]})}):d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[F.map(K=>{const Xe=k.find(it=>it.id===K);return Xe?d.jsxs("button",{type:"button",onClick:()=>te(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-muted",children:[d.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:rs(Xe.color)}}),d.jsx("span",{className:"truncate",children:Xe.name}),d.jsx("span",{role:"button",tabIndex:0,"aria-label":c("taskBoard.taskDialog.removeTagAriaLabel",{name:Xe.name}),className:"-mr-0.5 flex size-3.5 items-center justify-center rounded-sm text-muted-foreground hover:bg-background hover:text-foreground",onClick:it=>{it.stopPropagation(),U(An=>An.filter(qs=>qs!==K))},onKeyDown:it=>{(it.key==="Enter"||it.key===" ")&&(it.preventDefault(),it.stopPropagation(),U(An=>An.filter(qs=>qs!==K)))},children:d.jsx(vn,{size:10})})]},K):null}),d.jsx(kn,{asChild:!0,children:d.jsx("button",{type:"button","aria-label":c("taskBoard.taskDialog.addTagButton"),className:"flex size-7 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:d.jsx(Gn,{size:14})})})]}),e[175]=k,e[176]=c,e[177]=F,e[178]=tn):tn=e[178];let nn;e[179]!==k.length?(nn=Id(k.length),e[179]=k.length,e[180]=nn):nn=e[180];let cs;e[181]===Symbol.for("react.memo_cache_sentinel")?(cs=K=>U(Xe=>Xe.includes(K)?Xe.filter(it=>it!==K):[...Xe,K]),e[181]=cs):cs=e[181];let sn;e[182]!==E||e[183]!==ee||e[184]!==k||e[185]!==nn||e[186]!==F?(sn=d.jsx(Hn,{align:"start",className:"w-56 p-0",children:d.jsx(vh,{tags:k,selectedIds:F,defaultColor:nn,onToggle:cs,onCreate:E,onDelete:ee})}),e[182]=E,e[183]=ee,e[184]=k,e[185]=nn,e[186]=F,e[187]=sn):sn=e[187];let rn;e[188]!==tn||e[189]!==sn||e[190]!==se?(rn=d.jsxs(qn,{open:se,onOpenChange:te,modal:!0,children:[tn,sn]}),e[188]=tn,e[189]=sn,e[190]=se,e[191]=rn):rn=e[191];let on;e[192]!==Ee||e[193]!==wt||e[194]!==mt||e[195]!==en||e[196]!==rn?(on=d.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[Ee,wt,mt,en,rn]}),e[192]=Ee,e[193]=wt,e[194]=mt,e[195]=en,e[196]=rn,e[197]=on):on=e[197];let ln;e[198]!==ge||e[199]!==on?(ln=d.jsxs("div",{className:"flex w-full shrink-0 flex-col gap-4 border-t border-border p-6 sm:w-[220px] sm:border-t-0 sm:border-l sm:px-6 sm:py-10",children:[ge,on]}),e[198]=ge,e[199]=on,e[200]=ln):ln=e[200];let an;e[201]!==ce||e[202]!==ln?(an=d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",children:[ce,ln]}),e[201]=ce,e[202]=ln,e[203]=an):an=e[203];let cn;e[204]!==s||e[205]!==l||e[206]!==c?(cn=s&&l?d.jsx(at,{variant:"ghost",size:"icon","aria-label":c("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:l,children:d.jsx(Yi,{size:16})}):d.jsx("span",{}),e[204]=s,e[205]=l,e[206]=c,e[207]=cn):cn=e[207];let un;e[208]!==s||e[209]!==u||e[210]!==c?(un=s&&u&&d.jsxs(at,{variant:"outline",size:"sm",onClick:u,children:[d.jsx(eo,{size:16}),c("taskBoard.taskDialog.newChatButton")]}),e[208]=s,e[209]=u,e[210]=c,e[211]=un):un=e[211];let dn;e[212]!==f||e[213]!==T?(dn=!T.trim()||f,e[212]=f,e[213]=T,e[214]=dn):dn=e[214];let fn;e[215]!==s?(fn=s?null:d.jsx(Gn,{size:16}),e[215]=s,e[216]=fn):fn=e[216];let hn;e[217]!==s||e[218]!==c?(hn=c(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton"),e[217]=s,e[218]=c,e[219]=hn):hn=e[219];let pn;e[220]!==me||e[221]!==dn||e[222]!==fn||e[223]!==hn?(pn=d.jsxs(at,{size:"sm",disabled:dn,onClick:me,children:[fn,hn]}),e[220]=me,e[221]=dn,e[222]=fn,e[223]=hn,e[224]=pn):pn=e[224];let gn;e[225]!==un||e[226]!==pn?(gn=d.jsxs("div",{className:"flex items-center gap-2",children:[un,pn]}),e[225]=un,e[226]=pn,e[227]=gn):gn=e[227];let mn;e[228]!==cn||e[229]!==gn?(mn=d.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[cn,gn]}),e[228]=cn,e[229]=gn,e[230]=mn):mn=e[230];let xn;e[231]!==Pe||e[232]!==Ve||e[233]!==an||e[234]!==mn?(xn=d.jsxs(kr,{className:"flex max-h-[92vh] flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:h-[90vh] sm:max-h-[820px] sm:max-w-[1040px]",closeButtonClassName:"hidden",children:[Pe,Ve,an,mn]}),e[231]=Pe,e[232]=Ve,e[233]=an,e[234]=mn,e[235]=xn):xn=e[235];let us;return e[236]!==n||e[237]!==xe||e[238]!==xn?(us=d.jsx(wr,{open:n,onOpenChange:xe,children:xn}),e[236]=n,e[237]=xe,e[238]=xn,e[239]=us):us=e[239],us}function Th(t){t.key==="Enter"&&t.preventDefault()}function jh(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function Dh(t){return t.id}function Nh(t){return t.id}function Rh(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:Gl};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:to};case"in_progress":return{label:e("taskBoard.taskDialog.threadStatusRunning"),className:"text-primary",icon:xr,spin:!0};case"completed":return{label:e("taskBoard.taskDialog.threadStatusCompleted"),className:"text-success",icon:vr};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:lo};default:return t}}function Eh(t){const e=P.c(24),{thread:n,startedBy:r,onOpen:s}=t,i=de();let o;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const l=n.status?Rh(n.status,i):null,a=n.lastMessage;let u;e[5]!==s||e[6]!==n?(u=()=>s?.(n),e[5]=s,e[6]=n,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=d.jsx(Ot,{size:16,className:"shrink-0"}),e[8]=f):f=e[8];let c;e[9]!==i||e[10]!==n.title?(c=n.title||i("taskBoard.taskDialog.superAgentDefaultName"),e[9]=i,e[10]=n.title,e[11]=c):c=e[11];let h;e[12]!==c?(h=d.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:c}),e[12]=c,e[13]=h):h=e[13];let p;e[14]!==r||e[15]!==i?(p=r&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"shrink-0 text-sm text-muted-foreground/50",children:i("taskBoard.taskDialog.startedByLabel")}),d.jsx(Dt,{url:r.user?.image??void 0,fallback:jt(r.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate text-sm text-foreground",children:r.user?.name??i("taskBoard.taskDialog.someoneLabel")})]}),e[14]=r,e[15]=i,e[16]=p):p=e[16];let m;e[17]!==s||e[18]!==i?(m=s&&d.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 text-xs text-muted-foreground/60 group-hover:text-foreground",children:[i("taskBoard.taskDialog.openThreadHint"),d.jsx(Fa,{size:14})]}),e[17]=s,e[18]=i,e[19]=m):m=e[19];let x;e[20]!==h||e[21]!==p||e[22]!==m?(x=d.jsxs("div",{className:"flex items-center gap-2",children:[f,h,p,m]}),e[20]=h,e[21]=p,e[22]=m,e[23]=x):x=e[23],o=d.jsxs("button",{type:"button",disabled:!s,onClick:u,className:"group flex w-full flex-col gap-2 rounded-xl bg-card p-4 text-left card-shadow transition-colors enabled:hover:bg-muted/60 disabled:cursor-default",children:[x,l&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:ne("flex shrink-0 items-center gap-1.5",l.className),children:[d.jsx(l.icon,{size:15,className:ne(l.spin&&"animate-spin")}),d.jsx("span",{className:"text-sm",children:l.label})]}),a&&d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:a})]})]}),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=o}else o=e[4];return o}function Ih(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:Wl}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:Ks}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:Ks}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:Ks}}function Ah(t){const e=P.c(18),{item:n,description:r,onOpenThread:s}=t,i=de(),{data:o}=kh(n.id);let l,a;if(e[0]!==r||e[1]!==n.threads||e[2]!==s||e[3]!==o||e[4]!==i){a=Symbol.for("react.early_return_sentinel");e:{const u=Sh(r);if((!o||o.length===0)&&u.length===0){a=null;break e}let f,c,h;if(e[7]!==n.threads||e[8]!==s||e[9]!==o||e[10]!==i){const p=s?n.threads.find(Oh):void 0;f="flex flex-col gap-1 pb-2";let m;e[14]!==i?(m=i("taskBoard.taskDialog.linksLabel"),e[14]=i,e[15]=m):m=e[15],e[16]!==m?(c=d.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:m}),e[16]=m,e[17]=c):c=e[17],h=(o??[]).map(x=>{const b=Ih(x,i);return d.jsxs("div",{className:"flex items-center gap-3 rounded-xl bg-card p-3 card-shadow",children:[d.jsxs("a",{href:x.url,target:"_blank",rel:"noreferrer",className:"group flex min-w-0 flex-1 items-center gap-3",children:[d.jsx(tr,{className:"size-4 shrink-0 text-foreground"}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.title??`${x.repoOwner}/${x.repoName}`}),d.jsxs("span",{className:ne("flex shrink-0 items-center gap-1 text-xs font-medium",b.className),children:[d.jsx(b.icon,{size:13}),b.label]}),d.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:["#",x.number]}),d.jsx(bo,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]}),p&&d.jsxs(at,{type:"button",variant:"outline",size:"sm",className:"h-7 shrink-0 gap-1.5 px-2",title:i("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>s?.(p),children:[d.jsx(eo,{size:13}),i("taskBoard.taskDialog.openPreviewButton")]})]},x.url)}),e[7]=n.threads,e[8]=s,e[9]=o,e[10]=i,e[11]=f,e[12]=c,e[13]=h}else f=e[11],c=e[12],h=e[13];l=d.jsxs("div",{className:f,children:[c,h,u.map(_h)]})}e[0]=r,e[1]=n.threads,e[2]=s,e[3]=o,e[4]=i,e[5]=l,e[6]=a}else l=e[5],a=e[6];return a!==Symbol.for("react.early_return_sentinel")?a:l}function _h(t){return d.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"group flex items-center gap-2 rounded-md px-1 py-1.5 transition-colors hover:bg-muted",children:[d.jsx(qa,{size:15,className:"shrink-0 text-muted-foreground"}),d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:t.label}),d.jsx(bo,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function Oh(t){return t.hasPreview&&t.virtualMcpId}function Bh(t){const e=P.c(18),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=de(),{data:l}=wh(n.id);let a;e[0]!==r?(a=new Map(r.map(Lh)),e[0]=r,e[1]=a):a=e[1];const u=a;let f,c;if(e[2]!==l||e[3]!==n.threads){c=Symbol.for("react.early_return_sentinel");e:{const b=[...(l??[]).map(zh),...n.threads.map(Mh)].sort($h);if(b.length===0){c=null;break e}f=[];for(const g of b){if(g.kind==="thread"){f.push({type:"thread",thread:g.thread});continue}const y=f[f.length-1];y?.type==="timeline"?y.items.push(g.activity):f.push({type:"timeline",items:[g.activity]})}}e[2]=l,e[3]=n.threads,e[4]=f,e[5]=c}else f=e[4],c=e[5];if(c!==Symbol.for("react.early_return_sentinel"))return c;let h;e[6]!==o?(h=o("taskBoard.taskDialog.activityLabel"),e[6]=o,e[7]=h):h=e[7];let p;e[8]!==h?(p=d.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:h}),e[8]=h,e[9]=p):p=e[9];let m;e[10]!==f||e[11]!==u||e[12]!==i||e[13]!==s?(m=f.map((b,g)=>b.type==="timeline"?d.jsx(Fh,{items:b.items,memberByUserId:u},`timeline-${g}`):d.jsx(Eh,{thread:b.thread,startedBy:s,onOpen:i},`thread-${b.thread.threadId}`)),e[10]=f,e[11]=u,e[12]=i,e[13]=s,e[14]=m):m=e[14];let x;return e[15]!==p||e[16]!==m?(x=d.jsxs("div",{className:"flex flex-col gap-5 pb-2",children:[p,m]}),e[15]=p,e[16]=m,e[17]=x):x=e[17],x}function $h(t,e){return t.at-e.at}function Mh(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function zh(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function Lh(t){return[t.userId,t]}function yn(t){const e=P.c(7),{icon:n,label:r}=t;let s;e[0]!==n?(s=d.jsx("span",{className:"ml-1 mr-1 inline-flex h-[1lh] items-center align-top",children:n}),e[0]=n,e[1]=s):s=e[1];let i;e[2]!==r?(i=d.jsx("span",{className:"mr-1",children:r}),e[2]=r,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==i?(o=d.jsxs(d.Fragment,{children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6],o}const Is="\0";function Js(t){return`${Is}${t}${Is}`}function Ln(t,e){return t.split(new RegExp(`${Is}(\\w+)${Is}`)).map((n,r)=>d.jsx(w.Fragment,{children:r%2===0?n:e[n]},r))}function Ph(t,e,n){const r=c=>{const h=typeof c=="string"?bt[c]:void 0;if(!h)return String(c??"");const p=h.icon;return d.jsx(yn,{icon:d.jsx(p,{size:14,className:h.iconClassName}),label:e(h.labelKey)})},s=c=>{const h=typeof c=="string"?yt[c]:void 0;return h?d.jsx(yn,{icon:d.jsx("span",{className:ne("size-2 rounded-full",h.dotClassName)}),label:e(h.labelKey)}):String(c??"")},i=c=>{const h=pr(typeof c=="string"?c:null);return h?d.jsx(yn,{icon:d.jsx(wn,{size:14,className:"text-muted-foreground"}),label:Sl.format(h)}):""},o=c=>!Array.isArray(c)||c.length===0?null:c.map((h,p)=>{const m=h;return d.jsx(yn,{icon:d.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:rs(m.color)}}),label:m.name??""},m.id??p)}),l=c=>{if(c===nt)return d.jsx(yn,{icon:d.jsx(Ot,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const h=typeof c=="string"?n.get(c):void 0;return d.jsx(yn,{icon:d.jsx(Dt,{url:h?.user?.image??void 0,fallback:jt(h?.user?.name),shape:"circle",size:"2xs"}),label:h?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},a=t.data,u=Js("from"),f=Js("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return Ln(a.from?e("taskBoard.taskDialog.activityMovedFromTo",{from:u,to:f}):e("taskBoard.taskDialog.activityMovedTo",{to:f}),{from:r(a.from),to:r(a.to)});case"assignee_changed":return a.to==null?e("taskBoard.taskDialog.activityUnassigned"):Ln(e(a.to===nt?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:Js("name")}),{name:l(a.to)});case"priority_changed":return a.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):Ln(!a.from||a.from==="none"?e("taskBoard.taskDialog.activityPrioritySet",{to:f}):e("taskBoard.taskDialog.activityPriorityFromTo",{from:u,to:f}),{from:s(a.from),to:s(a.to)});case"due_date_changed":return a.to==null?e("taskBoard.taskDialog.activityDueDateCleared"):Ln(a.from==null?e("taskBoard.taskDialog.activityDueDateSet",{to:f}):e("taskBoard.taskDialog.activityDueDateFromTo",{from:u,to:f}),{from:i(a.from),to:i(a.to)});case"title_changed":return e("taskBoard.taskDialog.activityRenamed",{to:String(a.to??"")});case"description_changed":return e("taskBoard.taskDialog.activityDescriptionUpdated");case"tags_changed":return!Array.isArray(a.to)||a.to.length===0?e("taskBoard.taskDialog.activityTagsCleared"):Ln(e("taskBoard.taskDialog.activityTagsSet",{to:f}),{to:o(a.to)});default:{const c=t.action;return String(c)}}}function _i(t){return!t||t===nt}function Fh(t){const e=P.c(21),{items:n,memberByUserId:r}=t,s=de();let i;e[0]!==r||e[1]!==s?(i=h=>_i(h)?s("taskBoard.taskDialog.superAgentLabel"):r.get(h)?.user?.name??s("taskBoard.taskDialog.someoneLabel"),e[0]=r,e[1]=s,e[2]=i):i=e[2];const o=i;let l;e[3]!==r?(l=h=>{if(_i(h))return d.jsx("span",{className:"z-10 flex size-4 shrink-0 items-center justify-center bg-background",children:d.jsx(Ot,{size:16})});const p=r.get(h);return d.jsx("span",{className:"z-10 shrink-0 rounded-full bg-background",children:d.jsx(Dt,{url:p?.user?.image??void 0,fallback:jt(p?.user?.name),shape:"circle",size:"2xs"})})},e[3]=r,e[4]=l):l=e[4];const a=l;let u;e[5]!==n.length?(u=n.length>1&&d.jsx("span",{"aria-hidden":!0,className:"absolute bottom-3 left-2 top-3 w-px bg-border"}),e[5]=n.length,e[6]=u):u=e[6];let f;if(e[7]!==a||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==s){let h;e[13]!==a||e[14]!==o||e[15]!==r||e[16]!==s?(h=p=>d.jsxs("div",{className:"relative flex items-center gap-2.5",children:[a(p.actorId),d.jsxs("span",{className:"min-w-0 truncate text-sm text-muted-foreground",children:[d.jsx("span",{className:"font-medium text-foreground",children:o(p.actorId)})," ",Ph(p,s,r),d.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",oo(new Date(p.occurredAt))]})]})]},p.id),e[13]=a,e[14]=o,e[15]=r,e[16]=s,e[17]=h):h=e[17],f=n.map(h),e[7]=a,e[8]=o,e[9]=n,e[10]=r,e[11]=s,e[12]=f}else f=e[12];let c;return e[18]!==u||e[19]!==f?(c=d.jsxs("div",{className:"relative flex flex-col gap-4",children:[u,f]}),e[18]=u,e[19]=f,e[20]=c):c=e[20],c}const Oi=380,Uh=90,Bi=5,Hh="cubic-bezier(0.22, 0.61, 0.36, 1)";function qh(t,e,n){const r=w.useRef(new Map),s=w.useRef(new Map);w.useLayoutEffect(()=>{const i=t.current;if(!i)return;const o=i.querySelectorAll("[data-flip-id]"),l=new Map,a=r.current;r.current=l;const u=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,f=[];for(const g of o){const y=g.dataset.flipId;if(!y)continue;const k=g.getBoundingClientRect(),v=g.dataset.flipLane;if(l.set(y,{rect:k,lane:v}),!n)continue;const C=a.get(y);if(!C)continue;const T=C.rect.left-k.left,S=C.rect.top-k.top;(T||S)&&f.push({el:g,dx:T,dy:S,lane:C.lane!==v})}if(!n||u||f.length===0)return;const c=s.current,h=g=>{g instanceof HTMLElement&&(c.set(g,(c.get(g)??0)+1),g.style.overflow="visible")},p=g=>{if(!(g instanceof HTMLElement))return;const y=(c.get(g)??1)-1;if(y>0){c.set(g,y);return}c.delete(g),g.style.overflow=""};for(const g of f){const y=g.lane?` rotate(${g.dx>0?Bi:-Bi}deg)`:"";g.el.style.transition="none",g.el.style.transform=`translate(${g.dx}px, ${g.dy}px)${y}`,g.lane&&(g.el.style.zIndex="10",h(g.el.closest("[data-lane-scroll]")))}let m=0;const x=[],b=requestAnimationFrame(()=>{for(const g of f){const y=g.lane?m++*Uh:0;g.el.style.transition=`transform ${Oi}ms ${Hh} ${y}ms`,g.el.style.transform="",x.push(window.setTimeout(()=>{g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&p(g.el.closest("[data-lane-scroll]"))},Oi+y+30))}});return()=>{cancelAnimationFrame(b);for(const g of x)clearTimeout(g);for(const g of f)g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&p(g.el.closest("[data-lane-scroll]"))}},[e,t,n])}function Kh(t,e=[]){const n=[[`# Task: ${t.title}`,t.description?.trim()].filter(Boolean).join(`
72
+
73
+ `)];if(e.length>0){const r=e.map(s=>{const i=s.merged?"merged":s.state??(s.draft?"draft":"open"),o=s.title?.trim()||`${s.repoOwner}/${s.repoName}`;return`- #${s.number} ${o} [${i}] ${s.url}`});n.push(["## Linked pull requests",...r].join(`
74
+ `))}if(t.threads.length>0){const r=t.threads.map(s=>{const i=s.title?.trim()||"Untitled chat";return s.status?`- ${i} [${s.status}]`:`- ${i}`});n.push(["## Other chats on this task",...r].join(`
75
+ `))}return n.join(`
76
+
77
+ `)}const gr="__unassigned__",As={assignee:null,priority:null,due:null};function Vh(t){return t.assignee!==null||t.priority!==null||t.due!==null}function Wh(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const Gh=864e5;function Qh(t,e){const n=new Date(t),r=new Date(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function Xh(t,e){if(e.assignee!==null){if(e.assignee===gr){if(t.assigneeId!==null)return!1}else if(t.assigneeId!==e.assignee)return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const n=new Date(t.dueDate).getTime(),r=Date.now();if(e.due==="overdue"&&n>=r||e.due==="today"&&!Qh(n,r)||e.due==="week"&&(n<r||n>r+7*Gh))return!1}return!0}const $i={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Us(t,e=!1){return ne("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Yh(t){const e=P.c(95),{value:n,members:r,onChange:s,block:i}=t,o=de(),[l,a]=w.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(nr,{size:14,className:"shrink-0"}),e[0]=u):u=e[0];let f=u,c;e[1]!==o?(c=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=c):c=e[2];let h=c;if(n===gr){let O;e[3]!==o?(O=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=O):O=e[4],h=O}else if(n===nt){let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=d.jsx(Ot,{size:14}),e[5]=O):O=e[5],f=O;let H;e[6]!==o?(H=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=H):H=e[7],h=H}else if(n){let O,H,Q,re;if(e[8]!==r||e[9]!==n){let ee;e[14]!==n?(ee=ae=>ae.userId===n,e[14]=n,e[15]=ee):ee=e[15],H=r.find(ee),O=Dt,Q=H?.user?.image??void 0,re=jt(H?.user?.name),e[8]=r,e[9]=n,e[10]=O,e[11]=H,e[12]=Q,e[13]=re}else O=e[10],H=e[11],Q=e[12],re=e[13];let E;e[16]!==O||e[17]!==Q||e[18]!==re?(E=d.jsx(O,{url:Q,fallback:re,shape:"circle",size:"2xs"}),e[16]=O,e[17]=Q,e[18]=re,e[19]=E):E=e[19],f=E;let W;e[20]!==H?.user?.name||e[21]!==o?(W=H?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=H?.user?.name,e[21]=o,e[22]=W):W=e[22],h=W}let p;e[23]!==s?(p=O=>{s(O),a(!1)},e[23]=s,e[24]=p):p=e[24];const m=p,x=n!==null;let b;e[25]!==i||e[26]!==x?(b=Us(x,i),e[25]=i,e[26]=x,e[27]=b):b=e[27];const g=b,y=i&&"ml-auto";let k;e[28]!==y?(k=ne("shrink-0 opacity-60",y),e[28]=y,e[29]=k):k=e[29];const v=k;let C;e[30]!==h?(C=d.jsx("span",{className:"max-w-[10rem] truncate",children:h}),e[30]=h,e[31]=C):C=e[31];let T;e[32]!==v?(T=d.jsx(Rr,{size:12,className:v}),e[32]=v,e[33]=T):T=e[33];let S;e[34]!==f||e[35]!==C||e[36]!==T||e[37]!==g?(S=d.jsx(kn,{asChild:!0,children:d.jsxs("button",{type:"button",className:g,children:[f,C,T]})}),e[34]=f,e[35]=C,e[36]=T,e[37]=g,e[38]=S):S=e[38];let j;e[39]!==o?(j=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=j):j=e[40];let N;e[41]!==j?(N=d.jsx(Tr,{placeholder:j,className:"h-9"}),e[41]=j,e[42]=N):N=e[42];let R;e[43]!==o?(R=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[43]=o,e[44]=R):R=e[44];let D;e[45]!==R?(D=d.jsx(jr,{children:R}),e[45]=R,e[46]=D):D=e[46];let B;e[47]!==m?(B=()=>m(null),e[47]=m,e[48]=B):B=e[48];let z;e[49]!==o?(z=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=z):z=e[50];let M;e[51]!==B||e[52]!==z?(M=d.jsx(Lt,{value:"Anyone",onSelect:B,children:z}),e[51]=B,e[52]=z,e[53]=M):M=e[53];let L;e[54]!==m?(L=()=>m(gr),e[54]=m,e[55]=L):L=e[55];let A;e[56]===Symbol.for("react.memo_cache_sentinel")?(A=d.jsx(nr,{size:16,className:"text-muted-foreground"}),e[56]=A):A=e[56];let I;e[57]!==o?(I=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=I):I=e[58];let _;e[59]!==L||e[60]!==I?(_=d.jsxs(Lt,{value:"Unassigned",onSelect:L,className:"gap-2",children:[A,I]}),e[59]=L,e[60]=I,e[61]=_):_=e[61];let q;e[62]!==m?(q=()=>m(nt),e[62]=m,e[63]=q):q=e[63];let Z;e[64]===Symbol.for("react.memo_cache_sentinel")?(Z=d.jsx(Ot,{size:16}),e[64]=Z):Z=e[64];let F;e[65]!==o?(F=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=F):F=e[66];let U;e[67]!==q||e[68]!==F?(U=d.jsxs(Lt,{value:"Super Agent",onSelect:q,className:"gap-2",children:[Z,F]}),e[67]=q,e[68]=F,e[69]=U):U=e[69];let G;e[70]!==M||e[71]!==_||e[72]!==U?(G=d.jsxs(Dn,{children:[M,_,U]}),e[70]=M,e[71]=_,e[72]=U,e[73]=G):G=e[73];let X;e[74]!==o?(X=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=X):X=e[75];let Y;if(e[76]!==r||e[77]!==m){let O;e[79]!==m?(O=H=>d.jsxs(Lt,{value:H.user?.name??H.userId,onSelect:()=>m(H.userId),className:"gap-2",children:[d.jsx(Dt,{url:H.user?.image??void 0,fallback:jt(H.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:H.user?.name??H.userId})]},H.userId),e[79]=m,e[80]=O):O=e[80],Y=r.map(O),e[76]=r,e[77]=m,e[78]=Y}else Y=e[78];let V;e[81]!==X||e[82]!==Y?(V=d.jsx(Dn,{heading:X,children:Y}),e[81]=X,e[82]=Y,e[83]=V):V=e[83];let se;e[84]!==D||e[85]!==G||e[86]!==V?(se=d.jsxs(Nr,{children:[D,G,V]}),e[84]=D,e[85]=G,e[86]=V,e[87]=se):se=e[87];let te;e[88]!==N||e[89]!==se?(te=d.jsx(Hn,{align:"start",className:"w-56 p-0",children:d.jsxs(Dr,{children:[N,se]})}),e[88]=N,e[89]=se,e[90]=te):te=e[90];let J;return e[91]!==l||e[92]!==S||e[93]!==te?(J=d.jsxs(qn,{open:l,onOpenChange:a,children:[S,te]}),e[91]=l,e[92]=S,e[93]=te,e[94]=J):J=e[94],J}function Zh(t){const e=P.c(33),{value:n,onChange:r,block:s}=t,i=de(),o=n!==null;let l;e[0]!==s||e[1]!==o?(l=Us(o,s),e[0]=s,e[1]=o,e[2]=l):l=e[2];const a=l,u=s&&"ml-auto";let f;e[3]!==u?(f=ne("shrink-0 opacity-60",u),e[3]=u,e[4]=f):f=e[4];const c=f;let h;e[5]!==n?(h=n?d.jsx("span",{className:ne("size-2 shrink-0 rounded-full",yt[n].dotClassName)}):d.jsx(Ya,{size:14,className:"shrink-0"}),e[5]=n,e[6]=h):h=e[6];let p;e[7]!==i||e[8]!==n?(p=i(n?yt[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=n,e[9]=p):p=e[9];let m;e[10]!==c?(m=d.jsx(Rr,{size:12,className:c}),e[10]=c,e[11]=m):m=e[11];let x;e[12]!==h||e[13]!==p||e[14]!==m||e[15]!==a?(x=d.jsx(Cn,{asChild:!0,children:d.jsxs("button",{type:"button",className:a,children:[h,p,m]})}),e[12]=h,e[13]=p,e[14]=m,e[15]=a,e[16]=x):x=e[16];let b;e[17]!==r?(b=()=>r(null),e[17]=r,e[18]=b):b=e[18];let g;e[19]!==i?(g=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=g):g=e[20];let y;e[21]!==g||e[22]!==b?(y=d.jsx(Tt,{onSelect:b,children:g}),e[21]=g,e[22]=b,e[23]=y):y=e[23];let k;e[24]!==r||e[25]!==i?(k=Pr.map(T=>d.jsxs(Tt,{onSelect:()=>r(T),className:"gap-2",children:[d.jsx("span",{className:ne("size-2 rounded-full",yt[T].dotClassName)}),i(yt[T].labelKey)]},T)),e[24]=r,e[25]=i,e[26]=k):k=e[26];let v;e[27]!==y||e[28]!==k?(v=d.jsxs(Tn,{align:"start",className:"w-40",children:[y,k]}),e[27]=y,e[28]=k,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==x?(C=d.jsxs(jn,{children:[x,v]}),e[30]=v,e[31]=x,e[32]=C):C=e[32],C}function Jh(t){const e=P.c(35),{value:n,onChange:r,block:s}=t,i=de();let o;e[0]!==i||e[1]!==n?(o=n?i($i[n]):void 0,e[0]=i,e[1]=n,e[2]=o):o=e[2];const l=o,a=n!==null;let u;e[3]!==s||e[4]!==a?(u=Us(a,s),e[3]=s,e[4]=a,e[5]=u):u=e[5];const f=u,c=s&&"ml-auto";let h;e[6]!==c?(h=ne("shrink-0 opacity-60",c),e[6]=c,e[7]=h):h=e[7];const p=h;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=d.jsx(wn,{size:14,className:"shrink-0"}),e[8]=m):m=e[8];let x;e[9]!==l||e[10]!==i?(x=l??i("taskBoard.taskFilters.dueDateLabel"),e[9]=l,e[10]=i,e[11]=x):x=e[11];let b;e[12]!==p?(b=d.jsx(Rr,{size:12,className:p}),e[12]=p,e[13]=b):b=e[13];let g;e[14]!==x||e[15]!==b||e[16]!==f?(g=d.jsx(Cn,{asChild:!0,children:d.jsxs("button",{type:"button",className:f,children:[m,x,b]})}),e[14]=x,e[15]=b,e[16]=f,e[17]=g):g=e[17];let y;e[18]!==r?(y=()=>r(null),e[18]=r,e[19]=y):y=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=d.jsx(wn,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==i?(v=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=v):v=e[22];let C;e[23]!==y||e[24]!==v?(C=d.jsxs(Tt,{onSelect:y,className:"gap-2",children:[k,v]}),e[23]=y,e[24]=v,e[25]=C):C=e[25];let T;e[26]!==r||e[27]!==i?(T=Object.entries($i).map(N=>{const[R,D]=N,B=R==="overdue";return d.jsxs(Tt,{onSelect:()=>r(R),className:ne("gap-2",B&&"text-destructive"),children:[d.jsx(wn,{size:16,className:ne("shrink-0",B?"text-destructive":"text-muted-foreground")}),i(D)]},R)}),e[26]=r,e[27]=i,e[28]=T):T=e[28];let S;e[29]!==C||e[30]!==T?(S=d.jsxs(Tn,{align:"start",className:"w-44",children:[C,T]}),e[29]=C,e[30]=T,e[31]=S):S=e[31];let j;return e[32]!==S||e[33]!==g?(j=d.jsxs(jn,{children:[g,S]}),e[32]=S,e[33]=g,e[34]=j):j=e[34],j}function Cl(t){const e=P.c(26),{filters:n,members:r,onChange:s,block:i}=t;let o;e[0]!==n||e[1]!==s?(o=p=>s({...n,assignee:p}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let l;e[3]!==i||e[4]!==n.assignee||e[5]!==r||e[6]!==o?(l=d.jsx(Yh,{block:i,value:n.assignee,members:r,onChange:o}),e[3]=i,e[4]=n.assignee,e[5]=r,e[6]=o,e[7]=l):l=e[7];let a;e[8]!==n||e[9]!==s?(a=p=>s({...n,priority:p}),e[8]=n,e[9]=s,e[10]=a):a=e[10];let u;e[11]!==i||e[12]!==n.priority||e[13]!==a?(u=d.jsx(Zh,{block:i,value:n.priority,onChange:a}),e[11]=i,e[12]=n.priority,e[13]=a,e[14]=u):u=e[14];let f;e[15]!==n||e[16]!==s?(f=p=>s({...n,due:p}),e[15]=n,e[16]=s,e[17]=f):f=e[17];let c;e[18]!==i||e[19]!==n.due||e[20]!==f?(c=d.jsx(Jh,{block:i,value:n.due,onChange:f}),e[18]=i,e[19]=n.due,e[20]=f,e[21]=c):c=e[21];let h;return e[22]!==l||e[23]!==u||e[24]!==c?(h=d.jsxs(d.Fragment,{children:[l,u,c]}),e[22]=l,e[23]=u,e[24]=c,e[25]=h):h=e[25],h}function ep(t){const e=P.c(12),{filters:n,members:r,onChange:s}=t,i=de();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=d.jsx(vo,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let l;e[1]!==n||e[2]!==r||e[3]!==s?(l=d.jsx(Cl,{filters:n,members:r,onChange:s}),e[1]=n,e[2]=r,e[3]=s,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==s||e[7]!==i?(a=Vh(n)&&d.jsx("button",{type:"button",onClick:()=>s(As),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:i("taskBoard.taskFilters.clearButton")}),e[5]=n,e[6]=s,e[7]=i,e[8]=a):a=e[8];let u;return e[9]!==l||e[10]!==a?(u=d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11],u}function tp(t){const e=P.c(38),{filters:n,members:r,onChange:s}=t,i=de(),[o,l]=w.useState(!1),a=Wh(n),u=a>0;let f;e[0]!==u?(f=Us(u),e[0]=u,e[1]=f):f=e[1];const c=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=d.jsx(vo,{size:14,className:"shrink-0"}),e[2]=h):h=e[2];let p;e[3]!==i?(p=i("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=i,e[4]=p):p=e[4];let m;e[5]!==a?(m=a>0&&d.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:a}),e[5]=a,e[6]=m):m=e[6];let x;e[7]!==p||e[8]!==m||e[9]!==c?(x=d.jsx(Ka,{asChild:!0,children:d.jsxs("button",{type:"button",className:c,children:[h,p,m]})}),e[7]=p,e[8]=m,e[9]=c,e[10]=x):x=e[10];let b;e[11]!==i?(b=i("taskBoard.taskFilters.filterDrawerTitle"),e[11]=i,e[12]=b):b=e[12];let g;e[13]!==b?(g=d.jsx(Va,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=g):g=e[14];let y;e[15]!==n||e[16]!==r||e[17]!==s?(y=d.jsx("div",{className:"flex flex-col gap-2 p-4",children:d.jsx(Cl,{block:!0,filters:n,members:r,onChange:s})}),e[15]=n,e[16]=r,e[17]=s,e[18]=y):y=e[18];let k;e[19]!==a||e[20]!==s||e[21]!==i?(k=a>0&&d.jsx(at,{variant:"outline",className:"flex-1",onClick:()=>s(As),children:i("taskBoard.taskFilters.clearAllButton")}),e[19]=a,e[20]=s,e[21]=i,e[22]=k):k=e[22];let v;e[23]!==i?(v=i("taskBoard.taskFilters.doneButton"),e[23]=i,e[24]=v):v=e[24];let C;e[25]!==v?(C=d.jsx(Wa,{asChild:!0,children:d.jsx(at,{className:"flex-1",children:v})}),e[25]=v,e[26]=C):C=e[26];let T;e[27]!==k||e[28]!==C?(T=d.jsxs(Ga,{className:"flex-row gap-2",children:[k,C]}),e[27]=k,e[28]=C,e[29]=T):T=e[29];let S;e[30]!==T||e[31]!==g||e[32]!==y?(S=d.jsxs(Qa,{className:"p-0",children:[g,y,T]}),e[30]=T,e[31]=g,e[32]=y,e[33]=S):S=e[33];let j;return e[34]!==o||e[35]!==S||e[36]!==x?(j=d.jsxs(Xa,{open:o,onOpenChange:l,direction:"bottom",children:[x,S]}),e[34]=o,e[35]=S,e[36]=x,e[37]=j):j=e[37],j}const np="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",sp=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],Mi={price:"R$ 99",anchor:"R$ 499"};function rp(t){const e=P.c(21),{onOpen:n}=t,r=de();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=d.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-success/10",children:d.jsx(br,{size:16,className:"text-success"})}),e[0]=s):s=e[0];let i;e[1]!==r?(i=r("taskBoard.backlogPaywall.bannerTitle"),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==i?(o=d.jsx("span",{className:"text-sm font-medium text-foreground",children:i}),e[3]=i,e[4]=o):o=e[4];let l;e[5]!==r?(l=r("taskBoard.backlogPaywall.bannerSubtitle"),e[5]=r,e[6]=l):l=e[6];let a;e[7]!==l?(a=d.jsx("span",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=a):a=e[8];let u;e[9]!==o||e[10]!==a?(u=d.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[s,d.jsxs("div",{className:"flex min-w-0 flex-col",children:[o,a]})]}),e[9]=o,e[10]=a,e[11]=u):u=e[11];let f;e[12]!==r?(f=r("taskBoard.backlogPaywall.unlockButton"),e[12]=r,e[13]=f):f=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(ko,{size:16}),e[14]=c):c=e[14];let h;e[15]!==n||e[16]!==f?(h=d.jsxs(at,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:[f,c]}),e[15]=n,e[16]=f,e[17]=h):h=e[17];let p;return e[18]!==u||e[19]!==h?(p=d.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-4 card-shadow sm:flex-row sm:items-center sm:gap-4",children:[u,h]}),e[18]=u,e[19]=h,e[20]=p):p=e[20],p}function ip({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=de(),[i,o]=w.useState(!1),l=async()=>{if(!n){r();return}o(!0);try{const a=await n.callTool({name:"start_checkout",arguments:{}}),{url:u}=sr(a);if(new URL(u).protocol!=="https:")throw new Error("unsafe checkout url");window.open(u,"_blank","noopener,noreferrer"),e(!1)}catch{r()}finally{o(!1)}};return d.jsx(wr,{open:t,onOpenChange:e,children:d.jsxs(kr,{className:"gap-0 p-3 sm:max-w-[500px]",closeButtonClassName:"z-10 rounded-full bg-background/70 p-1 text-foreground backdrop-blur transition-colors hover:bg-background",children:[d.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:d.jsx("img",{src:np,alt:s("taskBoard.backlogPaywall.previewAlt"),className:"h-[208px] w-full object-cover object-left-top"})}),d.jsxs("div",{className:"flex flex-col gap-7 px-3 pb-3 pt-7",children:[d.jsxs("div",{className:"flex flex-col gap-5",children:[d.jsx(yr,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),d.jsx("ul",{className:"flex flex-col gap-3.5",children:sp.map(a=>d.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[d.jsx(vr,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),d.jsx("span",{className:"leading-snug text-foreground",children:s(a)})]},a))})]}),d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-2xl font-semibold text-foreground",children:Mi.price}),d.jsx("span",{className:"text-sm text-muted-foreground line-through",children:Mi.anchor})]}),d.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[d.jsx(at,{variant:"ghost",onClick:()=>e(!1),disabled:i,className:"order-2 w-full sm:order-none sm:w-auto",children:s("taskBoard.backlogPaywall.exploreButton")}),d.jsxs(at,{onClick:l,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?d.jsx(mr,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&d.jsx(ko,{size:16})]})]})]})]})]})})}function er(t){return`board-paywall-seen:${t}`}function op(){const t=P.c(26),{org:e}=Ae(),n=Xi(),{diagnostic:r,cdClient:s,connectionId:i}=Ec();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(er(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[l,a]=w.useState(o);let u;t[2]!==l.open||t[3]!==l.orgId||t[4]!==e.id?(u=l.orgId===e.id?l.open:!sessionStorage.getItem(er(e.id)),t[2]=l.open,t[3]=l.orgId,t[4]=e.id,t[5]=u):u=t[5];const f=u;if(!r?.locked)return null;let c;t[6]!==e.id?(c=v=>a({orgId:e.id,open:v}),t[6]=e.id,t[7]=c):c=t[7];const h=c;let p;t[8]!==e.id||t[9]!==h?(p=v=>{h(v),v||sessionStorage.setItem(er(e.id),"1")},t[8]=e.id,t[9]=h,t[10]=p):p=t[10];const m=p;let x;t[11]!==i||t[12]!==n||t[13]!==e?(x=()=>{ei("board_paywall_report_opened",{organization_id:e.id}),n(Ac(e,i))},t[11]=i,t[12]=n,t[13]=e,t[14]=x):x=t[14];const b=x;let g;t[15]!==e.id||t[16]!==h?(g=d.jsx(rp,{onOpen:()=>{ei("board_paywall_banner_clicked",{organization_id:e.id}),h(!0)}}),t[15]=e.id,t[16]=h,t[17]=g):g=t[17];let y;t[18]!==s||t[19]!==m||t[20]!==f||t[21]!==b?(y=d.jsx(ip,{open:f,onOpenChange:m,cdClient:s,onExpired:b}),t[18]=s,t[19]=m,t[20]=f,t[21]=b,t[22]=y):y=t[22];let k;return t[23]!==g||t[24]!==y?(k=d.jsxs(d.Fragment,{children:[g,y]}),t[23]=g,t[24]=y,t[25]=k):k=t[25],k}function lp(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsx($l,{fallback:null,children:d.jsx(op,{})}),t[0]=e):e=t[0],e}zl(()=>import("./index-CwBzuD_m.js").then(t=>t.bd),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145])).catch(()=>{});function ap(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsx("div",{className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:d.jsx("div",{className:"h-full p-0.5 pt-0.25",children:d.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:d.jsx(El,{})})})}),t[0]=e):e=t[0],e}const cp=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function up(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:cp.format(e),overdue:n}}const os="inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2 py-1 text-xs font-medium text-muted-foreground";function Tl(){const t=P.c(9),e=de();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=ne(os,"border-warning/30 text-warning"),t[0]=n):n=t[0];let r;t[1]!==e?(r=e("taskBoard.taskBoard.blockedBadgeTitle"),t[1]=e,t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=d.jsx(to,{size:14}),t[3]=s):s=t[3];let i;t[4]!==e?(i=e("taskBoard.taskBoard.needsInput"),t[4]=e,t[5]=i):i=t[5];let o;return t[6]!==r||t[7]!==i?(o=d.jsxs("span",{className:n,title:r,children:[s,i]}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function jl(t){const e=P.c(10),{priority:n}=t,r=de(),s=yt[n];let i;e[0]!==s.dotClassName?(i=ne("size-2 rounded-full",s.dotClassName),e[0]=s.dotClassName,e[1]=i):i=e[1];let o;e[2]!==i?(o=d.jsx("span",{className:i}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==s.labelKey||e[5]!==r?(l=r(s.labelKey),e[4]=s.labelKey,e[5]=r,e[6]=l):l=e[6];let a;return e[7]!==o||e[8]!==l?(a=d.jsxs("span",{className:os,children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9],a}function Dl(t){const e=P.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:l,overdue:a}=up(n);r=l,s=ne(os,a&&"border-destructive/30 text-destructive"),e[0]=n,e[1]=r,e[2]=s}else r=e[1],s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(wn,{size:14}),e[3]=i):i=e[3];let o;return e[4]!==r||e[5]!==s?(o=d.jsxs("span",{className:s,children:[i,r]}),e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function Nl(t){const e=P.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=rs(n.color),e[0]=n.color,e[1]=r):r=e[1];let s;e[2]!==r?(s=d.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:r}}),e[2]=r,e[3]=s):s=e[3];let i;return e[4]!==s||e[5]!==n.name?(i=d.jsxs("span",{className:os,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function Rl(t){const e=P.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,l=de(),[a,u]=w.useState(!1);if(n.assigneeId===nt){let y;e[0]!==s||e[1]!==l?(y=s?.user?.name?l("taskBoard.taskBoard.assignedToSuperAgentBy",{name:s.user.name}):l("taskBoard.taskBoard.assignedToSuperAgent"),e[0]=s,e[1]=l,e[2]=y):y=e[2];let k;e[3]!==s?(k=s&&d.jsx(Dt,{url:s.user?.image??void 0,fallback:jt(s.user?.name),shape:"circle",size:"xs",className:"-mr-2 ring-2 ring-background"}),e[3]=s,e[4]=k):k=e[4];let v;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=d.jsx(Ot,{size:20,className:"ring-2 ring-background"}),e[5]=v):v=e[5];let C;return e[6]!==y||e[7]!==k?(C=d.jsxs("span",{className:"inline-flex items-center",title:y,children:[k,v]}),e[6]=y,e[7]=k,e[8]=C):C=e[8],C}if(r){const y=r.user?.image??void 0,k=r.user?.name;let v;e[9]!==k?(v=jt(k),e[9]=k,e[10]=v):v=e[10];let C;return e[11]!==y||e[12]!==v?(C=d.jsx(Dt,{url:y,fallback:v,shape:"circle",size:"xs"}),e[11]=y,e[12]=v,e[13]=C):C=e[13],C}if(!o||!i?.length)return null;let f;e[14]!==l?(f=l("taskBoard.taskBoard.assignButton"),e[14]=l,e[15]=f):f=e[15];let c;e[16]!==l?(c=l("taskBoard.taskBoard.assignButton"),e[16]=l,e[17]=c):c=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=y=>{y.stopPropagation(),u(!0)},e[18]=h):h=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx(Ji,{size:13}),e[19]=p):p=e[19];let m;e[20]!==f||e[21]!==c?(m=d.jsx(kn,{asChild:!0,children:d.jsx("button",{type:"button",title:f,"aria-label":c,onClick:h,className:"flex size-6 shrink-0 items-center justify-center rounded-full border border-dashed border-muted-foreground/40 text-muted-foreground/40 transition-colors hover:border-muted-foreground hover:text-muted-foreground",children:p})}),e[20]=f,e[21]=c,e[22]=m):m=e[22];let x;e[23]!==o?(x=y=>{o(y),u(!1)},e[23]=o,e[24]=x):x=e[24];let b;e[25]!==i||e[26]!==x?(b=d.jsx(Hn,{className:"w-56 p-0",align:"end",side:"bottom",onClick:dp,children:d.jsx(Jr,{members:i,onSelect:x})}),e[25]=i,e[26]=x,e[27]=b):b=e[27];let g;return e[28]!==a||e[29]!==m||e[30]!==b?(g=d.jsxs(qn,{open:a,onOpenChange:u,children:[m,b]}),e[28]=a,e[29]=m,e[30]=b,e[31]=g):g=e[31],g}function dp(t){return t.stopPropagation()}function El(){const t=P.c(123),e=de(),{items:n,isLoading:r}=Nd(),s=Rd(),i=ec();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={slug:"mcp-github"},t[0]=o):o=t[0];const l=aa(o);let a;t[1]!==l?(a=l.some(mp),t[1]=l,t[2]=a):a=t[2];const u=a,[f,c]=w.useState(!1),[h,p]=w.useState(!1);let m;t[3]!==u?(m=$=>$===nt&&!u?(c(!0),!0):!1,t[3]=u,t[4]=m):m=t[4];const x=m,{data:b}=io();let g,y;t[5]!==b?.data?.members?(g=b?.data?.members??[],y=new Map(g.map(gp)),t[5]=b?.data?.members,t[6]=g,t[7]=y):(g=t[6],y=t[7]);const k=y,[v,C]=w.useState("board"),[T,S]=w.useState(As);let j;t[8]===Symbol.for("react.memo_cache_sentinel")?(j=new Set,t[8]=j):j=t[8];const[N,R]=w.useState(j);let D;t[9]===Symbol.for("react.memo_cache_sentinel")?(D=$=>R(ie=>{const ye=new Set(ie);return ye.has($)?ye.delete($):ye.add($),ye}),t[9]=D):D=t[9];const B=D,z=$=>R(ie=>{const ye=new Set(ie);for(const Qe of ae)Qe.status===$&&ye.add(Qe.id);return ye});let M;t[10]===Symbol.for("react.memo_cache_sentinel")?(M=()=>R(new Set),t[10]=M):M=t[10];const L=M,[A,I]=w.useState(!1),[_,q]=w.useState(null),[Z,F]=w.useState(null),{setTaskId:U}=Za(),{create:G}=Ja(),X=Jn(),{org:Y,locator:V}=Ae(),se=Xi();let te;t[11]===Symbol.for("react.memo_cache_sentinel")?(te={strict:!1},t[11]=te):te=t[11];const{task:J}=Ml(te);let O;t[12]!==J||t[13]!==n?(O=J?n.find($=>$.id===J)??null:null,t[12]=J,t[13]=n,t[14]=O):O=t[14];const H=O;let Q;t[15]!==J||t[16]!==se||t[17]!==Y?(Q=()=>{J&&se({to:"/$org/board",params:{org:Y.slug},search:{},replace:!0})},t[15]=J,t[16]=se,t[17]=Y,t[18]=Q):Q=t[18];const re=Q;let E;t[19]!==s||t[20]!==G||t[21]!==V||t[22]!==Y||t[23]!==U||t[24]!==X?(E=async $=>{const ie=crypto.randomUUID(),ye=ta(Y.id).id,Qe=await X.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:$.id}).then(pp).catch(hp),mt=Kh($,Qe),qt={type:"doc",content:[{type:"paragraph",content:[La({id:$.id,name:$.title,char:"@",kind:"task",metadata:{title:$.title,description:$.description,context:mt}}),{type:"text",text:" "}]}]};rc(sessionStorage,V,ie,qt),I(!1);try{await G({id:ie,virtual_mcp_id:ye}),await s.link.mutateAsync({id:$.id,linkThreadId:ie})}catch{}U(ie,ye)},t[19]=s,t[20]=G,t[21]=V,t[22]=Y,t[23]=U,t[24]=X,t[25]=E):E=t[25];const W=E;let ee;t[26]!==T?(ee=$=>Xh($,T),t[26]=T,t[27]=ee):ee=t[27];const ae=n.filter(ee);let me;t[28]===Symbol.for("react.memo_cache_sentinel")?(me=()=>{q(null),F(null),I(!0)},t[28]=me):me=t[28];const Ce=me;let ke;t[29]===Symbol.for("react.memo_cache_sentinel")?(ke=$=>{q(null),F($),I(!0)},t[29]=ke):ke=t[29];const we=ke;let Le;t[30]===Symbol.for("react.memo_cache_sentinel")?(Le=$=>{q($),I(!0)},t[30]=Le):Le=t[30];const kt=Le,xe=_??H,he=A||!!H;let Pe;t[31]!==re?(Pe=()=>{I(!1),q(null),F(null),re()},t[31]=re,t[32]=Pe):Pe=t[32];const pe=Pe;if(r&&n.length===0){let $;return t[33]===Symbol.for("react.memo_cache_sentinel")?($=d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(mr,{size:20,className:"animate-spin text-muted-foreground"})}),t[33]=$):$=t[33],$}const pt="relative flex min-h-0 flex-1 flex-col";let Ve;t[34]!==e?(Ve=e("taskBoard.taskBoard.tasksTitle"),t[34]=e,t[35]=Ve):Ve=t[35];let Ie;t[36]!==Ve?(Ie=d.jsx("h1",{className:"text-xl font-medium text-foreground",children:Ve}),t[36]=Ve,t[37]=Ie):Ie=t[37];let We;t[38]!==i?(We=i&&d.jsx(lp,{}),t[38]=i,t[39]=We):We=t[39];let Ze;t[40]!==T||t[41]!==n.length||t[42]!==g?(Ze=n.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"sm:hidden",children:d.jsx(tp,{filters:T,members:g,onChange:S})}),d.jsx("div",{className:"hidden sm:block",children:d.jsx(ep,{filters:T,members:g,onChange:S})})]}),t[40]=T,t[41]=n.length,t[42]=g,t[43]=Ze):Ze=t[43];const gt=v==="list";let Ue;t[44]!==L?(Ue=()=>{C("list"),L()},t[44]=L,t[45]=Ue):Ue=t[45];let Ge;t[46]!==e?(Ge=e("common.taskBoard.listView"),t[46]=e,t[47]=Ge):Ge=t[47];let Je;t[48]!==gt||t[49]!==Ue||t[50]!==Ge?(Je=d.jsx(zi,{active:gt,onClick:Ue,icon:no,label:Ge}),t[48]=gt,t[49]=Ue,t[50]=Ge,t[51]=Je):Je=t[51];const ct=v==="board";let ut;t[52]===Symbol.for("react.memo_cache_sentinel")?(ut=()=>C("board"),t[52]=ut):ut=t[52];let et;t[53]!==e?(et=e("common.taskBoard.boardView"),t[53]=e,t[54]=et):et=t[54];let tt;t[55]!==ct||t[56]!==et?(tt=d.jsx(zi,{active:ct,onClick:ut,icon:Ql,label:et}),t[55]=ct,t[56]=et,t[57]=tt):tt=t[57];let ce;t[58]!==Je||t[59]!==tt?(ce=d.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[Je,tt]}),t[58]=Je,t[59]=tt,t[60]=ce):ce=t[60];let ve;t[61]===Symbol.for("react.memo_cache_sentinel")?(ve=d.jsx(Gn,{size:16}),t[61]=ve):ve=t[61];let ge;t[62]!==e?(ge=e("taskBoard.taskBoard.newTask"),t[62]=e,t[63]=ge):ge=t[63];let Ne;t[64]!==ge?(Ne=d.jsxs(at,{size:"sm",onClick:Ce,children:[ve,ge]}),t[64]=ge,t[65]=Ne):Ne=t[65];let be;t[66]!==ce||t[67]!==Ne?(be=d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[ce,Ne]}),t[66]=ce,t[67]=Ne,t[68]=be):be=t[68];let Te;t[69]!==Ze||t[70]!==be?(Te=d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ze,be]}),t[69]=Ze,t[70]=be,t[71]=Te):Te=t[71];let je;t[72]!==Ie||t[73]!==We||t[74]!==Te?(je=d.jsxs("div",{className:"mx-auto flex w-full max-w-[1680px] flex-col gap-4 px-4 pt-6 sm:px-8 sm:pt-8",children:[Ie,We,Te]}),t[72]=Ie,t[73]=We,t[74]=Te,t[75]=je):je=t[75];const He=n.length===0?d.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:d.jsx("div",{className:"rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:e("taskBoard.taskBoard.noTasksYet")})}):ae.length===0?d.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:d.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:[e("taskBoard.taskBoard.noTasksMatch"),d.jsx(at,{variant:"outline",size:"sm",onClick:()=>S(As),children:e("taskBoard.taskBoard.clearFilters")})]})}):v==="board"?d.jsx(yp,{items:ae,members:g,memberByUserId:k,selectedIds:N,onToggleSelect:B,onSelectAllInLane:z,onOpen:kt,onCreate:we,onMove:($,ie,ye)=>{const Qe=Zo(ye,$.length);$.forEach((mt,qt)=>s.update.mutate({id:mt,status:ie,sortOrder:Qe[qt]}))},onAssign:($,ie)=>{x(ie)||s.update.mutate({id:$,assigneeId:ie})},onAutoFix:i?$=>{x(nt)||s.update.mutate({id:$.id,assigneeId:nt})}:void 0}):d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-6 pb-16 sm:px-8",children:d.jsx("div",{className:"mx-auto flex max-w-[820px] flex-col gap-2",children:ae.map($=>d.jsx(Np,{item:$,assignee:$.assigneeId?k.get($.assigneeId):void 0,assignedBy:$.assignedBy?k.get($.assignedBy):void 0,onOpen:()=>kt($)},$.id))})}),fe=he?xe?.id??`new-${Z??"default"}`:"closed",Oe=xe??void 0,Ee=Z??void 0,qe=s.create.isPending||s.update.isPending;let Be;t[76]!==s.create||t[77]!==s.update||t[78]!==xe||t[79]!==x||t[80]!==pe?(Be=$=>{if(x($.assigneeId)){pe();return}xe?s.update.mutate({id:xe.id,...$}):s.create.mutate($),pe()},t[76]=s.create,t[77]=s.update,t[78]=xe,t[79]=x,t[80]=pe,t[81]=Be):Be=t[81];let $e;t[82]!==s.remove||t[83]!==xe||t[84]!==pe?($e=xe?()=>{s.remove.mutate(xe.id),pe()}:void 0,t[82]=s.remove,t[83]=xe,t[84]=pe,t[85]=$e):$e=t[85];let Re;t[86]!==xe||t[87]!==W?(Re=xe?()=>{W(xe)}:void 0,t[86]=xe,t[87]=W,t[88]=Re):Re=t[88];let Me;t[89]!==pe||t[90]!==U?(Me=$=>{$.virtualMcpId&&(pe(),U($.threadId,$.virtualMcpId,{main:$.hasPreview?"preview":"board"}))},t[89]=pe,t[90]=U,t[91]=Me):Me=t[91];let Ke;t[92]!==pe||t[93]!==he||t[94]!==fe||t[95]!==Oe||t[96]!==Ee||t[97]!==qe||t[98]!==Be||t[99]!==$e||t[100]!==Re||t[101]!==Me?(Ke=d.jsx(Ch,{open:he,onClose:pe,item:Oe,defaultStatus:Ee,isSaving:qe,onSubmit:Be,onDelete:$e,onNewChat:Re,onOpenThread:Me},fe),t[92]=pe,t[93]=he,t[94]=fe,t[95]=Oe,t[96]=Ee,t[97]=qe,t[98]=Be,t[99]=$e,t[100]=Re,t[101]=Me,t[102]=Ke):Ke=t[102];let wt;t[103]===Symbol.for("react.memo_cache_sentinel")?(wt=()=>p(!0),t[103]=wt):wt=t[103];let Et;t[104]!==f?(Et=d.jsx(xp,{open:f,onOpenChange:c,onConnected:wt}),t[104]=f,t[105]=Et):Et=t[105];let dt;t[106]!==h?(dt=d.jsx(sa,{mode:"connection",open:h,onOpenChange:p}),t[106]=h,t[107]=dt):dt=t[107];let ft;t[108]!==s.remove||t[109]!==s.update||t[110]!==x||t[111]!==L||t[112]!==n||t[113]!==g||t[114]!==N?(ft=N.size>0&&d.jsx(bp,{count:N.size,members:g,onMoveTo:$=>{for(const ie of N)s.update.mutate({id:ie,status:$});L()},onSetPriority:$=>{for(const ie of N)s.update.mutate({id:ie,priority:$});L()},onAddTag:$=>{for(const ie of N){const ye=n.find(mt=>mt.id===ie);if(!ye)continue;const Qe=ye.tags.map(fp);Qe.includes($)||s.update.mutate({id:ie,tagIds:[...Qe,$]})}L()},onAssign:$=>{if(!x($)){for(const ie of N)s.update.mutate({id:ie,assigneeId:$});L()}},onSetDueDate:$=>{const ie=vl($);for(const ye of N)s.update.mutate({id:ye,dueDate:ie});L()},onAutoFix:N.size>0&&Array.from(N).every($=>{const ie=n.find(ye=>ye.id===$);return ie&&(ie.status==="triage"||ie.status==="todo")&&ie.assigneeId!==nt})?()=>{if(!x(nt)){for(const $ of N)s.update.mutate({id:$,assigneeId:nt});L()}}:void 0,onDelete:()=>{for(const $ of N)s.remove.mutate($);L()},onClear:L}),t[108]=s.remove,t[109]=s.update,t[110]=x,t[111]=L,t[112]=n,t[113]=g,t[114]=N,t[115]=ft):ft=t[115];let vt;return t[116]!==je||t[117]!==He||t[118]!==Ke||t[119]!==Et||t[120]!==dt||t[121]!==ft?(vt=d.jsxs("div",{className:pt,children:[je,He,Ke,Et,dt,ft]}),t[116]=je,t[117]=He,t[118]=Ke,t[119]=Et,t[120]=dt,t[121]=ft,t[122]=vt):vt=t[122],vt}function fp(t){return t.id}function hp(){return[]}function pp(t){return t.prs}function gp(t){return[t.userId,t]}function mp(t){return ca(t)!==null&&ua(t)}function xp(t){const e=P.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=de(),{connect:o,isConnecting:l}=ad("deco/mcp-github");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx("div",{className:"flex h-28 items-center justify-center bg-gradient-to-br from-muted via-muted to-accent",children:d.jsx("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-foreground text-background shadow-sm",children:d.jsx(tr,{className:"size-7"})})}),e[0]=a):a=e[0];let u;e[1]!==i?(u=i("taskBoard.taskBoard.connectGithubTitle"),e[1]=i,e[2]=u):u=e[2];let f;e[3]!==u?(f=d.jsx(yr,{children:u}),e[3]=u,e[4]=f):f=e[4];let c;e[5]!==i?(c=i("taskBoard.taskBoard.connectGithubDescription"),e[5]=i,e[6]=c):c=e[6];let h;e[7]!==c?(h=d.jsx(ra,{children:c}),e[7]=c,e[8]=h):h=e[8];let p;e[9]!==f||e[10]!==h?(p=d.jsxs(ia,{children:[f,h]}),e[9]=f,e[10]=h,e[11]=p):p=e[11];let m;e[12]!==o||e[13]!==s||e[14]!==r?(m=async()=>{await o(),r(!1),s()},e[12]=o,e[13]=s,e[14]=r,e[15]=m):m=e[15];let x;e[16]!==l?(x=l?d.jsx(mr,{size:16,className:"animate-spin"}):d.jsx(tr,{className:"size-4"}),e[16]=l,e[17]=x):x=e[17];let b;e[18]!==i?(b=i("taskBoard.taskBoard.connectGithubButton"),e[18]=i,e[19]=b):b=e[19];let g;e[20]!==l||e[21]!==m||e[22]!==x||e[23]!==b?(g=d.jsx(oa,{children:d.jsxs(at,{onClick:m,disabled:l,className:"gap-2",children:[x,b]})}),e[20]=l,e[21]=m,e[22]=x,e[23]=b,e[24]=g):g=e[24];let y;e[25]!==g||e[26]!==p?(y=d.jsxs(kr,{className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[a,d.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[p,g]})]}),e[25]=g,e[26]=p,e[27]=y):y=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==y?(k=d.jsx(wr,{open:n,onOpenChange:r,children:y}),e[28]=r,e[29]=n,e[30]=y,e[31]=k):k=e[31],k}function bp(t){const e=P.c(91),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:l,onSetDueDate:a,onAutoFix:u,onDelete:f,onClear:c}=t,h=de(),{data:p}=ao();let m;e[0]!==p?(m=p===void 0?[]:p,e[0]=p,e[1]=m):m=e[1];const x=m;let b;e[2]!==n||e[3]!==h?(b=h("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=h,e[4]=b):b=e[4];let g;e[5]!==b?(g=d.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:b}),e[5]=b,e[6]=g):g=e[6];let y;e[7]!==h?(y=h("taskBoard.taskBoard.actionsButton"),e[7]=h,e[8]=y):y=e[8];let k;e[9]!==y?(k=d.jsx(Cn,{asChild:!0,children:d.jsx("button",{type:"button",className:"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:y})}),e[9]=y,e[10]=k):k=e[10];let v;e[11]!==h?(v=h("taskBoard.taskBoard.moveToButton"),e[11]=h,e[12]=v):v=e[12];let C;e[13]!==v?(C=d.jsx(On,{children:v}),e[13]=v,e[14]=C):C=e[14];let T;e[15]!==s||e[16]!==h?(T=Ds.map(E=>d.jsx(Tt,{onClick:()=>s(E),children:h(bt[E].labelKey)},E)),e[15]=s,e[16]=h,e[17]=T):T=e[17];let S;e[18]!==T?(S=d.jsx(Bn,{children:T}),e[18]=T,e[19]=S):S=e[19];let j;e[20]!==S||e[21]!==C?(j=d.jsxs(_n,{children:[C,S]}),e[20]=S,e[21]=C,e[22]=j):j=e[22];let N;e[23]!==h?(N=h("taskBoard.taskBoard.changePriorityButton"),e[23]=h,e[24]=N):N=e[24];let R;e[25]!==N?(R=d.jsx(On,{children:N}),e[25]=N,e[26]=R):R=e[26];let D;e[27]!==i||e[28]!==h?(D=Pr.map(E=>d.jsxs(Tt,{onClick:()=>i(E),children:[d.jsx("span",{className:ne("size-2 rounded-full",yt[E].dotClassName)}),h(yt[E].labelKey)]},E)),e[27]=i,e[28]=h,e[29]=D):D=e[29];let B;e[30]!==D?(B=d.jsx(Bn,{children:D}),e[30]=D,e[31]=B):B=e[31];let z;e[32]!==R||e[33]!==B?(z=d.jsxs(_n,{children:[R,B]}),e[32]=R,e[33]=B,e[34]=z):z=e[34];let M;e[35]!==h?(M=h("taskBoard.taskBoard.assignButton"),e[35]=h,e[36]=M):M=e[36];let L;e[37]!==M?(L=d.jsx(On,{children:M}),e[37]=M,e[38]=L):L=e[38];let A;e[39]!==r||e[40]!==l?(A=d.jsx(Bn,{className:"w-56 p-0",children:d.jsx(Jr,{members:r,onSelect:l})}),e[39]=r,e[40]=l,e[41]=A):A=e[41];let I;e[42]!==L||e[43]!==A?(I=d.jsxs(_n,{children:[L,A]}),e[42]=L,e[43]=A,e[44]=I):I=e[44];let _;e[45]!==h?(_=h("taskBoard.taskBoard.dueDateButton"),e[45]=h,e[46]=_):_=e[46];let q;e[47]!==_?(q=d.jsx(On,{children:_}),e[47]=_,e[48]=q):q=e[48];let Z;e[49]!==a?(Z=d.jsx(Bn,{className:"w-auto p-0",children:d.jsx(xo,{mode:"single",onSelect:E=>E&&a(E),initialFocus:!0})}),e[49]=a,e[50]=Z):Z=e[50];let F;e[51]!==q||e[52]!==Z?(F=d.jsxs(_n,{children:[q,Z]}),e[51]=q,e[52]=Z,e[53]=F):F=e[53];let U;e[54]!==o||e[55]!==x||e[56]!==h?(U=x.length>0&&d.jsxs(_n,{children:[d.jsx(On,{children:h("taskBoard.taskBoard.addTagButton")}),d.jsx(Bn,{children:x.map(E=>d.jsxs(Tt,{onClick:()=>o(E.id),children:[d.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:rs(E.color)}}),E.name]},E.id))})]}),e[54]=o,e[55]=x,e[56]=h,e[57]=U):U=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G=d.jsx(Xl,{}),e[58]=G):G=e[58];let X;e[59]!==h?(X=h("taskBoard.taskBoard.deleteSelectedButton"),e[59]=h,e[60]=X):X=e[60];let Y;e[61]!==f||e[62]!==X?(Y=d.jsx(Tt,{variant:"destructive",onClick:f,children:X}),e[61]=f,e[62]=X,e[63]=Y):Y=e[63];let V;e[64]!==j||e[65]!==z||e[66]!==I||e[67]!==F||e[68]!==U||e[69]!==Y?(V=d.jsxs(Tn,{align:"center",side:"top",children:[j,z,I,F,U,G,Y]}),e[64]=j,e[65]=z,e[66]=I,e[67]=F,e[68]=U,e[69]=Y,e[70]=V):V=e[70];let se;e[71]!==V||e[72]!==k?(se=d.jsxs(jn,{children:[k,V]}),e[71]=V,e[72]=k,e[73]=se):se=e[73];let te;e[74]!==u||e[75]!==h?(te=u&&d.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:[d.jsx(br,{size:14}),h("taskBoard.taskBoard.autoFix")]}),e[74]=u,e[75]=h,e[76]=te):te=e[76];let J;e[77]!==h?(J=h("taskBoard.taskBoard.clearSelectionButton"),e[77]=h,e[78]=J):J=e[78];let O;e[79]!==h?(O=h("taskBoard.taskBoard.clearSelectionButton"),e[79]=h,e[80]=O):O=e[80];let H;e[81]===Symbol.for("react.memo_cache_sentinel")?(H=d.jsx(vn,{size:16}),e[81]=H):H=e[81];let Q;e[82]!==c||e[83]!==J||e[84]!==O?(Q=d.jsx("button",{type:"button","aria-label":J,title:O,onClick:c,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:H}),e[82]=c,e[83]=J,e[84]=O,e[85]=Q):Q=e[85];let re;return e[86]!==se||e[87]!==te||e[88]!==Q||e[89]!==g?(re=d.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 z-20 flex justify-center",children:d.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 rounded-full bg-background px-3 py-2 card-shadow",children:[g,se,te,Q]})}),e[86]=se,e[87]=te,e[88]=Q,e[89]=g,e[90]=re):re=e[90],re}function zi(t){const e=P.c(14),{active:n,onClick:r,icon:s,label:i}=t,o=de();let l;e[0]!==i||e[1]!==o?(l=o("taskBoard.taskBoard.layoutViewAriaLabel",{label:i}),e[0]=i,e[1]=o,e[2]=l):l=e[2];const a=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let u;e[3]!==a?(u=ne("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",a),e[3]=a,e[4]=u):u=e[4];let f;e[5]!==s?(f=d.jsx(s,{size:14}),e[5]=s,e[6]=f):f=e[6];let c;return e[7]!==n||e[8]!==i||e[9]!==r||e[10]!==l||e[11]!==u||e[12]!==f?(c=d.jsxs("button",{type:"button",onClick:r,"aria-label":l,"aria-pressed":n,className:u,children:[f,i]}),e[7]=n,e[8]=i,e[9]=r,e[10]=l,e[11]=u,e[12]=f,e[13]=c):c=e[13],c}const Un="lane:";function Li(t,e){return t.sortOrder-e.sortOrder}function yp(t){const e=P.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:u,onMove:f,onAutoFix:c,onAssign:h}=t,[p,m]=w.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[b,g]=w.useState(x);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=new Map,e[1]=y):y=e[1];const[k,v]=w.useState(y),C=w.useRef(null),T=k.size>0?n.map(E=>{const W=k.get(E.id);return W?{...E,...W}:E}):n;if(k.size>0&&!p){const E=[...k].filter(W=>{const[ee,ae]=W,me=n.find(Ce=>Ce.id===ee);return me?.status===ae.status&&me.sortOrder===ae.sortOrder});E.length>0&&v(W=>{const ee=new Map(W);for(const[ae]of E)ee.delete(ae);return ee})}qh(C,T.map(Sp).join(","),p===null);const S=E=>T.filter(W=>W.status===E).sort(Li),j=E=>{if(E===void 0)return null;const W=String(E);if(W.startsWith(Un)){const ee=W.slice(Un.length);return Ds.find(ae=>ae===ee)??null}return T.find(ee=>ee.id===W)?.status??null};let N;e[2]!==i?(N=E=>i.has(E)&&i.size>1?[E,...Array.from(i).filter(W=>W!==E)]:[E],e[2]=i,e[3]=N):N=e[3];const R=N;let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D=(E,W,ee)=>{const ae=Zo(ee,E.length);v(me=>{const Ce=new Map(me);return E.forEach((ke,we)=>Ce.set(ke,{status:W,sortOrder:ae[we]})),Ce})},e[4]=D):D=e[4];const B=D;let z;e[5]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:4}},e[5]=z):z=e[5];let M;e[6]===Symbol.for("react.memo_cache_sentinel")?(M={coordinateGetter:Td},e[6]=M):M=e[6];const L=Wc(si($r,z),si(Or,M)),A=E=>{const W=String(E.active.id),ee=j(E.over?.id),ae=T.find(we=>we.id===W);if(!ee||!ae||ae.status===ee)return;const me=R(W),Ce=String(E.over?.id??""),ke=S(ee).filter(we=>!me.includes(we.id));B(me,ee,bi(ke,Ce.startsWith(Un)?null:Ce,W))},I=E=>{const W=String(E.active.id);m(null);const ee=j(E.over?.id)??T.find(he=>he.id===W)?.status;if(!ee){v(new Map);return}const ae=R(W),me=S(ee),Ce=String(E.over?.id??""),ke=me.findIndex(he=>he.id===W),we=Ce.startsWith(Un)?me.length-1:me.findIndex(he=>he.id===Ce),Le=ke===-1||we===-1?me:zr(me,ke,we);if(n.filter(he=>he.status===ee).sort(Li).map(vp).join()===Le.map(wp).join()){v(new Map);return}const kt=Le.slice(Le.findIndex(he=>he.id===W)+1).find(he=>!ae.includes(he.id)),xe=bi(me.filter(he=>!ae.includes(he.id)),kt?.id??null,W);B(ae,ee,xe),g(ae),f(ae,ee,xe)},_=p?T.find(E=>E.id===p):null;let q;e[7]!==p||e[8]!==R?(q=p?R(p):[],e[7]=p,e[8]=R,e[9]=q):q=e[9];const Z=q,F=Hu,U=Ro;let G;e[10]===Symbol.for("react.memo_cache_sentinel")?(G=E=>{m(String(E.active.id)),g([])},e[10]=G):G=e[10];let X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{m(null),v(new Map)},e[11]=X):X=e[11];const Y=Ds.map(E=>d.jsx(Cp,{status:E,items:S(E),members:r,memberByUserId:s,selectedIds:i,isTarget:_?.status===E,hiddenIds:Z,landedIds:b,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:u,onAutoFix:c,onAssign:h},E));let V;e[12]!==Y?(V=d.jsx("div",{ref:C,className:"min-h-0 flex-1 overflow-x-auto",children:d.jsx("div",{className:"mx-auto flex h-full w-full max-w-[1680px] gap-3 px-4 pt-6 sm:px-8",children:Y})}),e[12]=Y,e[13]=V):V=e[13];const se=Ft.createPortal,te=ld,J=null,O=_&&d.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[d.jsx(Il,{item:_,assignee:_.assigneeId?s.get(_.assigneeId):void 0,assignedBy:_.assignedBy?s.get(_.assignedBy):void 0,selected:i.has(_.id),onOpen:kp,className:"w-full shadow-lg"}),Z.length>1&&d.jsx("span",{className:"absolute -top-2 -right-2 flex h-5 min-w-5 items-center justify-center rounded-full bg-foreground px-1.5 text-[11px] font-semibold text-background",children:Z.length})]});let H;e[14]!==te||e[15]!==O?(H=d.jsx(te,{dropAnimation:J,children:O}),e[14]=te,e[15]=O,e[16]=H):H=e[16];let Q;e[17]!==se||e[18]!==H?(Q=se(H,document.body),e[17]=se,e[18]=H,e[19]=Q):Q=e[19];let re;return e[20]!==F||e[21]!==I||e[22]!==A||e[23]!==L||e[24]!==X||e[25]!==V||e[26]!==Q||e[27]!==U||e[28]!==G?(re=d.jsxs(F,{sensors:L,collisionDetection:U,onDragStart:G,onDragOver:A,onDragEnd:I,onDragCancel:X,children:[V,Q]}),e[20]=F,e[21]=I,e[22]=A,e[23]=L,e[24]=X,e[25]=V,e[26]=Q,e[27]=U,e[28]=G,e[29]=re):re=e[29],re}function kp(){}function wp(t){return t.id}function vp(t){return t.id}function Sp(t){return`${t.id}:${t.status}`}function Cp(t){const e=P.c(91),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:l,hiddenIds:a,landedIds:u,onToggleSelect:f,onSelectAllInLane:c,onOpen:h,onCreate:p,onAutoFix:m,onAssign:x}=t,b=de(),g=bt[n],y=g.icon,k=`${Un}${n}`;let v;e[0]!==k?(v={id:k},e[0]=k,e[1]=v):v=e[1];const{setNodeRef:C}=Vo(v),T=l&&"bg-muted/50";let S;e[2]!==T?(S=ne("flex h-full w-[300px] shrink-0 flex-col rounded-xl py-1 transition-colors",T),e[2]=T,e[3]=S):S=e[3];const j=l?"bg-muted":"bg-background";let N;e[4]!==j?(N=ne("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",j),e[4]=j,e[5]=N):N=e[5];let R;e[6]!==g.iconClassName?(R=ne("shrink-0",g.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=g.iconClassName,e[7]=R):R=e[7];let D;e[8]!==y||e[9]!==R?(D=d.jsx(y,{size:15,className:R}),e[8]=y,e[9]=R,e[10]=D):D=e[10];let B;e[11]!==g.labelKey||e[12]!==b?(B=b(g.labelKey),e[11]=g.labelKey,e[12]=b,e[13]=B):B=e[13];let z;e[14]!==B?(z=d.jsx("span",{className:"text-sm font-medium text-foreground",children:B}),e[14]=B,e[15]=z):z=e[15];let M;e[16]!==r.length?(M=d.jsx("span",{className:"rounded-md bg-muted px-1.5 text-[11px] font-medium text-muted-foreground",children:r.length}),e[16]=r.length,e[17]=M):M=e[17];let L;e[18]!==g.labelKey||e[19]!==b?(L=b("taskBoard.taskBoard.laneMenuAriaLabel",{lane:b(g.labelKey)}),e[18]=g.labelKey,e[19]=b,e[20]=L):L=e[20];let A;e[21]===Symbol.for("react.memo_cache_sentinel")?(A=d.jsx(Zi,{size:15}),e[21]=A):A=e[21];let I;e[22]!==L?(I=d.jsx(Cn,{asChild:!0,children:d.jsx("button",{type:"button","aria-label":L,className:"ml-auto flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:A})}),e[22]=L,e[23]=I):I=e[23];let _;e[24]!==c||e[25]!==n?(_=()=>c(n),e[24]=c,e[25]=n,e[26]=_):_=e[26];let q;e[27]!==b?(q=b("taskBoard.taskBoard.selectAllInLane"),e[27]=b,e[28]=q):q=e[28];let Z;e[29]!==_||e[30]!==q?(Z=d.jsx(Tn,{align:"end",children:d.jsx(Tt,{onClick:_,children:q})}),e[29]=_,e[30]=q,e[31]=Z):Z=e[31];let F;e[32]!==I||e[33]!==Z?(F=d.jsxs(jn,{children:[I,Z]}),e[32]=I,e[33]=Z,e[34]=F):F=e[34];let U;e[35]!==g.labelKey||e[36]!==b?(U=b("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:b(g.labelKey)}),e[35]=g.labelKey,e[36]=b,e[37]=U):U=e[37];let G;e[38]!==g.labelKey||e[39]!==b?(G=b("taskBoard.taskBoard.newTaskInLaneTitle",{lane:b(g.labelKey)}),e[38]=g.labelKey,e[39]=b,e[40]=G):G=e[40];let X;e[41]!==p||e[42]!==n?(X=()=>p(n),e[41]=p,e[42]=n,e[43]=X):X=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=d.jsx(Gn,{size:15}),e[44]=Y):Y=e[44];let V;e[45]!==U||e[46]!==G||e[47]!==X?(V=d.jsx("button",{type:"button","aria-label":U,title:G,onClick:X,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:Y}),e[45]=U,e[46]=G,e[47]=X,e[48]=V):V=e[48];let se;e[49]!==z||e[50]!==M||e[51]!==F||e[52]!==V||e[53]!==N||e[54]!==D?(se=d.jsxs("div",{className:N,children:[D,z,M,F,V]}),e[49]=z,e[50]=M,e[51]=F,e[52]=V,e[53]=N,e[54]=D,e[55]=se):se=e[55];let te;e[56]!==r?(te=r.map(Tp),e[56]=r,e[57]=te):te=e[57];let J;if(e[58]!==a||e[59]!==r||e[60]!==u||e[61]!==i||e[62]!==s||e[63]!==x||e[64]!==m||e[65]!==h||e[66]!==f||e[67]!==o){let re;e[69]!==a||e[70]!==u||e[71]!==i||e[72]!==s||e[73]!==x||e[74]!==m||e[75]!==h||e[76]!==f||e[77]!==o?(re=E=>d.jsx(jp,{item:E,assignee:E.assigneeId?i.get(E.assigneeId):void 0,assignedBy:E.assignedBy?i.get(E.assignedBy):void 0,members:s,selected:o.has(E.id),hidden:a.includes(E.id),landed:u.includes(E.id),onToggleSelect:()=>f(E.id),onOpen:()=>h(E),onAutoFix:m?()=>m(E):void 0,onAssign:x?W=>x(E.id,W):void 0},E.id),e[69]=a,e[70]=u,e[71]=i,e[72]=s,e[73]=x,e[74]=m,e[75]=h,e[76]=f,e[77]=o,e[78]=re):re=e[78],J=r.map(re),e[58]=a,e[59]=r,e[60]=u,e[61]=i,e[62]=s,e[63]=x,e[64]=m,e[65]=h,e[66]=f,e[67]=o,e[68]=J}else J=e[68];let O;e[79]!==te||e[80]!==J?(O=d.jsx(gd,{items:te,strategy:hd,children:J}),e[79]=te,e[80]=J,e[81]=O):O=e[81];let H;e[82]!==C||e[83]!==n||e[84]!==O?(H=d.jsx("div",{ref:C,"data-lane-scroll":n,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-1 pt-1 pb-16 [scrollbar-width:thin] [&::-webkit-scrollbar]:w-1",children:O}),e[82]=C,e[83]=n,e[84]=O,e[85]=H):H=e[85];let Q;return e[86]!==n||e[87]!==se||e[88]!==H||e[89]!==S?(Q=d.jsxs("div",{"data-lane":n,className:S,children:[se,H]}),e[86]=n,e[87]=se,e[88]=H,e[89]=S,e[90]=Q):Q=e[90],Q}function Tp(t){return t.id}function jp(t){const e=P.c(29);let n,r,s,i;e[0]!==t?({item:r,hidden:n,landed:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=s,e[4]=i):(n=e[1],r=e[2],s=e[3],i=e[4]);let o;e[5]!==r.id?(o={id:r.id},e[5]=r.id,e[6]=o):o=e[6];const{attributes:l,listeners:a,setNodeRef:u,transform:f,transition:c,isDragging:h}=vd(o),p=r.id,m=r.status;let x;e[7]!==l||e[8]!==a?(x={attributes:l,listeners:a},e[7]=l,e[8]=a,e[9]=x):x=e[9];const b=s&&"animate-card-land";let g;e[10]!==b?(g=ne("w-full",b),e[10]=b,e[11]=g):g=e[11];let y;e[12]!==f?(y=Ht.Translate.toString(f),e[12]=f,e[13]=y):y=e[13];const k=h||n?0:void 0;let v;e[14]!==y||e[15]!==k||e[16]!==c?(v={transform:y,transition:c,opacity:k},e[14]=y,e[15]=k,e[16]=c,e[17]=v):v=e[17];let C;e[18]!==r||e[19]!==i||e[20]!==u||e[21]!==x||e[22]!==g||e[23]!==v?(C=d.jsx(Il,{...i,item:r,dragRef:u,bindings:x,className:g,style:v}),e[18]=r,e[19]=i,e[20]=u,e[21]=x,e[22]=g,e[23]=v,e[24]=C):C=e[24];let T;return e[25]!==r.id||e[26]!==r.status||e[27]!==C?(T=d.jsx("div",{className:"flex","data-flip-id":p,"data-flip-lane":m,children:C}),e[25]=r.id,e[26]=r.status,e[27]=C,e[28]=T):T=e[28],T}function Il(t){const e=P.c(43),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:l,dragRef:a,bindings:u,style:f,onToggleSelect:c,onOpen:h,onAutoFix:p,onAssign:m}=t,x=de(),b=bt[n.status].icon,g=Ed(n)?.lastMessage,y=p&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==nt,k=u?.attributes,v=u?.listeners;let C;e[0]!==h||e[1]!==c?(C=_=>{_.shiftKey&&c?c():h()},e[0]=h,e[1]=c,e[2]=C):C=e[2];const T=o&&"bg-accent";let S;e[3]!==l||e[4]!==T?(S=ne("group flex shrink-0 cursor-grab flex-col gap-2 rounded-xl bg-card px-3 py-2.5 text-left card-shadow hover:bg-accent/60 active:cursor-grabbing",T,l),e[3]=l,e[4]=T,e[5]=S):S=e[5];const j=n.title;let N;e[6]!==n?(N=ne("mt-px shrink-0",Lr(n)),e[6]=n,e[7]=N):N=e[7];let R;e[8]!==b||e[9]!==N?(R=d.jsx(b,{size:16,className:N}),e[8]=b,e[9]=N,e[10]=R):R=e[10];let D;e[11]!==n.title?(D=d.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium leading-snug text-foreground line-clamp-2",children:n.title}),e[11]=n.title,e[12]=D):D=e[12];let B;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==m?(B=d.jsx(Rl,{item:n,assignee:r,assignedBy:s,members:i,onAssign:m}),e[13]=s,e[14]=r,e[15]=n,e[16]=i,e[17]=m,e[18]=B):B=e[18];let z;e[19]!==B||e[20]!==R||e[21]!==D?(z=d.jsxs("div",{className:"flex items-start gap-2",children:[R,D,B]}),e[19]=B,e[20]=R,e[21]=D,e[22]=z):z=e[22];let M;e[23]!==g?(M=g&&d.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:g}),e[23]=g,e[24]=M):M=e[24];let L;e[25]!==n?(L=(js(n)||n.priority!=="none"||!!n.dueDate||n.tags.length>0)&&d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[js(n)&&d.jsx(Tl,{}),n.priority!=="none"&&d.jsx(jl,{priority:n.priority}),n.dueDate&&d.jsx(Dl,{iso:n.dueDate}),n.tags.map(Dp)]}),e[25]=n,e[26]=L):L=e[26];let A;e[27]!==p||e[28]!==y||e[29]!==x?(A=y&&d.jsxs("button",{type:"button",onClick:_=>{_.stopPropagation(),p()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-accent",children:[d.jsx(br,{size:12}),x("taskBoard.taskBoard.autoFix")]}),e[27]=p,e[28]=y,e[29]=x,e[30]=A):A=e[30];let I;return e[31]!==a||e[32]!==n.title||e[33]!==f||e[34]!==k||e[35]!==z||e[36]!==M||e[37]!==L||e[38]!==A||e[39]!==v||e[40]!==C||e[41]!==S?(I=d.jsxs("button",{type:"button",ref:a,style:f,...k,...v,onClick:C,className:S,title:j,children:[z,M,L,A]}),e[31]=a,e[32]=n.title,e[33]=f,e[34]=k,e[35]=z,e[36]=M,e[37]=L,e[38]=A,e[39]=v,e[40]=C,e[41]=S,e[42]=I):I=e[42],I}function Dp(t){return d.jsx(Nl,{tag:t},t.id)}function Np(t){const e=P.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=bt[n.status].icon;let l;e[0]!==n?(l=ne("shrink-0",Lr(n)),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==o||e[3]!==l?(a=d.jsx(o,{size:16,className:l}),e[2]=o,e[3]=l,e[4]=a):a=e[4];let u;e[5]!==n.title?(u=d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:n.title}),e[5]=n.title,e[6]=u):u=e[6];let f;e[7]!==n?(f=js(n)&&d.jsx(Tl,{}),e[7]=n,e[8]=f):f=e[8];let c;e[9]!==n.priority?(c=n.priority!=="none"&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(jl,{priority:n.priority})}),e[9]=n.priority,e[10]=c):c=e[10];let h;e[11]!==n.dueDate?(h=n.dueDate&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(Dl,{iso:n.dueDate})}),e[11]=n.dueDate,e[12]=h):h=e[12];let p;e[13]!==n.tags?(p=n.tags.length>0&&d.jsxs("span",{className:"hidden items-center gap-1.5 sm:inline-flex",children:[n.tags.slice(0,2).map(Rp),n.tags.length>2&&d.jsxs("span",{className:os,children:["+",n.tags.length-2]})]}),e[13]=n.tags,e[14]=p):p=e[14];let m;e[15]!==s||e[16]!==r||e[17]!==n?(m=d.jsx(Rl,{item:n,assignee:r,assignedBy:s}),e[15]=s,e[16]=r,e[17]=n,e[18]=m):m=e[18];let x;e[19]!==n.createdAt?(x=oo(new Date(n.createdAt)),e[19]=n.createdAt,e[20]=x):x=e[20];let b;e[21]!==x?(b=d.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:x}),e[21]=x,e[22]=b):b=e[22];let g;return e[23]!==i||e[24]!==b||e[25]!==a||e[26]!==u||e[27]!==f||e[28]!==c||e[29]!==h||e[30]!==p||e[31]!==m?(g=d.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-accent/60",children:[a,u,f,c,h,p,m,b]}),e[23]=i,e[24]=b,e[25]=a,e[26]=u,e[27]=f,e[28]=c,e[29]=h,e[30]=p,e[31]=m,e[32]=g):g=e[32],g}function Rp(t){return d.jsx(Nl,{tag:t},t.id)}const Ug=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:El,default:ap},Symbol.toStringTag,{value:"Module"}));export{Ug as $,Td as A,zr as B,Ht as C,Hu as D,Nd as E,Rd as F,bt as G,vg as H,yt as I,Ot as J,Or as K,ot as L,zg as M,Dg as N,Lg as O,$r as P,Rg as Q,Fg as R,fc as S,Ch as T,Cc as U,Ng as V,Ag as W,$g as X,Eg as Y,El as Z,Wo as _,hc as a,jg as b,Og as c,nc as d,Cg as e,Bg as f,Tc as g,Mg as h,oc as i,Ig as j,_g as k,Ec as l,Dc as m,Ac as n,Wc as o,si as p,ld as q,Sg as r,Vu as s,ad as t,Tg as u,Pg as v,rc as w,gd as x,hd as y,vd as z};