decocms 4.167.0 → 4.167.2

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 (221) hide show
  1. package/dist/client/assets/{AlertCircle-Cd8M35Wb.js → AlertCircle-CUqW_w6g.js} +1 -1
  2. package/dist/client/assets/{AreaChart-C78nqQQF.js → AreaChart-Bm75VTUe.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-4BHUZHFD.js → ArrowUp-C7ToAohd.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CCEVlmCI.js → ArrowUpRight-Ctd2GOR9.js} +1 -1
  5. package/dist/client/assets/{Check-CK_e8wdj.js → Check-CgsRhHy8.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-D31c9Zko.js → CheckCircle-VXm1pD5i.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DSAcD82u.js → ChevronDown-Wb4xUAM2.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-D02mIW0w.js → ChevronRight-Bb4Md-MD.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BqqaHKfG.js → ChevronUp-Bsb-Y77Y.js} +1 -1
  10. package/dist/client/assets/{Copy01-CbmbpqVa.js → Copy01-DZd32DIO.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-DHX1tpE2.js → CpuChip01-BPw4omKe.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DD9vI7XN.js → DotsVertical-Do26-QjL.js} +1 -1
  13. package/dist/client/assets/{Eye-CgfUY2cN.js → Eye-B22W8AyK.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BVMJKn0q.js → FilterLines-Bc1kxraS.js} +1 -1
  15. package/dist/client/assets/{HardDrive-2n4L-vNW.js → HardDrive-BUNzYRdb.js} +1 -1
  16. package/dist/client/assets/{Key01-T5YNQBm2.js → Key01-CG1NND7T.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-CaOxvIEl.js → LayoutLeft-m1wg28yS.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CXa8wVjc.js → LinkExternal01-BHdYJ4vg.js} +1 -1
  19. package/dist/client/assets/{LogOut01-CM9eugyU.js → LogOut01-CTki1bzq.js} +1 -1
  20. package/dist/client/assets/{Monitor01-8S0W2w5U.js → Monitor01-DcyY807V.js} +1 -1
  21. package/dist/client/assets/{Palette-BQLbJJdf.js → Palette-BEUtyKuF.js} +1 -1
  22. package/dist/client/assets/{Play-CuYQk1-M.js → Play-DrITqLDw.js} +1 -1
  23. package/dist/client/assets/{Plus-BApQaxo5.js → Plus-BmYOuiAj.js} +1 -1
  24. package/dist/client/assets/{SearchLg-BSb_OzKH.js → SearchLg-Brn3yddB.js} +1 -1
  25. package/dist/client/assets/{SearchMd-bzt4kP0K.js → SearchMd-h05KKMiS.js} +1 -1
  26. package/dist/client/assets/{Settings02-Cslfpi0u.js → Settings02-DqYJFs_A.js} +1 -1
  27. package/dist/client/assets/{Shield01-vx0tzuE8.js → Shield01-BGuTNf8w.js} +1 -1
  28. package/dist/client/assets/{Star01-DGK3WnVL.js → Star01-sYD82Np9.js} +1 -1
  29. package/dist/client/assets/{Stars01-BkoB-Q1B.js → Stars01-CfCAp21f.js} +1 -1
  30. package/dist/client/assets/{Stars02-Cx4R-W4T.js → Stars02-DnbvYkKU.js} +1 -1
  31. package/dist/client/assets/{Sun-Cno0ZL2K.js → Sun-tw8Adw2s.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-B1yag0Lu.js → SwitchHorizontal01-BnpMv-f4.js} +1 -1
  33. package/dist/client/assets/{Tool01-BPkNcjLe.js → Tool01-CTroi0ek.js} +1 -1
  34. package/dist/client/assets/{Tool02-8rf_PPrb.js → Tool02-Bh88tYGs.js} +1 -1
  35. package/dist/client/assets/{Trash01-CjLF47KG.js → Trash01-B8ymhEo_.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-B3nbKtR5.js → TrendUp01-Bqs7ykt4.js} +1 -1
  37. package/dist/client/assets/{Upload01-C74iA_2l.js → Upload01-CRF4bF0L.js} +1 -1
  38. package/dist/client/assets/{User01-gol1gjVG.js → User01-BMMY0J4X.js} +1 -1
  39. package/dist/client/assets/{Users01-ConkK5Hy.js → Users01-Co3nN3tw.js} +1 -1
  40. package/dist/client/assets/{Users03-C0TiA5ig.js → Users03-23U4ny0D.js} +1 -1
  41. package/dist/client/assets/{X-D-SXXNOh.js → X-BM44NliR.js} +1 -1
  42. package/dist/client/assets/{XCircle-Bdipnf78.js → XCircle-UQVfZTIm.js} +1 -1
  43. package/dist/client/assets/{XClose-BXyOmw6P.js → XClose-Beh-B9Gb.js} +1 -1
  44. package/dist/client/assets/{Zap-DJXvF0rz.js → Zap-BuelQrvQ.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-DRAXQQVP.js → ZapSquare-Cp9irGGl.js} +1 -1
  46. package/dist/client/assets/{access-gate-BKMOmBMY.js → access-gate-D-oUG6gg.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-B75sXBI5.js → add-section-modal-D_hcTQ7N.js} +1 -1
  48. package/dist/client/assets/{agent-icon-bqP8cd4A.js → agent-icon-CSidaJ6B.js} +1 -1
  49. package/dist/client/assets/{agents-list-JTNfRO7b.js → agents-list-DpnxFgYY.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DB4edqOH.js → ai-providers-B2Fsskz4.js} +1 -1
  51. package/dist/client/assets/{alert-kXNc1jQs.js → alert-BTpI2Cnj.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-fWZE2eoL.js → alert-dialog-FVJZWl26.js} +1 -1
  53. package/dist/client/assets/{app-editor-BJoZeDYw.js → app-editor-B4ngBBof.js} +1 -1
  54. package/dist/client/assets/{auth-B6-JmtGV.js → auth-D-uIp2CQ.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-cHl02pOC.js → auth-catchall-V3EeqtwY.js} +1 -1
  56. package/dist/client/assets/{auth-entry-BkcVdNXd.js → auth-entry-C08ZxDNT.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-ozU7OFFM.js → auth-split-layout-ByioBOA7.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-BBAoTw-S.js → authenticate-and-persist-oauth-DObbFBl5.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-BkrA0C81.js → automation-list-row-DMeZ0lJ3.js} +1 -1
  60. package/dist/client/assets/{automation-runs-1f49gKdv.js → automation-runs-DChno1Ee.js} +1 -1
  61. package/dist/client/assets/{automations-CuujfvxS.js → automations-B1nDP5Tu.js} +1 -1
  62. package/dist/client/assets/{avatar-CG1sYMC3.js → avatar-BumNKk7X.js} +1 -1
  63. package/dist/client/assets/{badge-DTv3ytkG.js → badge-BFv5PsKE.js} +1 -1
  64. package/dist/client/assets/{block-document-pKW_gNRc.js → block-document-DT1iEokX.js} +1 -1
  65. package/dist/client/assets/{brand-context-CSdoqkrl.js → brand-context-CjUnREO9.js} +1 -1
  66. package/dist/client/assets/{buckets-9vcDP1Xx.js → buckets-D7qH3DY9.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-Z8lz1ptZ.js → bulk-category-panel-R7nvjZc1.js} +1 -1
  68. package/dist/client/assets/{calendar-CSYSRHan.js → calendar-DMZ7yz5j.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-CI7JffNO.js → capability-load-error-Zpx0CzA1.js} +1 -1
  70. package/dist/client/assets/{card-Djqe431m.js → card-Dv8gN6wM.js} +1 -1
  71. package/dist/client/assets/{category-editor-BOkZGzvy.js → category-editor-DBU4RcGL.js} +1 -1
  72. package/dist/client/assets/{chat-context-B9IMqX9H.js → chat-context-D2jz7TPk.js} +1 -1
  73. package/dist/client/assets/{checkbox-g1Xe-Fh0.js → checkbox-B5fS-ChG.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-71pX1cOc.js → cli-auth-success-Dq-DdX99.js} +1 -1
  75. package/dist/client/assets/{collection-detail-DSTfsDtj.js → collection-detail-BJdFlI_D.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-DqckpPka.js → collection-display-button-DlQC5Fqe.js} +1 -1
  77. package/dist/client/assets/{collection-search-D8p930-2.js → collection-search-CclDfE5O.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-C4pkDKfG.js → collection-table-wrapper-DRbR52Xw.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-Btbvy5wZ.js → collection-tabs-B0dT6Ygy.js} +1 -1
  80. package/dist/client/assets/{command-D8VZgYcp.js → command-Bjp1VURS.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-B_-r2hWt.js → commerce-onboarding-EUvt30Jc.js} +1 -1
  82. package/dist/client/assets/{companions-core-C6pGrBaV.js → companions-core-BDbmsLM0.js} +1 -1
  83. package/dist/client/assets/{connect-Dggz_rgK.js → connect-DaqnZRt8.js} +1 -1
  84. package/dist/client/assets/{connection-Bm6D5T7s.js → connection-C0Suj0GO.js} +1 -1
  85. package/dist/client/assets/{connection-card-DaylHwd8.js → connection-card-HFSstqIJ.js} +1 -1
  86. package/dist/client/assets/{connection-detail-pp291ZsI.js → connection-detail-BvAKPB53.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-abaaeWRW.js → connection-form-helpers-CKgaIsD-.js} +1 -1
  88. package/dist/client/assets/{connections-C-3JQ-RT.js → connections-O4_j66gP.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-DJTs5v3B.js → decopilot-sse-pool-NjFnhgvn.js} +1 -1
  90. package/dist/client/assets/{dialog-BNEf4h73.js → dialog-D4l4Xdsp.js} +1 -1
  91. package/dist/client/assets/{domain-settings-BQw1ZHpG.js → domain-settings-BMIxOiTg.js} +1 -1
  92. package/dist/client/assets/{drawer-BOicXoW4.js → drawer-C3pYai9a.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-B0OSBqF5.js → dropdown-menu-Q--ZyLLW.js} +1 -1
  94. package/dist/client/assets/{empty-state-Jijm8Zjj.js → empty-state-BOcwt_Pf.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-ByQ1VQpk.js → extract-connection-data-Df7SJj9F.js} +1 -1
  96. package/dist/client/assets/{file-explorer-CheIIdH4.js → file-explorer-lqBegrgA.js} +1 -1
  97. package/dist/client/assets/{form-BoZJqj_8.js → form-DMrBv8ot.js} +1 -1
  98. package/dist/client/assets/{general-CtysXkWo.js → general-N31775KP.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-CCSv048C.js → github-repo-picker-Bw5gD-qj.js} +1 -1
  100. package/dist/client/assets/{hooks-Bl53PFCW.js → hooks-BkWYCTuM.js} +1 -1
  101. package/dist/client/assets/{index-BB4oQ8m2.js → index-3_M3tW1F.js} +1 -1
  102. package/dist/client/assets/{index-BAn2tA3m.js → index-BR7TGZHq.js} +1 -1
  103. package/dist/client/assets/{index-BdV3mKMQ.js → index-BxSgbIJg.js} +1 -1
  104. package/dist/client/assets/{index-EC0JTBd4.js → index-C8SvWM2K.js} +1 -1
  105. package/dist/client/assets/{index-DFVpce2g.js → index-CfVmXxnZ.js} +35 -35
  106. package/dist/client/assets/{index-7i5MzulY.js → index-DBssoMSm.js} +1 -1
  107. package/dist/client/assets/{index-CzdD7w68.js → index-DIkj5DIc.js} +1 -1
  108. package/dist/client/assets/{index-DBW7-LLJ.js → index-DptGhhs0.js} +27 -27
  109. package/dist/client/assets/{index-DW8FWTYY.js → index-Dsil6t1i.js} +1 -1
  110. package/dist/client/assets/{index-D7iPCSni.js → index-NXIL8Ow6.js} +10 -10
  111. package/dist/client/assets/{index-redirect-idcaLUlq.js → index-redirect-dX53aGUA.js} +1 -1
  112. package/dist/client/assets/{index-DS1dPTBr.js → index-yBY16i4r.js} +1 -1
  113. package/dist/client/assets/{input-DM14QBHx.js → input-zj8m7n84.js} +1 -1
  114. package/dist/client/assets/{integration-icon-BjR4OGAx.js → integration-icon-BuPK5TYy.js} +1 -1
  115. package/dist/client/assets/{invite-member-dialog-D9LT_tFK.js → invite-member-dialog-C6-_qm1d.js} +1 -1
  116. package/dist/client/assets/{label-BEcprhix.js → label-CuF09Kzu.js} +1 -1
  117. package/dist/client/assets/{layout-DluG1Vni.js → layout-DBvRMRIb.js} +1 -1
  118. package/dist/client/assets/{login-BUNmGthz.js → login-Cc4SDSF_.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-ws9m29vQ.js → mcp-oauth-shlK2GTY.js} +1 -1
  120. package/dist/client/assets/{members-B2rGjbVl.js → members-BDXBmXwe.js} +1 -1
  121. package/dist/client/assets/{monaco-editor-DJSyif3I.js → monaco-editor-CVT6PsIN.js} +1 -1
  122. package/dist/client/assets/{monitoring-stats-row-B5xpjD5z.js → monitoring-stats-row-Cdet9jiU.js} +1 -1
  123. package/dist/client/assets/{multi-select-DX4wKmiL.js → multi-select-xU_EwzSI.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-ai-provider-DYANs1ON.js → oauth-callback-ai-provider-Dm1COiz9.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-qhM58XQs.js → oauth-callback-iNyi40DB.js} +1 -1
  126. package/dist/client/assets/{onboarding-WshxsJzF.js → onboarding-Cloqiw3U.js} +1 -1
  127. package/dist/client/assets/{org-layout-CvfJlqf0.js → org-layout-CAFsjPqf.js} +1 -1
  128. package/dist/client/assets/{organization-choice-CsgXcMIz.js → organization-choice-Cyi_e8Zq.js} +1 -1
  129. package/dist/client/assets/{orgs-CGCwj0aX.js → orgs-S_k4xMrd.js} +1 -1
  130. package/dist/client/assets/{page-seo-form-BUmIrCHq.js → page-seo-form-D01XOKmk.js} +1 -1
  131. package/dist/client/assets/{popover-13d1_Ydy.js → popover-Bt8NA7TT.js} +1 -1
  132. package/dist/client/assets/{post-editor-CW3QV3HH.js → post-editor-C7T3qUe4.js} +1 -1
  133. package/dist/client/assets/{primitives-CWnjtxmC.js → primitives-CghAr9iC.js} +1 -1
  134. package/dist/client/assets/{profile-D-gvwVRu.js → profile-Dte5ZwvH.js} +1 -1
  135. package/dist/client/assets/project-app-view-BkR_dxRJ.js +1 -0
  136. package/dist/client/assets/record-editor-C_TZAxUC.js +1 -0
  137. package/dist/client/assets/{redirect-editor-BQgkHo14.js → redirect-editor-BSuCXuw4.js} +1 -1
  138. package/dist/client/assets/registry-Cy4VwkhT.js +2 -0
  139. package/dist/client/assets/{registry-layout-10se5s7s.js → registry-layout-D7OeE4Tp.js} +1 -1
  140. package/dist/client/assets/{reports-B0dg8-1T.js → reports-Ii6S1PYR.js} +1 -1
  141. package/dist/client/assets/{require-capability-94N1MpBW.js → require-capability-D5sKrc-a.js} +1 -1
  142. package/dist/client/assets/{required-auth-layout-DTRJEXT6.js → required-auth-layout-PejcRLRr.js} +1 -1
  143. package/dist/client/assets/{reset-password-DTqfLCFl.js → reset-password-j1MU8BBT.js} +1 -1
  144. package/dist/client/assets/{roles-DMaB4I0B.js → roles-CpX37qPN.js} +1 -1
  145. package/dist/client/assets/{search-input-Cav-R6u1.js → search-input-Bf_CjAux.js} +1 -1
  146. package/dist/client/assets/{secrets-CmQA_lCO.js → secrets-DidOyNZ0.js} +1 -1
  147. package/dist/client/assets/{sections-editor-B1CYJQwI.js → sections-editor-DY2AuZd7.js} +1 -1
  148. package/dist/client/assets/{select-p5o_Bt0F.js → select-j9WEM8Sh.js} +1 -1
  149. package/dist/client/assets/{select-model-z0c2dMz_.js → select-model-C8d0poms.js} +2 -2
  150. package/dist/client/assets/self-tool-result-aQ7EVEiZ.js +1 -0
  151. package/dist/client/assets/{seo-editor-DTdLrmHB.js → seo-editor-DGYP3acD.js} +1 -1
  152. package/dist/client/assets/{settings-layout-BnrJScNO.js → settings-layout-DWcGqshR.js} +1 -1
  153. package/dist/client/assets/{settings-section-CZTjnxlV.js → settings-section-fm3Mm6Bm.js} +1 -1
  154. package/dist/client/assets/{shell-controls-XiJZc3ao.js → shell-controls-DVyMygC3.js} +1 -1
  155. package/dist/client/assets/{shell-layout-CvSnv4Ng.js → shell-layout-Qdn6Ab14.js} +1 -1
  156. package/dist/client/assets/{sidebar-BBmlF4Le.js → sidebar-DYUk0Bcn.js} +1 -1
  157. package/dist/client/assets/{skeleton-D5maqyjg.js → skeleton--88gs_EO.js} +1 -1
  158. package/dist/client/assets/{spinner-D09NsuWH.js → spinner-DEsDb5EQ.js} +1 -1
  159. package/dist/client/assets/{sso-DqK4eFK8.js → sso-C0YVRrqi.js} +1 -1
  160. package/dist/client/assets/{store-DRo6GtOx.js → store-9L8vOeYP.js} +1 -1
  161. package/dist/client/assets/store-registry-DZm0Mqt3.js +2 -0
  162. package/dist/client/assets/{studio-tools-eC6fCmF6.js → studio-tools-Dz4porfg.js} +1 -1
  163. package/dist/client/assets/{switch-DJGvmJgh.js → switch-CjtCOM9l.js} +1 -1
  164. package/dist/client/assets/{tab-id-ts2R-IK7.js → tab-id-swDgZMnB.js} +1 -1
  165. package/dist/client/assets/{table-CUPzY57H.js → table-B1o0Pwj4.js} +1 -1
  166. package/dist/client/assets/{tabs-BezZc3NY.js → tabs-VUaZhlmm.js} +1 -1
  167. package/dist/client/assets/{textarea-DHTTJLnr.js → textarea-Bs8WvAl6.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CqJpxcmh.js → toggle-group-BsLp02VA.js} +1 -1
  169. package/dist/client/assets/{toolbar-8XCdJRqW.js → toolbar-B5h5oyq6.js} +1 -1
  170. package/dist/client/assets/{tooltip-fkTa7gIG.js → tooltip-CETnd3ay.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-wy-pIlnl.js → use-ai-providers-gi5xr2mP.js} +1 -1
  172. package/dist/client/assets/{use-automations-BebUXKcQ.js → use-automations-DhjGDNZK.js} +1 -1
  173. package/dist/client/assets/{use-autosave-CUZ4cIic.js → use-autosave-D0NLBkKG.js} +1 -1
  174. package/dist/client/assets/{use-capability-D9H3t7HP.js → use-capability-BqS7iGUH.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-Cso4aNFM.js → use-clock-tick-B9BJ0pwX.js} +1 -1
  176. package/dist/client/assets/{use-connection-DJ0b1gTC.js → use-connection-BMokl4CO.js} +1 -1
  177. package/dist/client/assets/{use-copy-BNgRyC_N.js → use-copy-Be1Kjd_w.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-pKJoeitk.js → use-create-virtual-mcp-CWkwgd9r.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-B-9KRifB.js → use-debounced-autosave-D0IOAPSF.js} +1 -1
  180. package/dist/client/assets/{use-debounced-value-DrbFDRJg.js → use-debounced-value-B-JvHFEo.js} +1 -1
  181. package/dist/client/assets/{use-deco-credits-DmpIUFXQ.js → use-deco-credits-UciEpjbi.js} +1 -1
  182. package/dist/client/assets/{use-decopilot-events-CPtuygfk.js → use-decopilot-events-CEPq_dZU.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-Ca978irp.js → use-delete-connection-COvCqZ-1.js} +1 -1
  184. package/dist/client/assets/{use-deployment-admin-DG7sPT_s.js → use-deployment-admin-BJaOQser.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-BSbmDdF6.js → use-file-configs-I7iEol3j.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-BLH47khU.js → use-infinite-scroll-CK3Uizc8.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-BFZJlmrE.js → use-join-requests-DqDoWz8D.js} +1 -1
  188. package/dist/client/assets/{use-mcp-auth-status-DtWK2vVN.js → use-mcp-auth-status-h3xamCXm.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-YC9HMu6y.js → use-mcp-client-C7paE-cE.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-81zsgjbk.js → use-mcp-tools-DS7HyfmS.js} +1 -1
  191. package/dist/client/assets/{use-members-BOo6SBZf.js → use-members-BuBLbPW8.js} +1 -1
  192. package/dist/client/assets/{use-mobile-DaXh9iB4.js → use-mobile-CYh3EGEt.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-CwseQD-z.js → use-navigate-to-agent-Bqz6pwLi.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-B_HThHi-.js → use-org-auth-client-CsKd0mpo.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-vq0R-8A9.js → use-org-sso-CCq7sZnB.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-C1XBXdGf.js → use-organization-roles-CgtJI-6n.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-Bi013MJn.js → use-organization-settings-MkvwyFUq.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-DHHAMc5J.js → use-registry-connections-YnGGDwWM.js} +1 -1
  199. package/dist/client/assets/{use-secrets-BCwf7s42.js → use-secrets-HEeF0D3f.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-B4bZcx6E.js → use-status-sounds-CyFcW6V5.js} +1 -1
  201. package/dist/client/assets/{use-tags-CxtVjJTC.js → use-tags-BDVrYGwL.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-2rHbtOa0.js → use-view-mode-9B1lHoFF.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-Czn5fHtD.js → use-virtual-mcp-Bdv0Gghv.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-BIuIIh4Y.js +1 -0
  205. package/dist/client/assets/{useQueries-BIMkg7rJ.js → useQueries-Bq9KgQR-.js} +1 -1
  206. package/dist/client/assets/{useRouterState-CQeHJLAo.js → useRouterState-Bf1ibFXD.js} +1 -1
  207. package/dist/client/assets/useSuspenseInfiniteQuery-TLdwTHtB.js +1 -0
  208. package/dist/client/assets/{users-CbQWIH4c.js → users-BpJTuCAK.js} +1 -1
  209. package/dist/client/assets/{variant-calendar-CVBnB48e.js → variant-calendar-B7O5BNIE.js} +1 -1
  210. package/dist/client/assets/{view-mode-toggle-CZXwONMQ.js → view-mode-toggle-BO7qzBum.js} +1 -1
  211. package/dist/client/index.html +1 -1
  212. package/dist/server/cli.js +389 -389
  213. package/dist/server/server.js +265 -265
  214. package/package.json +1 -1
  215. package/dist/client/assets/project-app-view-CWjCgPJM.js +0 -1
  216. package/dist/client/assets/record-editor-Bhe663KT.js +0 -1
  217. package/dist/client/assets/registry-Dp0LTgEx.js +0 -2
  218. package/dist/client/assets/self-tool-result-Cgb76l_D.js +0 -1
  219. package/dist/client/assets/store-registry-BfDOrY5J.js +0 -2
  220. package/dist/client/assets/useInfiniteQuery-yZBiNKu9.js +0 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-CdZRM8uM.js +0 -1
@@ -1,9 +1,9 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DFVpce2g.js","assets/index-DBW7-LLJ.js","assets/index-DsfuG9Bb.css","assets/ArrowUp-4BHUZHFD.js","assets/chat-context-B9IMqX9H.js","assets/tab-id-ts2R-IK7.js","assets/dialog-BNEf4h73.js","assets/X-D-SXXNOh.js","assets/Check-CK_e8wdj.js","assets/Copy01-CbmbpqVa.js","assets/hooks-Bl53PFCW.js","assets/use-mcp-client-YC9HMu6y.js","assets/auth-B6-JmtGV.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/decopilot-sse-pool-DJTs5v3B.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-virtual-mcp-Czn5fHtD.js","assets/use-ai-providers-wy-pIlnl.js","assets/studio-tools-eC6fCmF6.js","assets/use-decopilot-events-CPtuygfk.js","assets/use-organization-settings-Bi013MJn.js","assets/automation-runs-1f49gKdv.js","assets/select-p5o_Bt0F.js","assets/tooltip-fkTa7gIG.js","assets/ChevronDown-DSAcD82u.js","assets/ChevronUp-BqqaHKfG.js","assets/useInfiniteQuery-yZBiNKu9.js","assets/use-infinite-scroll-BLH47khU.js","assets/use-connection-DJ0b1gTC.js","assets/card-Djqe431m.js","assets/sidebar-BBmlF4Le.js","assets/LayoutLeft-CaOxvIEl.js","assets/use-mobile-DaXh9iB4.js","assets/table-CUPzY57H.js","assets/empty-state-Jijm8Zjj.js","assets/use-members-BOo6SBZf.js","assets/use-org-auth-client-B_HThHi-.js","assets/use-clock-tick-Cso4aNFM.js","assets/AlertCircle-Cd8M35Wb.js","assets/CheckCircle-D31c9Zko.js","assets/DotsVertical-DD9vI7XN.js","assets/agent-icon-bqP8cd4A.js","assets/Tool01-BPkNcjLe.js","assets/Settings02-Cslfpi0u.js","assets/Tool02-8rf_PPrb.js","assets/XCircle-Bdipnf78.js","assets/ArrowUpRight-CCEVlmCI.js","assets/TrendUp01-B3nbKtR5.js","assets/ZapSquare-DRAXQQVP.js","assets/Users03-C0TiA5ig.js","assets/ChevronRight-D02mIW0w.js","assets/Stars02-Cx4R-W4T.js","assets/CpuChip01-DHX1tpE2.js","assets/Eye-CgfUY2cN.js","assets/FilterLines-BVMJKn0q.js","assets/Star01-DGK3WnVL.js","assets/Palette-BQLbJJdf.js","assets/SwitchHorizontal01-B1yag0Lu.js","assets/HardDrive-2n4L-vNW.js","assets/Key01-T5YNQBm2.js","assets/LinkExternal01-CXa8wVjc.js","assets/LogOut01-CM9eugyU.js","assets/Monitor01-8S0W2w5U.js","assets/Sun-Cno0ZL2K.js","assets/Play-CuYQk1-M.js","assets/Plus-BApQaxo5.js","assets/SearchLg-BSb_OzKH.js","assets/SearchMd-bzt4kP0K.js","assets/Shield01-vx0tzuE8.js","assets/Stars01-BkoB-Q1B.js","assets/Trash01-CjLF47KG.js","assets/Upload01-C74iA_2l.js","assets/User01-gol1gjVG.js","assets/Users01-ConkK5Hy.js","assets/XClose-BXyOmw6P.js","assets/Zap-DJXvF0rz.js","assets/use-automations-BebUXKcQ.js","assets/useSuspenseInfiniteQuery-CdZRM8uM.js","assets/avatar-CG1sYMC3.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-BNgRyC_N.js","assets/calendar-CSYSRHan.js","assets/monaco-editor-DJSyif3I.js","assets/spinner-D09NsuWH.js","assets/index-DS1dPTBr.js","assets/shell-layout-CvSnv4Ng.js","assets/required-auth-layout-DTRJEXT6.js","assets/use-org-sso-vq0R-8A9.js","assets/integration-icon-BjR4OGAx.js","assets/use-navigate-to-agent-CwseQD-z.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-C78nqQQF.js","assets/form-BoZJqj_8.js","assets/label-BEcprhix.js","assets/input-DM14QBHx.js","assets/drawer-BOicXoW4.js","assets/collection-search-D8p930-2.js","assets/tabs-BezZc3NY.js","assets/toggle-group-CqJpxcmh.js","assets/use-deco-credits-DmpIUFXQ.js","assets/popover-13d1_Ydy.js","assets/alert-dialog-fWZE2eoL.js","assets/toolbar-8XCdJRqW.js","assets/skeleton-D5maqyjg.js","assets/github-repo-picker-CCSv048C.js","assets/use-debounced-value-DrbFDRJg.js","assets/authenticate-and-persist-oauth-BBAoTw-S.js","assets/mcp-oauth-ws9m29vQ.js","assets/use-mcp-tools-81zsgjbk.js","assets/extract-connection-data-ByQ1VQpk.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-CAXumITS.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-DaylHwd8.js","assets/use-registry-connections-DHHAMc5J.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-DHTTJLnr.js","assets/connection-form-helpers-abaaeWRW.js","assets/collection-tabs-Btbvy5wZ.js","assets/badge-DTv3ytkG.js","assets/select-model-z0c2dMz_.js","assets/checkbox-g1Xe-Fh0.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-CZTjnxlV.js","assets/dropdown-menu-B0OSBqF5.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-B4bZcx6E.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-D9H3t7HP.js","assets/pt-BR-CLy76QW2.js","assets/use-mcp-auth-status-DtWK2vVN.js","assets/use-debounced-autosave-B-9KRifB.js","assets/index-CzdD7w68.js","assets/search-input-Cav-R6u1.js","assets/switch-DJGvmJgh.js","assets/use-secrets-BCwf7s42.js","assets/command-D8VZgYcp.js","assets/index-7i5MzulY.js","assets/useQueries-BIMkg7rJ.js","assets/use-file-configs-BSbmDdF6.js","assets/automation-list-row-BkrA0C81.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
2
- import{G as Pa,r as v,c as L,x as Fa,K as ve,F as _e,o as En,e as Tt,n as lt,ax as Se,ag as Ut,a as Ua,t as At,a0 as qa,m as Z,j as d,b as ce,aW as Vi,aX as Gi,aY as Qi,aZ as Xi,a_ as Yi,a$ as Zi,b0 as Ji,b1 as eo,b2 as to,B as Xe,E as Ha,d as no,p as ii,k as wr,u as Ka,aG as Wa}from"./index-DBW7-LLJ.js";import{g as Dt}from"./get-initials-D-f_fDFw.js";import{A as Nt}from"./avatar-CG1sYMC3.js";import{aC as ss,af as Va,ag as Ga,ai as Qa,a6 as Xa,aD as Ya,B as Za,p as Ja,aE as so,X as ro,e as io,ae as el,j as oo,aF as tl,aB as Zs,as as Sr,_ as Sn,aG as nl,n as Cr,az as sl}from"./agent-icon-bqP8cd4A.js";import{i as ao}from"./SwitchHorizontal01-B1yag0Lu.js";import{s as Jn}from"./Plus-BApQaxo5.js";import{i as Cn}from"./X-D-SXXNOh.js";import{a as wn,b as Gn,P as Qn}from"./popover-13d1_Ydy.js";import{a as jt,D as jn,b as Dn,c as Nn,d as zn,e as Ln,f as Pn,i as rl}from"./dropdown-menu-B0OSBqF5.js";import{W as il,m as oi,S as lo,C as co,g as ol,u as al,h as ll,Q as cl,j as dl,a as ul}from"./use-mcp-client-YC9HMu6y.js";import{u as fl,G as ar,a as hl}from"./github-repo-picker-CCSv048C.js";import{b as Tr,d as jr,e as Dr,h as pl,a as gl,c as ml}from"./dialog-BNEf4h73.js";import{b as xl,u as bl}from"./use-connection-DJ0b1gTC.js";import{b as yl}from"./provision-repo-scoped-github-connection-CAXumITS.js";import{a as kl}from"./authenticate-and-persist-oauth-BBAoTw-S.js";import{e as vl}from"./extract-connection-data-ByQ1VQpk.js";import{u as uo}from"./use-members-BOo6SBZf.js";import{u as In}from"./studio-tools-eC6fCmF6.js";import{t as wl,T as Sl,a as Cl,S as nt,i as ai}from"./decopilot-sse-pool-DJTs5v3B.js";import{u as Tl}from"./use-decopilot-events-CPtuygfk.js";import{a as fo}from"./format-time-BnbuEtat.js";import{i as Ls}from"./AlertCircle-Cd8M35Wb.js";import{i as _n}from"./CheckCircle-D31c9Zko.js";import{i as jl}from"./DotsVertical-DD9vI7XN.js";import{s as Dl}from"./Eye-CgfUY2cN.js";import{u as ho,a as Nl,b as Rl}from"./use-tags-CxtVjJTC.js";import{o as El,P as qt,a as Nr,D as Il,p as _l,q as Al,S as Bt,r as Bl,T as po,F as Js,s as Kn,v as Ol,w as $l,x as go,N as Ml,k as Rr,y as zl,z as Ll,d as mo,n as Pl,A as Mt,B as Fl,G as Fn,H as Ul,I as xo,R as bo,m as yo,J as ko,K as ql,L as Hl,Q as Kl,e as Wl,u as Vl,f as Gl,j as Ql,C as vo,c as Xl}from"./calendar-CSYSRHan.js";import{S as yn}from"./skeleton-D5maqyjg.js";import{u as Yl}from"./use-copy-BNgRyC_N.js";import{i as Ps}from"./Check-CK_e8wdj.js";import{i as wo}from"./ChevronRight-D02mIW0w.js";import{a as Zl}from"./Copy01-CbmbpqVa.js";import{n as Jl,i as So}from"./Tool02-8rf_PPrb.js";import{n as Ss}from"./LinkExternal01-CXa8wVjc.js";import{b as Co,i as To}from"./XCircle-Bdipnf78.js";import{s as jo}from"./Trash01-CjLF47KG.js";import{u as li,a as ec}from"./use-organization-settings-Bi013MJn.js";import{d as Er,a as Ir,c as Pt,b as Rn,C as _r,e as Ar}from"./command-D8VZgYcp.js";import{s as lr}from"./User01-gol1gjVG.js";import{d as tc,b as nc,f as sc,g as rc,a as ic,D as oc}from"./drawer-BOicXoW4.js";import{t as Br}from"./ChevronDown-DSAcD82u.js";import{i as Do}from"./FilterLines-BVMJKn0q.js";import{s as ac}from"./TrendUp01-B3nbKtR5.js";import{u as lc}from"./shell-layout-CvSnv4Ng.js";import{b as cc}from"./hooks-Bl53PFCW.js";import{f as dc}from"./tab-id-ts2R-IK7.js";import{u as cr}from"./companions-core-C6pGrBaV.js";function uc(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 Ug="__home__";function Or(t,e){return Pa.chatDraft(t,e)}function fc(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 hc(t,e,n,r,s){const i=Or(e,n);if(uc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},a=JSON.stringify(o);try{t.setItem(i,a)}catch(l){if(pc(l)){const c=new TextEncoder().encode(a).byteLength;s?.onQuotaExceeded?.({docSizeBytes:c});return}throw l}}function qg(t,e,n){const r=Or(e,n),s=t.getItem(r),i=fc(s);return s!==null&&i===null&&t.removeItem(r),i}function Hg(t,e,n){t.removeItem(Or(e,n))}function pc(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}var gc=El;function mc(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:a}=t,l=r&&!s,c=Al(n),f=new RegExp(`\\s${c}$`),u=o?"^":"",h=s?"":c,p=l?new RegExp(`${u}${c}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${h}]*`,"gm"),m=((e=a.nodeBefore)==null?void 0:e.isText)&&a.nodeBefore.text;if(!m)return null;const y=a.pos-m.length,x=Array.from(m.matchAll(p)).pop();if(!x||x.input===void 0||x.index===void 0)return null;const g=x.input.slice(Math.max(0,x.index-1),x.index),b=new RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!b)return null;const k=y+x.index;let w=k+x[0].length;return l&&f.test(m.slice(w-1,w+1))&&(x[0]+=" ",w+=1),k<a.pos&&w>=a.pos?{range:{from:k,to:w},query:x[0].slice(n.length),text:x[0]}:null}var xc=new qt("suggestion");function bc({pluginKey:t=xc,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:f="is-empty",command:u=()=>null,items:h=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:y=mc,shouldShow:x}){let g;const b=p?.(),k=()=>{const C=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(C),{top:N,right:R,bottom:D,left:E}=T;try{return new DOMRect(E,N,R-E,D-N)}catch{return null}},w=(C,T)=>T?()=>{const N=t.getState(e.state),R=N?.decorationId,D=C.dom.querySelector(`[data-decoration-id="${R}"]`);return D?.getBoundingClientRect()||null}:k;function S(C,T){var N;try{const D=t.getState(C.state),E=D?.decorationId?C.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`):null,M={editor:e,range:D?.range||{from:0,to:0},query:D?.query||null,text:D?.text||null,items:[],command:A=>u({editor:e,range:D?.range||{from:0,to:0},props:A}),decorationNode:E,clientRect:w(C,E)};(N=b?.onExit)==null||N.call(b,M)}catch{}const R=C.state.tr.setMeta(T,{exit:!0});C.dispatch(R)}const j=new Nr({key:t,view(){return{update:async(C,T)=>{var N,R,D,E,M,A,U;const I=(N=this.key)==null?void 0:N.getState(T),B=(R=this.key)==null?void 0:R.getState(C.state),O=I.active&&B.active&&I.range.from!==B.range.from,K=!I.active&&B.active,Y=I.active&&!B.active,P=!K&&!Y&&I.query!==B.query,q=K||O&&P,Q=P||O,G=Y||O&&P;if(!q&&!Q&&!G)return;const ee=G&&!q?I:B,W=C.dom.querySelector(`[data-decoration-id="${ee.decorationId}"]`);g={editor:e,range:ee.range,query:ee.query,text:ee.text,items:[],command:ne=>u({editor:e,range:ee.range,props:ne}),decorationNode:W,clientRect:w(C,W)},q&&((D=b?.onBeforeStart)==null||D.call(b,g)),Q&&((E=b?.onBeforeUpdate)==null||E.call(b,g)),(Q||q)&&(g.items=await h({editor:e,query:ee.query})),G&&((M=b?.onExit)==null||M.call(b,g)),Q&&((A=b?.onUpdate)==null||A.call(b,g)),q&&((U=b?.onStart)==null||U.call(b,g))},destroy:()=>{var C;g&&((C=b?.onExit)==null||C.call(b,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,T,N,R){const{isEditable:D}=e,{composing:E}=e.view,{selection:M}=C,{empty:A,from:U}=M,I={...T},B=C.getMeta(t);if(B&&B.exit)return I.active=!1,I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null,I;if(I.composing=E,D&&(A||e.view.composing)){(U<T.range.from||U>T.range.to)&&!E&&!T.composing&&(I.active=!1);const O=y({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:M.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;O&&m({editor:e,state:R,range:O.range,isActive:T.active})&&(!x||x({editor:e,range:O.range,query:O.query,text:O.text,transaction:C}))?(I.active=!0,I.decorationId=T.decorationId?T.decorationId:K,I.range=O.range,I.query=O.query,I.text=O.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(C,T){var N,R,D,E;const{active:M,range:A}=j.getState(C.state);if(!M)return!1;if(T.key==="Escape"||T.key==="Esc"){const I=j.getState(C.state),B=(N=g?.decorationNode)!=null?N:null,O=B??(I?.decorationId?C.dom.querySelector(`[data-decoration-id="${I.decorationId}"]`):null);if(((R=b?.onKeyDown)==null?void 0:R.call(b,{view:C,event:T,range:I.range}))||!1)return!0;const Y={editor:e,range:I.range,query:I.query,text:I.text,items:[],command:P=>u({editor:e,range:I.range,props:P}),decorationNode:O,clientRect:O?()=>O.getBoundingClientRect()||null:null};return(D=b?.onExit)==null||D.call(b,Y),S(C,t),!0}return((E=b?.onKeyDown)==null?void 0:E.call(b,{view:C,event:T,range:A}))||!1},decorations(C){const{active:T,range:N,decorationId:R,query:D}=j.getState(C);if(!T)return null;const E=!D?.length,M=[l];return E&&M.push(f),Il.create(C.doc,[_l.inline(N.from,N.to,{nodeName:a,class:M.join(" "),"data-decoration-id":R,"data-decoration-content":c})])}}});return j}function yc(t){const e=L.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[a,l]=v.useState(0),c=v.useRef(s),f=v.useRef(a),u=v.useRef(i),h=v.useRef(o),p=v.useDeferredValue(r);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{l(0)},e[0]=m):m=e[0];let y;e[1]!==p?(y=[p],e[1]=p,e[2]=y):y=e[2],v.useEffect(m,y);let x,g;e[3]!==s.length||e[4]!==a?(x=()=>{a>=s.length&&s.length>0&&l(0)},g=[s.length,a],e[3]=s.length,e[4]=a,e[5]=x,e[6]=g):(x=e[5],g=e[6]),v.useEffect(x,g);let b,k;e[7]!==s?(b=()=>{c.current=s},k=[s],e[7]=s,e[8]=b,e[9]=k):(b=e[8],k=e[9]),v.useEffect(b,k);let w,S;e[10]!==a?(w=()=>{f.current=a},S=[a],e[10]=a,e[11]=w,e[12]=S):(w=e[11],S=e[12]),v.useEffect(w,S);let j,C;e[13]!==i?(C=()=>{u.current=i},j=[i],e[13]=i,e[14]=j,e[15]=C):(j=e[14],C=e[15]),v.useEffect(C,j);let T,N;e[16]!==o?(T=()=>{h.current=o},N=[o],e[16]=o,e[17]=T,e[18]=N):(T=e[17],N=e[18]),v.useEffect(T,N);let R,D;e[19]!==n?(R=()=>{if(n?.isDestroyed)return;let A;try{A=n.view.dom}catch{return}if(!A)return;const U=B=>{const O=c.current;if(!O.length)return!1;const K=()=>l(P=>(P+1)%O.length),Y=()=>l(P=>(P-1+O.length)%O.length);switch(B.key){case"ArrowUp":return B.preventDefault(),Y(),!0;case"ArrowDown":return B.preventDefault(),K(),!0;case"Tab":return B.preventDefault(),B.shiftKey?Y():K(),!0;case"Home":return B.preventDefault(),l(0),!0;case"End":return B.preventDefault(),l(O.length-1),!0;case"Enter":{if(B.isComposing)return!1;B.preventDefault();const P=f.current;return P!==-1&&O[P]&&u.current?.(O[P],P),!0}case"Escape":return B.preventDefault(),h.current?.(),!0;default:return!1}},I=B=>{U(B)};return A.addEventListener("keydown",I,!0),()=>{A?.removeEventListener("keydown",I,!0)}},D=[n],e[19]=n,e[20]=R,e[21]=D):(R=e[20],D=e[21]),v.useEffect(R,D);const E=s.length?a:void 0;let M;return e[22]!==E?(M={selectedIndex:E,setSelectedIndex:l},e[22]=E,e[23]=M):M=e[23],M}function kc(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 vc=v.createContext(void 0);function wc(){const t=v.useContext(vc);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Kg(t){const e=L.c(16),{editor:n,char:r,pluginKey:s,allow:i,onOpenChange:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=a):a=e[0];const[l,c]=v.useReducer(kc,a);let f;e[1]!==o?(f=y=>{o?.(y)},e[1]=o,e[2]=f):f=e[2];const u=v.useEffectEvent(f);let h;e[3]!==r||e[4]!==i||e[5]!==n||e[6]!==u||e[7]!==s?(h=()=>{if(n?.isDestroyed)return;const y=s instanceof qt?s:new qt(s);n.state.plugins.find(b=>b.spec.key===y)&&n.unregisterPlugin(y);const g=bc({pluginKey:y,editor:n,char:r,allow(b){const k=n.state.doc.resolve(b.range.from);for(let w=k.depth;w>0;w--)if(k.node(w).type.name==="image")return!1;return!(i&&!i(b))},command(){},render:()=>({onStart:b=>{c({type:"ON_START",payload:{element:b.decorationNode??null,query:b.query,range:b.range}}),u(!0)},onUpdate:b=>{c({type:"ON_UPDATE",payload:{element:b.decorationNode??null,query:b.query,range:b.range}})},onKeyDown:b=>b.event.key==="Escape"?(c({type:"ON_EXIT"}),!0):!1,onExit:()=>{c({type:"ON_EXIT"}),u(!1)}}),items:Sc});return n.registerPlugin(g),()=>{n?.isDestroyed||n.unregisterPlugin(y)}},e[3]=r,e[4]=i,e[5]=n,e[6]=u,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,c,i],e[9]=r,e[10]=i,e[11]=n,e[12]=s,e[13]=p):p=e[13],v.useEffect(h,p);let m;return e[14]!==l?(m={state:l,dispatch:c},e[14]=l,e[15]=m):m=e[15],m}function Sc(){return[]}function Wg({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=wc(),o=v.useDeferredValue(s.query),{data:a}=Fa({queryKey:ve.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),l=()=>{i({type:"ON_EXIT"})},c=async(u,h)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:u});try{const{view:p}=t,y=p.state.selection.$to.nodeAfter?.text?.startsWith(" "),x=s.range?{...s.range}:{from:0,to:0};y&&s.range&&(x.to+=1),await r({range:x,item:u})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):l()}catch{l()}}},{selectedIndex:f}=yc({editor:t,query:o,items:a,onSelect:c,onClose:l});return{selectedItem:s.selectedItem,items:a,selectedIndex:f,close:l,onSelect:c}}function Vg(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function pt(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 Gg(t,e){const n=L.c(15),{org:r}=_e();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=ve.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.id||n[5]!==t?(i=(l,c)=>c?.queryKey[1]===r.id&&c.queryKey[2]===t?l:void 0,n[4]=r.id,n[5]=t,n[6]=i):i=n[6];let o;n[7]!==r.slug||n[8]!==e||n[9]!==t?(o=async()=>(await(await Ye(pt(r.slug,t,"list",{path:e}))).json()).entries.toSorted(Cc),n[7]=r.slug,n[8]=e,n[9]=t,n[10]=o):o=n[10];let a;return n[11]!==s||n[12]!==i||n[13]!==o?(a={queryKey:s,placeholderData:i,queryFn:o},n[11]=s,n[12]=i,n[13]=o,n[14]=a):a=n[14],lt(a)}function Cc(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function Qg(t,e,n){const r=L.c(15),{org:s}=_e();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=ve.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 a;r[4]!==n?(a=n?.refetchIntervalWhenAbsent?f=>f.state.data?!1:n.refetchIntervalWhenAbsent??!1:void 0,r[4]=n,r[5]=a):a=r[5];let l;r[6]!==s.slug||r[7]!==e||r[8]!==t?(l=async()=>{const f=await Ye(pt(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]=l):l=r[9];let c;return r[10]!==i||r[11]!==o||r[12]!==a||r[13]!==l?(c={queryKey:i,enabled:o,refetchInterval:a,queryFn:l},r[10]=i,r[11]=o,r[12]=a,r[13]=l,r[14]=c):c=r[14],lt(c)}function Xg(t){const e=L.c(9),{org:n}=_e();let r;e[0]!==n.id||e[1]!==t?(r=ve.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(pt(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 Yg(t,e){const n=L.c(9),r=t===void 0?60:t,{org:s}=_e();let i;n[0]!==s.id?(i=ve.orgFsRecent(s.id),n[0]=s.id,n[1]=i):i=n[1];const o=e?.enabled;let a;n[2]!==r||n[3]!==s.slug?(a=async()=>(await(await Ye(`/api/${encodeURIComponent(s.slug)}/fs/recent?limit=${r}`)).json()).entries,n[2]=r,n[3]=s.slug,n[4]=a):a=n[4];let l;return n[5]!==i||n[6]!==o||n[7]!==a?(l={queryKey:i,enabled:o,queryFn:a},n[5]=i,n[6]=o,n[7]=a,n[8]=l):l=n[8],lt(l)}const Tc=50;function Zg(t,e){const n=L.c(16),{org:r}=_e();let s;n[0]!==r.id||n[1]!==t||n[2]!==e?.prefix||n[3]!==e?.volume?(s=ve.orgFsSearch(r.id,t,e?.volume??"",e?.prefix??""),n[0]=r.id,n[1]=t,n[2]=e?.prefix,n[3]=e?.volume,n[4]=s):s=n[4];const i=t.length>0;let o;n[5]!==r.id?(o=(c,f)=>f?.queryKey[1]===r.id?c:void 0,n[5]=r.id,n[6]=o):o=n[6];let a;n[7]!==r.slug||n[8]!==t||n[9]!==e?(a=async()=>{const c=new URLSearchParams({q:t,limit:String(Tc)});return e&&(c.set("volume",e.volume),e.prefix&&c.set("prefix",e.prefix)),(await(await Ye(`/api/${encodeURIComponent(r.slug)}/fs/search?${c}`)).json()).entries},n[7]=r.slug,n[8]=t,n[9]=e,n[10]=a):a=n[10];let l;return n[11]!==s||n[12]!==i||n[13]!==o||n[14]!==a?(l={queryKey:s,enabled:i,placeholderData:o,queryFn:a},n[11]=s,n[12]=i,n[13]=o,n[14]=a,n[15]=l):l=n[15],lt(l)}function Jg(t){const e=L.c(8),{org:n}=_e();let r;e[0]!==n.id?(r=ve.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 a=await Ye(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:l}=await a.json();return l.map(jc)},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 jc(t){return{volume:t.volume,path:t.path}}async function em(t){const e=await Ye(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function Dc(t,e,n){return(await Ye(pt(t,e,"read",{path:n}))).text()}const Nc=new Set(["md","mdx","markdown","txt","text"]),Rc=25,Ec=64*1024,Ic=256*1024,_c=4;function Ac(t){const e=t.lastIndexOf(".");return e===-1?!1:Nc.has(t.slice(e+1).toLowerCase())}async function tm(t,e,n){const r=n?`${n}/`:"",s=u=>u.startsWith(r)?u.slice(r.length):u,i=[],o=[],a=[{path:n,depth:0}];for(;a.length>0;){const u=a.shift();if(!u)break;let h;try{h=(await(await Ye(pt(t,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const p of[...h].sort((m,y)=>m.path.localeCompare(y.path))){if(p.kind==="dir"){u.depth<_c&&a.push({path:p.path,depth:u.depth+1});continue}Ac(p.path)&&p.size<=Ec&&i.length<Rc?i.push(p.path):o.push(s(p.path))}}const l=await Promise.all(i.map(u=>Dc(t,e,u).catch(()=>null))),c=[];let f=0;return i.forEach((u,h)=>{const p=l[h];if(p==null||f+p.length>Ic){o.push(s(u));return}f+=p.length,c.push({relPath:s(u),content:p})}),c.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),o.sort(),{files:c,omittedPaths:o}}function nm(){const t=L.c(7),{org:e}=_e();let n;t[0]!==e.id?(n=ve.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 Bc(t){const e=L.c(3),{org:n}=_e();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>pt(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function sm(){const t=L.c(2),{org:e}=_e();let n;return t[0]!==e.slug?(n=(r,s)=>pt(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function rm(t){const e=L.c(3),{org:n}=_e();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await Ye(pt(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],Tt(r)}function im(t){const e=L.c(18),{org:n}=_e(),r=En();let s;e[0]!==n||e[1]!==t?(s=async c=>(await(await Ye(pt(n.slug,t,"public",{path:c.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:c.mode,password:c.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 c=>{const f=ve.orgFsStat(n.id,t,c.path);await r.cancelQueries({queryKey:f});const u=r.getQueryData(f),h=c.mode!=="private";return r.setQueryData(f,p=>p&&{...p,readPublic:h,effectivePublic:h,shareMode:c.mode}),{key:f,previous:u}},e[3]=n,e[4]=r,e[5]=t,e[6]=i):i=e[6];let o;e[7]!==r?(o=(c,f,u)=>{u&&r.setQueryData(u.key,u.previous)},e[7]=r,e[8]=o):o=e[8];let a;e[9]!==n||e[10]!==r||e[11]!==t?(a=(c,f,u)=>{r.invalidateQueries({queryKey:ve.orgFsStat(n.id,t,u.path)}),r.invalidateQueries({queryKey:ve.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ve.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ve.orgFsSearchRoot(n.id)})},e[9]=n,e[10]=r,e[11]=t,e[12]=a):a=e[12];let l;return e[13]!==s||e[14]!==i||e[15]!==o||e[16]!==a?(l={mutationFn:s,onMutate:i,onError:o,onSettled:a},e[13]=s,e[14]=i,e[15]=o,e[16]=a,e[17]=l):l=e[17],Tt(l)}function Oc(t){const e=L.c(33),{org:n}=_e(),r=En();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:ve.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ve.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ve.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 S=(await Promise.allSettled(k.files.map(j=>{const C=k.dir?`${k.dir}/${j.name}`:j.name;return Ye(pt(n.slug,t,"file",{path:C}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find($c);if(S)throw S.reason},e[4]=n,e[5]=t,e[6]=o):o=e[6];let a;e[7]!==i||e[8]!==o?(a={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=a):a=e[9];const l=Tt(a);let c;e[10]!==n||e[11]!==t?(c=async k=>{await Ye(pt(n.slug,t,"dir",{path:k}),{method:"POST"})},e[10]=n,e[11]=t,e[12]=c):c=e[12];let f;e[13]!==i||e[14]!==c?(f={mutationFn:c,onSuccess:i},e[13]=i,e[14]=c,e[15]=f):f=e[15];const u=Tt(f);let h;e[16]!==n||e[17]!==t?(h=async k=>{await Ye(pt(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=Tt(p);let y;e[22]!==n||e[23]!==t?(y=async k=>{await Ye(pt(n.slug,t,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)})},e[22]=n,e[23]=t,e[24]=y):y=e[24];let x;e[25]!==i||e[26]!==y?(x={mutationFn:y,onSuccess:i},e[25]=i,e[26]=y,e[27]=x):x=e[27];const g=Tt(x);let b;return e[28]!==u||e[29]!==g||e[30]!==m||e[31]!==l?(b={upload:l,mkdir:u,remove:m,move:g},e[28]=u,e[29]=g,e[30]=m,e[31]=l,e[32]=b):b=e[32],b}function $c(t){return t.status==="rejected"}function Mc(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const zc=2e4;function Lc(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function Pc(){const t=L.c(17),{org:e}=_e(),n=il.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=oi({connectionId:lo,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:ve.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 cr(k)}}).data?.item??null,{data:a}=lt({...oi({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),l=ve.commerceDiscoveryDiagnostic(e.id,n),c=!!a;let f;t[3]!==a?(f=async()=>{if(!a)throw new Error("cdClient not ready");const k=await a.callTool({name:co,arguments:{}});return cr(k).diagnostic??null},t[3]=a,t[4]=f):f=t[4];let u;t[5]!==l||t[6]!==c||t[7]!==f?(u={queryKey:l,enabled:c,retry:1,refetchInterval:Fc,queryFn:f},t[5]=l,t[6]=c,t[7]=f,t[8]=u):u=t[8];const h=lt(u),p=h.data??null,m=h.isSuccess,y=o?.metadata?.siteUrl;let x;t[9]!==y?(x=Lc(y),t[9]=y,t[10]=x):x=t[10];const g=a??null;let b;return t[11]!==n||t[12]!==h.isSuccess||t[13]!==p||t[14]!==x||t[15]!==g?(b={diagnostic:p,isSuccess:m,host:x,connectionId:n,cdClient:g},t[11]=n,t[12]=h.isSuccess,t[13]=p,t[14]=x,t[15]=g,t[16]=b):b=t[16],b}function Fc(t){return t.state.status!=="error"&&Mc(t.state.data)==="generating"?zc:!1}function Uc(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:ol(t.id),main:dc(e,co)}}}function qc(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const Fs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function An(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function $r(t){return"nodeType"in t}function rt(t){var e,n;return t?An(t)?t:$r(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Mr(t){const{Document:e}=rt(t);return t instanceof e}function rs(t){return An(t)?!1:t instanceof rt(t).HTMLElement}function No(t){return t instanceof rt(t).SVGElement}function Bn(t){return t?An(t)?t.document:$r(t)?Mr(t)?t:rs(t)||No(t)?t.ownerDocument:document:document:document}const Rt=Fs?v.useLayoutEffect:v.useEffect;function Us(t){const e=v.useRef(t);return Rt(()=>{e.current=t}),v.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 Hc(){const t=v.useRef(null),e=v.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function es(t,e){e===void 0&&(e=[t]);const n=v.useRef(t);return Rt(()=>{n.current!==t&&(n.current=t)},e),n}function is(t,e){const n=v.useRef();return v.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function js(t){const e=Us(t),n=v.useRef(null),r=v.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function Ds(t){const e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}let er={};function os(t,e){return v.useMemo(()=>{if(e)return e;const n=er[t]==null?0:er[t]+1;return er[t]=n,t+"-"+n},[t,e])}function Ro(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 a=Object.entries(o);for(const[l,c]of a){const f=i[l];f!=null&&(i[l]=f+t*c)}return i},{...e})}}const Tn=Ro(1),ts=Ro(-1);function Kc(t){return"clientX"in t&&"clientY"in t}function qs(t){if(!t)return!1;const{KeyboardEvent:e}=rt(t.target);return e&&t instanceof e}function Wc(t){if(!t)return!1;const{TouchEvent:e}=rt(t.target);return e&&t instanceof e}function Ns(t){if(Wc(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 Kc(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}}}),ci="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vc(t){return t.matches(ci)?t:t.querySelector(ci)}const Gc={display:"none"};function Qc(t){let{id:e,value:n}=t;return Se.createElement("div",{id:e,style:Gc},n)}function Xc(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 Yc(){const[t,e]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const Eo=v.createContext(null);function Zc(t){const e=v.useContext(Eo);v.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Jc(){const[t]=v.useState(()=>new Set),e=v.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[v.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[t]),e]}const ed={draggable:`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CfVmXxnZ.js","assets/index-DptGhhs0.js","assets/index-DsfuG9Bb.css","assets/ArrowUp-C7ToAohd.js","assets/chat-context-D2jz7TPk.js","assets/tab-id-swDgZMnB.js","assets/dialog-D4l4Xdsp.js","assets/X-BM44NliR.js","assets/Check-CgsRhHy8.js","assets/Copy01-DZd32DIO.js","assets/hooks-BkWYCTuM.js","assets/use-mcp-client-C7paE-cE.js","assets/auth-D-uIp2CQ.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/decopilot-sse-pool-NjFnhgvn.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-virtual-mcp-Bdv0Gghv.js","assets/use-ai-providers-gi5xr2mP.js","assets/studio-tools-Dz4porfg.js","assets/use-decopilot-events-CEPq_dZU.js","assets/use-organization-settings-MkvwyFUq.js","assets/automation-runs-DChno1Ee.js","assets/select-j9WEM8Sh.js","assets/tooltip-CETnd3ay.js","assets/ChevronDown-Wb4xUAM2.js","assets/ChevronUp-Bsb-Y77Y.js","assets/useInfiniteQuery-BIuIIh4Y.js","assets/use-infinite-scroll-CK3Uizc8.js","assets/use-connection-BMokl4CO.js","assets/card-Dv8gN6wM.js","assets/sidebar-DYUk0Bcn.js","assets/LayoutLeft-m1wg28yS.js","assets/use-mobile-CYh3EGEt.js","assets/table-B1o0Pwj4.js","assets/empty-state-BOcwt_Pf.js","assets/use-members-BuBLbPW8.js","assets/use-org-auth-client-CsKd0mpo.js","assets/use-clock-tick-B9BJ0pwX.js","assets/AlertCircle-CUqW_w6g.js","assets/CheckCircle-VXm1pD5i.js","assets/DotsVertical-Do26-QjL.js","assets/agent-icon-CSidaJ6B.js","assets/Tool01-CTroi0ek.js","assets/Settings02-DqYJFs_A.js","assets/Tool02-Bh88tYGs.js","assets/XCircle-UQVfZTIm.js","assets/ArrowUpRight-Ctd2GOR9.js","assets/TrendUp01-Bqs7ykt4.js","assets/ZapSquare-Cp9irGGl.js","assets/Users03-23U4ny0D.js","assets/ChevronRight-Bb4Md-MD.js","assets/Stars02-DnbvYkKU.js","assets/CpuChip01-BPw4omKe.js","assets/Eye-B22W8AyK.js","assets/FilterLines-Bc1kxraS.js","assets/Star01-sYD82Np9.js","assets/Palette-BEUtyKuF.js","assets/SwitchHorizontal01-BnpMv-f4.js","assets/HardDrive-BUNzYRdb.js","assets/Key01-CG1NND7T.js","assets/LinkExternal01-BHdYJ4vg.js","assets/LogOut01-CTki1bzq.js","assets/Monitor01-DcyY807V.js","assets/Sun-tw8Adw2s.js","assets/Play-DrITqLDw.js","assets/Plus-BmYOuiAj.js","assets/SearchLg-Brn3yddB.js","assets/SearchMd-h05KKMiS.js","assets/Shield01-BGuTNf8w.js","assets/Stars01-CfCAp21f.js","assets/Trash01-B8ymhEo_.js","assets/Upload01-CRF4bF0L.js","assets/User01-BMMY0J4X.js","assets/Users01-Co3nN3tw.js","assets/XClose-Beh-B9Gb.js","assets/Zap-BuelQrvQ.js","assets/use-automations-DhjGDNZK.js","assets/useSuspenseInfiniteQuery-TLdwTHtB.js","assets/avatar-BumNKk7X.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-Be1Kjd_w.js","assets/calendar-DMZ7yz5j.js","assets/monaco-editor-CVT6PsIN.js","assets/spinner-DEsDb5EQ.js","assets/index-yBY16i4r.js","assets/shell-layout-Qdn6Ab14.js","assets/required-auth-layout-PejcRLRr.js","assets/use-org-sso-CCq7sZnB.js","assets/integration-icon-BuPK5TYy.js","assets/use-navigate-to-agent-Bqz6pwLi.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-Bm75VTUe.js","assets/form-DMrBv8ot.js","assets/label-CuF09Kzu.js","assets/input-zj8m7n84.js","assets/drawer-C3pYai9a.js","assets/collection-search-CclDfE5O.js","assets/tabs-VUaZhlmm.js","assets/toggle-group-BsLp02VA.js","assets/use-deco-credits-UciEpjbi.js","assets/popover-Bt8NA7TT.js","assets/alert-dialog-FVJZWl26.js","assets/toolbar-B5h5oyq6.js","assets/skeleton--88gs_EO.js","assets/github-repo-picker-Bw5gD-qj.js","assets/use-debounced-value-B-JvHFEo.js","assets/authenticate-and-persist-oauth-DObbFBl5.js","assets/mcp-oauth-shlK2GTY.js","assets/use-mcp-tools-DS7HyfmS.js","assets/extract-connection-data-Df7SJj9F.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-CAXumITS.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-HFSstqIJ.js","assets/use-registry-connections-YnGGDwWM.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-Bs8WvAl6.js","assets/connection-form-helpers-CKgaIsD-.js","assets/collection-tabs-B0dT6Ygy.js","assets/badge-BFv5PsKE.js","assets/select-model-C8d0poms.js","assets/checkbox-B5fS-ChG.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-fm3Mm6Bm.js","assets/dropdown-menu-Q--ZyLLW.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-CyFcW6V5.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-BqS7iGUH.js","assets/pt-BR-CLy76QW2.js","assets/use-mcp-auth-status-h3xamCXm.js","assets/use-debounced-autosave-D0IOAPSF.js","assets/index-DIkj5DIc.js","assets/search-input-Bf_CjAux.js","assets/switch-CjtCOM9l.js","assets/use-secrets-HEeF0D3f.js","assets/command-Bjp1VURS.js","assets/index-DBssoMSm.js","assets/useQueries-Bq9KgQR-.js","assets/use-file-configs-I7iEol3j.js","assets/automation-list-row-DMeZ0lJ3.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
2
+ import{G as Pa,r as v,c as L,x as Fa,K as ve,F as _e,o as En,e as Tt,n as lt,ax as Se,ag as Ut,a as Ua,t as At,a0 as qa,m as Z,j as d,b as ce,aW as Vi,aX as Gi,aY as Qi,aZ as Xi,a_ as Yi,a$ as Zi,b0 as Ji,b1 as eo,b2 as to,B as Xe,E as Ha,d as no,p as ii,k as wr,u as Ka,aG as Wa}from"./index-DptGhhs0.js";import{g as Dt}from"./get-initials-D-f_fDFw.js";import{A as Nt}from"./avatar-BumNKk7X.js";import{aC as ss,af as Va,ag as Ga,ai as Qa,a6 as Xa,aD as Ya,B as Za,p as Ja,aE as so,X as ro,e as io,ae as el,j as oo,aF as tl,aB as Zs,as as Sr,_ as Sn,aG as nl,n as Cr,az as sl}from"./agent-icon-CSidaJ6B.js";import{i as ao}from"./SwitchHorizontal01-BnpMv-f4.js";import{s as Jn}from"./Plus-BmYOuiAj.js";import{i as Cn}from"./X-BM44NliR.js";import{a as wn,b as Gn,P as Qn}from"./popover-Bt8NA7TT.js";import{a as jt,D as jn,b as Dn,c as Nn,d as zn,e as Ln,f as Pn,i as rl}from"./dropdown-menu-Q--ZyLLW.js";import{W as il,m as oi,S as lo,C as co,g as ol,u as al,h as ll,Q as cl,j as dl,a as ul}from"./use-mcp-client-C7paE-cE.js";import{u as fl,G as ar,a as hl}from"./github-repo-picker-Bw5gD-qj.js";import{b as Tr,d as jr,e as Dr,h as pl,a as gl,c as ml}from"./dialog-D4l4Xdsp.js";import{b as xl,u as bl}from"./use-connection-BMokl4CO.js";import{b as yl}from"./provision-repo-scoped-github-connection-CAXumITS.js";import{a as kl}from"./authenticate-and-persist-oauth-DObbFBl5.js";import{e as vl}from"./extract-connection-data-Df7SJj9F.js";import{u as uo}from"./use-members-BuBLbPW8.js";import{u as In}from"./studio-tools-Dz4porfg.js";import{t as wl,T as Sl,a as Cl,S as nt,i as ai}from"./decopilot-sse-pool-NjFnhgvn.js";import{u as Tl}from"./use-decopilot-events-CEPq_dZU.js";import{a as fo}from"./format-time-BnbuEtat.js";import{i as Ls}from"./AlertCircle-CUqW_w6g.js";import{i as _n}from"./CheckCircle-VXm1pD5i.js";import{i as jl}from"./DotsVertical-Do26-QjL.js";import{s as Dl}from"./Eye-B22W8AyK.js";import{u as ho,a as Nl,b as Rl}from"./use-tags-BDVrYGwL.js";import{o as El,P as qt,a as Nr,D as Il,p as _l,q as Al,S as Bt,r as Bl,T as po,F as Js,s as Kn,v as Ol,w as $l,x as go,N as Ml,k as Rr,y as zl,z as Ll,d as mo,n as Pl,A as Mt,B as Fl,G as Fn,H as Ul,I as xo,R as bo,m as yo,J as ko,K as ql,L as Hl,Q as Kl,e as Wl,u as Vl,f as Gl,j as Ql,C as vo,c as Xl}from"./calendar-DMZ7yz5j.js";import{S as yn}from"./skeleton--88gs_EO.js";import{u as Yl}from"./use-copy-Be1Kjd_w.js";import{i as Ps}from"./Check-CgsRhHy8.js";import{i as wo}from"./ChevronRight-Bb4Md-MD.js";import{a as Zl}from"./Copy01-DZd32DIO.js";import{n as Jl,i as So}from"./Tool02-Bh88tYGs.js";import{n as Ss}from"./LinkExternal01-BHdYJ4vg.js";import{b as Co,i as To}from"./XCircle-UQVfZTIm.js";import{s as jo}from"./Trash01-B8ymhEo_.js";import{u as li,a as ec}from"./use-organization-settings-MkvwyFUq.js";import{d as Er,a as Ir,c as Pt,b as Rn,C as _r,e as Ar}from"./command-Bjp1VURS.js";import{s as lr}from"./User01-BMMY0J4X.js";import{d as tc,b as nc,f as sc,g as rc,a as ic,D as oc}from"./drawer-C3pYai9a.js";import{t as Br}from"./ChevronDown-Wb4xUAM2.js";import{i as Do}from"./FilterLines-Bc1kxraS.js";import{s as ac}from"./TrendUp01-Bqs7ykt4.js";import{u as lc}from"./shell-layout-Qdn6Ab14.js";import{b as cc}from"./hooks-BkWYCTuM.js";import{f as dc}from"./tab-id-swDgZMnB.js";import{u as cr}from"./companions-core-BDbmsLM0.js";function uc(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 Ug="__home__";function Or(t,e){return Pa.chatDraft(t,e)}function fc(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 hc(t,e,n,r,s){const i=Or(e,n);if(uc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},a=JSON.stringify(o);try{t.setItem(i,a)}catch(l){if(pc(l)){const c=new TextEncoder().encode(a).byteLength;s?.onQuotaExceeded?.({docSizeBytes:c});return}throw l}}function qg(t,e,n){const r=Or(e,n),s=t.getItem(r),i=fc(s);return s!==null&&i===null&&t.removeItem(r),i}function Hg(t,e,n){t.removeItem(Or(e,n))}function pc(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}var gc=El;function mc(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:a}=t,l=r&&!s,c=Al(n),f=new RegExp(`\\s${c}$`),u=o?"^":"",h=s?"":c,p=l?new RegExp(`${u}${c}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${h}]*`,"gm"),m=((e=a.nodeBefore)==null?void 0:e.isText)&&a.nodeBefore.text;if(!m)return null;const y=a.pos-m.length,x=Array.from(m.matchAll(p)).pop();if(!x||x.input===void 0||x.index===void 0)return null;const g=x.input.slice(Math.max(0,x.index-1),x.index),b=new RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!b)return null;const k=y+x.index;let w=k+x[0].length;return l&&f.test(m.slice(w-1,w+1))&&(x[0]+=" ",w+=1),k<a.pos&&w>=a.pos?{range:{from:k,to:w},query:x[0].slice(n.length),text:x[0]}:null}var xc=new qt("suggestion");function bc({pluginKey:t=xc,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:f="is-empty",command:u=()=>null,items:h=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:y=mc,shouldShow:x}){let g;const b=p?.(),k=()=>{const S=e.state.selection.$anchor.pos,T=e.view.coordsAtPos(S),{top:N,right:R,bottom:D,left:E}=T;try{return new DOMRect(E,N,R-E,D-N)}catch{return null}},w=(S,T)=>T?()=>{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,T){var N;try{const D=t.getState(S.state),E=D?.decorationId?S.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`):null,M={editor:e,range:D?.range||{from:0,to:0},query:D?.query||null,text:D?.text||null,items:[],command:A=>u({editor:e,range:D?.range||{from:0,to:0},props:A}),decorationNode:E,clientRect:w(S,E)};(N=b?.onExit)==null||N.call(b,M)}catch{}const R=S.state.tr.setMeta(T,{exit:!0});S.dispatch(R)}const j=new Nr({key:t,view(){return{update:async(S,T)=>{var N,R,D,E,M,A,U;const I=(N=this.key)==null?void 0:N.getState(T),B=(R=this.key)==null?void 0:R.getState(S.state),O=I.active&&B.active&&I.range.from!==B.range.from,K=!I.active&&B.active,Y=I.active&&!B.active,P=!K&&!Y&&I.query!==B.query,q=K||O&&P,Q=P||O,G=Y||O&&P;if(!q&&!Q&&!G)return;const ee=G&&!q?I:B,W=S.dom.querySelector(`[data-decoration-id="${ee.decorationId}"]`);g={editor:e,range:ee.range,query:ee.query,text:ee.text,items:[],command:ne=>u({editor:e,range:ee.range,props:ne}),decorationNode:W,clientRect:w(S,W)},q&&((D=b?.onBeforeStart)==null||D.call(b,g)),Q&&((E=b?.onBeforeUpdate)==null||E.call(b,g)),(Q||q)&&(g.items=await h({editor:e,query:ee.query})),G&&((M=b?.onExit)==null||M.call(b,g)),Q&&((A=b?.onUpdate)==null||A.call(b,g)),q&&((U=b?.onStart)==null||U.call(b,g))},destroy:()=>{var S;g&&((S=b?.onExit)==null||S.call(b,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,T,N,R){const{isEditable:D}=e,{composing:E}=e.view,{selection:M}=S,{empty:A,from:U}=M,I={...T},B=S.getMeta(t);if(B&&B.exit)return I.active=!1,I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null,I;if(I.composing=E,D&&(A||e.view.composing)){(U<T.range.from||U>T.range.to)&&!E&&!T.composing&&(I.active=!1);const O=y({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:M.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;O&&m({editor:e,state:R,range:O.range,isActive:T.active})&&(!x||x({editor:e,range:O.range,query:O.query,text:O.text,transaction:S}))?(I.active=!0,I.decorationId=T.decorationId?T.decorationId:K,I.range=O.range,I.query=O.query,I.text=O.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(S,T){var N,R,D,E;const{active:M,range:A}=j.getState(S.state);if(!M)return!1;if(T.key==="Escape"||T.key==="Esc"){const I=j.getState(S.state),B=(N=g?.decorationNode)!=null?N:null,O=B??(I?.decorationId?S.dom.querySelector(`[data-decoration-id="${I.decorationId}"]`):null);if(((R=b?.onKeyDown)==null?void 0:R.call(b,{view:S,event:T,range:I.range}))||!1)return!0;const Y={editor:e,range:I.range,query:I.query,text:I.text,items:[],command:P=>u({editor:e,range:I.range,props:P}),decorationNode:O,clientRect:O?()=>O.getBoundingClientRect()||null:null};return(D=b?.onExit)==null||D.call(b,Y),C(S,t),!0}return((E=b?.onKeyDown)==null?void 0:E.call(b,{view:S,event:T,range:A}))||!1},decorations(S){const{active:T,range:N,decorationId:R,query:D}=j.getState(S);if(!T)return null;const E=!D?.length,M=[l];return E&&M.push(f),Il.create(S.doc,[_l.inline(N.from,N.to,{nodeName:a,class:M.join(" "),"data-decoration-id":R,"data-decoration-content":c})])}}});return j}function yc(t){const e=L.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[a,l]=v.useState(0),c=v.useRef(s),f=v.useRef(a),u=v.useRef(i),h=v.useRef(o),p=v.useDeferredValue(r);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{l(0)},e[0]=m):m=e[0];let y;e[1]!==p?(y=[p],e[1]=p,e[2]=y):y=e[2],v.useEffect(m,y);let x,g;e[3]!==s.length||e[4]!==a?(x=()=>{a>=s.length&&s.length>0&&l(0)},g=[s.length,a],e[3]=s.length,e[4]=a,e[5]=x,e[6]=g):(x=e[5],g=e[6]),v.useEffect(x,g);let b,k;e[7]!==s?(b=()=>{c.current=s},k=[s],e[7]=s,e[8]=b,e[9]=k):(b=e[8],k=e[9]),v.useEffect(b,k);let w,C;e[10]!==a?(w=()=>{f.current=a},C=[a],e[10]=a,e[11]=w,e[12]=C):(w=e[11],C=e[12]),v.useEffect(w,C);let j,S;e[13]!==i?(S=()=>{u.current=i},j=[i],e[13]=i,e[14]=j,e[15]=S):(j=e[14],S=e[15]),v.useEffect(S,j);let T,N;e[16]!==o?(T=()=>{h.current=o},N=[o],e[16]=o,e[17]=T,e[18]=N):(T=e[17],N=e[18]),v.useEffect(T,N);let R,D;e[19]!==n?(R=()=>{if(n?.isDestroyed)return;let A;try{A=n.view.dom}catch{return}if(!A)return;const U=B=>{const O=c.current;if(!O.length)return!1;const K=()=>l(P=>(P+1)%O.length),Y=()=>l(P=>(P-1+O.length)%O.length);switch(B.key){case"ArrowUp":return B.preventDefault(),Y(),!0;case"ArrowDown":return B.preventDefault(),K(),!0;case"Tab":return B.preventDefault(),B.shiftKey?Y():K(),!0;case"Home":return B.preventDefault(),l(0),!0;case"End":return B.preventDefault(),l(O.length-1),!0;case"Enter":{if(B.isComposing)return!1;B.preventDefault();const P=f.current;return P!==-1&&O[P]&&u.current?.(O[P],P),!0}case"Escape":return B.preventDefault(),h.current?.(),!0;default:return!1}},I=B=>{U(B)};return A.addEventListener("keydown",I,!0),()=>{A?.removeEventListener("keydown",I,!0)}},D=[n],e[19]=n,e[20]=R,e[21]=D):(R=e[20],D=e[21]),v.useEffect(R,D);const E=s.length?a:void 0;let M;return e[22]!==E?(M={selectedIndex:E,setSelectedIndex:l},e[22]=E,e[23]=M):M=e[23],M}function kc(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 vc=v.createContext(void 0);function wc(){const t=v.useContext(vc);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Kg(t){const e=L.c(16),{editor:n,char:r,pluginKey:s,allow:i,onOpenChange:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=a):a=e[0];const[l,c]=v.useReducer(kc,a);let f;e[1]!==o?(f=y=>{o?.(y)},e[1]=o,e[2]=f):f=e[2];const u=v.useEffectEvent(f);let h;e[3]!==r||e[4]!==i||e[5]!==n||e[6]!==u||e[7]!==s?(h=()=>{if(n?.isDestroyed)return;const y=s instanceof qt?s:new qt(s);n.state.plugins.find(b=>b.spec.key===y)&&n.unregisterPlugin(y);const g=bc({pluginKey:y,editor:n,char:r,allow(b){const k=n.state.doc.resolve(b.range.from);for(let w=k.depth;w>0;w--)if(k.node(w).type.name==="image")return!1;return!(i&&!i(b))},command(){},render:()=>({onStart:b=>{c({type:"ON_START",payload:{element:b.decorationNode??null,query:b.query,range:b.range}}),u(!0)},onUpdate:b=>{c({type:"ON_UPDATE",payload:{element:b.decorationNode??null,query:b.query,range:b.range}})},onKeyDown:b=>b.event.key==="Escape"?(c({type:"ON_EXIT"}),!0):!1,onExit:()=>{c({type:"ON_EXIT"}),u(!1)}}),items:Sc});return n.registerPlugin(g),()=>{n?.isDestroyed||n.unregisterPlugin(y)}},e[3]=r,e[4]=i,e[5]=n,e[6]=u,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,c,i],e[9]=r,e[10]=i,e[11]=n,e[12]=s,e[13]=p):p=e[13],v.useEffect(h,p);let m;return e[14]!==l?(m={state:l,dispatch:c},e[14]=l,e[15]=m):m=e[15],m}function Sc(){return[]}function Wg({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=wc(),o=v.useDeferredValue(s.query),{data:a}=Fa({queryKey:ve.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),l=()=>{i({type:"ON_EXIT"})},c=async(u,h)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:u});try{const{view:p}=t,y=p.state.selection.$to.nodeAfter?.text?.startsWith(" "),x=s.range?{...s.range}:{from:0,to:0};y&&s.range&&(x.to+=1),await r({range:x,item:u})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):l()}catch{l()}}},{selectedIndex:f}=yc({editor:t,query:o,items:a,onSelect:c,onClose:l});return{selectedItem:s.selectedItem,items:a,selectedIndex:f,close:l,onSelect:c}}function Vg(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function pt(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 Gg(t,e){const n=L.c(15),{org:r}=_e();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=ve.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.id||n[5]!==t?(i=(l,c)=>c?.queryKey[1]===r.id&&c.queryKey[2]===t?l:void 0,n[4]=r.id,n[5]=t,n[6]=i):i=n[6];let o;n[7]!==r.slug||n[8]!==e||n[9]!==t?(o=async()=>(await(await Ye(pt(r.slug,t,"list",{path:e}))).json()).entries.toSorted(Cc),n[7]=r.slug,n[8]=e,n[9]=t,n[10]=o):o=n[10];let a;return n[11]!==s||n[12]!==i||n[13]!==o?(a={queryKey:s,placeholderData:i,queryFn:o},n[11]=s,n[12]=i,n[13]=o,n[14]=a):a=n[14],lt(a)}function Cc(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function Qg(t,e,n){const r=L.c(15),{org:s}=_e();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=ve.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 a;r[4]!==n?(a=n?.refetchIntervalWhenAbsent?f=>f.state.data?!1:n.refetchIntervalWhenAbsent??!1:void 0,r[4]=n,r[5]=a):a=r[5];let l;r[6]!==s.slug||r[7]!==e||r[8]!==t?(l=async()=>{const f=await Ye(pt(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]=l):l=r[9];let c;return r[10]!==i||r[11]!==o||r[12]!==a||r[13]!==l?(c={queryKey:i,enabled:o,refetchInterval:a,queryFn:l},r[10]=i,r[11]=o,r[12]=a,r[13]=l,r[14]=c):c=r[14],lt(c)}function Xg(t){const e=L.c(9),{org:n}=_e();let r;e[0]!==n.id||e[1]!==t?(r=ve.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(pt(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 Yg(t,e){const n=L.c(9),r=t===void 0?60:t,{org:s}=_e();let i;n[0]!==s.id?(i=ve.orgFsRecent(s.id),n[0]=s.id,n[1]=i):i=n[1];const o=e?.enabled;let a;n[2]!==r||n[3]!==s.slug?(a=async()=>(await(await Ye(`/api/${encodeURIComponent(s.slug)}/fs/recent?limit=${r}`)).json()).entries,n[2]=r,n[3]=s.slug,n[4]=a):a=n[4];let l;return n[5]!==i||n[6]!==o||n[7]!==a?(l={queryKey:i,enabled:o,queryFn:a},n[5]=i,n[6]=o,n[7]=a,n[8]=l):l=n[8],lt(l)}const Tc=50;function Zg(t,e){const n=L.c(16),{org:r}=_e();let s;n[0]!==r.id||n[1]!==t||n[2]!==e?.prefix||n[3]!==e?.volume?(s=ve.orgFsSearch(r.id,t,e?.volume??"",e?.prefix??""),n[0]=r.id,n[1]=t,n[2]=e?.prefix,n[3]=e?.volume,n[4]=s):s=n[4];const i=t.length>0;let o;n[5]!==r.id?(o=(c,f)=>f?.queryKey[1]===r.id?c:void 0,n[5]=r.id,n[6]=o):o=n[6];let a;n[7]!==r.slug||n[8]!==t||n[9]!==e?(a=async()=>{const c=new URLSearchParams({q:t,limit:String(Tc)});return e&&(c.set("volume",e.volume),e.prefix&&c.set("prefix",e.prefix)),(await(await Ye(`/api/${encodeURIComponent(r.slug)}/fs/search?${c}`)).json()).entries},n[7]=r.slug,n[8]=t,n[9]=e,n[10]=a):a=n[10];let l;return n[11]!==s||n[12]!==i||n[13]!==o||n[14]!==a?(l={queryKey:s,enabled:i,placeholderData:o,queryFn:a},n[11]=s,n[12]=i,n[13]=o,n[14]=a,n[15]=l):l=n[15],lt(l)}function Jg(t){const e=L.c(8),{org:n}=_e();let r;e[0]!==n.id?(r=ve.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 a=await Ye(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:l}=await a.json();return l.map(jc)},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 jc(t){return{volume:t.volume,path:t.path}}async function em(t){const e=await Ye(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function Dc(t,e,n){return(await Ye(pt(t,e,"read",{path:n}))).text()}const Nc=new Set(["md","mdx","markdown","txt","text"]),Rc=25,Ec=64*1024,Ic=256*1024,_c=4;function Ac(t){const e=t.lastIndexOf(".");return e===-1?!1:Nc.has(t.slice(e+1).toLowerCase())}async function tm(t,e,n){const r=n?`${n}/`:"",s=u=>u.startsWith(r)?u.slice(r.length):u,i=[],o=[],a=[{path:n,depth:0}];for(;a.length>0;){const u=a.shift();if(!u)break;let h;try{h=(await(await Ye(pt(t,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const p of[...h].sort((m,y)=>m.path.localeCompare(y.path))){if(p.kind==="dir"){u.depth<_c&&a.push({path:p.path,depth:u.depth+1});continue}Ac(p.path)&&p.size<=Ec&&i.length<Rc?i.push(p.path):o.push(s(p.path))}}const l=await Promise.all(i.map(u=>Dc(t,e,u).catch(()=>null))),c=[];let f=0;return i.forEach((u,h)=>{const p=l[h];if(p==null||f+p.length>Ic){o.push(s(u));return}f+=p.length,c.push({relPath:s(u),content:p})}),c.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),o.sort(),{files:c,omittedPaths:o}}function nm(){const t=L.c(7),{org:e}=_e();let n;t[0]!==e.id?(n=ve.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 Bc(t){const e=L.c(3),{org:n}=_e();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>pt(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function sm(){const t=L.c(2),{org:e}=_e();let n;return t[0]!==e.slug?(n=(r,s)=>pt(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function rm(t){const e=L.c(3),{org:n}=_e();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await Ye(pt(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],Tt(r)}function im(t){const e=L.c(18),{org:n}=_e(),r=En();let s;e[0]!==n||e[1]!==t?(s=async c=>(await(await Ye(pt(n.slug,t,"public",{path:c.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:c.mode,password:c.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 c=>{const f=ve.orgFsStat(n.id,t,c.path);await r.cancelQueries({queryKey:f});const u=r.getQueryData(f),h=c.mode!=="private";return r.setQueryData(f,p=>p&&{...p,readPublic:h,effectivePublic:h,shareMode:c.mode}),{key:f,previous:u}},e[3]=n,e[4]=r,e[5]=t,e[6]=i):i=e[6];let o;e[7]!==r?(o=(c,f,u)=>{u&&r.setQueryData(u.key,u.previous)},e[7]=r,e[8]=o):o=e[8];let a;e[9]!==n||e[10]!==r||e[11]!==t?(a=(c,f,u)=>{r.invalidateQueries({queryKey:ve.orgFsStat(n.id,t,u.path)}),r.invalidateQueries({queryKey:ve.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ve.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ve.orgFsSearchRoot(n.id)})},e[9]=n,e[10]=r,e[11]=t,e[12]=a):a=e[12];let l;return e[13]!==s||e[14]!==i||e[15]!==o||e[16]!==a?(l={mutationFn:s,onMutate:i,onError:o,onSettled:a},e[13]=s,e[14]=i,e[15]=o,e[16]=a,e[17]=l):l=e[17],Tt(l)}function Oc(t){const e=L.c(33),{org:n}=_e(),r=En();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:ve.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ve.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ve.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(j=>{const S=k.dir?`${k.dir}/${j.name}`:j.name;return Ye(pt(n.slug,t,"file",{path:S}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find($c);if(C)throw C.reason},e[4]=n,e[5]=t,e[6]=o):o=e[6];let a;e[7]!==i||e[8]!==o?(a={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=a):a=e[9];const l=Tt(a);let c;e[10]!==n||e[11]!==t?(c=async k=>{await Ye(pt(n.slug,t,"dir",{path:k}),{method:"POST"})},e[10]=n,e[11]=t,e[12]=c):c=e[12];let f;e[13]!==i||e[14]!==c?(f={mutationFn:c,onSuccess:i},e[13]=i,e[14]=c,e[15]=f):f=e[15];const u=Tt(f);let h;e[16]!==n||e[17]!==t?(h=async k=>{await Ye(pt(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=Tt(p);let y;e[22]!==n||e[23]!==t?(y=async k=>{await Ye(pt(n.slug,t,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)})},e[22]=n,e[23]=t,e[24]=y):y=e[24];let x;e[25]!==i||e[26]!==y?(x={mutationFn:y,onSuccess:i},e[25]=i,e[26]=y,e[27]=x):x=e[27];const g=Tt(x);let b;return e[28]!==u||e[29]!==g||e[30]!==m||e[31]!==l?(b={upload:l,mkdir:u,remove:m,move:g},e[28]=u,e[29]=g,e[30]=m,e[31]=l,e[32]=b):b=e[32],b}function $c(t){return t.status==="rejected"}function Mc(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const zc=2e4;function Lc(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function Pc(){const t=L.c(17),{org:e}=_e(),n=il.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=oi({connectionId:lo,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:ve.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 cr(k)}}).data?.item??null,{data:a}=lt({...oi({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),l=ve.commerceDiscoveryDiagnostic(e.id,n),c=!!a;let f;t[3]!==a?(f=async()=>{if(!a)throw new Error("cdClient not ready");const k=await a.callTool({name:co,arguments:{}});return cr(k).diagnostic??null},t[3]=a,t[4]=f):f=t[4];let u;t[5]!==l||t[6]!==c||t[7]!==f?(u={queryKey:l,enabled:c,retry:1,refetchInterval:Fc,queryFn:f},t[5]=l,t[6]=c,t[7]=f,t[8]=u):u=t[8];const h=lt(u),p=h.data??null,m=h.isSuccess,y=o?.metadata?.siteUrl;let x;t[9]!==y?(x=Lc(y),t[9]=y,t[10]=x):x=t[10];const g=a??null;let b;return t[11]!==n||t[12]!==h.isSuccess||t[13]!==p||t[14]!==x||t[15]!==g?(b={diagnostic:p,isSuccess:m,host:x,connectionId:n,cdClient:g},t[11]=n,t[12]=h.isSuccess,t[13]=p,t[14]=x,t[15]=g,t[16]=b):b=t[16],b}function Fc(t){return t.state.status!=="error"&&Mc(t.state.data)==="generating"?zc:!1}function Uc(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:ol(t.id),main:dc(e,co)}}}function qc(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const Fs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function An(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function $r(t){return"nodeType"in t}function rt(t){var e,n;return t?An(t)?t:$r(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Mr(t){const{Document:e}=rt(t);return t instanceof e}function rs(t){return An(t)?!1:t instanceof rt(t).HTMLElement}function No(t){return t instanceof rt(t).SVGElement}function Bn(t){return t?An(t)?t.document:$r(t)?Mr(t)?t:rs(t)||No(t)?t.ownerDocument:document:document:document}const Rt=Fs?v.useLayoutEffect:v.useEffect;function Us(t){const e=v.useRef(t);return Rt(()=>{e.current=t}),v.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 Hc(){const t=v.useRef(null),e=v.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function es(t,e){e===void 0&&(e=[t]);const n=v.useRef(t);return Rt(()=>{n.current!==t&&(n.current=t)},e),n}function is(t,e){const n=v.useRef();return v.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function js(t){const e=Us(t),n=v.useRef(null),r=v.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function Ds(t){const e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}let er={};function os(t,e){return v.useMemo(()=>{if(e)return e;const n=er[t]==null?0:er[t]+1;return er[t]=n,t+"-"+n},[t,e])}function Ro(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 a=Object.entries(o);for(const[l,c]of a){const f=i[l];f!=null&&(i[l]=f+t*c)}return i},{...e})}}const Tn=Ro(1),ts=Ro(-1);function Kc(t){return"clientX"in t&&"clientY"in t}function qs(t){if(!t)return!1;const{KeyboardEvent:e}=rt(t.target);return e&&t instanceof e}function Wc(t){if(!t)return!1;const{TouchEvent:e}=rt(t.target);return e&&t instanceof e}function Ns(t){if(Wc(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 Kc(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}}}),ci="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vc(t){return t.matches(ci)?t:t.querySelector(ci)}const Gc={display:"none"};function Qc(t){let{id:e,value:n}=t;return Se.createElement("div",{id:e,style:Gc},n)}function Xc(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 Yc(){const[t,e]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const Eo=v.createContext(null);function Zc(t){const e=v.useContext(Eo);v.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Jc(){const[t]=v.useState(()=>new Set),e=v.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[v.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[t]),e]}const ed={draggable:`
3
3
  To pick up a draggable item, press the space bar.
4
4
  While dragging, use the arrow keys to move the item.
5
5
  Press space again to drop the item in its new position, or press escape to cancel.
6
- `},td={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 nd(t){let{announcements:e=td,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=ed}=t;const{announce:i,announcement:o}=Yc(),a=os("DndLiveRegion"),[l,c]=v.useState(!1);if(v.useEffect(()=>{c(!0)},[]),Zc(v.useMemo(()=>({onDragStart(u){let{active:h}=u;i(e.onDragStart({active:h}))},onDragMove(u){let{active:h,over:p}=u;e.onDragMove&&i(e.onDragMove({active:h,over:p}))},onDragOver(u){let{active:h,over:p}=u;i(e.onDragOver({active:h,over:p}))},onDragEnd(u){let{active:h,over:p}=u;i(e.onDragEnd({active:h,over:p}))},onDragCancel(u){let{active:h,over:p}=u;i(e.onDragCancel({active:h,over:p}))}}),[i,e])),!l)return null;const f=Se.createElement(Se.Fragment,null,Se.createElement(Qc,{id:r,value:s.draggable}),Se.createElement(Xc,{id:a,announcement:o}));return n?Ut.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 Rs(){}function di(t,e){return v.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function sd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Et=Object.freeze({x:0,y:0});function Io(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function rd(t,e){const n=Ns(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 _o(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function id(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function ui(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 Ao(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function fi(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 om=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=fi(e,e.left,e.top),i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=Io(fi(l),s);i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(_o)},Bo=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=ui(e),i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=ui(l),f=s.reduce((h,p,m)=>h+Io(c[m],p),0),u=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(_o)};function od(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,a=i-n;if(r<s&&n<i){const l=e.width*e.height,c=t.width*t.height,f=o*a,u=f/(l+c-f);return Number(u.toFixed(4))}return 0}const ad=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const l=od(a,e);l>0&&s.push({id:o,data:{droppableContainer:i,value:l}})}}return s.sort(id)};function ld(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function Oo(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Et}function cd(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,a)=>({...o,top:o.top+t*a.y,bottom:o.bottom+t*a.y,left:o.left+t*a.x,right:o.right+t*a.x}),{...n})}}const dd=cd(1);function $o(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 ud(t,e,n){const r=$o(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:a}=r,l=t.left-o-(1-s)*parseFloat(n),c=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,u=i?t.height/i:t.height;return{width:f,height:u,top:c,right:l+f,bottom:c+u,left:l}}const fd={ignoreTransform:!1};function On(t,e){e===void 0&&(e=fd);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:f}=rt(t).getComputedStyle(t);c&&(n=ud(n,c,f))}const{top:r,left:s,width:i,height:o,bottom:a,right:l}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:l}}function hi(t){return On(t,{ignoreTransform:!0})}function hd(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function pd(t,e){return e===void 0&&(e=rt(t).getComputedStyle(t)),e.position==="fixed"}function gd(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 Hs(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(Mr(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!rs(s)||No(s)||n.includes(s))return n;const i=rt(t).getComputedStyle(s);return s!==t&&gd(s,i)&&n.push(s),pd(s,i)?n:r(s.parentNode)}return t?r(t):n}function Mo(t){const[e]=Hs(t,1);return e??null}function tr(t){return!Fs||!t?null:An(t)?t:$r(t)?Mr(t)||t===Bn(t).scrollingElement?window:rs(t)?t:null:null}function zo(t){return An(t)?t.scrollX:t.scrollLeft}function Lo(t){return An(t)?t.scrollY:t.scrollTop}function dr(t){return{x:zo(t),y:Lo(t)}}var Pe;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Pe||(Pe={}));function Po(t){return!Fs||!t?!1:t===document.scrollingElement}function Fo(t){const e={x:0,y:0},n=Po(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,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:e}}const md={x:.2,y:.2};function xd(t,e,n,r,s){let{top:i,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=md);const{isTop:c,isBottom:f,isLeft:u,isRight:h}=Fo(t),p={x:0,y:0},m={x:0,y:0},y={height:e.height*s.y,width:e.width*s.x};return!c&&i<=e.top+y.height?(p.y=Pe.Backward,m.y=r*Math.abs((e.top+y.height-i)/y.height)):!f&&l>=e.bottom-y.height&&(p.y=Pe.Forward,m.y=r*Math.abs((e.bottom-y.height-l)/y.height)),!h&&a>=e.right-y.width?(p.x=Pe.Forward,m.x=r*Math.abs((e.right-y.width-a)/y.width)):!u&&o<=e.left+y.width&&(p.x=Pe.Backward,m.x=r*Math.abs((e.left+y.width-o)/y.width)),{direction:p,speed:m}}function bd(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 Uo(t){return t.reduce((e,n)=>Tn(e,dr(n)),Et)}function yd(t){return t.reduce((e,n)=>e+zo(n),0)}function kd(t){return t.reduce((e,n)=>e+Lo(n),0)}function qo(t,e){if(e===void 0&&(e=On),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);Mo(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const vd=[["x",["left","right"],yd],["y",["top","bottom"],kd]];class zr{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=Hs(n),s=Uo(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,a]of vd)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(r),f=s[i]-c;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Xn{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 wd(t){const{EventTarget:e}=rt(t);return t instanceof e?t:Bn(t)}function nr(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 bt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(bt||(bt={}));function pi(t){t.preventDefault()}function Sd(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 Ho={start:[oe.Space,oe.Enter],cancel:[oe.Esc],end:[oe.Space,oe.Enter,oe.Tab]},Cd=(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 Lr{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 Xn(Bn(n)),this.windowListeners=new Xn(rt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bt.Resize,this.handleCancel),this.windowListeners.add(bt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&qo(r),n(Et)}handleKeyDown(e){if(qs(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=Ho,coordinateGetter:o=Cd,scrollBehavior:a="smooth"}=s,{code:l}=e;if(i.end.includes(l)){this.handleEnd(e);return}if(i.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:c}=r.current,f=c?{x:c.left,y:c.top}:Et;this.referenceCoordinates||(this.referenceCoordinates=f);const u=o(e,{active:n,context:r.current,currentCoordinates:f});if(u){const h=ts(u,f),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const y of m){const x=e.code,{isTop:g,isRight:b,isLeft:k,isBottom:w,maxScroll:S,minScroll:j}=Fo(y),C=bd(y),T={x:Math.min(x===oe.Right?C.right-C.width/2:C.right,Math.max(x===oe.Right?C.left:C.left+C.width/2,u.x)),y:Math.min(x===oe.Down?C.bottom-C.height/2:C.bottom,Math.max(x===oe.Down?C.top:C.top+C.height/2,u.y))},N=x===oe.Right&&!b||x===oe.Left&&!k,R=x===oe.Down&&!w||x===oe.Up&&!g;if(N&&T.x!==u.x){const D=y.scrollLeft+h.x,E=x===oe.Right&&D<=S.x||x===oe.Left&&D>=j.x;if(E&&!h.y){y.scrollTo({left:D,behavior:a});return}E?p.x=y.scrollLeft-D:p.x=x===oe.Right?y.scrollLeft-S.x:y.scrollLeft-j.x,p.x&&y.scrollBy({left:-p.x,behavior:a});break}else if(R&&T.y!==u.y){const D=y.scrollTop+h.y,E=x===oe.Down&&D<=S.y||x===oe.Up&&D>=j.y;if(E&&!h.x){y.scrollTo({top:D,behavior:a});return}E?p.y=y.scrollTop-D:p.y=x===oe.Down?y.scrollTop-S.y:y.scrollTop-j.y,p.y&&y.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(e,Tn(ts(u,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()}}Lr.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=Ho,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function gi(t){return!!(t&&"distance"in t)}function mi(t){return!!(t&&"delay"in t)}class Pr{constructor(e,n,r){var s;r===void 0&&(r=wd(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=Bn(o),this.documentListeners=new Xn(this.document),this.listeners=new Xn(r),this.windowListeners=new Xn(rt(o)),this.initialCoordinates=(s=Ns(i))!=null?s:Et,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(bt.Resize,this.handleCancel),this.windowListeners.add(bt.DragStart,pi),this.windowListeners.add(bt.VisibilityChange,this.handleCancel),this.windowListeners.add(bt.ContextMenu,pi),this.documentListeners.add(bt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mi(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(gi(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(bt.Click,Sd,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bt.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const l=(n=Ns(e))!=null?n:Et,c=ts(s,l);if(!r&&a){if(gi(a)){if(a.tolerance!=null&&nr(c,a.tolerance))return this.handleCancel();if(nr(c,a.distance))return this.handleStart()}if(mi(a)&&nr(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}e.cancelable&&e.preventDefault(),o(l)}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 Td={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Fr extends Pr{constructor(e){const{event:n}=e,r=Bn(n.target);super(e,Td,r)}}Fr.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 jd={move:{name:"mousemove"},end:{name:"mouseup"}};var ur;(function(t){t[t.RightClick=2]="RightClick"})(ur||(ur={}));class Dd extends Pr{constructor(e){super(e,jd,Bn(e.event.target))}}Dd.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===ur.RightClick?!1:(r?.({event:n}),!0)}}];const sr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Nd extends Pr{constructor(e){super(e,sr)}static setup(){return window.addEventListener(sr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(sr.move.name,e)};function e(){}}}Nd.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 Yn;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Yn||(Yn={}));var Es;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Es||(Es={}));function Rd(t){let{acceleration:e,activator:n=Yn.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=Es.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:f,delta:u,threshold:h}=t;const p=Id({delta:u,disabled:!i}),[m,y]=Hc(),x=v.useRef({x:0,y:0}),g=v.useRef({x:0,y:0}),b=v.useMemo(()=>{switch(n){case Yn.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Yn.DraggableRect:return s}},[n,s,l]),k=v.useRef(null),w=v.useCallback(()=>{const j=k.current;if(!j)return;const C=x.current.x*g.current.x,T=x.current.y*g.current.y;j.scrollBy(C,T)},[]),S=v.useMemo(()=>a===Es.TreeOrder?[...c].reverse():c,[a,c]);v.useEffect(()=>{if(!i||!c.length||!b){y();return}for(const j of S){if(r?.(j)===!1)continue;const C=c.indexOf(j),T=f[C];if(!T)continue;const{direction:N,speed:R}=xd(j,T,b,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){y(),k.current=j,m(w,o),x.current=R,g.current=N;return}}x.current={x:0,y:0},g.current={x:0,y:0},y()},[e,w,r,y,i,o,JSON.stringify(b),JSON.stringify(p),m,c,S,f,JSON.stringify(h)])}const Ed={x:{[Pe.Backward]:!1,[Pe.Forward]:!1},y:{[Pe.Backward]:!1,[Pe.Forward]:!1}};function Id(t){let{delta:e,disabled:n}=t;const r=Ds(e);return is(s=>{if(n||!r||!s)return Ed;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Pe.Backward]:s.x[Pe.Backward]||i.x===-1,[Pe.Forward]:s.x[Pe.Forward]||i.x===1},y:{[Pe.Backward]:s.y[Pe.Backward]||i.y===-1,[Pe.Forward]:s.y[Pe.Forward]||i.y===1}}},[n,e,r])}function _d(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return is(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function Ad(t,e){return v.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 ns;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ns||(ns={}));var fr;(function(t){t.Optimized="optimized"})(fr||(fr={}));const xi=new Map;function Bd(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=v.useState(null),{frequency:a,measure:l,strategy:c}=s,f=v.useRef(t),u=x(),h=es(u),p=v.useCallback(function(g){g===void 0&&(g=[]),!h.current&&o(b=>b===null?g:b.concat(g.filter(k=>!b.includes(k))))},[h]),m=v.useRef(null),y=is(g=>{if(u&&!n)return xi;if(!g||g===xi||f.current!==t||i!=null){const b=new Map;for(let k of t){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){b.set(k.id,k.rect.current);continue}const w=k.node.current,S=w?new zr(l(w),w):null;k.rect.current=S,S&&b.set(k.id,S)}return b}return g},[t,i,n,u,l]);return v.useEffect(()=>{f.current=t},[t]),v.useEffect(()=>{u||p()},[n,u]),v.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),v.useEffect(()=>{u||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},a))},[a,u,p,...r]),{droppableRects:y,measureDroppableContainers:p,measuringScheduled:i!=null};function x(){switch(c){case ns.Always:return!1;case ns.BeforeDragging:return n;default:return!n}}}function Ur(t,e){return is(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Od(t,e){return Ur(t,e)}function $d(t){let{callback:e,disabled:n}=t;const r=Us(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Ks(t){let{callback:e,disabled:n}=t;const r=Us(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Md(t){return new zr(On(t),t)}function bi(t,e,n){e===void 0&&(e=Md);const[r,s]=v.useState(null);function i(){s(l=>{if(!t)return null;if(t.isConnected===!1){var c;return(c=l??n)!=null?c:null}const f=e(t);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=$d({callback(l){if(t)for(const c of l){const{type:f,target:u}=c;if(f==="childList"&&u instanceof HTMLElement&&u.contains(t)){i();break}}}}),a=Ks({callback:i});return Rt(()=>{i(),t?(a?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),o?.disconnect())},[t]),r}function zd(t){const e=Ur(t);return Oo(t,e)}const yi=[];function Ld(t){const e=v.useRef(t),n=is(r=>t?r&&r!==yi&&t&&e.current&&t.parentNode===e.current.parentNode?r:Hs(t):yi,[t]);return v.useEffect(()=>{e.current=t},[t]),n}function Pd(t){const[e,n]=v.useState(null),r=v.useRef(t),s=v.useCallback(i=>{const o=tr(i.target);o&&n(a=>a?(a.set(o,dr(o)),new Map(a)):null)},[]);return v.useEffect(()=>{const i=r.current;if(t!==i){o(i);const a=t.map(l=>{const c=tr(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,dr(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=t}return()=>{o(t),o(i)};function o(a){a.forEach(l=>{const c=tr(l);c?.removeEventListener("scroll",s)})}},[s,t]),v.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Tn(i,o),Et):Uo(t):Et,[t,e])}function ki(t,e){e===void 0&&(e=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},e),v.useEffect(()=>{const r=t!==Et;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?ts(t,n.current):Et}function Fd(t){v.useEffect(()=>{if(!Fs)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 Ud(t,e){return v.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function Ko(t){return v.useMemo(()=>t?hd(t):null,[t])}const vi=[];function qd(t,e){e===void 0&&(e=On);const[n]=t,r=Ko(n?rt(n):null),[s,i]=v.useState(vi);function o(){i(()=>t.length?t.map(l=>Po(l)?r:new zr(e(l),l)):vi)}const a=Ks({callback:o});return Rt(()=>{a?.disconnect(),o(),t.forEach(l=>a?.observe(l))},[t]),s}function Wo(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return rs(e)?e:t}function Hd(t){let{measure:e}=t;const[n,r]=v.useState(null),s=v.useCallback(c=>{for(const{target:f}of c)if(rs(f)){r(u=>{const h=e(f);return u?{...u,width:h.width,height:h.height}:h});break}},[e]),i=Ks({callback:s}),o=v.useCallback(c=>{const f=Wo(c);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[a,l]=js(o);return v.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Kd=[{sensor:Fr,options:{}},{sensor:Lr,options:{}}],Wd={current:{}},Cs={draggable:{measure:hi},droppable:{measure:hi,strategy:ns.WhileDragging,frequency:fr.Optimized},dragOverlay:{measure:On}};class Zn 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 Vd={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Cs,measureDroppableContainers:Rs,windowRect:null,measuringScheduled:!1},Vo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Rs,draggableNodes:new Map,over:null,measureDroppableContainers:Rs},as=v.createContext(Vo),Go=v.createContext(Vd);function Gd(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zn}}}function Qd(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 Zn(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 Zn(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 Zn(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Xd(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=v.useContext(as),i=Ds(r),o=Ds(n?.id);return v.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!qs(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const f of[l.current,c.current]){if(!f)continue;const u=Vc(f);if(u){u.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 Yd(t){return v.useMemo(()=>({draggable:{...Cs.draggable,...t?.draggable},droppable:{...Cs.droppable,...t?.droppable},dragOverlay:{...Cs.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Zd(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=v.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;Rt(()=>{if(!o&&!a||!e){i.current=!1;return}if(i.current||!r)return;const c=e?.node.current;if(!c||c.isConnected===!1)return;const f=n(c),u=Oo(f,r);if(o||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const h=Mo(c);h&&h.scrollBy({top:u.y,left:u.x})}},[e,o,a,r,n])}const Ws=v.createContext({...Et,scaleX:1,scaleY:1});var Ft;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ft||(Ft={}));const Jd=v.memo(function(e){var n,r,s,i;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:f=Kd,collisionDetection:u=ad,measuring:h,modifiers:p,...m}=e;const y=v.useReducer(Qd,void 0,Gd),[x,g]=y,[b,k]=Jc(),[w,S]=v.useState(Ft.Uninitialized),j=w===Ft.Initialized,{draggable:{active:C,nodes:T,translate:N},droppable:{containers:R}}=x,D=C!=null?T.get(C):null,E=v.useRef({initial:null,translated:null}),M=v.useMemo(()=>{var de;return C!=null?{id:C,data:(de=D?.data)!=null?de:Wd,rect:E}:null},[C,D]),A=v.useRef(null),[U,I]=v.useState(null),[B,O]=v.useState(null),K=es(m,Object.values(m)),Y=os("DndDescribedBy",o),P=v.useMemo(()=>R.getEnabled(),[R]),q=Yd(h),{droppableRects:Q,measureDroppableContainers:G,measuringScheduled:ee}=Bd(P,{dragging:j,dependencies:[N.x,N.y],config:q.droppable}),W=_d(T,C),ne=v.useMemo(()=>B?Ns(B):null,[B]),J=tt(),se=Od(W,q.draggable.measure);Zd({activeNode:C!=null?T.get(C):null,config:J.layoutShiftCompensation,initialRect:se,measure:q.draggable.measure});const $=bi(W,q.draggable.measure,se),F=bi(W?W.parentElement:null),X=v.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=R.getNodeFor((n=X.current.over)==null?void 0:n.id),_=Hd({measure:q.dragOverlay.measure}),V=(r=_.nodeRef.current)!=null?r:W,te=j?(s=_.rect)!=null?s:$:null,le=!!(_.nodeRef.current&&_.rect),je=zd(le?null:$),pe=Ko(V?rt(V):null),De=Ld(j?re??W:null),fe=qd(De),it=Qo(p,{transform:{x:N.x-je.x,y:N.y-je.y,scaleX:1,scaleY:1},activatorEvent:B,active:M,activeNodeRect:$,containerNodeRect:F,draggingNodeRect:te,over:X.current.over,overlayNodeRect:_.rect,scrollableAncestors:De,scrollableAncestorRects:fe,windowRect:pe}),Ee=ne?Tn(ne,N):null,ct=Pd(De),be=ki(ct),ge=ki(ct,[$]),Le=Tn(it,be),me=te?dd(te,it):null,gt=M&&me?u({active:M,collisionRect:me,droppableRects:Q,droppableContainers:P,pointerCoordinates:Ee}):null,Ke=Ao(gt,"id"),[Ae,We]=v.useState(null),Ze=le?it:Tn(it,ge),mt=ld(Ze,(i=Ae?.rect)!=null?i:null,$),Fe=v.useRef(null),Ve=v.useCallback((de,we)=>{let{sensor:xe,options:Ne}=we;if(A.current==null)return;const ye=T.get(A.current);if(!ye)return;const Ce=de.nativeEvent,Te=new xe({active:A.current,activeNode:ye,event:Ce,options:Ne,context:X,onAbort(he){if(!T.get(he))return;const{onDragAbort:Ie}=K.current,qe={id:he};Ie?.(qe),b({type:"onDragAbort",event:qe})},onPending(he,Be,Ie,qe){if(!T.get(he))return;const{onDragPending:$e}=K.current,Re={id:he,constraint:Be,initialCoordinates:Ie,offset:qe};$e?.(Re),b({type:"onDragPending",event:Re})},onStart(he){const Be=A.current;if(Be==null)return;const Ie=T.get(Be);if(!Ie)return;const{onDragStart:qe}=K.current,Oe={activatorEvent:Ce,active:{id:Be,data:Ie.data,rect:E}};Ut.unstable_batchedUpdates(()=>{qe?.(Oe),S(Ft.Initializing),g({type:ze.DragStart,initialCoordinates:he,active:Be}),b({type:"onDragStart",event:Oe}),I(Fe.current),O(Ce)})},onMove(he){g({type:ze.DragMove,coordinates:he})},onEnd:Ue(ze.DragEnd),onCancel:Ue(ze.DragCancel)});Fe.current=Te;function Ue(he){return async function(){const{active:Ie,collisions:qe,over:Oe,scrollAdjustedTranslate:$e}=X.current;let Re=null;if(Ie&&$e){const{cancelDrop:Me}=K.current;Re={activatorEvent:Ce,active:Ie,collisions:qe,delta:$e,over:Oe},he===ze.DragEnd&&typeof Me=="function"&&await Promise.resolve(Me(Re))&&(he=ze.DragCancel)}A.current=null,Ut.unstable_batchedUpdates(()=>{g({type:he}),S(Ft.Uninitialized),We(null),I(null),O(null),Fe.current=null;const Me=he===ze.DragEnd?"onDragEnd":"onDragCancel";if(Re){const He=K.current[Me];He?.(Re),b({type:Me,event:Re})}})}}},[T]),Je=v.useCallback((de,we)=>(xe,Ne)=>{const ye=xe.nativeEvent,Ce=T.get(Ne);if(A.current!==null||!Ce||ye.dndKit||ye.defaultPrevented)return;const Te={active:Ce};de(xe,we.options,Te)===!0&&(ye.dndKit={capturedBy:we.sensor},A.current=Ne,Ve(xe,we))},[T,Ve]),dt=Ad(f,Je);Fd(f),Rt(()=>{$&&w===Ft.Initializing&&S(Ft.Initialized)},[$,w]),v.useEffect(()=>{const{onDragMove:de}=K.current,{active:we,activatorEvent:xe,collisions:Ne,over:ye}=X.current;if(!we||!xe)return;const Ce={active:we,activatorEvent:xe,collisions:Ne,delta:{x:Le.x,y:Le.y},over:ye};Ut.unstable_batchedUpdates(()=>{de?.(Ce),b({type:"onDragMove",event:Ce})})},[Le.x,Le.y]),v.useEffect(()=>{const{active:de,activatorEvent:we,collisions:xe,droppableContainers:Ne,scrollAdjustedTranslate:ye}=X.current;if(!de||A.current==null||!we||!ye)return;const{onDragOver:Ce}=K.current,Te=Ne.get(Ke),Ue=Te&&Te.rect.current?{id:Te.id,rect:Te.rect.current,data:Te.data,disabled:Te.disabled}:null,he={active:de,activatorEvent:we,collisions:xe,delta:{x:ye.x,y:ye.y},over:Ue};Ut.unstable_batchedUpdates(()=>{We(Ue),Ce?.(he),b({type:"onDragOver",event:he})})},[Ke]),Rt(()=>{X.current={activatorEvent:B,active:M,activeNode:W,collisionRect:me,collisions:gt,droppableRects:Q,draggableNodes:T,draggingNode:V,draggingNodeRect:te,droppableContainers:R,over:Ae,scrollableAncestors:De,scrollAdjustedTranslate:Le},E.current={initial:te,translated:me}},[M,W,gt,me,T,V,te,Q,R,Ae,De,Le]),Rd({...J,delta:N,draggingRect:me,pointerCoordinates:Ee,scrollableAncestors:De,scrollableAncestorRects:fe});const ut=v.useMemo(()=>({active:M,activeNode:W,activeNodeRect:$,activatorEvent:B,collisions:gt,containerNodeRect:F,dragOverlay:_,draggableNodes:T,droppableContainers:R,droppableRects:Q,over:Ae,measureDroppableContainers:G,scrollableAncestors:De,scrollableAncestorRects:fe,measuringConfiguration:q,measuringScheduled:ee,windowRect:pe}),[M,W,$,B,gt,F,_,T,R,Q,Ae,G,De,fe,q,ee,pe]),et=v.useMemo(()=>({activatorEvent:B,activators:dt,active:M,activeNodeRect:$,ariaDescribedById:{draggable:Y},dispatch:g,draggableNodes:T,over:Ae,measureDroppableContainers:G}),[B,dt,M,$,g,Y,T,Ae,G]);return Se.createElement(Eo.Provider,{value:k},Se.createElement(as.Provider,{value:et},Se.createElement(Go.Provider,{value:ut},Se.createElement(Ws.Provider,{value:mt},c)),Se.createElement(Xd,{disabled:a?.restoreFocus===!1})),Se.createElement(nd,{...a,hiddenTextDescribedById:Y}));function tt(){const de=U?.autoScrollEnabled===!1,we=typeof l=="object"?l.enabled===!1:l===!1,xe=j&&!de&&!we;return typeof l=="object"?{...l,enabled:xe}:{enabled:xe}}}),eu=v.createContext(null),wi="button",tu="Draggable";function nu(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=os(tu),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:f,draggableNodes:u,over:h}=v.useContext(as),{role:p=wi,roleDescription:m="draggable",tabIndex:y=0}=s??{},x=l?.id===e,g=v.useContext(x?Ws:eu),[b,k]=js(),[w,S]=js(),j=Ud(o,e),C=es(n);Rt(()=>(u.set(e,{id:e,key:i,node:b,activatorNode:w,data:C}),()=>{const N=u.get(e);N&&N.key===i&&u.delete(e)}),[u,e]);const T=v.useMemo(()=>({role:p,tabIndex:y,"aria-disabled":r,"aria-pressed":x&&p===wi?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,p,y,x,m,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:x,listeners:r?void 0:j,node:b,over:h,setNodeRef:k,setActivatorNodeRef:S,transform:g}}function Xo(){return v.useContext(Go)}const su="Droppable",ru={timeout:25};function Yo(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=os(su),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=v.useContext(as),f=v.useRef({disabled:n}),u=v.useRef(!1),h=v.useRef(null),p=v.useRef(null),{disabled:m,updateMeasurementsFor:y,timeout:x}={...ru,...s},g=es(y??r),b=v.useCallback(()=>{if(!u.current){u.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),p.current=null},x)},[x]),k=Ks({callback:b,disabled:m||!o}),w=v.useCallback((T,N)=>{k&&(N&&(k.unobserve(N),u.current=!1),T&&k.observe(T))},[k]),[S,j]=js(w),C=es(e);return v.useEffect(()=>{!k||!S.current||(k.disconnect(),u.current=!1,k.observe(S.current))},[S,k]),v.useEffect(()=>(a({type:ze.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:h,data:C}}),()=>a({type:ze.UnregisterDroppable,key:i,id:r})),[r]),v.useEffect(()=>{n!==f.current.disabled&&(a({type:ze.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:o,rect:h,isOver:l?.id===r,node:S,over:l,setNodeRef:j}}function iu(t){let{animation:e,children:n}=t;const[r,s]=v.useState(null),[i,o]=v.useState(null),a=Ds(n);return!n&&!r&&a&&s(a),Rt(()=>{if(!i)return;const l=r?.key,c=r?.props.id;if(l==null||c==null){s(null);return}Promise.resolve(e(c,i)).then(()=>{s(null)})},[e,r,i]),Se.createElement(Se.Fragment,null,n,r?v.cloneElement(r,{ref:o}):null)}const ou={x:0,y:0,scaleX:1,scaleY:1};function au(t){let{children:e}=t;return Se.createElement(as.Provider,{value:Vo},Se.createElement(Ws.Provider,{value:ou},e))}const lu={position:"fixed",touchAction:"none"},cu=t=>qs(t)?"transform 250ms ease":void 0,du=v.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:l,transform:c,transition:f=cu}=t;if(!a)return null;const u=s?c:{...c,scaleX:1,scaleY:1},h={...lu,width:a.width,height:a.height,top:a.top,left:a.left,transform:Ht.Transform.toString(u),transformOrigin:s&&r?rd(r,a):void 0,transition:typeof f=="function"?f(r):f,...l};return Se.createElement(n,{className:o,style:h,ref:e},i)}),uu=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,c]of Object.entries(s))n.node.style.setProperty(l,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},fu=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Ht.Transform.toString(e)},{transform:Ht.Transform.toString(n)}]},hu={duration:250,easing:"ease",keyframes:fu,sideEffects:uu({styles:{active:{opacity:"0"}}})};function pu(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return Us((i,o)=>{if(e===null)return;const a=n.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=Wo(o);if(!c)return;const{transform:f}=rt(o).getComputedStyle(o),u=$o(f);if(!u)return;const h=typeof e=="function"?e:gu(e);return qo(l,s.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function gu(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...hu,...t};return i=>{let{active:o,dragOverlay:a,transform:l,...c}=i;if(!e)return;const f={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},u={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-f.x,y:l.y-f.y,...u},p=s({...c,active:o,dragOverlay:a,transform:{initial:l,final:h}}),[m]=p,y=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(y))return;const x=r?.({active:o,dragOverlay:a,...c}),g=a.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(b=>{g.onfinish=()=>{x?.(),b()}})}}let Si=0;function mu(t){return v.useMemo(()=>{if(t!=null)return Si++,Si},[t])}const xu=Se.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=t;const{activatorEvent:f,active:u,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:y,dragOverlay:x,over:g,measuringConfiguration:b,scrollableAncestors:k,scrollableAncestorRects:w,windowRect:S}=Xo(),j=v.useContext(Ws),C=mu(u?.id),T=Qo(o,{activatorEvent:f,active:u,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:x.rect,over:g,overlayNodeRect:x.rect,scrollableAncestors:k,scrollableAncestorRects:w,transform:j,windowRect:S}),N=Ur(h),R=pu({config:r,draggableNodes:m,droppableContainers:y,measuringConfiguration:b}),D=N?x.setRef:void 0;return Se.createElement(au,null,Se.createElement(iu,{animation:R},u&&C?Se.createElement(du,{key:C,id:u.id,ref:D,as:a,activatorEvent:f,adjustScale:e,className:l,transition:i,rect:N,style:{zIndex:c,...s},transform:T},n):null))});function bu(t){const{org:e}=_e(),{data:n}=Ua.useSession(),r=xl(),s=En(),i=al({connectionId:lo,orgId:e.id,orgSlug:e.slug}),[o,a]=v.useState(!1),l=fl(t,{enabled:!1});return{connect:async()=>{if(!(o||!n?.user?.id||!e)){a(!0);try{const f=l.data??(await l.refetch()).data;if(!f){At.error("Could not find this integration in the registry");return}const u=vl(f,e.id,n.user.id,{remoteIndex:0});if(!u.connection_url){At.error("This integration has no connection method available");return}const h=u.app_name?await yu(i,u.app_name):null,p=!h,m=h?.id??(await r.create.mutateAsync(u)).id,y=await kl({connectionId:m,orgId:e.id,orgSlug:e.slug,persistFallback:x=>r.update.mutateAsync({id:m,data:{connection_token:x}}).then(()=>{})});if(y.ran&&!y.ok){if(p)try{await r.delete.mutateAsync(m)}catch{}At.error(`Authentication failed: ${y.error??"no token"}`);return}qa(s,e.id),At.success(p?"Connected successfully":"Already connected")}catch(f){At.error(`Failed to connect: ${f instanceof Error?f.message:String(f)}`)}finally{a(!1)}}},isConnecting:o}}async function yu(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 qr(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function ku(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function gs(t){return t!==null&&t>=0}function vu(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 wu(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Zo=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=qr(e,r,n),o=e[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},ms={scaleX:1,scaleY:1},Su=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const a=(e=i[n])!=null?e:r;if(!a)return null;if(s===n){const c=i[o];return c?{x:0,y:n<o?c.top+c.height-(a.top+a.height):c.top-a.top,...ms}:null}const l=Cu(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-l,...ms}:s<n&&s>=o?{x:0,y:a.height+l,...ms}:{x:0,y:0,...ms}};function Cu(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 Jo="Sortable",ea=Se.createContext({activeIndex:-1,containerId:Jo,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Zo,disabled:{draggable:!1,droppable:!1}});function Tu(t){let{children:e,id:n,items:r,strategy:s=Zo,disabled:i=!1}=t;const{active:o,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:f}=Xo(),u=os(Jo,n),h=a.rect!==null,p=v.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),m=o!=null,y=o?p.indexOf(o.id):-1,x=c?p.indexOf(c.id):-1,g=v.useRef(p),b=!vu(p,g.current),k=x!==-1&&y===-1||b,w=wu(i);Rt(()=>{b&&m&&f(p)},[b,p,m,f]),v.useEffect(()=>{g.current=p},[p]);const S=v.useMemo(()=>({activeIndex:y,containerId:u,disabled:w,disableTransforms:k,items:p,overIndex:x,useDragOverlay:h,sortedRects:ku(p,l),strategy:s}),[y,u,w.draggable,w.droppable,k,p,x,l,h,s]);return Se.createElement(ea.Provider,{value:S},e)}const ju=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return qr(n,r,s).indexOf(e)},Du=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:l,transition:c}=t;return!c||!r||a!==i&&s===o?!1:n?!0:o!==s&&e===l},Nu={duration:200,easing:"ease"},ta="transform",Ru=Ht.Transition.toString({property:ta,duration:0,easing:"linear"}),Eu={roleDescription:"sortable"};function Iu(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=v.useState(null),a=v.useRef(n);return Rt(()=>{if(!e&&n!==a.current&&r.current){const l=s.current;if(l){const c=On(r.current,{ignoreTransform:!0}),f={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(f.x||f.y)&&o(f)}}n!==a.current&&(a.current=n)},[e,n,r,s]),v.useEffect(()=>{i&&o(null)},[i]),i}function _u(t){let{animateLayoutChanges:e=Du,attributes:n,disabled:r,data:s,getNewIndex:i=ju,id:o,strategy:a,resizeObserverConfig:l,transition:c=Nu}=t;const{items:f,containerId:u,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:y,overIndex:x,useDragOverlay:g,strategy:b}=v.useContext(ea),k=Au(r,p),w=f.indexOf(o),S=v.useMemo(()=>({sortable:{containerId:u,index:w,items:f},...s}),[u,s,w,f]),j=v.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:C,node:T,isOver:N,setNodeRef:R}=Yo({id:o,data:S,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...l}}),{active:D,activatorEvent:E,activeNodeRect:M,attributes:A,setNodeRef:U,listeners:I,isDragging:B,over:O,setActivatorNodeRef:K,transform:Y}=nu({id:o,data:S,attributes:{...Eu,...n},disabled:k.draggable}),P=qc(R,U),q=!!D,Q=q&&!m&&gs(h)&&gs(x),G=!g&&B,ee=G&&Q?Y:null,ne=Q?ee??(a??b)({rects:y,activeNodeRect:M,activeIndex:h,overIndex:x,index:w}):null,J=gs(h)&&gs(x)?i({id:o,items:f,activeIndex:h,overIndex:x}):w,se=D?.id,$=v.useRef({activeId:se,items:f,newIndex:J,containerId:u}),F=f!==$.current.items,X=e({active:D,containerId:u,isDragging:B,isSorting:q,id:o,index:w,items:f,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:c,wasDragging:$.current.activeId!=null}),re=Iu({disabled:!X,index:w,node:T,rect:C});return v.useEffect(()=>{q&&$.current.newIndex!==J&&($.current.newIndex=J),u!==$.current.containerId&&($.current.containerId=u),f!==$.current.items&&($.current.items=f)},[q,J,u,f]),v.useEffect(()=>{if(se===$.current.activeId)return;if(se!=null&&$.current.activeId==null){$.current.activeId=se;return}const V=setTimeout(()=>{$.current.activeId=se},50);return()=>clearTimeout(V)},[se]),{active:D,activeIndex:h,attributes:A,data:S,rect:C,index:w,newIndex:J,items:f,isOver:N,isSorting:q,isDragging:B,listeners:I,node:T,overIndex:x,over:O,setNodeRef:P,setActivatorNodeRef:K,setDroppableNodeRef:R,setDraggableNodeRef:U,transform:re??ne,transition:_()};function _(){if(re||F&&$.current.newIndex===w)return Ru;if(!(G&&!qs(E)||!c)&&(q||X))return Ht.Transition.toString({...c,property:ta})}}function Au(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 Is(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 Bu=[oe.Down,oe.Right,oe.Up,oe.Left],Ou=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:a}}=e;if(Bu.includes(t.code)){if(t.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const h=s.get(u.id);if(h)switch(t.code){case oe.Down:r.top<h.top&&l.push(u);break;case oe.Up:r.top>h.top&&l.push(u);break;case oe.Left:r.left>h.left&&l.push(u);break;case oe.Right:r.left<h.left&&l.push(u);break}});const c=Bo({collisionRect:r,droppableRects:s,droppableContainers:l});let f=Ao(c,"id");if(f===o?.id&&c.length>1&&(f=c[1].id),f!=null){const u=i.get(n.id),h=i.get(f),p=h?s.get(h.id):null,m=h?.node.current;if(m&&p&&u&&h){const x=Hs(m).some((j,C)=>a[C]!==j),g=na(u,h),b=$u(u,h),k=x||!g?{x:0,y:0}:{x:b?r.width-p.width:0,y:b?r.height-p.height:0},w={x:p.left,y:p.top};return k.x&&k.y?w:ts(w,k)}}}};function na(t,e){return!Is(t)||!Is(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function $u(t,e){return!Is(t)||!Is(e)||!na(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function Ot(t){const e=L.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=Z("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==o?(a=d.jsx("img",{src:ll,alt:"Super Agent",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=a):a=e[7],a}const Ci=()=>0;function Mu(t){const{orgSlug:e,enabled:n=!0,onUpdate:r,onDelete:s}=t,i=v.useRef(r);i.current=r;const o=v.useRef(s);o.current=s;const a=v.useRef(null),l=v.useRef(n),c=v.useRef(e);(!a.current||l.current!==n||c.current!==e)&&(l.current=n,c.current=e,a.current=u=>{if(!n||!e)return()=>{};const h=p=>{let m;try{m=JSON.parse(p.data)}catch{return}m.data&&(p.type===Sl?o.current?.(m.data.id):i.current(m.data)),u()};return wl.subscribe(e,h)}),v.useSyncExternalStore(a.current,Ci,Ci)}function zu(){const t=L.c(30),{org:e,locator:n}=_e(),r=In(),s=En();let i;t[0]!==n?(i=ve.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const o=i;let a;t[2]!==r?(a=async()=>(await r.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=r,t[3]=a):a=t[3];let l;t[4]!==o||t[5]!==a?(l={queryKey:o,queryFn:a},t[4]=o,t[5]=a,t[6]=l):l=t[6];const c=lt(l);let f;t[7]!==n||t[8]!==s||t[9]!==o?(f=g=>{s.setQueryData(o,b=>{const k=b??[],w=g;return k.some(S=>S.id===w.id)?k.map(S=>S.id===w.id?w:S):[w,...k]}),s.invalidateQueries({queryKey:ve.taskBoardActivity(n,g.id)})},t[7]=n,t[8]=s,t[9]=o,t[10]=f):f=t[10];let u;t[11]!==s||t[12]!==o?(u=g=>{s.setQueryData(o,b=>b?.filter(k=>k.id!==g))},t[11]=s,t[12]=o,t[13]=u):u=t[13];let h;t[14]!==e.slug||t[15]!==f||t[16]!==u?(h={orgSlug:e.slug,onUpdate:f,onDelete:u},t[14]=e.slug,t[15]=f,t[16]=u,t[17]=h):h=t[17],Mu(h);let p;t[18]!==s||t[19]!==o?(p=g=>{const b=g.subject,k=g.data.status;s.setQueryData(o,w=>w?.map(S=>S.threads.some(j=>j.threadId===b)?{...S,threads:S.threads.map(j=>j.threadId===b?{...j,status:k}:j)}:S))},t[18]=s,t[19]=o,t[20]=p):p=t[20];let m;t[21]!==e.slug||t[22]!==p?(m={orgSlug:e.slug,onTaskStatus:p},t[21]=e.slug,t[22]=p,t[23]=m):m=t[23],Tl(m);let y;t[24]!==c.data?(y=c.data??[],t[24]=c.data,t[25]=y):y=t[25];let x;return t[26]!==c.error||t[27]!==c.isLoading||t[28]!==y?(x={items:y,isLoading:c.isLoading,error:c.error},t[26]=c.error,t[27]=c.isLoading,t[28]=y,t[29]=x):x=t[29],x}function Lu(){const t=L.c(40),{locator:e}=_e(),n=In(),r=En();let s;t[0]!==e?(s=ve.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 a=o;let l;t[5]!==n?(l=T=>n.call("TASK_BOARD_ITEM_CREATE",T),t[5]=n,t[6]=l):l=t[6];let c;t[7]!==a||t[8]!==l?(c={mutationFn:l,onSuccess:a},t[7]=a,t[8]=l,t[9]=c):c=t[9];const f=Tt(c);let u;t[10]!==n?(u=T=>n.call("TASK_BOARD_ITEM_UPDATE",T),t[10]=n,t[11]=u):u=t[11];let h,p;t[12]!==r||t[13]!==i?(h=async T=>{await r.cancelQueries({queryKey:i});const N=r.getQueryData(i);return r.setQueryData(i,R=>R?.map(D=>D.id===T.id?{...D,...T}:D)),{previous:N}},p=(T,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]!==a||t[17]!==e||t[18]!==r?(m=(T,N,R)=>{a(),r.invalidateQueries({queryKey:ve.taskBoardActivity(e,R.id)})},t[16]=a,t[17]=e,t[18]=r,t[19]=m):m=t[19];let y;t[20]!==u||t[21]!==h||t[22]!==p||t[23]!==m?(y={mutationFn:u,onMutate:h,onError:p,onSettled:m},t[20]=u,t[21]=h,t[22]=p,t[23]=m,t[24]=y):y=t[24];const x=Tt(y);let g;t[25]!==n?(g=T=>n.call("TASK_BOARD_ITEM_DELETE",{id:T}),t[25]=n,t[26]=g):g=t[26];let b;t[27]!==a||t[28]!==g?(b={mutationFn:g,onSuccess:a},t[27]=a,t[28]=g,t[29]=b):b=t[29];const k=Tt(b);let w;t[30]!==n?(w=T=>n.call("TASK_BOARD_ITEM_UPDATE",T),t[30]=n,t[31]=w):w=t[31];let S;t[32]!==a||t[33]!==w?(S={mutationFn:w,onSuccess:a},t[32]=a,t[33]=w,t[34]=S):S=t[34];const j=Tt(S);let C;return t[35]!==f||t[36]!==j||t[37]!==k||t[38]!==x?(C={create:f,update:x,remove:k,link:j},t[35]=f,t[36]=j,t[37]=k,t[38]=x,t[39]=C):C=t[39],C}function _s(t){return t.threads.some(e=>e.status==="requires_action")}function Hr(t){return t.status==="in_progress"&&_s(t)?"text-warning animate-pulse":yt[t.status].iconClassName}function Pu(t){return t.threads[0]}function Ti(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,a=o===-1?i.length:o,l=i[a-1],c=i[a];return l&&c?(l.sortOrder+c.sortOrder)/2:l?l.sortOrder+1:c?c.sortOrder-1:0}function sa(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const As=["triage","todo","in_progress","in_review","done"],yt={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Ls,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:jl,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:ss,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Dl,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:_n,iconClassName:"text-success"}},Kr=["none","low","medium","high","urgent"],kt={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"}},hr=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],ra=hr[0];function ls(t){return t??ra}function Fu(t){return hr[t%hr.length]??ra}function ia(t){const e=L.c(11),{size:n,className:r}=t,s=n===void 0?16:n,i=ce();let o;e[0]!==i?(o=i("taskBoard.taskDialog.qaAgentLabel"),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==s?(a={width:s,height:s},e[2]=s,e[3]=a):a=e[3];let l;e[4]!==r?(l=Z("shrink-0 rounded-full object-cover",r),e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==o||e[8]!==a||e[9]!==l?(c=d.jsx("img",{src:cl,alt:o,width:s,height:s,style:a,className:l}),e[6]=s,e[7]=o,e[8]=a,e[9]=l,e[10]=c):c=e[10],c}function oa(t){const e=L.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=Z("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==o?(a=d.jsx("img",{src:dl,alt:"Code Reviewer",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=a):a=e[7],a}let pr,gr;if(typeof WeakMap<"u"){let t=new WeakMap;pr=e=>t.get(e),gr=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;pr=r=>{for(let s=0;s<t.length;s+=2)if(t[s]==r)return t[s+1]},gr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var Lt=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 a=1;i<this.width&&this.map[e+a]==n;a++)i++;for(let a=1;o<this.height&&this.map[e+this.width*a]==n;a++)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:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(s,l),right:Math.max(r,a),bottom:Math.max(i,c)}}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 a=(t+1)*this.width;for(;o<a&&this.map[o]<s;)o++;return o==a?i-1:this.map[o]}s=i}}static get(t){return pr(t)||gr(t,Uu(t))}};function Uu(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=qu(t),n=t.childCount,r=[];let s=0,i=null;const o=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const u=t.child(c);f++;for(let m=0;;m++){for(;s<r.length&&r[s]!=0;)s++;if(m==u.childCount)break;const y=u.child(m),{colspan:x,rowspan:g,colwidth:b}=y.attrs;for(let k=0;k<g;k++){if(k+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:f,n:g-k});break}const w=s+k*e;for(let S=0;S<x;S++){r[w+S]==0?r[w+S]=f:(i||(i=[])).push({type:"collision",row:c,pos:f,n:x-S});const j=b&&b[S];if(j){const C=(w+S)%e*2,T=o[C];T==null||T!=j&&o[C+1]==1?(o[C]=j,o[C+1]=1):T==j&&o[C+1]++}}}s+=x,f+=y.nodeSize}const h=(c+1)*e;let p=0;for(;s<h;)r[s++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:c,n:p}),f++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new Lt(e,n,r,i);let l=!1;for(let c=0;!l&&c<o.length;c+=2)o[c]!=null&&o[c+1]<n&&(l=!0);return l&&Hu(a,o,t),a}function qu(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 a=t.child(o);for(let l=0;l<a.childCount;l++){const c=a.child(l);o+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let o=0;o<s.childCount;o++){const a=s.child(o);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function Hu(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 a=null;const l=o.attrs;for(let c=0;c<l.colspan;c++){const f=e[(s+c)%t.width*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=Ku(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function Ku(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Wr(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 qt("selectingCells");function Wu(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 aa(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 Vu(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=Wu(e.$head)||Gu(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Gu(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 ji(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function la(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ca(t,e,n){const r=t.node(-1),s=Lt.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 Di(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 $t=class zt extends Bt{constructor(e,n=e){const r=e.node(-1),s=Lt.get(r),i=e.start(-1),o=s.rectBetween(e.pos-i,n.pos-i),a=e.node(0),l=s.cellsInRect(o).filter(f=>f!=n.pos-i);l.unshift(n.pos-i);const c=l.map(f=>{const u=r.nodeAt(f);if(!u)throw new RangeError(`No cell with offset ${f} found`);const h=i+f+1;return new Bl(a.resolve(h),a.resolve(h+u.content.size))});super(c[0].$from,c[0].$to,c),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(ji(r)&&ji(s)&&la(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?zt.rowSelection(r,s):i&&this.isColSelection()?zt.colSelection(r,s):new zt(r,s)}return po.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=Lt.get(e),r=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},o=[];for(let l=s.top;l<s.bottom;l++){const c=[];for(let f=l*n.width+s.left,u=s.left;u<s.right;u++,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 y=s.left-p.left,x=p.right-s.right;if(y>0||x>0){let g=m.attrs;if(y>0&&(g=Di(g,0,y)),x>0&&(g=Di(g,g.colspan-x,x)),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)}c.push(m)}o.push(e.child(l).copy(Js.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new Kn(Js.from(a),1,1)}replace(e,n=Kn.empty){const r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){const{$from:a,$to:l}=s[o],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),o?Kn.empty:n)}const i=Bt.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new Kn(Js.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Lt.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=Lt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),a=s.findCell(n.pos-i),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(i+s.map[o.left])),a.bottom<s.height&&(n=l.resolve(i+s.map[s.width*(s.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+s.map[a.left])),o.bottom<s.height&&(e=l.resolve(i+s.map[s.width*(s.height-1)+o.right-1]))),new zt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Lt.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,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==n.width}eq(e){return e instanceof zt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=Lt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),a=s.findCell(n.pos-i),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(i+s.map[o.top*s.width])),a.right<s.width&&(n=l.resolve(i+s.map[s.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+s.map[a.top*s.width])),o.right<s.width&&(e=l.resolve(i+s.map[s.width*(o.top+1)-1]))),new zt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new zt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new zt(e.resolve(n),e.resolve(r))}getBookmark(){return new Qu(this.$anchorCell.pos,this.$headCell.pos)}};$t.prototype.visible=!1;Bt.jsonID("cell",$t);var Qu=class da{constructor(e,n){this.anchor=e,this.head=n}map(e){return new da(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&&la(n,r)?new $t(n,r):Bt.near(r,1)}};new qt("fix-tables");function ua(t){const e=t.selection,n=Vu(t),r=n.node(-1),s=n.start(-1),i=Lt.get(r);return{...e instanceof $t?i.rectBetween(e.$anchorCell.pos-s,e.$headCell.pos-s):i.findCell(n.pos-s),tableStart:s,map:i,table:r}}function Xu(t){return function(e,n){if(!aa(e))return!1;if(n){const r=Wr(e.schema),s=ua(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),a=o.map(l=>s.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(s.tableStart+o[l],r.cell,a[l].attrs);if(i.steps.length===0)for(let l=0;l<o.length;l++)i.setNodeMarkup(s.tableStart+o[l],r.header_cell,a[l].attrs);n(i)}return!0}}function Ni(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 Vr(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Xu(t):function(n,r){if(!aa(n))return!1;if(r){const s=Wr(n.schema),i=ua(n),o=n.tr,a=Ni("row",i,s),l=Ni("column",i,s),c=(t==="column"?a:t==="row"&&l)?1:0,f=t=="column"?{left:0,top:c,right:1,bottom:i.map.height}:t=="row"?{left:c,top:0,right:i.map.width,bottom:1}:i,u=t=="column"?l?s.cell:s.header_cell:t=="row"?a?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,u,m.attrs)}),r(o)}return!0}}Vr("row",{useDeprecatedLogic:!0});Vr("column",{useDeprecatedLogic:!0});Vr("cell",{useDeprecatedLogic:!0});function xs(t,e){const n=t.selection;if(!(n instanceof $t))return!1;if(e){const r=t.tr,s=Wr(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 Kn(s,0,0))}),r.docChanged&&e(r)}return!0}Ol({ArrowLeft:bs("horiz",-1),ArrowRight:bs("horiz",1),ArrowUp:bs("vert",-1),ArrowDown:bs("vert",1),"Shift-ArrowLeft":ys("horiz",-1),"Shift-ArrowRight":ys("horiz",1),"Shift-ArrowUp":ys("vert",-1),"Shift-ArrowDown":ys("vert",1),Backspace:xs,"Mod-Backspace":xs,Delete:xs,"Mod-Delete":xs});function Ts(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function bs(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof $t)return Ts(n,r,Bt.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=fa(s,t,e);if(o==null)return!1;if(t=="horiz")return Ts(n,r,Bt.near(n.doc.resolve(i.head+e),e));{const a=n.doc.resolve(o),l=ca(a,t,e);let c;return l?c=Bt.near(l,1):e<0?c=Bt.near(n.doc.resolve(a.before(-1)),-1):c=Bt.near(n.doc.resolve(a.after(-1)),1),Ts(n,r,c)}}}function ys(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;let o;if(i instanceof $t)o=i;else{const l=fa(s,t,e);if(l==null)return!1;o=new $t(n.doc.resolve(l))}const a=ca(o.$headCell,t,e);return a?Ts(n,r,new $t(o.$anchorCell,a)):!1}}function fa(t,e,n){if(!(t.state.selection instanceof po))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),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?o:null}}return null}new qt("tableColumnResizing");function Yu(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,a=r-n,l=s,c=n;return new DOMRect(l,c,o,a)}var Zu=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:s=250,resizeDelay:i=60,shouldShow:o,appendTo:a,getReferencedVirtualElement:l,options:c}){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:u,state:h,from:p,to:m})=>{const{doc:y,selection:x}=h,{empty:g}=x,b=!y.textBetween(p,m).length&&$l(h.selection),k=this.element.contains(document.activeElement);return!(!(u.hasFocus()||k)||g||b||!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:u})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,h)=>{const p=!h?.selection.eq(u.state.selection),m=!h?.doc.eq(u.state.doc);!p&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,p,m,h)},this.updateDelay))},this.updateHandler=(u,h,p,m)=>{const{composing:y}=u;if(y||!h&&!p)return;if(!this.getShouldShow(m)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:u})=>{const h=u.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=a,this.scrollTarget=(f=c?.scrollTarget)!=null?f:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...c},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(Vi(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Gi(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Qi(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(Xi(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Yi(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Zi(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Ji(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(eo(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=go(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof Ml){let a=this.view.nodeDOM(r.from);const l=a.dataset.nodeViewWrapper?a:a.querySelector("[data-node-view-wrapper]");l&&(a=l),a&&(o={getBoundingClientRect:()=>a.getBoundingClientRect(),getClientRects:()=>[a.getBoundingClientRect()]})}if(r instanceof $t){const{$anchorCell:a,$headCell:l}=r,c=a?a.pos:l.pos,f=l?l.pos:a.pos,u=this.view.nodeDOM(c),h=this.view.nodeDOM(f);if(!u||!h)return;const p=u===h?u.getBoundingClientRect():Yu(u.getBoundingClientRect(),h.getBoundingClientRect());o={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&to(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(l=>l.$from.pos)),o=Math.max(...s.map(l=>l.$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()}},ha=t=>new Nr({key:typeof t.pluginKey=="string"?new qt(t.pluginKey):t.pluginKey,view:e=>new Zu({view:e,...t})});Rr.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ha({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 Ju=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:s=250,resizeDelay:i=60,options:o,appendTo:a,shouldShow:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:f,state:u})=>{const{selection:h}=u,{$anchor:p,empty:m}=h,y=p.depth===1,x=p.parent.isTextblock&&!p.parent.type.spec.code&&!p.parent.textContent&&p.parent.childCount===0&&!this.getTextContent(p.parent);return!(!f.hasFocus()||!m||!y||!x||!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,u,h,p)=>{const{composing:m}=f;if(m||!u&&!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 u;if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((u=this.element.parentNode)!=null&&u.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:f})=>{const u=f.getMeta(this.pluginKey);u==="updatePosition"?this.updatePosition():u&&typeof u=="object"&&u.type==="updateOptions"?this.updateOptions(u.options):u==="hide"?this.hide():u==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var c;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=a,this.scrollTarget=(c=o?.scrollTarget)!=null?c:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,l&&(this.shouldShow=l),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 zl(t,{textSerializers:Ll(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Vi(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Gi(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Qi(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(Xi(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Yi(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Zi(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Ji(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(eo(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(l=>l.$from.pos)),o=Math.max(...s.map(l=>l.$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=go(this.view,t.from,t.to);to({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 a,l;if((a=o.hide)!=null&&a.referenceHidden||(l=o.hide)!=null&&l.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()}},pa=t=>new Nr({key:typeof t.pluginKey=="string"?new qt(t.pluginKey):t.pluginKey,view:e=>new Ju({view:e,...t})});Rr.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?[pa({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 ef=Se.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,getReferencedVirtualElement:o,options:a,children:l,...c},f)=>{const u=v.useRef(document.createElement("div"));typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:h}=mo(),p=e||h,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:a},y=v.useRef(m);y.current=m;const[x,g]=v.useState(!1),b=v.useRef(!0);return v.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=u.current;k.style.visibility="hidden",k.style.position="absolute";const w=ha({...y.current,editor:p,element:k});p.registerPlugin(w);const S=y.current.pluginKey;return b.current=!0,g(!0),()=>{g(!1),p.unregisterPlugin(S),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[p]),v.useEffect(()=>{if(!(!x||!p||p.isDestroyed)){if(b.current){b.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:y.current}))}},[x,p,n,r,i,a,s,o]),Ut.createPortal(d.jsx("div",{...c,children:l}),u.current)});Se.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,options:o,children:a,...l},c)=>{const f=v.useRef(document.createElement("div"));typeof c=="function"?c(f.current):c&&(c.current=f.current);const{editor:u}=mo(),h=e||u,p={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,options:o},m=v.useRef(p);m.current=p;const[y,x]=v.useState(!1),g=v.useRef(!0);return v.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 b=f.current;b.style.visibility="hidden",b.style.position="absolute";const k=pa({...m.current,editor:h,element:b});h.registerPlugin(k);const w=m.current.pluginKey;return g.current=!0,x(!0),()=>{x(!1),h.unregisterPlugin(w),window.requestAnimationFrame(()=>{b.parentNode&&b.parentNode.removeChild(b)})}},[h]),v.useEffect(()=>{if(!(!y||!h||h.isDestroyed)){if(g.current){g.current=!1;return}h.view.dispatch(h.state.tr.setMeta(t,{type:"updateOptions",options:m.current}))}},[y,h,n,r,i,o,s]),Ut.createPortal(d.jsx("div",{...l,children:a}),f.current)});const tf=new Set(["http:","https:","mailto:","tel:","ftp:"]);function ga(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return tf.has(e.protocol)}catch{return!1}}function ma(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 nf="noopener noreferrer nofollow";function at(t){const e=L.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 a;e[0]!==o?(a=Z("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",o),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==n||e[3]!==i||e[4]!==r||e[5]!==s||e[6]!==a?(l=d.jsx("button",{type:"button","aria-label":r,"aria-pressed":n,onMouseDown:sf,onClick:s,className:a,children:i}),e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function sf(t){return t.preventDefault()}function Ri(t){const e=L.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=Z("flex-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer",i),e[0]=i,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==o?(a=d.jsx("button",{type:"button","aria-pressed":n,onMouseDown:rf,onClick:s,className:o,children:r}),e[2]=n,e[3]=r,e[4]=s,e[5]=o,e[6]=a):a=e[6],a}function rf(t){return t.preventDefault()}function am(t){const e=L.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=ce(),[a,l]=v.useState(""),[c,f]=v.useState(!0),[u,h]=v.useState(!1);let p;e[0]!==r||e[1]!==n||e[2]!==i?(p=()=>{const D=n.getAttributes("link");l(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 y;e[4]!==n||e[5]!==i?(y=()=>{i(!1),n.chain().focus().run()},e[4]=n,e[5]=i,e[6]=y):y=e[6];const x=y;let g;e[7]!==a||e[8]!==n||e[9]!==c||e[10]!==i?(g=()=>{const D=ma(a);if(D===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!ga(D)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:D,target:c?"_blank":null,rel:c?nf:null}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=c,e[10]=i,e[11]=g):g=e[11];const b=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 w=k;let S;e[15]!==o?(S=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=S):S=e[16];const j=s?x:m;let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=d.jsx(Co,{size:14}),e[17]=C):C=e[17];let T;e[18]!==r||e[19]!==S||e[20]!==j?(T=d.jsx(at,{active:r,label:S,onClick:j,children:C}),e[18]=r,e[19]=S,e[20]=j,e[21]=T):T=e[21];let N;e[22]!==r||e[23]!==b||e[24]!==x||e[25]!==a||e[26]!==u||e[27]!==c||e[28]!==i||e[29]!==s||e[30]!==w||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":u,placeholder:o("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:a,onChange:D=>{l(D.target.value),h(!1)},onKeyDown:D=>{D.key==="Enter"?(D.preventDefault(),b()):D.key==="Escape"&&(D.preventDefault(),x())},className:Z("h-7 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",u&&"text-destructive")}),d.jsx(at,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:b,children:d.jsx(Ps,{size:14})}),r&&d.jsx(at,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:w,children:d.jsx(jo,{size:14})})]}),d.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[d.jsx(Ri,{active:!c,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>f(!1)}),d.jsx(Ri,{active:c,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>f(!0)})]})]}),e[22]=r,e[23]=b,e[24]=x,e[25]=a,e[26]=u,e[27]=c,e[28]=i,e[29]=s,e[30]=w,e[31]=o,e[32]=N):N=e[32];let R;return e[33]!==T||e[34]!==N?(R=d.jsxs("div",{className:"relative",children:[T,N]}),e[33]=T,e[34]=N,e[35]=R):R=e[35],R}function of(t){const e=L.c(30),{editor:n}=t,r=ce(),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,c]=v.useState(!1);let f;e[0]!==n?(f=n.isActive("link"),e[0]=n,e[1]=f):f=e[1];const u=f;let h;e[2]!==n||e[3]!==s?(h=()=>{if(s){i(!1);return}const C=n.getAttributes("link").href;a(typeof C=="string"?C:""),c(!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 y=m;let x;e[7]!==o||e[8]!==n||e[9]!==y?(x=()=>{const C=ma(o);if(C===""){y();return}if(!ga(C)){c(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:C}).run(),i(!1)},e[7]=o,e[8]=n,e[9]=y,e[10]=x):x=e[10];const g=x;let b;e[11]!==r?(b=r("markdownEditor.link"),e[11]=r,e[12]=b):b=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=d.jsx(Co,{size:14}),e[13]=k):k=e[13];let w;e[14]!==u||e[15]!==b||e[16]!==p?(w=d.jsx(at,{active:u,label:b,onClick:p,children:k}),e[14]=u,e[15]=b,e[16]=p,e[17]=w):w=e[17];let S;e[18]!==u||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==l||e[23]!==s||e[24]!==y||e[25]!==r?(S=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:C=>{C.currentTarget.contains(C.relatedTarget)||i(!1)},children:[d.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":l,placeholder:r("markdownEditor.linkPlaceholder"),value:o,onChange:C=>{a(C.target.value),c(!1)},onKeyDown:C=>{C.key==="Enter"?(C.preventDefault(),g()):C.key==="Escape"&&(C.preventDefault(),i(!1),n.chain().focus().run())},className:Z("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",l&&"text-destructive")}),d.jsx(at,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:d.jsx(Ps,{size:14})}),u&&d.jsx(at,{active:!1,label:r("markdownEditor.linkRemove"),onClick:y,children:d.jsx(jo,{size:14})})]}),e[18]=u,e[19]=g,e[20]=o,e[21]=n,e[22]=l,e[23]=s,e[24]=y,e[25]=r,e[26]=S):S=e[26];let j;return e[27]!==w||e[28]!==S?(j=d.jsxs("div",{className:"relative",children:[w,S]}),e[27]=w,e[28]=S,e[29]=j):j=e[29],j}const rr=()=>{const t=L.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},Ei=t=>{const e=L.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},xa=[1,2,3],af=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function lf(t){const e=L.c(20),{editor:n}=t,r=ce(),[s,i]=v.useState(null);let o;e[0]!==n?(o={editor:n,selector:cf},e[0]=n,e[1]=o):o=e[1];const a=Pl(o);let l;e[2]!==r?(l=r("markdownEditor.heading1"),e[2]=r,e[3]=l):l=e[3];let c;e[4]!==r?(c=r("markdownEditor.heading2"),e[4]=r,e[5]=c):c=e[5];let f;e[6]!==r?(f=r("markdownEditor.heading3"),e[6]=r,e[7]=f):f=e[7];let u;e[8]!==l||e[9]!==c||e[10]!==f?(u={1:l,2:c,3:f},e[8]=l,e[9]=c,e[10]=f,e[11]=u):u=e[11];const h=u;let p;e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==a||e[16]!==r?(p=s&&d.jsxs(ef,{editor:n,shouldShow:af,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(at,{active:a.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:d.jsx(Va,{size:14})}),d.jsx(at,{active:a.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:d.jsx(Ga,{size:14})}),d.jsx(at,{active:a.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:d.jsx(Qa,{size:14})}),d.jsx(at,{active:a.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:d.jsx(Xa,{size:14})}),d.jsx(rr,{}),xa.map((y,x)=>d.jsx(at,{active:a.headings[x]??!1,label:h[y],onClick:()=>n.chain().focus().toggleHeading({level:y}).run(),children:d.jsx(Ei,{children:`H${y}`})},y)),d.jsx(rr,{}),d.jsx(at,{active:a.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:d.jsx(ao,{size:14})}),d.jsx(at,{active:a.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:d.jsx(Ei,{children:"1."})}),d.jsx(at,{active:a.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:d.jsx(Ya,{size:14})}),d.jsx(rr,{}),d.jsx(of,{editor:n})]}),e[12]=n,e[13]=h,e[14]=s,e[15]=a,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 cf(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:xa.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function Gr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Qt=Gr();function ba(t){Qt=t}var Vt={exec:()=>null};function ae(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 df=(()=>{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)}}>`)},uf=/^(?:[ \t]*(?:\n|$))+/,ff=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,cs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ya=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ka=ae(ya).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(),gf=ae(ya).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(),Xr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mf=/^[^\n]+/,Yr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xf=ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bf=ae(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qr).getRegex(),Vs="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",Zr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yf=ae("^ {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",Zr).replace("tag",Vs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),va=ae(Xr).replace("hr",cs).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",Vs).getRegex(),kf=ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",va).getRegex(),Jr={blockquote:kf,code:ff,def:xf,fences:hf,heading:pf,hr:cs,html:yf,lheading:ka,list:bf,newline:uf,paragraph:va,table:Vt,text:mf},Ii=ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",cs).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",Vs).getRegex(),vf={...Jr,lheading:gf,table:Ii,paragraph:ae(Xr).replace("hr",cs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ii).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",Vs).getRegex()},wf={...Jr,html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zr).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:ae(Xr).replace("hr",cs).replace("heading",` *#{1,6} *[^
6
+ `},td={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 nd(t){let{announcements:e=td,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=ed}=t;const{announce:i,announcement:o}=Yc(),a=os("DndLiveRegion"),[l,c]=v.useState(!1);if(v.useEffect(()=>{c(!0)},[]),Zc(v.useMemo(()=>({onDragStart(u){let{active:h}=u;i(e.onDragStart({active:h}))},onDragMove(u){let{active:h,over:p}=u;e.onDragMove&&i(e.onDragMove({active:h,over:p}))},onDragOver(u){let{active:h,over:p}=u;i(e.onDragOver({active:h,over:p}))},onDragEnd(u){let{active:h,over:p}=u;i(e.onDragEnd({active:h,over:p}))},onDragCancel(u){let{active:h,over:p}=u;i(e.onDragCancel({active:h,over:p}))}}),[i,e])),!l)return null;const f=Se.createElement(Se.Fragment,null,Se.createElement(Qc,{id:r,value:s.draggable}),Se.createElement(Xc,{id:a,announcement:o}));return n?Ut.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 Rs(){}function di(t,e){return v.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function sd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Et=Object.freeze({x:0,y:0});function Io(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function rd(t,e){const n=Ns(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 _o(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function id(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function ui(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 Ao(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function fi(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 om=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=fi(e,e.left,e.top),i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=Io(fi(l),s);i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(_o)},Bo=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=ui(e),i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=ui(l),f=s.reduce((h,p,m)=>h+Io(c[m],p),0),u=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(_o)};function od(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,a=i-n;if(r<s&&n<i){const l=e.width*e.height,c=t.width*t.height,f=o*a,u=f/(l+c-f);return Number(u.toFixed(4))}return 0}const ad=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const l=od(a,e);l>0&&s.push({id:o,data:{droppableContainer:i,value:l}})}}return s.sort(id)};function ld(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function Oo(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Et}function cd(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,a)=>({...o,top:o.top+t*a.y,bottom:o.bottom+t*a.y,left:o.left+t*a.x,right:o.right+t*a.x}),{...n})}}const dd=cd(1);function $o(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 ud(t,e,n){const r=$o(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:a}=r,l=t.left-o-(1-s)*parseFloat(n),c=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,u=i?t.height/i:t.height;return{width:f,height:u,top:c,right:l+f,bottom:c+u,left:l}}const fd={ignoreTransform:!1};function On(t,e){e===void 0&&(e=fd);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:f}=rt(t).getComputedStyle(t);c&&(n=ud(n,c,f))}const{top:r,left:s,width:i,height:o,bottom:a,right:l}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:l}}function hi(t){return On(t,{ignoreTransform:!0})}function hd(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function pd(t,e){return e===void 0&&(e=rt(t).getComputedStyle(t)),e.position==="fixed"}function gd(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 Hs(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(Mr(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!rs(s)||No(s)||n.includes(s))return n;const i=rt(t).getComputedStyle(s);return s!==t&&gd(s,i)&&n.push(s),pd(s,i)?n:r(s.parentNode)}return t?r(t):n}function Mo(t){const[e]=Hs(t,1);return e??null}function tr(t){return!Fs||!t?null:An(t)?t:$r(t)?Mr(t)||t===Bn(t).scrollingElement?window:rs(t)?t:null:null}function zo(t){return An(t)?t.scrollX:t.scrollLeft}function Lo(t){return An(t)?t.scrollY:t.scrollTop}function dr(t){return{x:zo(t),y:Lo(t)}}var Pe;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Pe||(Pe={}));function Po(t){return!Fs||!t?!1:t===document.scrollingElement}function Fo(t){const e={x:0,y:0},n=Po(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,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:e}}const md={x:.2,y:.2};function xd(t,e,n,r,s){let{top:i,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=md);const{isTop:c,isBottom:f,isLeft:u,isRight:h}=Fo(t),p={x:0,y:0},m={x:0,y:0},y={height:e.height*s.y,width:e.width*s.x};return!c&&i<=e.top+y.height?(p.y=Pe.Backward,m.y=r*Math.abs((e.top+y.height-i)/y.height)):!f&&l>=e.bottom-y.height&&(p.y=Pe.Forward,m.y=r*Math.abs((e.bottom-y.height-l)/y.height)),!h&&a>=e.right-y.width?(p.x=Pe.Forward,m.x=r*Math.abs((e.right-y.width-a)/y.width)):!u&&o<=e.left+y.width&&(p.x=Pe.Backward,m.x=r*Math.abs((e.left+y.width-o)/y.width)),{direction:p,speed:m}}function bd(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 Uo(t){return t.reduce((e,n)=>Tn(e,dr(n)),Et)}function yd(t){return t.reduce((e,n)=>e+zo(n),0)}function kd(t){return t.reduce((e,n)=>e+Lo(n),0)}function qo(t,e){if(e===void 0&&(e=On),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);Mo(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const vd=[["x",["left","right"],yd],["y",["top","bottom"],kd]];class zr{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=Hs(n),s=Uo(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,a]of vd)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(r),f=s[i]-c;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Xn{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 wd(t){const{EventTarget:e}=rt(t);return t instanceof e?t:Bn(t)}function nr(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 bt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(bt||(bt={}));function pi(t){t.preventDefault()}function Sd(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 Ho={start:[oe.Space,oe.Enter],cancel:[oe.Esc],end:[oe.Space,oe.Enter,oe.Tab]},Cd=(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 Lr{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 Xn(Bn(n)),this.windowListeners=new Xn(rt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bt.Resize,this.handleCancel),this.windowListeners.add(bt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&qo(r),n(Et)}handleKeyDown(e){if(qs(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=Ho,coordinateGetter:o=Cd,scrollBehavior:a="smooth"}=s,{code:l}=e;if(i.end.includes(l)){this.handleEnd(e);return}if(i.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:c}=r.current,f=c?{x:c.left,y:c.top}:Et;this.referenceCoordinates||(this.referenceCoordinates=f);const u=o(e,{active:n,context:r.current,currentCoordinates:f});if(u){const h=ts(u,f),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const y of m){const x=e.code,{isTop:g,isRight:b,isLeft:k,isBottom:w,maxScroll:C,minScroll:j}=Fo(y),S=bd(y),T={x:Math.min(x===oe.Right?S.right-S.width/2:S.right,Math.max(x===oe.Right?S.left:S.left+S.width/2,u.x)),y:Math.min(x===oe.Down?S.bottom-S.height/2:S.bottom,Math.max(x===oe.Down?S.top:S.top+S.height/2,u.y))},N=x===oe.Right&&!b||x===oe.Left&&!k,R=x===oe.Down&&!w||x===oe.Up&&!g;if(N&&T.x!==u.x){const D=y.scrollLeft+h.x,E=x===oe.Right&&D<=C.x||x===oe.Left&&D>=j.x;if(E&&!h.y){y.scrollTo({left:D,behavior:a});return}E?p.x=y.scrollLeft-D:p.x=x===oe.Right?y.scrollLeft-C.x:y.scrollLeft-j.x,p.x&&y.scrollBy({left:-p.x,behavior:a});break}else if(R&&T.y!==u.y){const D=y.scrollTop+h.y,E=x===oe.Down&&D<=C.y||x===oe.Up&&D>=j.y;if(E&&!h.x){y.scrollTo({top:D,behavior:a});return}E?p.y=y.scrollTop-D:p.y=x===oe.Down?y.scrollTop-C.y:y.scrollTop-j.y,p.y&&y.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(e,Tn(ts(u,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()}}Lr.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=Ho,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function gi(t){return!!(t&&"distance"in t)}function mi(t){return!!(t&&"delay"in t)}class Pr{constructor(e,n,r){var s;r===void 0&&(r=wd(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=Bn(o),this.documentListeners=new Xn(this.document),this.listeners=new Xn(r),this.windowListeners=new Xn(rt(o)),this.initialCoordinates=(s=Ns(i))!=null?s:Et,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(bt.Resize,this.handleCancel),this.windowListeners.add(bt.DragStart,pi),this.windowListeners.add(bt.VisibilityChange,this.handleCancel),this.windowListeners.add(bt.ContextMenu,pi),this.documentListeners.add(bt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mi(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(gi(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(bt.Click,Sd,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bt.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const l=(n=Ns(e))!=null?n:Et,c=ts(s,l);if(!r&&a){if(gi(a)){if(a.tolerance!=null&&nr(c,a.tolerance))return this.handleCancel();if(nr(c,a.distance))return this.handleStart()}if(mi(a)&&nr(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}e.cancelable&&e.preventDefault(),o(l)}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 Td={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Fr extends Pr{constructor(e){const{event:n}=e,r=Bn(n.target);super(e,Td,r)}}Fr.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 jd={move:{name:"mousemove"},end:{name:"mouseup"}};var ur;(function(t){t[t.RightClick=2]="RightClick"})(ur||(ur={}));class Dd extends Pr{constructor(e){super(e,jd,Bn(e.event.target))}}Dd.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===ur.RightClick?!1:(r?.({event:n}),!0)}}];const sr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Nd extends Pr{constructor(e){super(e,sr)}static setup(){return window.addEventListener(sr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(sr.move.name,e)};function e(){}}}Nd.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 Yn;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Yn||(Yn={}));var Es;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Es||(Es={}));function Rd(t){let{acceleration:e,activator:n=Yn.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=Es.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:f,delta:u,threshold:h}=t;const p=Id({delta:u,disabled:!i}),[m,y]=Hc(),x=v.useRef({x:0,y:0}),g=v.useRef({x:0,y:0}),b=v.useMemo(()=>{switch(n){case Yn.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Yn.DraggableRect:return s}},[n,s,l]),k=v.useRef(null),w=v.useCallback(()=>{const j=k.current;if(!j)return;const S=x.current.x*g.current.x,T=x.current.y*g.current.y;j.scrollBy(S,T)},[]),C=v.useMemo(()=>a===Es.TreeOrder?[...c].reverse():c,[a,c]);v.useEffect(()=>{if(!i||!c.length||!b){y();return}for(const j of C){if(r?.(j)===!1)continue;const S=c.indexOf(j),T=f[S];if(!T)continue;const{direction:N,speed:R}=xd(j,T,b,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){y(),k.current=j,m(w,o),x.current=R,g.current=N;return}}x.current={x:0,y:0},g.current={x:0,y:0},y()},[e,w,r,y,i,o,JSON.stringify(b),JSON.stringify(p),m,c,C,f,JSON.stringify(h)])}const Ed={x:{[Pe.Backward]:!1,[Pe.Forward]:!1},y:{[Pe.Backward]:!1,[Pe.Forward]:!1}};function Id(t){let{delta:e,disabled:n}=t;const r=Ds(e);return is(s=>{if(n||!r||!s)return Ed;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Pe.Backward]:s.x[Pe.Backward]||i.x===-1,[Pe.Forward]:s.x[Pe.Forward]||i.x===1},y:{[Pe.Backward]:s.y[Pe.Backward]||i.y===-1,[Pe.Forward]:s.y[Pe.Forward]||i.y===1}}},[n,e,r])}function _d(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return is(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function Ad(t,e){return v.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 ns;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ns||(ns={}));var fr;(function(t){t.Optimized="optimized"})(fr||(fr={}));const xi=new Map;function Bd(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=v.useState(null),{frequency:a,measure:l,strategy:c}=s,f=v.useRef(t),u=x(),h=es(u),p=v.useCallback(function(g){g===void 0&&(g=[]),!h.current&&o(b=>b===null?g:b.concat(g.filter(k=>!b.includes(k))))},[h]),m=v.useRef(null),y=is(g=>{if(u&&!n)return xi;if(!g||g===xi||f.current!==t||i!=null){const b=new Map;for(let k of t){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){b.set(k.id,k.rect.current);continue}const w=k.node.current,C=w?new zr(l(w),w):null;k.rect.current=C,C&&b.set(k.id,C)}return b}return g},[t,i,n,u,l]);return v.useEffect(()=>{f.current=t},[t]),v.useEffect(()=>{u||p()},[n,u]),v.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),v.useEffect(()=>{u||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},a))},[a,u,p,...r]),{droppableRects:y,measureDroppableContainers:p,measuringScheduled:i!=null};function x(){switch(c){case ns.Always:return!1;case ns.BeforeDragging:return n;default:return!n}}}function Ur(t,e){return is(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Od(t,e){return Ur(t,e)}function $d(t){let{callback:e,disabled:n}=t;const r=Us(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Ks(t){let{callback:e,disabled:n}=t;const r=Us(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Md(t){return new zr(On(t),t)}function bi(t,e,n){e===void 0&&(e=Md);const[r,s]=v.useState(null);function i(){s(l=>{if(!t)return null;if(t.isConnected===!1){var c;return(c=l??n)!=null?c:null}const f=e(t);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const o=$d({callback(l){if(t)for(const c of l){const{type:f,target:u}=c;if(f==="childList"&&u instanceof HTMLElement&&u.contains(t)){i();break}}}}),a=Ks({callback:i});return Rt(()=>{i(),t?(a?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),o?.disconnect())},[t]),r}function zd(t){const e=Ur(t);return Oo(t,e)}const yi=[];function Ld(t){const e=v.useRef(t),n=is(r=>t?r&&r!==yi&&t&&e.current&&t.parentNode===e.current.parentNode?r:Hs(t):yi,[t]);return v.useEffect(()=>{e.current=t},[t]),n}function Pd(t){const[e,n]=v.useState(null),r=v.useRef(t),s=v.useCallback(i=>{const o=tr(i.target);o&&n(a=>a?(a.set(o,dr(o)),new Map(a)):null)},[]);return v.useEffect(()=>{const i=r.current;if(t!==i){o(i);const a=t.map(l=>{const c=tr(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,dr(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=t}return()=>{o(t),o(i)};function o(a){a.forEach(l=>{const c=tr(l);c?.removeEventListener("scroll",s)})}},[s,t]),v.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Tn(i,o),Et):Uo(t):Et,[t,e])}function ki(t,e){e===void 0&&(e=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},e),v.useEffect(()=>{const r=t!==Et;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?ts(t,n.current):Et}function Fd(t){v.useEffect(()=>{if(!Fs)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 Ud(t,e){return v.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function Ko(t){return v.useMemo(()=>t?hd(t):null,[t])}const vi=[];function qd(t,e){e===void 0&&(e=On);const[n]=t,r=Ko(n?rt(n):null),[s,i]=v.useState(vi);function o(){i(()=>t.length?t.map(l=>Po(l)?r:new zr(e(l),l)):vi)}const a=Ks({callback:o});return Rt(()=>{a?.disconnect(),o(),t.forEach(l=>a?.observe(l))},[t]),s}function Wo(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return rs(e)?e:t}function Hd(t){let{measure:e}=t;const[n,r]=v.useState(null),s=v.useCallback(c=>{for(const{target:f}of c)if(rs(f)){r(u=>{const h=e(f);return u?{...u,width:h.width,height:h.height}:h});break}},[e]),i=Ks({callback:s}),o=v.useCallback(c=>{const f=Wo(c);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[a,l]=js(o);return v.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Kd=[{sensor:Fr,options:{}},{sensor:Lr,options:{}}],Wd={current:{}},Cs={draggable:{measure:hi},droppable:{measure:hi,strategy:ns.WhileDragging,frequency:fr.Optimized},dragOverlay:{measure:On}};class Zn 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 Vd={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Cs,measureDroppableContainers:Rs,windowRect:null,measuringScheduled:!1},Vo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Rs,draggableNodes:new Map,over:null,measureDroppableContainers:Rs},as=v.createContext(Vo),Go=v.createContext(Vd);function Gd(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zn}}}function Qd(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 Zn(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 Zn(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 Zn(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Xd(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=v.useContext(as),i=Ds(r),o=Ds(n?.id);return v.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!qs(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const f of[l.current,c.current]){if(!f)continue;const u=Vc(f);if(u){u.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 Yd(t){return v.useMemo(()=>({draggable:{...Cs.draggable,...t?.draggable},droppable:{...Cs.droppable,...t?.droppable},dragOverlay:{...Cs.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Zd(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=v.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;Rt(()=>{if(!o&&!a||!e){i.current=!1;return}if(i.current||!r)return;const c=e?.node.current;if(!c||c.isConnected===!1)return;const f=n(c),u=Oo(f,r);if(o||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const h=Mo(c);h&&h.scrollBy({top:u.y,left:u.x})}},[e,o,a,r,n])}const Ws=v.createContext({...Et,scaleX:1,scaleY:1});var Ft;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ft||(Ft={}));const Jd=v.memo(function(e){var n,r,s,i;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:f=Kd,collisionDetection:u=ad,measuring:h,modifiers:p,...m}=e;const y=v.useReducer(Qd,void 0,Gd),[x,g]=y,[b,k]=Jc(),[w,C]=v.useState(Ft.Uninitialized),j=w===Ft.Initialized,{draggable:{active:S,nodes:T,translate:N},droppable:{containers:R}}=x,D=S!=null?T.get(S):null,E=v.useRef({initial:null,translated:null}),M=v.useMemo(()=>{var de;return S!=null?{id:S,data:(de=D?.data)!=null?de:Wd,rect:E}:null},[S,D]),A=v.useRef(null),[U,I]=v.useState(null),[B,O]=v.useState(null),K=es(m,Object.values(m)),Y=os("DndDescribedBy",o),P=v.useMemo(()=>R.getEnabled(),[R]),q=Yd(h),{droppableRects:Q,measureDroppableContainers:G,measuringScheduled:ee}=Bd(P,{dragging:j,dependencies:[N.x,N.y],config:q.droppable}),W=_d(T,S),ne=v.useMemo(()=>B?Ns(B):null,[B]),J=tt(),se=Od(W,q.draggable.measure);Zd({activeNode:S!=null?T.get(S):null,config:J.layoutShiftCompensation,initialRect:se,measure:q.draggable.measure});const $=bi(W,q.draggable.measure,se),F=bi(W?W.parentElement:null),X=v.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=R.getNodeFor((n=X.current.over)==null?void 0:n.id),_=Hd({measure:q.dragOverlay.measure}),V=(r=_.nodeRef.current)!=null?r:W,te=j?(s=_.rect)!=null?s:$:null,le=!!(_.nodeRef.current&&_.rect),je=zd(le?null:$),pe=Ko(V?rt(V):null),De=Ld(j?re??W:null),fe=qd(De),it=Qo(p,{transform:{x:N.x-je.x,y:N.y-je.y,scaleX:1,scaleY:1},activatorEvent:B,active:M,activeNodeRect:$,containerNodeRect:F,draggingNodeRect:te,over:X.current.over,overlayNodeRect:_.rect,scrollableAncestors:De,scrollableAncestorRects:fe,windowRect:pe}),Ee=ne?Tn(ne,N):null,ct=Pd(De),be=ki(ct),ge=ki(ct,[$]),Le=Tn(it,be),me=te?dd(te,it):null,gt=M&&me?u({active:M,collisionRect:me,droppableRects:Q,droppableContainers:P,pointerCoordinates:Ee}):null,Ke=Ao(gt,"id"),[Ae,We]=v.useState(null),Ze=le?it:Tn(it,ge),mt=ld(Ze,(i=Ae?.rect)!=null?i:null,$),Fe=v.useRef(null),Ve=v.useCallback((de,we)=>{let{sensor:xe,options:Ne}=we;if(A.current==null)return;const ye=T.get(A.current);if(!ye)return;const Ce=de.nativeEvent,Te=new xe({active:A.current,activeNode:ye,event:Ce,options:Ne,context:X,onAbort(he){if(!T.get(he))return;const{onDragAbort:Ie}=K.current,qe={id:he};Ie?.(qe),b({type:"onDragAbort",event:qe})},onPending(he,Be,Ie,qe){if(!T.get(he))return;const{onDragPending:$e}=K.current,Re={id:he,constraint:Be,initialCoordinates:Ie,offset:qe};$e?.(Re),b({type:"onDragPending",event:Re})},onStart(he){const Be=A.current;if(Be==null)return;const Ie=T.get(Be);if(!Ie)return;const{onDragStart:qe}=K.current,Oe={activatorEvent:Ce,active:{id:Be,data:Ie.data,rect:E}};Ut.unstable_batchedUpdates(()=>{qe?.(Oe),C(Ft.Initializing),g({type:ze.DragStart,initialCoordinates:he,active:Be}),b({type:"onDragStart",event:Oe}),I(Fe.current),O(Ce)})},onMove(he){g({type:ze.DragMove,coordinates:he})},onEnd:Ue(ze.DragEnd),onCancel:Ue(ze.DragCancel)});Fe.current=Te;function Ue(he){return async function(){const{active:Ie,collisions:qe,over:Oe,scrollAdjustedTranslate:$e}=X.current;let Re=null;if(Ie&&$e){const{cancelDrop:Me}=K.current;Re={activatorEvent:Ce,active:Ie,collisions:qe,delta:$e,over:Oe},he===ze.DragEnd&&typeof Me=="function"&&await Promise.resolve(Me(Re))&&(he=ze.DragCancel)}A.current=null,Ut.unstable_batchedUpdates(()=>{g({type:he}),C(Ft.Uninitialized),We(null),I(null),O(null),Fe.current=null;const Me=he===ze.DragEnd?"onDragEnd":"onDragCancel";if(Re){const He=K.current[Me];He?.(Re),b({type:Me,event:Re})}})}}},[T]),Je=v.useCallback((de,we)=>(xe,Ne)=>{const ye=xe.nativeEvent,Ce=T.get(Ne);if(A.current!==null||!Ce||ye.dndKit||ye.defaultPrevented)return;const Te={active:Ce};de(xe,we.options,Te)===!0&&(ye.dndKit={capturedBy:we.sensor},A.current=Ne,Ve(xe,we))},[T,Ve]),dt=Ad(f,Je);Fd(f),Rt(()=>{$&&w===Ft.Initializing&&C(Ft.Initialized)},[$,w]),v.useEffect(()=>{const{onDragMove:de}=K.current,{active:we,activatorEvent:xe,collisions:Ne,over:ye}=X.current;if(!we||!xe)return;const Ce={active:we,activatorEvent:xe,collisions:Ne,delta:{x:Le.x,y:Le.y},over:ye};Ut.unstable_batchedUpdates(()=>{de?.(Ce),b({type:"onDragMove",event:Ce})})},[Le.x,Le.y]),v.useEffect(()=>{const{active:de,activatorEvent:we,collisions:xe,droppableContainers:Ne,scrollAdjustedTranslate:ye}=X.current;if(!de||A.current==null||!we||!ye)return;const{onDragOver:Ce}=K.current,Te=Ne.get(Ke),Ue=Te&&Te.rect.current?{id:Te.id,rect:Te.rect.current,data:Te.data,disabled:Te.disabled}:null,he={active:de,activatorEvent:we,collisions:xe,delta:{x:ye.x,y:ye.y},over:Ue};Ut.unstable_batchedUpdates(()=>{We(Ue),Ce?.(he),b({type:"onDragOver",event:he})})},[Ke]),Rt(()=>{X.current={activatorEvent:B,active:M,activeNode:W,collisionRect:me,collisions:gt,droppableRects:Q,draggableNodes:T,draggingNode:V,draggingNodeRect:te,droppableContainers:R,over:Ae,scrollableAncestors:De,scrollAdjustedTranslate:Le},E.current={initial:te,translated:me}},[M,W,gt,me,T,V,te,Q,R,Ae,De,Le]),Rd({...J,delta:N,draggingRect:me,pointerCoordinates:Ee,scrollableAncestors:De,scrollableAncestorRects:fe});const ut=v.useMemo(()=>({active:M,activeNode:W,activeNodeRect:$,activatorEvent:B,collisions:gt,containerNodeRect:F,dragOverlay:_,draggableNodes:T,droppableContainers:R,droppableRects:Q,over:Ae,measureDroppableContainers:G,scrollableAncestors:De,scrollableAncestorRects:fe,measuringConfiguration:q,measuringScheduled:ee,windowRect:pe}),[M,W,$,B,gt,F,_,T,R,Q,Ae,G,De,fe,q,ee,pe]),et=v.useMemo(()=>({activatorEvent:B,activators:dt,active:M,activeNodeRect:$,ariaDescribedById:{draggable:Y},dispatch:g,draggableNodes:T,over:Ae,measureDroppableContainers:G}),[B,dt,M,$,g,Y,T,Ae,G]);return Se.createElement(Eo.Provider,{value:k},Se.createElement(as.Provider,{value:et},Se.createElement(Go.Provider,{value:ut},Se.createElement(Ws.Provider,{value:mt},c)),Se.createElement(Xd,{disabled:a?.restoreFocus===!1})),Se.createElement(nd,{...a,hiddenTextDescribedById:Y}));function tt(){const de=U?.autoScrollEnabled===!1,we=typeof l=="object"?l.enabled===!1:l===!1,xe=j&&!de&&!we;return typeof l=="object"?{...l,enabled:xe}:{enabled:xe}}}),eu=v.createContext(null),wi="button",tu="Draggable";function nu(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=os(tu),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:f,draggableNodes:u,over:h}=v.useContext(as),{role:p=wi,roleDescription:m="draggable",tabIndex:y=0}=s??{},x=l?.id===e,g=v.useContext(x?Ws:eu),[b,k]=js(),[w,C]=js(),j=Ud(o,e),S=es(n);Rt(()=>(u.set(e,{id:e,key:i,node:b,activatorNode:w,data:S}),()=>{const N=u.get(e);N&&N.key===i&&u.delete(e)}),[u,e]);const T=v.useMemo(()=>({role:p,tabIndex:y,"aria-disabled":r,"aria-pressed":x&&p===wi?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,p,y,x,m,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:x,listeners:r?void 0:j,node:b,over:h,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Xo(){return v.useContext(Go)}const su="Droppable",ru={timeout:25};function Yo(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=os(su),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=v.useContext(as),f=v.useRef({disabled:n}),u=v.useRef(!1),h=v.useRef(null),p=v.useRef(null),{disabled:m,updateMeasurementsFor:y,timeout:x}={...ru,...s},g=es(y??r),b=v.useCallback(()=>{if(!u.current){u.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),p.current=null},x)},[x]),k=Ks({callback:b,disabled:m||!o}),w=v.useCallback((T,N)=>{k&&(N&&(k.unobserve(N),u.current=!1),T&&k.observe(T))},[k]),[C,j]=js(w),S=es(e);return v.useEffect(()=>{!k||!C.current||(k.disconnect(),u.current=!1,k.observe(C.current))},[C,k]),v.useEffect(()=>(a({type:ze.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:h,data:S}}),()=>a({type:ze.UnregisterDroppable,key:i,id:r})),[r]),v.useEffect(()=>{n!==f.current.disabled&&(a({type:ze.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:o,rect:h,isOver:l?.id===r,node:C,over:l,setNodeRef:j}}function iu(t){let{animation:e,children:n}=t;const[r,s]=v.useState(null),[i,o]=v.useState(null),a=Ds(n);return!n&&!r&&a&&s(a),Rt(()=>{if(!i)return;const l=r?.key,c=r?.props.id;if(l==null||c==null){s(null);return}Promise.resolve(e(c,i)).then(()=>{s(null)})},[e,r,i]),Se.createElement(Se.Fragment,null,n,r?v.cloneElement(r,{ref:o}):null)}const ou={x:0,y:0,scaleX:1,scaleY:1};function au(t){let{children:e}=t;return Se.createElement(as.Provider,{value:Vo},Se.createElement(Ws.Provider,{value:ou},e))}const lu={position:"fixed",touchAction:"none"},cu=t=>qs(t)?"transform 250ms ease":void 0,du=v.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:l,transform:c,transition:f=cu}=t;if(!a)return null;const u=s?c:{...c,scaleX:1,scaleY:1},h={...lu,width:a.width,height:a.height,top:a.top,left:a.left,transform:Ht.Transform.toString(u),transformOrigin:s&&r?rd(r,a):void 0,transition:typeof f=="function"?f(r):f,...l};return Se.createElement(n,{className:o,style:h,ref:e},i)}),uu=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,c]of Object.entries(s))n.node.style.setProperty(l,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},fu=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Ht.Transform.toString(e)},{transform:Ht.Transform.toString(n)}]},hu={duration:250,easing:"ease",keyframes:fu,sideEffects:uu({styles:{active:{opacity:"0"}}})};function pu(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return Us((i,o)=>{if(e===null)return;const a=n.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=Wo(o);if(!c)return;const{transform:f}=rt(o).getComputedStyle(o),u=$o(f);if(!u)return;const h=typeof e=="function"?e:gu(e);return qo(l,s.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function gu(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...hu,...t};return i=>{let{active:o,dragOverlay:a,transform:l,...c}=i;if(!e)return;const f={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},u={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-f.x,y:l.y-f.y,...u},p=s({...c,active:o,dragOverlay:a,transform:{initial:l,final:h}}),[m]=p,y=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(y))return;const x=r?.({active:o,dragOverlay:a,...c}),g=a.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(b=>{g.onfinish=()=>{x?.(),b()}})}}let Si=0;function mu(t){return v.useMemo(()=>{if(t!=null)return Si++,Si},[t])}const xu=Se.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=t;const{activatorEvent:f,active:u,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:y,dragOverlay:x,over:g,measuringConfiguration:b,scrollableAncestors:k,scrollableAncestorRects:w,windowRect:C}=Xo(),j=v.useContext(Ws),S=mu(u?.id),T=Qo(o,{activatorEvent:f,active:u,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:x.rect,over:g,overlayNodeRect:x.rect,scrollableAncestors:k,scrollableAncestorRects:w,transform:j,windowRect:C}),N=Ur(h),R=pu({config:r,draggableNodes:m,droppableContainers:y,measuringConfiguration:b}),D=N?x.setRef:void 0;return Se.createElement(au,null,Se.createElement(iu,{animation:R},u&&S?Se.createElement(du,{key:S,id:u.id,ref:D,as:a,activatorEvent:f,adjustScale:e,className:l,transition:i,rect:N,style:{zIndex:c,...s},transform:T},n):null))});function bu(t){const{org:e}=_e(),{data:n}=Ua.useSession(),r=xl(),s=En(),i=al({connectionId:lo,orgId:e.id,orgSlug:e.slug}),[o,a]=v.useState(!1),l=fl(t,{enabled:!1});return{connect:async()=>{if(!(o||!n?.user?.id||!e)){a(!0);try{const f=l.data??(await l.refetch()).data;if(!f){At.error("Could not find this integration in the registry");return}const u=vl(f,e.id,n.user.id,{remoteIndex:0});if(!u.connection_url){At.error("This integration has no connection method available");return}const h=u.app_name?await yu(i,u.app_name):null,p=!h,m=h?.id??(await r.create.mutateAsync(u)).id,y=await kl({connectionId:m,orgId:e.id,orgSlug:e.slug,persistFallback:x=>r.update.mutateAsync({id:m,data:{connection_token:x}}).then(()=>{})});if(y.ran&&!y.ok){if(p)try{await r.delete.mutateAsync(m)}catch{}At.error(`Authentication failed: ${y.error??"no token"}`);return}qa(s,e.id),At.success(p?"Connected successfully":"Already connected")}catch(f){At.error(`Failed to connect: ${f instanceof Error?f.message:String(f)}`)}finally{a(!1)}}},isConnecting:o}}async function yu(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 qr(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function ku(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function gs(t){return t!==null&&t>=0}function vu(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 wu(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Zo=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=qr(e,r,n),o=e[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},ms={scaleX:1,scaleY:1},Su=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const a=(e=i[n])!=null?e:r;if(!a)return null;if(s===n){const c=i[o];return c?{x:0,y:n<o?c.top+c.height-(a.top+a.height):c.top-a.top,...ms}:null}const l=Cu(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-l,...ms}:s<n&&s>=o?{x:0,y:a.height+l,...ms}:{x:0,y:0,...ms}};function Cu(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 Jo="Sortable",ea=Se.createContext({activeIndex:-1,containerId:Jo,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Zo,disabled:{draggable:!1,droppable:!1}});function Tu(t){let{children:e,id:n,items:r,strategy:s=Zo,disabled:i=!1}=t;const{active:o,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:f}=Xo(),u=os(Jo,n),h=a.rect!==null,p=v.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),m=o!=null,y=o?p.indexOf(o.id):-1,x=c?p.indexOf(c.id):-1,g=v.useRef(p),b=!vu(p,g.current),k=x!==-1&&y===-1||b,w=wu(i);Rt(()=>{b&&m&&f(p)},[b,p,m,f]),v.useEffect(()=>{g.current=p},[p]);const C=v.useMemo(()=>({activeIndex:y,containerId:u,disabled:w,disableTransforms:k,items:p,overIndex:x,useDragOverlay:h,sortedRects:ku(p,l),strategy:s}),[y,u,w.draggable,w.droppable,k,p,x,l,h,s]);return Se.createElement(ea.Provider,{value:C},e)}const ju=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return qr(n,r,s).indexOf(e)},Du=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:l,transition:c}=t;return!c||!r||a!==i&&s===o?!1:n?!0:o!==s&&e===l},Nu={duration:200,easing:"ease"},ta="transform",Ru=Ht.Transition.toString({property:ta,duration:0,easing:"linear"}),Eu={roleDescription:"sortable"};function Iu(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=v.useState(null),a=v.useRef(n);return Rt(()=>{if(!e&&n!==a.current&&r.current){const l=s.current;if(l){const c=On(r.current,{ignoreTransform:!0}),f={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(f.x||f.y)&&o(f)}}n!==a.current&&(a.current=n)},[e,n,r,s]),v.useEffect(()=>{i&&o(null)},[i]),i}function _u(t){let{animateLayoutChanges:e=Du,attributes:n,disabled:r,data:s,getNewIndex:i=ju,id:o,strategy:a,resizeObserverConfig:l,transition:c=Nu}=t;const{items:f,containerId:u,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:y,overIndex:x,useDragOverlay:g,strategy:b}=v.useContext(ea),k=Au(r,p),w=f.indexOf(o),C=v.useMemo(()=>({sortable:{containerId:u,index:w,items:f},...s}),[u,s,w,f]),j=v.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:S,node:T,isOver:N,setNodeRef:R}=Yo({id:o,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...l}}),{active:D,activatorEvent:E,activeNodeRect:M,attributes:A,setNodeRef:U,listeners:I,isDragging:B,over:O,setActivatorNodeRef:K,transform:Y}=nu({id:o,data:C,attributes:{...Eu,...n},disabled:k.draggable}),P=qc(R,U),q=!!D,Q=q&&!m&&gs(h)&&gs(x),G=!g&&B,ee=G&&Q?Y:null,ne=Q?ee??(a??b)({rects:y,activeNodeRect:M,activeIndex:h,overIndex:x,index:w}):null,J=gs(h)&&gs(x)?i({id:o,items:f,activeIndex:h,overIndex:x}):w,se=D?.id,$=v.useRef({activeId:se,items:f,newIndex:J,containerId:u}),F=f!==$.current.items,X=e({active:D,containerId:u,isDragging:B,isSorting:q,id:o,index:w,items:f,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:c,wasDragging:$.current.activeId!=null}),re=Iu({disabled:!X,index:w,node:T,rect:S});return v.useEffect(()=>{q&&$.current.newIndex!==J&&($.current.newIndex=J),u!==$.current.containerId&&($.current.containerId=u),f!==$.current.items&&($.current.items=f)},[q,J,u,f]),v.useEffect(()=>{if(se===$.current.activeId)return;if(se!=null&&$.current.activeId==null){$.current.activeId=se;return}const V=setTimeout(()=>{$.current.activeId=se},50);return()=>clearTimeout(V)},[se]),{active:D,activeIndex:h,attributes:A,data:C,rect:S,index:w,newIndex:J,items:f,isOver:N,isSorting:q,isDragging:B,listeners:I,node:T,overIndex:x,over:O,setNodeRef:P,setActivatorNodeRef:K,setDroppableNodeRef:R,setDraggableNodeRef:U,transform:re??ne,transition:_()};function _(){if(re||F&&$.current.newIndex===w)return Ru;if(!(G&&!qs(E)||!c)&&(q||X))return Ht.Transition.toString({...c,property:ta})}}function Au(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 Is(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 Bu=[oe.Down,oe.Right,oe.Up,oe.Left],Ou=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:a}}=e;if(Bu.includes(t.code)){if(t.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const h=s.get(u.id);if(h)switch(t.code){case oe.Down:r.top<h.top&&l.push(u);break;case oe.Up:r.top>h.top&&l.push(u);break;case oe.Left:r.left>h.left&&l.push(u);break;case oe.Right:r.left<h.left&&l.push(u);break}});const c=Bo({collisionRect:r,droppableRects:s,droppableContainers:l});let f=Ao(c,"id");if(f===o?.id&&c.length>1&&(f=c[1].id),f!=null){const u=i.get(n.id),h=i.get(f),p=h?s.get(h.id):null,m=h?.node.current;if(m&&p&&u&&h){const x=Hs(m).some((j,S)=>a[S]!==j),g=na(u,h),b=$u(u,h),k=x||!g?{x:0,y:0}:{x:b?r.width-p.width:0,y:b?r.height-p.height:0},w={x:p.left,y:p.top};return k.x&&k.y?w:ts(w,k)}}}};function na(t,e){return!Is(t)||!Is(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function $u(t,e){return!Is(t)||!Is(e)||!na(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function Ot(t){const e=L.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=Z("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==o?(a=d.jsx("img",{src:ll,alt:"Super Agent",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=a):a=e[7],a}const Ci=()=>0;function Mu(t){const{orgSlug:e,enabled:n=!0,onUpdate:r,onDelete:s}=t,i=v.useRef(r);i.current=r;const o=v.useRef(s);o.current=s;const a=v.useRef(null),l=v.useRef(n),c=v.useRef(e);(!a.current||l.current!==n||c.current!==e)&&(l.current=n,c.current=e,a.current=u=>{if(!n||!e)return()=>{};const h=p=>{let m;try{m=JSON.parse(p.data)}catch{return}m.data&&(p.type===Sl?o.current?.(m.data.id):i.current(m.data)),u()};return wl.subscribe(e,h)}),v.useSyncExternalStore(a.current,Ci,Ci)}function zu(){const t=L.c(30),{org:e,locator:n}=_e(),r=In(),s=En();let i;t[0]!==n?(i=ve.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const o=i;let a;t[2]!==r?(a=async()=>(await r.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=r,t[3]=a):a=t[3];let l;t[4]!==o||t[5]!==a?(l={queryKey:o,queryFn:a},t[4]=o,t[5]=a,t[6]=l):l=t[6];const c=lt(l);let f;t[7]!==n||t[8]!==s||t[9]!==o?(f=g=>{s.setQueryData(o,b=>{const k=b??[];return k.some(w=>w.id===g.id)?k.map(w=>w.id===g.id?g:w):[g,...k]}),s.invalidateQueries({queryKey:ve.taskBoardActivity(n,g.id)})},t[7]=n,t[8]=s,t[9]=o,t[10]=f):f=t[10];let u;t[11]!==s||t[12]!==o?(u=g=>{s.setQueryData(o,b=>b?.filter(k=>k.id!==g))},t[11]=s,t[12]=o,t[13]=u):u=t[13];let h;t[14]!==e.slug||t[15]!==f||t[16]!==u?(h={orgSlug:e.slug,onUpdate:f,onDelete:u},t[14]=e.slug,t[15]=f,t[16]=u,t[17]=h):h=t[17],Mu(h);let p;t[18]!==s||t[19]!==o?(p=g=>{const b=g.subject,k=g.data.status;s.setQueryData(o,w=>w?.map(C=>C.threads.some(j=>j.threadId===b)?{...C,threads:C.threads.map(j=>j.threadId===b?{...j,status:k}:j)}:C))},t[18]=s,t[19]=o,t[20]=p):p=t[20];let m;t[21]!==e.slug||t[22]!==p?(m={orgSlug:e.slug,onTaskStatus:p},t[21]=e.slug,t[22]=p,t[23]=m):m=t[23],Tl(m);let y;t[24]!==c.data?(y=c.data??[],t[24]=c.data,t[25]=y):y=t[25];let x;return t[26]!==c.error||t[27]!==c.isLoading||t[28]!==y?(x={items:y,isLoading:c.isLoading,error:c.error},t[26]=c.error,t[27]=c.isLoading,t[28]=y,t[29]=x):x=t[29],x}function Lu(){const t=L.c(40),{locator:e}=_e(),n=In(),r=En();let s;t[0]!==e?(s=ve.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 a=o;let l;t[5]!==n?(l=T=>n.call("TASK_BOARD_ITEM_CREATE",T),t[5]=n,t[6]=l):l=t[6];let c;t[7]!==a||t[8]!==l?(c={mutationFn:l,onSuccess:a},t[7]=a,t[8]=l,t[9]=c):c=t[9];const f=Tt(c);let u;t[10]!==n?(u=T=>n.call("TASK_BOARD_ITEM_UPDATE",T),t[10]=n,t[11]=u):u=t[11];let h,p;t[12]!==r||t[13]!==i?(h=async T=>{await r.cancelQueries({queryKey:i});const N=r.getQueryData(i);return r.setQueryData(i,R=>R?.map(D=>D.id===T.id?{...D,...T}:D)),{previous:N}},p=(T,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]!==a||t[17]!==e||t[18]!==r?(m=(T,N,R)=>{a(),r.invalidateQueries({queryKey:ve.taskBoardActivity(e,R.id)})},t[16]=a,t[17]=e,t[18]=r,t[19]=m):m=t[19];let y;t[20]!==u||t[21]!==h||t[22]!==p||t[23]!==m?(y={mutationFn:u,onMutate:h,onError:p,onSettled:m},t[20]=u,t[21]=h,t[22]=p,t[23]=m,t[24]=y):y=t[24];const x=Tt(y);let g;t[25]!==n?(g=T=>n.call("TASK_BOARD_ITEM_DELETE",{id:T}),t[25]=n,t[26]=g):g=t[26];let b;t[27]!==a||t[28]!==g?(b={mutationFn:g,onSuccess:a},t[27]=a,t[28]=g,t[29]=b):b=t[29];const k=Tt(b);let w;t[30]!==n?(w=T=>n.call("TASK_BOARD_ITEM_UPDATE",T),t[30]=n,t[31]=w):w=t[31];let C;t[32]!==a||t[33]!==w?(C={mutationFn:w,onSuccess:a},t[32]=a,t[33]=w,t[34]=C):C=t[34];const j=Tt(C);let S;return t[35]!==f||t[36]!==j||t[37]!==k||t[38]!==x?(S={create:f,update:x,remove:k,link:j},t[35]=f,t[36]=j,t[37]=k,t[38]=x,t[39]=S):S=t[39],S}function _s(t){return t.threads.some(e=>e.status==="requires_action")}function Hr(t){return t.status==="in_progress"&&_s(t)?"text-warning animate-pulse":yt[t.status].iconClassName}function Pu(t){return t.threads[0]}function Ti(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,a=o===-1?i.length:o,l=i[a-1],c=i[a];return l&&c?(l.sortOrder+c.sortOrder)/2:l?l.sortOrder+1:c?c.sortOrder-1:0}function sa(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const As=["triage","todo","in_progress","in_review","done"],yt={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Ls,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:jl,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:ss,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Dl,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:_n,iconClassName:"text-success"}},Kr=["none","low","medium","high","urgent"],kt={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"}},hr=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],ra=hr[0];function ls(t){return t??ra}function Fu(t){return hr[t%hr.length]??ra}function ia(t){const e=L.c(11),{size:n,className:r}=t,s=n===void 0?16:n,i=ce();let o;e[0]!==i?(o=i("taskBoard.taskDialog.qaAgentLabel"),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==s?(a={width:s,height:s},e[2]=s,e[3]=a):a=e[3];let l;e[4]!==r?(l=Z("shrink-0 rounded-full object-cover",r),e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==o||e[8]!==a||e[9]!==l?(c=d.jsx("img",{src:cl,alt:o,width:s,height:s,style:a,className:l}),e[6]=s,e[7]=o,e[8]=a,e[9]=l,e[10]=c):c=e[10],c}function oa(t){const e=L.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=Z("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==o?(a=d.jsx("img",{src:dl,alt:"Code Reviewer",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=a):a=e[7],a}let pr,gr;if(typeof WeakMap<"u"){let t=new WeakMap;pr=e=>t.get(e),gr=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;pr=r=>{for(let s=0;s<t.length;s+=2)if(t[s]==r)return t[s+1]},gr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var Lt=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 a=1;i<this.width&&this.map[e+a]==n;a++)i++;for(let a=1;o<this.height&&this.map[e+this.width*a]==n;a++)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:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(s,l),right:Math.max(r,a),bottom:Math.max(i,c)}}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 a=(t+1)*this.width;for(;o<a&&this.map[o]<s;)o++;return o==a?i-1:this.map[o]}s=i}}static get(t){return pr(t)||gr(t,Uu(t))}};function Uu(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=qu(t),n=t.childCount,r=[];let s=0,i=null;const o=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const u=t.child(c);f++;for(let m=0;;m++){for(;s<r.length&&r[s]!=0;)s++;if(m==u.childCount)break;const y=u.child(m),{colspan:x,rowspan:g,colwidth:b}=y.attrs;for(let k=0;k<g;k++){if(k+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:f,n:g-k});break}const w=s+k*e;for(let C=0;C<x;C++){r[w+C]==0?r[w+C]=f:(i||(i=[])).push({type:"collision",row:c,pos:f,n:x-C});const j=b&&b[C];if(j){const S=(w+C)%e*2,T=o[S];T==null||T!=j&&o[S+1]==1?(o[S]=j,o[S+1]=1):T==j&&o[S+1]++}}}s+=x,f+=y.nodeSize}const h=(c+1)*e;let p=0;for(;s<h;)r[s++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:c,n:p}),f++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new Lt(e,n,r,i);let l=!1;for(let c=0;!l&&c<o.length;c+=2)o[c]!=null&&o[c+1]<n&&(l=!0);return l&&Hu(a,o,t),a}function qu(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 a=t.child(o);for(let l=0;l<a.childCount;l++){const c=a.child(l);o+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let o=0;o<s.childCount;o++){const a=s.child(o);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function Hu(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 a=null;const l=o.attrs;for(let c=0;c<l.colspan;c++){const f=e[(s+c)%t.width*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=Ku(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function Ku(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Wr(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 qt("selectingCells");function Wu(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 aa(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 Vu(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=Wu(e.$head)||Gu(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Gu(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 ji(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function la(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ca(t,e,n){const r=t.node(-1),s=Lt.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 Di(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 $t=class zt extends Bt{constructor(e,n=e){const r=e.node(-1),s=Lt.get(r),i=e.start(-1),o=s.rectBetween(e.pos-i,n.pos-i),a=e.node(0),l=s.cellsInRect(o).filter(f=>f!=n.pos-i);l.unshift(n.pos-i);const c=l.map(f=>{const u=r.nodeAt(f);if(!u)throw new RangeError(`No cell with offset ${f} found`);const h=i+f+1;return new Bl(a.resolve(h),a.resolve(h+u.content.size))});super(c[0].$from,c[0].$to,c),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(ji(r)&&ji(s)&&la(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?zt.rowSelection(r,s):i&&this.isColSelection()?zt.colSelection(r,s):new zt(r,s)}return po.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=Lt.get(e),r=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},o=[];for(let l=s.top;l<s.bottom;l++){const c=[];for(let f=l*n.width+s.left,u=s.left;u<s.right;u++,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 y=s.left-p.left,x=p.right-s.right;if(y>0||x>0){let g=m.attrs;if(y>0&&(g=Di(g,0,y)),x>0&&(g=Di(g,g.colspan-x,x)),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)}c.push(m)}o.push(e.child(l).copy(Js.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new Kn(Js.from(a),1,1)}replace(e,n=Kn.empty){const r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){const{$from:a,$to:l}=s[o],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),o?Kn.empty:n)}const i=Bt.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new Kn(Js.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Lt.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=Lt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),a=s.findCell(n.pos-i),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(i+s.map[o.left])),a.bottom<s.height&&(n=l.resolve(i+s.map[s.width*(s.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+s.map[a.left])),o.bottom<s.height&&(e=l.resolve(i+s.map[s.width*(s.height-1)+o.right-1]))),new zt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Lt.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,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==n.width}eq(e){return e instanceof zt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=Lt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),a=s.findCell(n.pos-i),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(i+s.map[o.top*s.width])),a.right<s.width&&(n=l.resolve(i+s.map[s.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+s.map[a.top*s.width])),o.right<s.width&&(e=l.resolve(i+s.map[s.width*(o.top+1)-1]))),new zt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new zt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new zt(e.resolve(n),e.resolve(r))}getBookmark(){return new Qu(this.$anchorCell.pos,this.$headCell.pos)}};$t.prototype.visible=!1;Bt.jsonID("cell",$t);var Qu=class da{constructor(e,n){this.anchor=e,this.head=n}map(e){return new da(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&&la(n,r)?new $t(n,r):Bt.near(r,1)}};new qt("fix-tables");function ua(t){const e=t.selection,n=Vu(t),r=n.node(-1),s=n.start(-1),i=Lt.get(r);return{...e instanceof $t?i.rectBetween(e.$anchorCell.pos-s,e.$headCell.pos-s):i.findCell(n.pos-s),tableStart:s,map:i,table:r}}function Xu(t){return function(e,n){if(!aa(e))return!1;if(n){const r=Wr(e.schema),s=ua(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),a=o.map(l=>s.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(s.tableStart+o[l],r.cell,a[l].attrs);if(i.steps.length===0)for(let l=0;l<o.length;l++)i.setNodeMarkup(s.tableStart+o[l],r.header_cell,a[l].attrs);n(i)}return!0}}function Ni(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 Vr(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Xu(t):function(n,r){if(!aa(n))return!1;if(r){const s=Wr(n.schema),i=ua(n),o=n.tr,a=Ni("row",i,s),l=Ni("column",i,s),c=(t==="column"?a:t==="row"&&l)?1:0,f=t=="column"?{left:0,top:c,right:1,bottom:i.map.height}:t=="row"?{left:c,top:0,right:i.map.width,bottom:1}:i,u=t=="column"?l?s.cell:s.header_cell:t=="row"?a?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,u,m.attrs)}),r(o)}return!0}}Vr("row",{useDeprecatedLogic:!0});Vr("column",{useDeprecatedLogic:!0});Vr("cell",{useDeprecatedLogic:!0});function xs(t,e){const n=t.selection;if(!(n instanceof $t))return!1;if(e){const r=t.tr,s=Wr(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 Kn(s,0,0))}),r.docChanged&&e(r)}return!0}Ol({ArrowLeft:bs("horiz",-1),ArrowRight:bs("horiz",1),ArrowUp:bs("vert",-1),ArrowDown:bs("vert",1),"Shift-ArrowLeft":ys("horiz",-1),"Shift-ArrowRight":ys("horiz",1),"Shift-ArrowUp":ys("vert",-1),"Shift-ArrowDown":ys("vert",1),Backspace:xs,"Mod-Backspace":xs,Delete:xs,"Mod-Delete":xs});function Ts(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function bs(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof $t)return Ts(n,r,Bt.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=fa(s,t,e);if(o==null)return!1;if(t=="horiz")return Ts(n,r,Bt.near(n.doc.resolve(i.head+e),e));{const a=n.doc.resolve(o),l=ca(a,t,e);let c;return l?c=Bt.near(l,1):e<0?c=Bt.near(n.doc.resolve(a.before(-1)),-1):c=Bt.near(n.doc.resolve(a.after(-1)),1),Ts(n,r,c)}}}function ys(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;let o;if(i instanceof $t)o=i;else{const l=fa(s,t,e);if(l==null)return!1;o=new $t(n.doc.resolve(l))}const a=ca(o.$headCell,t,e);return a?Ts(n,r,new $t(o.$anchorCell,a)):!1}}function fa(t,e,n){if(!(t.state.selection instanceof po))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),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?o:null}}return null}new qt("tableColumnResizing");function Yu(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,a=r-n,l=s,c=n;return new DOMRect(l,c,o,a)}var Zu=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:s=250,resizeDelay:i=60,shouldShow:o,appendTo:a,getReferencedVirtualElement:l,options:c}){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:u,state:h,from:p,to:m})=>{const{doc:y,selection:x}=h,{empty:g}=x,b=!y.textBetween(p,m).length&&$l(h.selection),k=this.element.contains(document.activeElement);return!(!(u.hasFocus()||k)||g||b||!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:u})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(u,h)=>{const p=!h?.selection.eq(u.state.selection),m=!h?.doc.eq(u.state.doc);!p&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,p,m,h)},this.updateDelay))},this.updateHandler=(u,h,p,m)=>{const{composing:y}=u;if(y||!h&&!p)return;if(!this.getShouldShow(m)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:u})=>{const h=u.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=a,this.scrollTarget=(f=c?.scrollTarget)!=null?f:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...c},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(Vi(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Gi(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Qi(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(Xi(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Yi(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Zi(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Ji(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(eo(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=go(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof Ml){let a=this.view.nodeDOM(r.from);const l=a.dataset.nodeViewWrapper?a:a.querySelector("[data-node-view-wrapper]");l&&(a=l),a&&(o={getBoundingClientRect:()=>a.getBoundingClientRect(),getClientRects:()=>[a.getBoundingClientRect()]})}if(r instanceof $t){const{$anchorCell:a,$headCell:l}=r,c=a?a.pos:l.pos,f=l?l.pos:a.pos,u=this.view.nodeDOM(c),h=this.view.nodeDOM(f);if(!u||!h)return;const p=u===h?u.getBoundingClientRect():Yu(u.getBoundingClientRect(),h.getBoundingClientRect());o={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&to(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(l=>l.$from.pos)),o=Math.max(...s.map(l=>l.$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()}},ha=t=>new Nr({key:typeof t.pluginKey=="string"?new qt(t.pluginKey):t.pluginKey,view:e=>new Zu({view:e,...t})});Rr.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ha({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 Ju=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:s=250,resizeDelay:i=60,options:o,appendTo:a,shouldShow:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:f,state:u})=>{const{selection:h}=u,{$anchor:p,empty:m}=h,y=p.depth===1,x=p.parent.isTextblock&&!p.parent.type.spec.code&&!p.parent.textContent&&p.parent.childCount===0&&!this.getTextContent(p.parent);return!(!f.hasFocus()||!m||!y||!x||!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,u,h,p)=>{const{composing:m}=f;if(m||!u&&!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 u;if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((u=this.element.parentNode)!=null&&u.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:f})=>{const u=f.getMeta(this.pluginKey);u==="updatePosition"?this.updatePosition():u&&typeof u=="object"&&u.type==="updateOptions"?this.updateOptions(u.options):u==="hide"?this.hide():u==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var c;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=a,this.scrollTarget=(c=o?.scrollTarget)!=null?c:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,l&&(this.shouldShow=l),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 zl(t,{textSerializers:Ll(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Vi(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Gi(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Qi(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(Xi(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Yi(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Zi(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Ji(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(eo(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(l=>l.$from.pos)),o=Math.max(...s.map(l=>l.$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=go(this.view,t.from,t.to);to({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 a,l;if((a=o.hide)!=null&&a.referenceHidden||(l=o.hide)!=null&&l.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()}},pa=t=>new Nr({key:typeof t.pluginKey=="string"?new qt(t.pluginKey):t.pluginKey,view:e=>new Ju({view:e,...t})});Rr.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?[pa({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 ef=Se.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,getReferencedVirtualElement:o,options:a,children:l,...c},f)=>{const u=v.useRef(document.createElement("div"));typeof f=="function"?f(u.current):f&&(f.current=u.current);const{editor:h}=mo(),p=e||h,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:a},y=v.useRef(m);y.current=m;const[x,g]=v.useState(!1),b=v.useRef(!0);return v.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=u.current;k.style.visibility="hidden",k.style.position="absolute";const w=ha({...y.current,editor:p,element:k});p.registerPlugin(w);const C=y.current.pluginKey;return b.current=!0,g(!0),()=>{g(!1),p.unregisterPlugin(C),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[p]),v.useEffect(()=>{if(!(!x||!p||p.isDestroyed)){if(b.current){b.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:y.current}))}},[x,p,n,r,i,a,s,o]),Ut.createPortal(d.jsx("div",{...c,children:l}),u.current)});Se.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,options:o,children:a,...l},c)=>{const f=v.useRef(document.createElement("div"));typeof c=="function"?c(f.current):c&&(c.current=f.current);const{editor:u}=mo(),h=e||u,p={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,options:o},m=v.useRef(p);m.current=p;const[y,x]=v.useState(!1),g=v.useRef(!0);return v.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 b=f.current;b.style.visibility="hidden",b.style.position="absolute";const k=pa({...m.current,editor:h,element:b});h.registerPlugin(k);const w=m.current.pluginKey;return g.current=!0,x(!0),()=>{x(!1),h.unregisterPlugin(w),window.requestAnimationFrame(()=>{b.parentNode&&b.parentNode.removeChild(b)})}},[h]),v.useEffect(()=>{if(!(!y||!h||h.isDestroyed)){if(g.current){g.current=!1;return}h.view.dispatch(h.state.tr.setMeta(t,{type:"updateOptions",options:m.current}))}},[y,h,n,r,i,o,s]),Ut.createPortal(d.jsx("div",{...l,children:a}),f.current)});const tf=new Set(["http:","https:","mailto:","tel:","ftp:"]);function ga(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return tf.has(e.protocol)}catch{return!1}}function ma(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 nf="noopener noreferrer nofollow";function at(t){const e=L.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 a;e[0]!==o?(a=Z("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",o),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==n||e[3]!==i||e[4]!==r||e[5]!==s||e[6]!==a?(l=d.jsx("button",{type:"button","aria-label":r,"aria-pressed":n,onMouseDown:sf,onClick:s,className:a,children:i}),e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function sf(t){return t.preventDefault()}function Ri(t){const e=L.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=Z("flex-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer",i),e[0]=i,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==o?(a=d.jsx("button",{type:"button","aria-pressed":n,onMouseDown:rf,onClick:s,className:o,children:r}),e[2]=n,e[3]=r,e[4]=s,e[5]=o,e[6]=a):a=e[6],a}function rf(t){return t.preventDefault()}function am(t){const e=L.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=ce(),[a,l]=v.useState(""),[c,f]=v.useState(!0),[u,h]=v.useState(!1);let p;e[0]!==r||e[1]!==n||e[2]!==i?(p=()=>{const D=n.getAttributes("link");l(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 y;e[4]!==n||e[5]!==i?(y=()=>{i(!1),n.chain().focus().run()},e[4]=n,e[5]=i,e[6]=y):y=e[6];const x=y;let g;e[7]!==a||e[8]!==n||e[9]!==c||e[10]!==i?(g=()=>{const D=ma(a);if(D===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!ga(D)){h(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:D,target:c?"_blank":null,rel:c?nf:null}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=c,e[10]=i,e[11]=g):g=e[11];const b=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 w=k;let C;e[15]!==o?(C=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=C):C=e[16];const j=s?x:m;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=d.jsx(Co,{size:14}),e[17]=S):S=e[17];let T;e[18]!==r||e[19]!==C||e[20]!==j?(T=d.jsx(at,{active:r,label:C,onClick:j,children:S}),e[18]=r,e[19]=C,e[20]=j,e[21]=T):T=e[21];let N;e[22]!==r||e[23]!==b||e[24]!==x||e[25]!==a||e[26]!==u||e[27]!==c||e[28]!==i||e[29]!==s||e[30]!==w||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":u,placeholder:o("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:a,onChange:D=>{l(D.target.value),h(!1)},onKeyDown:D=>{D.key==="Enter"?(D.preventDefault(),b()):D.key==="Escape"&&(D.preventDefault(),x())},className:Z("h-7 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",u&&"text-destructive")}),d.jsx(at,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:b,children:d.jsx(Ps,{size:14})}),r&&d.jsx(at,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:w,children:d.jsx(jo,{size:14})})]}),d.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[d.jsx(Ri,{active:!c,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>f(!1)}),d.jsx(Ri,{active:c,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>f(!0)})]})]}),e[22]=r,e[23]=b,e[24]=x,e[25]=a,e[26]=u,e[27]=c,e[28]=i,e[29]=s,e[30]=w,e[31]=o,e[32]=N):N=e[32];let R;return e[33]!==T||e[34]!==N?(R=d.jsxs("div",{className:"relative",children:[T,N]}),e[33]=T,e[34]=N,e[35]=R):R=e[35],R}function of(t){const e=L.c(30),{editor:n}=t,r=ce(),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,c]=v.useState(!1);let f;e[0]!==n?(f=n.isActive("link"),e[0]=n,e[1]=f):f=e[1];const u=f;let h;e[2]!==n||e[3]!==s?(h=()=>{if(s){i(!1);return}const S=n.getAttributes("link").href;a(typeof S=="string"?S:""),c(!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 y=m;let x;e[7]!==o||e[8]!==n||e[9]!==y?(x=()=>{const S=ma(o);if(S===""){y();return}if(!ga(S)){c(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:S}).run(),i(!1)},e[7]=o,e[8]=n,e[9]=y,e[10]=x):x=e[10];const g=x;let b;e[11]!==r?(b=r("markdownEditor.link"),e[11]=r,e[12]=b):b=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=d.jsx(Co,{size:14}),e[13]=k):k=e[13];let w;e[14]!==u||e[15]!==b||e[16]!==p?(w=d.jsx(at,{active:u,label:b,onClick:p,children:k}),e[14]=u,e[15]=b,e[16]=p,e[17]=w):w=e[17];let C;e[18]!==u||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==l||e[23]!==s||e[24]!==y||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":l,placeholder:r("markdownEditor.linkPlaceholder"),value:o,onChange:S=>{a(S.target.value),c(!1)},onKeyDown:S=>{S.key==="Enter"?(S.preventDefault(),g()):S.key==="Escape"&&(S.preventDefault(),i(!1),n.chain().focus().run())},className:Z("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",l&&"text-destructive")}),d.jsx(at,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:d.jsx(Ps,{size:14})}),u&&d.jsx(at,{active:!1,label:r("markdownEditor.linkRemove"),onClick:y,children:d.jsx(jo,{size:14})})]}),e[18]=u,e[19]=g,e[20]=o,e[21]=n,e[22]=l,e[23]=s,e[24]=y,e[25]=r,e[26]=C):C=e[26];let j;return e[27]!==w||e[28]!==C?(j=d.jsxs("div",{className:"relative",children:[w,C]}),e[27]=w,e[28]=C,e[29]=j):j=e[29],j}const rr=()=>{const t=L.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},Ei=t=>{const e=L.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},xa=[1,2,3],af=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function lf(t){const e=L.c(20),{editor:n}=t,r=ce(),[s,i]=v.useState(null);let o;e[0]!==n?(o={editor:n,selector:cf},e[0]=n,e[1]=o):o=e[1];const a=Pl(o);let l;e[2]!==r?(l=r("markdownEditor.heading1"),e[2]=r,e[3]=l):l=e[3];let c;e[4]!==r?(c=r("markdownEditor.heading2"),e[4]=r,e[5]=c):c=e[5];let f;e[6]!==r?(f=r("markdownEditor.heading3"),e[6]=r,e[7]=f):f=e[7];let u;e[8]!==l||e[9]!==c||e[10]!==f?(u={1:l,2:c,3:f},e[8]=l,e[9]=c,e[10]=f,e[11]=u):u=e[11];const h=u;let p;e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==a||e[16]!==r?(p=s&&d.jsxs(ef,{editor:n,shouldShow:af,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(at,{active:a.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:d.jsx(Va,{size:14})}),d.jsx(at,{active:a.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:d.jsx(Ga,{size:14})}),d.jsx(at,{active:a.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:d.jsx(Qa,{size:14})}),d.jsx(at,{active:a.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:d.jsx(Xa,{size:14})}),d.jsx(rr,{}),xa.map((y,x)=>d.jsx(at,{active:a.headings[x]??!1,label:h[y],onClick:()=>n.chain().focus().toggleHeading({level:y}).run(),children:d.jsx(Ei,{children:`H${y}`})},y)),d.jsx(rr,{}),d.jsx(at,{active:a.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:d.jsx(ao,{size:14})}),d.jsx(at,{active:a.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:d.jsx(Ei,{children:"1."})}),d.jsx(at,{active:a.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:d.jsx(Ya,{size:14})}),d.jsx(rr,{}),d.jsx(of,{editor:n})]}),e[12]=n,e[13]=h,e[14]=s,e[15]=a,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 cf(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:xa.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function Gr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Qt=Gr();function ba(t){Qt=t}var Vt={exec:()=>null};function ae(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 df=(()=>{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)}}>`)},uf=/^(?:[ \t]*(?:\n|$))+/,ff=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,cs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ya=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ka=ae(ya).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(),gf=ae(ya).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(),Xr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mf=/^[^\n]+/,Yr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xf=ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bf=ae(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qr).getRegex(),Vs="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",Zr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yf=ae("^ {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",Zr).replace("tag",Vs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),va=ae(Xr).replace("hr",cs).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",Vs).getRegex(),kf=ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",va).getRegex(),Jr={blockquote:kf,code:ff,def:xf,fences:hf,heading:pf,hr:cs,html:yf,lheading:ka,list:bf,newline:uf,paragraph:va,table:Vt,text:mf},Ii=ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",cs).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",Vs).getRegex(),vf={...Jr,lheading:gf,table:Ii,paragraph:ae(Xr).replace("hr",cs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ii).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",Vs).getRegex()},wf={...Jr,html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zr).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:ae(Xr).replace("hr",cs).replace("heading",` *#{1,6} *[^
7
7
  ]`).replace("lheading",ka).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Sf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Cf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wa=/^( {2,}|\\)\n(?!\s*$)/,Tf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$n=/[\p{P}\p{S}]/u,Gs=/[\s\p{P}\p{S}]/u,ei=/[^\s\p{P}\p{S}]/u,jf=ae(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Gs).getRegex(),Sa=/(?!~)[\p{P}\p{S}]/u,Df=/(?!~)[\s\p{P}\p{S}]/u,Nf=/(?:[^\s\p{P}\p{S}]|~)/u,Rf=ae(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",df?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ca=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ef=ae(Ca,"u").replace(/punct/g,$n).getRegex(),If=ae(Ca,"u").replace(/punct/g,Sa).getRegex(),Ta="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_f=ae(Ta,"gu").replace(/notPunctSpace/g,ei).replace(/punctSpace/g,Gs).replace(/punct/g,$n).getRegex(),Af=ae(Ta,"gu").replace(/notPunctSpace/g,Nf).replace(/punctSpace/g,Df).replace(/punct/g,Sa).getRegex(),Bf=ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ei).replace(/punctSpace/g,Gs).replace(/punct/g,$n).getRegex(),Of=ae(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,$n).getRegex(),$f="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Mf=ae($f,"gu").replace(/notPunctSpace/g,ei).replace(/punctSpace/g,Gs).replace(/punct/g,$n).getRegex(),zf=ae(/\\(punct)/,"gu").replace(/punct/g,$n).getRegex(),Lf=ae(/^<(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(),Pf=ae(Zr).replace("(?:-->|$)","-->").getRegex(),Ff=ae("^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",Pf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Uf=ae(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Bs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ja=ae(/^!?\[(label)\]\[(ref)\]/).replace("label",Bs).replace("ref",Yr).getRegex(),Da=ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",Yr).getRegex(),qf=ae("reflink|nolink(?!\\()","g").replace("reflink",ja).replace("nolink",Da).getRegex(),_i=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ti={_backpedal:Vt,anyPunctuation:zf,autolink:Lf,blockSkip:Rf,br:wa,code:Cf,del:Vt,delLDelim:Vt,delRDelim:Vt,emStrongLDelim:Ef,emStrongRDelimAst:_f,emStrongRDelimUnd:Bf,escape:Sf,link:Uf,nolink:Da,punctuation:jf,reflink:ja,reflinkSearch:qf,tag:Ff,text:Tf,url:Vt},Hf={...ti,link:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",Bs).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bs).getRegex()},mr={...ti,emStrongRDelimAst:Af,emStrongLDelim:If,delLDelim:Of,delRDelim:Mf,url:ae(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_i).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:ae(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",_i).getRegex()},Kf={...mr,br:ae(wa).replace("{2,}","*").getRegex(),text:ae(mr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ks={normal:Jr,gfm:vf,pedantic:wf},Un={normal:ti,gfm:mr,breaks:Kf,pedantic:Hf},Wf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ai=t=>Wf[t];function _t(t,e){if(e){if(st.escapeTest.test(t))return t.replace(st.escapeReplace,Ai)}else if(st.escapeTestNoEncode.test(t))return t.replace(st.escapeReplaceNoEncode,Ai);return t}function Bi(t){try{t=encodeURI(t).replace(st.percentDecode,"%")}catch{return null}return t}function Oi(t,e){let n=t.replace(st.findPipe,(i,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),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 qn(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 Vf(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 Gf(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 $i(t,e,n,r,s){let i=e.href,o=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function Qf(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
8
8
  `).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[a]=o;return a.length>=s.length?i.slice(s.length):i}).join(`
9
9
  `)}var Os=class{options;rules;lexer;constructor(t){this.options=t||Qt}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:qn(n,`
@@ -22,11 +22,11 @@ ${f}`:f;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
22
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 l=!1,c="",f="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let u=Gf(e[2].split(`
23
23
  `,1)[0],e[1].length),h=t.split(`
24
24
  `,1)[0],p=!u.trim(),m=0;if(this.options.pedantic?(m=2,f=u.trimStart()):p?m=e[1].length+1:(m=u.search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=u.slice(m),m+=e[1].length),p&&this.rules.other.blankLine.test(h)&&(c+=h+`
25
- `,t=t.substring(h.length+1),l=!0),!l){let y=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),g=this.rules.other.fencesBeginRegex(m),b=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),w=this.rules.other.blockquoteBeginRegex(m);for(;t;){let S=t.split(`
26
- `,1)[0],j;if(h=S,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),j=h):j=h.replace(this.rules.other.tabCharGlobal," "),g.test(h)||b.test(h)||k.test(h)||w.test(h)||y.test(h)||x.test(h))break;if(j.search(this.rules.other.nonSpaceChar)>=m||!h.trim())f+=`
25
+ `,t=t.substring(h.length+1),l=!0),!l){let y=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),g=this.rules.other.fencesBeginRegex(m),b=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),w=this.rules.other.blockquoteBeginRegex(m);for(;t;){let C=t.split(`
26
+ `,1)[0],j;if(h=C,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),j=h):j=h.replace(this.rules.other.tabCharGlobal," "),g.test(h)||b.test(h)||k.test(h)||w.test(h)||y.test(h)||x.test(h))break;if(j.search(this.rules.other.nonSpaceChar)>=m||!h.trim())f+=`
27
27
  `+j.slice(m);else{if(p||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(u)||b.test(u)||x.test(u))break;f+=`
28
- `+h}p=!h.trim(),c+=S+`
29
- `,t=t.substring(S.length+1),u=j.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),s.raw+=c}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.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 c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let f={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=f.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=f.raw+l.tokens[0].raw,l.tokens[0].text=f.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(f)):l.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):l.tokens.unshift(f)}}if(!s.loose){let c=l.tokens.filter(u=>u.type==="space"),f=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=f}}if(s.loose)for(let l of s.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.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=Oi(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
28
+ `+h}p=!h.trim(),c+=C+`
29
+ `,t=t.substring(C.length+1),u=j.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),s.raw+=c}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.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 c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let f={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=f.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=f.raw+l.tokens[0].raw,l.tokens[0].text=f.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(f)):l.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):l.tokens.unshift(f)}}if(!s.loose){let c=l.tokens.filter(u=>u.type==="space"),f=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=f}}if(s.loose)for(let l of s.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.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=Oi(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
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(Oi(o,i.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[l]})));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
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=qn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Vf(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)),$i(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 $i(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,a=s,l=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+s);(r=c.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]){a+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let f=[...r[0]][0].length,u=t.slice(0,s+r.index+f+o);if(Math.min(s,o)%2){let p=u.slice(1,-1);return{type:"em",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}let h=u.slice(2,-2);return{type:"strong",raw:u,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,a=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+s);(r=l.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]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...r[0]][0].length,f=t.slice(0,s+r.index+c+o),u=f.slice(s,-s);return{type:"del",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}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 xr{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Qt,this.options.tokenizer=this.options.tokenizer||new Os,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:ks.normal,inline:Un.normal};this.options.pedantic?(n.block=ks.pedantic,n.inline=Un.pedantic):this.options.gfm&&(n.block=ks.gfm,this.options.breaks?n.inline=Un.breaks:n.inline=Un.gfm),this.tokenizer.rules=n}static get rules(){return{block:ks,inline:Un}}static lex(e,n){return new xr(n).lex(e)}static lexInline(e,n){return new xr(n).inlineTokens(e)}lex(e){e=e.replace(st.carriageReturn,`
32
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+=`
@@ -66,12 +66,12 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
66
66
  `);return r.slice(0,r.length-1)}function Zf(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 Jf(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{t.has(r)||n.push({type:r,mark:s})}),n}function eh(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(l=>[l.type,l]))),a=[];if(s||i||o)if(n&&n.type==="text"&&n.marks){const l=new Map(n.marks.map(c=>[c.type,c]));Array.from(t.keys()).forEach(c=>{l.has(c)||a.push(c)})}else(s||i)&&a.push(...Array.from(t.keys()));return a}function th(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 nh(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 ir(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 vs(t,e){return typeof t!="string"?"json":e}var sh=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,Fl(t.extensions).forEach(a=>this.registerExtension(a,!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=Fn(t,"markdownTokenName")||s,o=Fn(t,"parseMarkdown"),a=Fn(t,"renderMarkdown"),l=Fn(t,"markdownTokenizer"),c=(n=Fn(t,"markdownOptions"))!=null?n:null,f=(r=c?.indentsContent)!=null?r:!1,u={tokenName:i,nodeName:s,parseMarkdown:o,renderMarkdown:a,isIndenting:f,tokenizer:l};if(i&&o){const h=this.registry.get(i)||[];h.push(u),this.registry.set(i,h)}if(a){const h=this.nodeTypeRegistry.get(s)||[];h.push(u),this.nodeTypeRegistry.set(s,h)}l&&this.hasMarked()&&(this.registerTokenizer(l),e&&(this.lexer=new this.markedInstance.Lexer))}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:r="inline",tokenize:s}=t,a={inlineTokens:f=>this.lexer.inlineTokens(f),blockTokens:f=>this.lexer.blockTokens(f)};let l;n?l=typeof n=="function"?n:f=>f.indexOf(n):l=f=>{const u=s(f,[],a);return u&&u.raw?f.indexOf(u.raw):-1};const c={name:e,level:r,start:l,tokenizer:(f,u)=>{const h=s(f,u,a);if(h&&h.type)return{...h,type:h.type||e,raw:h.raw||"",tokens:h.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[c]})}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,a)=>(o.type!=="space"&&i.push(a),i),[]);let r=-1,s=0;return t.flatMap((i,o)=>{for(var a;s<n.length&&n[s]<o;)r=n[s],s+=1;if(e&&i.type==="space"){const c=(a=n[s])!=null?a:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,c)}const l=this.parseToken(i,e);return l===null?[]:Array.isArray(l)?l:[l]})}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
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),a=this.normalizeParseResult(o);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!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(a=>ir(a).isTask),n=t.items.some(a=>!ir(a).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let a=0;a<t.items.length;a+=1){const l=t.items[a],{isTask:c,checked:f,indentLevel:u}=ir(l);let h=l;if(c){const y=(l.raw||l.text||"").split(`
68
68
  `),x=y[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),g=x?x[2]:"";let b=[];if(y.length>1&&y.slice(1).join(`
69
- `).trim()){const w=y.slice(1),S=w.filter(j=>j.trim());if(S.length>0){const j=Math.min(...S.map(N=>N.length-N.trimStart().length)),T=w.map(N=>N.trim()?N.slice(j):"").join(`
69
+ `).trim()){const w=y.slice(1),C=w.filter(j=>j.trim());if(C.length>0){const j=Math.min(...C.map(N=>N.length-N.trimStart().length)),T=w.map(N=>N.trim()?N.slice(j):"").join(`
70
70
  `).trim();T&&(b=this.markedInstance.lexer(`${T}
71
- `))}}h={type:"taskItem",raw:"",mainContent:g,indentLevel:u,checked:f??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:b}}const p=c?"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 a=0;a<r.length;a+=1){const l=r[a],c={...t,type:l.type,items:l.items},f=this.parseToken(c);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 a=t[o];if(a.type==="text")i.push({type:"text",text:a.text||""});else if(a.type==="html"){const l=((n=(e=a.raw)!=null?e:a.text)!=null?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(l),f=l.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&f&&!/\/>$/.test(l)){const h=f[1],p=this.escapeRegex(h),m=new RegExp(`^<\\/\\s*${p}\\b`,"i");let y=-1;const x=[l];for(let g=o+1;g<t.length;g+=1){const b=t[g],k=((s=(r=b.raw)!=null?r:b.text)!=null?s:"").toString();if(x.push(k),b.type==="html"&&m.test(k)){y=g;break}}if(y!==-1){const g=x.join(""),b={type:"html",raw:g,text:g,block:!1},k=this.parseHTMLToken(b);if(k){const w=this.normalizeParseResult(k);Array.isArray(w)?i.push(...w):w&&i.push(w)}o=y;continue}}const u=this.parseHTMLToken(a);if(u){const h=this.normalizeParseResult(u);Array.isArray(h)?i.push(...h):h&&i.push(h)}}else if(a.type){const l=this.getHandlerForToken(a.type);if(l&&l.parseMarkdown){const c=this.createParseHelpers(),f=l.parseMarkdown(a,c);if(this.isMarkResult(f)){const u=this.applyMarkToContent(f.mark,f.content,f.attrs);i.push(...u)}else{const u=this.normalizeParseResult(f);Array.isArray(u)?i.push(...u):u&&i.push(u)}}else a.tokens&&i.push(...this.parseInlineTokens(a.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=Ul(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 a=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,l={renderChildren:(u,h)=>{const p=o.isIndenting?r+1:r;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,t,h||"",n,p):this.renderNodes(u,t,h||"",n,p)},renderChild:(u,h)=>{const p=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(u,t,h,p)},indent:u=>this.indentString+u,wrapInBlock:Yf},c={index:n,level:r,parentType:e?.type,previousNode:a,meta:{parentAttrs:e?.attrs,...s}};return((i=o.renderMarkdown)==null?void 0:i.call(o,t,l,c))||""}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,a)=>{const l=a<t.length-1?t[a+1]:null;if(o.type)if(o.type==="text"){let c=o.text||"";const f=new Map((o.marks||[]).map(g=>[g.type,g])),u=Jf(i,f),h=Zf(f,l);let p="";if(h.length>0){const g=c.match(/(\s+)$/);g&&(p=g[1],c=c.slice(0,-p.length))}h.forEach(g=>{const b=f.get(g),k=this.getMarkClosing(g,b);k&&(c+=k),i.has(g)&&i.delete(g)});let m="";if(u.length>0){const g=c.match(/^(\s+)/);g&&(m=g[1],c=c.slice(m.length))}u.forEach(({type:g,mark:b})=>{const k=this.getMarkOpening(g,b);k&&(c=k+c),h.includes(g)||i.set(g,b)}),c=m+c;const y=eh(i,f,l,this.markSetsEqual.bind(this));let x="";if(y.length>0){const g=c.match(/(\s+)$/);g&&(x=g[1],c=c.slice(0,-x.length))}y.forEach(g=>{const b=i.get(g),k=this.getMarkClosing(g,b);k&&(c+=k),i.delete(g)}),c+=x,c+=p,s.push(c)}else{const c=new Map(i),f=th(i,this.getMarkClosing.bind(this)),u=this.renderNodeToMarkdown(o,e,a,r),h=o.type==="hardBreak"?"":nh(c,i,this.getMarkOpening.bind(this));s.push(f+u+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:l=>l,wrapInBlock:(l,c)=>l+c},{index:0,level:0,parentType:"text",meta:{}}),a=o.indexOf(s);return a>=0?o.substring(0,a):""}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:c=>c,wrapInBlock:(c,f)=>c+f},{index:0,level:0,parentType:"text",meta:{}}),a=o.indexOf(s),l=a+s.length;return a>=0?o.substring(l):""}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))}},Mi=sh,rh=Rr.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return Mt.setContent(t,e);if(vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Mt.setContent(t,e);const r=this.editor.markdown.parse(t);return Mt.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return Mt.insertContent(t,e);if(vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Mt.insertContent(t,e);const r=this.editor.markdown.parse(t);return Mt.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return Mt.insertContentAt(t,e,n);if(vs(e,n?.contentType)!=="markdown"||!this.editor.markdown)return Mt.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return Mt.insertContentAt(t,s,n)}}},addStorage(){return{manager:new Mi({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 Mi({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||vs(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 ih(t){const e=L.c(25),{node:n,selected:r,editor:s,deleteNode:i}=t,o=ce(),a=typeof n.attrs.href=="string"?n.attrs.href:"",l=typeof n.attrs.name=="string"?n.attrs.name:"";let c;e[0]!==l||e[1]!==o?(c=l||o("markdownEditor.fileNameFallback"),e[0]=l,e[1]=o,e[2]=c):c=e[2];const f=c,u=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==u?(h=Z("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",u),e[3]=u,e[4]=h):h=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx(Za,{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 y;e[8]!==f||e[9]!==o?(y=o("markdownEditor.downloadFile",{name:f}),e[8]=f,e[9]=o,e[10]=y):y=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=d.jsx(Jl,{size:14}),e[11]=x):x=e[11];let g;e[12]!==a||e[13]!==f||e[14]!==y?(g=d.jsx("a",{href:a,download:f,"aria-label":y,onMouseDown:ah,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:x}),e[12]=a,e[13]=f,e[14]=y,e[15]=g):g=e[15];let b;e[16]!==i||e[17]!==s.isEditable||e[18]!==o?(b=s.isEditable&&d.jsx("button",{type:"button","aria-label":o("markdownEditor.removeFile"),onMouseDown:oh,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:d.jsx(Cn,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=b):b=e[19];let k;return e[20]!==h||e[21]!==m||e[22]!==g||e[23]!==b?(k=d.jsxs(ko,{as:"span",className:h,children:[p,m,g,b]}),e[20]=h,e[21]=m,e[22]=g,e[23]=b,e[24]=k):k=e[24],k}function oh(t){return t.preventDefault()}function ah(t){return t.preventDefault()}function lh(t){return t.replace(/([[\]])/g,"\\$1")}const ch=xo.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",yo(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`[${lh(n)}](${e})`},addNodeView(){return bo(ih)}});var dh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,uh=xo.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",yo(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 a=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",l=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},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:a})=>{const l=document.createElement("img");Object.entries(o).forEach(([u,h])=>{if(h!=null)switch(u){case"width":case"height":break;default:l.setAttribute(u,h);break}}),l.src=o.src;const c=new Hl({element:l,editor:a,node:s,getPos:i,onResize:(u,h)=>{l.style.width=`${u}px`,l.style.height=`${h}px`},onCommit:(u,h)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:u,height:h}).run()},onUpdate:(u,h,p)=>u.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),f=c.dom;return f.style.visibility="hidden",f.style.pointerEvents="none",l.onload=()=>{f.style.visibility="",f.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[ql({find:dh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),fh=uh;function hh(t){const e=L.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,o=ce(),a=typeof n.attrs.src=="string"?n.attrs.src:"",l=typeof n.attrs.alt=="string"?n.attrs.alt:"";let c;e[0]!==l||e[1]!==o?(c=l||o("markdownEditor.imageAltFallback"),e[0]=l,e[1]=o,e[2]=c):c=e[2];const f=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let u;e[3]!==f?(u=Z("max-h-[420px] max-w-full rounded-lg border border-border object-contain",f),e[3]=f,e[4]=u):u=e[4];let h;e[5]!==a||e[6]!==c||e[7]!==u?(h=d.jsx("img",{src:a,alt:c,draggable:!1,className:u}),e[5]=a,e[6]=c,e[7]=u,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:ph,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(Cn,{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(ko,{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 ph(t){return t.preventDefault()}const gh=fh.extend({addNodeView(){return bo(hh)}}).configure({inline:!1,allowBase64:!1}),yr="uploads",mh="editor-images",Na="editor-files",xh=new RegExp(`^/api/[^/]+/fs/${yr}/read$`),zi="http://relative.invalid";function bh(t){let e;try{e=new URL(t,zi)}catch{return!1}return e.origin!==zi||!xh.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${Na}/`)}const yh={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},kh=Kl.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return bh(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function vh(t=""){return[Wl.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),kh.configure(yh),gc.configure({placeholder:t}),gh,ch,rh.configure({markedOptions:{breaks:!0}})]}const wh=10,Sh=25,Ch={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Th(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??Ch[t.type]??(si(t)?".png":"")}function si(t){return t.type.startsWith("image/")}function jh(){const t=ce(),{upload:e}=Oc(yr),n=Bc(yr),[r,s]=v.useState(0);return{uploadFile:async o=>{const a=si(o),l=a?wh:Sh;if(o.size>l*1024*1024)return At.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(l)})),null;const c=a?mh:Na,f=`${crypto.randomUUID()}${Th(o)}`;s(u=>u+1);try{return await e.mutateAsync({dir:c,files:[new File([o],f,{type:o.type})]}),n(`${c}/${f}`)}catch{return At.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(u=>u-1)}},pending:r}}const Dh=["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(" "),Nh=["[&_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 Li(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(Bt.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function Rh({defaultValue:t,onChange:e,placeholder:n}){const r=ce(),{uploadFile:s,pending:i}=jh(),o=v.useRef(null),a=v.useRef(e),l=v.useRef(s);a.current=e,l.current=s;const c=(h,p,m)=>p.length===0?!1:((async()=>{let y=m;for(const x of p){const g=await l.current(x);g&&(y=si(x)?Li(h,y,"image",{src:g,alt:x.name}):Li(h,y,"attachment",{href:g,name:x.name}))}})(),!0),f=Vl({extensions:vh(n),content:t,contentType:"markdown",editorProps:{attributes:{class:Z(Dh,Nh)},handlePaste:(h,p)=>c(h,Array.from(p.clipboardData?.files??[]),h.state.selection.to),handleDrop:(h,p,m,y)=>{if(y)return!1;const x=Array.from(p.dataTransfer?.files??[]),g=h.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return g===void 0?!1:c(h,x,g)}},onUpdate:({editor:h})=>a.current(h.getMarkdown())});if(!f)return null;const u=h=>{!h||h.length===0||c(f.view,Array.from(h),f.state.selection.to)};return d.jsxs("div",{className:"flex flex-col",children:[d.jsx(lf,{editor:f}),d.jsx(Gl,{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(Xe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":r("markdownEditor.attachFile"),onClick:()=>o.current?.click(),children:d.jsx(Ja,{size:14})}),i>0&&d.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[d.jsx(ss,{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=>{u(h.target.files),h.target.value=""}})]})}const Eh=1e4;function Ih(t){const e=L.c(10),{locator:n}=_e(),r=In();let s;e[0]!==t||e[1]!==n?(s=ve.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 a;return e[6]!==s||e[7]!==i||e[8]!==o?(a={queryKey:s,enabled:i,refetchInterval:Eh,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=a):a=e[9],lt(a)}function Ra(t){const e=L.c(10),{locator:n}=_e(),r=In();let s;e[0]!==t||e[1]!==n?(s=ve.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 a;return e[6]!==s||e[7]!==i||e[8]!==o?(a={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=a):a=e[9],lt(a)}function _h(t){const e=L.c(10),{locator:n}=_e(),r=In(),s=En();let i;e[0]!==t||e[1]!==r?(i=async()=>await r.call("TASK_BOARD_PROMOTE_TO_PRODUCTION",{taskBoardItemId:t}),e[0]=t,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==t||e[4]!==n||e[5]!==s?(o=()=>{s.invalidateQueries({queryKey:ve.taskBoardItemPrs(n,t)}),s.invalidateQueries({queryKey:ve.taskBoardActivity(n,t)})},e[3]=t,e[4]=n,e[5]=s,e[6]=o):o=e[6];let a;return e[7]!==i||e[8]!==o?(a={mutationFn:i,onSuccess:o},e[7]=i,e[8]=o,e[9]=a):a=e[9],Tt(a)}function Ah(t){const e=[];return t.qa&&e.push("qa"),t.codeReview&&e.push("code_review"),e}function Bh(t,e){return e.length===0?!0:Cl(t,e)}function ri(t){const e=L.c(54),{members:n,onSelect:r}=t,s=ce();let i;e[0]!==s?(i=s("taskBoard.taskDialog.assignToPlaceholder"),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==i?(o=d.jsx(Er,{placeholder:i,className:"h-9"}),e[2]=i,e[3]=o):o=e[3];let a;e[4]!==s?(a=s("taskBoard.taskDialog.noMembersFound"),e[4]=s,e[5]=a):a=e[5];let l;e[6]!==a?(l=d.jsx(Ir,{children:a}),e[6]=a,e[7]=l):l=e[7];let c;e[8]!==s?(c=s("taskBoard.taskDialog.superAgentLabel"),e[8]=s,e[9]=c):c=e[9];let f;e[10]!==r?(f=()=>r(nt),e[10]=r,e[11]=f):f=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(Ot,{size:16}),e[12]=u):u=e[12];let h;e[13]!==s?(h=s("taskBoard.taskDialog.superAgentLabel"),e[13]=s,e[14]=h):h=e[14];let p;e[15]!==h?(p=d.jsx("span",{className:"truncate",children:h}),e[15]=h,e[16]=p):p=e[16];let m;e[17]!==c||e[18]!==f||e[19]!==p?(m=d.jsxs(Pt,{value:c,onSelect:f,className:"gap-2",children:[u,p]}),e[17]=c,e[18]=f,e[19]=p,e[20]=m):m=e[20];let y;e[21]!==s?(y=s("taskBoard.taskDialog.unassignedLabel"),e[21]=s,e[22]=y):y=e[22];let x;e[23]!==r?(x=()=>r(null),e[23]=r,e[24]=x):x=e[24];let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=d.jsx(lr,{size:16,className:"text-muted-foreground"}),e[25]=g):g=e[25];let b;e[26]!==s?(b=s("taskBoard.taskDialog.unassignedLabel"),e[26]=s,e[27]=b):b=e[27];let k;e[28]!==b?(k=d.jsx("span",{className:"truncate",children:b}),e[28]=b,e[29]=k):k=e[29];let w;e[30]!==y||e[31]!==x||e[32]!==k?(w=d.jsxs(Pt,{value:y,onSelect:x,className:"gap-2",children:[g,k]}),e[30]=y,e[31]=x,e[32]=k,e[33]=w):w=e[33];let S;e[34]!==m||e[35]!==w?(S=d.jsxs(Rn,{children:[m,w]}),e[34]=m,e[35]=w,e[36]=S):S=e[36];let j;e[37]!==s?(j=s("taskBoard.taskDialog.membersGroupHeading"),e[37]=s,e[38]=j):j=e[38];let C;if(e[39]!==n||e[40]!==r){let D;e[42]!==r?(D=E=>d.jsxs(Pt,{value:E.user?.name??E.userId,onSelect:()=>r(E.userId),className:"gap-2",children:[d.jsx(Nt,{url:E.user?.image??void 0,fallback:Dt(E.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:E.user?.name??E.userId})]},E.userId),e[42]=r,e[43]=D):D=e[43],C=n.map(D),e[39]=n,e[40]=r,e[41]=C}else C=e[41];let T;e[44]!==j||e[45]!==C?(T=d.jsx(Rn,{heading:j,children:C}),e[44]=j,e[45]=C,e[46]=T):T=e[46];let N;e[47]!==S||e[48]!==T||e[49]!==l?(N=d.jsxs(_r,{children:[l,S,T]}),e[47]=S,e[48]=T,e[49]=l,e[50]=N):N=e[50];let R;return e[51]!==o||e[52]!==N?(R=d.jsxs(Ar,{children:[o,N]}),e[51]=o,e[52]=N,e[53]=R):R=e[53],R}function Oh({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=ce(),[a,l]=v.useState(""),[c,f]=v.useState(!1),[u,h]=v.useState(n),p=a.trim(),m=t.some(x=>x.name.toLowerCase()===p.toLowerCase()),y=async()=>{if(!(!p||m||c)){f(!0);try{await s(p,u),l("")}finally{f(!1)}}};return d.jsxs(Ar,{children:[d.jsx(Er,{value:a,onValueChange:l,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),d.jsxs(_r,{children:[p&&!m?d.jsx(Rn,{children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{type:"color",value:u,onChange:x=>h(x.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(Pt,{value:`create-${p}`,disabled:c,onSelect:y,className:"flex-1 gap-2",children:[d.jsx(Jn,{size:16,className:"text-muted-foreground"}),d.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:p})})]})]})}):d.jsx(Ir,{children:o("taskBoard.taskDialog.noTagsFound")}),d.jsx(Rn,{children:t.map(x=>{const g=e.includes(x.id);return d.jsxs(Pt,{value:x.name,onSelect:()=>r(x.id),className:"group gap-2",children:[d.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:ls(x.color)}}),d.jsx("span",{className:"flex-1 truncate",children:x.name}),d.jsx("button",{type:"button","aria-label":o("taskBoard.taskDialog.deleteTagAriaLabel",{name:x.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:b=>{b.stopPropagation(),i(x.id)},children:d.jsx(so,{size:13})}),g&&d.jsx(Ps,{size:14,className:"shrink-0 text-foreground"})]},x.id)})})]})]})}function $h(t){if(!t)return[];const e=[],n=new Set,r=(o,a)=>{n.has(o)||(n.add(o),e.push({url:o,label:a.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 Ea(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function kr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const Ia=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),kn="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 Mh(t){const e=L.c(240),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:a,onOpenThread:l,onNewChat:c,isSaving:f}=t,u=ce(),{data:h}=uo();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:y,copied:x}=Yl(),{data:g}=ho();let b;e[2]!==g?(b=g===void 0?[]:g,e[2]=g,e[3]=b):b=e[3];const k=b,w=Nl(),S=Rl(),[j,C]=v.useState(s?.title??""),[T,N]=v.useState(s?.description??""),[R,D]=v.useState(s?.status??i??"triage"),[E,M]=v.useState(s?.priority??"medium"),[A,U]=v.useState(s?.assigneeId??null),I=s?.dueDate;let B;e[4]!==I?(B=kr(I),e[4]=I,e[5]=B):B=e[5];const[O,K]=v.useState(B);let Y;e[6]!==s?.tags?(Y=s?.tags.map(Fh)??[],e[6]=s?.tags,e[7]=Y):Y=e[7];const[P,q]=v.useState(Y),[Q,G]=v.useState(!1),[ee,W]=v.useState(!1),[ne,J]=v.useState(!1);let se;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?(se=()=>{C(s?.title??""),N(s?.description??""),D(s?.status??i??"triage"),M(s?.priority??"medium"),U(s?.assigneeId??null),K(kr(s?.dueDate)),q(s?.tags.map(Ph)??[])},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]=se):se=e[16];const $=se;let F;e[17]!==r||e[18]!==$?(F=()=>{r(),$()},e[17]=r,e[18]=$,e[19]=F):F=e[19];const X=F;let re;e[20]!==w?(re=async(H,Qe)=>{const ot=await w.mutateAsync({name:H,color:Qe});q(Mn=>[...Mn,ot.id])},e[20]=w,e[21]=re):re=e[21];const _=re;let V;e[22]!==S?(V=H=>{S.mutate(H),q(Qe=>Qe.filter(ot=>ot!==H))},e[22]=S,e[23]=V):V=e[23];const te=V;let le;e[24]!==A||e[25]!==T||e[26]!==O||e[27]!==o||e[28]!==E||e[29]!==R||e[30]!==P||e[31]!==j?(le=()=>{const H=j.trim();H&&o({title:H,description:T.trim()||null,status:R,priority:E,assigneeId:A,dueDate:O?Ea(O):null,tagIds:P})},e[24]=A,e[25]=T,e[26]=O,e[27]=o,e[28]=E,e[29]=R,e[30]=P,e[31]=j,e[32]=le):le=e[32];const je=le,pe=A===nt;let De;if(e[33]!==A||e[34]!==m){let H;e[36]!==A?(H=Qe=>Qe.userId===A,e[36]=A,e[37]=H):H=e[37],De=m.find(H),e[33]=A,e[34]=m,e[35]=De}else De=e[35];const fe=De;let it;e[38]!==s||e[39]!==m?(it=s?.assignedBy?m.find(H=>H.userId===s.assignedBy):void 0,e[38]=s,e[39]=m,e[40]=it):it=e[40];const Ee=it,ct=yt[R].icon;let be;e[41]!==X?(be=H=>!H&&X(),e[41]=X,e[42]=be):be=e[42];let ge;e[43]!==s||e[44]!==u?(ge=u(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[43]=s,e[44]=u,e[45]=ge):ge=e[45];let Le;e[46]!==ge?(Le=d.jsx(Tr,{className:"sr-only",children:ge}),e[46]=ge,e[47]=Le):Le=e[47];let me;e[48]!==u?(me=u("taskBoard.taskDialog.closeAriaLabel"),e[48]=u,e[49]=me):me=e[49];let gt;e[50]===Symbol.for("react.memo_cache_sentinel")?(gt=d.jsx(Cn,{size:16}),e[50]=gt):gt=e[50];let Ke;e[51]!==X||e[52]!==me?(Ke=d.jsx("button",{type:"button","aria-label":me,onClick:X,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:gt}),e[51]=X,e[52]=me,e[53]=Ke):Ke=e[53];let Ae;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ae=H=>{C(H.target.value),H.target.style.height="auto",H.target.style.height=`${H.target.scrollHeight}px`},e[54]=Ae):Ae=e[54];let We;e[55]!==u?(We=u("taskBoard.taskDialog.taskTitlePlaceholder"),e[55]=u,e[56]=We):We=e[56];let Ze;e[57]!==We||e[58]!==j?(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:Lh,value:j,onChange:Ae,onKeyDown:zh,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]=j,e[59]=Ze):Ze=e[59];let mt;e[60]!==u?(mt=u("taskBoard.taskDialog.descriptionPlaceholder"),e[60]=u,e[61]=mt):mt=e[61];let Fe;e[62]!==T||e[63]!==mt?(Fe=d.jsx(Rh,{defaultValue:T,onChange:N,placeholder:mt}),e[62]=T,e[63]=mt,e[64]=Fe):Fe=e[64];let Ve;e[65]!==x||e[66]!==T||e[67]!==y||e[68]!==u?(Ve=T&&d.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":u("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:()=>y(T),children:x?d.jsx(Ps,{size:14}):d.jsx(Zl,{size:14})}),e[65]=x,e[66]=T,e[67]=y,e[68]=u,e[69]=Ve):Ve=e[69];let Je;e[70]!==Fe||e[71]!==Ve?(Je=d.jsxs("div",{className:"group relative flex flex-col",children:[Fe,Ve]}),e[70]=Fe,e[71]=Ve,e[72]=Je):Je=e[72];let dt;e[73]!==s?(dt=s&&d.jsx("hr",{className:"border-border"}),e[73]=s,e[74]=dt):dt=e[74];let ut;e[75]!==T||e[76]!==s||e[77]!==l?(ut=s?.id&&d.jsx(Yh,{item:s,description:T,onOpenThread:l}),e[75]=T,e[76]=s,e[77]=l,e[78]=ut):ut=e[78];let et;e[79]!==Ee||e[80]!==fe||e[81]!==s||e[82]!==m||e[83]!==l?(et=s&&d.jsx(ep,{item:s,members:m,startedBy:Ee??fe,onOpenThread:l}),e[79]=Ee,e[80]=fe,e[81]=s,e[82]=m,e[83]=l,e[84]=et):et=e[84];let tt;e[85]!==Je||e[86]!==dt||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,dt,ut,et]}),e[85]=Je,e[86]=dt,e[87]=ut,e[88]=et,e[89]=tt):tt=e[89];let de;e[90]!==Ze||e[91]!==tt?(de=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]=de):de=e[92];let we;e[93]!==u?(we=u("taskBoard.taskDialog.propertiesLabel"),e[93]=u,e[94]=we):we=e[94];let xe;e[95]!==we?(xe=d.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:we}),e[95]=we,e[96]=xe):xe=e[96];let Ne;e[97]!==s||e[98]!==R?(Ne=Z(s?Hr({...s,status:R}):yt[R].iconClassName),e[97]=s,e[98]=R,e[99]=Ne):Ne=e[99];let ye;e[100]!==ct||e[101]!==Ne?(ye=d.jsx(ct,{size:16,className:Ne}),e[100]=ct,e[101]=Ne,e[102]=ye):ye=e[102];const Ce=yt[R];let Te;e[103]!==u||e[104]!==Ce.labelKey?(Te=u(Ce.labelKey),e[103]=u,e[104]=Ce.labelKey,e[105]=Te):Te=e[105];let Ue;e[106]!==ye||e[107]!==Te?(Ue=d.jsx(jn,{asChild:!0,children:d.jsxs("button",{type:"button",className:kn,children:[ye,Te]})}),e[106]=ye,e[107]=Te,e[108]=Ue):Ue=e[108];let he;e[109]!==u?(he=As.map(H=>{const Qe=yt[H].icon;return d.jsxs(jt,{onSelect:()=>D(H),className:"gap-2",children:[d.jsx(Qe,{size:16,className:yt[H].iconClassName}),u(yt[H].labelKey)]},H)}),e[109]=u,e[110]=he):he=e[110];let Be;e[111]!==he?(Be=d.jsx(Dn,{align:"start",className:"w-44",children:he}),e[111]=he,e[112]=Be):Be=e[112];let Ie;e[113]!==Ue||e[114]!==Be?(Ie=d.jsxs(Nn,{children:[Ue,Be]}),e[113]=Ue,e[114]=Be,e[115]=Ie):Ie=e[115];const qe=E==="none"&&"text-muted-foreground";let Oe;e[116]!==qe?(Oe=Z(kn,qe),e[116]=qe,e[117]=Oe):Oe=e[117];let $e;e[118]!==E||e[119]!==u?($e=E==="none"?d.jsxs(d.Fragment,{children:[d.jsx(ro,{size:16}),u("taskBoard.taskDialog.setPriorityButton")]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[E].dotClassName)}),u(kt[E].labelKey)]}),e[118]=E,e[119]=u,e[120]=$e):$e=e[120];let Re;e[121]!==Oe||e[122]!==$e?(Re=d.jsx(jn,{asChild:!0,children:d.jsx("button",{type:"button",className:Oe,children:$e})}),e[121]=Oe,e[122]=$e,e[123]=Re):Re=e[123];let Me;e[124]!==u?(Me=Kr.map(H=>d.jsxs(jt,{onSelect:()=>M(H),children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[H].dotClassName)}),u(kt[H].labelKey)]},H)),e[124]=u,e[125]=Me):Me=e[125];let He;e[126]!==Me?(He=d.jsx(Dn,{align:"start",className:"w-40",children:Me}),e[126]=Me,e[127]=He):He=e[127];let vt;e[128]!==Re||e[129]!==He?(vt=d.jsxs(Nn,{children:[Re,He]}),e[128]=Re,e[129]=He,e[130]=vt):vt=e[130];const It=!A&&"text-muted-foreground";let ft;e[131]!==It?(ft=Z(kn,It),e[131]=It,e[132]=ft):ft=e[132];let ht;e[133]!==Ee||e[134]!==fe||e[135]!==pe||e[136]!==u?(ht=pe&&Ee?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[d.jsx(Nt,{url:Ee.user?.image??void 0,fallback:Dt(Ee.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:Ee.user?.name??u("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(Nt,{url:Ee.user?.image??void 0,fallback:Dt(Ee.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),d.jsx(Ot,{size:16,className:"ring-2 ring-background"})]}),u("taskBoard.taskDialog.superAgentLabel")]})]}):pe?d.jsxs(d.Fragment,{children:[d.jsx(Ot,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]}):fe?d.jsxs(d.Fragment,{children:[d.jsx(Nt,{url:fe.user?.image??void 0,fallback:Dt(fe.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:fe.user?.name??u("taskBoard.taskDialog.unassignedLabel")})]}):d.jsxs(d.Fragment,{children:[d.jsx(io,{size:16,className:"text-muted-foreground"}),u("taskBoard.taskDialog.assignButton")]}),e[133]=Ee,e[134]=fe,e[135]=pe,e[136]=u,e[137]=ht):ht=e[137];let wt;e[138]!==ft||e[139]!==ht?(wt=d.jsx(wn,{asChild:!0,children:d.jsx("button",{type:"button",className:ft,children:ht})}),e[138]=ft,e[139]=ht,e[140]=wt):wt=e[140];let z;e[141]===Symbol.for("react.memo_cache_sentinel")?(z=H=>{U(H),W(!1)},e[141]=z):z=e[141];let ie;e[142]!==m?(ie=d.jsx(Gn,{align:"start",className:"w-56 p-0",children:d.jsx(ri,{members:m,onSelect:z})}),e[142]=m,e[143]=ie):ie=e[143];let ke;e[144]!==ee||e[145]!==wt||e[146]!==ie?(ke=d.jsxs(Qn,{open:ee,onOpenChange:W,modal:!0,children:[wt,ie]}),e[144]=ee,e[145]=wt,e[146]=ie,e[147]=ke):ke=e[147];let Ge;e[148]!==Ee||e[149]!==pe||e[150]!==u?(Ge=pe&&Ee&&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:Z(kn,"pointer-events-none"),children:[d.jsx(Ot,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]})]}),e[148]=Ee,e[149]=pe,e[150]=u,e[151]=Ge):Ge=e[151];let xt;e[152]!==ke||e[153]!==Ge?(xt=d.jsxs("div",{className:"flex flex-col",children:[ke,Ge]}),e[152]=ke,e[153]=Ge,e[154]=xt):xt=e[154];const Kt=!O&&"text-muted-foreground";let Xt;e[155]!==Kt?(Xt=Z(kn,Kt),e[155]=Kt,e[156]=Xt):Xt=e[156];let us;e[157]===Symbol.for("react.memo_cache_sentinel")?(us=d.jsx(Sn,{size:16,className:"text-muted-foreground"}),e[157]=us):us=e[157];let Yt;e[158]!==O||e[159]!==u?(Yt=O?Ia.format(O):u("taskBoard.taskDialog.dueDateLabel"),e[158]=O,e[159]=u,e[160]=Yt):Yt=e[160];let Zt;e[161]!==O||e[162]!==u?(Zt=O&&d.jsx("span",{role:"button",tabIndex:0,"aria-label":u("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:H=>{H.stopPropagation(),K(null)},onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),H.stopPropagation(),K(null))},children:d.jsx(Cn,{size:12})}),e[161]=O,e[162]=u,e[163]=Zt):Zt=e[163];let Jt;e[164]!==Xt||e[165]!==Yt||e[166]!==Zt?(Jt=d.jsx(wn,{asChild:!0,children:d.jsxs("button",{type:"button",className:Xt,children:[us,Yt,Zt]})}),e[164]=Xt,e[165]=Yt,e[166]=Zt,e[167]=Jt):Jt=e[167];const Xs=O??void 0;let fs;e[168]===Symbol.for("react.memo_cache_sentinel")?(fs=H=>{K(H??null),H&&G(!1)},e[168]=fs):fs=e[168];let en;e[169]!==Xs?(en=d.jsx(Gn,{className:"w-auto p-0",align:"start",children:d.jsx(vo,{mode:"single",selected:Xs,onSelect:fs,initialFocus:!0})}),e[169]=Xs,e[170]=en):en=e[170];let tn;e[171]!==Q||e[172]!==Jt||e[173]!==en?(tn=d.jsxs(Qn,{open:Q,onOpenChange:G,children:[Jt,en]}),e[171]=Q,e[172]=Jt,e[173]=en,e[174]=tn):tn=e[174];let nn;e[175]!==k||e[176]!==u||e[177]!==P?(nn=P.length===0?d.jsx(wn,{asChild:!0,children:d.jsxs("button",{type:"button",className:Z(kn,"text-muted-foreground"),children:[d.jsx(el,{size:16}),u("taskBoard.taskDialog.tagsButton")]})}):d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[P.map(H=>{const Qe=k.find(ot=>ot.id===H);return Qe?d.jsxs("button",{type:"button",onClick:()=>J(!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:ls(Qe.color)}}),d.jsx("span",{className:"truncate",children:Qe.name}),d.jsx("span",{role:"button",tabIndex:0,"aria-label":u("taskBoard.taskDialog.removeTagAriaLabel",{name:Qe.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:ot=>{ot.stopPropagation(),q(Mn=>Mn.filter(Ys=>Ys!==H))},onKeyDown:ot=>{(ot.key==="Enter"||ot.key===" ")&&(ot.preventDefault(),ot.stopPropagation(),q(Mn=>Mn.filter(Ys=>Ys!==H)))},children:d.jsx(Cn,{size:10})})]},H):null}),d.jsx(wn,{asChild:!0,children:d.jsx("button",{type:"button","aria-label":u("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(Jn,{size:14})})})]}),e[175]=k,e[176]=u,e[177]=P,e[178]=nn):nn=e[178];let sn;e[179]!==k.length?(sn=Fu(k.length),e[179]=k.length,e[180]=sn):sn=e[180];let hs;e[181]===Symbol.for("react.memo_cache_sentinel")?(hs=H=>q(Qe=>Qe.includes(H)?Qe.filter(ot=>ot!==H):[...Qe,H]),e[181]=hs):hs=e[181];let rn;e[182]!==_||e[183]!==te||e[184]!==k||e[185]!==sn||e[186]!==P?(rn=d.jsx(Gn,{align:"start",className:"w-56 p-0",children:d.jsx(Oh,{tags:k,selectedIds:P,defaultColor:sn,onToggle:hs,onCreate:_,onDelete:te})}),e[182]=_,e[183]=te,e[184]=k,e[185]=sn,e[186]=P,e[187]=rn):rn=e[187];let on;e[188]!==nn||e[189]!==rn||e[190]!==ne?(on=d.jsxs(Qn,{open:ne,onOpenChange:J,modal:!0,children:[nn,rn]}),e[188]=nn,e[189]=rn,e[190]=ne,e[191]=on):on=e[191];let an;e[192]!==Ie||e[193]!==vt||e[194]!==xt||e[195]!==tn||e[196]!==on?(an=d.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[Ie,vt,xt,tn,on]}),e[192]=Ie,e[193]=vt,e[194]=xt,e[195]=tn,e[196]=on,e[197]=an):an=e[197];let ln;e[198]!==xe||e[199]!==an?(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:[xe,an]}),e[198]=xe,e[199]=an,e[200]=ln):ln=e[200];let cn;e[201]!==de||e[202]!==ln?(cn=d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",children:[de,ln]}),e[201]=de,e[202]=ln,e[203]=cn):cn=e[203];let dn;e[204]!==s||e[205]!==a||e[206]!==u?(dn=s&&a?d.jsx(Xe,{variant:"ghost",size:"icon","aria-label":u("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:a,children:d.jsx(so,{size:16})}):d.jsx("span",{}),e[204]=s,e[205]=a,e[206]=u,e[207]=dn):dn=e[207];let un;e[208]!==s||e[209]!==c||e[210]!==u?(un=s&&c&&d.jsxs(Xe,{variant:"outline",size:"sm",onClick:c,children:[d.jsx(oo,{size:16}),u("taskBoard.taskDialog.newChatButton")]}),e[208]=s,e[209]=c,e[210]=u,e[211]=un):un=e[211];let fn;e[212]!==f||e[213]!==j?(fn=!j.trim()||f,e[212]=f,e[213]=j,e[214]=fn):fn=e[214];let hn;e[215]!==s?(hn=s?null:d.jsx(Jn,{size:16}),e[215]=s,e[216]=hn):hn=e[216];let pn;e[217]!==s||e[218]!==u?(pn=u(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton"),e[217]=s,e[218]=u,e[219]=pn):pn=e[219];let gn;e[220]!==je||e[221]!==fn||e[222]!==hn||e[223]!==pn?(gn=d.jsxs(Xe,{size:"sm",disabled:fn,onClick:je,children:[hn,pn]}),e[220]=je,e[221]=fn,e[222]=hn,e[223]=pn,e[224]=gn):gn=e[224];let mn;e[225]!==un||e[226]!==gn?(mn=d.jsxs("div",{className:"flex items-center gap-2",children:[un,gn]}),e[225]=un,e[226]=gn,e[227]=mn):mn=e[227];let xn;e[228]!==dn||e[229]!==mn?(xn=d.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[dn,mn]}),e[228]=dn,e[229]=mn,e[230]=xn):xn=e[230];let bn;e[231]!==Le||e[232]!==Ke||e[233]!==cn||e[234]!==xn?(bn=d.jsxs(jr,{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:[Le,Ke,cn,xn]}),e[231]=Le,e[232]=Ke,e[233]=cn,e[234]=xn,e[235]=bn):bn=e[235];let ps;return e[236]!==n||e[237]!==be||e[238]!==bn?(ps=d.jsx(Dr,{open:n,onOpenChange:be,children:bn}),e[236]=n,e[237]=be,e[238]=bn,e[239]=ps):ps=e[239],ps}function zh(t){t.key==="Enter"&&t.preventDefault()}function Lh(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function Ph(t){return t.id}function Fh(t){return t.id}function Uh(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:nl};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:Sr};case"in_progress":return{label:e("taskBoard.taskDialog.threadStatusRunning"),className:"text-primary",icon:ss,spin:!0};case"completed":return{label:e("taskBoard.taskDialog.threadStatusCompleted"),className:"text-success",icon:_n};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:Ls};default:return t}}function qh(t){const e=L.c(31),{thread:n,startedBy:r,onOpen:s}=t,i=ce();let o;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const a=n.status?Uh(n.status,i):null,l=n.lastMessage;let c;e[5]!==n.title?(c=ai(n.title,"qa"),e[5]=n.title,e[6]=c):c=e[6];const f=c;let u;e[7]!==n.title?(u=ai(n.title,"code_review"),e[7]=n.title,e[8]=u):u=e[8];const h=u;let p;e[9]!==s||e[10]!==n?(p=()=>s?.(n),e[9]=s,e[10]=n,e[11]=p):p=e[11];let m;e[12]!==h||e[13]!==f?(m=f?d.jsx(ia,{size:16,className:"shrink-0"}):h?d.jsx(oa,{size:16,className:"shrink-0"}):d.jsx(Ot,{size:16,className:"shrink-0"}),e[12]=h,e[13]=f,e[14]=m):m=e[14];let y;e[15]!==i||e[16]!==n.title?(y=n.title||i("taskBoard.taskDialog.superAgentDefaultName"),e[15]=i,e[16]=n.title,e[17]=y):y=e[17];let x;e[18]!==y?(x=d.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y}),e[18]=y,e[19]=x):x=e[19];let g;e[20]!==r||e[21]!==i?(g=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(Nt,{url:r.user?.image??void 0,fallback:Dt(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[20]=r,e[21]=i,e[22]=g):g=e[22];let b;e[23]!==s||e[24]!==i?(b=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(wo,{size:14})]}),e[23]=s,e[24]=i,e[25]=b):b=e[25];let k;e[26]!==m||e[27]!==x||e[28]!==g||e[29]!==b?(k=d.jsxs("div",{className:"flex items-center gap-2",children:[m,x,g,b]}),e[26]=m,e[27]=x,e[28]=g,e[29]=b,e[30]=k):k=e[30],o=d.jsxs("button",{type:"button",disabled:!s,onClick:p,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:[k,a&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:Z("flex shrink-0 items-center gap-1.5",a.className),children:[d.jsx(a.icon,{size:15,className:Z(a.spin&&"animate-spin")}),d.jsx("span",{className:"text-sm",children:a.label})]}),l&&d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:l})]})]}),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=o}else o=e[4];return o}function Hh(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:tl}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:Zs}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:Zs}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:Zs}}function Kh(t,e){switch(t){case"passing":return{label:e("taskBoard.taskDialog.prChecksPassing"),className:"text-success",icon:_n};case"failing":return{label:e("taskBoard.taskDialog.prChecksFailing"),className:"text-destructive",icon:Ls};case"pending":return{label:e("taskBoard.taskDialog.prChecksPending"),className:"text-warning",icon:ss};default:return null}}const Wh=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);function Vh(t){if(t.status!=="completed")return{icon:ss,className:"text-warning",spin:!0};const e=t.conclusion;return e&&Wh.has(e)?{icon:Ls,className:"text-destructive",spin:!1}:e==="success"||e==="neutral"||e==="skipped"?{icon:_n,className:"text-success",spin:!1}:{icon:Sr,className:"text-muted-foreground",spin:!1}}function Gh(t){const e=L.c(37),{pr:n,previewThread:r,reviewsReady:s,shipPending:i,onShip:o,onOpenThread:a}=t,l=ce(),[c,f]=v.useState(!1);let u;if(e[0]!==c||e[1]!==a||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==l){const h=Hh(n,l),p=Kh(n.checksStatus,l),m=n.state==="open"&&!n.merged,y=n.checksStatus!=="failing"&&n.checksStatus!=="pending",x=s&&m&&y,g=!!r||!!n.previewUrl||x;let b;e[9]!==n.checks?(b=n.checks??[],e[9]=n.checks,e[10]=b):b=e[10];const k=b,w=k.length>0||p!=null,S=k.length>0;let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=d.jsx(ar,{className:"size-4 shrink-0 text-foreground"}),e[11]=j):j=e[11];const C=n.title??`${n.repoOwner}/${n.repoName}`;let T;e[12]!==C?(T=d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:C}),e[12]=C,e[13]=T):T=e[13];const N=Z("flex shrink-0 items-center gap-1 text-xs font-medium",h.className);let R;e[14]!==h?(R=d.jsx(h.icon,{size:13}),e[14]=h,e[15]=R):R=e[15];let D;e[16]!==h||e[17]!==N||e[18]!==R?(D=d.jsxs("span",{className:N,children:[R,h.label]}),e[16]=h,e[17]=N,e[18]=R,e[19]=D):D=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=d.jsx(Ss,{size:12,className:"text-muted-foreground/60 group-hover:text-foreground"}),e[20]=E):E=e[20];let M;e[21]!==n.number||e[22]!==n.url?(M=d.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",title:n.url,className:"group flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted",children:["#",n.number,E]}),e[21]=n.number,e[22]=n.url,e[23]=M):M=e[23];let A;e[24]!==M||e[25]!==T||e[26]!==D?(A=d.jsxs("div",{className:"flex items-center gap-3",children:[j,T,D,M]}),e[24]=M,e[25]=T,e[26]=D,e[27]=A):A=e[27];let U;e[28]!==g||e[29]!==a||e[30]!==o||e[31]!==n.previewUrl||e[32]!==r||e[33]!==i||e[34]!==x||e[35]!==l?(U=g&&d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&d.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",title:l("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>a?.(r),children:[d.jsx(oo,{size:13}),l("taskBoard.taskDialog.openPreviewButton")]}),n.previewUrl&&d.jsx(Xe,{asChild:!0,type:"button",variant:"outline",size:"sm",className:"gap-1.5",children:d.jsxs("a",{href:n.previewUrl,target:"_blank",rel:"noreferrer",children:[d.jsx(So,{size:14}),l("taskBoard.taskDialog.previewLabel"),d.jsx(Ss,{size:12})]})}),x&&d.jsx(Xe,{type:"button",variant:"success",size:"sm",disabled:i,onClick:o,children:l("taskBoard.taskDialog.shipToProductionButton")})]}),e[28]=g,e[29]=a,e[30]=o,e[31]=n.previewUrl,e[32]=r,e[33]=i,e[34]=x,e[35]=l,e[36]=U):U=e[36],u=d.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[A,U,w&&d.jsxs("div",{className:"border-t border-border pt-2 text-xs",children:[d.jsxs("button",{type:"button",disabled:!S,onClick:()=>f(Qh),className:"flex w-full items-center gap-1.5 font-medium disabled:cursor-default",children:[p?d.jsx(p.icon,{size:13,className:p.className}):d.jsx(_n,{size:13,className:"text-muted-foreground"}),d.jsx("span",{className:Z(p?.className??"text-muted-foreground"),children:p?.label??l("taskBoard.taskDialog.prChecksLabel")}),S&&d.jsx(wo,{size:14,className:Z("ml-auto text-muted-foreground/60 transition-transform",c&&"rotate-90")})]}),c&&d.jsx("div",{className:"mt-2 flex flex-col gap-2",children:k.map(I=>{const B=Vh(I);return d.jsxs("div",{className:"rounded-md bg-muted/40 p-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(B.icon,{size:13,className:Z("shrink-0",B.className,B.spin&&"animate-spin")}),d.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:I.name}),I.detailsUrl&&d.jsx("a",{href:I.detailsUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:d.jsx(Ss,{size:12})})]}),I.summary&&d.jsx("div",{className:"mt-1.5 max-h-64 overflow-auto text-muted-foreground",children:d.jsx(Ql,{id:`${n.url}-${I.name}`,text:I.summary})})]},I.name)})})]})]}),e[0]=c,e[1]=a,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=l,e[8]=u}else u=e[8];return u}function Qh(t){return!t}function Xh(){const t=L.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(yn,{className:"size-4 shrink-0 rounded"}),d.jsx(yn,{className:"h-4 min-w-0 flex-1"}),d.jsx(yn,{className:"h-4 w-16 shrink-0"}),d.jsx(yn,{className:"h-4 w-10 shrink-0"})]}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=d.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[e,d.jsxs("div",{className:"flex gap-2",children:[d.jsx(yn,{className:"h-7 w-20"}),d.jsx(yn,{className:"h-7 w-28"})]})]}),t[1]=n):n=t[1],n}function Yh(t){const e=L.c(36),{item:n,description:r,onOpenThread:s}=t,i=ce(),{data:o,isLoading:a}=Ih(n.id),{data:l}=Ra(n.id),c=li("qa_agent_enabled"),f=li("code_reviewer_enabled"),u=_h(n.id);let h,p;if(e[0]!==l||e[1]!==f||e[2]!==r||e[3]!==n.status||e[4]!==n.threads||e[5]!==s||e[6]!==u||e[7]!==o||e[8]!==a||e[9]!==c||e[10]!==i){p=Symbol.for("react.early_return_sentinel");e:{const m=$h(r),y=a&&!o;if(!y&&(!o||o.length===0)&&m.length===0){p=null;break e}let x;e[13]!==l||e[14]!==f||e[15]!==n.status||e[16]!==c?(x=n.status==="in_review"&&Bh(l??[],Ah({qa:c,codeReview:f})),e[13]=l,e[14]=f,e[15]=n.status,e[16]=c,e[17]=x):x=e[17];const g=x;let b;e[18]!==u||e[19]!==i?(b=()=>u.mutate(void 0,{onSuccess:N=>N?.merged?At.success(i("taskBoard.taskDialog.shipSuccess")):At.error(i("taskBoard.taskDialog.shipError")),onError:()=>At.error(i("taskBoard.taskDialog.shipError"))}),e[18]=u,e[19]=i,e[20]=b):b=e[20];const k=b;let w;e[21]!==n.threads||e[22]!==s?(w=s?n.threads.find(Jh):void 0,e[21]=n.threads,e[22]=s,e[23]=w):w=e[23];const S=w;let j;e[24]!==i?(j=i("taskBoard.taskDialog.linksLabel"),e[24]=i,e[25]=j):j=e[25];let C;e[26]!==j?(C=d.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:j}),e[26]=j,e[27]=C):C=e[27];let T;e[28]!==y||e[29]!==s||e[30]!==k||e[31]!==S||e[32]!==u||e[33]!==o||e[34]!==g?(T=y?d.jsx(Xh,{}):(o??[]).map(N=>d.jsx(Gh,{pr:N,previewThread:S,reviewsReady:g,shipPending:u.isPending,onShip:k,onOpenThread:s},N.url)),e[28]=y,e[29]=s,e[30]=k,e[31]=S,e[32]=u,e[33]=o,e[34]=g,e[35]=T):T=e[35],h=d.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[C,T,m.map(Zh)]})}e[0]=l,e[1]=f,e[2]=r,e[3]=n.status,e[4]=n.threads,e[5]=s,e[6]=u,e[7]=o,e[8]=a,e[9]=c,e[10]=i,e[11]=h,e[12]=p}else h=e[11],p=e[12];return p!==Symbol.for("react.early_return_sentinel")?p:h}function Zh(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(So,{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(Ss,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function Jh(t){return t.hasPreview&&t.virtualMcpId}function ep(t){const e=L.c(18),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=ce(),{data:a}=Ra(n.id);let l;e[0]!==r?(l=new Map(r.map(rp)),e[0]=r,e[1]=l):l=e[1];const c=l;let f,u;if(e[2]!==a||e[3]!==n.threads){u=Symbol.for("react.early_return_sentinel");e:{const x=[...(a??[]).map(sp),...n.threads.map(np)].sort(tp);if(x.length===0){u=null;break e}f=[];for(const g of x){if(g.kind==="thread"){f.push({type:"thread",thread:g.thread});continue}const b=f[f.length-1];b?.type==="timeline"?b.items.push(g.activity):f.push({type:"timeline",items:[g.activity]})}}e[2]=a,e[3]=n.threads,e[4]=f,e[5]=u}else f=e[4],u=e[5];if(u!==Symbol.for("react.early_return_sentinel"))return u;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]!==c||e[12]!==i||e[13]!==s?(m=f.map((x,g)=>x.type==="timeline"?d.jsx(op,{items:x.items,memberByUserId:c},`timeline-${g}`):d.jsx(qh,{thread:x.thread,startedBy:s,onOpen:i},`thread-${x.thread.threadId}`)),e[10]=f,e[11]=c,e[12]=i,e[13]=s,e[14]=m):m=e[14];let y;return e[15]!==p||e[16]!==m?(y=d.jsxs("div",{className:"flex flex-col gap-5 pb-2",children:[p,m]}),e[15]=p,e[16]=m,e[17]=y):y=e[17],y}function tp(t,e){return t.at-e.at}function np(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function sp(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function rp(t){return[t.userId,t]}function Wt(t){const e=L.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 Ms="\0";function ws(t){return`${Ms}${t}${Ms}`}function vn(t,e){return t.split(new RegExp(`${Ms}(\\w+)${Ms}`)).map((n,r)=>d.jsx(v.Fragment,{children:r%2===0?n:e[n]},r))}function Hn(t,e){return e(t==="code_review"?"taskBoard.taskDialog.codeReviewerLabel":"taskBoard.taskDialog.qaAgentLabel")}function ip(t,e,n){const r=h=>{const p=typeof h=="string"?yt[h]:void 0;if(!p)return String(h??"");const m=p.icon;return d.jsx(Wt,{icon:d.jsx(m,{size:14,className:p.iconClassName}),label:e(p.labelKey)})},s=h=>{const p=typeof h=="string"?kt[h]:void 0;return p?d.jsx(Wt,{icon:d.jsx("span",{className:Z("size-2 rounded-full",p.dotClassName)}),label:e(p.labelKey)}):String(h??"")},i=h=>{const p=kr(typeof h=="string"?h:null);return p?d.jsx(Wt,{icon:d.jsx(Sn,{size:14,className:"text-muted-foreground"}),label:Ia.format(p)}):""},o=h=>!Array.isArray(h)||h.length===0?null:h.map((p,m)=>{const y=p;return d.jsx(Wt,{icon:d.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:ls(y.color)}}),label:y.name??""},y.id??m)}),a=h=>{if(h===nt)return d.jsx(Wt,{icon:d.jsx(Ot,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const p=typeof h=="string"?n.get(h):void 0;return d.jsx(Wt,{icon:d.jsx(Nt,{url:p?.user?.image??void 0,fallback:Dt(p?.user?.name),shape:"circle",size:"2xs"}),label:p?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},l=h=>d.jsx(Wt,{icon:h==="code_review"?d.jsx(oa,{size:14}):d.jsx(ia,{size:14}),label:Hn(h,e)}),c=t.data,f=ws("from"),u=ws("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return vn(c.from?e("taskBoard.taskDialog.activityMovedFromTo",{from:f,to:u}):e("taskBoard.taskDialog.activityMovedTo",{to:u}),{from:r(c.from),to:r(c.to)});case"assignee_changed":return c.to==null?e("taskBoard.taskDialog.activityUnassigned"):vn(e(c.to===nt?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:ws("name")}),{name:a(c.to)});case"priority_changed":return c.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):vn(!c.from||c.from==="none"?e("taskBoard.taskDialog.activityPrioritySet",{to:u}):e("taskBoard.taskDialog.activityPriorityFromTo",{from:f,to:u}),{from:s(c.from),to:s(c.to)});case"due_date_changed":return c.to==null?e("taskBoard.taskDialog.activityDueDateCleared"):vn(c.from==null?e("taskBoard.taskDialog.activityDueDateSet",{to:u}):e("taskBoard.taskDialog.activityDueDateFromTo",{from:f,to:u}),{from:i(c.from),to:i(c.to)});case"title_changed":return e("taskBoard.taskDialog.activityRenamed",{to:String(c.to??"")});case"description_changed":return e("taskBoard.taskDialog.activityDescriptionUpdated");case"tags_changed":return!Array.isArray(c.to)||c.to.length===0?e("taskBoard.taskDialog.activityTagsCleared"):vn(e("taskBoard.taskDialog.activityTagsSet",{to:u}),{to:o(c.to)});case"review_requested":return vn(e("taskBoard.taskDialog.activityDelegated",{name:ws("name")}),{name:l(c.reviewer)});case"review_approved":return typeof c.notes=="string"&&c.notes.trim()?e("taskBoard.taskDialog.activityReviewApprovedWithNotes",{reviewer:Hn(c.reviewer,e),notes:c.notes}):e("taskBoard.taskDialog.activityReviewApproved",{reviewer:Hn(c.reviewer,e)});case"review_changes_requested":return typeof c.notes=="string"&&c.notes.trim()?e("taskBoard.taskDialog.activityReviewChangesRequestedWithNotes",{reviewer:Hn(c.reviewer,e),notes:c.notes}):e("taskBoard.taskDialog.activityReviewChangesRequested",{reviewer:Hn(c.reviewer,e)});case"merge_conflict_resolution":return e("taskBoard.taskDialog.activityMergeConflictResolution");default:{const h=t.action;return String(h)}}}function Pi(t){return!t||t===nt}function op(t){const e=L.c(21),{items:n,memberByUserId:r}=t,s=ce();let i;e[0]!==r||e[1]!==s?(i=h=>Pi(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 a;e[3]!==r?(a=h=>{if(Pi(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(Nt,{url:p?.user?.image??void 0,fallback:Dt(p?.user?.name),shape:"circle",size:"2xs"})})},e[3]=r,e[4]=a):a=e[4];const l=a;let c;e[5]!==n.length?(c=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]=c):c=e[6];let f;if(e[7]!==l||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==s){let h;e[13]!==l||e[14]!==o||e[15]!==r||e[16]!==s?(h=p=>d.jsxs("div",{className:"relative flex items-center gap-2.5",children:[l(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)})," ",ip(p,s,r),d.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",fo(new Date(p.occurredAt))]})]})]},p.id),e[13]=l,e[14]=o,e[15]=r,e[16]=s,e[17]=h):h=e[17],f=n.map(h),e[7]=l,e[8]=o,e[9]=n,e[10]=r,e[11]=s,e[12]=f}else f=e[12];let u;return e[18]!==c||e[19]!==f?(u=d.jsxs("div",{className:"relative flex flex-col gap-4",children:[c,f]}),e[18]=c,e[19]=f,e[20]=u):u=e[20],u}const Fi=380,ap=90,Ui=5,lp="cubic-bezier(0.22, 0.61, 0.36, 1)";function cp(t,e,n){const r=v.useRef(new Map),s=v.useRef(new Map);v.useLayoutEffect(()=>{const i=t.current;if(!i)return;const o=i.querySelectorAll("[data-flip-id]"),a=new Map,l=r.current;r.current=a;const c=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,f=[];for(const g of o){const b=g.dataset.flipId;if(!b)continue;const k=g.getBoundingClientRect(),w=g.dataset.flipLane;if(a.set(b,{rect:k,lane:w}),!n)continue;const S=l.get(b);if(!S)continue;const j=S.rect.left-k.left,C=S.rect.top-k.top;(j||C)&&f.push({el:g,dx:j,dy:C,lane:S.lane!==w})}if(!n||c||f.length===0)return;const u=s.current,h=g=>{g instanceof HTMLElement&&(u.set(g,(u.get(g)??0)+1),g.style.overflow="visible")},p=g=>{if(!(g instanceof HTMLElement))return;const b=(u.get(g)??1)-1;if(b>0){u.set(g,b);return}u.delete(g),g.style.overflow=""};for(const g of f){const b=g.lane?` rotate(${g.dx>0?Ui:-Ui}deg)`:"";g.el.style.transition="none",g.el.style.transform=`translate(${g.dx}px, ${g.dy}px)${b}`,g.lane&&(g.el.style.zIndex="10",h(g.el.closest("[data-lane-scroll]")))}let m=0;const y=[],x=requestAnimationFrame(()=>{for(const g of f){const b=g.lane?m++*ap:0;g.el.style.transition=`transform ${Fi}ms ${lp} ${b}ms`,g.el.style.transform="",y.push(window.setTimeout(()=>{g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&p(g.el.closest("[data-lane-scroll]"))},Fi+b+30))}});return()=>{cancelAnimationFrame(x);for(const g of y)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 dp(t,e=[]){const n=[[`# Task: ${t.title}`,t.description?.trim()].filter(Boolean).join(`
71
+ `))}}h={type:"taskItem",raw:"",mainContent:g,indentLevel:u,checked:f??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:b}}const p=c?"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 a=0;a<r.length;a+=1){const l=r[a],c={...t,type:l.type,items:l.items},f=this.parseToken(c);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 a=t[o];if(a.type==="text")i.push({type:"text",text:a.text||""});else if(a.type==="html"){const l=((n=(e=a.raw)!=null?e:a.text)!=null?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(l),f=l.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&f&&!/\/>$/.test(l)){const h=f[1],p=this.escapeRegex(h),m=new RegExp(`^<\\/\\s*${p}\\b`,"i");let y=-1;const x=[l];for(let g=o+1;g<t.length;g+=1){const b=t[g],k=((s=(r=b.raw)!=null?r:b.text)!=null?s:"").toString();if(x.push(k),b.type==="html"&&m.test(k)){y=g;break}}if(y!==-1){const g=x.join(""),b={type:"html",raw:g,text:g,block:!1},k=this.parseHTMLToken(b);if(k){const w=this.normalizeParseResult(k);Array.isArray(w)?i.push(...w):w&&i.push(w)}o=y;continue}}const u=this.parseHTMLToken(a);if(u){const h=this.normalizeParseResult(u);Array.isArray(h)?i.push(...h):h&&i.push(h)}}else if(a.type){const l=this.getHandlerForToken(a.type);if(l&&l.parseMarkdown){const c=this.createParseHelpers(),f=l.parseMarkdown(a,c);if(this.isMarkResult(f)){const u=this.applyMarkToContent(f.mark,f.content,f.attrs);i.push(...u)}else{const u=this.normalizeParseResult(f);Array.isArray(u)?i.push(...u):u&&i.push(u)}}else a.tokens&&i.push(...this.parseInlineTokens(a.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=Ul(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 a=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,l={renderChildren:(u,h)=>{const p=o.isIndenting?r+1:r;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,t,h||"",n,p):this.renderNodes(u,t,h||"",n,p)},renderChild:(u,h)=>{const p=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(u,t,h,p)},indent:u=>this.indentString+u,wrapInBlock:Yf},c={index:n,level:r,parentType:e?.type,previousNode:a,meta:{parentAttrs:e?.attrs,...s}};return((i=o.renderMarkdown)==null?void 0:i.call(o,t,l,c))||""}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,a)=>{const l=a<t.length-1?t[a+1]:null;if(o.type)if(o.type==="text"){let c=o.text||"";const f=new Map((o.marks||[]).map(g=>[g.type,g])),u=Jf(i,f),h=Zf(f,l);let p="";if(h.length>0){const g=c.match(/(\s+)$/);g&&(p=g[1],c=c.slice(0,-p.length))}h.forEach(g=>{const b=f.get(g),k=this.getMarkClosing(g,b);k&&(c+=k),i.has(g)&&i.delete(g)});let m="";if(u.length>0){const g=c.match(/^(\s+)/);g&&(m=g[1],c=c.slice(m.length))}u.forEach(({type:g,mark:b})=>{const k=this.getMarkOpening(g,b);k&&(c=k+c),h.includes(g)||i.set(g,b)}),c=m+c;const y=eh(i,f,l,this.markSetsEqual.bind(this));let x="";if(y.length>0){const g=c.match(/(\s+)$/);g&&(x=g[1],c=c.slice(0,-x.length))}y.forEach(g=>{const b=i.get(g),k=this.getMarkClosing(g,b);k&&(c+=k),i.delete(g)}),c+=x,c+=p,s.push(c)}else{const c=new Map(i),f=th(i,this.getMarkClosing.bind(this)),u=this.renderNodeToMarkdown(o,e,a,r),h=o.type==="hardBreak"?"":nh(c,i,this.getMarkOpening.bind(this));s.push(f+u+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:l=>l,wrapInBlock:(l,c)=>l+c},{index:0,level:0,parentType:"text",meta:{}}),a=o.indexOf(s);return a>=0?o.substring(0,a):""}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:c=>c,wrapInBlock:(c,f)=>c+f},{index:0,level:0,parentType:"text",meta:{}}),a=o.indexOf(s),l=a+s.length;return a>=0?o.substring(l):""}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))}},Mi=sh,rh=Rr.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return Mt.setContent(t,e);if(vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Mt.setContent(t,e);const r=this.editor.markdown.parse(t);return Mt.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return Mt.insertContent(t,e);if(vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Mt.insertContent(t,e);const r=this.editor.markdown.parse(t);return Mt.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return Mt.insertContentAt(t,e,n);if(vs(e,n?.contentType)!=="markdown"||!this.editor.markdown)return Mt.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return Mt.insertContentAt(t,s,n)}}},addStorage(){return{manager:new Mi({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 Mi({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||vs(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 ih(t){const e=L.c(25),{node:n,selected:r,editor:s,deleteNode:i}=t,o=ce(),a=typeof n.attrs.href=="string"?n.attrs.href:"",l=typeof n.attrs.name=="string"?n.attrs.name:"";let c;e[0]!==l||e[1]!==o?(c=l||o("markdownEditor.fileNameFallback"),e[0]=l,e[1]=o,e[2]=c):c=e[2];const f=c,u=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==u?(h=Z("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",u),e[3]=u,e[4]=h):h=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx(Za,{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 y;e[8]!==f||e[9]!==o?(y=o("markdownEditor.downloadFile",{name:f}),e[8]=f,e[9]=o,e[10]=y):y=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=d.jsx(Jl,{size:14}),e[11]=x):x=e[11];let g;e[12]!==a||e[13]!==f||e[14]!==y?(g=d.jsx("a",{href:a,download:f,"aria-label":y,onMouseDown:ah,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:x}),e[12]=a,e[13]=f,e[14]=y,e[15]=g):g=e[15];let b;e[16]!==i||e[17]!==s.isEditable||e[18]!==o?(b=s.isEditable&&d.jsx("button",{type:"button","aria-label":o("markdownEditor.removeFile"),onMouseDown:oh,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:d.jsx(Cn,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=b):b=e[19];let k;return e[20]!==h||e[21]!==m||e[22]!==g||e[23]!==b?(k=d.jsxs(ko,{as:"span",className:h,children:[p,m,g,b]}),e[20]=h,e[21]=m,e[22]=g,e[23]=b,e[24]=k):k=e[24],k}function oh(t){return t.preventDefault()}function ah(t){return t.preventDefault()}function lh(t){return t.replace(/([[\]])/g,"\\$1")}const ch=xo.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",yo(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`[${lh(n)}](${e})`},addNodeView(){return bo(ih)}});var dh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,uh=xo.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",yo(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 a=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",l=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},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:a})=>{const l=document.createElement("img");Object.entries(o).forEach(([u,h])=>{if(h!=null)switch(u){case"width":case"height":break;default:l.setAttribute(u,h);break}}),l.src=o.src;const c=new Hl({element:l,editor:a,node:s,getPos:i,onResize:(u,h)=>{l.style.width=`${u}px`,l.style.height=`${h}px`},onCommit:(u,h)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:u,height:h}).run()},onUpdate:(u,h,p)=>u.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),f=c.dom;return f.style.visibility="hidden",f.style.pointerEvents="none",l.onload=()=>{f.style.visibility="",f.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[ql({find:dh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),fh=uh;function hh(t){const e=L.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,o=ce(),a=typeof n.attrs.src=="string"?n.attrs.src:"",l=typeof n.attrs.alt=="string"?n.attrs.alt:"";let c;e[0]!==l||e[1]!==o?(c=l||o("markdownEditor.imageAltFallback"),e[0]=l,e[1]=o,e[2]=c):c=e[2];const f=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let u;e[3]!==f?(u=Z("max-h-[420px] max-w-full rounded-lg border border-border object-contain",f),e[3]=f,e[4]=u):u=e[4];let h;e[5]!==a||e[6]!==c||e[7]!==u?(h=d.jsx("img",{src:a,alt:c,draggable:!1,className:u}),e[5]=a,e[6]=c,e[7]=u,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:ph,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(Cn,{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(ko,{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 ph(t){return t.preventDefault()}const gh=fh.extend({addNodeView(){return bo(hh)}}).configure({inline:!1,allowBase64:!1}),yr="uploads",mh="editor-images",Na="editor-files",xh=new RegExp(`^/api/[^/]+/fs/${yr}/read$`),zi="http://relative.invalid";function bh(t){let e;try{e=new URL(t,zi)}catch{return!1}return e.origin!==zi||!xh.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${Na}/`)}const yh={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},kh=Kl.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return bh(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function vh(t=""){return[Wl.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),kh.configure(yh),gc.configure({placeholder:t}),gh,ch,rh.configure({markedOptions:{breaks:!0}})]}const wh=10,Sh=25,Ch={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Th(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??Ch[t.type]??(si(t)?".png":"")}function si(t){return t.type.startsWith("image/")}function jh(){const t=ce(),{upload:e}=Oc(yr),n=Bc(yr),[r,s]=v.useState(0);return{uploadFile:async o=>{const a=si(o),l=a?wh:Sh;if(o.size>l*1024*1024)return At.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(l)})),null;const c=a?mh:Na,f=`${crypto.randomUUID()}${Th(o)}`;s(u=>u+1);try{return await e.mutateAsync({dir:c,files:[new File([o],f,{type:o.type})]}),n(`${c}/${f}`)}catch{return At.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(u=>u-1)}},pending:r}}const Dh=["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(" "),Nh=["[&_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 Li(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(Bt.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function Rh({defaultValue:t,onChange:e,placeholder:n}){const r=ce(),{uploadFile:s,pending:i}=jh(),o=v.useRef(null),a=v.useRef(e),l=v.useRef(s);a.current=e,l.current=s;const c=(h,p,m)=>p.length===0?!1:((async()=>{let y=m;for(const x of p){const g=await l.current(x);g&&(y=si(x)?Li(h,y,"image",{src:g,alt:x.name}):Li(h,y,"attachment",{href:g,name:x.name}))}})(),!0),f=Vl({extensions:vh(n),content:t,contentType:"markdown",editorProps:{attributes:{class:Z(Dh,Nh)},handlePaste:(h,p)=>c(h,Array.from(p.clipboardData?.files??[]),h.state.selection.to),handleDrop:(h,p,m,y)=>{if(y)return!1;const x=Array.from(p.dataTransfer?.files??[]),g=h.posAtCoords({left:p.clientX,top:p.clientY})?.pos;return g===void 0?!1:c(h,x,g)}},onUpdate:({editor:h})=>a.current(h.getMarkdown())});if(!f)return null;const u=h=>{!h||h.length===0||c(f.view,Array.from(h),f.state.selection.to)};return d.jsxs("div",{className:"flex flex-col",children:[d.jsx(lf,{editor:f}),d.jsx(Gl,{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(Xe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":r("markdownEditor.attachFile"),onClick:()=>o.current?.click(),children:d.jsx(Ja,{size:14})}),i>0&&d.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[d.jsx(ss,{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=>{u(h.target.files),h.target.value=""}})]})}const Eh=1e4;function Ih(t){const e=L.c(10),{locator:n}=_e(),r=In();let s;e[0]!==t||e[1]!==n?(s=ve.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 a;return e[6]!==s||e[7]!==i||e[8]!==o?(a={queryKey:s,enabled:i,refetchInterval:Eh,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=a):a=e[9],lt(a)}function Ra(t){const e=L.c(10),{locator:n}=_e(),r=In();let s;e[0]!==t||e[1]!==n?(s=ve.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 a;return e[6]!==s||e[7]!==i||e[8]!==o?(a={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=a):a=e[9],lt(a)}function _h(t){const e=L.c(10),{locator:n}=_e(),r=In(),s=En();let i;e[0]!==t||e[1]!==r?(i=async()=>await r.call("TASK_BOARD_PROMOTE_TO_PRODUCTION",{taskBoardItemId:t}),e[0]=t,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==t||e[4]!==n||e[5]!==s?(o=()=>{s.invalidateQueries({queryKey:ve.taskBoardItemPrs(n,t)}),s.invalidateQueries({queryKey:ve.taskBoardActivity(n,t)})},e[3]=t,e[4]=n,e[5]=s,e[6]=o):o=e[6];let a;return e[7]!==i||e[8]!==o?(a={mutationFn:i,onSuccess:o},e[7]=i,e[8]=o,e[9]=a):a=e[9],Tt(a)}function Ah(t){const e=[];return t.qa&&e.push("qa"),t.codeReview&&e.push("code_review"),e}function Bh(t,e){return e.length===0?!0:Cl(t,e)}function ri(t){const e=L.c(54),{members:n,onSelect:r}=t,s=ce();let i;e[0]!==s?(i=s("taskBoard.taskDialog.assignToPlaceholder"),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==i?(o=d.jsx(Er,{placeholder:i,className:"h-9"}),e[2]=i,e[3]=o):o=e[3];let a;e[4]!==s?(a=s("taskBoard.taskDialog.noMembersFound"),e[4]=s,e[5]=a):a=e[5];let l;e[6]!==a?(l=d.jsx(Ir,{children:a}),e[6]=a,e[7]=l):l=e[7];let c;e[8]!==s?(c=s("taskBoard.taskDialog.superAgentLabel"),e[8]=s,e[9]=c):c=e[9];let f;e[10]!==r?(f=()=>r(nt),e[10]=r,e[11]=f):f=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(Ot,{size:16}),e[12]=u):u=e[12];let h;e[13]!==s?(h=s("taskBoard.taskDialog.superAgentLabel"),e[13]=s,e[14]=h):h=e[14];let p;e[15]!==h?(p=d.jsx("span",{className:"truncate",children:h}),e[15]=h,e[16]=p):p=e[16];let m;e[17]!==c||e[18]!==f||e[19]!==p?(m=d.jsxs(Pt,{value:c,onSelect:f,className:"gap-2",children:[u,p]}),e[17]=c,e[18]=f,e[19]=p,e[20]=m):m=e[20];let y;e[21]!==s?(y=s("taskBoard.taskDialog.unassignedLabel"),e[21]=s,e[22]=y):y=e[22];let x;e[23]!==r?(x=()=>r(null),e[23]=r,e[24]=x):x=e[24];let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=d.jsx(lr,{size:16,className:"text-muted-foreground"}),e[25]=g):g=e[25];let b;e[26]!==s?(b=s("taskBoard.taskDialog.unassignedLabel"),e[26]=s,e[27]=b):b=e[27];let k;e[28]!==b?(k=d.jsx("span",{className:"truncate",children:b}),e[28]=b,e[29]=k):k=e[29];let w;e[30]!==y||e[31]!==x||e[32]!==k?(w=d.jsxs(Pt,{value:y,onSelect:x,className:"gap-2",children:[g,k]}),e[30]=y,e[31]=x,e[32]=k,e[33]=w):w=e[33];let C;e[34]!==m||e[35]!==w?(C=d.jsxs(Rn,{children:[m,w]}),e[34]=m,e[35]=w,e[36]=C):C=e[36];let j;e[37]!==s?(j=s("taskBoard.taskDialog.membersGroupHeading"),e[37]=s,e[38]=j):j=e[38];let S;if(e[39]!==n||e[40]!==r){let D;e[42]!==r?(D=E=>d.jsxs(Pt,{value:E.user?.name??E.userId,onSelect:()=>r(E.userId),className:"gap-2",children:[d.jsx(Nt,{url:E.user?.image??void 0,fallback:Dt(E.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:E.user?.name??E.userId})]},E.userId),e[42]=r,e[43]=D):D=e[43],S=n.map(D),e[39]=n,e[40]=r,e[41]=S}else S=e[41];let T;e[44]!==j||e[45]!==S?(T=d.jsx(Rn,{heading:j,children:S}),e[44]=j,e[45]=S,e[46]=T):T=e[46];let N;e[47]!==C||e[48]!==T||e[49]!==l?(N=d.jsxs(_r,{children:[l,C,T]}),e[47]=C,e[48]=T,e[49]=l,e[50]=N):N=e[50];let R;return e[51]!==o||e[52]!==N?(R=d.jsxs(Ar,{children:[o,N]}),e[51]=o,e[52]=N,e[53]=R):R=e[53],R}function Oh({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=ce(),[a,l]=v.useState(""),[c,f]=v.useState(!1),[u,h]=v.useState(n),p=a.trim(),m=t.some(x=>x.name.toLowerCase()===p.toLowerCase()),y=async()=>{if(!(!p||m||c)){f(!0);try{await s(p,u),l("")}finally{f(!1)}}};return d.jsxs(Ar,{children:[d.jsx(Er,{value:a,onValueChange:l,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),d.jsxs(_r,{children:[p&&!m?d.jsx(Rn,{children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{type:"color",value:u,onChange:x=>h(x.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(Pt,{value:`create-${p}`,disabled:c,onSelect:y,className:"flex-1 gap-2",children:[d.jsx(Jn,{size:16,className:"text-muted-foreground"}),d.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:p})})]})]})}):d.jsx(Ir,{children:o("taskBoard.taskDialog.noTagsFound")}),d.jsx(Rn,{children:t.map(x=>{const g=e.includes(x.id);return d.jsxs(Pt,{value:x.name,onSelect:()=>r(x.id),className:"group gap-2",children:[d.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:ls(x.color)}}),d.jsx("span",{className:"flex-1 truncate",children:x.name}),d.jsx("button",{type:"button","aria-label":o("taskBoard.taskDialog.deleteTagAriaLabel",{name:x.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:b=>{b.stopPropagation(),i(x.id)},children:d.jsx(so,{size:13})}),g&&d.jsx(Ps,{size:14,className:"shrink-0 text-foreground"})]},x.id)})})]})]})}function $h(t){if(!t)return[];const e=[],n=new Set,r=(o,a)=>{n.has(o)||(n.add(o),e.push({url:o,label:a.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 Ea(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function kr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const Ia=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),kn="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 Mh(t){const e=L.c(240),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:a,onOpenThread:l,onNewChat:c,isSaving:f}=t,u=ce(),{data:h}=uo();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:y,copied:x}=Yl(),{data:g}=ho();let b;e[2]!==g?(b=g===void 0?[]:g,e[2]=g,e[3]=b):b=e[3];const k=b,w=Nl(),C=Rl(),[j,S]=v.useState(s?.title??""),[T,N]=v.useState(s?.description??""),[R,D]=v.useState(s?.status??i??"triage"),[E,M]=v.useState(s?.priority??"medium"),[A,U]=v.useState(s?.assigneeId??null),I=s?.dueDate;let B;e[4]!==I?(B=kr(I),e[4]=I,e[5]=B):B=e[5];const[O,K]=v.useState(B);let Y;e[6]!==s?.tags?(Y=s?.tags.map(Fh)??[],e[6]=s?.tags,e[7]=Y):Y=e[7];const[P,q]=v.useState(Y),[Q,G]=v.useState(!1),[ee,W]=v.useState(!1),[ne,J]=v.useState(!1);let se;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?(se=()=>{S(s?.title??""),N(s?.description??""),D(s?.status??i??"triage"),M(s?.priority??"medium"),U(s?.assigneeId??null),K(kr(s?.dueDate)),q(s?.tags.map(Ph)??[])},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]=se):se=e[16];const $=se;let F;e[17]!==r||e[18]!==$?(F=()=>{r(),$()},e[17]=r,e[18]=$,e[19]=F):F=e[19];const X=F;let re;e[20]!==w?(re=async(H,Qe)=>{const ot=await w.mutateAsync({name:H,color:Qe});q(Mn=>[...Mn,ot.id])},e[20]=w,e[21]=re):re=e[21];const _=re;let V;e[22]!==C?(V=H=>{C.mutate(H),q(Qe=>Qe.filter(ot=>ot!==H))},e[22]=C,e[23]=V):V=e[23];const te=V;let le;e[24]!==A||e[25]!==T||e[26]!==O||e[27]!==o||e[28]!==E||e[29]!==R||e[30]!==P||e[31]!==j?(le=()=>{const H=j.trim();H&&o({title:H,description:T.trim()||null,status:R,priority:E,assigneeId:A,dueDate:O?Ea(O):null,tagIds:P})},e[24]=A,e[25]=T,e[26]=O,e[27]=o,e[28]=E,e[29]=R,e[30]=P,e[31]=j,e[32]=le):le=e[32];const je=le,pe=A===nt;let De;if(e[33]!==A||e[34]!==m){let H;e[36]!==A?(H=Qe=>Qe.userId===A,e[36]=A,e[37]=H):H=e[37],De=m.find(H),e[33]=A,e[34]=m,e[35]=De}else De=e[35];const fe=De;let it;e[38]!==s||e[39]!==m?(it=s?.assignedBy?m.find(H=>H.userId===s.assignedBy):void 0,e[38]=s,e[39]=m,e[40]=it):it=e[40];const Ee=it,ct=yt[R].icon;let be;e[41]!==X?(be=H=>!H&&X(),e[41]=X,e[42]=be):be=e[42];let ge;e[43]!==s||e[44]!==u?(ge=u(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[43]=s,e[44]=u,e[45]=ge):ge=e[45];let Le;e[46]!==ge?(Le=d.jsx(Tr,{className:"sr-only",children:ge}),e[46]=ge,e[47]=Le):Le=e[47];let me;e[48]!==u?(me=u("taskBoard.taskDialog.closeAriaLabel"),e[48]=u,e[49]=me):me=e[49];let gt;e[50]===Symbol.for("react.memo_cache_sentinel")?(gt=d.jsx(Cn,{size:16}),e[50]=gt):gt=e[50];let Ke;e[51]!==X||e[52]!==me?(Ke=d.jsx("button",{type:"button","aria-label":me,onClick:X,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:gt}),e[51]=X,e[52]=me,e[53]=Ke):Ke=e[53];let Ae;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ae=H=>{S(H.target.value),H.target.style.height="auto",H.target.style.height=`${H.target.scrollHeight}px`},e[54]=Ae):Ae=e[54];let We;e[55]!==u?(We=u("taskBoard.taskDialog.taskTitlePlaceholder"),e[55]=u,e[56]=We):We=e[56];let Ze;e[57]!==We||e[58]!==j?(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:Lh,value:j,onChange:Ae,onKeyDown:zh,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]=j,e[59]=Ze):Ze=e[59];let mt;e[60]!==u?(mt=u("taskBoard.taskDialog.descriptionPlaceholder"),e[60]=u,e[61]=mt):mt=e[61];let Fe;e[62]!==T||e[63]!==mt?(Fe=d.jsx(Rh,{defaultValue:T,onChange:N,placeholder:mt}),e[62]=T,e[63]=mt,e[64]=Fe):Fe=e[64];let Ve;e[65]!==x||e[66]!==T||e[67]!==y||e[68]!==u?(Ve=T&&d.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":u("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:()=>y(T),children:x?d.jsx(Ps,{size:14}):d.jsx(Zl,{size:14})}),e[65]=x,e[66]=T,e[67]=y,e[68]=u,e[69]=Ve):Ve=e[69];let Je;e[70]!==Fe||e[71]!==Ve?(Je=d.jsxs("div",{className:"group relative flex flex-col",children:[Fe,Ve]}),e[70]=Fe,e[71]=Ve,e[72]=Je):Je=e[72];let dt;e[73]!==s?(dt=s&&d.jsx("hr",{className:"border-border"}),e[73]=s,e[74]=dt):dt=e[74];let ut;e[75]!==T||e[76]!==s||e[77]!==l?(ut=s?.id&&d.jsx(Yh,{item:s,description:T,onOpenThread:l}),e[75]=T,e[76]=s,e[77]=l,e[78]=ut):ut=e[78];let et;e[79]!==Ee||e[80]!==fe||e[81]!==s||e[82]!==m||e[83]!==l?(et=s&&d.jsx(ep,{item:s,members:m,startedBy:Ee??fe,onOpenThread:l}),e[79]=Ee,e[80]=fe,e[81]=s,e[82]=m,e[83]=l,e[84]=et):et=e[84];let tt;e[85]!==Je||e[86]!==dt||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,dt,ut,et]}),e[85]=Je,e[86]=dt,e[87]=ut,e[88]=et,e[89]=tt):tt=e[89];let de;e[90]!==Ze||e[91]!==tt?(de=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]=de):de=e[92];let we;e[93]!==u?(we=u("taskBoard.taskDialog.propertiesLabel"),e[93]=u,e[94]=we):we=e[94];let xe;e[95]!==we?(xe=d.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:we}),e[95]=we,e[96]=xe):xe=e[96];let Ne;e[97]!==s||e[98]!==R?(Ne=Z(s?Hr({...s,status:R}):yt[R].iconClassName),e[97]=s,e[98]=R,e[99]=Ne):Ne=e[99];let ye;e[100]!==ct||e[101]!==Ne?(ye=d.jsx(ct,{size:16,className:Ne}),e[100]=ct,e[101]=Ne,e[102]=ye):ye=e[102];const Ce=yt[R];let Te;e[103]!==u||e[104]!==Ce.labelKey?(Te=u(Ce.labelKey),e[103]=u,e[104]=Ce.labelKey,e[105]=Te):Te=e[105];let Ue;e[106]!==ye||e[107]!==Te?(Ue=d.jsx(jn,{asChild:!0,children:d.jsxs("button",{type:"button",className:kn,children:[ye,Te]})}),e[106]=ye,e[107]=Te,e[108]=Ue):Ue=e[108];let he;e[109]!==u?(he=As.map(H=>{const Qe=yt[H].icon;return d.jsxs(jt,{onSelect:()=>D(H),className:"gap-2",children:[d.jsx(Qe,{size:16,className:yt[H].iconClassName}),u(yt[H].labelKey)]},H)}),e[109]=u,e[110]=he):he=e[110];let Be;e[111]!==he?(Be=d.jsx(Dn,{align:"start",className:"w-44",children:he}),e[111]=he,e[112]=Be):Be=e[112];let Ie;e[113]!==Ue||e[114]!==Be?(Ie=d.jsxs(Nn,{children:[Ue,Be]}),e[113]=Ue,e[114]=Be,e[115]=Ie):Ie=e[115];const qe=E==="none"&&"text-muted-foreground";let Oe;e[116]!==qe?(Oe=Z(kn,qe),e[116]=qe,e[117]=Oe):Oe=e[117];let $e;e[118]!==E||e[119]!==u?($e=E==="none"?d.jsxs(d.Fragment,{children:[d.jsx(ro,{size:16}),u("taskBoard.taskDialog.setPriorityButton")]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[E].dotClassName)}),u(kt[E].labelKey)]}),e[118]=E,e[119]=u,e[120]=$e):$e=e[120];let Re;e[121]!==Oe||e[122]!==$e?(Re=d.jsx(jn,{asChild:!0,children:d.jsx("button",{type:"button",className:Oe,children:$e})}),e[121]=Oe,e[122]=$e,e[123]=Re):Re=e[123];let Me;e[124]!==u?(Me=Kr.map(H=>d.jsxs(jt,{onSelect:()=>M(H),children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[H].dotClassName)}),u(kt[H].labelKey)]},H)),e[124]=u,e[125]=Me):Me=e[125];let He;e[126]!==Me?(He=d.jsx(Dn,{align:"start",className:"w-40",children:Me}),e[126]=Me,e[127]=He):He=e[127];let vt;e[128]!==Re||e[129]!==He?(vt=d.jsxs(Nn,{children:[Re,He]}),e[128]=Re,e[129]=He,e[130]=vt):vt=e[130];const It=!A&&"text-muted-foreground";let ft;e[131]!==It?(ft=Z(kn,It),e[131]=It,e[132]=ft):ft=e[132];let ht;e[133]!==Ee||e[134]!==fe||e[135]!==pe||e[136]!==u?(ht=pe&&Ee?d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[d.jsx(Nt,{url:Ee.user?.image??void 0,fallback:Dt(Ee.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:Ee.user?.name??u("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(Nt,{url:Ee.user?.image??void 0,fallback:Dt(Ee.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),d.jsx(Ot,{size:16,className:"ring-2 ring-background"})]}),u("taskBoard.taskDialog.superAgentLabel")]})]}):pe?d.jsxs(d.Fragment,{children:[d.jsx(Ot,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]}):fe?d.jsxs(d.Fragment,{children:[d.jsx(Nt,{url:fe.user?.image??void 0,fallback:Dt(fe.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:fe.user?.name??u("taskBoard.taskDialog.unassignedLabel")})]}):d.jsxs(d.Fragment,{children:[d.jsx(io,{size:16,className:"text-muted-foreground"}),u("taskBoard.taskDialog.assignButton")]}),e[133]=Ee,e[134]=fe,e[135]=pe,e[136]=u,e[137]=ht):ht=e[137];let wt;e[138]!==ft||e[139]!==ht?(wt=d.jsx(wn,{asChild:!0,children:d.jsx("button",{type:"button",className:ft,children:ht})}),e[138]=ft,e[139]=ht,e[140]=wt):wt=e[140];let z;e[141]===Symbol.for("react.memo_cache_sentinel")?(z=H=>{U(H),W(!1)},e[141]=z):z=e[141];let ie;e[142]!==m?(ie=d.jsx(Gn,{align:"start",className:"w-56 p-0",children:d.jsx(ri,{members:m,onSelect:z})}),e[142]=m,e[143]=ie):ie=e[143];let ke;e[144]!==ee||e[145]!==wt||e[146]!==ie?(ke=d.jsxs(Qn,{open:ee,onOpenChange:W,modal:!0,children:[wt,ie]}),e[144]=ee,e[145]=wt,e[146]=ie,e[147]=ke):ke=e[147];let Ge;e[148]!==Ee||e[149]!==pe||e[150]!==u?(Ge=pe&&Ee&&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:Z(kn,"pointer-events-none"),children:[d.jsx(Ot,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]})]}),e[148]=Ee,e[149]=pe,e[150]=u,e[151]=Ge):Ge=e[151];let xt;e[152]!==ke||e[153]!==Ge?(xt=d.jsxs("div",{className:"flex flex-col",children:[ke,Ge]}),e[152]=ke,e[153]=Ge,e[154]=xt):xt=e[154];const Kt=!O&&"text-muted-foreground";let Xt;e[155]!==Kt?(Xt=Z(kn,Kt),e[155]=Kt,e[156]=Xt):Xt=e[156];let us;e[157]===Symbol.for("react.memo_cache_sentinel")?(us=d.jsx(Sn,{size:16,className:"text-muted-foreground"}),e[157]=us):us=e[157];let Yt;e[158]!==O||e[159]!==u?(Yt=O?Ia.format(O):u("taskBoard.taskDialog.dueDateLabel"),e[158]=O,e[159]=u,e[160]=Yt):Yt=e[160];let Zt;e[161]!==O||e[162]!==u?(Zt=O&&d.jsx("span",{role:"button",tabIndex:0,"aria-label":u("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:H=>{H.stopPropagation(),K(null)},onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),H.stopPropagation(),K(null))},children:d.jsx(Cn,{size:12})}),e[161]=O,e[162]=u,e[163]=Zt):Zt=e[163];let Jt;e[164]!==Xt||e[165]!==Yt||e[166]!==Zt?(Jt=d.jsx(wn,{asChild:!0,children:d.jsxs("button",{type:"button",className:Xt,children:[us,Yt,Zt]})}),e[164]=Xt,e[165]=Yt,e[166]=Zt,e[167]=Jt):Jt=e[167];const Xs=O??void 0;let fs;e[168]===Symbol.for("react.memo_cache_sentinel")?(fs=H=>{K(H??null),H&&G(!1)},e[168]=fs):fs=e[168];let en;e[169]!==Xs?(en=d.jsx(Gn,{className:"w-auto p-0",align:"start",children:d.jsx(vo,{mode:"single",selected:Xs,onSelect:fs,initialFocus:!0})}),e[169]=Xs,e[170]=en):en=e[170];let tn;e[171]!==Q||e[172]!==Jt||e[173]!==en?(tn=d.jsxs(Qn,{open:Q,onOpenChange:G,children:[Jt,en]}),e[171]=Q,e[172]=Jt,e[173]=en,e[174]=tn):tn=e[174];let nn;e[175]!==k||e[176]!==u||e[177]!==P?(nn=P.length===0?d.jsx(wn,{asChild:!0,children:d.jsxs("button",{type:"button",className:Z(kn,"text-muted-foreground"),children:[d.jsx(el,{size:16}),u("taskBoard.taskDialog.tagsButton")]})}):d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[P.map(H=>{const Qe=k.find(ot=>ot.id===H);return Qe?d.jsxs("button",{type:"button",onClick:()=>J(!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:ls(Qe.color)}}),d.jsx("span",{className:"truncate",children:Qe.name}),d.jsx("span",{role:"button",tabIndex:0,"aria-label":u("taskBoard.taskDialog.removeTagAriaLabel",{name:Qe.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:ot=>{ot.stopPropagation(),q(Mn=>Mn.filter(Ys=>Ys!==H))},onKeyDown:ot=>{(ot.key==="Enter"||ot.key===" ")&&(ot.preventDefault(),ot.stopPropagation(),q(Mn=>Mn.filter(Ys=>Ys!==H)))},children:d.jsx(Cn,{size:10})})]},H):null}),d.jsx(wn,{asChild:!0,children:d.jsx("button",{type:"button","aria-label":u("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(Jn,{size:14})})})]}),e[175]=k,e[176]=u,e[177]=P,e[178]=nn):nn=e[178];let sn;e[179]!==k.length?(sn=Fu(k.length),e[179]=k.length,e[180]=sn):sn=e[180];let hs;e[181]===Symbol.for("react.memo_cache_sentinel")?(hs=H=>q(Qe=>Qe.includes(H)?Qe.filter(ot=>ot!==H):[...Qe,H]),e[181]=hs):hs=e[181];let rn;e[182]!==_||e[183]!==te||e[184]!==k||e[185]!==sn||e[186]!==P?(rn=d.jsx(Gn,{align:"start",className:"w-56 p-0",children:d.jsx(Oh,{tags:k,selectedIds:P,defaultColor:sn,onToggle:hs,onCreate:_,onDelete:te})}),e[182]=_,e[183]=te,e[184]=k,e[185]=sn,e[186]=P,e[187]=rn):rn=e[187];let on;e[188]!==nn||e[189]!==rn||e[190]!==ne?(on=d.jsxs(Qn,{open:ne,onOpenChange:J,modal:!0,children:[nn,rn]}),e[188]=nn,e[189]=rn,e[190]=ne,e[191]=on):on=e[191];let an;e[192]!==Ie||e[193]!==vt||e[194]!==xt||e[195]!==tn||e[196]!==on?(an=d.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[Ie,vt,xt,tn,on]}),e[192]=Ie,e[193]=vt,e[194]=xt,e[195]=tn,e[196]=on,e[197]=an):an=e[197];let ln;e[198]!==xe||e[199]!==an?(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:[xe,an]}),e[198]=xe,e[199]=an,e[200]=ln):ln=e[200];let cn;e[201]!==de||e[202]!==ln?(cn=d.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",children:[de,ln]}),e[201]=de,e[202]=ln,e[203]=cn):cn=e[203];let dn;e[204]!==s||e[205]!==a||e[206]!==u?(dn=s&&a?d.jsx(Xe,{variant:"ghost",size:"icon","aria-label":u("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:a,children:d.jsx(so,{size:16})}):d.jsx("span",{}),e[204]=s,e[205]=a,e[206]=u,e[207]=dn):dn=e[207];let un;e[208]!==s||e[209]!==c||e[210]!==u?(un=s&&c&&d.jsxs(Xe,{variant:"outline",size:"sm",onClick:c,children:[d.jsx(oo,{size:16}),u("taskBoard.taskDialog.newChatButton")]}),e[208]=s,e[209]=c,e[210]=u,e[211]=un):un=e[211];let fn;e[212]!==f||e[213]!==j?(fn=!j.trim()||f,e[212]=f,e[213]=j,e[214]=fn):fn=e[214];let hn;e[215]!==s?(hn=s?null:d.jsx(Jn,{size:16}),e[215]=s,e[216]=hn):hn=e[216];let pn;e[217]!==s||e[218]!==u?(pn=u(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton"),e[217]=s,e[218]=u,e[219]=pn):pn=e[219];let gn;e[220]!==je||e[221]!==fn||e[222]!==hn||e[223]!==pn?(gn=d.jsxs(Xe,{size:"sm",disabled:fn,onClick:je,children:[hn,pn]}),e[220]=je,e[221]=fn,e[222]=hn,e[223]=pn,e[224]=gn):gn=e[224];let mn;e[225]!==un||e[226]!==gn?(mn=d.jsxs("div",{className:"flex items-center gap-2",children:[un,gn]}),e[225]=un,e[226]=gn,e[227]=mn):mn=e[227];let xn;e[228]!==dn||e[229]!==mn?(xn=d.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[dn,mn]}),e[228]=dn,e[229]=mn,e[230]=xn):xn=e[230];let bn;e[231]!==Le||e[232]!==Ke||e[233]!==cn||e[234]!==xn?(bn=d.jsxs(jr,{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:[Le,Ke,cn,xn]}),e[231]=Le,e[232]=Ke,e[233]=cn,e[234]=xn,e[235]=bn):bn=e[235];let ps;return e[236]!==n||e[237]!==be||e[238]!==bn?(ps=d.jsx(Dr,{open:n,onOpenChange:be,children:bn}),e[236]=n,e[237]=be,e[238]=bn,e[239]=ps):ps=e[239],ps}function zh(t){t.key==="Enter"&&t.preventDefault()}function Lh(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function Ph(t){return t.id}function Fh(t){return t.id}function Uh(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:nl};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:Sr};case"in_progress":return{label:e("taskBoard.taskDialog.threadStatusRunning"),className:"text-primary",icon:ss,spin:!0};case"completed":return{label:e("taskBoard.taskDialog.threadStatusCompleted"),className:"text-success",icon:_n};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:Ls};default:return t}}function qh(t){const e=L.c(31),{thread:n,startedBy:r,onOpen:s}=t,i=ce();let o;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const a=n.status?Uh(n.status,i):null,l=n.lastMessage;let c;e[5]!==n.title?(c=ai(n.title,"qa"),e[5]=n.title,e[6]=c):c=e[6];const f=c;let u;e[7]!==n.title?(u=ai(n.title,"code_review"),e[7]=n.title,e[8]=u):u=e[8];const h=u;let p;e[9]!==s||e[10]!==n?(p=()=>s?.(n),e[9]=s,e[10]=n,e[11]=p):p=e[11];let m;e[12]!==h||e[13]!==f?(m=f?d.jsx(ia,{size:16,className:"shrink-0"}):h?d.jsx(oa,{size:16,className:"shrink-0"}):d.jsx(Ot,{size:16,className:"shrink-0"}),e[12]=h,e[13]=f,e[14]=m):m=e[14];let y;e[15]!==i||e[16]!==n.title?(y=n.title||i("taskBoard.taskDialog.superAgentDefaultName"),e[15]=i,e[16]=n.title,e[17]=y):y=e[17];let x;e[18]!==y?(x=d.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y}),e[18]=y,e[19]=x):x=e[19];let g;e[20]!==r||e[21]!==i?(g=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(Nt,{url:r.user?.image??void 0,fallback:Dt(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[20]=r,e[21]=i,e[22]=g):g=e[22];let b;e[23]!==s||e[24]!==i?(b=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(wo,{size:14})]}),e[23]=s,e[24]=i,e[25]=b):b=e[25];let k;e[26]!==m||e[27]!==x||e[28]!==g||e[29]!==b?(k=d.jsxs("div",{className:"flex items-center gap-2",children:[m,x,g,b]}),e[26]=m,e[27]=x,e[28]=g,e[29]=b,e[30]=k):k=e[30],o=d.jsxs("button",{type:"button",disabled:!s,onClick:p,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:[k,a&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("span",{className:Z("flex shrink-0 items-center gap-1.5",a.className),children:[d.jsx(a.icon,{size:15,className:Z(a.spin&&"animate-spin")}),d.jsx("span",{className:"text-sm",children:a.label})]}),l&&d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:l})]})]}),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=o}else o=e[4];return o}function Hh(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:tl}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:Zs}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:Zs}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:Zs}}function Kh(t,e){switch(t){case"passing":return{label:e("taskBoard.taskDialog.prChecksPassing"),className:"text-success",icon:_n};case"failing":return{label:e("taskBoard.taskDialog.prChecksFailing"),className:"text-destructive",icon:Ls};case"pending":return{label:e("taskBoard.taskDialog.prChecksPending"),className:"text-warning",icon:ss};default:return null}}const Wh=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);function Vh(t){if(t.status!=="completed")return{icon:ss,className:"text-warning",spin:!0};const e=t.conclusion;return e&&Wh.has(e)?{icon:Ls,className:"text-destructive",spin:!1}:e==="success"||e==="neutral"||e==="skipped"?{icon:_n,className:"text-success",spin:!1}:{icon:Sr,className:"text-muted-foreground",spin:!1}}function Gh(t){const e=L.c(37),{pr:n,previewThread:r,reviewsReady:s,shipPending:i,onShip:o,onOpenThread:a}=t,l=ce(),[c,f]=v.useState(!1);let u;if(e[0]!==c||e[1]!==a||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==l){const h=Hh(n,l),p=Kh(n.checksStatus,l),m=n.state==="open"&&!n.merged,y=n.checksStatus!=="failing"&&n.checksStatus!=="pending",x=s&&m&&y,g=!!r||!!n.previewUrl||x;let b;e[9]!==n.checks?(b=n.checks??[],e[9]=n.checks,e[10]=b):b=e[10];const k=b,w=k.length>0||p!=null,C=k.length>0;let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=d.jsx(ar,{className:"size-4 shrink-0 text-foreground"}),e[11]=j):j=e[11];const S=n.title??`${n.repoOwner}/${n.repoName}`;let T;e[12]!==S?(T=d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:S}),e[12]=S,e[13]=T):T=e[13];const N=Z("flex shrink-0 items-center gap-1 text-xs font-medium",h.className);let R;e[14]!==h?(R=d.jsx(h.icon,{size:13}),e[14]=h,e[15]=R):R=e[15];let D;e[16]!==h||e[17]!==N||e[18]!==R?(D=d.jsxs("span",{className:N,children:[R,h.label]}),e[16]=h,e[17]=N,e[18]=R,e[19]=D):D=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=d.jsx(Ss,{size:12,className:"text-muted-foreground/60 group-hover:text-foreground"}),e[20]=E):E=e[20];let M;e[21]!==n.number||e[22]!==n.url?(M=d.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",title:n.url,className:"group flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted",children:["#",n.number,E]}),e[21]=n.number,e[22]=n.url,e[23]=M):M=e[23];let A;e[24]!==M||e[25]!==T||e[26]!==D?(A=d.jsxs("div",{className:"flex items-center gap-3",children:[j,T,D,M]}),e[24]=M,e[25]=T,e[26]=D,e[27]=A):A=e[27];let U;e[28]!==g||e[29]!==a||e[30]!==o||e[31]!==n.previewUrl||e[32]!==r||e[33]!==i||e[34]!==x||e[35]!==l?(U=g&&d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&d.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",title:l("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>a?.(r),children:[d.jsx(oo,{size:13}),l("taskBoard.taskDialog.openPreviewButton")]}),n.previewUrl&&d.jsx(Xe,{asChild:!0,type:"button",variant:"outline",size:"sm",className:"gap-1.5",children:d.jsxs("a",{href:n.previewUrl,target:"_blank",rel:"noreferrer",children:[d.jsx(So,{size:14}),l("taskBoard.taskDialog.previewLabel"),d.jsx(Ss,{size:12})]})}),x&&d.jsx(Xe,{type:"button",variant:"success",size:"sm",disabled:i,onClick:o,children:l("taskBoard.taskDialog.shipToProductionButton")})]}),e[28]=g,e[29]=a,e[30]=o,e[31]=n.previewUrl,e[32]=r,e[33]=i,e[34]=x,e[35]=l,e[36]=U):U=e[36],u=d.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[A,U,w&&d.jsxs("div",{className:"border-t border-border pt-2 text-xs",children:[d.jsxs("button",{type:"button",disabled:!C,onClick:()=>f(Qh),className:"flex w-full items-center gap-1.5 font-medium disabled:cursor-default",children:[p?d.jsx(p.icon,{size:13,className:p.className}):d.jsx(_n,{size:13,className:"text-muted-foreground"}),d.jsx("span",{className:Z(p?.className??"text-muted-foreground"),children:p?.label??l("taskBoard.taskDialog.prChecksLabel")}),C&&d.jsx(wo,{size:14,className:Z("ml-auto text-muted-foreground/60 transition-transform",c&&"rotate-90")})]}),c&&d.jsx("div",{className:"mt-2 flex flex-col gap-2",children:k.map(I=>{const B=Vh(I);return d.jsxs("div",{className:"rounded-md bg-muted/40 p-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(B.icon,{size:13,className:Z("shrink-0",B.className,B.spin&&"animate-spin")}),d.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:I.name}),I.detailsUrl&&d.jsx("a",{href:I.detailsUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:d.jsx(Ss,{size:12})})]}),I.summary&&d.jsx("div",{className:"mt-1.5 max-h-64 overflow-auto text-muted-foreground",children:d.jsx(Ql,{id:`${n.url}-${I.name}`,text:I.summary})})]},I.name)})})]})]}),e[0]=c,e[1]=a,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=l,e[8]=u}else u=e[8];return u}function Qh(t){return!t}function Xh(){const t=L.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(yn,{className:"size-4 shrink-0 rounded"}),d.jsx(yn,{className:"h-4 min-w-0 flex-1"}),d.jsx(yn,{className:"h-4 w-16 shrink-0"}),d.jsx(yn,{className:"h-4 w-10 shrink-0"})]}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=d.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[e,d.jsxs("div",{className:"flex gap-2",children:[d.jsx(yn,{className:"h-7 w-20"}),d.jsx(yn,{className:"h-7 w-28"})]})]}),t[1]=n):n=t[1],n}function Yh(t){const e=L.c(36),{item:n,description:r,onOpenThread:s}=t,i=ce(),{data:o,isLoading:a}=Ih(n.id),{data:l}=Ra(n.id),c=li("qa_agent_enabled"),f=li("code_reviewer_enabled"),u=_h(n.id);let h,p;if(e[0]!==l||e[1]!==f||e[2]!==r||e[3]!==n.status||e[4]!==n.threads||e[5]!==s||e[6]!==u||e[7]!==o||e[8]!==a||e[9]!==c||e[10]!==i){p=Symbol.for("react.early_return_sentinel");e:{const m=$h(r),y=a&&!o;if(!y&&(!o||o.length===0)&&m.length===0){p=null;break e}let x;e[13]!==l||e[14]!==f||e[15]!==n.status||e[16]!==c?(x=n.status==="in_review"&&Bh(l??[],Ah({qa:c,codeReview:f})),e[13]=l,e[14]=f,e[15]=n.status,e[16]=c,e[17]=x):x=e[17];const g=x;let b;e[18]!==u||e[19]!==i?(b=()=>u.mutate(void 0,{onSuccess:N=>N?.merged?At.success(i("taskBoard.taskDialog.shipSuccess")):At.error(i("taskBoard.taskDialog.shipError")),onError:()=>At.error(i("taskBoard.taskDialog.shipError"))}),e[18]=u,e[19]=i,e[20]=b):b=e[20];const k=b;let w;e[21]!==n.threads||e[22]!==s?(w=s?n.threads.find(Jh):void 0,e[21]=n.threads,e[22]=s,e[23]=w):w=e[23];const C=w;let j;e[24]!==i?(j=i("taskBoard.taskDialog.linksLabel"),e[24]=i,e[25]=j):j=e[25];let S;e[26]!==j?(S=d.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:j}),e[26]=j,e[27]=S):S=e[27];let T;e[28]!==y||e[29]!==s||e[30]!==k||e[31]!==C||e[32]!==u||e[33]!==o||e[34]!==g?(T=y?d.jsx(Xh,{}):(o??[]).map(N=>d.jsx(Gh,{pr:N,previewThread:C,reviewsReady:g,shipPending:u.isPending,onShip:k,onOpenThread:s},N.url)),e[28]=y,e[29]=s,e[30]=k,e[31]=C,e[32]=u,e[33]=o,e[34]=g,e[35]=T):T=e[35],h=d.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[S,T,m.map(Zh)]})}e[0]=l,e[1]=f,e[2]=r,e[3]=n.status,e[4]=n.threads,e[5]=s,e[6]=u,e[7]=o,e[8]=a,e[9]=c,e[10]=i,e[11]=h,e[12]=p}else h=e[11],p=e[12];return p!==Symbol.for("react.early_return_sentinel")?p:h}function Zh(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(So,{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(Ss,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function Jh(t){return t.hasPreview&&t.virtualMcpId}function ep(t){const e=L.c(18),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=ce(),{data:a}=Ra(n.id);let l;e[0]!==r?(l=new Map(r.map(rp)),e[0]=r,e[1]=l):l=e[1];const c=l;let f,u;if(e[2]!==a||e[3]!==n.threads){u=Symbol.for("react.early_return_sentinel");e:{const x=[...(a??[]).map(sp),...n.threads.map(np)].sort(tp);if(x.length===0){u=null;break e}f=[];for(const g of x){if(g.kind==="thread"){f.push({type:"thread",thread:g.thread});continue}const b=f[f.length-1];b?.type==="timeline"?b.items.push(g.activity):f.push({type:"timeline",items:[g.activity]})}}e[2]=a,e[3]=n.threads,e[4]=f,e[5]=u}else f=e[4],u=e[5];if(u!==Symbol.for("react.early_return_sentinel"))return u;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]!==c||e[12]!==i||e[13]!==s?(m=f.map((x,g)=>x.type==="timeline"?d.jsx(op,{items:x.items,memberByUserId:c},`timeline-${g}`):d.jsx(qh,{thread:x.thread,startedBy:s,onOpen:i},`thread-${x.thread.threadId}`)),e[10]=f,e[11]=c,e[12]=i,e[13]=s,e[14]=m):m=e[14];let y;return e[15]!==p||e[16]!==m?(y=d.jsxs("div",{className:"flex flex-col gap-5 pb-2",children:[p,m]}),e[15]=p,e[16]=m,e[17]=y):y=e[17],y}function tp(t,e){return t.at-e.at}function np(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function sp(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function rp(t){return[t.userId,t]}function Wt(t){const e=L.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 Ms="\0";function ws(t){return`${Ms}${t}${Ms}`}function vn(t,e){return t.split(new RegExp(`${Ms}(\\w+)${Ms}`)).map((n,r)=>d.jsx(v.Fragment,{children:r%2===0?n:e[n]},r))}function Hn(t,e){return e(t==="code_review"?"taskBoard.taskDialog.codeReviewerLabel":"taskBoard.taskDialog.qaAgentLabel")}function ip(t,e,n){const r=h=>{const p=typeof h=="string"?yt[h]:void 0;if(!p)return String(h??"");const m=p.icon;return d.jsx(Wt,{icon:d.jsx(m,{size:14,className:p.iconClassName}),label:e(p.labelKey)})},s=h=>{const p=typeof h=="string"?kt[h]:void 0;return p?d.jsx(Wt,{icon:d.jsx("span",{className:Z("size-2 rounded-full",p.dotClassName)}),label:e(p.labelKey)}):String(h??"")},i=h=>{const p=kr(typeof h=="string"?h:null);return p?d.jsx(Wt,{icon:d.jsx(Sn,{size:14,className:"text-muted-foreground"}),label:Ia.format(p)}):""},o=h=>!Array.isArray(h)||h.length===0?null:h.map((p,m)=>{const y=p;return d.jsx(Wt,{icon:d.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:ls(y.color)}}),label:y.name??""},y.id??m)}),a=h=>{if(h===nt)return d.jsx(Wt,{icon:d.jsx(Ot,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const p=typeof h=="string"?n.get(h):void 0;return d.jsx(Wt,{icon:d.jsx(Nt,{url:p?.user?.image??void 0,fallback:Dt(p?.user?.name),shape:"circle",size:"2xs"}),label:p?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},l=h=>d.jsx(Wt,{icon:h==="code_review"?d.jsx(oa,{size:14}):d.jsx(ia,{size:14}),label:Hn(h,e)}),c=t.data,f=ws("from"),u=ws("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return vn(c.from?e("taskBoard.taskDialog.activityMovedFromTo",{from:f,to:u}):e("taskBoard.taskDialog.activityMovedTo",{to:u}),{from:r(c.from),to:r(c.to)});case"assignee_changed":return c.to==null?e("taskBoard.taskDialog.activityUnassigned"):vn(e(c.to===nt?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:ws("name")}),{name:a(c.to)});case"priority_changed":return c.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):vn(!c.from||c.from==="none"?e("taskBoard.taskDialog.activityPrioritySet",{to:u}):e("taskBoard.taskDialog.activityPriorityFromTo",{from:f,to:u}),{from:s(c.from),to:s(c.to)});case"due_date_changed":return c.to==null?e("taskBoard.taskDialog.activityDueDateCleared"):vn(c.from==null?e("taskBoard.taskDialog.activityDueDateSet",{to:u}):e("taskBoard.taskDialog.activityDueDateFromTo",{from:f,to:u}),{from:i(c.from),to:i(c.to)});case"title_changed":return e("taskBoard.taskDialog.activityRenamed",{to:String(c.to??"")});case"description_changed":return e("taskBoard.taskDialog.activityDescriptionUpdated");case"tags_changed":return!Array.isArray(c.to)||c.to.length===0?e("taskBoard.taskDialog.activityTagsCleared"):vn(e("taskBoard.taskDialog.activityTagsSet",{to:u}),{to:o(c.to)});case"review_requested":return vn(e("taskBoard.taskDialog.activityDelegated",{name:ws("name")}),{name:l(c.reviewer)});case"review_approved":return typeof c.notes=="string"&&c.notes.trim()?e("taskBoard.taskDialog.activityReviewApprovedWithNotes",{reviewer:Hn(c.reviewer,e),notes:c.notes}):e("taskBoard.taskDialog.activityReviewApproved",{reviewer:Hn(c.reviewer,e)});case"review_changes_requested":return typeof c.notes=="string"&&c.notes.trim()?e("taskBoard.taskDialog.activityReviewChangesRequestedWithNotes",{reviewer:Hn(c.reviewer,e),notes:c.notes}):e("taskBoard.taskDialog.activityReviewChangesRequested",{reviewer:Hn(c.reviewer,e)});case"merge_conflict_resolution":return e("taskBoard.taskDialog.activityMergeConflictResolution");default:{const h=t.action;return String(h)}}}function Pi(t){return!t||t===nt}function op(t){const e=L.c(21),{items:n,memberByUserId:r}=t,s=ce();let i;e[0]!==r||e[1]!==s?(i=h=>Pi(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 a;e[3]!==r?(a=h=>{if(Pi(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(Nt,{url:p?.user?.image??void 0,fallback:Dt(p?.user?.name),shape:"circle",size:"2xs"})})},e[3]=r,e[4]=a):a=e[4];const l=a;let c;e[5]!==n.length?(c=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]=c):c=e[6];let f;if(e[7]!==l||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==s){let h;e[13]!==l||e[14]!==o||e[15]!==r||e[16]!==s?(h=p=>d.jsxs("div",{className:"relative flex items-center gap-2.5",children:[l(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)})," ",ip(p,s,r),d.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",fo(new Date(p.occurredAt))]})]})]},p.id),e[13]=l,e[14]=o,e[15]=r,e[16]=s,e[17]=h):h=e[17],f=n.map(h),e[7]=l,e[8]=o,e[9]=n,e[10]=r,e[11]=s,e[12]=f}else f=e[12];let u;return e[18]!==c||e[19]!==f?(u=d.jsxs("div",{className:"relative flex flex-col gap-4",children:[c,f]}),e[18]=c,e[19]=f,e[20]=u):u=e[20],u}const Fi=380,ap=90,Ui=5,lp="cubic-bezier(0.22, 0.61, 0.36, 1)";function cp(t,e,n){const r=v.useRef(new Map),s=v.useRef(new Map);v.useLayoutEffect(()=>{const i=t.current;if(!i)return;const o=i.querySelectorAll("[data-flip-id]"),a=new Map,l=r.current;r.current=a;const c=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,f=[];for(const g of o){const b=g.dataset.flipId;if(!b)continue;const k=g.getBoundingClientRect(),w=g.dataset.flipLane;if(a.set(b,{rect:k,lane:w}),!n)continue;const C=l.get(b);if(!C)continue;const j=C.rect.left-k.left,S=C.rect.top-k.top;(j||S)&&f.push({el:g,dx:j,dy:S,lane:C.lane!==w})}if(!n||c||f.length===0)return;const u=s.current,h=g=>{g instanceof HTMLElement&&(u.set(g,(u.get(g)??0)+1),g.style.overflow="visible")},p=g=>{if(!(g instanceof HTMLElement))return;const b=(u.get(g)??1)-1;if(b>0){u.set(g,b);return}u.delete(g),g.style.overflow=""};for(const g of f){const b=g.lane?` rotate(${g.dx>0?Ui:-Ui}deg)`:"";g.el.style.transition="none",g.el.style.transform=`translate(${g.dx}px, ${g.dy}px)${b}`,g.lane&&(g.el.style.zIndex="10",h(g.el.closest("[data-lane-scroll]")))}let m=0;const y=[],x=requestAnimationFrame(()=>{for(const g of f){const b=g.lane?m++*ap:0;g.el.style.transition=`transform ${Fi}ms ${lp} ${b}ms`,g.el.style.transform="",y.push(window.setTimeout(()=>{g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&p(g.el.closest("[data-lane-scroll]"))},Fi+b+30))}});return()=>{cancelAnimationFrame(x);for(const g of y)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 dp(t,e=[]){const n=[[`# Task: ${t.title}`,t.description?.trim()].filter(Boolean).join(`
72
72
 
73
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
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
75
  `))}return n.join(`
76
76
 
77
- `)}const vr="__unassigned__",zs={assignee:null,priority:null,due:null};function up(t){return t.assignee!==null||t.priority!==null||t.due!==null}function fp(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const hp=864e5;function pp(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 gp(t,e){if(e.assignee!==null){if(e.assignee===vr){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"&&!pp(n,r)||e.due==="week"&&(n<r||n>r+7*hp))return!1}return!0}const qi={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Qs(t,e=!1){return Z("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 mp(t){const e=L.c(95),{value:n,members:r,onChange:s,block:i}=t,o=ce(),[a,l]=v.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(lr,{size:14,className:"shrink-0"}),e[0]=c):c=e[0];let f=c,u;e[1]!==o?(u=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=u):u=e[2];let h=u;if(n===vr){let $;e[3]!==o?($=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=$):$=e[4],h=$}else if(n===nt){let $;e[5]===Symbol.for("react.memo_cache_sentinel")?($=d.jsx(Ot,{size:14}),e[5]=$):$=e[5],f=$;let F;e[6]!==o?(F=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=F):F=e[7],h=F}else if(n){let $,F,X,re;if(e[8]!==r||e[9]!==n){let te;e[14]!==n?(te=le=>le.userId===n,e[14]=n,e[15]=te):te=e[15],F=r.find(te),$=Nt,X=F?.user?.image??void 0,re=Dt(F?.user?.name),e[8]=r,e[9]=n,e[10]=$,e[11]=F,e[12]=X,e[13]=re}else $=e[10],F=e[11],X=e[12],re=e[13];let _;e[16]!==$||e[17]!==X||e[18]!==re?(_=d.jsx($,{url:X,fallback:re,shape:"circle",size:"2xs"}),e[16]=$,e[17]=X,e[18]=re,e[19]=_):_=e[19],f=_;let V;e[20]!==F?.user?.name||e[21]!==o?(V=F?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=F?.user?.name,e[21]=o,e[22]=V):V=e[22],h=V}let p;e[23]!==s?(p=$=>{s($),l(!1)},e[23]=s,e[24]=p):p=e[24];const m=p,y=n!==null;let x;e[25]!==i||e[26]!==y?(x=Qs(y,i),e[25]=i,e[26]=y,e[27]=x):x=e[27];const g=x,b=i&&"ml-auto";let k;e[28]!==b?(k=Z("shrink-0 opacity-60",b),e[28]=b,e[29]=k):k=e[29];const w=k;let S;e[30]!==h?(S=d.jsx("span",{className:"max-w-[10rem] truncate",children:h}),e[30]=h,e[31]=S):S=e[31];let j;e[32]!==w?(j=d.jsx(Br,{size:12,className:w}),e[32]=w,e[33]=j):j=e[33];let C;e[34]!==f||e[35]!==S||e[36]!==j||e[37]!==g?(C=d.jsx(wn,{asChild:!0,children:d.jsxs("button",{type:"button",className:g,children:[f,S,j]})}),e[34]=f,e[35]=S,e[36]=j,e[37]=g,e[38]=C):C=e[38];let T;e[39]!==o?(T=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=T):T=e[40];let N;e[41]!==T?(N=d.jsx(Er,{placeholder:T,className:"h-9"}),e[41]=T,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(Ir,{children:R}),e[45]=R,e[46]=D):D=e[46];let E;e[47]!==m?(E=()=>m(null),e[47]=m,e[48]=E):E=e[48];let M;e[49]!==o?(M=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=M):M=e[50];let A;e[51]!==E||e[52]!==M?(A=d.jsx(Pt,{value:"Anyone",onSelect:E,children:M}),e[51]=E,e[52]=M,e[53]=A):A=e[53];let U;e[54]!==m?(U=()=>m(vr),e[54]=m,e[55]=U):U=e[55];let I;e[56]===Symbol.for("react.memo_cache_sentinel")?(I=d.jsx(lr,{size:16,className:"text-muted-foreground"}),e[56]=I):I=e[56];let B;e[57]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=B):B=e[58];let O;e[59]!==U||e[60]!==B?(O=d.jsxs(Pt,{value:"Unassigned",onSelect:U,className:"gap-2",children:[I,B]}),e[59]=U,e[60]=B,e[61]=O):O=e[61];let K;e[62]!==m?(K=()=>m(nt),e[62]=m,e[63]=K):K=e[63];let Y;e[64]===Symbol.for("react.memo_cache_sentinel")?(Y=d.jsx(Ot,{size:16}),e[64]=Y):Y=e[64];let P;e[65]!==o?(P=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=P):P=e[66];let q;e[67]!==K||e[68]!==P?(q=d.jsxs(Pt,{value:"Super Agent",onSelect:K,className:"gap-2",children:[Y,P]}),e[67]=K,e[68]=P,e[69]=q):q=e[69];let Q;e[70]!==A||e[71]!==O||e[72]!==q?(Q=d.jsxs(Rn,{children:[A,O,q]}),e[70]=A,e[71]=O,e[72]=q,e[73]=Q):Q=e[73];let G;e[74]!==o?(G=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=G):G=e[75];let ee;if(e[76]!==r||e[77]!==m){let $;e[79]!==m?($=F=>d.jsxs(Pt,{value:F.user?.name??F.userId,onSelect:()=>m(F.userId),className:"gap-2",children:[d.jsx(Nt,{url:F.user?.image??void 0,fallback:Dt(F.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:F.user?.name??F.userId})]},F.userId),e[79]=m,e[80]=$):$=e[80],ee=r.map($),e[76]=r,e[77]=m,e[78]=ee}else ee=e[78];let W;e[81]!==G||e[82]!==ee?(W=d.jsx(Rn,{heading:G,children:ee}),e[81]=G,e[82]=ee,e[83]=W):W=e[83];let ne;e[84]!==D||e[85]!==Q||e[86]!==W?(ne=d.jsxs(_r,{children:[D,Q,W]}),e[84]=D,e[85]=Q,e[86]=W,e[87]=ne):ne=e[87];let J;e[88]!==N||e[89]!==ne?(J=d.jsx(Gn,{align:"start",className:"w-56 p-0",children:d.jsxs(Ar,{children:[N,ne]})}),e[88]=N,e[89]=ne,e[90]=J):J=e[90];let se;return e[91]!==a||e[92]!==C||e[93]!==J?(se=d.jsxs(Qn,{open:a,onOpenChange:l,children:[C,J]}),e[91]=a,e[92]=C,e[93]=J,e[94]=se):se=e[94],se}function xp(t){const e=L.c(33),{value:n,onChange:r,block:s}=t,i=ce(),o=n!==null;let a;e[0]!==s||e[1]!==o?(a=Qs(o,s),e[0]=s,e[1]=o,e[2]=a):a=e[2];const l=a,c=s&&"ml-auto";let f;e[3]!==c?(f=Z("shrink-0 opacity-60",c),e[3]=c,e[4]=f):f=e[4];const u=f;let h;e[5]!==n?(h=n?d.jsx("span",{className:Z("size-2 shrink-0 rounded-full",kt[n].dotClassName)}):d.jsx(ac,{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?kt[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=n,e[9]=p):p=e[9];let m;e[10]!==u?(m=d.jsx(Br,{size:12,className:u}),e[10]=u,e[11]=m):m=e[11];let y;e[12]!==h||e[13]!==p||e[14]!==m||e[15]!==l?(y=d.jsx(jn,{asChild:!0,children:d.jsxs("button",{type:"button",className:l,children:[h,p,m]})}),e[12]=h,e[13]=p,e[14]=m,e[15]=l,e[16]=y):y=e[16];let x;e[17]!==r?(x=()=>r(null),e[17]=r,e[18]=x):x=e[18];let g;e[19]!==i?(g=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=g):g=e[20];let b;e[21]!==g||e[22]!==x?(b=d.jsx(jt,{onSelect:x,children:g}),e[21]=g,e[22]=x,e[23]=b):b=e[23];let k;e[24]!==r||e[25]!==i?(k=Kr.map(j=>d.jsxs(jt,{onSelect:()=>r(j),className:"gap-2",children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[j].dotClassName)}),i(kt[j].labelKey)]},j)),e[24]=r,e[25]=i,e[26]=k):k=e[26];let w;e[27]!==b||e[28]!==k?(w=d.jsxs(Dn,{align:"start",className:"w-40",children:[b,k]}),e[27]=b,e[28]=k,e[29]=w):w=e[29];let S;return e[30]!==w||e[31]!==y?(S=d.jsxs(Nn,{children:[y,w]}),e[30]=w,e[31]=y,e[32]=S):S=e[32],S}function bp(t){const e=L.c(35),{value:n,onChange:r,block:s}=t,i=ce();let o;e[0]!==i||e[1]!==n?(o=n?i(qi[n]):void 0,e[0]=i,e[1]=n,e[2]=o):o=e[2];const a=o,l=n!==null;let c;e[3]!==s||e[4]!==l?(c=Qs(l,s),e[3]=s,e[4]=l,e[5]=c):c=e[5];const f=c,u=s&&"ml-auto";let h;e[6]!==u?(h=Z("shrink-0 opacity-60",u),e[6]=u,e[7]=h):h=e[7];const p=h;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=d.jsx(Sn,{size:14,className:"shrink-0"}),e[8]=m):m=e[8];let y;e[9]!==a||e[10]!==i?(y=a??i("taskBoard.taskFilters.dueDateLabel"),e[9]=a,e[10]=i,e[11]=y):y=e[11];let x;e[12]!==p?(x=d.jsx(Br,{size:12,className:p}),e[12]=p,e[13]=x):x=e[13];let g;e[14]!==y||e[15]!==x||e[16]!==f?(g=d.jsx(jn,{asChild:!0,children:d.jsxs("button",{type:"button",className:f,children:[m,y,x]})}),e[14]=y,e[15]=x,e[16]=f,e[17]=g):g=e[17];let b;e[18]!==r?(b=()=>r(null),e[18]=r,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=d.jsx(Sn,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let w;e[21]!==i?(w=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=w):w=e[22];let S;e[23]!==b||e[24]!==w?(S=d.jsxs(jt,{onSelect:b,className:"gap-2",children:[k,w]}),e[23]=b,e[24]=w,e[25]=S):S=e[25];let j;e[26]!==r||e[27]!==i?(j=Object.entries(qi).map(N=>{const[R,D]=N,E=R==="overdue";return d.jsxs(jt,{onSelect:()=>r(R),className:Z("gap-2",E&&"text-destructive"),children:[d.jsx(Sn,{size:16,className:Z("shrink-0",E?"text-destructive":"text-muted-foreground")}),i(D)]},R)}),e[26]=r,e[27]=i,e[28]=j):j=e[28];let C;e[29]!==S||e[30]!==j?(C=d.jsxs(Dn,{align:"start",className:"w-44",children:[S,j]}),e[29]=S,e[30]=j,e[31]=C):C=e[31];let T;return e[32]!==C||e[33]!==g?(T=d.jsxs(Nn,{children:[g,C]}),e[32]=C,e[33]=g,e[34]=T):T=e[34],T}function _a(t){const e=L.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 a;e[3]!==i||e[4]!==n.assignee||e[5]!==r||e[6]!==o?(a=d.jsx(mp,{block:i,value:n.assignee,members:r,onChange:o}),e[3]=i,e[4]=n.assignee,e[5]=r,e[6]=o,e[7]=a):a=e[7];let l;e[8]!==n||e[9]!==s?(l=p=>s({...n,priority:p}),e[8]=n,e[9]=s,e[10]=l):l=e[10];let c;e[11]!==i||e[12]!==n.priority||e[13]!==l?(c=d.jsx(xp,{block:i,value:n.priority,onChange:l}),e[11]=i,e[12]=n.priority,e[13]=l,e[14]=c):c=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 u;e[18]!==i||e[19]!==n.due||e[20]!==f?(u=d.jsx(bp,{block:i,value:n.due,onChange:f}),e[18]=i,e[19]=n.due,e[20]=f,e[21]=u):u=e[21];let h;return e[22]!==a||e[23]!==c||e[24]!==u?(h=d.jsxs(d.Fragment,{children:[a,c,u]}),e[22]=a,e[23]=c,e[24]=u,e[25]=h):h=e[25],h}function yp(t){const e=L.c(12),{filters:n,members:r,onChange:s}=t,i=ce();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=d.jsx(Do,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let a;e[1]!==n||e[2]!==r||e[3]!==s?(a=d.jsx(_a,{filters:n,members:r,onChange:s}),e[1]=n,e[2]=r,e[3]=s,e[4]=a):a=e[4];let l;e[5]!==n||e[6]!==s||e[7]!==i?(l=up(n)&&d.jsx("button",{type:"button",onClick:()=>s(zs),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]=l):l=e[8];let c;return e[9]!==a||e[10]!==l?(c=d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,a,l]}),e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function kp(t){const e=L.c(38),{filters:n,members:r,onChange:s}=t,i=ce(),[o,a]=v.useState(!1),l=fp(n),c=l>0;let f;e[0]!==c?(f=Qs(c),e[0]=c,e[1]=f):f=e[1];const u=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=d.jsx(Do,{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]!==l?(m=l>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:l}),e[5]=l,e[6]=m):m=e[6];let y;e[7]!==p||e[8]!==m||e[9]!==u?(y=d.jsx(tc,{asChild:!0,children:d.jsxs("button",{type:"button",className:u,children:[h,p,m]})}),e[7]=p,e[8]=m,e[9]=u,e[10]=y):y=e[10];let x;e[11]!==i?(x=i("taskBoard.taskFilters.filterDrawerTitle"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==x?(g=d.jsx(nc,{className:"px-4 pt-4 text-base font-medium text-foreground",children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==n||e[16]!==r||e[17]!==s?(b=d.jsx("div",{className:"flex flex-col gap-2 p-4",children:d.jsx(_a,{block:!0,filters:n,members:r,onChange:s})}),e[15]=n,e[16]=r,e[17]=s,e[18]=b):b=e[18];let k;e[19]!==l||e[20]!==s||e[21]!==i?(k=l>0&&d.jsx(Xe,{variant:"outline",className:"flex-1",onClick:()=>s(zs),children:i("taskBoard.taskFilters.clearAllButton")}),e[19]=l,e[20]=s,e[21]=i,e[22]=k):k=e[22];let w;e[23]!==i?(w=i("taskBoard.taskFilters.doneButton"),e[23]=i,e[24]=w):w=e[24];let S;e[25]!==w?(S=d.jsx(sc,{asChild:!0,children:d.jsx(Xe,{className:"flex-1",children:w})}),e[25]=w,e[26]=S):S=e[26];let j;e[27]!==k||e[28]!==S?(j=d.jsxs(rc,{className:"flex-row gap-2",children:[k,S]}),e[27]=k,e[28]=S,e[29]=j):j=e[29];let C;e[30]!==j||e[31]!==g||e[32]!==b?(C=d.jsxs(ic,{className:"p-0",children:[g,b,j]}),e[30]=j,e[31]=g,e[32]=b,e[33]=C):C=e[33];let T;return e[34]!==o||e[35]!==C||e[36]!==y?(T=d.jsxs(oc,{open:o,onOpenChange:a,direction:"bottom",children:[y,C]}),e[34]=o,e[35]=C,e[36]=y,e[37]=T):T=e[37],T}const vp="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",wp=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],Hi={price:"R$ 99",anchor:"R$ 499"};function Sp(t){const e=L.c(21),{onOpen:n}=t,r=ce();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(Cr,{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 a;e[5]!==r?(a=r("taskBoard.backlogPaywall.bannerSubtitle"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==a?(l=d.jsx("span",{className:"text-sm text-muted-foreground",children:a}),e[7]=a,e[8]=l):l=e[8];let c;e[9]!==o||e[10]!==l?(c=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,l]})]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let f;e[12]!==r?(f=r("taskBoard.backlogPaywall.unlockButton"),e[12]=r,e[13]=f):f=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(To,{size:16}),e[14]=u):u=e[14];let h;e[15]!==n||e[16]!==f?(h=d.jsxs(Xe,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:[f,u]}),e[15]=n,e[16]=f,e[17]=h):h=e[17];let p;return e[18]!==c||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:[c,h]}),e[18]=c,e[19]=h,e[20]=p):p=e[20],p}function Cp({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=ce(),[i,o]=v.useState(!1),a=async()=>{if(!n){r();return}o(!0);try{const l=await n.callTool({name:"start_checkout",arguments:{}}),{url:c}=cr(l);if(new URL(c).protocol!=="https:")throw new Error("unsafe checkout url");window.open(c,"_blank","noopener,noreferrer"),e(!1)}catch{r()}finally{o(!1)}};return d.jsx(Dr,{open:t,onOpenChange:e,children:d.jsxs(jr,{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:vp,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(Tr,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),d.jsx("ul",{className:"flex flex-col gap-3.5",children:wp.map(l=>d.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[d.jsx(_n,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),d.jsx("span",{className:"leading-snug text-foreground",children:s(l)})]},l))})]}),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:Hi.price}),d.jsx("span",{className:"text-sm text-muted-foreground line-through",children:Hi.anchor})]}),d.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[d.jsx(Xe,{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(Xe,{onClick:a,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?d.jsx(wr,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&d.jsx(To,{size:16})]})]})]})]})]})})}function or(t){return`board-paywall-seen:${t}`}function Tp(){const t=L.c(26),{org:e}=_e(),n=no(),{diagnostic:r,cdClient:s,connectionId:i}=Pc();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(or(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[a,l]=v.useState(o);let c;t[2]!==a.open||t[3]!==a.orgId||t[4]!==e.id?(c=a.orgId===e.id?a.open:!sessionStorage.getItem(or(e.id)),t[2]=a.open,t[3]=a.orgId,t[4]=e.id,t[5]=c):c=t[5];const f=c;if(!r?.locked)return null;let u;t[6]!==e.id?(u=w=>l({orgId:e.id,open:w}),t[6]=e.id,t[7]=u):u=t[7];const h=u;let p;t[8]!==e.id||t[9]!==h?(p=w=>{h(w),w||sessionStorage.setItem(or(e.id),"1")},t[8]=e.id,t[9]=h,t[10]=p):p=t[10];const m=p;let y;t[11]!==i||t[12]!==n||t[13]!==e?(y=()=>{ii("board_paywall_report_opened",{organization_id:e.id}),n(Uc(e,i))},t[11]=i,t[12]=n,t[13]=e,t[14]=y):y=t[14];const x=y;let g;t[15]!==e.id||t[16]!==h?(g=d.jsx(Sp,{onOpen:()=>{ii("board_paywall_banner_clicked",{organization_id:e.id}),h(!0)}}),t[15]=e.id,t[16]=h,t[17]=g):g=t[17];let b;t[18]!==s||t[19]!==m||t[20]!==f||t[21]!==x?(b=d.jsx(Cp,{open:f,onOpenChange:m,cdClient:s,onExpired:x}),t[18]=s,t[19]=m,t[20]=f,t[21]=x,t[22]=b):b=t[22];let k;return t[23]!==g||t[24]!==b?(k=d.jsxs(d.Fragment,{children:[g,b]}),t[23]=g,t[24]=b,t[25]=k):k=t[25],k}function jp(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsx(Ha,{fallback:null,children:d.jsx(Tp,{})}),t[0]=e):e=t[0],e}Wa(()=>import("./index-DFVpce2g.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 Dp(){const t=L.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(za,{})})})}),t[0]=e):e=t[0],e}const Np=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function Rp(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:Np.format(e),overdue:n}}const ds="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 Aa(){const t=L.c(9),e=ce();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Z(ds,"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(Sr,{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 Ba(t){const e=L.c(10),{priority:n}=t,r=ce(),s=kt[n];let i;e[0]!==s.dotClassName?(i=Z("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 a;e[4]!==s.labelKey||e[5]!==r?(a=r(s.labelKey),e[4]=s.labelKey,e[5]=r,e[6]=a):a=e[6];let l;return e[7]!==o||e[8]!==a?(l=d.jsxs("span",{className:ds,children:[o,a]}),e[7]=o,e[8]=a,e[9]=l):l=e[9],l}function Oa(t){const e=L.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:a,overdue:l}=Rp(n);r=a,s=Z(ds,l&&"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(Sn,{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 $a(t){const e=L.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=ls(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:ds,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function Ma(t){const e=L.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,a=ce(),[l,c]=v.useState(!1);if(n.assigneeId===nt){let b;e[0]!==s||e[1]!==a?(b=s?.user?.name?a("taskBoard.taskBoard.assignedToSuperAgentBy",{name:s.user.name}):a("taskBoard.taskBoard.assignedToSuperAgent"),e[0]=s,e[1]=a,e[2]=b):b=e[2];let k;e[3]!==s?(k=s&&d.jsx(Nt,{url:s.user?.image??void 0,fallback:Dt(s.user?.name),shape:"circle",size:"xs",className:"-mr-2 ring-2 ring-background"}),e[3]=s,e[4]=k):k=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=d.jsx(Ot,{size:20,className:"ring-2 ring-background"}),e[5]=w):w=e[5];let S;return e[6]!==b||e[7]!==k?(S=d.jsxs("span",{className:"inline-flex items-center",title:b,children:[k,w]}),e[6]=b,e[7]=k,e[8]=S):S=e[8],S}if(r){const b=r.user?.image??void 0,k=r.user?.name;let w;e[9]!==k?(w=Dt(k),e[9]=k,e[10]=w):w=e[10];let S;return e[11]!==b||e[12]!==w?(S=d.jsx(Nt,{url:b,fallback:w,shape:"circle",size:"xs"}),e[11]=b,e[12]=w,e[13]=S):S=e[13],S}if(!o||!i?.length)return null;let f;e[14]!==a?(f=a("taskBoard.taskBoard.assignButton"),e[14]=a,e[15]=f):f=e[15];let u;e[16]!==a?(u=a("taskBoard.taskBoard.assignButton"),e[16]=a,e[17]=u):u=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=b=>{b.stopPropagation(),c(!0)},e[18]=h):h=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx(io,{size:13}),e[19]=p):p=e[19];let m;e[20]!==f||e[21]!==u?(m=d.jsx(wn,{asChild:!0,children:d.jsx("button",{type:"button",title:f,"aria-label":u,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]=u,e[22]=m):m=e[22];let y;e[23]!==o?(y=b=>{o(b),c(!1)},e[23]=o,e[24]=y):y=e[24];let x;e[25]!==i||e[26]!==y?(x=d.jsx(Gn,{className:"w-56 p-0",align:"end",side:"bottom",onClick:Ep,children:d.jsx(ri,{members:i,onSelect:y})}),e[25]=i,e[26]=y,e[27]=x):x=e[27];let g;return e[28]!==l||e[29]!==m||e[30]!==x?(g=d.jsxs(Qn,{open:l,onOpenChange:c,children:[m,x]}),e[28]=l,e[29]=m,e[30]=x,e[31]=g):g=e[31],g}function Ep(t){return t.stopPropagation()}function za(){const t=L.c(126),e=ce(),{items:n,isLoading:r}=zu(),s=Lu(),i=ec(),o=bl({slug:"mcp-github"})??[];let a;t[0]!==o?(a=o.some(Op),t[0]=o,t[1]=a):a=t[1];const l=a,[c,f]=v.useState(!1),[u,h]=v.useState(!1);let p;t[2]!==l?(p=z=>z===nt&&!l?(f(!0),!0):!1,t[2]=l,t[3]=p):p=t[3];const m=p,{data:y}=uo();let x,g;t[4]!==y?.data?.members?(x=y?.data?.members??[],g=new Map(x.map(Bp)),t[4]=y?.data?.members,t[5]=x,t[6]=g):(x=t[5],g=t[6]);const b=g,[k,w]=v.useState("board"),[S,j]=v.useState(zs);let C;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=new Set,t[7]=C):C=t[7];const[T,N]=v.useState(C);let R;t[8]===Symbol.for("react.memo_cache_sentinel")?(R=z=>N(ie=>{const ke=new Set(ie);return ke.has(z)?ke.delete(z):ke.add(z),ke}),t[8]=R):R=t[8];const D=R,E=z=>N(ie=>{const ke=new Set(ie);for(const Ge of te)Ge.status===z&&ke.add(Ge.id);return ke});let M;t[9]===Symbol.for("react.memo_cache_sentinel")?(M=()=>N(new Set),t[9]=M):M=t[9];const A=M,[U,I]=v.useState(!1),[B,O]=v.useState(null),[K,Y]=v.useState(null),{setTaskId:P}=lc(),{create:q}=cc(),Q=In(),{org:G,locator:ee}=_e(),W=no();let ne;t[10]===Symbol.for("react.memo_cache_sentinel")?(ne={strict:!1},t[10]=ne):ne=t[10];const{task:J}=Ka(ne);let se;t[11]!==J||t[12]!==n?(se=J?n.find(z=>z.id===J)??null:null,t[11]=J,t[12]=n,t[13]=se):se=t[13];const $=se;let F;t[14]!==J||t[15]!==W||t[16]!==G?(F=()=>{J&&W({to:"/$org/board",params:{org:G.slug},search:{},replace:!0})},t[14]=J,t[15]=W,t[16]=G,t[17]=F):F=t[17];const X=F;let re;t[18]!==s||t[19]!==q||t[20]!==ee||t[21]!==G||t[22]!==P||t[23]!==Q?(re=async z=>{const ie=crypto.randomUUID(),ke=ul(G.id).id,Ge=await Q.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:z.id}).then(Ap).catch(_p),xt=dp(z,Ge),Kt={type:"doc",content:[{type:"paragraph",content:[Xl({id:z.id,name:z.title,char:"@",kind:"task",metadata:{title:z.title,description:z.description,context:xt}}),{type:"text",text:" "}]}]};hc(sessionStorage,ee,ie,Kt),I(!1);try{await q({id:ie,virtual_mcp_id:ke}),await s.link.mutateAsync({id:z.id,linkThreadId:ie})}catch{}P(ie,ke)},t[18]=s,t[19]=q,t[20]=ee,t[21]=G,t[22]=P,t[23]=Q,t[24]=re):re=t[24];const _=re;let V;t[25]!==S?(V=z=>gp(z,S),t[25]=S,t[26]=V):V=t[26];const te=n.filter(V);let le;t[27]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{O(null),Y(null),I(!0)},t[27]=le):le=t[27];const je=le;let pe;t[28]===Symbol.for("react.memo_cache_sentinel")?(pe=z=>{O(null),Y(z),I(!0)},t[28]=pe):pe=t[28];const De=pe;let fe;t[29]===Symbol.for("react.memo_cache_sentinel")?(fe=z=>{O(z),I(!0)},t[29]=fe):fe=t[29];const Ee=fe;let ct;t[30]!==$||t[31]!==B||t[32]!==n?(ct=(B&&n.find(z=>z.id===B.id))??B??$,t[30]=$,t[31]=B,t[32]=n,t[33]=ct):ct=t[33];const be=ct,ge=U||!!$;let Le;t[34]!==X?(Le=()=>{I(!1),O(null),Y(null),X()},t[34]=X,t[35]=Le):Le=t[35];const me=Le;if(r&&n.length===0){let z;return t[36]===Symbol.for("react.memo_cache_sentinel")?(z=d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(wr,{size:20,className:"animate-spin text-muted-foreground"})}),t[36]=z):z=t[36],z}const gt="relative flex min-h-0 flex-1 flex-col";let Ke;t[37]!==e?(Ke=e("taskBoard.taskBoard.tasksTitle"),t[37]=e,t[38]=Ke):Ke=t[38];let Ae;t[39]!==Ke?(Ae=d.jsx("h1",{className:"text-xl font-medium text-foreground",children:Ke}),t[39]=Ke,t[40]=Ae):Ae=t[40];let We;t[41]!==i?(We=i&&d.jsx(jp,{}),t[41]=i,t[42]=We):We=t[42];let Ze;t[43]!==S||t[44]!==n.length||t[45]!==x?(Ze=n.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"sm:hidden",children:d.jsx(kp,{filters:S,members:x,onChange:j})}),d.jsx("div",{className:"hidden sm:block",children:d.jsx(yp,{filters:S,members:x,onChange:j})})]}),t[43]=S,t[44]=n.length,t[45]=x,t[46]=Ze):Ze=t[46];const mt=k==="list";let Fe;t[47]!==A?(Fe=()=>{w("list"),A()},t[47]=A,t[48]=Fe):Fe=t[48];let Ve;t[49]!==e?(Ve=e("common.taskBoard.listView"),t[49]=e,t[50]=Ve):Ve=t[50];let Je;t[51]!==mt||t[52]!==Fe||t[53]!==Ve?(Je=d.jsx(Ki,{active:mt,onClick:Fe,icon:ao,label:Ve}),t[51]=mt,t[52]=Fe,t[53]=Ve,t[54]=Je):Je=t[54];const dt=k==="board";let ut;t[55]===Symbol.for("react.memo_cache_sentinel")?(ut=()=>w("board"),t[55]=ut):ut=t[55];let et;t[56]!==e?(et=e("common.taskBoard.boardView"),t[56]=e,t[57]=et):et=t[57];let tt;t[58]!==dt||t[59]!==et?(tt=d.jsx(Ki,{active:dt,onClick:ut,icon:sl,label:et}),t[58]=dt,t[59]=et,t[60]=tt):tt=t[60];let de;t[61]!==Je||t[62]!==tt?(de=d.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[Je,tt]}),t[61]=Je,t[62]=tt,t[63]=de):de=t[63];let we;t[64]===Symbol.for("react.memo_cache_sentinel")?(we=d.jsx(Jn,{size:16}),t[64]=we):we=t[64];let xe;t[65]!==e?(xe=e("taskBoard.taskBoard.newTask"),t[65]=e,t[66]=xe):xe=t[66];let Ne;t[67]!==xe?(Ne=d.jsxs(Xe,{size:"sm",onClick:je,children:[we,xe]}),t[67]=xe,t[68]=Ne):Ne=t[68];let ye;t[69]!==de||t[70]!==Ne?(ye=d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[de,Ne]}),t[69]=de,t[70]=Ne,t[71]=ye):ye=t[71];let Ce;t[72]!==Ze||t[73]!==ye?(Ce=d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ze,ye]}),t[72]=Ze,t[73]=ye,t[74]=Ce):Ce=t[74];let Te;t[75]!==Ae||t[76]!==We||t[77]!==Ce?(Te=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:[Ae,We,Ce]}),t[75]=Ae,t[76]=We,t[77]=Ce,t[78]=Te):Te=t[78];const Ue=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")})}):te.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(Xe,{variant:"outline",size:"sm",onClick:()=>j(zs),children:e("taskBoard.taskBoard.clearFilters")})]})}):k==="board"?d.jsx(zp,{items:te,members:x,memberByUserId:b,selectedIds:T,onToggleSelect:D,onSelectAllInLane:E,onOpen:Ee,onCreate:De,onMove:(z,ie,ke)=>{const Ge=sa(ke,z.length);z.forEach((xt,Kt)=>s.update.mutate({id:xt,status:ie,sortOrder:Ge[Kt]}))},onAssign:(z,ie)=>{m(ie)||s.update.mutate({id:z,assigneeId:ie})},onAutoFix:i?z=>{m(nt)||s.update.mutate({id:z.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:te.map(z=>d.jsx(Vp,{item:z,assignee:z.assigneeId?b.get(z.assigneeId):void 0,assignedBy:z.assignedBy?b.get(z.assignedBy):void 0,onOpen:()=>Ee(z)},z.id))})}),he=ge?be?.id??`new-${K??"default"}`:"closed",Be=be??void 0,Ie=K??void 0,qe=s.create.isPending||s.update.isPending;let Oe;t[79]!==s.create||t[80]!==s.update||t[81]!==be||t[82]!==m||t[83]!==me?(Oe=z=>{if(m(z.assigneeId)){me();return}be?s.update.mutate({id:be.id,...z}):s.create.mutate(z),me()},t[79]=s.create,t[80]=s.update,t[81]=be,t[82]=m,t[83]=me,t[84]=Oe):Oe=t[84];let $e;t[85]!==s.remove||t[86]!==be||t[87]!==me?($e=be?()=>{s.remove.mutate(be.id),me()}:void 0,t[85]=s.remove,t[86]=be,t[87]=me,t[88]=$e):$e=t[88];let Re;t[89]!==be||t[90]!==_?(Re=be?()=>{_(be)}:void 0,t[89]=be,t[90]=_,t[91]=Re):Re=t[91];let Me;t[92]!==me||t[93]!==P?(Me=z=>{z.virtualMcpId&&(me(),P(z.threadId,z.virtualMcpId,{main:z.hasPreview?"preview":"board"}))},t[92]=me,t[93]=P,t[94]=Me):Me=t[94];let He;t[95]!==me||t[96]!==ge||t[97]!==he||t[98]!==Be||t[99]!==Ie||t[100]!==qe||t[101]!==Oe||t[102]!==$e||t[103]!==Re||t[104]!==Me?(He=d.jsx(Mh,{open:ge,onClose:me,item:Be,defaultStatus:Ie,isSaving:qe,onSubmit:Oe,onDelete:$e,onNewChat:Re,onOpenThread:Me},he),t[95]=me,t[96]=ge,t[97]=he,t[98]=Be,t[99]=Ie,t[100]=qe,t[101]=Oe,t[102]=$e,t[103]=Re,t[104]=Me,t[105]=He):He=t[105];let vt;t[106]===Symbol.for("react.memo_cache_sentinel")?(vt=()=>h(!0),t[106]=vt):vt=t[106];let It;t[107]!==c?(It=d.jsx($p,{open:c,onOpenChange:f,onConnected:vt}),t[107]=c,t[108]=It):It=t[108];let ft;t[109]!==u?(ft=d.jsx(hl,{mode:"connection",open:u,onOpenChange:h}),t[109]=u,t[110]=ft):ft=t[110];let ht;t[111]!==s.remove||t[112]!==s.update||t[113]!==m||t[114]!==A||t[115]!==n||t[116]!==x||t[117]!==T?(ht=T.size>0&&d.jsx(Mp,{count:T.size,members:x,onMoveTo:z=>{for(const ie of T)s.update.mutate({id:ie,status:z});A()},onSetPriority:z=>{for(const ie of T)s.update.mutate({id:ie,priority:z});A()},onAddTag:z=>{for(const ie of T){const ke=n.find(xt=>xt.id===ie);if(!ke)continue;const Ge=ke.tags.map(Ip);Ge.includes(z)||s.update.mutate({id:ie,tagIds:[...Ge,z]})}A()},onAssign:z=>{if(!m(z)){for(const ie of T)s.update.mutate({id:ie,assigneeId:z});A()}},onSetDueDate:z=>{const ie=Ea(z);for(const ke of T)s.update.mutate({id:ke,dueDate:ie});A()},onAutoFix:T.size>0&&Array.from(T).every(z=>{const ie=n.find(ke=>ke.id===z);return ie&&(ie.status==="triage"||ie.status==="todo")&&ie.assigneeId!==nt})?()=>{if(!m(nt)){for(const z of T)s.update.mutate({id:z,assigneeId:nt});A()}}:void 0,onDelete:()=>{for(const z of T)s.remove.mutate(z);A()},onClear:A}),t[111]=s.remove,t[112]=s.update,t[113]=m,t[114]=A,t[115]=n,t[116]=x,t[117]=T,t[118]=ht):ht=t[118];let wt;return t[119]!==Te||t[120]!==Ue||t[121]!==He||t[122]!==It||t[123]!==ft||t[124]!==ht?(wt=d.jsxs("div",{className:gt,children:[Te,Ue,He,It,ft,ht]}),t[119]=Te,t[120]=Ue,t[121]=He,t[122]=It,t[123]=ft,t[124]=ht,t[125]=wt):wt=t[125],wt}function Ip(t){return t.id}function _p(){return[]}function Ap(t){return t.prs}function Bp(t){return[t.userId,t]}function Op(t){return t.status==="active"&&yl(t)!==null}function $p(t){const e=L.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=ce(),{connect:o,isConnecting:a}=bu("deco/mcp-github");let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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(ar,{className:"size-7"})})}),e[0]=l):l=e[0];let c;e[1]!==i?(c=i("taskBoard.taskBoard.connectGithubTitle"),e[1]=i,e[2]=c):c=e[2];let f;e[3]!==c?(f=d.jsx(Tr,{children:c}),e[3]=c,e[4]=f):f=e[4];let u;e[5]!==i?(u=i("taskBoard.taskBoard.connectGithubDescription"),e[5]=i,e[6]=u):u=e[6];let h;e[7]!==u?(h=d.jsx(pl,{children:u}),e[7]=u,e[8]=h):h=e[8];let p;e[9]!==f||e[10]!==h?(p=d.jsxs(gl,{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 y;e[16]!==a?(y=a?d.jsx(wr,{size:16,className:"animate-spin"}):d.jsx(ar,{className:"size-4"}),e[16]=a,e[17]=y):y=e[17];let x;e[18]!==i?(x=i("taskBoard.taskBoard.connectGithubButton"),e[18]=i,e[19]=x):x=e[19];let g;e[20]!==a||e[21]!==m||e[22]!==y||e[23]!==x?(g=d.jsx(ml,{children:d.jsxs(Xe,{onClick:m,disabled:a,className:"gap-2",children:[y,x]})}),e[20]=a,e[21]=m,e[22]=y,e[23]=x,e[24]=g):g=e[24];let b;e[25]!==g||e[26]!==p?(b=d.jsxs(jr,{className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[l,d.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[p,g]})]}),e[25]=g,e[26]=p,e[27]=b):b=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==b?(k=d.jsx(Dr,{open:n,onOpenChange:r,children:b}),e[28]=r,e[29]=n,e[30]=b,e[31]=k):k=e[31],k}function Mp(t){const e=L.c(91),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:a,onSetDueDate:l,onAutoFix:c,onDelete:f,onClear:u}=t,h=ce(),{data:p}=ho();let m;e[0]!==p?(m=p===void 0?[]:p,e[0]=p,e[1]=m):m=e[1];const y=m;let x;e[2]!==n||e[3]!==h?(x=h("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=h,e[4]=x):x=e[4];let g;e[5]!==x?(g=d.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:x}),e[5]=x,e[6]=g):g=e[6];let b;e[7]!==h?(b=h("taskBoard.taskBoard.actionsButton"),e[7]=h,e[8]=b):b=e[8];let k;e[9]!==b?(k=d.jsx(jn,{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:b})}),e[9]=b,e[10]=k):k=e[10];let w;e[11]!==h?(w=h("taskBoard.taskBoard.moveToButton"),e[11]=h,e[12]=w):w=e[12];let S;e[13]!==w?(S=d.jsx(Ln,{children:w}),e[13]=w,e[14]=S):S=e[14];let j;e[15]!==s||e[16]!==h?(j=As.map(_=>d.jsx(jt,{onClick:()=>s(_),children:h(yt[_].labelKey)},_)),e[15]=s,e[16]=h,e[17]=j):j=e[17];let C;e[18]!==j?(C=d.jsx(Pn,{children:j}),e[18]=j,e[19]=C):C=e[19];let T;e[20]!==C||e[21]!==S?(T=d.jsxs(zn,{children:[S,C]}),e[20]=C,e[21]=S,e[22]=T):T=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(Ln,{children:N}),e[25]=N,e[26]=R):R=e[26];let D;e[27]!==i||e[28]!==h?(D=Kr.map(_=>d.jsxs(jt,{onClick:()=>i(_),children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[_].dotClassName)}),h(kt[_].labelKey)]},_)),e[27]=i,e[28]=h,e[29]=D):D=e[29];let E;e[30]!==D?(E=d.jsx(Pn,{children:D}),e[30]=D,e[31]=E):E=e[31];let M;e[32]!==R||e[33]!==E?(M=d.jsxs(zn,{children:[R,E]}),e[32]=R,e[33]=E,e[34]=M):M=e[34];let A;e[35]!==h?(A=h("taskBoard.taskBoard.assignButton"),e[35]=h,e[36]=A):A=e[36];let U;e[37]!==A?(U=d.jsx(Ln,{children:A}),e[37]=A,e[38]=U):U=e[38];let I;e[39]!==r||e[40]!==a?(I=d.jsx(Pn,{className:"w-56 p-0",children:d.jsx(ri,{members:r,onSelect:a})}),e[39]=r,e[40]=a,e[41]=I):I=e[41];let B;e[42]!==U||e[43]!==I?(B=d.jsxs(zn,{children:[U,I]}),e[42]=U,e[43]=I,e[44]=B):B=e[44];let O;e[45]!==h?(O=h("taskBoard.taskBoard.dueDateButton"),e[45]=h,e[46]=O):O=e[46];let K;e[47]!==O?(K=d.jsx(Ln,{children:O}),e[47]=O,e[48]=K):K=e[48];let Y;e[49]!==l?(Y=d.jsx(Pn,{className:"w-auto p-0",children:d.jsx(vo,{mode:"single",onSelect:_=>_&&l(_),initialFocus:!0})}),e[49]=l,e[50]=Y):Y=e[50];let P;e[51]!==K||e[52]!==Y?(P=d.jsxs(zn,{children:[K,Y]}),e[51]=K,e[52]=Y,e[53]=P):P=e[53];let q;e[54]!==o||e[55]!==y||e[56]!==h?(q=y.length>0&&d.jsxs(zn,{children:[d.jsx(Ln,{children:h("taskBoard.taskBoard.addTagButton")}),d.jsx(Pn,{children:y.map(_=>d.jsxs(jt,{onClick:()=>o(_.id),children:[d.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:ls(_.color)}}),_.name]},_.id))})]}),e[54]=o,e[55]=y,e[56]=h,e[57]=q):q=e[57];let Q;e[58]===Symbol.for("react.memo_cache_sentinel")?(Q=d.jsx(rl,{}),e[58]=Q):Q=e[58];let G;e[59]!==h?(G=h("taskBoard.taskBoard.deleteSelectedButton"),e[59]=h,e[60]=G):G=e[60];let ee;e[61]!==f||e[62]!==G?(ee=d.jsx(jt,{variant:"destructive",onClick:f,children:G}),e[61]=f,e[62]=G,e[63]=ee):ee=e[63];let W;e[64]!==T||e[65]!==M||e[66]!==B||e[67]!==P||e[68]!==q||e[69]!==ee?(W=d.jsxs(Dn,{align:"center",side:"top",children:[T,M,B,P,q,Q,ee]}),e[64]=T,e[65]=M,e[66]=B,e[67]=P,e[68]=q,e[69]=ee,e[70]=W):W=e[70];let ne;e[71]!==W||e[72]!==k?(ne=d.jsxs(Nn,{children:[k,W]}),e[71]=W,e[72]=k,e[73]=ne):ne=e[73];let J;e[74]!==c||e[75]!==h?(J=c&&d.jsxs("button",{type:"button",onClick:c,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(Cr,{size:14}),h("taskBoard.taskBoard.autoFix")]}),e[74]=c,e[75]=h,e[76]=J):J=e[76];let se;e[77]!==h?(se=h("taskBoard.taskBoard.clearSelectionButton"),e[77]=h,e[78]=se):se=e[78];let $;e[79]!==h?($=h("taskBoard.taskBoard.clearSelectionButton"),e[79]=h,e[80]=$):$=e[80];let F;e[81]===Symbol.for("react.memo_cache_sentinel")?(F=d.jsx(Cn,{size:16}),e[81]=F):F=e[81];let X;e[82]!==u||e[83]!==se||e[84]!==$?(X=d.jsx("button",{type:"button","aria-label":se,title:$,onClick:u,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:F}),e[82]=u,e[83]=se,e[84]=$,e[85]=X):X=e[85];let re;return e[86]!==ne||e[87]!==J||e[88]!==X||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,ne,J,X]})}),e[86]=ne,e[87]=J,e[88]=X,e[89]=g,e[90]=re):re=e[90],re}function Ki(t){const e=L.c(14),{active:n,onClick:r,icon:s,label:i}=t,o=ce();let a;e[0]!==i||e[1]!==o?(a=o("taskBoard.taskBoard.layoutViewAriaLabel",{label:i}),e[0]=i,e[1]=o,e[2]=a):a=e[2];const l=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let c;e[3]!==l?(c=Z("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",l),e[3]=l,e[4]=c):c=e[4];let f;e[5]!==s?(f=d.jsx(s,{size:14}),e[5]=s,e[6]=f):f=e[6];let u;return e[7]!==n||e[8]!==i||e[9]!==r||e[10]!==a||e[11]!==c||e[12]!==f?(u=d.jsxs("button",{type:"button",onClick:r,"aria-label":a,"aria-pressed":n,className:c,children:[f,i]}),e[7]=n,e[8]=i,e[9]=r,e[10]=a,e[11]=c,e[12]=f,e[13]=u):u=e[13],u}const Vn="lane:";function Wi(t,e){return t.sortOrder-e.sortOrder}function zp(t){const e=L.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:a,onOpen:l,onCreate:c,onMove:f,onAutoFix:u,onAssign:h}=t,[p,m]=v.useState(null);let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[x,g]=v.useState(y);let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=new Map,e[1]=b):b=e[1];const[k,w]=v.useState(b),S=v.useRef(null),j=k.size>0?n.map(_=>{const V=k.get(_.id);return V?{..._,...V}:_}):n;if(k.size>0&&!p){const _=[...k].filter(V=>{const[te,le]=V,je=n.find(pe=>pe.id===te);return je?.status===le.status&&je.sortOrder===le.sortOrder});_.length>0&&w(V=>{const te=new Map(V);for(const[le]of _)te.delete(le);return te})}cp(S,j.map(Up).join(","),p===null);const C=_=>j.filter(V=>V.status===_).sort(Wi),T=_=>{if(_===void 0)return null;const V=String(_);if(V.startsWith(Vn)){const te=V.slice(Vn.length);return As.find(le=>le===te)??null}return j.find(te=>te.id===V)?.status??null};let N;e[2]!==i?(N=_=>i.has(_)&&i.size>1?[_,...Array.from(i).filter(V=>V!==_)]:[_],e[2]=i,e[3]=N):N=e[3];const R=N;let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D=(_,V,te)=>{const le=sa(te,_.length);w(je=>{const pe=new Map(je);return _.forEach((De,fe)=>pe.set(De,{status:V,sortOrder:le[fe]})),pe})},e[4]=D):D=e[4];const E=D;let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M={activationConstraint:{distance:4}},e[5]=M):M=e[5];let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A={coordinateGetter:Ou},e[6]=A):A=e[6];const U=sd(di(Fr,M),di(Lr,A)),I=_=>{const V=String(_.active.id),te=T(_.over?.id),le=j.find(fe=>fe.id===V);if(!te||!le||le.status===te)return;const je=R(V),pe=String(_.over?.id??""),De=C(te).filter(fe=>!je.includes(fe.id));E(je,te,Ti(De,pe.startsWith(Vn)?null:pe,V))},B=_=>{const V=String(_.active.id);m(null);const te=T(_.over?.id)??j.find(ge=>ge.id===V)?.status;if(!te){w(new Map);return}const le=R(V),je=C(te),pe=String(_.over?.id??""),De=je.findIndex(ge=>ge.id===V),fe=pe.startsWith(Vn)?je.length-1:je.findIndex(ge=>ge.id===pe),it=De===-1||fe===-1?je:qr(je,De,fe);if(n.filter(ge=>ge.status===te).sort(Wi).map(Fp).join()===it.map(Pp).join()){w(new Map);return}const ct=it.slice(it.findIndex(ge=>ge.id===V)+1).find(ge=>!le.includes(ge.id)),be=Ti(je.filter(ge=>!le.includes(ge.id)),ct?.id??null,V);E(le,te,be),g(le),f(le,te,be)},O=p?j.find(_=>_.id===p):null;let K;e[7]!==p||e[8]!==R?(K=p?R(p):[],e[7]=p,e[8]=R,e[9]=K):K=e[9];const Y=K,P=Jd,q=Bo;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>{m(String(_.active.id)),g([])},e[10]=Q):Q=e[10];let G;e[11]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{m(null),w(new Map)},e[11]=G):G=e[11];const ee=As.map(_=>d.jsx(qp,{status:_,items:C(_),members:r,memberByUserId:s,selectedIds:i,isTarget:O?.status===_,hiddenIds:Y,landedIds:x,onToggleSelect:o,onSelectAllInLane:a,onOpen:l,onCreate:c,onAutoFix:u,onAssign:h},_));let W;e[12]!==ee?(W=d.jsx("div",{ref:S,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:ee})}),e[12]=ee,e[13]=W):W=e[13];const ne=Ut.createPortal,J=xu,se=null,$=O&&d.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[d.jsx(La,{item:O,assignee:O.assigneeId?s.get(O.assigneeId):void 0,assignedBy:O.assignedBy?s.get(O.assignedBy):void 0,selected:i.has(O.id),onOpen:Lp,className:"w-full shadow-lg"}),Y.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:Y.length})]});let F;e[14]!==J||e[15]!==$?(F=d.jsx(J,{dropAnimation:se,children:$}),e[14]=J,e[15]=$,e[16]=F):F=e[16];let X;e[17]!==ne||e[18]!==F?(X=ne(F,document.body),e[17]=ne,e[18]=F,e[19]=X):X=e[19];let re;return e[20]!==P||e[21]!==B||e[22]!==I||e[23]!==U||e[24]!==G||e[25]!==W||e[26]!==X||e[27]!==q||e[28]!==Q?(re=d.jsxs(P,{sensors:U,collisionDetection:q,onDragStart:Q,onDragOver:I,onDragEnd:B,onDragCancel:G,children:[W,X]}),e[20]=P,e[21]=B,e[22]=I,e[23]=U,e[24]=G,e[25]=W,e[26]=X,e[27]=q,e[28]=Q,e[29]=re):re=e[29],re}function Lp(){}function Pp(t){return t.id}function Fp(t){return t.id}function Up(t){return`${t.id}:${t.status}`}function qp(t){const e=L.c(91),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:a,hiddenIds:l,landedIds:c,onToggleSelect:f,onSelectAllInLane:u,onOpen:h,onCreate:p,onAutoFix:m,onAssign:y}=t,x=ce(),g=yt[n],b=g.icon,k=`${Vn}${n}`;let w;e[0]!==k?(w={id:k},e[0]=k,e[1]=w):w=e[1];const{setNodeRef:S}=Yo(w),j=a&&"bg-muted/50";let C;e[2]!==j?(C=Z("flex h-full w-[300px] shrink-0 flex-col rounded-xl py-1 transition-colors",j),e[2]=j,e[3]=C):C=e[3];const T=a?"bg-muted":"bg-background";let N;e[4]!==T?(N=Z("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",T),e[4]=T,e[5]=N):N=e[5];let R;e[6]!==g.iconClassName?(R=Z("shrink-0",g.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=g.iconClassName,e[7]=R):R=e[7];let D;e[8]!==b||e[9]!==R?(D=d.jsx(b,{size:15,className:R}),e[8]=b,e[9]=R,e[10]=D):D=e[10];let E;e[11]!==g.labelKey||e[12]!==x?(E=x(g.labelKey),e[11]=g.labelKey,e[12]=x,e[13]=E):E=e[13];let M;e[14]!==E?(M=d.jsx("span",{className:"text-sm font-medium text-foreground",children:E}),e[14]=E,e[15]=M):M=e[15];let A;e[16]!==r.length?(A=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]=A):A=e[17];let U;e[18]!==g.labelKey||e[19]!==x?(U=x("taskBoard.taskBoard.laneMenuAriaLabel",{lane:x(g.labelKey)}),e[18]=g.labelKey,e[19]=x,e[20]=U):U=e[20];let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=d.jsx(ro,{size:15}),e[21]=I):I=e[21];let B;e[22]!==U?(B=d.jsx(jn,{asChild:!0,children:d.jsx("button",{type:"button","aria-label":U,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:I})}),e[22]=U,e[23]=B):B=e[23];let O;e[24]!==u||e[25]!==n?(O=()=>u(n),e[24]=u,e[25]=n,e[26]=O):O=e[26];let K;e[27]!==x?(K=x("taskBoard.taskBoard.selectAllInLane"),e[27]=x,e[28]=K):K=e[28];let Y;e[29]!==O||e[30]!==K?(Y=d.jsx(Dn,{align:"end",children:d.jsx(jt,{onClick:O,children:K})}),e[29]=O,e[30]=K,e[31]=Y):Y=e[31];let P;e[32]!==B||e[33]!==Y?(P=d.jsxs(Nn,{children:[B,Y]}),e[32]=B,e[33]=Y,e[34]=P):P=e[34];let q;e[35]!==g.labelKey||e[36]!==x?(q=x("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:x(g.labelKey)}),e[35]=g.labelKey,e[36]=x,e[37]=q):q=e[37];let Q;e[38]!==g.labelKey||e[39]!==x?(Q=x("taskBoard.taskBoard.newTaskInLaneTitle",{lane:x(g.labelKey)}),e[38]=g.labelKey,e[39]=x,e[40]=Q):Q=e[40];let G;e[41]!==p||e[42]!==n?(G=()=>p(n),e[41]=p,e[42]=n,e[43]=G):G=e[43];let ee;e[44]===Symbol.for("react.memo_cache_sentinel")?(ee=d.jsx(Jn,{size:15}),e[44]=ee):ee=e[44];let W;e[45]!==q||e[46]!==Q||e[47]!==G?(W=d.jsx("button",{type:"button","aria-label":q,title:Q,onClick:G,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:ee}),e[45]=q,e[46]=Q,e[47]=G,e[48]=W):W=e[48];let ne;e[49]!==M||e[50]!==A||e[51]!==P||e[52]!==W||e[53]!==N||e[54]!==D?(ne=d.jsxs("div",{className:N,children:[D,M,A,P,W]}),e[49]=M,e[50]=A,e[51]=P,e[52]=W,e[53]=N,e[54]=D,e[55]=ne):ne=e[55];let J;e[56]!==r?(J=r.map(Hp),e[56]=r,e[57]=J):J=e[57];let se;if(e[58]!==l||e[59]!==r||e[60]!==c||e[61]!==i||e[62]!==s||e[63]!==y||e[64]!==m||e[65]!==h||e[66]!==f||e[67]!==o){let re;e[69]!==l||e[70]!==c||e[71]!==i||e[72]!==s||e[73]!==y||e[74]!==m||e[75]!==h||e[76]!==f||e[77]!==o?(re=_=>d.jsx(Kp,{item:_,assignee:_.assigneeId?i.get(_.assigneeId):void 0,assignedBy:_.assignedBy?i.get(_.assignedBy):void 0,members:s,selected:o.has(_.id),hidden:l.includes(_.id),landed:c.includes(_.id),onToggleSelect:()=>f(_.id),onOpen:()=>h(_),onAutoFix:m?()=>m(_):void 0,onAssign:y?V=>y(_.id,V):void 0},_.id),e[69]=l,e[70]=c,e[71]=i,e[72]=s,e[73]=y,e[74]=m,e[75]=h,e[76]=f,e[77]=o,e[78]=re):re=e[78],se=r.map(re),e[58]=l,e[59]=r,e[60]=c,e[61]=i,e[62]=s,e[63]=y,e[64]=m,e[65]=h,e[66]=f,e[67]=o,e[68]=se}else se=e[68];let $;e[79]!==J||e[80]!==se?($=d.jsx(Tu,{items:J,strategy:Su,children:se}),e[79]=J,e[80]=se,e[81]=$):$=e[81];let F;e[82]!==S||e[83]!==n||e[84]!==$?(F=d.jsx("div",{ref:S,"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:$}),e[82]=S,e[83]=n,e[84]=$,e[85]=F):F=e[85];let X;return e[86]!==n||e[87]!==ne||e[88]!==F||e[89]!==C?(X=d.jsxs("div",{"data-lane":n,className:C,children:[ne,F]}),e[86]=n,e[87]=ne,e[88]=F,e[89]=C,e[90]=X):X=e[90],X}function Hp(t){return t.id}function Kp(t){const e=L.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:a,listeners:l,setNodeRef:c,transform:f,transition:u,isDragging:h}=_u(o),p=r.id,m=r.status;let y;e[7]!==a||e[8]!==l?(y={attributes:a,listeners:l},e[7]=a,e[8]=l,e[9]=y):y=e[9];const x=s&&"animate-card-land";let g;e[10]!==x?(g=Z("w-full",x),e[10]=x,e[11]=g):g=e[11];let b;e[12]!==f?(b=Ht.Translate.toString(f),e[12]=f,e[13]=b):b=e[13];const k=h||n?0:void 0;let w;e[14]!==b||e[15]!==k||e[16]!==u?(w={transform:b,transition:u,opacity:k},e[14]=b,e[15]=k,e[16]=u,e[17]=w):w=e[17];let S;e[18]!==r||e[19]!==i||e[20]!==c||e[21]!==y||e[22]!==g||e[23]!==w?(S=d.jsx(La,{...i,item:r,dragRef:c,bindings:y,className:g,style:w}),e[18]=r,e[19]=i,e[20]=c,e[21]=y,e[22]=g,e[23]=w,e[24]=S):S=e[24];let j;return e[25]!==r.id||e[26]!==r.status||e[27]!==S?(j=d.jsx("div",{className:"flex","data-flip-id":p,"data-flip-lane":m,children:S}),e[25]=r.id,e[26]=r.status,e[27]=S,e[28]=j):j=e[28],j}function La(t){const e=L.c(43),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:a,dragRef:l,bindings:c,style:f,onToggleSelect:u,onOpen:h,onAutoFix:p,onAssign:m}=t,y=ce(),x=yt[n.status].icon,g=Pu(n)?.lastMessage,b=p&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==nt,k=c?.attributes,w=c?.listeners;let S;e[0]!==h||e[1]!==u?(S=O=>{O.shiftKey&&u?u():h()},e[0]=h,e[1]=u,e[2]=S):S=e[2];const j=o&&"bg-accent";let C;e[3]!==a||e[4]!==j?(C=Z("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",j,a),e[3]=a,e[4]=j,e[5]=C):C=e[5];const T=n.title;let N;e[6]!==n?(N=Z("mt-px shrink-0",Hr(n)),e[6]=n,e[7]=N):N=e[7];let R;e[8]!==x||e[9]!==N?(R=d.jsx(x,{size:16,className:N}),e[8]=x,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 E;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==m?(E=d.jsx(Ma,{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]=E):E=e[18];let M;e[19]!==E||e[20]!==R||e[21]!==D?(M=d.jsxs("div",{className:"flex items-start gap-2",children:[R,D,E]}),e[19]=E,e[20]=R,e[21]=D,e[22]=M):M=e[22];let A;e[23]!==g?(A=g&&d.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:g}),e[23]=g,e[24]=A):A=e[24];let U;e[25]!==n?(U=(_s(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:[_s(n)&&d.jsx(Aa,{}),n.priority!=="none"&&d.jsx(Ba,{priority:n.priority}),n.dueDate&&d.jsx(Oa,{iso:n.dueDate}),n.tags.map(Wp)]}),e[25]=n,e[26]=U):U=e[26];let I;e[27]!==p||e[28]!==b||e[29]!==y?(I=b&&d.jsxs("button",{type:"button",onClick:O=>{O.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(Cr,{size:12}),y("taskBoard.taskBoard.autoFix")]}),e[27]=p,e[28]=b,e[29]=y,e[30]=I):I=e[30];let B;return e[31]!==l||e[32]!==n.title||e[33]!==f||e[34]!==k||e[35]!==M||e[36]!==A||e[37]!==U||e[38]!==I||e[39]!==w||e[40]!==S||e[41]!==C?(B=d.jsxs("button",{type:"button",ref:l,style:f,...k,...w,onClick:S,className:C,title:T,children:[M,A,U,I]}),e[31]=l,e[32]=n.title,e[33]=f,e[34]=k,e[35]=M,e[36]=A,e[37]=U,e[38]=I,e[39]=w,e[40]=S,e[41]=C,e[42]=B):B=e[42],B}function Wp(t){return d.jsx($a,{tag:t},t.id)}function Vp(t){const e=L.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=yt[n.status].icon;let a;e[0]!==n?(a=Z("shrink-0",Hr(n)),e[0]=n,e[1]=a):a=e[1];let l;e[2]!==o||e[3]!==a?(l=d.jsx(o,{size:16,className:a}),e[2]=o,e[3]=a,e[4]=l):l=e[4];let c;e[5]!==n.title?(c=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]=c):c=e[6];let f;e[7]!==n?(f=_s(n)&&d.jsx(Aa,{}),e[7]=n,e[8]=f):f=e[8];let u;e[9]!==n.priority?(u=n.priority!=="none"&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(Ba,{priority:n.priority})}),e[9]=n.priority,e[10]=u):u=e[10];let h;e[11]!==n.dueDate?(h=n.dueDate&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(Oa,{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(Gp),n.tags.length>2&&d.jsxs("span",{className:ds,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(Ma,{item:n,assignee:r,assignedBy:s}),e[15]=s,e[16]=r,e[17]=n,e[18]=m):m=e[18];let y;e[19]!==n.createdAt?(y=fo(new Date(n.createdAt)),e[19]=n.createdAt,e[20]=y):y=e[20];let x;e[21]!==y?(x=d.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:y}),e[21]=y,e[22]=x):x=e[22];let g;return e[23]!==i||e[24]!==x||e[25]!==l||e[26]!==c||e[27]!==f||e[28]!==u||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:[l,c,f,u,h,p,m,x]}),e[23]=i,e[24]=x,e[25]=l,e[26]=c,e[27]=f,e[28]=u,e[29]=h,e[30]=p,e[31]=m,e[32]=g):g=e[32],g}function Gp(t){return d.jsx($a,{tag:t},t.id)}const lm=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:za,default:Dp},Symbol.toStringTag,{value:"Module"}));export{lm as $,Ou as A,qr as B,Ht as C,Jd as D,zu as E,Lu as F,yt as G,Ug as H,kt as I,Ot as J,Lr as K,at as L,rm as M,Vg as N,im as O,Fr as P,Qg as Q,am as R,vc as S,Mh as T,Bc as U,Gg as V,Zg as W,nm as X,Xg as Y,za as Z,Zo as _,wc as a,Wg as b,em as c,uc as d,Hg as e,tm as f,Oc as g,sm as h,gc as i,Yg as j,Jg as k,Pc as l,Mc as m,Uc as n,sd as o,di as p,xu as q,qg as r,nu as s,bu as t,Kg as u,om as v,hc as w,Tu as x,Su as y,_u as z};
77
+ `)}const vr="__unassigned__",zs={assignee:null,priority:null,due:null};function up(t){return t.assignee!==null||t.priority!==null||t.due!==null}function fp(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const hp=864e5;function pp(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 gp(t,e){if(e.assignee!==null){if(e.assignee===vr){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"&&!pp(n,r)||e.due==="week"&&(n<r||n>r+7*hp))return!1}return!0}const qi={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Qs(t,e=!1){return Z("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 mp(t){const e=L.c(95),{value:n,members:r,onChange:s,block:i}=t,o=ce(),[a,l]=v.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(lr,{size:14,className:"shrink-0"}),e[0]=c):c=e[0];let f=c,u;e[1]!==o?(u=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=u):u=e[2];let h=u;if(n===vr){let $;e[3]!==o?($=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=$):$=e[4],h=$}else if(n===nt){let $;e[5]===Symbol.for("react.memo_cache_sentinel")?($=d.jsx(Ot,{size:14}),e[5]=$):$=e[5],f=$;let F;e[6]!==o?(F=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=F):F=e[7],h=F}else if(n){let $,F,X,re;if(e[8]!==r||e[9]!==n){let te;e[14]!==n?(te=le=>le.userId===n,e[14]=n,e[15]=te):te=e[15],F=r.find(te),$=Nt,X=F?.user?.image??void 0,re=Dt(F?.user?.name),e[8]=r,e[9]=n,e[10]=$,e[11]=F,e[12]=X,e[13]=re}else $=e[10],F=e[11],X=e[12],re=e[13];let _;e[16]!==$||e[17]!==X||e[18]!==re?(_=d.jsx($,{url:X,fallback:re,shape:"circle",size:"2xs"}),e[16]=$,e[17]=X,e[18]=re,e[19]=_):_=e[19],f=_;let V;e[20]!==F?.user?.name||e[21]!==o?(V=F?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=F?.user?.name,e[21]=o,e[22]=V):V=e[22],h=V}let p;e[23]!==s?(p=$=>{s($),l(!1)},e[23]=s,e[24]=p):p=e[24];const m=p,y=n!==null;let x;e[25]!==i||e[26]!==y?(x=Qs(y,i),e[25]=i,e[26]=y,e[27]=x):x=e[27];const g=x,b=i&&"ml-auto";let k;e[28]!==b?(k=Z("shrink-0 opacity-60",b),e[28]=b,e[29]=k):k=e[29];const w=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 j;e[32]!==w?(j=d.jsx(Br,{size:12,className:w}),e[32]=w,e[33]=j):j=e[33];let S;e[34]!==f||e[35]!==C||e[36]!==j||e[37]!==g?(S=d.jsx(wn,{asChild:!0,children:d.jsxs("button",{type:"button",className:g,children:[f,C,j]})}),e[34]=f,e[35]=C,e[36]=j,e[37]=g,e[38]=S):S=e[38];let T;e[39]!==o?(T=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=T):T=e[40];let N;e[41]!==T?(N=d.jsx(Er,{placeholder:T,className:"h-9"}),e[41]=T,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(Ir,{children:R}),e[45]=R,e[46]=D):D=e[46];let E;e[47]!==m?(E=()=>m(null),e[47]=m,e[48]=E):E=e[48];let M;e[49]!==o?(M=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=M):M=e[50];let A;e[51]!==E||e[52]!==M?(A=d.jsx(Pt,{value:"Anyone",onSelect:E,children:M}),e[51]=E,e[52]=M,e[53]=A):A=e[53];let U;e[54]!==m?(U=()=>m(vr),e[54]=m,e[55]=U):U=e[55];let I;e[56]===Symbol.for("react.memo_cache_sentinel")?(I=d.jsx(lr,{size:16,className:"text-muted-foreground"}),e[56]=I):I=e[56];let B;e[57]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=B):B=e[58];let O;e[59]!==U||e[60]!==B?(O=d.jsxs(Pt,{value:"Unassigned",onSelect:U,className:"gap-2",children:[I,B]}),e[59]=U,e[60]=B,e[61]=O):O=e[61];let K;e[62]!==m?(K=()=>m(nt),e[62]=m,e[63]=K):K=e[63];let Y;e[64]===Symbol.for("react.memo_cache_sentinel")?(Y=d.jsx(Ot,{size:16}),e[64]=Y):Y=e[64];let P;e[65]!==o?(P=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=P):P=e[66];let q;e[67]!==K||e[68]!==P?(q=d.jsxs(Pt,{value:"Super Agent",onSelect:K,className:"gap-2",children:[Y,P]}),e[67]=K,e[68]=P,e[69]=q):q=e[69];let Q;e[70]!==A||e[71]!==O||e[72]!==q?(Q=d.jsxs(Rn,{children:[A,O,q]}),e[70]=A,e[71]=O,e[72]=q,e[73]=Q):Q=e[73];let G;e[74]!==o?(G=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=G):G=e[75];let ee;if(e[76]!==r||e[77]!==m){let $;e[79]!==m?($=F=>d.jsxs(Pt,{value:F.user?.name??F.userId,onSelect:()=>m(F.userId),className:"gap-2",children:[d.jsx(Nt,{url:F.user?.image??void 0,fallback:Dt(F.user?.name),shape:"circle",size:"2xs"}),d.jsx("span",{className:"truncate",children:F.user?.name??F.userId})]},F.userId),e[79]=m,e[80]=$):$=e[80],ee=r.map($),e[76]=r,e[77]=m,e[78]=ee}else ee=e[78];let W;e[81]!==G||e[82]!==ee?(W=d.jsx(Rn,{heading:G,children:ee}),e[81]=G,e[82]=ee,e[83]=W):W=e[83];let ne;e[84]!==D||e[85]!==Q||e[86]!==W?(ne=d.jsxs(_r,{children:[D,Q,W]}),e[84]=D,e[85]=Q,e[86]=W,e[87]=ne):ne=e[87];let J;e[88]!==N||e[89]!==ne?(J=d.jsx(Gn,{align:"start",className:"w-56 p-0",children:d.jsxs(Ar,{children:[N,ne]})}),e[88]=N,e[89]=ne,e[90]=J):J=e[90];let se;return e[91]!==a||e[92]!==S||e[93]!==J?(se=d.jsxs(Qn,{open:a,onOpenChange:l,children:[S,J]}),e[91]=a,e[92]=S,e[93]=J,e[94]=se):se=e[94],se}function xp(t){const e=L.c(33),{value:n,onChange:r,block:s}=t,i=ce(),o=n!==null;let a;e[0]!==s||e[1]!==o?(a=Qs(o,s),e[0]=s,e[1]=o,e[2]=a):a=e[2];const l=a,c=s&&"ml-auto";let f;e[3]!==c?(f=Z("shrink-0 opacity-60",c),e[3]=c,e[4]=f):f=e[4];const u=f;let h;e[5]!==n?(h=n?d.jsx("span",{className:Z("size-2 shrink-0 rounded-full",kt[n].dotClassName)}):d.jsx(ac,{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?kt[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=n,e[9]=p):p=e[9];let m;e[10]!==u?(m=d.jsx(Br,{size:12,className:u}),e[10]=u,e[11]=m):m=e[11];let y;e[12]!==h||e[13]!==p||e[14]!==m||e[15]!==l?(y=d.jsx(jn,{asChild:!0,children:d.jsxs("button",{type:"button",className:l,children:[h,p,m]})}),e[12]=h,e[13]=p,e[14]=m,e[15]=l,e[16]=y):y=e[16];let x;e[17]!==r?(x=()=>r(null),e[17]=r,e[18]=x):x=e[18];let g;e[19]!==i?(g=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=g):g=e[20];let b;e[21]!==g||e[22]!==x?(b=d.jsx(jt,{onSelect:x,children:g}),e[21]=g,e[22]=x,e[23]=b):b=e[23];let k;e[24]!==r||e[25]!==i?(k=Kr.map(j=>d.jsxs(jt,{onSelect:()=>r(j),className:"gap-2",children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[j].dotClassName)}),i(kt[j].labelKey)]},j)),e[24]=r,e[25]=i,e[26]=k):k=e[26];let w;e[27]!==b||e[28]!==k?(w=d.jsxs(Dn,{align:"start",className:"w-40",children:[b,k]}),e[27]=b,e[28]=k,e[29]=w):w=e[29];let C;return e[30]!==w||e[31]!==y?(C=d.jsxs(Nn,{children:[y,w]}),e[30]=w,e[31]=y,e[32]=C):C=e[32],C}function bp(t){const e=L.c(35),{value:n,onChange:r,block:s}=t,i=ce();let o;e[0]!==i||e[1]!==n?(o=n?i(qi[n]):void 0,e[0]=i,e[1]=n,e[2]=o):o=e[2];const a=o,l=n!==null;let c;e[3]!==s||e[4]!==l?(c=Qs(l,s),e[3]=s,e[4]=l,e[5]=c):c=e[5];const f=c,u=s&&"ml-auto";let h;e[6]!==u?(h=Z("shrink-0 opacity-60",u),e[6]=u,e[7]=h):h=e[7];const p=h;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=d.jsx(Sn,{size:14,className:"shrink-0"}),e[8]=m):m=e[8];let y;e[9]!==a||e[10]!==i?(y=a??i("taskBoard.taskFilters.dueDateLabel"),e[9]=a,e[10]=i,e[11]=y):y=e[11];let x;e[12]!==p?(x=d.jsx(Br,{size:12,className:p}),e[12]=p,e[13]=x):x=e[13];let g;e[14]!==y||e[15]!==x||e[16]!==f?(g=d.jsx(jn,{asChild:!0,children:d.jsxs("button",{type:"button",className:f,children:[m,y,x]})}),e[14]=y,e[15]=x,e[16]=f,e[17]=g):g=e[17];let b;e[18]!==r?(b=()=>r(null),e[18]=r,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=d.jsx(Sn,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let w;e[21]!==i?(w=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=w):w=e[22];let C;e[23]!==b||e[24]!==w?(C=d.jsxs(jt,{onSelect:b,className:"gap-2",children:[k,w]}),e[23]=b,e[24]=w,e[25]=C):C=e[25];let j;e[26]!==r||e[27]!==i?(j=Object.entries(qi).map(N=>{const[R,D]=N,E=R==="overdue";return d.jsxs(jt,{onSelect:()=>r(R),className:Z("gap-2",E&&"text-destructive"),children:[d.jsx(Sn,{size:16,className:Z("shrink-0",E?"text-destructive":"text-muted-foreground")}),i(D)]},R)}),e[26]=r,e[27]=i,e[28]=j):j=e[28];let S;e[29]!==C||e[30]!==j?(S=d.jsxs(Dn,{align:"start",className:"w-44",children:[C,j]}),e[29]=C,e[30]=j,e[31]=S):S=e[31];let T;return e[32]!==S||e[33]!==g?(T=d.jsxs(Nn,{children:[g,S]}),e[32]=S,e[33]=g,e[34]=T):T=e[34],T}function _a(t){const e=L.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 a;e[3]!==i||e[4]!==n.assignee||e[5]!==r||e[6]!==o?(a=d.jsx(mp,{block:i,value:n.assignee,members:r,onChange:o}),e[3]=i,e[4]=n.assignee,e[5]=r,e[6]=o,e[7]=a):a=e[7];let l;e[8]!==n||e[9]!==s?(l=p=>s({...n,priority:p}),e[8]=n,e[9]=s,e[10]=l):l=e[10];let c;e[11]!==i||e[12]!==n.priority||e[13]!==l?(c=d.jsx(xp,{block:i,value:n.priority,onChange:l}),e[11]=i,e[12]=n.priority,e[13]=l,e[14]=c):c=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 u;e[18]!==i||e[19]!==n.due||e[20]!==f?(u=d.jsx(bp,{block:i,value:n.due,onChange:f}),e[18]=i,e[19]=n.due,e[20]=f,e[21]=u):u=e[21];let h;return e[22]!==a||e[23]!==c||e[24]!==u?(h=d.jsxs(d.Fragment,{children:[a,c,u]}),e[22]=a,e[23]=c,e[24]=u,e[25]=h):h=e[25],h}function yp(t){const e=L.c(12),{filters:n,members:r,onChange:s}=t,i=ce();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=d.jsx(Do,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let a;e[1]!==n||e[2]!==r||e[3]!==s?(a=d.jsx(_a,{filters:n,members:r,onChange:s}),e[1]=n,e[2]=r,e[3]=s,e[4]=a):a=e[4];let l;e[5]!==n||e[6]!==s||e[7]!==i?(l=up(n)&&d.jsx("button",{type:"button",onClick:()=>s(zs),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]=l):l=e[8];let c;return e[9]!==a||e[10]!==l?(c=d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,a,l]}),e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function kp(t){const e=L.c(38),{filters:n,members:r,onChange:s}=t,i=ce(),[o,a]=v.useState(!1),l=fp(n),c=l>0;let f;e[0]!==c?(f=Qs(c),e[0]=c,e[1]=f):f=e[1];const u=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=d.jsx(Do,{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]!==l?(m=l>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:l}),e[5]=l,e[6]=m):m=e[6];let y;e[7]!==p||e[8]!==m||e[9]!==u?(y=d.jsx(tc,{asChild:!0,children:d.jsxs("button",{type:"button",className:u,children:[h,p,m]})}),e[7]=p,e[8]=m,e[9]=u,e[10]=y):y=e[10];let x;e[11]!==i?(x=i("taskBoard.taskFilters.filterDrawerTitle"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==x?(g=d.jsx(nc,{className:"px-4 pt-4 text-base font-medium text-foreground",children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==n||e[16]!==r||e[17]!==s?(b=d.jsx("div",{className:"flex flex-col gap-2 p-4",children:d.jsx(_a,{block:!0,filters:n,members:r,onChange:s})}),e[15]=n,e[16]=r,e[17]=s,e[18]=b):b=e[18];let k;e[19]!==l||e[20]!==s||e[21]!==i?(k=l>0&&d.jsx(Xe,{variant:"outline",className:"flex-1",onClick:()=>s(zs),children:i("taskBoard.taskFilters.clearAllButton")}),e[19]=l,e[20]=s,e[21]=i,e[22]=k):k=e[22];let w;e[23]!==i?(w=i("taskBoard.taskFilters.doneButton"),e[23]=i,e[24]=w):w=e[24];let C;e[25]!==w?(C=d.jsx(sc,{asChild:!0,children:d.jsx(Xe,{className:"flex-1",children:w})}),e[25]=w,e[26]=C):C=e[26];let j;e[27]!==k||e[28]!==C?(j=d.jsxs(rc,{className:"flex-row gap-2",children:[k,C]}),e[27]=k,e[28]=C,e[29]=j):j=e[29];let S;e[30]!==j||e[31]!==g||e[32]!==b?(S=d.jsxs(ic,{className:"p-0",children:[g,b,j]}),e[30]=j,e[31]=g,e[32]=b,e[33]=S):S=e[33];let T;return e[34]!==o||e[35]!==S||e[36]!==y?(T=d.jsxs(oc,{open:o,onOpenChange:a,direction:"bottom",children:[y,S]}),e[34]=o,e[35]=S,e[36]=y,e[37]=T):T=e[37],T}const vp="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",wp=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],Hi={price:"R$ 99",anchor:"R$ 499"};function Sp(t){const e=L.c(21),{onOpen:n}=t,r=ce();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(Cr,{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 a;e[5]!==r?(a=r("taskBoard.backlogPaywall.bannerSubtitle"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==a?(l=d.jsx("span",{className:"text-sm text-muted-foreground",children:a}),e[7]=a,e[8]=l):l=e[8];let c;e[9]!==o||e[10]!==l?(c=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,l]})]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let f;e[12]!==r?(f=r("taskBoard.backlogPaywall.unlockButton"),e[12]=r,e[13]=f):f=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(To,{size:16}),e[14]=u):u=e[14];let h;e[15]!==n||e[16]!==f?(h=d.jsxs(Xe,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:[f,u]}),e[15]=n,e[16]=f,e[17]=h):h=e[17];let p;return e[18]!==c||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:[c,h]}),e[18]=c,e[19]=h,e[20]=p):p=e[20],p}function Cp({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=ce(),[i,o]=v.useState(!1),a=async()=>{if(!n){r();return}o(!0);try{const l=await n.callTool({name:"start_checkout",arguments:{}}),{url:c}=cr(l);if(new URL(c).protocol!=="https:")throw new Error("unsafe checkout url");window.open(c,"_blank","noopener,noreferrer"),e(!1)}catch{r()}finally{o(!1)}};return d.jsx(Dr,{open:t,onOpenChange:e,children:d.jsxs(jr,{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:vp,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(Tr,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),d.jsx("ul",{className:"flex flex-col gap-3.5",children:wp.map(l=>d.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[d.jsx(_n,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),d.jsx("span",{className:"leading-snug text-foreground",children:s(l)})]},l))})]}),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:Hi.price}),d.jsx("span",{className:"text-sm text-muted-foreground line-through",children:Hi.anchor})]}),d.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[d.jsx(Xe,{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(Xe,{onClick:a,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?d.jsx(wr,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&d.jsx(To,{size:16})]})]})]})]})]})})}function or(t){return`board-paywall-seen:${t}`}function Tp(){const t=L.c(26),{org:e}=_e(),n=no(),{diagnostic:r,cdClient:s,connectionId:i}=Pc();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(or(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[a,l]=v.useState(o);let c;t[2]!==a.open||t[3]!==a.orgId||t[4]!==e.id?(c=a.orgId===e.id?a.open:!sessionStorage.getItem(or(e.id)),t[2]=a.open,t[3]=a.orgId,t[4]=e.id,t[5]=c):c=t[5];const f=c;if(!r?.locked)return null;let u;t[6]!==e.id?(u=w=>l({orgId:e.id,open:w}),t[6]=e.id,t[7]=u):u=t[7];const h=u;let p;t[8]!==e.id||t[9]!==h?(p=w=>{h(w),w||sessionStorage.setItem(or(e.id),"1")},t[8]=e.id,t[9]=h,t[10]=p):p=t[10];const m=p;let y;t[11]!==i||t[12]!==n||t[13]!==e?(y=()=>{ii("board_paywall_report_opened",{organization_id:e.id}),n(Uc(e,i))},t[11]=i,t[12]=n,t[13]=e,t[14]=y):y=t[14];const x=y;let g;t[15]!==e.id||t[16]!==h?(g=d.jsx(Sp,{onOpen:()=>{ii("board_paywall_banner_clicked",{organization_id:e.id}),h(!0)}}),t[15]=e.id,t[16]=h,t[17]=g):g=t[17];let b;t[18]!==s||t[19]!==m||t[20]!==f||t[21]!==x?(b=d.jsx(Cp,{open:f,onOpenChange:m,cdClient:s,onExpired:x}),t[18]=s,t[19]=m,t[20]=f,t[21]=x,t[22]=b):b=t[22];let k;return t[23]!==g||t[24]!==b?(k=d.jsxs(d.Fragment,{children:[g,b]}),t[23]=g,t[24]=b,t[25]=k):k=t[25],k}function jp(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsx(Ha,{fallback:null,children:d.jsx(Tp,{})}),t[0]=e):e=t[0],e}Wa(()=>import("./index-CfVmXxnZ.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 Dp(){const t=L.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(za,{})})})}),t[0]=e):e=t[0],e}const Np=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function Rp(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:Np.format(e),overdue:n}}const ds="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 Aa(){const t=L.c(9),e=ce();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Z(ds,"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(Sr,{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 Ba(t){const e=L.c(10),{priority:n}=t,r=ce(),s=kt[n];let i;e[0]!==s.dotClassName?(i=Z("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 a;e[4]!==s.labelKey||e[5]!==r?(a=r(s.labelKey),e[4]=s.labelKey,e[5]=r,e[6]=a):a=e[6];let l;return e[7]!==o||e[8]!==a?(l=d.jsxs("span",{className:ds,children:[o,a]}),e[7]=o,e[8]=a,e[9]=l):l=e[9],l}function Oa(t){const e=L.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:a,overdue:l}=Rp(n);r=a,s=Z(ds,l&&"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(Sn,{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 $a(t){const e=L.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=ls(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:ds,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function Ma(t){const e=L.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,a=ce(),[l,c]=v.useState(!1);if(n.assigneeId===nt){let b;e[0]!==s||e[1]!==a?(b=s?.user?.name?a("taskBoard.taskBoard.assignedToSuperAgentBy",{name:s.user.name}):a("taskBoard.taskBoard.assignedToSuperAgent"),e[0]=s,e[1]=a,e[2]=b):b=e[2];let k;e[3]!==s?(k=s&&d.jsx(Nt,{url:s.user?.image??void 0,fallback:Dt(s.user?.name),shape:"circle",size:"xs",className:"-mr-2 ring-2 ring-background"}),e[3]=s,e[4]=k):k=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=d.jsx(Ot,{size:20,className:"ring-2 ring-background"}),e[5]=w):w=e[5];let C;return e[6]!==b||e[7]!==k?(C=d.jsxs("span",{className:"inline-flex items-center",title:b,children:[k,w]}),e[6]=b,e[7]=k,e[8]=C):C=e[8],C}if(r){const b=r.user?.image??void 0,k=r.user?.name;let w;e[9]!==k?(w=Dt(k),e[9]=k,e[10]=w):w=e[10];let C;return e[11]!==b||e[12]!==w?(C=d.jsx(Nt,{url:b,fallback:w,shape:"circle",size:"xs"}),e[11]=b,e[12]=w,e[13]=C):C=e[13],C}if(!o||!i?.length)return null;let f;e[14]!==a?(f=a("taskBoard.taskBoard.assignButton"),e[14]=a,e[15]=f):f=e[15];let u;e[16]!==a?(u=a("taskBoard.taskBoard.assignButton"),e[16]=a,e[17]=u):u=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=b=>{b.stopPropagation(),c(!0)},e[18]=h):h=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx(io,{size:13}),e[19]=p):p=e[19];let m;e[20]!==f||e[21]!==u?(m=d.jsx(wn,{asChild:!0,children:d.jsx("button",{type:"button",title:f,"aria-label":u,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]=u,e[22]=m):m=e[22];let y;e[23]!==o?(y=b=>{o(b),c(!1)},e[23]=o,e[24]=y):y=e[24];let x;e[25]!==i||e[26]!==y?(x=d.jsx(Gn,{className:"w-56 p-0",align:"end",side:"bottom",onClick:Ep,children:d.jsx(ri,{members:i,onSelect:y})}),e[25]=i,e[26]=y,e[27]=x):x=e[27];let g;return e[28]!==l||e[29]!==m||e[30]!==x?(g=d.jsxs(Qn,{open:l,onOpenChange:c,children:[m,x]}),e[28]=l,e[29]=m,e[30]=x,e[31]=g):g=e[31],g}function Ep(t){return t.stopPropagation()}function za(){const t=L.c(126),e=ce(),{items:n,isLoading:r}=zu(),s=Lu(),i=ec(),o=bl({slug:"mcp-github"})??[];let a;t[0]!==o?(a=o.some(Op),t[0]=o,t[1]=a):a=t[1];const l=a,[c,f]=v.useState(!1),[u,h]=v.useState(!1);let p;t[2]!==l?(p=z=>z===nt&&!l?(f(!0),!0):!1,t[2]=l,t[3]=p):p=t[3];const m=p,{data:y}=uo();let x,g;t[4]!==y?.data?.members?(x=y?.data?.members??[],g=new Map(x.map(Bp)),t[4]=y?.data?.members,t[5]=x,t[6]=g):(x=t[5],g=t[6]);const b=g,[k,w]=v.useState("board"),[C,j]=v.useState(zs);let S;t[7]===Symbol.for("react.memo_cache_sentinel")?(S=new Set,t[7]=S):S=t[7];const[T,N]=v.useState(S);let R;t[8]===Symbol.for("react.memo_cache_sentinel")?(R=z=>N(ie=>{const ke=new Set(ie);return ke.has(z)?ke.delete(z):ke.add(z),ke}),t[8]=R):R=t[8];const D=R,E=z=>N(ie=>{const ke=new Set(ie);for(const Ge of te)Ge.status===z&&ke.add(Ge.id);return ke});let M;t[9]===Symbol.for("react.memo_cache_sentinel")?(M=()=>N(new Set),t[9]=M):M=t[9];const A=M,[U,I]=v.useState(!1),[B,O]=v.useState(null),[K,Y]=v.useState(null),{setTaskId:P}=lc(),{create:q}=cc(),Q=In(),{org:G,locator:ee}=_e(),W=no();let ne;t[10]===Symbol.for("react.memo_cache_sentinel")?(ne={strict:!1},t[10]=ne):ne=t[10];const{task:J}=Ka(ne);let se;t[11]!==J||t[12]!==n?(se=J?n.find(z=>z.id===J)??null:null,t[11]=J,t[12]=n,t[13]=se):se=t[13];const $=se;let F;t[14]!==J||t[15]!==W||t[16]!==G?(F=()=>{J&&W({to:"/$org/board",params:{org:G.slug},search:{},replace:!0})},t[14]=J,t[15]=W,t[16]=G,t[17]=F):F=t[17];const X=F;let re;t[18]!==s||t[19]!==q||t[20]!==ee||t[21]!==G||t[22]!==P||t[23]!==Q?(re=async z=>{const ie=crypto.randomUUID(),ke=ul(G.id).id,Ge=await Q.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:z.id}).then(Ap).catch(_p),xt=dp(z,Ge),Kt={type:"doc",content:[{type:"paragraph",content:[Xl({id:z.id,name:z.title,char:"@",kind:"task",metadata:{title:z.title,description:z.description,context:xt}}),{type:"text",text:" "}]}]};hc(sessionStorage,ee,ie,Kt),I(!1);try{await q({id:ie,virtual_mcp_id:ke}),await s.link.mutateAsync({id:z.id,linkThreadId:ie})}catch{}P(ie,ke)},t[18]=s,t[19]=q,t[20]=ee,t[21]=G,t[22]=P,t[23]=Q,t[24]=re):re=t[24];const _=re;let V;t[25]!==C?(V=z=>gp(z,C),t[25]=C,t[26]=V):V=t[26];const te=n.filter(V);let le;t[27]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{O(null),Y(null),I(!0)},t[27]=le):le=t[27];const je=le;let pe;t[28]===Symbol.for("react.memo_cache_sentinel")?(pe=z=>{O(null),Y(z),I(!0)},t[28]=pe):pe=t[28];const De=pe;let fe;t[29]===Symbol.for("react.memo_cache_sentinel")?(fe=z=>{O(z),I(!0)},t[29]=fe):fe=t[29];const Ee=fe;let ct;t[30]!==$||t[31]!==B||t[32]!==n?(ct=(B&&n.find(z=>z.id===B.id))??B??$,t[30]=$,t[31]=B,t[32]=n,t[33]=ct):ct=t[33];const be=ct,ge=U||!!$;let Le;t[34]!==X?(Le=()=>{I(!1),O(null),Y(null),X()},t[34]=X,t[35]=Le):Le=t[35];const me=Le;if(r&&n.length===0){let z;return t[36]===Symbol.for("react.memo_cache_sentinel")?(z=d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(wr,{size:20,className:"animate-spin text-muted-foreground"})}),t[36]=z):z=t[36],z}const gt="relative flex min-h-0 flex-1 flex-col";let Ke;t[37]!==e?(Ke=e("taskBoard.taskBoard.tasksTitle"),t[37]=e,t[38]=Ke):Ke=t[38];let Ae;t[39]!==Ke?(Ae=d.jsx("h1",{className:"text-xl font-medium text-foreground",children:Ke}),t[39]=Ke,t[40]=Ae):Ae=t[40];let We;t[41]!==i?(We=i&&d.jsx(jp,{}),t[41]=i,t[42]=We):We=t[42];let Ze;t[43]!==C||t[44]!==n.length||t[45]!==x?(Ze=n.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"sm:hidden",children:d.jsx(kp,{filters:C,members:x,onChange:j})}),d.jsx("div",{className:"hidden sm:block",children:d.jsx(yp,{filters:C,members:x,onChange:j})})]}),t[43]=C,t[44]=n.length,t[45]=x,t[46]=Ze):Ze=t[46];const mt=k==="list";let Fe;t[47]!==A?(Fe=()=>{w("list"),A()},t[47]=A,t[48]=Fe):Fe=t[48];let Ve;t[49]!==e?(Ve=e("common.taskBoard.listView"),t[49]=e,t[50]=Ve):Ve=t[50];let Je;t[51]!==mt||t[52]!==Fe||t[53]!==Ve?(Je=d.jsx(Ki,{active:mt,onClick:Fe,icon:ao,label:Ve}),t[51]=mt,t[52]=Fe,t[53]=Ve,t[54]=Je):Je=t[54];const dt=k==="board";let ut;t[55]===Symbol.for("react.memo_cache_sentinel")?(ut=()=>w("board"),t[55]=ut):ut=t[55];let et;t[56]!==e?(et=e("common.taskBoard.boardView"),t[56]=e,t[57]=et):et=t[57];let tt;t[58]!==dt||t[59]!==et?(tt=d.jsx(Ki,{active:dt,onClick:ut,icon:sl,label:et}),t[58]=dt,t[59]=et,t[60]=tt):tt=t[60];let de;t[61]!==Je||t[62]!==tt?(de=d.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[Je,tt]}),t[61]=Je,t[62]=tt,t[63]=de):de=t[63];let we;t[64]===Symbol.for("react.memo_cache_sentinel")?(we=d.jsx(Jn,{size:16}),t[64]=we):we=t[64];let xe;t[65]!==e?(xe=e("taskBoard.taskBoard.newTask"),t[65]=e,t[66]=xe):xe=t[66];let Ne;t[67]!==xe?(Ne=d.jsxs(Xe,{size:"sm",onClick:je,children:[we,xe]}),t[67]=xe,t[68]=Ne):Ne=t[68];let ye;t[69]!==de||t[70]!==Ne?(ye=d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[de,Ne]}),t[69]=de,t[70]=Ne,t[71]=ye):ye=t[71];let Ce;t[72]!==Ze||t[73]!==ye?(Ce=d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ze,ye]}),t[72]=Ze,t[73]=ye,t[74]=Ce):Ce=t[74];let Te;t[75]!==Ae||t[76]!==We||t[77]!==Ce?(Te=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:[Ae,We,Ce]}),t[75]=Ae,t[76]=We,t[77]=Ce,t[78]=Te):Te=t[78];const Ue=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")})}):te.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(Xe,{variant:"outline",size:"sm",onClick:()=>j(zs),children:e("taskBoard.taskBoard.clearFilters")})]})}):k==="board"?d.jsx(zp,{items:te,members:x,memberByUserId:b,selectedIds:T,onToggleSelect:D,onSelectAllInLane:E,onOpen:Ee,onCreate:De,onMove:(z,ie,ke)=>{const Ge=sa(ke,z.length);z.forEach((xt,Kt)=>s.update.mutate({id:xt,status:ie,sortOrder:Ge[Kt]}))},onAssign:(z,ie)=>{m(ie)||s.update.mutate({id:z,assigneeId:ie})},onAutoFix:i?z=>{m(nt)||s.update.mutate({id:z.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:te.map(z=>d.jsx(Vp,{item:z,assignee:z.assigneeId?b.get(z.assigneeId):void 0,assignedBy:z.assignedBy?b.get(z.assignedBy):void 0,onOpen:()=>Ee(z)},z.id))})}),he=ge?be?.id??`new-${K??"default"}`:"closed",Be=be??void 0,Ie=K??void 0,qe=s.create.isPending||s.update.isPending;let Oe;t[79]!==s.create||t[80]!==s.update||t[81]!==be||t[82]!==m||t[83]!==me?(Oe=z=>{if(m(z.assigneeId)){me();return}be?s.update.mutate({id:be.id,...z}):s.create.mutate(z),me()},t[79]=s.create,t[80]=s.update,t[81]=be,t[82]=m,t[83]=me,t[84]=Oe):Oe=t[84];let $e;t[85]!==s.remove||t[86]!==be||t[87]!==me?($e=be?()=>{s.remove.mutate(be.id),me()}:void 0,t[85]=s.remove,t[86]=be,t[87]=me,t[88]=$e):$e=t[88];let Re;t[89]!==be||t[90]!==_?(Re=be?()=>{_(be)}:void 0,t[89]=be,t[90]=_,t[91]=Re):Re=t[91];let Me;t[92]!==me||t[93]!==P?(Me=z=>{z.virtualMcpId&&(me(),P(z.threadId,z.virtualMcpId,{main:z.hasPreview?"preview":"board"}))},t[92]=me,t[93]=P,t[94]=Me):Me=t[94];let He;t[95]!==me||t[96]!==ge||t[97]!==he||t[98]!==Be||t[99]!==Ie||t[100]!==qe||t[101]!==Oe||t[102]!==$e||t[103]!==Re||t[104]!==Me?(He=d.jsx(Mh,{open:ge,onClose:me,item:Be,defaultStatus:Ie,isSaving:qe,onSubmit:Oe,onDelete:$e,onNewChat:Re,onOpenThread:Me},he),t[95]=me,t[96]=ge,t[97]=he,t[98]=Be,t[99]=Ie,t[100]=qe,t[101]=Oe,t[102]=$e,t[103]=Re,t[104]=Me,t[105]=He):He=t[105];let vt;t[106]===Symbol.for("react.memo_cache_sentinel")?(vt=()=>h(!0),t[106]=vt):vt=t[106];let It;t[107]!==c?(It=d.jsx($p,{open:c,onOpenChange:f,onConnected:vt}),t[107]=c,t[108]=It):It=t[108];let ft;t[109]!==u?(ft=d.jsx(hl,{mode:"connection",open:u,onOpenChange:h}),t[109]=u,t[110]=ft):ft=t[110];let ht;t[111]!==s.remove||t[112]!==s.update||t[113]!==m||t[114]!==A||t[115]!==n||t[116]!==x||t[117]!==T?(ht=T.size>0&&d.jsx(Mp,{count:T.size,members:x,onMoveTo:z=>{for(const ie of T)s.update.mutate({id:ie,status:z});A()},onSetPriority:z=>{for(const ie of T)s.update.mutate({id:ie,priority:z});A()},onAddTag:z=>{for(const ie of T){const ke=n.find(xt=>xt.id===ie);if(!ke)continue;const Ge=ke.tags.map(Ip);Ge.includes(z)||s.update.mutate({id:ie,tagIds:[...Ge,z]})}A()},onAssign:z=>{if(!m(z)){for(const ie of T)s.update.mutate({id:ie,assigneeId:z});A()}},onSetDueDate:z=>{const ie=Ea(z);for(const ke of T)s.update.mutate({id:ke,dueDate:ie});A()},onAutoFix:T.size>0&&Array.from(T).every(z=>{const ie=n.find(ke=>ke.id===z);return ie&&(ie.status==="triage"||ie.status==="todo")&&ie.assigneeId!==nt})?()=>{if(!m(nt)){for(const z of T)s.update.mutate({id:z,assigneeId:nt});A()}}:void 0,onDelete:()=>{for(const z of T)s.remove.mutate(z);A()},onClear:A}),t[111]=s.remove,t[112]=s.update,t[113]=m,t[114]=A,t[115]=n,t[116]=x,t[117]=T,t[118]=ht):ht=t[118];let wt;return t[119]!==Te||t[120]!==Ue||t[121]!==He||t[122]!==It||t[123]!==ft||t[124]!==ht?(wt=d.jsxs("div",{className:gt,children:[Te,Ue,He,It,ft,ht]}),t[119]=Te,t[120]=Ue,t[121]=He,t[122]=It,t[123]=ft,t[124]=ht,t[125]=wt):wt=t[125],wt}function Ip(t){return t.id}function _p(){return[]}function Ap(t){return t.prs}function Bp(t){return[t.userId,t]}function Op(t){return t.status==="active"&&yl(t)!==null}function $p(t){const e=L.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=ce(),{connect:o,isConnecting:a}=bu("deco/mcp-github");let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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(ar,{className:"size-7"})})}),e[0]=l):l=e[0];let c;e[1]!==i?(c=i("taskBoard.taskBoard.connectGithubTitle"),e[1]=i,e[2]=c):c=e[2];let f;e[3]!==c?(f=d.jsx(Tr,{children:c}),e[3]=c,e[4]=f):f=e[4];let u;e[5]!==i?(u=i("taskBoard.taskBoard.connectGithubDescription"),e[5]=i,e[6]=u):u=e[6];let h;e[7]!==u?(h=d.jsx(pl,{children:u}),e[7]=u,e[8]=h):h=e[8];let p;e[9]!==f||e[10]!==h?(p=d.jsxs(gl,{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 y;e[16]!==a?(y=a?d.jsx(wr,{size:16,className:"animate-spin"}):d.jsx(ar,{className:"size-4"}),e[16]=a,e[17]=y):y=e[17];let x;e[18]!==i?(x=i("taskBoard.taskBoard.connectGithubButton"),e[18]=i,e[19]=x):x=e[19];let g;e[20]!==a||e[21]!==m||e[22]!==y||e[23]!==x?(g=d.jsx(ml,{children:d.jsxs(Xe,{onClick:m,disabled:a,className:"gap-2",children:[y,x]})}),e[20]=a,e[21]=m,e[22]=y,e[23]=x,e[24]=g):g=e[24];let b;e[25]!==g||e[26]!==p?(b=d.jsxs(jr,{className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[l,d.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[p,g]})]}),e[25]=g,e[26]=p,e[27]=b):b=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==b?(k=d.jsx(Dr,{open:n,onOpenChange:r,children:b}),e[28]=r,e[29]=n,e[30]=b,e[31]=k):k=e[31],k}function Mp(t){const e=L.c(91),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:a,onSetDueDate:l,onAutoFix:c,onDelete:f,onClear:u}=t,h=ce(),{data:p}=ho();let m;e[0]!==p?(m=p===void 0?[]:p,e[0]=p,e[1]=m):m=e[1];const y=m;let x;e[2]!==n||e[3]!==h?(x=h("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=h,e[4]=x):x=e[4];let g;e[5]!==x?(g=d.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:x}),e[5]=x,e[6]=g):g=e[6];let b;e[7]!==h?(b=h("taskBoard.taskBoard.actionsButton"),e[7]=h,e[8]=b):b=e[8];let k;e[9]!==b?(k=d.jsx(jn,{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:b})}),e[9]=b,e[10]=k):k=e[10];let w;e[11]!==h?(w=h("taskBoard.taskBoard.moveToButton"),e[11]=h,e[12]=w):w=e[12];let C;e[13]!==w?(C=d.jsx(Ln,{children:w}),e[13]=w,e[14]=C):C=e[14];let j;e[15]!==s||e[16]!==h?(j=As.map(_=>d.jsx(jt,{onClick:()=>s(_),children:h(yt[_].labelKey)},_)),e[15]=s,e[16]=h,e[17]=j):j=e[17];let S;e[18]!==j?(S=d.jsx(Pn,{children:j}),e[18]=j,e[19]=S):S=e[19];let T;e[20]!==S||e[21]!==C?(T=d.jsxs(zn,{children:[C,S]}),e[20]=S,e[21]=C,e[22]=T):T=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(Ln,{children:N}),e[25]=N,e[26]=R):R=e[26];let D;e[27]!==i||e[28]!==h?(D=Kr.map(_=>d.jsxs(jt,{onClick:()=>i(_),children:[d.jsx("span",{className:Z("size-2 rounded-full",kt[_].dotClassName)}),h(kt[_].labelKey)]},_)),e[27]=i,e[28]=h,e[29]=D):D=e[29];let E;e[30]!==D?(E=d.jsx(Pn,{children:D}),e[30]=D,e[31]=E):E=e[31];let M;e[32]!==R||e[33]!==E?(M=d.jsxs(zn,{children:[R,E]}),e[32]=R,e[33]=E,e[34]=M):M=e[34];let A;e[35]!==h?(A=h("taskBoard.taskBoard.assignButton"),e[35]=h,e[36]=A):A=e[36];let U;e[37]!==A?(U=d.jsx(Ln,{children:A}),e[37]=A,e[38]=U):U=e[38];let I;e[39]!==r||e[40]!==a?(I=d.jsx(Pn,{className:"w-56 p-0",children:d.jsx(ri,{members:r,onSelect:a})}),e[39]=r,e[40]=a,e[41]=I):I=e[41];let B;e[42]!==U||e[43]!==I?(B=d.jsxs(zn,{children:[U,I]}),e[42]=U,e[43]=I,e[44]=B):B=e[44];let O;e[45]!==h?(O=h("taskBoard.taskBoard.dueDateButton"),e[45]=h,e[46]=O):O=e[46];let K;e[47]!==O?(K=d.jsx(Ln,{children:O}),e[47]=O,e[48]=K):K=e[48];let Y;e[49]!==l?(Y=d.jsx(Pn,{className:"w-auto p-0",children:d.jsx(vo,{mode:"single",onSelect:_=>_&&l(_),initialFocus:!0})}),e[49]=l,e[50]=Y):Y=e[50];let P;e[51]!==K||e[52]!==Y?(P=d.jsxs(zn,{children:[K,Y]}),e[51]=K,e[52]=Y,e[53]=P):P=e[53];let q;e[54]!==o||e[55]!==y||e[56]!==h?(q=y.length>0&&d.jsxs(zn,{children:[d.jsx(Ln,{children:h("taskBoard.taskBoard.addTagButton")}),d.jsx(Pn,{children:y.map(_=>d.jsxs(jt,{onClick:()=>o(_.id),children:[d.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:ls(_.color)}}),_.name]},_.id))})]}),e[54]=o,e[55]=y,e[56]=h,e[57]=q):q=e[57];let Q;e[58]===Symbol.for("react.memo_cache_sentinel")?(Q=d.jsx(rl,{}),e[58]=Q):Q=e[58];let G;e[59]!==h?(G=h("taskBoard.taskBoard.deleteSelectedButton"),e[59]=h,e[60]=G):G=e[60];let ee;e[61]!==f||e[62]!==G?(ee=d.jsx(jt,{variant:"destructive",onClick:f,children:G}),e[61]=f,e[62]=G,e[63]=ee):ee=e[63];let W;e[64]!==T||e[65]!==M||e[66]!==B||e[67]!==P||e[68]!==q||e[69]!==ee?(W=d.jsxs(Dn,{align:"center",side:"top",children:[T,M,B,P,q,Q,ee]}),e[64]=T,e[65]=M,e[66]=B,e[67]=P,e[68]=q,e[69]=ee,e[70]=W):W=e[70];let ne;e[71]!==W||e[72]!==k?(ne=d.jsxs(Nn,{children:[k,W]}),e[71]=W,e[72]=k,e[73]=ne):ne=e[73];let J;e[74]!==c||e[75]!==h?(J=c&&d.jsxs("button",{type:"button",onClick:c,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(Cr,{size:14}),h("taskBoard.taskBoard.autoFix")]}),e[74]=c,e[75]=h,e[76]=J):J=e[76];let se;e[77]!==h?(se=h("taskBoard.taskBoard.clearSelectionButton"),e[77]=h,e[78]=se):se=e[78];let $;e[79]!==h?($=h("taskBoard.taskBoard.clearSelectionButton"),e[79]=h,e[80]=$):$=e[80];let F;e[81]===Symbol.for("react.memo_cache_sentinel")?(F=d.jsx(Cn,{size:16}),e[81]=F):F=e[81];let X;e[82]!==u||e[83]!==se||e[84]!==$?(X=d.jsx("button",{type:"button","aria-label":se,title:$,onClick:u,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:F}),e[82]=u,e[83]=se,e[84]=$,e[85]=X):X=e[85];let re;return e[86]!==ne||e[87]!==J||e[88]!==X||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,ne,J,X]})}),e[86]=ne,e[87]=J,e[88]=X,e[89]=g,e[90]=re):re=e[90],re}function Ki(t){const e=L.c(14),{active:n,onClick:r,icon:s,label:i}=t,o=ce();let a;e[0]!==i||e[1]!==o?(a=o("taskBoard.taskBoard.layoutViewAriaLabel",{label:i}),e[0]=i,e[1]=o,e[2]=a):a=e[2];const l=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let c;e[3]!==l?(c=Z("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",l),e[3]=l,e[4]=c):c=e[4];let f;e[5]!==s?(f=d.jsx(s,{size:14}),e[5]=s,e[6]=f):f=e[6];let u;return e[7]!==n||e[8]!==i||e[9]!==r||e[10]!==a||e[11]!==c||e[12]!==f?(u=d.jsxs("button",{type:"button",onClick:r,"aria-label":a,"aria-pressed":n,className:c,children:[f,i]}),e[7]=n,e[8]=i,e[9]=r,e[10]=a,e[11]=c,e[12]=f,e[13]=u):u=e[13],u}const Vn="lane:";function Wi(t,e){return t.sortOrder-e.sortOrder}function zp(t){const e=L.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:a,onOpen:l,onCreate:c,onMove:f,onAutoFix:u,onAssign:h}=t,[p,m]=v.useState(null);let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[x,g]=v.useState(y);let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=new Map,e[1]=b):b=e[1];const[k,w]=v.useState(b),C=v.useRef(null),j=k.size>0?n.map(_=>{const V=k.get(_.id);return V?{..._,...V}:_}):n;if(k.size>0&&!p){const _=[...k].filter(V=>{const[te,le]=V,je=n.find(pe=>pe.id===te);return je?.status===le.status&&je.sortOrder===le.sortOrder});_.length>0&&w(V=>{const te=new Map(V);for(const[le]of _)te.delete(le);return te})}cp(C,j.map(Up).join(","),p===null);const S=_=>j.filter(V=>V.status===_).sort(Wi),T=_=>{if(_===void 0)return null;const V=String(_);if(V.startsWith(Vn)){const te=V.slice(Vn.length);return As.find(le=>le===te)??null}return j.find(te=>te.id===V)?.status??null};let N;e[2]!==i?(N=_=>i.has(_)&&i.size>1?[_,...Array.from(i).filter(V=>V!==_)]:[_],e[2]=i,e[3]=N):N=e[3];const R=N;let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D=(_,V,te)=>{const le=sa(te,_.length);w(je=>{const pe=new Map(je);return _.forEach((De,fe)=>pe.set(De,{status:V,sortOrder:le[fe]})),pe})},e[4]=D):D=e[4];const E=D;let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M={activationConstraint:{distance:4}},e[5]=M):M=e[5];let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A={coordinateGetter:Ou},e[6]=A):A=e[6];const U=sd(di(Fr,M),di(Lr,A)),I=_=>{const V=String(_.active.id),te=T(_.over?.id),le=j.find(fe=>fe.id===V);if(!te||!le||le.status===te)return;const je=R(V),pe=String(_.over?.id??""),De=S(te).filter(fe=>!je.includes(fe.id));E(je,te,Ti(De,pe.startsWith(Vn)?null:pe,V))},B=_=>{const V=String(_.active.id);m(null);const te=T(_.over?.id)??j.find(ge=>ge.id===V)?.status;if(!te){w(new Map);return}const le=R(V),je=S(te),pe=String(_.over?.id??""),De=je.findIndex(ge=>ge.id===V),fe=pe.startsWith(Vn)?je.length-1:je.findIndex(ge=>ge.id===pe),it=De===-1||fe===-1?je:qr(je,De,fe);if(n.filter(ge=>ge.status===te).sort(Wi).map(Fp).join()===it.map(Pp).join()){w(new Map);return}const ct=it.slice(it.findIndex(ge=>ge.id===V)+1).find(ge=>!le.includes(ge.id)),be=Ti(je.filter(ge=>!le.includes(ge.id)),ct?.id??null,V);E(le,te,be),g(le),f(le,te,be)},O=p?j.find(_=>_.id===p):null;let K;e[7]!==p||e[8]!==R?(K=p?R(p):[],e[7]=p,e[8]=R,e[9]=K):K=e[9];const Y=K,P=Jd,q=Bo;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>{m(String(_.active.id)),g([])},e[10]=Q):Q=e[10];let G;e[11]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{m(null),w(new Map)},e[11]=G):G=e[11];const ee=As.map(_=>d.jsx(qp,{status:_,items:S(_),members:r,memberByUserId:s,selectedIds:i,isTarget:O?.status===_,hiddenIds:Y,landedIds:x,onToggleSelect:o,onSelectAllInLane:a,onOpen:l,onCreate:c,onAutoFix:u,onAssign:h},_));let W;e[12]!==ee?(W=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:ee})}),e[12]=ee,e[13]=W):W=e[13];const ne=Ut.createPortal,J=xu,se=null,$=O&&d.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[d.jsx(La,{item:O,assignee:O.assigneeId?s.get(O.assigneeId):void 0,assignedBy:O.assignedBy?s.get(O.assignedBy):void 0,selected:i.has(O.id),onOpen:Lp,className:"w-full shadow-lg"}),Y.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:Y.length})]});let F;e[14]!==J||e[15]!==$?(F=d.jsx(J,{dropAnimation:se,children:$}),e[14]=J,e[15]=$,e[16]=F):F=e[16];let X;e[17]!==ne||e[18]!==F?(X=ne(F,document.body),e[17]=ne,e[18]=F,e[19]=X):X=e[19];let re;return e[20]!==P||e[21]!==B||e[22]!==I||e[23]!==U||e[24]!==G||e[25]!==W||e[26]!==X||e[27]!==q||e[28]!==Q?(re=d.jsxs(P,{sensors:U,collisionDetection:q,onDragStart:Q,onDragOver:I,onDragEnd:B,onDragCancel:G,children:[W,X]}),e[20]=P,e[21]=B,e[22]=I,e[23]=U,e[24]=G,e[25]=W,e[26]=X,e[27]=q,e[28]=Q,e[29]=re):re=e[29],re}function Lp(){}function Pp(t){return t.id}function Fp(t){return t.id}function Up(t){return`${t.id}:${t.status}`}function qp(t){const e=L.c(91),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:a,hiddenIds:l,landedIds:c,onToggleSelect:f,onSelectAllInLane:u,onOpen:h,onCreate:p,onAutoFix:m,onAssign:y}=t,x=ce(),g=yt[n],b=g.icon,k=`${Vn}${n}`;let w;e[0]!==k?(w={id:k},e[0]=k,e[1]=w):w=e[1];const{setNodeRef:C}=Yo(w),j=a&&"bg-muted/50";let S;e[2]!==j?(S=Z("flex h-full w-[300px] shrink-0 flex-col rounded-xl py-1 transition-colors",j),e[2]=j,e[3]=S):S=e[3];const T=a?"bg-muted":"bg-background";let N;e[4]!==T?(N=Z("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",T),e[4]=T,e[5]=N):N=e[5];let R;e[6]!==g.iconClassName?(R=Z("shrink-0",g.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=g.iconClassName,e[7]=R):R=e[7];let D;e[8]!==b||e[9]!==R?(D=d.jsx(b,{size:15,className:R}),e[8]=b,e[9]=R,e[10]=D):D=e[10];let E;e[11]!==g.labelKey||e[12]!==x?(E=x(g.labelKey),e[11]=g.labelKey,e[12]=x,e[13]=E):E=e[13];let M;e[14]!==E?(M=d.jsx("span",{className:"text-sm font-medium text-foreground",children:E}),e[14]=E,e[15]=M):M=e[15];let A;e[16]!==r.length?(A=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]=A):A=e[17];let U;e[18]!==g.labelKey||e[19]!==x?(U=x("taskBoard.taskBoard.laneMenuAriaLabel",{lane:x(g.labelKey)}),e[18]=g.labelKey,e[19]=x,e[20]=U):U=e[20];let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=d.jsx(ro,{size:15}),e[21]=I):I=e[21];let B;e[22]!==U?(B=d.jsx(jn,{asChild:!0,children:d.jsx("button",{type:"button","aria-label":U,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:I})}),e[22]=U,e[23]=B):B=e[23];let O;e[24]!==u||e[25]!==n?(O=()=>u(n),e[24]=u,e[25]=n,e[26]=O):O=e[26];let K;e[27]!==x?(K=x("taskBoard.taskBoard.selectAllInLane"),e[27]=x,e[28]=K):K=e[28];let Y;e[29]!==O||e[30]!==K?(Y=d.jsx(Dn,{align:"end",children:d.jsx(jt,{onClick:O,children:K})}),e[29]=O,e[30]=K,e[31]=Y):Y=e[31];let P;e[32]!==B||e[33]!==Y?(P=d.jsxs(Nn,{children:[B,Y]}),e[32]=B,e[33]=Y,e[34]=P):P=e[34];let q;e[35]!==g.labelKey||e[36]!==x?(q=x("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:x(g.labelKey)}),e[35]=g.labelKey,e[36]=x,e[37]=q):q=e[37];let Q;e[38]!==g.labelKey||e[39]!==x?(Q=x("taskBoard.taskBoard.newTaskInLaneTitle",{lane:x(g.labelKey)}),e[38]=g.labelKey,e[39]=x,e[40]=Q):Q=e[40];let G;e[41]!==p||e[42]!==n?(G=()=>p(n),e[41]=p,e[42]=n,e[43]=G):G=e[43];let ee;e[44]===Symbol.for("react.memo_cache_sentinel")?(ee=d.jsx(Jn,{size:15}),e[44]=ee):ee=e[44];let W;e[45]!==q||e[46]!==Q||e[47]!==G?(W=d.jsx("button",{type:"button","aria-label":q,title:Q,onClick:G,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:ee}),e[45]=q,e[46]=Q,e[47]=G,e[48]=W):W=e[48];let ne;e[49]!==M||e[50]!==A||e[51]!==P||e[52]!==W||e[53]!==N||e[54]!==D?(ne=d.jsxs("div",{className:N,children:[D,M,A,P,W]}),e[49]=M,e[50]=A,e[51]=P,e[52]=W,e[53]=N,e[54]=D,e[55]=ne):ne=e[55];let J;e[56]!==r?(J=r.map(Hp),e[56]=r,e[57]=J):J=e[57];let se;if(e[58]!==l||e[59]!==r||e[60]!==c||e[61]!==i||e[62]!==s||e[63]!==y||e[64]!==m||e[65]!==h||e[66]!==f||e[67]!==o){let re;e[69]!==l||e[70]!==c||e[71]!==i||e[72]!==s||e[73]!==y||e[74]!==m||e[75]!==h||e[76]!==f||e[77]!==o?(re=_=>d.jsx(Kp,{item:_,assignee:_.assigneeId?i.get(_.assigneeId):void 0,assignedBy:_.assignedBy?i.get(_.assignedBy):void 0,members:s,selected:o.has(_.id),hidden:l.includes(_.id),landed:c.includes(_.id),onToggleSelect:()=>f(_.id),onOpen:()=>h(_),onAutoFix:m?()=>m(_):void 0,onAssign:y?V=>y(_.id,V):void 0},_.id),e[69]=l,e[70]=c,e[71]=i,e[72]=s,e[73]=y,e[74]=m,e[75]=h,e[76]=f,e[77]=o,e[78]=re):re=e[78],se=r.map(re),e[58]=l,e[59]=r,e[60]=c,e[61]=i,e[62]=s,e[63]=y,e[64]=m,e[65]=h,e[66]=f,e[67]=o,e[68]=se}else se=e[68];let $;e[79]!==J||e[80]!==se?($=d.jsx(Tu,{items:J,strategy:Su,children:se}),e[79]=J,e[80]=se,e[81]=$):$=e[81];let F;e[82]!==C||e[83]!==n||e[84]!==$?(F=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:$}),e[82]=C,e[83]=n,e[84]=$,e[85]=F):F=e[85];let X;return e[86]!==n||e[87]!==ne||e[88]!==F||e[89]!==S?(X=d.jsxs("div",{"data-lane":n,className:S,children:[ne,F]}),e[86]=n,e[87]=ne,e[88]=F,e[89]=S,e[90]=X):X=e[90],X}function Hp(t){return t.id}function Kp(t){const e=L.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:a,listeners:l,setNodeRef:c,transform:f,transition:u,isDragging:h}=_u(o),p=r.id,m=r.status;let y;e[7]!==a||e[8]!==l?(y={attributes:a,listeners:l},e[7]=a,e[8]=l,e[9]=y):y=e[9];const x=s&&"animate-card-land";let g;e[10]!==x?(g=Z("w-full",x),e[10]=x,e[11]=g):g=e[11];let b;e[12]!==f?(b=Ht.Translate.toString(f),e[12]=f,e[13]=b):b=e[13];const k=h||n?0:void 0;let w;e[14]!==b||e[15]!==k||e[16]!==u?(w={transform:b,transition:u,opacity:k},e[14]=b,e[15]=k,e[16]=u,e[17]=w):w=e[17];let C;e[18]!==r||e[19]!==i||e[20]!==c||e[21]!==y||e[22]!==g||e[23]!==w?(C=d.jsx(La,{...i,item:r,dragRef:c,bindings:y,className:g,style:w}),e[18]=r,e[19]=i,e[20]=c,e[21]=y,e[22]=g,e[23]=w,e[24]=C):C=e[24];let j;return e[25]!==r.id||e[26]!==r.status||e[27]!==C?(j=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]=j):j=e[28],j}function La(t){const e=L.c(43),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:a,dragRef:l,bindings:c,style:f,onToggleSelect:u,onOpen:h,onAutoFix:p,onAssign:m}=t,y=ce(),x=yt[n.status].icon,g=Pu(n)?.lastMessage,b=p&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==nt,k=c?.attributes,w=c?.listeners;let C;e[0]!==h||e[1]!==u?(C=O=>{O.shiftKey&&u?u():h()},e[0]=h,e[1]=u,e[2]=C):C=e[2];const j=o&&"bg-accent";let S;e[3]!==a||e[4]!==j?(S=Z("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",j,a),e[3]=a,e[4]=j,e[5]=S):S=e[5];const T=n.title;let N;e[6]!==n?(N=Z("mt-px shrink-0",Hr(n)),e[6]=n,e[7]=N):N=e[7];let R;e[8]!==x||e[9]!==N?(R=d.jsx(x,{size:16,className:N}),e[8]=x,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 E;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==m?(E=d.jsx(Ma,{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]=E):E=e[18];let M;e[19]!==E||e[20]!==R||e[21]!==D?(M=d.jsxs("div",{className:"flex items-start gap-2",children:[R,D,E]}),e[19]=E,e[20]=R,e[21]=D,e[22]=M):M=e[22];let A;e[23]!==g?(A=g&&d.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:g}),e[23]=g,e[24]=A):A=e[24];let U;e[25]!==n?(U=(_s(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:[_s(n)&&d.jsx(Aa,{}),n.priority!=="none"&&d.jsx(Ba,{priority:n.priority}),n.dueDate&&d.jsx(Oa,{iso:n.dueDate}),n.tags.map(Wp)]}),e[25]=n,e[26]=U):U=e[26];let I;e[27]!==p||e[28]!==b||e[29]!==y?(I=b&&d.jsxs("button",{type:"button",onClick:O=>{O.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(Cr,{size:12}),y("taskBoard.taskBoard.autoFix")]}),e[27]=p,e[28]=b,e[29]=y,e[30]=I):I=e[30];let B;return e[31]!==l||e[32]!==n.title||e[33]!==f||e[34]!==k||e[35]!==M||e[36]!==A||e[37]!==U||e[38]!==I||e[39]!==w||e[40]!==C||e[41]!==S?(B=d.jsxs("button",{type:"button",ref:l,style:f,...k,...w,onClick:C,className:S,title:T,children:[M,A,U,I]}),e[31]=l,e[32]=n.title,e[33]=f,e[34]=k,e[35]=M,e[36]=A,e[37]=U,e[38]=I,e[39]=w,e[40]=C,e[41]=S,e[42]=B):B=e[42],B}function Wp(t){return d.jsx($a,{tag:t},t.id)}function Vp(t){const e=L.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=yt[n.status].icon;let a;e[0]!==n?(a=Z("shrink-0",Hr(n)),e[0]=n,e[1]=a):a=e[1];let l;e[2]!==o||e[3]!==a?(l=d.jsx(o,{size:16,className:a}),e[2]=o,e[3]=a,e[4]=l):l=e[4];let c;e[5]!==n.title?(c=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]=c):c=e[6];let f;e[7]!==n?(f=_s(n)&&d.jsx(Aa,{}),e[7]=n,e[8]=f):f=e[8];let u;e[9]!==n.priority?(u=n.priority!=="none"&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(Ba,{priority:n.priority})}),e[9]=n.priority,e[10]=u):u=e[10];let h;e[11]!==n.dueDate?(h=n.dueDate&&d.jsx("span",{className:"hidden sm:inline-flex",children:d.jsx(Oa,{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(Gp),n.tags.length>2&&d.jsxs("span",{className:ds,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(Ma,{item:n,assignee:r,assignedBy:s}),e[15]=s,e[16]=r,e[17]=n,e[18]=m):m=e[18];let y;e[19]!==n.createdAt?(y=fo(new Date(n.createdAt)),e[19]=n.createdAt,e[20]=y):y=e[20];let x;e[21]!==y?(x=d.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:y}),e[21]=y,e[22]=x):x=e[22];let g;return e[23]!==i||e[24]!==x||e[25]!==l||e[26]!==c||e[27]!==f||e[28]!==u||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:[l,c,f,u,h,p,m,x]}),e[23]=i,e[24]=x,e[25]=l,e[26]=c,e[27]=f,e[28]=u,e[29]=h,e[30]=p,e[31]=m,e[32]=g):g=e[32],g}function Gp(t){return d.jsx($a,{tag:t},t.id)}const lm=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:za,default:Dp},Symbol.toStringTag,{value:"Module"}));export{lm as $,Ou as A,qr as B,Ht as C,Jd as D,zu as E,Lu as F,yt as G,Ug as H,kt as I,Ot as J,Lr as K,at as L,rm as M,Vg as N,im as O,Fr as P,Qg as Q,am as R,vc as S,Mh as T,Bc as U,Gg as V,Zg as W,nm as X,Xg as Y,za as Z,Zo as _,wc as a,Wg as b,em as c,uc as d,Hg as e,tm as f,Oc as g,sm as h,gc as i,Yg as j,Jg as k,Pc as l,Mc as m,Uc as n,sd as o,di as p,xu as q,qg as r,nu as s,bu as t,Kg as u,om as v,hc as w,Tu as x,Su as y,_u as z};