decocms 4.183.0 → 4.184.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/client/assets/{AlertCircle-aHlHbnDb.js → AlertCircle-B3JS1Ogr.js} +1 -1
  2. package/dist/client/assets/{AreaChart-C9lpd8CL.js → AreaChart-BMS62HNl.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-D_cT_UIc.js → ArrowUp-D9KeZg3z.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DiazbKfV.js → ArrowUpRight-C7vjzlfR.js} +1 -1
  5. package/dist/client/assets/{Check-DsLsfmyq.js → Check-C-LauNEP.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-BimqoBAV.js → CheckCircle-BAtVWz02.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Gy6tdNNK.js → ChevronDown-BR_rY5I7.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-p52nlbDc.js → ChevronRight-DNaF9GmC.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Beib2ITZ.js → ChevronUp-DYqaZocr.js} +1 -1
  10. package/dist/client/assets/{Copy01-B2ony-bk.js → Copy01-b-czDxAP.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-CYFRGV0B.js → CpuChip01-CzTGabjK.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-CzlEqb4G.js → CreditCard01-DHT3Rv6c.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-DVq3-Xga.js → DotsVertical-SHbBfUyY.js} +1 -1
  14. package/dist/client/assets/{Eye-ZlvbuHCY.js → Eye-CWQ6QYQ_.js} +1 -1
  15. package/dist/client/assets/{FilterLines-DvNHcDU-.js → FilterLines-FKt18eu-.js} +1 -1
  16. package/dist/client/assets/{HardDrive-BbR87PFj.js → HardDrive--Ca3_i9z.js} +1 -1
  17. package/dist/client/assets/{Key01-x95Mn7re.js → Key01-Cxb_dTY9.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-RBcOzvvA.js → LayoutLeft-619VnLrS.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-CEVoEXFf.js → LinkExternal01-B7fSoBl7.js} +1 -1
  20. package/dist/client/assets/{LogOut01-DJmrA8Cf.js → LogOut01-8nsv1Zrx.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CQzjDQf4.js → Monitor01-Ddtu0GLO.js} +1 -1
  22. package/dist/client/assets/{Palette-Dp2ItXNP.js → Palette-BjvX1ruC.js} +1 -1
  23. package/dist/client/assets/{Play-D37hNiER.js → Play-B6BIJve0.js} +1 -1
  24. package/dist/client/assets/{Plus-CYTAnozl.js → Plus-BQ3wCu8K.js} +1 -1
  25. package/dist/client/assets/{SearchLg-Cx4jk9h6.js → SearchLg-Bf0OE8pv.js} +1 -1
  26. package/dist/client/assets/{SearchMd-Bc7HkOwh.js → SearchMd-DDYxMG_A.js} +1 -1
  27. package/dist/client/assets/{Settings02-DQ9TLzbe.js → Settings02-C8JbwZnu.js} +1 -1
  28. package/dist/client/assets/{Shield01-0dWGhNPX.js → Shield01-n9H7rn2N.js} +1 -1
  29. package/dist/client/assets/{Star01-D3YkMrr2.js → Star01-B_crwKS8.js} +1 -1
  30. package/dist/client/assets/{Stars01-Ch7SWtYI.js → Stars01-C1ltyRgO.js} +1 -1
  31. package/dist/client/assets/{Stars02-DEemClqG.js → Stars02-CrM-SKfV.js} +1 -1
  32. package/dist/client/assets/{Sun-BDvHb-XG.js → Sun-EctD6SlF.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-DGkeBrwY.js → SwitchHorizontal01-LVXImEqS.js} +1 -1
  34. package/dist/client/assets/{Tool01-DCGn5a1p.js → Tool01-C13i3FWq.js} +1 -1
  35. package/dist/client/assets/{Tool02-u405-St7.js → Tool02-DUySVGxt.js} +1 -1
  36. package/dist/client/assets/{Trash01-CuJXZ9ct.js → Trash01-C_efCdAs.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-B7LNIgea.js → TrendUp01-BgnnhLXr.js} +1 -1
  38. package/dist/client/assets/{Upload01-Bt-Amwu8.js → Upload01-sXK5QJkl.js} +1 -1
  39. package/dist/client/assets/{User01-DhhpGrEM.js → User01-DQ1vt8a0.js} +1 -1
  40. package/dist/client/assets/{Users01-BClCd9pB.js → Users01-Do4gmbPq.js} +1 -1
  41. package/dist/client/assets/{Users03-zwY1jsVI.js → Users03-BcYjhwHT.js} +1 -1
  42. package/dist/client/assets/{X-BzjpT-15.js → X-ypK_5s2v.js} +1 -1
  43. package/dist/client/assets/{XCircle-Kc6c0cNF.js → XCircle-CVncmwo8.js} +1 -1
  44. package/dist/client/assets/{XClose-Dj2IAH6X.js → XClose-BewBCx_H.js} +1 -1
  45. package/dist/client/assets/{Zap-BPtJMphd.js → Zap-BVnrXYPx.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-BqYG4BTa.js → ZapSquare-CK2EnhlO.js} +1 -1
  47. package/dist/client/assets/{access-gate-DeGo_FW7.js → access-gate-gdInAd9D.js} +1 -1
  48. package/dist/client/assets/{add-section-modal-C8k7f243.js → add-section-modal-Dsb07QT9.js} +1 -1
  49. package/dist/client/assets/{agent-icon-BWGWhQlT.js → agent-icon-CG09iBgJ.js} +1 -1
  50. package/dist/client/assets/{agents-list-C_S5EB33.js → agents-list-CxTuXJiz.js} +1 -1
  51. package/dist/client/assets/{ai-providers-BsPG_oo0.js → ai-providers-50eDPRO_.js} +1 -1
  52. package/dist/client/assets/{alert-ZpmpvnWA.js → alert-cYzFjVuf.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-CXphytq4.js → alert-dialog-CquqUuRD.js} +1 -1
  54. package/dist/client/assets/{app-editor-Cdig6lrQ.js → app-editor-BIp-SPOE.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-CUj_T4PL.js → auth-catchall-Y9gjp8x5.js} +1 -1
  56. package/dist/client/assets/{auth-entry-kHRdwDyb.js → auth-entry-D_uyCSIa.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-BI6iKy4H.js → auth-split-layout-BFduyX9Q.js} +1 -1
  58. package/dist/client/assets/{auth--o3OMG5b.js → auth-xxR7y6tl.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-Dkxj-fDE.js → authenticate-and-persist-oauth-k5Z-pOOh.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-C9ge79g9.js → automation-list-row-CHCVO6NE.js} +1 -1
  61. package/dist/client/assets/{automation-runs-Zy_KQAaa.js → automation-runs-iQ7GyF0U.js} +1 -1
  62. package/dist/client/assets/{automations-ZoE5nu4n.js → automations-DeMGyuP4.js} +1 -1
  63. package/dist/client/assets/{avatar-D8IHFMGF.js → avatar-D2tOztUd.js} +1 -1
  64. package/dist/client/assets/{badge-BqrqB_uj.js → badge-D8pOsxKV.js} +1 -1
  65. package/dist/client/assets/{billing-DDGDj7E3.js → billing-CeHAuexv.js} +1 -1
  66. package/dist/client/assets/{block-document-B7Gp0qyP.js → block-document-0akRZYsC.js} +1 -1
  67. package/dist/client/assets/{brand-context-CLnHC6Ni.js → brand-context-DLuDCZRi.js} +1 -1
  68. package/dist/client/assets/{buckets-D-zJv4te.js → buckets-Bfd_j2Km.js} +1 -1
  69. package/dist/client/assets/{bulk-category-panel-Dktf13dG.js → bulk-category-panel-Bzoc6rdI.js} +1 -1
  70. package/dist/client/assets/{calendar-D9j8nchp.js → calendar-VVAQUXnL.js} +1 -1
  71. package/dist/client/assets/{capability-load-error-DFcYAh39.js → capability-load-error-CQdkThFQ.js} +1 -1
  72. package/dist/client/assets/{card-B7oxfapp.js → card-DYTU8rq7.js} +1 -1
  73. package/dist/client/assets/{category-editor-Jo5SYWHw.js → category-editor-Bhcsodv9.js} +1 -1
  74. package/dist/client/assets/{chat-context-DDx13UY-.js → chat-context-GCEjbEBj.js} +1 -1
  75. package/dist/client/assets/{checkbox-DjFipj8q.js → checkbox-CXTjTXUs.js} +1 -1
  76. package/dist/client/assets/{cli-auth-success-C2UzPn9p.js → cli-auth-success-VQyjBBAB.js} +1 -1
  77. package/dist/client/assets/{collection-detail-te_AeyJe.js → collection-detail-C26eu1Jv.js} +1 -1
  78. package/dist/client/assets/{collection-display-button--2wcPOHU.js → collection-display-button-CX7FxCDx.js} +1 -1
  79. package/dist/client/assets/{collection-search-CXF9dytt.js → collection-search-Dw7EfxX-.js} +1 -1
  80. package/dist/client/assets/{collection-table-wrapper-C2h_ch5y.js → collection-table-wrapper-BrLnTwVA.js} +1 -1
  81. package/dist/client/assets/{collection-tabs-CsWR5nay.js → collection-tabs-B3WFfHWI.js} +1 -1
  82. package/dist/client/assets/{command-C4tHruaX.js → command-AYLm7ZwQ.js} +1 -1
  83. package/dist/client/assets/{commerce-onboarding-DGva3K20.js → commerce-onboarding-DlJhSB6g.js} +1 -1
  84. package/dist/client/assets/{companions-core-cILfPFw3.js → companions-core-BRC46RL7.js} +1 -1
  85. package/dist/client/assets/{connect-3QoHmREd.js → connect-D39aX-bO.js} +1 -1
  86. package/dist/client/assets/{connection-DzNQpqTF.js → connection-BWmmybbw.js} +1 -1
  87. package/dist/client/assets/{connection-card-CBQz28WE.js → connection-card-DHCHpIgN.js} +1 -1
  88. package/dist/client/assets/{connection-detail-BddeBzDN.js → connection-detail-C7ifYQvZ.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-CqJuDNdY.js → connection-form-helpers-YtamX_oI.js} +1 -1
  90. package/dist/client/assets/{connections-BlOBTOmX.js → connections-DRXr97Ow.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-DyKEiI_2.js → decopilot-sse-pool-BuDEKE2B.js} +1 -1
  92. package/dist/client/assets/{dialog-Bt7eMv3e.js → dialog-DSJ_GZJt.js} +1 -1
  93. package/dist/client/assets/{domain-settings-CwOwtnaa.js → domain-settings-QXVJq8E8.js} +1 -1
  94. package/dist/client/assets/{drawer-B7RnJ3wR.js → drawer-BoNzql-k.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-DXoRyF9G.js → dropdown-menu-Dl-K6r1z.js} +1 -1
  96. package/dist/client/assets/{empty-state-3ZrQMmKM.js → empty-state-DU0gJX7R.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-BbUsFp4U.js → extract-connection-data-C8kYmTwA.js} +1 -1
  98. package/dist/client/assets/{file-explorer-BR-DaOMR.js → file-explorer-Dd_UXfQe.js} +1 -1
  99. package/dist/client/assets/{form-Cm9-K_rL.js → form-CfXwbDnQ.js} +1 -1
  100. package/dist/client/assets/{general-DTwuZdOG.js → general-cjioWpU5.js} +1 -1
  101. package/dist/client/assets/{github-repo-picker-DAdNsHq6.js → github-repo-picker-BX2_UCL9.js} +1 -1
  102. package/dist/client/assets/{hooks-D3fXgaRp.js → hooks-BnzTub3t.js} +1 -1
  103. package/dist/client/assets/{index-BNKeySBB.js → index-BOOmt4KH.js} +1 -1
  104. package/dist/client/assets/{index-BFs6Lkwg.js → index-BU4e8BQP.js} +1 -1
  105. package/dist/client/assets/{index-BGSP2DZy.js → index-BiL1coyY.js} +1 -1
  106. package/dist/client/assets/index-BnjU2dTw.js +77 -0
  107. package/dist/client/assets/{index-CQEfPss7.js → index-C7Jqgqec.js} +1 -1
  108. package/dist/client/assets/{index-CFiuX5sg.js → index-CZI3aMGz.js} +5 -5
  109. package/dist/client/assets/{index-GcKXz6Hm.js → index-CzkBTHyl.js} +1 -1
  110. package/dist/client/assets/{index-DggacYgX.js → index-D5s7iB_G.js} +31 -31
  111. package/dist/client/assets/{index-BUdJATnr.js → index-D8679f_U.js} +1 -1
  112. package/dist/client/assets/{index-B1T-Hggy.js → index-DEa1H475.js} +1 -1
  113. package/dist/client/assets/{index-dMwoGHXT.js → index-DTdwBEkE.js} +1 -1
  114. package/dist/client/assets/{index-jYWRycIN.js → index-UhwFQSWG.js} +1 -1
  115. package/dist/client/assets/{index-redirect-lhUtCXDG.js → index-redirect-ISnwOhy2.js} +1 -1
  116. package/dist/client/assets/{input-S84m9AtW.js → input-BLW13qDV.js} +1 -1
  117. package/dist/client/assets/{integration-icon-BWHDNAQl.js → integration-icon-DiC7PYLo.js} +1 -1
  118. package/dist/client/assets/{invite-member-dialog-DaWTmsq7.js → invite-member-dialog-DknO-g5T.js} +1 -1
  119. package/dist/client/assets/{label-Cxo79mbH.js → label-CdAnELsh.js} +1 -1
  120. package/dist/client/assets/{layout-CPKT8BYo.js → layout-Chy4pfib.js} +1 -1
  121. package/dist/client/assets/{login-aJtfxjHn.js → login-DTpypykn.js} +1 -1
  122. package/dist/client/assets/{mcp-oauth-NDbJg_iw.js → mcp-oauth-D1xsqTbw.js} +1 -1
  123. package/dist/client/assets/{members-CgS_OZzg.js → members-445MstFS.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-C8BkmFBS.js → monaco-editor-d6E7Zvd9.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-CyYAcnRa.js → monitoring-stats-row-DKN2Z1_i.js} +1 -1
  126. package/dist/client/assets/{multi-select-CvZQPSvi.js → multi-select-CfCRhmSe.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-CH5EsTkQ.js → oauth-callback-DJvOMDUI.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-B9KI1_GL.js → oauth-callback-ai-provider-BdhWesBZ.js} +1 -1
  129. package/dist/client/assets/{onboarding-CI22ROnk.js → onboarding-CS8UTzzK.js} +1 -1
  130. package/dist/client/assets/{org-layout-C0CMMpXp.js → org-layout-_EcLoVko.js} +1 -1
  131. package/dist/client/assets/{organization-choice-BEuogrJI.js → organization-choice-BxSBJQGA.js} +1 -1
  132. package/dist/client/assets/{orgs-CddRmFS9.js → orgs-GuS4oucW.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-C0fN-ar5.js → page-seo-form-B9po7fEi.js} +1 -1
  134. package/dist/client/assets/{popover-Dwceexuc.js → popover-D2qLkEGb.js} +1 -1
  135. package/dist/client/assets/{post-editor-CitSA7UI.js → post-editor-Deu2F14G.js} +1 -1
  136. package/dist/client/assets/{primitives-DAACRO6I.js → primitives-pV6A0yki.js} +1 -1
  137. package/dist/client/assets/{profile-CfNHZBsV.js → profile-c2z8X6Kq.js} +1 -1
  138. package/dist/client/assets/project-app-view-CcHtyOQQ.js +1 -0
  139. package/dist/client/assets/record-editor-BA-UmwkJ.js +1 -0
  140. package/dist/client/assets/{redirect-editor-AL8rcugk.js → redirect-editor-BibKbBqp.js} +1 -1
  141. package/dist/client/assets/registry-C3cqMqjN.js +2 -0
  142. package/dist/client/assets/{registry-layout-D0rOgojZ.js → registry-layout-C3zb9sDp.js} +1 -1
  143. package/dist/client/assets/{reports-CnvwYvHM.js → reports-EmI1mHpW.js} +1 -1
  144. package/dist/client/assets/{require-capability-UF2IeQzP.js → require-capability-CaR1pXbU.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-Bn7ai5Eo.js → required-auth-layout-CUZmEaxs.js} +1 -1
  146. package/dist/client/assets/{reset-password-D41yofU2.js → reset-password-CBXAvhH9.js} +1 -1
  147. package/dist/client/assets/roles-mZf8kH6y.js +1 -0
  148. package/dist/client/assets/{search-input-DU57HG_B.js → search-input-DDVxkABf.js} +1 -1
  149. package/dist/client/assets/{secrets-B7k27ig5.js → secrets-B_9IMoe1.js} +1 -1
  150. package/dist/client/assets/{sections-editor-BzrLZDzy.js → sections-editor-DB_QzUbA.js} +1 -1
  151. package/dist/client/assets/{select-CZJm-gAJ.js → select-CWnB_uQx.js} +1 -1
  152. package/dist/client/assets/{select-model-WWZE18E0.js → select-model-LJrrvVPW.js} +1 -1
  153. package/dist/client/assets/{self-tool-result-BDhtzDsR.js → self-tool-result-Bz21E3aZ.js} +1 -1
  154. package/dist/client/assets/{seo-editor-mhVkTzCF.js → seo-editor-Cp7502yh.js} +1 -1
  155. package/dist/client/assets/{settings-layout-Z0R5T-5p.js → settings-layout-GF-G0wjF.js} +1 -1
  156. package/dist/client/assets/{settings-section--7J4fXfn.js → settings-section-ZIpqpn6u.js} +1 -1
  157. package/dist/client/assets/{shell-controls-C5mJqJqc.js → shell-controls-Bng45Su0.js} +1 -1
  158. package/dist/client/assets/{shell-layout-BZ1bp6KG.js → shell-layout-DnVpUUuI.js} +1 -1
  159. package/dist/client/assets/{sidebar-CXetie7M.js → sidebar-BghCVHZt.js} +1 -1
  160. package/dist/client/assets/{skeleton-jicxowh6.js → skeleton-lc9kh8qd.js} +1 -1
  161. package/dist/client/assets/{spinner-Dzm37O12.js → spinner-D1VHlCPg.js} +1 -1
  162. package/dist/client/assets/{sso-DrbZ_2Mu.js → sso-BR_j0lud.js} +1 -1
  163. package/dist/client/assets/{store-BwGelpbM.js → store-DL3KLkjK.js} +1 -1
  164. package/dist/client/assets/store-registry-YLkbINDi.js +2 -0
  165. package/dist/client/assets/{studio-tools-BbM6-UA7.js → studio-tools-Dnhai2E2.js} +1 -1
  166. package/dist/client/assets/{switch-B6O3Y-gU.js → switch-5ORj8iPy.js} +1 -1
  167. package/dist/client/assets/{tab-id-DSuKogLf.js → tab-id-BkkhJopj.js} +1 -1
  168. package/dist/client/assets/{table-Epe56N8S.js → table-dGsHWyfu.js} +1 -1
  169. package/dist/client/assets/{tabs-DxfQVAOw.js → tabs-BLQN3Bzj.js} +1 -1
  170. package/dist/client/assets/{textarea-Dfq_bmlL.js → textarea-89LUuJW5.js} +1 -1
  171. package/dist/client/assets/{toggle-group-BN1gjQvQ.js → toggle-group-1VbMPded.js} +1 -1
  172. package/dist/client/assets/{toolbar-C9jumvgT.js → toolbar-Dx6B96vS.js} +1 -1
  173. package/dist/client/assets/{tooltip-MlLH1_Dh.js → tooltip-aoWInzoh.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-Defto_je.js → use-ai-providers-CFfUlF1f.js} +1 -1
  175. package/dist/client/assets/{use-automations-GvZcdpCo.js → use-automations-B8-RtV1z.js} +1 -1
  176. package/dist/client/assets/{use-autosave-BkYk2CW4.js → use-autosave-CXpoagL6.js} +1 -1
  177. package/dist/client/assets/{use-capability-BiXF-UYc.js → use-capability-DiPv8Zb8.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-CAnD9NNi.js → use-clock-tick-ClPZ6D9Y.js} +1 -1
  179. package/dist/client/assets/{use-connection-BZIDvbn8.js → use-connection-DvPLUiIA.js} +1 -1
  180. package/dist/client/assets/{use-copy-DOdHRGOs.js → use-copy-DIay_-Je.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-BmJCyzuH.js → use-create-virtual-mcp-BZXqo_pO.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-Bt5JJzmR.js → use-debounced-autosave-CvLLnMGe.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-DG1XCJIr.js → use-debounced-value-bthpDZiE.js} +1 -1
  184. package/dist/client/assets/{use-deco-credits-DPUIAaD_.js → use-deco-credits-D1TNghK4.js} +1 -1
  185. package/dist/client/assets/{use-decopilot-events-CPfIgUww.js → use-decopilot-events-CEnoV83H.js} +1 -1
  186. package/dist/client/assets/{use-delete-connection-C5SFs3S1.js → use-delete-connection-9f3obKAs.js} +1 -1
  187. package/dist/client/assets/{use-deployment-admin-CK8KTjxB.js → use-deployment-admin-C59HdwZf.js} +1 -1
  188. package/dist/client/assets/{use-file-configs-C2KrmTUX.js → use-file-configs-ClgScKvu.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-Cdi0-ZPn.js → use-infinite-scroll-C32yKpeT.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-C4x7ZrQS.js → use-join-requests-CzXf25FI.js} +1 -1
  191. package/dist/client/assets/{use-mcp-client-BAibrVDl.js → use-mcp-client-DrSHoCVl.js} +1 -1
  192. package/dist/client/assets/{use-mcp-tools-C1eT4Ju9.js → use-mcp-tools-BN79MGPB.js} +1 -1
  193. package/dist/client/assets/{use-members-BiTGlZ2w.js → use-members-0dOk8VV6.js} +1 -1
  194. package/dist/client/assets/{use-mobile-DB5ZxHaJ.js → use-mobile-CGdxblv_.js} +1 -1
  195. package/dist/client/assets/{use-navigate-to-agent-Qmi7y8B_.js → use-navigate-to-agent-BeeZom_X.js} +1 -1
  196. package/dist/client/assets/{use-open-billing-url-B1-y2cpj.js → use-open-billing-url-mk1x37uU.js} +1 -1
  197. package/dist/client/assets/{use-org-auth-client-i01FhEvq.js → use-org-auth-client-BgXvHZ3n.js} +1 -1
  198. package/dist/client/assets/{use-org-sso-BrC9it_j.js → use-org-sso-CFX6XDqX.js} +1 -1
  199. package/dist/client/assets/{use-organization-roles-CcKuP3SV.js → use-organization-roles-DtGn2caD.js} +1 -1
  200. package/dist/client/assets/{use-organization-settings-CADr887M.js → use-organization-settings-CRDxfnxm.js} +1 -1
  201. package/dist/client/assets/{use-registry-connections--zx8YUAi.js → use-registry-connections-BUfxuowY.js} +1 -1
  202. package/dist/client/assets/{use-secrets-CoWYmFng.js → use-secrets-D8ds-9XA.js} +1 -1
  203. package/dist/client/assets/{use-status-sounds-Cn6niJwb.js → use-status-sounds-DZ5Z_g91.js} +1 -1
  204. package/dist/client/assets/{use-tags-CbeqLeJe.js → use-tags-D1HbmIof.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-BwihOxnB.js → use-view-mode-mhODNaJU.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-Bxdg2RZi.js → use-virtual-mcp-BfqTkZTV.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-DiQjMEo-.js +1 -0
  208. package/dist/client/assets/{useRouterState-ChhncROL.js → useRouterState-ivpTEnE_.js} +1 -1
  209. package/dist/client/assets/useSuspenseInfiniteQuery-tRLMDsN2.js +1 -0
  210. package/dist/client/assets/{users-BLAG7Dj6.js → users-vab4Zr9W.js} +1 -1
  211. package/dist/client/assets/{variant-calendar-c-fsCDvP.js → variant-calendar-CvDCuacg.js} +1 -1
  212. package/dist/client/assets/{view-mode-toggle-_BqV7w71.js → view-mode-toggle-BEe5tOOR.js} +1 -1
  213. package/dist/client/index.html +1 -1
  214. package/dist/server/cli.js +466 -466
  215. package/dist/server/server.js +308 -308
  216. package/package.json +1 -1
  217. package/dist/client/assets/index-afeJnuWJ.js +0 -77
  218. package/dist/client/assets/project-app-view-Bs4rd91I.js +0 -1
  219. package/dist/client/assets/record-editor-Da-XDkvg.js +0 -1
  220. package/dist/client/assets/registry-DAjGp2y2.js +0 -2
  221. package/dist/client/assets/roles-F3gPgr6u.js +0 -1
  222. package/dist/client/assets/store-registry-_gIpWRou.js +0 -2
  223. package/dist/client/assets/useInfiniteQuery-BiwXmqqh.js +0 -1
  224. package/dist/client/assets/useSuspenseInfiniteQuery-CC-Xt1G1.js +0 -1
@@ -1,77 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CFiuX5sg.js","assets/index-DggacYgX.js","assets/index-CUIiLem4.css","assets/ArrowUp-D_cT_UIc.js","assets/chat-context-DDx13UY-.js","assets/tab-id-DSuKogLf.js","assets/dialog-Bt7eMv3e.js","assets/X-BzjpT-15.js","assets/Check-DsLsfmyq.js","assets/Copy01-B2ony-bk.js","assets/hooks-D3fXgaRp.js","assets/use-mcp-client-BAibrVDl.js","assets/auth--o3OMG5b.js","assets/decopilot-sse-pool-DyKEiI_2.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-virtual-mcp-Bxdg2RZi.js","assets/use-ai-providers-Defto_je.js","assets/studio-tools-BbM6-UA7.js","assets/use-decopilot-events-CPfIgUww.js","assets/use-organization-settings-CADr887M.js","assets/automation-runs-Zy_KQAaa.js","assets/select-CZJm-gAJ.js","assets/tooltip-MlLH1_Dh.js","assets/ChevronDown-Gy6tdNNK.js","assets/ChevronUp-Beib2ITZ.js","assets/useInfiniteQuery-BiwXmqqh.js","assets/use-infinite-scroll-Cdi0-ZPn.js","assets/use-connection-BZIDvbn8.js","assets/card-B7oxfapp.js","assets/sidebar-CXetie7M.js","assets/LayoutLeft-RBcOzvvA.js","assets/use-mobile-DB5ZxHaJ.js","assets/table-Epe56N8S.js","assets/empty-state-3ZrQMmKM.js","assets/use-members-BiTGlZ2w.js","assets/use-org-auth-client-i01FhEvq.js","assets/use-clock-tick-CAnD9NNi.js","assets/AlertCircle-aHlHbnDb.js","assets/CheckCircle-BimqoBAV.js","assets/DotsVertical-DVq3-Xga.js","assets/agent-icon-BWGWhQlT.js","assets/Tool01-DCGn5a1p.js","assets/Settings02-DQ9TLzbe.js","assets/Tool02-u405-St7.js","assets/XCircle-Kc6c0cNF.js","assets/ArrowUpRight-DiazbKfV.js","assets/TrendUp01-B7LNIgea.js","assets/ZapSquare-BqYG4BTa.js","assets/Users03-zwY1jsVI.js","assets/ChevronRight-p52nlbDc.js","assets/Stars02-DEemClqG.js","assets/CpuChip01-CYFRGV0B.js","assets/CreditCard01-CzlEqb4G.js","assets/Eye-ZlvbuHCY.js","assets/FilterLines-DvNHcDU-.js","assets/Star01-D3YkMrr2.js","assets/Palette-Dp2ItXNP.js","assets/SwitchHorizontal01-DGkeBrwY.js","assets/HardDrive-BbR87PFj.js","assets/Key01-x95Mn7re.js","assets/LinkExternal01-CEVoEXFf.js","assets/LogOut01-DJmrA8Cf.js","assets/Monitor01-CQzjDQf4.js","assets/Sun-BDvHb-XG.js","assets/Play-D37hNiER.js","assets/Plus-CYTAnozl.js","assets/SearchLg-Cx4jk9h6.js","assets/SearchMd-Bc7HkOwh.js","assets/Shield01-0dWGhNPX.js","assets/Stars01-Ch7SWtYI.js","assets/Trash01-CuJXZ9ct.js","assets/Upload01-Bt-Amwu8.js","assets/User01-DhhpGrEM.js","assets/Users01-BClCd9pB.js","assets/XClose-Dj2IAH6X.js","assets/Zap-BPtJMphd.js","assets/use-automations-GvZcdpCo.js","assets/useSuspenseInfiniteQuery-CC-Xt1G1.js","assets/avatar-D8IHFMGF.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-DOdHRGOs.js","assets/calendar-D9j8nchp.js","assets/monaco-editor-C8BkmFBS.js","assets/spinner-Dzm37O12.js","assets/index-BFs6Lkwg.js","assets/shell-layout-BZ1bp6KG.js","assets/required-auth-layout-Bn7ai5Eo.js","assets/use-org-sso-BrC9it_j.js","assets/integration-icon-BWHDNAQl.js","assets/use-navigate-to-agent-Qmi7y8B_.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-C9lpd8CL.js","assets/form-Cm9-K_rL.js","assets/label-Cxo79mbH.js","assets/input-S84m9AtW.js","assets/drawer-B7RnJ3wR.js","assets/collection-search-CXF9dytt.js","assets/tabs-DxfQVAOw.js","assets/toggle-group-BN1gjQvQ.js","assets/use-deco-credits-DPUIAaD_.js","assets/popover-Dwceexuc.js","assets/alert-dialog-CXphytq4.js","assets/toolbar-C9jumvgT.js","assets/skeleton-jicxowh6.js","assets/github-repo-picker-DAdNsHq6.js","assets/use-debounced-value-DG1XCJIr.js","assets/authenticate-and-persist-oauth-Dkxj-fDE.js","assets/mcp-oauth-NDbJg_iw.js","assets/use-mcp-tools-C1eT4Ju9.js","assets/extract-connection-data-BbUsFp4U.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-B2s3ApVy.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-CBQz28WE.js","assets/use-registry-connections--zx8YUAi.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-Dfq_bmlL.js","assets/connection-form-helpers-CqJuDNdY.js","assets/collection-tabs-CsWR5nay.js","assets/badge-BqrqB_uj.js","assets/use-open-billing-url-B1-y2cpj.js","assets/select-model-WWZE18E0.js","assets/checkbox-DjFipj8q.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section--7J4fXfn.js","assets/dropdown-menu-DXoRyF9G.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-Cn6niJwb.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-BiXF-UYc.js","assets/pt-BR-CLy76QW2.js","assets/switch-B6O3Y-gU.js","assets/use-debounced-autosave-Bt5JJzmR.js","assets/index-BUdJATnr.js","assets/search-input-DU57HG_B.js","assets/index-BNKeySBB.js","assets/use-secrets-CoWYmFng.js","assets/command-C4tHruaX.js","assets/index-B1T-Hggy.js","assets/self-tool-result-BDhtzDsR.js","assets/companions-core-cILfPFw3.js","assets/use-file-configs-C2KrmTUX.js","assets/automation-list-row-C9ge79g9.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
2
- import{G as ya,r as w,c as P,x as ka,K as xe,F as Be,o as an,e as it,n as Qe,aw as je,ae as Yt,a as wo,t as vt,ar as va,m as J,j as c,b as ie,aW as So,aX as Co,aY as jo,aZ as To,a_ as Do,a$ as No,b0 as Ro,b1 as Eo,b2 as Io,B as Me,y as wa,E as Sa,d as _o,p as Ei,k as lr,u as Ca,aF as ja}from"./index-DggacYgX.js";import{g as Et}from"./get-initials-D-f_fDFw.js";import{A as It}from"./avatar-D8IHFMGF.js";import{aC as Ss,ae as Ta,af as Da,ah as Na,a5 as Ra,aD as Ea,y as Ia,n as _a,aE as Qr,aF as Aa,W as Xr,d as Ao,ad as Ba,g as Bo,k as ar,aG as Oa,aA as Sr,ar as Yr,Z as Gn,aH as $a,ay as Ma}from"./agent-icon-BWGWhQlT.js";import{i as Oo}from"./SwitchHorizontal01-DGkeBrwY.js";import{s as ms}from"./Plus-CYTAnozl.js";import{i as nn}from"./X-BzjpT-15.js";import{a as Vn,b as us,P as fs}from"./popover-Dwceexuc.js";import{a as wt,i as $o,D as sn,b as rn,c as on,d as ts,e as ns,f as ss}from"./dropdown-menu-DXoRyF9G.js";import{W as za,m as Ii,S as Mo,C as zo,g as La,u as Pa,h as Fa,Q as Ua,j as qa,a as Ka}from"./use-mcp-client-BAibrVDl.js";import{u as Ha,G as Ar,a as Wa}from"./github-repo-picker-DAdNsHq6.js";import{e as xs,d as bs,b as ys,h as Lo,a as Po,c as Fo}from"./dialog-Bt7eMv3e.js";import{b as Va,u as Ga}from"./use-connection-BZIDvbn8.js";import{b as Qa}from"./provision-repo-scoped-github-connection-B2s3ApVy.js";import{a as Xa}from"./authenticate-and-persist-oauth-Dkxj-fDE.js";import{e as Ya}from"./extract-connection-data-BbUsFp4U.js";import{u as Uo}from"./use-members-BiTGlZ2w.js";import{u as cn}from"./studio-tools-BbM6-UA7.js";import{t as Za,T as Ja,a as ec,S as qe,i as qo,b as _i}from"./decopilot-sse-pool-DyKEiI_2.js";import{u as tc}from"./use-decopilot-events-CPfIgUww.js";import{a as Zr}from"./format-time-BnbuEtat.js";import{i as cr}from"./AlertCircle-aHlHbnDb.js";import{i as dn}from"./CheckCircle-BimqoBAV.js";import{i as nc}from"./DotsVertical-DVq3-Xga.js";import{s as sc}from"./Eye-ZlvbuHCY.js";import{u as Ko,a as rc,b as ic}from"./use-tags-CbeqLeJe.js";import{o as oc,P as Zt,a as Jr,D as lc,p as ac,q as cc,S as qt,r as dc,T as Ho,F as Cr,s as as,v as uc,w as fc,x as Wo,N as hc,k as ei,y as pc,z as gc,d as Vo,n as mc,A as Ht,B as xc,G as rs,H as bc,I as Go,R as Qo,m as Xo,J as Yo,K as yc,L as kc,Q as vc,e as wc,u as Sc,f as Cc,j as jc,C as Zo,c as Tc}from"./calendar-D9j8nchp.js";import{S as Kn}from"./skeleton-jicxowh6.js";import{u as Dc}from"./use-copy-DOdHRGOs.js";import{i as Cs}from"./Check-DsLsfmyq.js";import{i as Jo}from"./ChevronRight-p52nlbDc.js";import{a as Nc}from"./Copy01-B2ony-bk.js";import{n as Rc,i as el}from"./Tool02-u405-St7.js";import{n as Hs}from"./LinkExternal01-CEVoEXFf.js";import{b as tl,i as nl}from"./XCircle-Kc6c0cNF.js";import{s as sl}from"./Trash01-CuJXZ9ct.js";import{u as Ai,a as Ec}from"./use-organization-settings-CADr887M.js";import{d as ti,a as ni,c as Gt,b as Xn,C as si,e as ri}from"./command-C4tHruaX.js";import{s as Br}from"./User01-DhhpGrEM.js";import{i as Ic}from"./ArrowUp-D_cT_UIc.js";import{i as _c}from"./Tool01-DCGn5a1p.js";import{u as Ac}from"./use-open-billing-url-B1-y2cpj.js";import{f as Bc}from"./tab-id-DSuKogLf.js";import{u as Or}from"./companions-core-cILfPFw3.js";import{d as Oc,b as $c,f as Mc,g as zc,a as Lc,D as Pc}from"./drawer-B7RnJ3wR.js";import{t as ii}from"./ChevronDown-Gy6tdNNK.js";import{i as rl}from"./FilterLines-DvNHcDU-.js";import{s as Fc}from"./TrendUp01-B7LNIgea.js";import{u as Uc}from"./shell-layout-BZ1bp6KG.js";import{b as qc}from"./hooks-D3fXgaRp.js";const Kc="[SUBSCRIPTION_REQUIRED]";function Hc(t){return t?.message.startsWith(Kc)?t.message.includes("used its free task executions")?"trial_exhausted":t.message.includes("used its monthly task executions")?"monthly_exhausted":t.message.includes("reached its execution limit")?"runs_exhausted":null:null}function Wc(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 Mm="__home__";function oi(t,e){return ya.chatDraft(t,e)}function Vc(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 Gc(t,e,n,r,s){const i=oi(e,n);if(Wc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},l=JSON.stringify(o);try{t.setItem(i,l)}catch(a){if(Qc(a)){const d=new TextEncoder().encode(l).byteLength;s?.onQuotaExceeded?.({docSizeBytes:d});return}throw a}}function zm(t,e,n){const r=oi(e,n),s=t.getItem(r),i=Vc(s);return s!==null&&i===null&&t.removeItem(r),i}function Lm(t,e,n){t.removeItem(oi(e,n))}function Qc(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}var Xc=oc;function Yc(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,d=cc(n),f=new RegExp(`\\s${d}$`),h=o?"^":"",u=s?"":d,p=a?new RegExp(`${h}${d}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${h}(?:^)?${d}[^\\s${u}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const b=l.pos-m.length,y=Array.from(m.matchAll(p)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const g=y.input.slice(Math.max(0,y.index-1),y.index),x=new RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!x)return null;const k=b+y.index;let v=k+y[0].length;return a&&f.test(m.slice(v-1,v+1))&&(y[0]+=" ",v+=1),k<l.pos&&v>=l.pos?{range:{from:k,to:v},query:y[0].slice(n.length),text:y[0]}:null}var Zc=new Zt("suggestion");function Jc({pluginKey:t=Zc,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:d="",decorationEmptyClass:f="is-empty",command:h=()=>null,items:u=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:b=Yc,shouldShow:y}){let g;const x=p?.(),k=()=>{const S=e.state.selection.$anchor.pos,D=e.view.coordsAtPos(S),{top:N,right:R,bottom:T,left:E}=D;try{return new DOMRect(E,N,R-E,T-N)}catch{return null}},v=(S,D)=>D?()=>{const N=t.getState(e.state),R=N?.decorationId,T=S.dom.querySelector(`[data-decoration-id="${R}"]`);return T?.getBoundingClientRect()||null}:k;function C(S,D){var N;try{const T=t.getState(S.state),E=T?.decorationId?S.dom.querySelector(`[data-decoration-id="${T.decorationId}"]`):null,_={editor:e,range:T?.range||{from:0,to:0},query:T?.query||null,text:T?.text||null,items:[],command:O=>h({editor:e,range:T?.range||{from:0,to:0},props:O}),decorationNode:E,clientRect:v(S,E)};(N=x?.onExit)==null||N.call(x,_)}catch{}const R=S.state.tr.setMeta(D,{exit:!0});S.dispatch(R)}const j=new Jr({key:t,view(){return{update:async(S,D)=>{var N,R,T,E,_,O,I;const A=(N=this.key)==null?void 0:N.getState(D),B=(R=this.key)==null?void 0:R.getState(S.state),$=A.active&&B.active&&A.range.from!==B.range.from,U=!A.active&&B.active,G=A.active&&!B.active,q=!U&&!G&&A.query!==B.query,F=U||$&&q,K=q||$,Q=G||$&&q;if(!F&&!K&&!Q)return;const X=Q&&!F?A:B,H=S.dom.querySelector(`[data-decoration-id="${X.decorationId}"]`);g={editor:e,range:X.range,query:X.query,text:X.text,items:[],command:se=>h({editor:e,range:X.range,props:se}),decorationNode:H,clientRect:v(S,H)},F&&((T=x?.onBeforeStart)==null||T.call(x,g)),K&&((E=x?.onBeforeUpdate)==null||E.call(x,g)),(K||F)&&(g.items=await u({editor:e,query:X.query})),Q&&((_=x?.onExit)==null||_.call(x,g)),K&&((O=x?.onUpdate)==null||O.call(x,g)),F&&((I=x?.onStart)==null||I.call(x,g))},destroy:()=>{var S;g&&((S=x?.onExit)==null||S.call(x,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,D,N,R){const{isEditable:T}=e,{composing:E}=e.view,{selection:_}=S,{empty:O,from:I}=_,A={...D},B=S.getMeta(t);if(B&&B.exit)return A.active=!1,A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null,A;if(A.composing=E,T&&(O||e.view.composing)){(I<D.range.from||I>D.range.to)&&!E&&!D.composing&&(A.active=!1);const $=b({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:_.$from}),U=`id_${Math.floor(Math.random()*4294967295)}`;$&&m({editor:e,state:R,range:$.range,isActive:D.active})&&(!y||y({editor:e,range:$.range,query:$.query,text:$.text,transaction:S}))?(A.active=!0,A.decorationId=D.decorationId?D.decorationId:U,A.range=$.range,A.query=$.query,A.text=$.text):A.active=!1}else A.active=!1;return A.active||(A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null),A}},props:{handleKeyDown(S,D){var N,R,T,E;const{active:_,range:O}=j.getState(S.state);if(!_)return!1;if(D.key==="Escape"||D.key==="Esc"){const A=j.getState(S.state),B=(N=g?.decorationNode)!=null?N:null,$=B??(A?.decorationId?S.dom.querySelector(`[data-decoration-id="${A.decorationId}"]`):null);if(((R=x?.onKeyDown)==null?void 0:R.call(x,{view:S,event:D,range:A.range}))||!1)return!0;const G={editor:e,range:A.range,query:A.query,text:A.text,items:[],command:q=>h({editor:e,range:A.range,props:q}),decorationNode:$,clientRect:$?()=>$.getBoundingClientRect()||null:null};return(T=x?.onExit)==null||T.call(x,G),C(S,t),!0}return((E=x?.onKeyDown)==null?void 0:E.call(x,{view:S,event:D,range:O}))||!1},decorations(S){const{active:D,range:N,decorationId:R,query:T}=j.getState(S);if(!D)return null;const E=!T?.length,_=[a];return E&&_.push(f),lc.create(S.doc,[ac.inline(N.from,N.to,{nodeName:l,class:_.join(" "),"data-decoration-id":R,"data-decoration-content":d})])}}});return j}function ed(t){const e=P.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[l,a]=w.useState(0),d=w.useRef(s),f=w.useRef(l),h=w.useRef(i),u=w.useRef(o),p=w.useDeferredValue(r);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{a(0)},e[0]=m):m=e[0];let b;e[1]!==p?(b=[p],e[1]=p,e[2]=b):b=e[2],w.useEffect(m,b);let y,g;e[3]!==s.length||e[4]!==l?(y=()=>{l>=s.length&&s.length>0&&a(0)},g=[s.length,l],e[3]=s.length,e[4]=l,e[5]=y,e[6]=g):(y=e[5],g=e[6]),w.useEffect(y,g);let x,k;e[7]!==s?(x=()=>{d.current=s},k=[s],e[7]=s,e[8]=x,e[9]=k):(x=e[8],k=e[9]),w.useEffect(x,k);let v,C;e[10]!==l?(v=()=>{f.current=l},C=[l],e[10]=l,e[11]=v,e[12]=C):(v=e[11],C=e[12]),w.useEffect(v,C);let j,S;e[13]!==i?(S=()=>{h.current=i},j=[i],e[13]=i,e[14]=j,e[15]=S):(j=e[14],S=e[15]),w.useEffect(S,j);let D,N;e[16]!==o?(D=()=>{u.current=o},N=[o],e[16]=o,e[17]=D,e[18]=N):(D=e[17],N=e[18]),w.useEffect(D,N);let R,T;e[19]!==n?(R=()=>{if(n?.isDestroyed)return;let O;try{O=n.view.dom}catch{return}if(!O)return;const I=B=>{const $=d.current;if(!$.length)return!1;const U=()=>a(q=>(q+1)%$.length),G=()=>a(q=>(q-1+$.length)%$.length);switch(B.key){case"ArrowUp":return B.preventDefault(),G(),!0;case"ArrowDown":return B.preventDefault(),U(),!0;case"Tab":return B.preventDefault(),B.shiftKey?G():U(),!0;case"Home":return B.preventDefault(),a(0),!0;case"End":return B.preventDefault(),a($.length-1),!0;case"Enter":{if(B.isComposing)return!1;B.preventDefault();const q=f.current;return q!==-1&&$[q]&&h.current?.($[q],q),!0}case"Escape":return B.preventDefault(),u.current?.(),!0;default:return!1}},A=B=>{I(B)};return O.addEventListener("keydown",A,!0),()=>{O?.removeEventListener("keydown",A,!0)}},T=[n],e[19]=n,e[20]=R,e[21]=T):(R=e[20],T=e[21]),w.useEffect(R,T);const E=s.length?l:void 0;let _;return e[22]!==E?(_={selectedIndex:E,setSelectedIndex:a},e[22]=E,e[23]=_):_=e[23],_}function td(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 nd=w.createContext(void 0);function sd(){const t=w.useContext(nd);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Pm(t){const e=P.c(16),{editor:n,char:r,pluginKey:s,allow:i,onOpenChange:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=l):l=e[0];const[a,d]=w.useReducer(td,l);let f;e[1]!==o?(f=b=>{o?.(b)},e[1]=o,e[2]=f):f=e[2];const h=w.useEffectEvent(f);let u;e[3]!==r||e[4]!==i||e[5]!==n||e[6]!==h||e[7]!==s?(u=()=>{if(n?.isDestroyed)return;const b=s instanceof Zt?s:new Zt(s);n.state.plugins.find(x=>x.spec.key===b)&&n.unregisterPlugin(b);const g=Jc({pluginKey:b,editor:n,char:r,allow(x){const k=n.state.doc.resolve(x.range.from);for(let v=k.depth;v>0;v--)if(k.node(v).type.name==="image")return!1;return!(i&&!i(x))},command(){},render:()=>({onStart:x=>{d({type:"ON_START",payload:{element:x.decorationNode??null,query:x.query,range:x.range}}),h(!0)},onUpdate:x=>{d({type:"ON_UPDATE",payload:{element:x.decorationNode??null,query:x.query,range:x.range}})},onKeyDown:x=>x.event.key==="Escape"?(d({type:"ON_EXIT"}),!0):!1,onExit:()=>{d({type:"ON_EXIT"}),h(!1)}}),items:rd});return n.registerPlugin(g),()=>{n?.isDestroyed||n.unregisterPlugin(b)}},e[3]=r,e[4]=i,e[5]=n,e[6]=h,e[7]=s,e[8]=u):u=e[8];let p;e[9]!==r||e[10]!==i||e[11]!==n||e[12]!==s?(p=[n,s,r,d,i],e[9]=r,e[10]=i,e[11]=n,e[12]=s,e[13]=p):p=e[13],w.useEffect(u,p);let m;return e[14]!==a?(m={state:a,dispatch:d},e[14]=a,e[15]=m):m=e[15],m}function rd(){return[]}function Fm({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=sd(),o=w.useDeferredValue(s.query),{data:l}=ka({queryKey:xe.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),a=()=>{i({type:"ON_EXIT"})},d=async(h,u)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:h});try{const{view:p}=t,b=p.state.selection.$to.nodeAfter?.text?.startsWith(" "),y=s.range?{...s.range}:{from:0,to:0};b&&s.range&&(y.to+=1),await r({range:y,item:h})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):a()}catch{a()}}},{selectedIndex:f}=ed({editor:t,query:o,items:l,onSelect:d,onClose:a});return{selectedItem:s.selectedItem,items:l,selectedIndex:f,close:a,onSelect:d}}function Um(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function St(t,e,n,r){const s=new URLSearchParams(r).toString();return`/api/${encodeURIComponent(t)}/fs/${encodeURIComponent(e)}/${n}${s?`?${s}`:""}`}async function Xe(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 qm(t,e){const n=P.c(15),{org:r}=Be();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=xe.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=(a,d)=>d?.queryKey[1]===r.id&&d.queryKey[2]===t?a: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 Xe(St(r.slug,t,"list",{path:e}))).json()).entries.toSorted(id),n[7]=r.slug,n[8]=e,n[9]=t,n[10]=o):o=n[10];let l;return n[11]!==s||n[12]!==i||n[13]!==o?(l={queryKey:s,placeholderData:i,queryFn:o},n[11]=s,n[12]=i,n[13]=o,n[14]=l):l=n[14],Qe(l)}function id(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function Km(t,e,n){const r=P.c(15),{org:s}=Be();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=xe.orgFsStat(s.id,t??"",e),r[0]=s.id,r[1]=e,r[2]=t,r[3]=i):i=r[3];const o=t!==null;let l;r[4]!==n?(l=n?.refetchIntervalWhenAbsent?f=>f.state.data?!1:n.refetchIntervalWhenAbsent??!1:void 0,r[4]=n,r[5]=l):l=r[5];let a;r[6]!==s.slug||r[7]!==e||r[8]!==t?(a=async()=>{const f=await Xe(St(s.slug,t??"","stat",{path:e}),void 0,{allow404:!0});return f.status===404?null:(await f.json()).entry},r[6]=s.slug,r[7]=e,r[8]=t,r[9]=a):a=r[9];let d;return r[10]!==i||r[11]!==o||r[12]!==l||r[13]!==a?(d={queryKey:i,enabled:o,refetchInterval:l,queryFn:a},r[10]=i,r[11]=o,r[12]=l,r[13]=a,r[14]=d):d=r[14],Qe(d)}function Hm(t){const e=P.c(9),{org:n}=Be();let r;e[0]!==n.id||e[1]!==t?(r=xe.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 Xe(St(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],Qe(i)}function Wm(t,e){const n=P.c(9),r=t===void 0?60:t,{org:s}=Be();let i;n[0]!==s.id?(i=xe.orgFsRecent(s.id),n[0]=s.id,n[1]=i):i=n[1];const o=e?.enabled;let l;n[2]!==r||n[3]!==s.slug?(l=async()=>(await(await Xe(`/api/${encodeURIComponent(s.slug)}/fs/recent?limit=${r}`)).json()).entries,n[2]=r,n[3]=s.slug,n[4]=l):l=n[4];let a;return n[5]!==i||n[6]!==o||n[7]!==l?(a={queryKey:i,enabled:o,queryFn:l},n[5]=i,n[6]=o,n[7]=l,n[8]=a):a=n[8],Qe(a)}const od=50;function Vm(t,e){const n=P.c(16),{org:r}=Be();let s;n[0]!==r.id||n[1]!==t||n[2]!==e?.prefix||n[3]!==e?.volume?(s=xe.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=(d,f)=>f?.queryKey[1]===r.id?d:void 0,n[5]=r.id,n[6]=o):o=n[6];let l;n[7]!==r.slug||n[8]!==t||n[9]!==e?(l=async()=>{const d=new URLSearchParams({q:t,limit:String(od)});return e&&(d.set("volume",e.volume),e.prefix&&d.set("prefix",e.prefix)),(await(await Xe(`/api/${encodeURIComponent(r.slug)}/fs/search?${d}`)).json()).entries},n[7]=r.slug,n[8]=t,n[9]=e,n[10]=l):l=n[10];let a;return n[11]!==s||n[12]!==i||n[13]!==o||n[14]!==l?(a={queryKey:s,enabled:i,placeholderData:o,queryFn:l},n[11]=s,n[12]=i,n[13]=o,n[14]=l,n[15]=a):a=n[15],Qe(a)}function Gm(t){const e=P.c(8),{org:n}=Be();let r;e[0]!==n.id?(r=xe.orgFsSkills(n.id),e[0]=n.id,e[1]=r):r=e[1];const s=t?.enabled;let i;e[2]!==n.slug?(i=async()=>{const l=await Xe(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:a}=await l.json();return a.map(ld)},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],Qe(o)}function ld(t){return{volume:t.volume,path:t.path}}async function Qm(t){const e=await Xe(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function ad(t,e,n){return(await Xe(St(t,e,"read",{path:n}))).text()}function Xm(t,e){const n=P.c(8);let r;n[0]!==t?(r=xe.fileText(t),n[0]=t,n[1]=r):r=n[1];const s=e?.enabled!==!1&&t!=="";let i;n[2]!==t?(i=async()=>{const l=await fetch(t,{credentials:"include"});return l.ok?await l.text():null},n[2]=t,n[3]=i):i=n[3];let o;return n[4]!==r||n[5]!==s||n[6]!==i?(o={queryKey:r,enabled:s,staleTime:6e4,retry:!1,queryFn:i},n[4]=r,n[5]=s,n[6]=i,n[7]=o):o=n[7],Qe(o)}const cd=new Set(["md","mdx","markdown","txt","text"]),dd=25,ud=64*1024,fd=256*1024,hd=4;function pd(t){const e=t.lastIndexOf(".");return e===-1?!1:cd.has(t.slice(e+1).toLowerCase())}async function Ym(t,e,n){const r=n?`${n}/`:"",s=h=>h.startsWith(r)?h.slice(r.length):h,i=[],o=[],l=[{path:n,depth:0}];for(;l.length>0;){const h=l.shift();if(!h)break;let u;try{u=(await(await Xe(St(t,e,"list",{path:h.path}))).json()).entries}catch{continue}for(const p of[...u].sort((m,b)=>m.path.localeCompare(b.path))){if(p.kind==="dir"){h.depth<hd&&l.push({path:p.path,depth:h.depth+1});continue}pd(p.path)&&p.size<=ud&&i.length<dd?i.push(p.path):o.push(s(p.path))}}const a=await Promise.all(i.map(h=>ad(t,e,h).catch(()=>null))),d=[];let f=0;return i.forEach((h,u)=>{const p=a[u];if(p==null||f+p.length>fd){o.push(s(h));return}f+=p.length,d.push({relPath:s(h),content:p})}),d.sort((h,u)=>h.relPath==="SKILL.md"?-1:u.relPath==="SKILL.md"?1:h.relPath.localeCompare(u.relPath)),o.sort(),{files:d,omittedPaths:o}}function Zm(){const t=P.c(7),{org:e}=Be();let n;t[0]!==e.id?(n=xe.orgFsPublicSets(e.id),t[0]=e.id,t[1]=n):n=t[1];let r;t[2]!==e.slug?(r=async()=>(await(await Xe(`/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],Qe(s)}function gd(t){const e=P.c(3),{org:n}=Be();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>St(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function Jm(){const t=P.c(2),{org:e}=Be();let n;return t[0]!==e.slug?(n=(r,s)=>St(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function e1(t){const e=P.c(3),{org:n}=Be();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await Xe(St(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],it(r)}function t1(t){const e=P.c(18),{org:n}=Be(),r=an();let s;e[0]!==n||e[1]!==t?(s=async d=>(await(await Xe(St(n.slug,t,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.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 d=>{const f=xe.orgFsStat(n.id,t,d.path);await r.cancelQueries({queryKey:f});const h=r.getQueryData(f),u=d.mode!=="private";return r.setQueryData(f,p=>p&&{...p,readPublic:u,effectivePublic:u,shareMode:d.mode}),{key:f,previous:h}},e[3]=n,e[4]=r,e[5]=t,e[6]=i):i=e[6];let o;e[7]!==r?(o=(d,f,h)=>{h&&r.setQueryData(h.key,h.previous)},e[7]=r,e[8]=o):o=e[8];let l;e[9]!==n||e[10]!==r||e[11]!==t?(l=(d,f,h)=>{r.invalidateQueries({queryKey:xe.orgFsStat(n.id,t,h.path)}),r.invalidateQueries({queryKey:xe.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:xe.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:xe.orgFsSearchRoot(n.id)})},e[9]=n,e[10]=r,e[11]=t,e[12]=l):l=e[12];let a;return e[13]!==s||e[14]!==i||e[15]!==o||e[16]!==l?(a={mutationFn:s,onMutate:i,onError:o,onSettled:l},e[13]=s,e[14]=i,e[15]=o,e[16]=l,e[17]=a):a=e[17],it(a)}function md(t){const e=P.c(33),{org:n}=Be(),r=an();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:xe.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:xe.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:xe.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 Xe(St(n.slug,t,"file",{path:S}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(xd);if(C)throw C.reason},e[4]=n,e[5]=t,e[6]=o):o=e[6];let l;e[7]!==i||e[8]!==o?(l={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=l):l=e[9];const a=it(l);let d;e[10]!==n||e[11]!==t?(d=async k=>{await Xe(St(n.slug,t,"dir",{path:k}),{method:"POST"})},e[10]=n,e[11]=t,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const h=it(f);let u;e[16]!==n||e[17]!==t?(u=async k=>{await Xe(St(n.slug,t,"file",{path:k}),{method:"DELETE"})},e[16]=n,e[17]=t,e[18]=u):u=e[18];let p;e[19]!==i||e[20]!==u?(p={mutationFn:u,onSuccess:i},e[19]=i,e[20]=u,e[21]=p):p=e[21];const m=it(p);let b;e[22]!==n||e[23]!==t?(b=async k=>{await Xe(St(n.slug,t,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)})},e[22]=n,e[23]=t,e[24]=b):b=e[24];let y;e[25]!==i||e[26]!==b?(y={mutationFn:b,onSuccess:i},e[25]=i,e[26]=b,e[27]=y):y=e[27];const g=it(y);let x;return e[28]!==h||e[29]!==g||e[30]!==m||e[31]!==a?(x={upload:a,mkdir:h,remove:m,move:g},e[28]=h,e[29]=g,e[30]=m,e[31]=a,e[32]=x):x=e[32],x}function xd(t){return t.status==="rejected"}function bd(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const yd=2e4;function kd(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function vd(){const t=P.c(17),{org:e}=Be(),n=za.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=Ii({connectionId:Mo,orgId:e.id,orgSlug:e.slug}),t[0]=e.id,t[1]=e.slug,t[2]=r):r=t[2];const{data:s}=Qe(r),o=Qe({queryKey:xe.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 Or(k)}}).data?.item??null,{data:l}=Qe({...Ii({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),a=xe.commerceDiscoveryDiagnostic(e.id,n),d=!!l;let f;t[3]!==l?(f=async()=>{if(!l)throw new Error("cdClient not ready");const k=await l.callTool({name:zo,arguments:{}});return Or(k).diagnostic??null},t[3]=l,t[4]=f):f=t[4];let h;t[5]!==a||t[6]!==d||t[7]!==f?(h={queryKey:a,enabled:d,retry:1,refetchInterval:wd,queryFn:f},t[5]=a,t[6]=d,t[7]=f,t[8]=h):h=t[8];const u=Qe(h),p=u.data??null,m=u.isSuccess,b=o?.metadata?.siteUrl;let y;t[9]!==b?(y=kd(b),t[9]=b,t[10]=y):y=t[10];const g=l??null;let x;return t[11]!==n||t[12]!==u.isSuccess||t[13]!==p||t[14]!==y||t[15]!==g?(x={diagnostic:p,isSuccess:m,host:y,connectionId:n,cdClient:g},t[11]=n,t[12]=u.isSuccess,t[13]=p,t[14]=y,t[15]=g,t[16]=x):x=t[16],x}function wd(t){return t.state.status!=="error"&&bd(t.state.data)==="generating"?yd:!1}function Sd(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:La(t.id),main:Bc(e,zo)}}}function Cd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const dr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yn(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function li(t){return"nodeType"in t}function lt(t){var e,n;return t?Yn(t)?t:li(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function ai(t){const{Document:e}=lt(t);return t instanceof e}function js(t){return Yn(t)?!1:t instanceof lt(t).HTMLElement}function il(t){return t instanceof lt(t).SVGElement}function Zn(t){return t?Yn(t)?t.document:li(t)?ai(t)?t:js(t)||il(t)?t.ownerDocument:document:document:document}const Lt=dr?w.useLayoutEffect:w.useEffect;function ur(t){const e=w.useRef(t);return Lt(()=>{e.current=t}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function jd(){const t=w.useRef(null),e=w.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=w.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function ks(t,e){e===void 0&&(e=[t]);const n=w.useRef(t);return Lt(()=>{n.current!==t&&(n.current=t)},e),n}function Ts(t,e){const n=w.useRef();return w.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Gs(t){const e=ur(t),n=w.useRef(null),r=w.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function Qs(t){const e=w.useRef();return w.useEffect(()=>{e.current=t},[t]),e.current}let jr={};function Ds(t,e){return w.useMemo(()=>{if(e)return e;const n=jr[t]==null?0:jr[t]+1;return jr[t]=n,t+"-"+n},[t,e])}function ol(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const l=Object.entries(o);for(const[a,d]of l){const f=i[a];f!=null&&(i[a]=f+t*d)}return i},{...e})}}const Qn=ol(1),vs=ol(-1);function Td(t){return"clientX"in t&&"clientY"in t}function fr(t){if(!t)return!1;const{KeyboardEvent:e}=lt(t.target);return e&&t instanceof e}function Dd(t){if(!t)return!1;const{TouchEvent:e}=lt(t.target);return e&&t instanceof e}function Xs(t){if(Dd(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 Td(t)?{x:t.clientX,y:t.clientY}:null}const Jt=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[Jt.Translate.toString(t),Jt.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),Bi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Nd(t){return t.matches(Bi)?t:t.querySelector(Bi)}const Rd={display:"none"};function Ed(t){let{id:e,value:n}=t;return je.createElement("div",{id:e,style:Rd},n)}function Id(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 je.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function _d(){const[t,e]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const ll=w.createContext(null);function Ad(t){const e=w.useContext(ll);w.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Bd(){const[t]=w.useState(()=>new Set),e=w.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[w.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var l;return(l=o[s])==null?void 0:l.call(o,i)})},[t]),e]}const Od={draggable:`
3
- To pick up a draggable item, press the space bar.
4
- While dragging, use the arrow keys to move the item.
5
- Press space again to drop the item in its new position, or press escape to cancel.
6
- `},$d={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 Md(t){let{announcements:e=$d,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Od}=t;const{announce:i,announcement:o}=_d(),l=Ds("DndLiveRegion"),[a,d]=w.useState(!1);if(w.useEffect(()=>{d(!0)},[]),Ad(w.useMemo(()=>({onDragStart(h){let{active:u}=h;i(e.onDragStart({active:u}))},onDragMove(h){let{active:u,over:p}=h;e.onDragMove&&i(e.onDragMove({active:u,over:p}))},onDragOver(h){let{active:u,over:p}=h;i(e.onDragOver({active:u,over:p}))},onDragEnd(h){let{active:u,over:p}=h;i(e.onDragEnd({active:u,over:p}))},onDragCancel(h){let{active:u,over:p}=h;i(e.onDragCancel({active:u,over:p}))}}),[i,e])),!a)return null;const f=je.createElement(je.Fragment,null,je.createElement(Ed,{id:r,value:s.draggable}),je.createElement(Id,{id:l,announcement:o}));return n?Yt.createPortal(f,n):f}var Fe;(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"})(Fe||(Fe={}));function Ys(){}function Oi(t,e){return w.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function zd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Pt=Object.freeze({x:0,y:0});function al(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ld(t,e){const n=Xs(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 cl(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Pd(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function $i(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 dl(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function Mi(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 n1=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=Mi(e,e.left,e.top),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=al(Mi(a),s);i.push({id:l,data:{droppableContainer:o,value:d}})}}return i.sort(cl)},ul=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=$i(e),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=$i(a),f=s.reduce((u,p,m)=>u+al(d[m],p),0),h=Number((f/4).toFixed(4));i.push({id:l,data:{droppableContainer:o,value:h}})}}return i.sort(cl)};function Fd(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,l=i-n;if(r<s&&n<i){const a=e.width*e.height,d=t.width*t.height,f=o*l,h=f/(a+d-f);return Number(h.toFixed(4))}return 0}const Ud=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,l=n.get(o);if(l){const a=Fd(l,e);a>0&&s.push({id:o,data:{droppableContainer:i,value:a}})}}return s.sort(Pd)};function qd(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function fl(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Pt}function Kd(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,l)=>({...o,top:o.top+t*l.y,bottom:o.bottom+t*l.y,left:o.left+t*l.x,right:o.right+t*l.x}),{...n})}}const Hd=Kd(1);function hl(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 Wd(t,e,n){const r=hl(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:l}=r,a=t.left-o-(1-s)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,h=i?t.height/i:t.height;return{width:f,height:h,top:d,right:a+f,bottom:d+h,left:a}}const Vd={ignoreTransform:!1};function Jn(t,e){e===void 0&&(e=Vd);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:f}=lt(t).getComputedStyle(t);d&&(n=Wd(n,d,f))}const{top:r,left:s,width:i,height:o,bottom:l,right:a}=n;return{top:r,left:s,width:i,height:o,bottom:l,right:a}}function zi(t){return Jn(t,{ignoreTransform:!0})}function Gd(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Qd(t,e){return e===void 0&&(e=lt(t).getComputedStyle(t)),e.position==="fixed"}function Xd(t,e){e===void 0&&(e=lt(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 hr(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(ai(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!js(s)||il(s)||n.includes(s))return n;const i=lt(t).getComputedStyle(s);return s!==t&&Xd(s,i)&&n.push(s),Qd(s,i)?n:r(s.parentNode)}return t?r(t):n}function pl(t){const[e]=hr(t,1);return e??null}function Tr(t){return!dr||!t?null:Yn(t)?t:li(t)?ai(t)||t===Zn(t).scrollingElement?window:js(t)?t:null:null}function gl(t){return Yn(t)?t.scrollX:t.scrollLeft}function ml(t){return Yn(t)?t.scrollY:t.scrollTop}function $r(t){return{x:gl(t),y:ml(t)}}var Ke;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Ke||(Ke={}));function xl(t){return!dr||!t?!1:t===document.scrollingElement}function bl(t){const e={x:0,y:0},n=xl(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:l,maxScroll:r,minScroll:e}}const Yd={x:.2,y:.2};function Zd(t,e,n,r,s){let{top:i,left:o,right:l,bottom:a}=n;r===void 0&&(r=10),s===void 0&&(s=Yd);const{isTop:d,isBottom:f,isLeft:h,isRight:u}=bl(t),p={x:0,y:0},m={x:0,y:0},b={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+b.height?(p.y=Ke.Backward,m.y=r*Math.abs((e.top+b.height-i)/b.height)):!f&&a>=e.bottom-b.height&&(p.y=Ke.Forward,m.y=r*Math.abs((e.bottom-b.height-a)/b.height)),!u&&l>=e.right-b.width?(p.x=Ke.Forward,m.x=r*Math.abs((e.right-b.width-l)/b.width)):!h&&o<=e.left+b.width&&(p.x=Ke.Backward,m.x=r*Math.abs((e.left+b.width-o)/b.width)),{direction:p,speed:m}}function Jd(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 yl(t){return t.reduce((e,n)=>Qn(e,$r(n)),Pt)}function eu(t){return t.reduce((e,n)=>e+gl(n),0)}function tu(t){return t.reduce((e,n)=>e+ml(n),0)}function kl(t,e){if(e===void 0&&(e=Jn),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);pl(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const nu=[["x",["left","right"],eu],["y",["top","bottom"],tu]];class ci{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=hr(n),s=yl(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,l]of nu)for(const a of o)Object.defineProperty(this,a,{get:()=>{const d=l(r),f=s[i]-d;return this.rect[a]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class hs{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 su(t){const{EventTarget:e}=lt(t);return t instanceof e?t:Zn(t)}function Dr(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 Dt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Dt||(Dt={}));function Li(t){t.preventDefault()}function ru(t){t.stopPropagation()}var le;(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"})(le||(le={}));const vl={start:[le.Space,le.Enter],cancel:[le.Esc],end:[le.Space,le.Enter,le.Tab]},iu=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case le.Right:return{...n,x:n.x+25};case le.Left:return{...n,x:n.x-25};case le.Down:return{...n,y:n.y+25};case le.Up:return{...n,y:n.y-25}}};class di{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 hs(Zn(n)),this.windowListeners=new hs(lt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Dt.Resize,this.handleCancel),this.windowListeners.add(Dt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Dt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&kl(r),n(Pt)}handleKeyDown(e){if(fr(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=vl,coordinateGetter:o=iu,scrollBehavior:l="smooth"}=s,{code:a}=e;if(i.end.includes(a)){this.handleEnd(e);return}if(i.cancel.includes(a)){this.handleCancel(e);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:Pt;this.referenceCoordinates||(this.referenceCoordinates=f);const h=o(e,{active:n,context:r.current,currentCoordinates:f});if(h){const u=vs(h,f),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const b of m){const y=e.code,{isTop:g,isRight:x,isLeft:k,isBottom:v,maxScroll:C,minScroll:j}=bl(b),S=Jd(b),D={x:Math.min(y===le.Right?S.right-S.width/2:S.right,Math.max(y===le.Right?S.left:S.left+S.width/2,h.x)),y:Math.min(y===le.Down?S.bottom-S.height/2:S.bottom,Math.max(y===le.Down?S.top:S.top+S.height/2,h.y))},N=y===le.Right&&!x||y===le.Left&&!k,R=y===le.Down&&!v||y===le.Up&&!g;if(N&&D.x!==h.x){const T=b.scrollLeft+u.x,E=y===le.Right&&T<=C.x||y===le.Left&&T>=j.x;if(E&&!u.y){b.scrollTo({left:T,behavior:l});return}E?p.x=b.scrollLeft-T:p.x=y===le.Right?b.scrollLeft-C.x:b.scrollLeft-j.x,p.x&&b.scrollBy({left:-p.x,behavior:l});break}else if(R&&D.y!==h.y){const T=b.scrollTop+u.y,E=y===le.Down&&T<=C.y||y===le.Up&&T>=j.y;if(E&&!u.x){b.scrollTo({top:T,behavior:l});return}E?p.y=b.scrollTop-T:p.y=y===le.Down?b.scrollTop-C.y:b.scrollTop-j.y,p.y&&b.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(e,Qn(vs(h,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()}}di.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=vl,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function Pi(t){return!!(t&&"distance"in t)}function Fi(t){return!!(t&&"delay"in t)}class ui{constructor(e,n,r){var s;r===void 0&&(r=su(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=Zn(o),this.documentListeners=new hs(this.document),this.listeners=new hs(r),this.windowListeners=new hs(lt(o)),this.initialCoordinates=(s=Xs(i))!=null?s:Pt,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(Dt.Resize,this.handleCancel),this.windowListeners.add(Dt.DragStart,Li),this.windowListeners.add(Dt.VisibilityChange,this.handleCancel),this.windowListeners.add(Dt.ContextMenu,Li),this.documentListeners.add(Dt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fi(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Pi(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(Dt.Click,ru,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Dt.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:l}}=i;if(!s)return;const a=(n=Xs(e))!=null?n:Pt,d=vs(s,a);if(!r&&l){if(Pi(l)){if(l.tolerance!=null&&Dr(d,l.tolerance))return this.handleCancel();if(Dr(d,l.distance))return this.handleStart()}if(Fi(l)&&Dr(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),o(a)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===le.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const ou={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class fi extends ui{constructor(e){const{event:n}=e,r=Zn(n.target);super(e,ou,r)}}fi.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 lu={move:{name:"mousemove"},end:{name:"mouseup"}};var Mr;(function(t){t[t.RightClick=2]="RightClick"})(Mr||(Mr={}));class au extends ui{constructor(e){super(e,lu,Zn(e.event.target))}}au.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Mr.RightClick?!1:(r?.({event:n}),!0)}}];const Nr={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class cu extends ui{constructor(e){super(e,Nr)}static setup(){return window.addEventListener(Nr.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Nr.move.name,e)};function e(){}}}cu.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 ps;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ps||(ps={}));var Zs;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zs||(Zs={}));function du(t){let{acceleration:e,activator:n=ps.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:l=Zs.TreeOrder,pointerCoordinates:a,scrollableAncestors:d,scrollableAncestorRects:f,delta:h,threshold:u}=t;const p=fu({delta:h,disabled:!i}),[m,b]=jd(),y=w.useRef({x:0,y:0}),g=w.useRef({x:0,y:0}),x=w.useMemo(()=>{switch(n){case ps.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case ps.DraggableRect:return s}},[n,s,a]),k=w.useRef(null),v=w.useCallback(()=>{const j=k.current;if(!j)return;const S=y.current.x*g.current.x,D=y.current.y*g.current.y;j.scrollBy(S,D)},[]),C=w.useMemo(()=>l===Zs.TreeOrder?[...d].reverse():d,[l,d]);w.useEffect(()=>{if(!i||!d.length||!x){b();return}for(const j of C){if(r?.(j)===!1)continue;const S=d.indexOf(j),D=f[S];if(!D)continue;const{direction:N,speed:R}=Zd(j,D,x,e,u);for(const T of["x","y"])p[T][N[T]]||(R[T]=0,N[T]=0);if(R.x>0||R.y>0){b(),k.current=j,m(v,o),y.current=R,g.current=N;return}}y.current={x:0,y:0},g.current={x:0,y:0},b()},[e,v,r,b,i,o,JSON.stringify(x),JSON.stringify(p),m,d,C,f,JSON.stringify(u)])}const uu={x:{[Ke.Backward]:!1,[Ke.Forward]:!1},y:{[Ke.Backward]:!1,[Ke.Forward]:!1}};function fu(t){let{delta:e,disabled:n}=t;const r=Qs(e);return Ts(s=>{if(n||!r||!s)return uu;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Ke.Backward]:s.x[Ke.Backward]||i.x===-1,[Ke.Forward]:s.x[Ke.Forward]||i.x===1},y:{[Ke.Backward]:s.y[Ke.Backward]||i.y===-1,[Ke.Forward]:s.y[Ke.Forward]||i.y===1}}},[n,e,r])}function hu(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Ts(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function pu(t,e){return w.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var ws;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ws||(ws={}));var zr;(function(t){t.Optimized="optimized"})(zr||(zr={}));const Ui=new Map;function gu(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=w.useState(null),{frequency:l,measure:a,strategy:d}=s,f=w.useRef(t),h=y(),u=ks(h),p=w.useCallback(function(g){g===void 0&&(g=[]),!u.current&&o(x=>x===null?g:x.concat(g.filter(k=>!x.includes(k))))},[u]),m=w.useRef(null),b=Ts(g=>{if(h&&!n)return Ui;if(!g||g===Ui||f.current!==t||i!=null){const x=new Map;for(let k of t){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){x.set(k.id,k.rect.current);continue}const v=k.node.current,C=v?new ci(a(v),v):null;k.rect.current=C,C&&x.set(k.id,C)}return x}return g},[t,i,n,h,a]);return w.useEffect(()=>{f.current=t},[t]),w.useEffect(()=>{h||p()},[n,h]),w.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),w.useEffect(()=>{h||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},l))},[l,h,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:i!=null};function y(){switch(d){case ws.Always:return!1;case ws.BeforeDragging:return n;default:return!n}}}function hi(t,e){return Ts(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function mu(t,e){return hi(t,e)}function xu(t){let{callback:e,disabled:n}=t;const r=ur(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function pr(t){let{callback:e,disabled:n}=t;const r=ur(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function bu(t){return new ci(Jn(t),t)}function qi(t,e,n){e===void 0&&(e=bu);const[r,s]=w.useState(null);function i(){s(a=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=a??n)!=null?d:null}const f=e(t);return JSON.stringify(a)===JSON.stringify(f)?a:f})}const o=xu({callback(a){if(t)for(const d of a){const{type:f,target:h}=d;if(f==="childList"&&h instanceof HTMLElement&&h.contains(t)){i();break}}}}),l=pr({callback:i});return Lt(()=>{i(),t?(l?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),o?.disconnect())},[t]),r}function yu(t){const e=hi(t);return fl(t,e)}const Ki=[];function ku(t){const e=w.useRef(t),n=Ts(r=>t?r&&r!==Ki&&t&&e.current&&t.parentNode===e.current.parentNode?r:hr(t):Ki,[t]);return w.useEffect(()=>{e.current=t},[t]),n}function vu(t){const[e,n]=w.useState(null),r=w.useRef(t),s=w.useCallback(i=>{const o=Tr(i.target);o&&n(l=>l?(l.set(o,$r(o)),new Map(l)):null)},[]);return w.useEffect(()=>{const i=r.current;if(t!==i){o(i);const l=t.map(a=>{const d=Tr(a);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,$r(d)]):null}).filter(a=>a!=null);n(l.length?new Map(l):null),r.current=t}return()=>{o(t),o(i)};function o(l){l.forEach(a=>{const d=Tr(a);d?.removeEventListener("scroll",s)})}},[s,t]),w.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Qn(i,o),Pt):yl(t):Pt,[t,e])}function Hi(t,e){e===void 0&&(e=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},e),w.useEffect(()=>{const r=t!==Pt;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?vs(t,n.current):Pt}function wu(t){w.useEffect(()=>{if(!dr)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 Su(t,e){return w.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function wl(t){return w.useMemo(()=>t?Gd(t):null,[t])}const Wi=[];function Cu(t,e){e===void 0&&(e=Jn);const[n]=t,r=wl(n?lt(n):null),[s,i]=w.useState(Wi);function o(){i(()=>t.length?t.map(a=>xl(a)?r:new ci(e(a),a)):Wi)}const l=pr({callback:o});return Lt(()=>{l?.disconnect(),o(),t.forEach(a=>l?.observe(a))},[t]),s}function Sl(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return js(e)?e:t}function ju(t){let{measure:e}=t;const[n,r]=w.useState(null),s=w.useCallback(d=>{for(const{target:f}of d)if(js(f)){r(h=>{const u=e(f);return h?{...h,width:u.width,height:u.height}:u});break}},[e]),i=pr({callback:s}),o=w.useCallback(d=>{const f=Sl(d);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[l,a]=Gs(o);return w.useMemo(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}const Tu=[{sensor:fi,options:{}},{sensor:di,options:{}}],Du={current:{}},Ws={draggable:{measure:zi},droppable:{measure:zi,strategy:ws.WhileDragging,frequency:zr.Optimized},dragOverlay:{measure:Jn}};class gs 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 Nu={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new gs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ys},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ws,measureDroppableContainers:Ys,windowRect:null,measuringScheduled:!1},Cl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ys,draggableNodes:new Map,over:null,measureDroppableContainers:Ys},Ns=w.createContext(Cl),jl=w.createContext(Nu);function Ru(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new gs}}}function Eu(t,e){switch(e.type){case Fe.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Fe.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 Fe.DragEnd:case Fe.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Fe.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new gs(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Fe.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 gs(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case Fe.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new gs(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Iu(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=w.useContext(Ns),i=Qs(r),o=Qs(n?.id);return w.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!fr(i)||document.activeElement===i.target)return;const l=s.get(o);if(!l)return;const{activatorNode:a,node:d}=l;if(!a.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[a.current,d.current]){if(!f)continue;const h=Nd(f);if(h){h.focus();break}}})}},[r,e,s,o,i]),null}function Tl(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function _u(t){return w.useMemo(()=>({draggable:{...Ws.draggable,...t?.draggable},droppable:{...Ws.droppable,...t?.droppable},dragOverlay:{...Ws.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Au(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=w.useRef(!1),{x:o,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Lt(()=>{if(!o&&!l||!e){i.current=!1;return}if(i.current||!r)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const f=n(d),h=fl(f,r);if(o||(h.x=0),l||(h.y=0),i.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const u=pl(d);u&&u.scrollBy({top:h.y,left:h.x})}},[e,o,l,r,n])}const gr=w.createContext({...Pt,scaleX:1,scaleY:1});var Xt;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Xt||(Xt={}));const Bu=w.memo(function(e){var n,r,s,i;let{id:o,accessibility:l,autoScroll:a=!0,children:d,sensors:f=Tu,collisionDetection:h=Ud,measuring:u,modifiers:p,...m}=e;const b=w.useReducer(Eu,void 0,Ru),[y,g]=b,[x,k]=Bd(),[v,C]=w.useState(Xt.Uninitialized),j=v===Xt.Initialized,{draggable:{active:S,nodes:D,translate:N},droppable:{containers:R}}=y,T=S!=null?D.get(S):null,E=w.useRef({initial:null,translated:null}),_=w.useMemo(()=>{var be;return S!=null?{id:S,data:(be=T?.data)!=null?be:Du,rect:E}:null},[S,T]),O=w.useRef(null),[I,A]=w.useState(null),[B,$]=w.useState(null),U=ks(m,Object.values(m)),G=Ds("DndDescribedBy",o),q=w.useMemo(()=>R.getEnabled(),[R]),F=_u(u),{droppableRects:K,measureDroppableContainers:Q,measuringScheduled:X}=gu(q,{dragging:j,dependencies:[N.x,N.y],config:F.droppable}),H=hu(D,S),se=w.useMemo(()=>B?Xs(B):null,[B]),ee=st(),oe=mu(H,F.draggable.measure);Au({activeNode:S!=null?D.get(S):null,config:ee.layoutShiftCompensation,initialRect:oe,measure:F.draggable.measure});const L=qi(H,F.draggable.measure,oe),W=qi(H?H.parentElement:null),Y=w.useRef({activatorEvent:null,active:null,activeNode:H,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),te=R.getNodeFor((n=Y.current.over)==null?void 0:n.id),M=ju({measure:F.dragOverlay.measure}),Z=(r=M.nodeRef.current)!=null?r:H,ne=j?(s=M.rect)!=null?s:L:null,de=!!(M.nodeRef.current&&M.rect),ve=yu(de?null:L),Re=wl(Z?lt(Z):null),he=ku(j?te??H:null),Ee=Cu(he),Ye=Tl(p,{transform:{x:N.x-ve.x,y:N.y-ve.y,scaleX:1,scaleY:1},activatorEvent:B,active:_,activeNodeRect:L,containerNodeRect:W,draggingNodeRect:ne,over:Y.current.over,overlayNodeRect:M.rect,scrollableAncestors:he,scrollableAncestorRects:Ee,windowRect:Re}),Ct=se?Qn(se,N):null,_t=vu(he),ze=Hi(_t),Oe=Hi(_t,[L]),Te=Qn(Ye,ze),Ze=ne?Hd(ne,Ye):null,ce=_&&Ze?h({active:_,collisionRect:Ze,droppableRects:K,droppableContainers:q,pointerCoordinates:Ct}):null,at=dl(ce,"id"),[ue,we]=w.useState(null),Ft=de?Ye:Qn(Ye,Oe),Je=qd(Ft,(i=ue?.rect)!=null?i:null,L),He=w.useRef(null),Ue=w.useCallback((be,Se)=>{let{sensor:ye,options:Ie}=Se;if(O.current==null)return;const ge=D.get(O.current);if(!ge)return;const ke=be.nativeEvent,De=new ye({active:O.current,activeNode:ge,event:ke,options:Ie,context:Y,onAbort(fe){if(!D.get(fe))return;const{onDragAbort:Ne}=U.current,$e={id:fe};Ne?.($e),x({type:"onDragAbort",event:$e})},onPending(fe,Ae,Ne,$e){if(!D.get(fe))return;const{onDragPending:Ve}=U.current,Le={id:fe,constraint:Ae,initialCoordinates:Ne,offset:$e};Ve?.(Le),x({type:"onDragPending",event:Le})},onStart(fe){const Ae=O.current;if(Ae==null)return;const Ne=D.get(Ae);if(!Ne)return;const{onDragStart:$e}=U.current,ut={activatorEvent:ke,active:{id:Ae,data:Ne.data,rect:E}};Yt.unstable_batchedUpdates(()=>{$e?.(ut),C(Xt.Initializing),g({type:Fe.DragStart,initialCoordinates:fe,active:Ae}),x({type:"onDragStart",event:ut}),A(He.current),$(ke)})},onMove(fe){g({type:Fe.DragMove,coordinates:fe})},onEnd:_e(Fe.DragEnd),onCancel:_e(Fe.DragCancel)});He.current=De;function _e(fe){return async function(){const{active:Ne,collisions:$e,over:ut,scrollAdjustedTranslate:Ve}=Y.current;let Le=null;if(Ne&&Ve){const{cancelDrop:Ge}=U.current;Le={activatorEvent:ke,active:Ne,collisions:$e,delta:Ve,over:ut},fe===Fe.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(Le))&&(fe=Fe.DragCancel)}O.current=null,Yt.unstable_batchedUpdates(()=>{g({type:fe}),C(Xt.Uninitialized),we(null),A(null),$(null),He.current=null;const Ge=fe===Fe.DragEnd?"onDragEnd":"onDragCancel";if(Le){const We=U.current[Ge];We?.(Le),x({type:Ge,event:Le})}})}}},[D]),et=w.useCallback((be,Se)=>(ye,Ie)=>{const ge=ye.nativeEvent,ke=D.get(Ie);if(O.current!==null||!ke||ge.dndKit||ge.defaultPrevented)return;const De={active:ke};be(ye,Se.options,De)===!0&&(ge.dndKit={capturedBy:Se.sensor},O.current=Ie,Ue(ye,Se))},[D,Ue]),dt=pu(f,et);wu(f),Lt(()=>{L&&v===Xt.Initializing&&C(Xt.Initialized)},[L,v]),w.useEffect(()=>{const{onDragMove:be}=U.current,{active:Se,activatorEvent:ye,collisions:Ie,over:ge}=Y.current;if(!Se||!ye)return;const ke={active:Se,activatorEvent:ye,collisions:Ie,delta:{x:Te.x,y:Te.y},over:ge};Yt.unstable_batchedUpdates(()=>{be?.(ke),x({type:"onDragMove",event:ke})})},[Te.x,Te.y]),w.useEffect(()=>{const{active:be,activatorEvent:Se,collisions:ye,droppableContainers:Ie,scrollAdjustedTranslate:ge}=Y.current;if(!be||O.current==null||!Se||!ge)return;const{onDragOver:ke}=U.current,De=Ie.get(at),_e=De&&De.rect.current?{id:De.id,rect:De.rect.current,data:De.data,disabled:De.disabled}:null,fe={active:be,activatorEvent:Se,collisions:ye,delta:{x:ge.x,y:ge.y},over:_e};Yt.unstable_batchedUpdates(()=>{we(_e),ke?.(fe),x({type:"onDragOver",event:fe})})},[at]),Lt(()=>{Y.current={activatorEvent:B,active:_,activeNode:H,collisionRect:Ze,collisions:ce,droppableRects:K,draggableNodes:D,draggingNode:Z,draggingNodeRect:ne,droppableContainers:R,over:ue,scrollableAncestors:he,scrollAdjustedTranslate:Te},E.current={initial:ne,translated:Ze}},[_,H,ce,Ze,D,Z,ne,K,R,ue,he,Te]),du({...ee,delta:N,draggingRect:Ze,pointerCoordinates:Ct,scrollableAncestors:he,scrollableAncestorRects:Ee});const tt=w.useMemo(()=>({active:_,activeNode:H,activeNodeRect:L,activatorEvent:B,collisions:ce,containerNodeRect:W,dragOverlay:M,draggableNodes:D,droppableContainers:R,droppableRects:K,over:ue,measureDroppableContainers:Q,scrollableAncestors:he,scrollableAncestorRects:Ee,measuringConfiguration:F,measuringScheduled:X,windowRect:Re}),[_,H,L,B,ce,W,M,D,R,K,ue,Q,he,Ee,F,X,Re]),nt=w.useMemo(()=>({activatorEvent:B,activators:dt,active:_,activeNodeRect:L,ariaDescribedById:{draggable:G},dispatch:g,draggableNodes:D,over:ue,measureDroppableContainers:Q}),[B,dt,_,L,g,G,D,ue,Q]);return je.createElement(ll.Provider,{value:k},je.createElement(Ns.Provider,{value:nt},je.createElement(jl.Provider,{value:tt},je.createElement(gr.Provider,{value:Je},d)),je.createElement(Iu,{disabled:l?.restoreFocus===!1})),je.createElement(Md,{...l,hiddenTextDescribedById:G}));function st(){const be=I?.autoScrollEnabled===!1,Se=typeof a=="object"?a.enabled===!1:a===!1,ye=j&&!be&&!Se;return typeof a=="object"?{...a,enabled:ye}:{enabled:ye}}}),Ou=w.createContext(null),Vi="button",$u="Draggable";function Mu(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=Ds($u),{activators:o,activatorEvent:l,active:a,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:u}=w.useContext(Ns),{role:p=Vi,roleDescription:m="draggable",tabIndex:b=0}=s??{},y=a?.id===e,g=w.useContext(y?gr:Ou),[x,k]=Gs(),[v,C]=Gs(),j=Su(o,e),S=ks(n);Lt(()=>(h.set(e,{id:e,key:i,node:x,activatorNode:v,data:S}),()=>{const N=h.get(e);N&&N.key===i&&h.delete(e)}),[h,e]);const D=w.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":y&&p===Vi?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,p,b,y,m,f.draggable]);return{active:a,activatorEvent:l,activeNodeRect:d,attributes:D,isDragging:y,listeners:r?void 0:j,node:x,over:u,setNodeRef:k,setActivatorNodeRef:C,transform:g}}function Dl(){return w.useContext(jl)}const zu="Droppable",Lu={timeout:25};function Nl(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=Ds(zu),{active:o,dispatch:l,over:a,measureDroppableContainers:d}=w.useContext(Ns),f=w.useRef({disabled:n}),h=w.useRef(!1),u=w.useRef(null),p=w.useRef(null),{disabled:m,updateMeasurementsFor:b,timeout:y}={...Lu,...s},g=ks(b??r),x=w.useCallback(()=>{if(!h.current){h.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(g.current)?g.current:[g.current]),p.current=null},y)},[y]),k=pr({callback:x,disabled:m||!o}),v=w.useCallback((D,N)=>{k&&(N&&(k.unobserve(N),h.current=!1),D&&k.observe(D))},[k]),[C,j]=Gs(v),S=ks(e);return w.useEffect(()=>{!k||!C.current||(k.disconnect(),h.current=!1,k.observe(C.current))},[C,k]),w.useEffect(()=>(l({type:Fe.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:u,data:S}}),()=>l({type:Fe.UnregisterDroppable,key:i,id:r})),[r]),w.useEffect(()=>{n!==f.current.disabled&&(l({type:Fe.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,l]),{active:o,rect:u,isOver:a?.id===r,node:C,over:a,setNodeRef:j}}function Pu(t){let{animation:e,children:n}=t;const[r,s]=w.useState(null),[i,o]=w.useState(null),l=Qs(n);return!n&&!r&&l&&s(l),Lt(()=>{if(!i)return;const a=r?.key,d=r?.props.id;if(a==null||d==null){s(null);return}Promise.resolve(e(d,i)).then(()=>{s(null)})},[e,r,i]),je.createElement(je.Fragment,null,n,r?w.cloneElement(r,{ref:o}):null)}const Fu={x:0,y:0,scaleX:1,scaleY:1};function Uu(t){let{children:e}=t;return je.createElement(Ns.Provider,{value:Cl},je.createElement(gr.Provider,{value:Fu},e))}const qu={position:"fixed",touchAction:"none"},Ku=t=>fr(t)?"transform 250ms ease":void 0,Hu=w.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:l,style:a,transform:d,transition:f=Ku}=t;if(!l)return null;const h=s?d:{...d,scaleX:1,scaleY:1},u={...qu,width:l.width,height:l.height,top:l.top,left:l.left,transform:Jt.Transform.toString(h),transformOrigin:s&&r?Ld(r,l):void 0,transition:typeof f=="function"?f(r):f,...a};return je.createElement(n,{className:o,style:u,ref:e},i)}),Wu=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[l,a]of Object.entries(i.active))a!==void 0&&(s[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,a));if(i!=null&&i.dragOverlay)for(const[l,a]of Object.entries(i.dragOverlay))a!==void 0&&r.node.style.setProperty(l,a);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[a,d]of Object.entries(s))n.node.style.setProperty(a,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},Vu=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Jt.Transform.toString(e)},{transform:Jt.Transform.toString(n)}]},Gu={duration:250,easing:"ease",keyframes:Vu,sideEffects:Wu({styles:{active:{opacity:"0"}}})};function Qu(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return ur((i,o)=>{if(e===null)return;const l=n.get(i);if(!l)return;const a=l.node.current;if(!a)return;const d=Sl(o);if(!d)return;const{transform:f}=lt(o).getComputedStyle(o),h=hl(f);if(!h)return;const u=typeof e=="function"?e:Xu(e);return kl(a,s.draggable.measure),u({active:{id:i,data:l.data,node:a,rect:s.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:s,transform:h})})}function Xu(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...Gu,...t};return i=>{let{active:o,dragOverlay:l,transform:a,...d}=i;if(!e)return;const f={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},h={scaleX:a.scaleX!==1?o.rect.width*a.scaleX/l.rect.width:1,scaleY:a.scaleY!==1?o.rect.height*a.scaleY/l.rect.height:1},u={x:a.x-f.x,y:a.y-f.y,...h},p=s({...d,active:o,dragOverlay:l,transform:{initial:a,final:u}}),[m]=p,b=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(b))return;const y=r?.({active:o,dragOverlay:l,...d}),g=l.node.animate(p,{duration:e,easing:n,fill:"forwards"});return new Promise(x=>{g.onfinish=()=>{y?.(),x()}})}}let Gi=0;function Yu(t){return w.useMemo(()=>{if(t!=null)return Gi++,Gi},[t])}const Zu=je.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:l="div",className:a,zIndex:d=999}=t;const{activatorEvent:f,active:h,activeNodeRect:u,containerNodeRect:p,draggableNodes:m,droppableContainers:b,dragOverlay:y,over:g,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:v,windowRect:C}=Dl(),j=w.useContext(gr),S=Yu(h?.id),D=Tl(o,{activatorEvent:f,active:h,activeNodeRect:u,containerNodeRect:p,draggingNodeRect:y.rect,over:g,overlayNodeRect:y.rect,scrollableAncestors:k,scrollableAncestorRects:v,transform:j,windowRect:C}),N=hi(u),R=Qu({config:r,draggableNodes:m,droppableContainers:b,measuringConfiguration:x}),T=N?y.setRef:void 0;return je.createElement(Uu,null,je.createElement(Pu,{animation:R},h&&S?je.createElement(Hu,{key:S,id:h.id,ref:T,as:l,activatorEvent:f,adjustScale:e,className:a,transition:i,rect:N,style:{zIndex:d,...s},transform:D},n):null))});function Ju(t){const{org:e}=Be(),{data:n}=wo.useSession(),r=Va(),s=an(),i=Pa({connectionId:Mo,orgId:e.id,orgSlug:e.slug}),[o,l]=w.useState(!1),a=Ha(t,{enabled:!1});return{connect:async()=>{if(!(o||!n?.user?.id||!e)){l(!0);try{const f=a.data??(await a.refetch()).data;if(!f){vt.error("Could not find this integration in the registry");return}const h=Ya(f,e.id,n.user.id,{remoteIndex:0});if(!h.connection_url){vt.error("This integration has no connection method available");return}const u=h.app_name?await ef(i,h.app_name):null,p=!u,m=u?.id??(await r.create.mutateAsync(h)).id,b=await Xa({connectionId:m,orgId:e.id,orgSlug:e.slug,persistFallback:y=>r.update.mutateAsync({id:m,data:{connection_token:y}}).then(()=>{})});if(b.ran&&!b.ok){if(p)try{await r.delete.mutateAsync(m)}catch{}vt.error(`Authentication failed: ${b.error??"no token"}`);return}va(s,e.id),vt.success(p?"Connected successfully":"Already connected")}catch(f){vt.error(`Failed to connect: ${f instanceof Error?f.message:String(f)}`)}finally{l(!1)}}},isConnecting:o}}async function ef(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 pi(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function tf(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function Ms(t){return t!==null&&t>=0}function nf(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 sf(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Rl=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=pi(e,r,n),o=e[s],l=i[s];return!l||!o?null:{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}},zs={scaleX:1,scaleY:1},rf=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const l=(e=i[n])!=null?e:r;if(!l)return null;if(s===n){const d=i[o];return d?{x:0,y:n<o?d.top+d.height-(l.top+l.height):d.top-l.top,...zs}:null}const a=of(i,s,n);return s>n&&s<=o?{x:0,y:-l.height-a,...zs}:s<n&&s>=o?{x:0,y:l.height+a,...zs}:{x:0,y:0,...zs}};function of(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 El="Sortable",Il=je.createContext({activeIndex:-1,containerId:El,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Rl,disabled:{draggable:!1,droppable:!1}});function lf(t){let{children:e,id:n,items:r,strategy:s=Rl,disabled:i=!1}=t;const{active:o,dragOverlay:l,droppableRects:a,over:d,measureDroppableContainers:f}=Dl(),h=Ds(El,n),u=l.rect!==null,p=w.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),m=o!=null,b=o?p.indexOf(o.id):-1,y=d?p.indexOf(d.id):-1,g=w.useRef(p),x=!nf(p,g.current),k=y!==-1&&b===-1||x,v=sf(i);Lt(()=>{x&&m&&f(p)},[x,p,m,f]),w.useEffect(()=>{g.current=p},[p]);const C=w.useMemo(()=>({activeIndex:b,containerId:h,disabled:v,disableTransforms:k,items:p,overIndex:y,useDragOverlay:u,sortedRects:tf(p,a),strategy:s}),[b,h,v.draggable,v.droppable,k,p,y,a,u,s]);return je.createElement(Il.Provider,{value:C},e)}const af=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return pi(n,r,s).indexOf(e)},cf=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:l,previousContainerId:a,transition:d}=t;return!d||!r||l!==i&&s===o?!1:n?!0:o!==s&&e===a},df={duration:200,easing:"ease"},_l="transform",uf=Jt.Transition.toString({property:_l,duration:0,easing:"linear"}),ff={roleDescription:"sortable"};function hf(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=w.useState(null),l=w.useRef(n);return Lt(()=>{if(!e&&n!==l.current&&r.current){const a=s.current;if(a){const d=Jn(r.current,{ignoreTransform:!0}),f={x:a.left-d.left,y:a.top-d.top,scaleX:a.width/d.width,scaleY:a.height/d.height};(f.x||f.y)&&o(f)}}n!==l.current&&(l.current=n)},[e,n,r,s]),w.useEffect(()=>{i&&o(null)},[i]),i}function pf(t){let{animateLayoutChanges:e=cf,attributes:n,disabled:r,data:s,getNewIndex:i=af,id:o,strategy:l,resizeObserverConfig:a,transition:d=df}=t;const{items:f,containerId:h,activeIndex:u,disabled:p,disableTransforms:m,sortedRects:b,overIndex:y,useDragOverlay:g,strategy:x}=w.useContext(Il),k=gf(r,p),v=f.indexOf(o),C=w.useMemo(()=>({sortable:{containerId:h,index:v,items:f},...s}),[h,s,v,f]),j=w.useMemo(()=>f.slice(f.indexOf(o)),[f,o]),{rect:S,node:D,isOver:N,setNodeRef:R}=Nl({id:o,data:C,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...a}}),{active:T,activatorEvent:E,activeNodeRect:_,attributes:O,setNodeRef:I,listeners:A,isDragging:B,over:$,setActivatorNodeRef:U,transform:G}=Mu({id:o,data:C,attributes:{...ff,...n},disabled:k.draggable}),q=Cd(R,I),F=!!T,K=F&&!m&&Ms(u)&&Ms(y),Q=!g&&B,X=Q&&K?G:null,se=K?X??(l??x)({rects:b,activeNodeRect:_,activeIndex:u,overIndex:y,index:v}):null,ee=Ms(u)&&Ms(y)?i({id:o,items:f,activeIndex:u,overIndex:y}):v,oe=T?.id,L=w.useRef({activeId:oe,items:f,newIndex:ee,containerId:h}),W=f!==L.current.items,Y=e({active:T,containerId:h,isDragging:B,isSorting:F,id:o,index:v,items:f,newIndex:L.current.newIndex,previousItems:L.current.items,previousContainerId:L.current.containerId,transition:d,wasDragging:L.current.activeId!=null}),te=hf({disabled:!Y,index:v,node:D,rect:S});return w.useEffect(()=>{F&&L.current.newIndex!==ee&&(L.current.newIndex=ee),h!==L.current.containerId&&(L.current.containerId=h),f!==L.current.items&&(L.current.items=f)},[F,ee,h,f]),w.useEffect(()=>{if(oe===L.current.activeId)return;if(oe!=null&&L.current.activeId==null){L.current.activeId=oe;return}const Z=setTimeout(()=>{L.current.activeId=oe},50);return()=>clearTimeout(Z)},[oe]),{active:T,activeIndex:u,attributes:O,data:C,rect:S,index:v,newIndex:ee,items:f,isOver:N,isSorting:F,isDragging:B,listeners:A,node:D,overIndex:y,over:$,setNodeRef:q,setActivatorNodeRef:U,setDroppableNodeRef:R,setDraggableNodeRef:I,transform:te??se,transition:M()};function M(){if(te||W&&L.current.newIndex===v)return uf;if(!(Q&&!fr(E)||!d)&&(F||Y))return Jt.Transition.toString({...d,property:_l})}}function gf(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 Js(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 mf=[le.Down,le.Right,le.Up,le.Left],xf=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:l}}=e;if(mf.includes(t.code)){if(t.preventDefault(),!n||!r)return;const a=[];i.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const u=s.get(h.id);if(u)switch(t.code){case le.Down:r.top<u.top&&a.push(h);break;case le.Up:r.top>u.top&&a.push(h);break;case le.Left:r.left>u.left&&a.push(h);break;case le.Right:r.left<u.left&&a.push(h);break}});const d=ul({collisionRect:r,droppableRects:s,droppableContainers:a});let f=dl(d,"id");if(f===o?.id&&d.length>1&&(f=d[1].id),f!=null){const h=i.get(n.id),u=i.get(f),p=u?s.get(u.id):null,m=u?.node.current;if(m&&p&&h&&u){const y=hr(m).some((j,S)=>l[S]!==j),g=Al(h,u),x=bf(h,u),k=y||!g?{x:0,y:0}:{x:x?r.width-p.width:0,y:x?r.height-p.height:0},v={x:p.left,y:p.top};return k.x&&k.y?v:vs(v,k)}}}};function Al(t,e){return!Js(t)||!Js(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function bf(t,e){return!Js(t)||!Js(e)||!Al(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function zt(t){const e=P.c(8),{size:n,className:r}=t,s=n===void 0?16:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=J("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==o?(l=c.jsx("img",{src:Fa,alt:"Super Agent",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const Qi=()=>0;function yf(t){const{orgSlug:e,enabled:n=!0,onUpdate:r,onDelete:s}=t,i=w.useRef(r);i.current=r;const o=w.useRef(s);o.current=s;const l=w.useRef(null),a=w.useRef(n),d=w.useRef(e);(!l.current||a.current!==n||d.current!==e)&&(a.current=n,d.current=e,l.current=h=>{if(!n||!e)return()=>{};const u=p=>{let m;try{m=JSON.parse(p.data)}catch{return}m.data&&(p.type===Ja?o.current?.(m.data.id):i.current(m.data)),h()};return Za.subscribe(e,u)}),w.useSyncExternalStore(l.current,Qi,Qi)}function kf(){const t=P.c(30),{org:e,locator:n}=Be(),r=cn(),s=an();let i;t[0]!==n?(i=xe.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const o=i;let l;t[2]!==r?(l=async()=>(await r.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=r,t[3]=l):l=t[3];let a;t[4]!==o||t[5]!==l?(a={queryKey:o,queryFn:l},t[4]=o,t[5]=l,t[6]=a):a=t[6];const d=Qe(a);let f;t[7]!==n||t[8]!==s||t[9]!==o?(f=g=>{s.setQueryData(o,x=>{const k=x??[];return k.some(v=>v.id===g.id)?k.map(v=>v.id===g.id?g:v):[g,...k]}),s.invalidateQueries({queryKey:xe.taskBoardActivity(n,g.id)})},t[7]=n,t[8]=s,t[9]=o,t[10]=f):f=t[10];let h;t[11]!==s||t[12]!==o?(h=g=>{s.setQueryData(o,x=>x?.filter(k=>k.id!==g))},t[11]=s,t[12]=o,t[13]=h):h=t[13];let u;t[14]!==e.slug||t[15]!==f||t[16]!==h?(u={orgSlug:e.slug,onUpdate:f,onDelete:h},t[14]=e.slug,t[15]=f,t[16]=h,t[17]=u):u=t[17],yf(u);let p;t[18]!==s||t[19]!==o?(p=g=>{const x=g.subject,k=g.data.status;s.setQueryData(o,v=>v?.map(C=>C.threads.some(j=>j.threadId===x)?{...C,threads:C.threads.map(j=>j.threadId===x?{...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],tc(m);let b;t[24]!==d.data?(b=d.data??[],t[24]=d.data,t[25]=b):b=t[25];let y;return t[26]!==d.error||t[27]!==d.isLoading||t[28]!==b?(y={items:b,isLoading:d.isLoading,error:d.error},t[26]=d.error,t[27]=d.isLoading,t[28]=b,t[29]=y):y=t[29],y}function vf(){const t=P.c(55),{locator:e}=Be(),n=cn(),r=an(),s=ie();let i;t[0]!==e?(i=xe.taskBoardItems(e),t[0]=e,t[1]=i):i=t[1];const o=i;let l;t[2]!==r||t[3]!==o?(l=()=>r.invalidateQueries({queryKey:o}),t[2]=r,t[3]=o,t[4]=l):l=t[4];const a=l;let d;t[5]!==n?(d=I=>n.call("TASK_BOARD_ITEM_CREATE",I),t[5]=n,t[6]=d):d=t[6];let f;t[7]!==a||t[8]!==d?(f={mutationFn:d,onSuccess:a},t[7]=a,t[8]=d,t[9]=f):f=t[9];const h=it(f);let u;t[10]!==n?(u=I=>n.call("TASK_BOARD_ITEM_UPDATE",I),t[10]=n,t[11]=u):u=t[11];let p,m;t[12]!==r||t[13]!==o?(p=async I=>{await r.cancelQueries({queryKey:o});const A=r.getQueryData(o);return r.setQueryData(o,B=>B?.map($=>$.id===I.id?{...$,...I}:$)),{previous:A}},m=(I,A,B)=>{B?.previous&&r.setQueryData(o,B.previous)},t[12]=r,t[13]=o,t[14]=p,t[15]=m):(p=t[14],m=t[15]);let b;t[16]!==a||t[17]!==e||t[18]!==r?(b=(I,A,B)=>{a(),r.invalidateQueries({queryKey:xe.taskBoardActivity(e,B.id)})},t[16]=a,t[17]=e,t[18]=r,t[19]=b):b=t[19];let y;t[20]!==u||t[21]!==p||t[22]!==m||t[23]!==b?(y={mutationFn:u,onMutate:p,onError:m,onSettled:b},t[20]=u,t[21]=p,t[22]=m,t[23]=b,t[24]=y):y=t[24];const g=it(y);let x;t[25]!==n?(x=I=>n.call("TASK_BOARD_ITEM_DELETE",{id:I}),t[25]=n,t[26]=x):x=t[26];let k;t[27]!==a||t[28]!==s?(k=I=>{vt.error(I instanceof Error&&I.message?I.message:s("taskBoard.taskBoard.deleteError")),a()},t[27]=a,t[28]=s,t[29]=k):k=t[29];let v;t[30]!==a||t[31]!==k||t[32]!==x?(v={mutationFn:x,onSuccess:a,onError:k},t[30]=a,t[31]=k,t[32]=x,t[33]=v):v=t[33];const C=it(v);let j;t[34]!==n?(j=async I=>{const A=await Promise.allSettled(I.map(B=>n.call("TASK_BOARD_ITEM_DELETE",{id:B})));return{total:I.length,failed:A.filter(wf).length}},t[34]=n,t[35]=j):j=t[35];let S,D;t[36]!==s?(S=I=>{const{total:A,failed:B}=I;B!==0&&vt.error(s("taskBoard.taskBoard.deleteBulkError",{failed:String(B),total:String(A)}))},D=()=>vt.error(s("taskBoard.taskBoard.deleteError")),t[36]=s,t[37]=S,t[38]=D):(S=t[37],D=t[38]);let N;t[39]!==a||t[40]!==j||t[41]!==S||t[42]!==D?(N={mutationFn:j,onSuccess:S,onError:D,onSettled:a},t[39]=a,t[40]=j,t[41]=S,t[42]=D,t[43]=N):N=t[43];const R=it(N);let T;t[44]!==n?(T=I=>n.call("TASK_BOARD_ITEM_UPDATE",I),t[44]=n,t[45]=T):T=t[45];let E;t[46]!==a||t[47]!==T?(E={mutationFn:T,onSuccess:a},t[46]=a,t[47]=T,t[48]=E):E=t[48];const _=it(E);let O;return t[49]!==h||t[50]!==_||t[51]!==C||t[52]!==R||t[53]!==g?(O={create:h,update:g,remove:C,removeMany:R,link:_},t[49]=h,t[50]=_,t[51]=C,t[52]=R,t[53]=g,t[54]=O):O=t[54],O}function wf(t){return t.status==="rejected"}function er(t){return t.threads.some(e=>e.status==="requires_action")}function gi(t){return t.status==="in_progress"&&er(t)?"text-warning animate-pulse":Nt[t.status].iconClassName}function Sf(t){return t.threads[0]}function Xi(t,e,n){const r=t.findIndex(f=>f.id===n),s=e===n?t[r+1]?.id??null:e,i=t.filter(f=>f.id!==n),o=s?i.findIndex(f=>f.id===s):-1,l=o===-1?i.length:o,a=i[l-1],d=i[l];return a&&d?(a.sortOrder+d.sortOrder)/2:a?a.sortOrder+1:d?d.sortOrder-1:0}function Bl(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const tr=["triage","todo","in_progress","in_review","done"],Nt={triage:{labelKey:"taskBoard.config.statusBacklog",icon:cr,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:nc,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Ss,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:sc,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:dn,iconClassName:"text-success"}},mi=["none","low","medium","high","urgent"],Rt={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive"}},Lr=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],Ol=Lr[0];function Rs(t){return t??Ol}function Cf(t){return Lr[t%Lr.length]??Ol}function $l(t){const e=P.c(11),{size:n,className:r}=t,s=n===void 0?16:n,i=ie();let o;e[0]!==i?(o=i("taskBoard.taskDialog.qaAgentLabel"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==s?(l={width:s,height:s},e[2]=s,e[3]=l):l=e[3];let a;e[4]!==r?(a=J("shrink-0 rounded-full object-cover",r),e[4]=r,e[5]=a):a=e[5];let d;return e[6]!==s||e[7]!==o||e[8]!==l||e[9]!==a?(d=c.jsx("img",{src:Ua,alt:o,width:s,height:s,style:l,className:a}),e[6]=s,e[7]=o,e[8]=l,e[9]=a,e[10]=d):d=e[10],d}function Ml(t){const e=P.c(8),{size:n,className:r}=t,s=n===void 0?16:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=J("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==o?(l=c.jsx("img",{src:qa,alt:"Code Reviewer",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=l):l=e[7],l}let Pr,Fr;if(typeof WeakMap<"u"){let t=new WeakMap;Pr=e=>t.get(e),Fr=(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]},Fr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var Vt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,s=e/this.width|0;let i=r+1,o=s+1;for(let l=1;i<this.width&&this.map[e+l]==n;l++)i++;for(let l=1;o<this.height&&this.map[e+this.width*l]==n;l++)o++;return{left:r,top:s,right:i,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:s,top:i,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?r==0:s==this.width)?null:this.map[i*this.width+(n<0?r-1:s)]:(n<0?i==0:o==this.height)?null:this.map[r+this.width*(n<0?i-1:o)]}rectBetween(t,e){const{left:n,right:r,top:s,bottom:i}=this.findCell(t),{left:o,right:l,top:a,bottom:d}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(s,a),right:Math.max(r,l),bottom:Math.max(i,d)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let s=t.left;s<t.right;s++){const i=r*this.width+s,o=this.map[i];n[o]||(n[o]=!0,!(s==t.left&&s&&this.map[i-1]==o||r==t.top&&r&&this.map[i-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let r=0,s=0;;r++){const i=s+n.child(r).nodeSize;if(r==t){let o=e+t*this.width;const l=(t+1)*this.width;for(;o<l&&this.map[o]<s;)o++;return o==l?i-1:this.map[o]}s=i}}static get(t){return Pr(t)||Fr(t,jf(t))}};function jf(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Tf(t),n=t.childCount,r=[];let s=0,i=null;const o=[];for(let d=0,f=e*n;d<f;d++)r[d]=0;for(let d=0,f=0;d<n;d++){const h=t.child(d);f++;for(let m=0;;m++){for(;s<r.length&&r[s]!=0;)s++;if(m==h.childCount)break;const b=h.child(m),{colspan:y,rowspan:g,colwidth:x}=b.attrs;for(let k=0;k<g;k++){if(k+d>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:f,n:g-k});break}const v=s+k*e;for(let C=0;C<y;C++){r[v+C]==0?r[v+C]=f:(i||(i=[])).push({type:"collision",row:d,pos:f,n:y-C});const j=x&&x[C];if(j){const S=(v+C)%e*2,D=o[S];D==null||D!=j&&o[S+1]==1?(o[S]=j,o[S+1]=1):D==j&&o[S+1]++}}}s+=y,f+=b.nodeSize}const u=(d+1)*e;let p=0;for(;s<u;)r[s++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:d,n:p}),f++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const l=new Vt(e,n,r,i);let a=!1;for(let d=0;!a&&d<o.length;d+=2)o[d]!=null&&o[d+1]<n&&(a=!0);return a&&Df(l,o,t),l}function Tf(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const s=t.child(r);let i=0;if(n)for(let o=0;o<r;o++){const l=t.child(o);for(let a=0;a<l.childCount;a++){const d=l.child(a);o+d.attrs.rowspan>r&&(i+=d.attrs.colspan)}}for(let o=0;o<s.childCount;o++){const l=s.child(o);i+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function Df(t,e,n){t.problems||(t.problems=[]);const r={};for(let s=0;s<t.map.length;s++){const i=t.map[s];if(r[i])continue;r[i]=!0;const o=n.nodeAt(i);if(!o)throw new RangeError(`No cell with offset ${i} found`);let l=null;const a=o.attrs;for(let d=0;d<a.colspan;d++){const f=e[(s+d)%t.width*2];f!=null&&(!a.colwidth||a.colwidth[d]!=f)&&((l||(l=Nf(a)))[d]=f)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function Nf(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function xi(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 Zt("selectingCells");function Rf(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 zl(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 Ef(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=Rf(e.$head)||If(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function If(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Yi(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Ll(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Pl(t,e,n){const r=t.node(-1),s=Vt.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 Zi(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 Kt=class Wt extends qt{constructor(e,n=e){const r=e.node(-1),s=Vt.get(r),i=e.start(-1),o=s.rectBetween(e.pos-i,n.pos-i),l=e.node(0),a=s.cellsInRect(o).filter(f=>f!=n.pos-i);a.unshift(n.pos-i);const d=a.map(f=>{const h=r.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const u=i+f+1;return new dc(l.resolve(u),l.resolve(u+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),s=e.resolve(n.map(this.$headCell.pos));if(Yi(r)&&Yi(s)&&Ll(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Wt.rowSelection(r,s):i&&this.isColSelection()?Wt.colSelection(r,s):new Wt(r,s)}return Ho.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=Vt.get(e),r=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},o=[];for(let a=s.top;a<s.bottom;a++){const d=[];for(let f=a*n.width+s.left,h=s.left;h<s.right;h++,f++){const u=n.map[f];if(i[u])continue;i[u]=!0;const p=n.findCell(u);let m=e.nodeAt(u);if(!m)throw new RangeError(`No cell with offset ${u} found`);const b=s.left-p.left,y=p.right-s.right;if(b>0||y>0){let g=m.attrs;if(b>0&&(g=Zi(g,0,b)),y>0&&(g=Zi(g,g.colspan-y,y)),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)}d.push(m)}o.push(e.child(a).copy(Cr.from(d)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new as(Cr.from(l),1,1)}replace(e,n=as.empty){const r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){const{$from:l,$to:a}=s[o],d=e.mapping.slice(r);e.replace(d.map(l.pos),d.map(a.pos),o?as.empty:n)}const i=qt.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new as(Cr.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Vt.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=Vt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.top<=l.top?(o.top>0&&(e=a.resolve(i+s.map[o.left])),l.bottom<s.height&&(n=a.resolve(i+s.map[s.width*(s.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(i+s.map[l.left])),o.bottom<s.height&&(e=a.resolve(i+s.map[s.width*(s.height-1)+o.right-1]))),new Wt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Vt.get(e),r=this.$anchorCell.start(-1),s=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(s,i)>0)return!1;const o=s+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(e){return e instanceof Wt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=Vt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.left<=l.left?(o.left>0&&(e=a.resolve(i+s.map[o.top*s.width])),l.right<s.width&&(n=a.resolve(i+s.map[s.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(i+s.map[l.top*s.width])),o.right<s.width&&(e=a.resolve(i+s.map[s.width*(o.top+1)-1]))),new Wt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Wt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Wt(e.resolve(n),e.resolve(r))}getBookmark(){return new _f(this.$anchorCell.pos,this.$headCell.pos)}};Kt.prototype.visible=!1;qt.jsonID("cell",Kt);var _f=class Fl{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Fl(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&&Ll(n,r)?new Kt(n,r):qt.near(r,1)}};new Zt("fix-tables");function Ul(t){const e=t.selection,n=Ef(t),r=n.node(-1),s=n.start(-1),i=Vt.get(r);return{...e instanceof Kt?i.rectBetween(e.$anchorCell.pos-s,e.$headCell.pos-s):i.findCell(n.pos-s),tableStart:s,map:i,table:r}}function Af(t){return function(e,n){if(!zl(e))return!1;if(n){const r=xi(e.schema),s=Ul(e),i=e.tr,o=s.map.cellsInRect(t=="column"?{left:s.left,top:0,right:s.right,bottom:s.map.height}:t=="row"?{left:0,top:s.top,right:s.map.width,bottom:s.bottom}:s),l=o.map(a=>s.table.nodeAt(a));for(let a=0;a<o.length;a++)l[a].type==r.header_cell&&i.setNodeMarkup(s.tableStart+o[a],r.cell,l[a].attrs);if(i.steps.length===0)for(let a=0;a<o.length;a++)i.setNodeMarkup(s.tableStart+o[a],r.header_cell,l[a].attrs);n(i)}return!0}}function Ji(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 bi(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Af(t):function(n,r){if(!zl(n))return!1;if(r){const s=xi(n.schema),i=Ul(n),o=n.tr,l=Ji("row",i,s),a=Ji("column",i,s),d=(t==="column"?l:t==="row"&&a)?1:0,f=t=="column"?{left:0,top:d,right:1,bottom:i.map.height}:t=="row"?{left:d,top:0,right:i.map.width,bottom:1}:i,h=t=="column"?a?s.cell:s.header_cell:t=="row"?l?s.cell:s.header_cell:s.cell;i.map.cellsInRect(f).forEach(u=>{const p=u+i.tableStart,m=o.doc.nodeAt(p);m&&o.setNodeMarkup(p,h,m.attrs)}),r(o)}return!0}}bi("row",{useDeprecatedLogic:!0});bi("column",{useDeprecatedLogic:!0});bi("cell",{useDeprecatedLogic:!0});function Ls(t,e){const n=t.selection;if(!(n instanceof Kt))return!1;if(e){const r=t.tr,s=xi(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 as(s,0,0))}),r.docChanged&&e(r)}return!0}uc({ArrowLeft:Ps("horiz",-1),ArrowRight:Ps("horiz",1),ArrowUp:Ps("vert",-1),ArrowDown:Ps("vert",1),"Shift-ArrowLeft":Fs("horiz",-1),"Shift-ArrowRight":Fs("horiz",1),"Shift-ArrowUp":Fs("vert",-1),"Shift-ArrowDown":Fs("vert",1),Backspace:Ls,"Mod-Backspace":Ls,Delete:Ls,"Mod-Delete":Ls});function Vs(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ps(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof Kt)return Vs(n,r,qt.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=ql(s,t,e);if(o==null)return!1;if(t=="horiz")return Vs(n,r,qt.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(o),a=Pl(l,t,e);let d;return a?d=qt.near(a,1):e<0?d=qt.near(n.doc.resolve(l.before(-1)),-1):d=qt.near(n.doc.resolve(l.after(-1)),1),Vs(n,r,d)}}}function Fs(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;let o;if(i instanceof Kt)o=i;else{const a=ql(s,t,e);if(a==null)return!1;o=new Kt(n.doc.resolve(a))}const l=Pl(o.$headCell,t,e);return l?Vs(n,r,new Kt(o.$anchorCell,l)):!1}}function ql(t,e,n){if(!(t.state.selection instanceof Ho))return null;const{$head:r}=t.state.selection;for(let s=r.depth-1;s>=0;s--){const i=r.node(s);if((n<0?r.index(s):r.indexAfter(s))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const o=r.before(s),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?o:null}}return null}new Zt("tableColumnResizing");function Bf(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),s=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-s,l=r-n,a=s,d=n;return new DOMRect(a,d,o,l)}var Of=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:s=250,resizeDelay:i=60,shouldShow:o,appendTo:l,getReferencedVirtualElement:a,options:d}){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:h,state:u,from:p,to:m})=>{const{doc:b,selection:y}=u,{empty:g}=y,x=!b.textBetween(p,m).length&&fc(u.selection),k=this.element.contains(document.activeElement);return!(!(h.hasFocus()||k)||g||x||!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:h})=>{var u;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}h?.relatedTarget&&((u=this.element.parentNode)!=null&&u.contains(h.relatedTarget))||h?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(h,u)=>{const p=!u?.selection.eq(h.state.selection),m=!u?.doc.eq(h.state.doc);!p&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(h,p,m,u)},this.updateDelay))},this.updateHandler=(h,u,p,m)=>{const{composing:b}=h;if(b||!u&&!p)return;if(!this.getShouldShow(m)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:h})=>{const u=h.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())};var f;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(f=d?.scrollTarget)!=null?f:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...d},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(So(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Co(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(jo(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(To(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Do(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(No(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Ro(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=Wo(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof hc){let l=this.view.nodeDOM(r.from);const a=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");a&&(l=a),l&&(o={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(r instanceof Kt){const{$anchorCell:l,$headCell:a}=r,d=l?l.pos:a.pos,f=a?a.pos:l.pos,h=this.view.nodeDOM(d),u=this.view.nodeDOM(f);if(!h||!u)return;const p=h===u?h.getBoundingClientRect():Bf(h.getBoundingClientRect(),u.getBoundingClientRect());o={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&Io(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:r,middlewareData:s})=>{var i,o;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((i=s.hide)!=null&&i.referenceHidden||(o=s.hide)!=null&&o.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:n}=t,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(t,e);return}const s=!e?.selection.eq(t.state.selection),i=!e?.doc.eq(t.state.doc);this.updateHandler(t,s,i,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:s}=r,i=Math.min(...s.map(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:i,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Kl=t=>new Jr({key:typeof t.pluginKey=="string"?new Zt(t.pluginKey):t.pluginKey,view:e=>new Of({view:e,...t})});ei.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Kl({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 $f=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:s=250,resizeDelay:i=60,options:o,appendTo:l,shouldShow:a}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:f,state:h})=>{const{selection:u}=h,{$anchor:p,empty:m}=u,b=p.depth===1,y=p.parent.isTextblock&&!p.parent.type.spec.code&&!p.parent.textContent&&p.parent.childCount===0&&!this.getTextContent(p.parent);return!(!f.hasFocus()||!m||!b||!y||!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,h,u,p)=>{const{composing:m}=f;if(m||!h&&!u)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 h;if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:f})=>{const h=f.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())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var d;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(d=o?.scrollTarget)!=null?d:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return pc(t,{textSerializers:gc(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(So(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Co(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(jo(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(To(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Do(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(No(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Ro(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(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:n,oldState:t,from:i,to:o})}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){const{selection:t}=this.editor.state,e=Wo(this.view,t.from,t.to);Io({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:r,y:s,strategy:i,middlewareData:o})=>{var l,a;if((l=o.hide)!=null&&l.referenceHidden||(a=o.hide)!=null&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${r}px`,this.element.style.top=`${s}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const n=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,n,r,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Hl=t=>new Jr({key:typeof t.pluginKey=="string"?new Zt(t.pluginKey):t.pluginKey,view:e=>new $f({view:e,...t})});ei.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?[Hl({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 Mf=je.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,getReferencedVirtualElement:o,options:l,children:a,...d},f)=>{const h=w.useRef(document.createElement("div"));typeof f=="function"?f(h.current):f&&(f.current=h.current);const{editor:u}=Vo(),p=e||u,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:l},b=w.useRef(m);b.current=m;const[y,g]=w.useState(!1),x=w.useRef(!0);return w.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const k=h.current;k.style.visibility="hidden",k.style.position="absolute";const v=Kl({...b.current,editor:p,element:k});p.registerPlugin(v);const C=b.current.pluginKey;return x.current=!0,g(!0),()=>{g(!1),p.unregisterPlugin(C),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[p]),w.useEffect(()=>{if(!(!y||!p||p.isDestroyed)){if(x.current){x.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:b.current}))}},[y,p,n,r,i,l,s,o]),Yt.createPortal(c.jsx("div",{...d,children:a}),h.current)});je.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,options:o,children:l,...a},d)=>{const f=w.useRef(document.createElement("div"));typeof d=="function"?d(f.current):d&&(d.current=f.current);const{editor:h}=Vo(),u=e||h,p={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,options:o},m=w.useRef(p);m.current=p;const[b,y]=w.useState(!1),g=w.useRef(!0);return w.useEffect(()=>{if(u?.isDestroyed)return;if(!u){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const x=f.current;x.style.visibility="hidden",x.style.position="absolute";const k=Hl({...m.current,editor:u,element:x});u.registerPlugin(k);const v=m.current.pluginKey;return g.current=!0,y(!0),()=>{y(!1),u.unregisterPlugin(v),window.requestAnimationFrame(()=>{x.parentNode&&x.parentNode.removeChild(x)})}},[u]),w.useEffect(()=>{if(!(!b||!u||u.isDestroyed)){if(g.current){g.current=!1;return}u.view.dispatch(u.state.tr.setMeta(t,{type:"updateOptions",options:m.current}))}},[b,u,n,r,i,o,s]),Yt.createPortal(c.jsx("div",{...a,children:l}),f.current)});const zf=new Set(["http:","https:","mailto:","tel:","ftp:"]);function Wl(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return zf.has(e.protocol)}catch{return!1}}function Vl(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 Lf="noopener noreferrer nofollow";function ct(t){const e=P.c(8),{active:n,label:r,onClick:s,children:i}=t,o=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==o?(l=J("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",o),e[0]=o,e[1]=l):l=e[1];let a;return e[2]!==n||e[3]!==i||e[4]!==r||e[5]!==s||e[6]!==l?(a=c.jsx("button",{type:"button","aria-label":r,"aria-pressed":n,onMouseDown:Pf,onClick:s,className:l,children:i}),e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=l,e[7]=a):a=e[7],a}function Pf(t){return t.preventDefault()}function eo(t){const e=P.c(7),{active:n,label:r,onSelect:s}=t,i=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let o;e[0]!==i?(o=J("flex-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer",i),e[0]=i,e[1]=o):o=e[1];let l;return e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==o?(l=c.jsx("button",{type:"button","aria-pressed":n,onMouseDown:Ff,onClick:s,className:o,children:r}),e[2]=n,e[3]=r,e[4]=s,e[5]=o,e[6]=l):l=e[6],l}function Ff(t){return t.preventDefault()}function s1(t){const e=P.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=ie(),[l,a]=w.useState(""),[d,f]=w.useState(!0),[h,u]=w.useState(!1);let p;e[0]!==r||e[1]!==n||e[2]!==i?(p=()=>{const T=n.getAttributes("link");a(typeof T.href=="string"?T.href:""),f(r?T.target==="_blank":!0),u(!1),i(!0)},e[0]=r,e[1]=n,e[2]=i,e[3]=p):p=e[3];const m=p;let b;e[4]!==n||e[5]!==i?(b=()=>{i(!1),n.chain().focus().run()},e[4]=n,e[5]=i,e[6]=b):b=e[6];const y=b;let g;e[7]!==l||e[8]!==n||e[9]!==d||e[10]!==i?(g=()=>{const T=Vl(l);if(T===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!Wl(T)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:T,target:d?"_blank":null,rel:d?Lf:null}).run(),i(!1)},e[7]=l,e[8]=n,e[9]=d,e[10]=i,e[11]=g):g=e[11];const x=g;let k;e[12]!==n||e[13]!==i?(k=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[12]=n,e[13]=i,e[14]=k):k=e[14];const v=k;let C;e[15]!==o?(C=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=C):C=e[16];const j=s?y:m;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(tl,{size:14}),e[17]=S):S=e[17];let D;e[18]!==r||e[19]!==C||e[20]!==j?(D=c.jsx(ct,{active:r,label:C,onClick:j,children:S}),e[18]=r,e[19]=C,e[20]=j,e[21]=D):D=e[21];let N;e[22]!==r||e[23]!==x||e[24]!==y||e[25]!==l||e[26]!==h||e[27]!==d||e[28]!==i||e[29]!==s||e[30]!==v||e[31]!==o?(N=s&&c.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:T=>{T.currentTarget.contains(T.relatedTarget)||i(!1)},children:[c.jsxs("div",{className:"flex items-center gap-0.5",children:[c.jsx("input",{autoFocus:!0,type:"text","aria-label":o("sectionsEditor.richTextLinkControl.urlInputAriaLabel"),"aria-invalid":h,placeholder:o("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:l,onChange:T=>{a(T.target.value),u(!1)},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),x()):T.key==="Escape"&&(T.preventDefault(),y())},className:J("h-7 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",h&&"text-destructive")}),c.jsx(ct,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:x,children:c.jsx(Cs,{size:14})}),r&&c.jsx(ct,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:v,children:c.jsx(sl,{size:14})})]}),c.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[c.jsx(eo,{active:!d,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>f(!1)}),c.jsx(eo,{active:d,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>f(!0)})]})]}),e[22]=r,e[23]=x,e[24]=y,e[25]=l,e[26]=h,e[27]=d,e[28]=i,e[29]=s,e[30]=v,e[31]=o,e[32]=N):N=e[32];let R;return e[33]!==D||e[34]!==N?(R=c.jsxs("div",{className:"relative",children:[D,N]}),e[33]=D,e[34]=N,e[35]=R):R=e[35],R}function Uf(t){const e=P.c(30),{editor:n}=t,r=ie(),[s,i]=w.useState(!1),[o,l]=w.useState(""),[a,d]=w.useState(!1);let f;e[0]!==n?(f=n.isActive("link"),e[0]=n,e[1]=f):f=e[1];const h=f;let u;e[2]!==n||e[3]!==s?(u=()=>{if(s){i(!1);return}const S=n.getAttributes("link").href;l(typeof S=="string"?S:""),d(!1),i(!0)},e[2]=n,e[3]=s,e[4]=u):u=e[4];const p=u;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 b=m;let y;e[7]!==o||e[8]!==n||e[9]!==b?(y=()=>{const S=Vl(o);if(S===""){b();return}if(!Wl(S)){d(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:S}).run(),i(!1)},e[7]=o,e[8]=n,e[9]=b,e[10]=y):y=e[10];const g=y;let x;e[11]!==r?(x=r("markdownEditor.link"),e[11]=r,e[12]=x):x=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(tl,{size:14}),e[13]=k):k=e[13];let v;e[14]!==h||e[15]!==x||e[16]!==p?(v=c.jsx(ct,{active:h,label:x,onClick:p,children:k}),e[14]=h,e[15]=x,e[16]=p,e[17]=v):v=e[17];let C;e[18]!==h||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==a||e[23]!==s||e[24]!==b||e[25]!==r?(C=s&&c.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:[c.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":a,placeholder:r("markdownEditor.linkPlaceholder"),value:o,onChange:S=>{l(S.target.value),d(!1)},onKeyDown:S=>{S.key==="Enter"?(S.preventDefault(),g()):S.key==="Escape"&&(S.preventDefault(),i(!1),n.chain().focus().run())},className:J("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",a&&"text-destructive")}),c.jsx(ct,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:c.jsx(Cs,{size:14})}),h&&c.jsx(ct,{active:!1,label:r("markdownEditor.linkRemove"),onClick:b,children:c.jsx(sl,{size:14})})]}),e[18]=h,e[19]=g,e[20]=o,e[21]=n,e[22]=a,e[23]=s,e[24]=b,e[25]=r,e[26]=C):C=e[26];let j;return e[27]!==v||e[28]!==C?(j=c.jsxs("div",{className:"relative",children:[v,C]}),e[27]=v,e[28]=C,e[29]=j):j=e[29],j}const Rr=()=>{const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},to=t=>{const e=P.c(2),{children:n}=t;let r;return e[0]!==n?(r=c.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},Gl=[1,2,3],qf=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Kf(t){const e=P.c(20),{editor:n}=t,r=ie(),[s,i]=w.useState(null);let o;e[0]!==n?(o={editor:n,selector:Hf},e[0]=n,e[1]=o):o=e[1];const l=mc(o);let a;e[2]!==r?(a=r("markdownEditor.heading1"),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==r?(d=r("markdownEditor.heading2"),e[4]=r,e[5]=d):d=e[5];let f;e[6]!==r?(f=r("markdownEditor.heading3"),e[6]=r,e[7]=f):f=e[7];let h;e[8]!==a||e[9]!==d||e[10]!==f?(h={1:a,2:d,3:f},e[8]=a,e[9]=d,e[10]=f,e[11]=h):h=e[11];const u=h;let p;e[12]!==n||e[13]!==u||e[14]!==s||e[15]!==l||e[16]!==r?(p=s&&c.jsxs(Mf,{editor:n,shouldShow:qf,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:[c.jsx(ct,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:c.jsx(Ta,{size:14})}),c.jsx(ct,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:c.jsx(Da,{size:14})}),c.jsx(ct,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:c.jsx(Na,{size:14})}),c.jsx(ct,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:c.jsx(Ra,{size:14})}),c.jsx(Rr,{}),Gl.map((b,y)=>c.jsx(ct,{active:l.headings[y]??!1,label:u[b],onClick:()=>n.chain().focus().toggleHeading({level:b}).run(),children:c.jsx(to,{children:`H${b}`})},b)),c.jsx(Rr,{}),c.jsx(ct,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:c.jsx(Oo,{size:14})}),c.jsx(ct,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:c.jsx(to,{children:"1."})}),c.jsx(ct,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:c.jsx(Ea,{size:14})}),c.jsx(Rr,{}),c.jsx(Uf,{editor:n})]}),e[12]=n,e[13]=u,e[14]=s,e[15]=l,e[16]=r,e[17]=p):p=e[17];let m;return e[18]!==p?(m=c.jsx("div",{ref:i,className:"relative z-20",children:p}),e[18]=p,e[19]=m):m=e[19],m}function Hf(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Gl.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function yi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var un=yi();function Ql(t){un=t}var tn={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(ot.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,e)};return r}var Wf=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ot={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)}}>`)},Vf=/^(?:[ \t]*(?:\n|$))+/,Gf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Es=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ki=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Xl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Yl=ae(Xl).replace(/bull/g,ki).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(),Yf=ae(Xl).replace(/bull/g,ki).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(),vi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zf=/^[^\n]+/,wi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Jf=ae(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),eh=ae(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ki).getRegex(),mr="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",Si=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,th=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",Si).replace("tag",mr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Zl=ae(vi).replace("hr",Es).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",mr).getRegex(),nh=ae(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Zl).getRegex(),Ci={blockquote:nh,code:Gf,def:Jf,fences:Qf,heading:Xf,hr:Es,html:th,lheading:Yl,list:eh,newline:Vf,paragraph:Zl,table:tn,text:Zf},no=ae("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Es).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",mr).getRegex(),sh={...Ci,lheading:Yf,table:no,paragraph:ae(vi).replace("hr",Es).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",no).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",mr).getRegex()},rh={...Ci,html:ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Si).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:tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ae(vi).replace("hr",Es).replace("heading",` *#{1,6} *[^
7
- ]`).replace("lheading",Yl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ih=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Jl=/^( {2,}|\\)\n(?!\s*$)/,lh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,es=/[\p{P}\p{S}]/u,xr=/[\s\p{P}\p{S}]/u,ji=/[^\s\p{P}\p{S}]/u,ah=ae(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xr).getRegex(),ea=/(?!~)[\p{P}\p{S}]/u,ch=/(?!~)[\s\p{P}\p{S}]/u,dh=/(?:[^\s\p{P}\p{S}]|~)/u,uh=ae(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Wf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ta=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fh=ae(ta,"u").replace(/punct/g,es).getRegex(),hh=ae(ta,"u").replace(/punct/g,ea).getRegex(),na="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ph=ae(na,"gu").replace(/notPunctSpace/g,ji).replace(/punctSpace/g,xr).replace(/punct/g,es).getRegex(),gh=ae(na,"gu").replace(/notPunctSpace/g,dh).replace(/punctSpace/g,ch).replace(/punct/g,ea).getRegex(),mh=ae("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ji).replace(/punctSpace/g,xr).replace(/punct/g,es).getRegex(),xh=ae(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,es).getRegex(),bh="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",yh=ae(bh,"gu").replace(/notPunctSpace/g,ji).replace(/punctSpace/g,xr).replace(/punct/g,es).getRegex(),kh=ae(/\\(punct)/,"gu").replace(/punct/g,es).getRegex(),vh=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(),wh=ae(Si).replace("(?:-->|$)","-->").getRegex(),Sh=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",wh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),nr=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ch=ae(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",nr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sa=ae(/^!?\[(label)\]\[(ref)\]/).replace("label",nr).replace("ref",wi).getRegex(),ra=ae(/^!?\[(ref)\](?:\[\])?/).replace("ref",wi).getRegex(),jh=ae("reflink|nolink(?!\\()","g").replace("reflink",sa).replace("nolink",ra).getRegex(),so=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ti={_backpedal:tn,anyPunctuation:kh,autolink:vh,blockSkip:uh,br:Jl,code:oh,del:tn,delLDelim:tn,delRDelim:tn,emStrongLDelim:fh,emStrongRDelimAst:ph,emStrongRDelimUnd:mh,escape:ih,link:Ch,nolink:ra,punctuation:ah,reflink:sa,reflinkSearch:jh,tag:Sh,text:lh,url:tn},Th={...Ti,link:ae(/^!?\[(label)\]\((.*?)\)/).replace("label",nr).getRegex(),reflink:ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",nr).getRegex()},Ur={...Ti,emStrongRDelimAst:gh,emStrongLDelim:hh,delLDelim:xh,delRDelim:yh,url:ae(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",so).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",so).getRegex()},Dh={...Ur,br:ae(Jl).replace("{2,}","*").getRegex(),text:ae(Ur.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Us={normal:Ci,gfm:sh,pedantic:rh},is={normal:Ti,gfm:Ur,breaks:Dh,pedantic:Th},Nh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ro=t=>Nh[t];function Ut(t,e){if(e){if(ot.escapeTest.test(t))return t.replace(ot.escapeReplace,ro)}else if(ot.escapeTestNoEncode.test(t))return t.replace(ot.escapeReplaceNoEncode,ro);return t}function io(t){try{t=encodeURI(t).replace(ot.percentDecode,"%")}catch{return null}return t}function oo(t,e){let n=t.replace(ot.findPipe,(i,o,l)=>{let a=!1,d=o;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),r=n.split(ot.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(ot.slashPipe,"|");return r}function os(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 Rh(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 Eh(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 lo(t,e,n,r,s){let i=e.href,o=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function Ih(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
8
- `).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[l]=o;return l.length>=s.length?i.slice(s.length):i}).join(`
9
- `)}var sr=class{options;rules;lexer;constructor(t){this.options=t||un}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:os(n,`
10
- `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Ih(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=os(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:os(e[0],`
11
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=os(e[0],`
12
- `).split(`
13
- `),r="",s="",i=[];for(;n.length>0;){let o=!1,l=[],a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),o=!0;else if(!o)l.push(n[a]);else break;n=n.slice(a);let d=l.join(`
14
- `),f=d.replace(this.rules.other.blockquoteSetextReplace,`
15
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
16
- ${d}`:d,s=s?`${s}
17
- ${f}`:f;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,i,!0),this.lexer.state.top=h,n.length===0)break;let u=i.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let p=u,m=p.raw+`
18
- `+n.join(`
19
- `),b=this.blockquote(m);i[i.length-1]=b,r=r.substring(0,r.length-p.raw.length)+b.raw,s=s.substring(0,s.length-p.text.length)+b.text;break}else if(u?.type==="list"){let p=u,m=p.raw+`
20
- `+n.join(`
21
- `),b=this.list(m);i[i.length-1]=b,r=r.substring(0,r.length-u.raw.length)+b.raw,s=s.substring(0,s.length-p.raw.length)+b.raw,n=m.substring(i.at(-1).raw.length).split(`
22
- `);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),o=!1;for(;t;){let a=!1,d="",f="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let h=Eh(e[2].split(`
23
- `,1)[0],e[1].length),u=t.split(`
24
- `,1)[0],p=!h.trim(),m=0;if(this.options.pedantic?(m=2,f=h.trimStart()):p?m=e[1].length+1:(m=h.search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=h.slice(m),m+=e[1].length),p&&this.rules.other.blankLine.test(u)&&(d+=u+`
25
- `,t=t.substring(u.length+1),a=!0),!a){let b=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),g=this.rules.other.fencesBeginRegex(m),x=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),v=this.rules.other.blockquoteBeginRegex(m);for(;t;){let C=t.split(`
26
- `,1)[0],j;if(u=C,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),j=u):j=u.replace(this.rules.other.tabCharGlobal," "),g.test(u)||x.test(u)||k.test(u)||v.test(u)||b.test(u)||y.test(u))break;if(j.search(this.rules.other.nonSpaceChar)>=m||!u.trim())f+=`
27
- `+j.slice(m);else{if(p||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(h)||x.test(h)||y.test(h))break;f+=`
28
- `+u}p=!u.trim(),d+=C+`
29
- `,t=t.substring(C.length+1),h=j.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),s.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),s.raw+=d}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let a of s.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(a.raw);if(d){let f={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};a.checked=f.checked,s.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=f.raw+a.tokens[0].raw,a.tokens[0].text=f.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(f)):a.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):a.tokens.unshift(f)}}if(!s.loose){let d=a.tokens.filter(h=>h.type==="space"),f=d.length>0&&d.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=f}}if(s.loose)for(let a of s.items){a.loose=!0;for(let d of a.tokens)d.type==="text"&&(d.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=oo(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of s)i.rows.push(oo(o,i.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[a]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
31
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=os(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Rh(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)),lo(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 lo(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+s);(r=d.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let f=[...r[0]][0].length,h=t.slice(0,s+r.index+f+o);if(Math.min(s,o)%2){let p=h.slice(1,-1);return{type:"em",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}let u=h.slice(2,-2);return{type:"strong",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*t.length+s);(r=a.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let d=[...r[0]][0].length,f=t.slice(0,s+r.index+d+o),h=f.slice(s,-s);return{type:"del",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}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}}}},$t=class qr{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||un,this.options.tokenizer=this.options.tokenizer||new sr,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:ot,block:Us.normal,inline:is.normal};this.options.pedantic?(n.block=Us.pedantic,n.inline=is.pedantic):this.options.gfm&&(n.block=Us.gfm,this.options.breaks?n.inline=is.breaks:n.inline=is.gfm),this.tokenizer.rules=n}static get rules(){return{block:Us,inline:is}}static lex(e,n){return new qr(n).lex(e)}static lexInline(e,n){return new qr(n).inlineTokens(e)}lex(e){e=e.replace(ot.carriageReturn,`
32
- `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ot.tabCharGlobal," ").replace(ot.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=n.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
33
- `:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
34
- `)?"":`
35
- `)+s.raw,o.text+=`
36
- `+s.text,this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
37
- `)?"":`
38
- `)+s.raw,o.text+=`
39
- `+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),a;this.options.extensions.startBlock.forEach(d=>{a=d.call({lexer:this},l),typeof a=="number"&&a>=0&&(o=Math.min(o,a))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
40
- `)?"":`
41
- `)+s.raw,o.text+=`
42
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
43
- `)?"":`
44
- `)+s.raw,o.text+=`
45
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,l="";for(;e;){o||(l=""),o=!1;let a;if(this.options.extensions?.inline?.some(f=>(a=f.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let f=n.at(-1);a.type==="text"&&f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let d=e;if(this.options.extensions?.startInline){let f=1/0,h=e.slice(1),u;this.options.extensions.startInline.forEach(p=>{u=p.call({lexer:this},h),typeof u=="number"&&u>=0&&(f=Math.min(f,u))}),f<1/0&&f>=0&&(d=e.substring(0,f+1))}if(a=this.tokenizer.inlineText(d)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),o=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):n.push(a);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},rr=class{options;parser;constructor(t){this.options=t||un}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(ot.notSpaceStart)?.[0],s=t.replace(ot.endingNewline,"")+`
46
- `;return r?'<pre><code class="language-'+Ut(r)+'">'+(n?s:Ut(s,!0))+`</code></pre>
47
- `:"<pre><code>"+(n?s:Ut(s,!0))+`</code></pre>
48
- `}blockquote({tokens:t}){return`<blockquote>
49
- ${this.parser.parse(t)}</blockquote>
50
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
51
- `}hr(t){return`<hr>
52
- `}list(t){let e=t.ordered,n=t.start,r="";for(let o=0;o<t.items.length;o++){let l=t.items[o];r+=this.listitem(l)}let s=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
53
- `+r+"</"+s+`>
54
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
55
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
56
- `}table(t){let e="",n="";for(let s=0;s<t.header.length;s++)n+=this.tablecell(t.header[s]);e+=this.tablerow({text:n});let r="";for(let s=0;s<t.rows.length;s++){let i=t.rows[s];n="";for(let o=0;o<i.length;o++)n+=this.tablecell(i[o]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
57
- <thead>
58
- `+e+`</thead>
59
- `+r+`</table>
60
- `}tablerow({text:t}){return`<tr>
61
- ${t}</tr>
62
- `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
63
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ut(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),s=io(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+Ut(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=io(t);if(s===null)return Ut(n);t=s;let i=`<img src="${t}" alt="${Ut(n)}"`;return e&&(i+=` title="${Ut(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ut(t.text)}},Di=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Mt=class Kr{options;renderer;textRenderer;constructor(e){this.options=e||un,this.options.renderer=this.options.renderer||new rr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Di}static parse(e,n){return new Kr(n).parse(e)}static parseInline(e,n){return new Kr(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let o=s,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}let o=i;switch(o.type){case"escape":{r+=n.text(o);break}case"html":{r+=n.html(o);break}case"link":{r+=n.link(o);break}case"image":{r+=n.image(o);break}case"checkbox":{r+=n.checkbox(o);break}case"strong":{r+=n.strong(o);break}case"em":{r+=n.em(o);break}case"codespan":{r+=n.codespan(o);break}case"br":{r+=n.br(o);break}case"del":{r+=n.del(o);break}case"text":{r+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},cs=class{options;block;constructor(t){this.options=t||un}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?$t.lex:$t.lexInline}provideParser(t=this.block){return t?Mt.parse:Mt.parseInline}},_h=class{defaults=yi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Mt;Renderer=rr;TextRenderer=Di;Lexer=$t;Tokenizer=sr;Hooks=cs;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of s.rows)for(let o of i)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let o=s[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){let s=this.defaults.renderer||new rr(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=n.renderer[o],a=s[o];s[o]=(...d)=>{let f=l.apply(s,d);return f===!1&&(f=a.apply(s,d)),f||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new sr(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=n.tokenizer[o],a=s[o];s[o]=(...d)=>{let f=l.apply(s,d);return f===!1&&(f=a.apply(s,d)),f}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new cs;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=n.hooks[o],a=s[o];cs.passThroughHooks.has(i)?s[o]=d=>{if(this.defaults.async&&cs.passThroughHooksRespectAsync.has(i))return(async()=>{let h=await l.call(s,d);return a.call(s,h)})();let f=l.call(s,d);return a.call(s,f)}:s[o]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(s,d);return h===!1&&(h=await a.apply(s,d)),h})();let f=l.apply(s,d);return f===!1&&(f=a.apply(s,d)),f}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return $t.lex(t,e??this.defaults)}parser(t,e){return Mt.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(t):t?$t.lex:$t.lexInline)(o,s),a=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(a,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser(t):t?Mt.parse:Mt.parseInline)(a,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer(t):t?$t.lex:$t.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(t):t?Mt.parse:Mt.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=`
64
- Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Ut(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},ln=new _h;function pe(t,e){return ln.parse(t,e)}pe.options=pe.setOptions=function(t){return ln.setOptions(t),pe.defaults=ln.defaults,Ql(pe.defaults),pe};pe.getDefaults=yi;pe.defaults=un;pe.use=function(...t){return ln.use(...t),pe.defaults=ln.defaults,Ql(pe.defaults),pe};pe.walkTokens=function(t,e){return ln.walkTokens(t,e)};pe.parseInline=ln.parseInline;pe.Parser=Mt;pe.parser=Mt.parse;pe.Renderer=rr;pe.TextRenderer=Di;pe.Lexer=$t;pe.lexer=$t.lex;pe.Tokenizer=sr;pe.Hooks=cs;pe.parse=pe;pe.options;pe.setOptions;pe.use;pe.walkTokens;pe.parseInline;Mt.parse;$t.lex;function Ah(t,e){const r=e.split(`
65
- `).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
66
- `);return r.slice(0,r.length-1)}function Bh(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 Oh(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{t.has(r)||n.push({type:r,mark:s})}),n}function $h(t,e,n,r){const s=!n,i=n&&n.type==="text"&&(!n.marks||n.marks.length===0),o=n&&n.type==="text"&&n.marks&&!r(e,new Map(n.marks.map(a=>[a.type,a]))),l=[];if(s||i||o)if(n&&n.type==="text"&&n.marks){const a=new Map(n.marks.map(d=>[d.type,d]));Array.from(t.keys()).forEach(d=>{a.has(d)||l.push(d)})}else(s||i)&&l.push(...Array.from(t.keys()));return l}function Mh(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 zh(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 Er(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 qs(t,e){return typeof t!="string"?"json":e}var Lh=class{constructor(t){this.baseExtensions=[],this.extensions=[],this.lastParseResult=null;var e,n,r,s,i;this.markedInstance=(e=t?.marked)!=null?e:pe,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,xc(t.extensions).forEach(l=>this.registerExtension(l,!1))),this.lexer=new this.markedInstance.Lexer}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t,e=!0){var n,r;this.extensions.push(t);const s=t.name,i=rs(t,"markdownTokenName")||s,o=rs(t,"parseMarkdown"),l=rs(t,"renderMarkdown"),a=rs(t,"markdownTokenizer"),d=(n=rs(t,"markdownOptions"))!=null?n:null,f=(r=d?.indentsContent)!=null?r:!1,h={tokenName:i,nodeName:s,parseMarkdown:o,renderMarkdown:l,isIndenting:f,tokenizer:a};if(i&&o){const u=this.registry.get(i)||[];u.push(h),this.registry.set(i,u)}if(l){const u=this.nodeTypeRegistry.get(s)||[];u.push(h),this.nodeTypeRegistry.set(s,u)}a&&this.hasMarked()&&(this.registerTokenizer(a),e&&(this.lexer=new this.markedInstance.Lexer))}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:r="inline",tokenize:s}=t,l={inlineTokens:f=>this.lexer.inlineTokens(f),blockTokens:f=>this.lexer.blockTokens(f)};let a;n?a=typeof n=="function"?n:f=>f.indexOf(n):a=f=>{const h=s(f,[],l);return h&&h.raw?f.indexOf(h.raw):-1};const d={name:e,level:r,start:a,tokenizer:(f,h)=>{const u=s(f,h,l);if(u&&u.type)return{...u,type:u.type||e,raw:u.raw||"",tokens:u.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[d]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/&nbsp;/g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.markedInstance.lexer(t);return{type:"doc",content:this.parseTokens(e,!0)}}parseTokens(t,e=!1){const n=t.reduce((i,o,l)=>(o.type!=="space"&&i.push(l),i),[]);let r=-1,s=0;return t.flatMap((i,o)=>{for(var l;s<n.length&&n[s]<o;)r=n[s],s+=1;if(e&&i.type==="space"){const d=(l=n[s])!=null?l:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,d)}const a=this.parseToken(i,e);return a===null?[]:Array.isArray(a)?a:[a]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const r=this.countParagraphSeparators(t.raw||"");if(r===0)return[];const i=Math.max(r-(e===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
67
- `).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(n.find(i=>{if(!i.parseMarkdown)return!1;const o=i.parseMarkdown(t,r),l=this.normalizeParseResult(o);return l&&(!Array.isArray(l)||l.length>0)?(this.lastParseResult=l,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>Er(l).isTask),n=t.items.some(l=>!Er(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let l=0;l<t.items.length;l+=1){const a=t.items[l],{isTask:d,checked:f,indentLevel:h}=Er(a);let u=a;if(d){const b=(a.raw||a.text||"").split(`
68
- `),y=b[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),g=y?y[2]:"";let x=[];if(b.length>1&&b.slice(1).join(`
69
- `).trim()){const v=b.slice(1),C=v.filter(j=>j.trim());if(C.length>0){const j=Math.min(...C.map(N=>N.length-N.trimStart().length)),D=v.map(N=>N.trim()?N.slice(j):"").join(`
70
- `).trim();D&&(x=this.markedInstance.lexer(`${D}
71
- `))}}u={type:"taskItem",raw:"",mainContent:g,indentLevel:h,checked:f??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:x}}const p=d?"taskList":"list";i!==p?(s.length>0&&r.push({type:i,items:s}),s=[u],i=p):s.push(u)}s.length>0&&r.push({type:i,items:s});const o=[];for(let l=0;l<r.length;l+=1){const a=r[l],d={...t,type:a.type,items:a.items},f=this.parseToken(d);f&&(Array.isArray(f)?o.push(...f):o.push(f))}return o.length>0?o:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(t,n),o=this.normalizeParseResult(i);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){var e,n,r,s;const i=[];for(let o=0;o<t.length;o+=1){const l=t[o];if(l.type==="text")i.push({type:"text",text:l.text||""});else if(l.type==="html"){const a=((n=(e=l.raw)!=null?e:l.text)!=null?n:"").toString(),d=/^<\/[\s]*[\w-]+/i.test(a),f=a.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!d&&f&&!/\/>$/.test(a)){const u=f[1],p=this.escapeRegex(u),m=new RegExp(`^<\\/\\s*${p}\\b`,"i");let b=-1;const y=[a];for(let g=o+1;g<t.length;g+=1){const x=t[g],k=((s=(r=x.raw)!=null?r:x.text)!=null?s:"").toString();if(y.push(k),x.type==="html"&&m.test(k)){b=g;break}}if(b!==-1){const g=y.join(""),x={type:"html",raw:g,text:g,block:!1},k=this.parseHTMLToken(x);if(k){const v=this.normalizeParseResult(k);Array.isArray(v)?i.push(...v):v&&i.push(v)}o=b;continue}}const h=this.parseHTMLToken(l);if(h){const u=this.normalizeParseResult(h);Array.isArray(u)?i.push(...u):u&&i.push(u)}}else if(l.type){const a=this.getHandlerForToken(l.type);if(a&&a.parseMarkdown){const d=this.createParseHelpers(),f=a.parseMarkdown(l,d);if(this.isMarkResult(f)){const h=this.applyMarkToContent(f.mark,f.content,f.attrs);i.push(...h)}else{const h=this.normalizeParseResult(f);Array.isArray(h)?i.push(...h):h&&i.push(h)}}else l.tokens&&i.push(...this.parseInlineTokens(l.tokens))}}return i}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:t.text||""};case"html":return this.parseHTMLToken(t);case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(typeof window>"u")return t.block?{type:"paragraph",content:[{type:"text",text:e}]}:{type:"text",text:e};try{const n=bc(e,this.baseExtensions);return n.type==="doc"&&n.content?t.block?n.content:n.content.length===1&&n.content[0].type==="paragraph"&&n.content[0].content?n.content[0].content:n.content:n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return t.text||"";if(!t.type)return"";const o=this.getHandlerForToken(t.type);if(!o)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,a={renderChildren:(h,u)=>{const p=o.isIndenting?r+1:r;return!Array.isArray(h)&&h.content?this.renderNodes(h.content,t,u||"",n,p):this.renderNodes(h,t,u||"",n,p)},renderChild:(h,u)=>{const p=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(h,t,u,p)},indent:h=>this.indentString+h,wrapInBlock:Ah},d={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=o.renderMarkdown)==null?void 0:i.call(o,t,a,d))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map;return t.forEach((o,l)=>{const a=l<t.length-1?t[l+1]:null;if(o.type)if(o.type==="text"){let d=o.text||"";const f=new Map((o.marks||[]).map(g=>[g.type,g])),h=Oh(i,f),u=Bh(f,a);let p="";if(u.length>0){const g=d.match(/(\s+)$/);g&&(p=g[1],d=d.slice(0,-p.length))}u.forEach(g=>{const x=f.get(g),k=this.getMarkClosing(g,x);k&&(d+=k),i.has(g)&&i.delete(g)});let m="";if(h.length>0){const g=d.match(/^(\s+)/);g&&(m=g[1],d=d.slice(m.length))}h.forEach(({type:g,mark:x})=>{const k=this.getMarkOpening(g,x);k&&(d=k+d),u.includes(g)||i.set(g,x)}),d=m+d;const b=$h(i,f,a,this.markSetsEqual.bind(this));let y="";if(b.length>0){const g=d.match(/(\s+)$/);g&&(y=g[1],d=d.slice(0,-y.length))}b.forEach(g=>{const x=i.get(g),k=this.getMarkClosing(g,x);k&&(d+=k),i.delete(g)}),d+=y,d+=p,s.push(d)}else{const d=new Map(i),f=Mh(i,this.getMarkClosing.bind(this)),h=this.renderNodeToMarkdown(o,e,l,r),u=o.type==="hardBreak"?"":zh(d,i,this.getMarkOpening.bind(this));s.push(f+h+u)}}),s.join(n)}getMarkOpening(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:a=>a,wrapInBlock:(a,d)=>a+d},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s);return l>=0?o.substring(0,l):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s),a=l+s.length;return l>=0?o.substring(a):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.keys()).every(n=>e.has(n))}},ao=Lh,Ph=ei.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return Ht.setContent(t,e);if(qs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Ht.setContent(t,e);const r=this.editor.markdown.parse(t);return Ht.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return Ht.insertContent(t,e);if(qs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Ht.insertContent(t,e);const r=this.editor.markdown.parse(t);return Ht.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return Ht.insertContentAt(t,e,n);if(qs(e,n?.contentType)!=="markdown"||!this.editor.markdown)return Ht.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return Ht.insertContentAt(t,s,n)}}},addStorage(){return{manager:new ao({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 ao({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||qs(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 Fh(t){const e=P.c(25),{node:n,selected:r,editor:s,deleteNode:i}=t,o=ie(),l=typeof n.attrs.href=="string"?n.attrs.href:"",a=typeof n.attrs.name=="string"?n.attrs.name:"";let d;e[0]!==a||e[1]!==o?(d=a||o("markdownEditor.fileNameFallback"),e[0]=a,e[1]=o,e[2]=d):d=e[2];const f=d,h=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let u;e[3]!==h?(u=J("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",h),e[3]=h,e[4]=u):u=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Ia,{size:14,className:"shrink-0 text-muted-foreground"}),e[5]=p):p=e[5];let m;e[6]!==f?(m=c.jsx("span",{className:"min-w-0 truncate",children:f}),e[6]=f,e[7]=m):m=e[7];let b;e[8]!==f||e[9]!==o?(b=o("markdownEditor.downloadFile",{name:f}),e[8]=f,e[9]=o,e[10]=b):b=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx(Rc,{size:14}),e[11]=y):y=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==b?(g=c.jsx("a",{href:l,download:f,"aria-label":b,onMouseDown:qh,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:y}),e[12]=l,e[13]=f,e[14]=b,e[15]=g):g=e[15];let x;e[16]!==i||e[17]!==s.isEditable||e[18]!==o?(x=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeFile"),onMouseDown:Uh,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c.jsx(nn,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=x):x=e[19];let k;return e[20]!==u||e[21]!==m||e[22]!==g||e[23]!==x?(k=c.jsxs(Yo,{as:"span",className:u,children:[p,m,g,x]}),e[20]=u,e[21]=m,e[22]=g,e[23]=x,e[24]=k):k=e[24],k}function Uh(t){return t.preventDefault()}function qh(t){return t.preventDefault()}function Kh(t){return t.replace(/([[\]])/g,"\\$1")}const Hh=Go.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",Xo(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`[${Kh(n)}](${e})`},addNodeView(){return Qo(Fh)}});var Wh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Vh=Go.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",Xo(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",d=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return d?`![${a}](${l} "${d}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([h,u])=>{if(u!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,u);break}}),a.src=o.src;const d=new kc({element:a,editor:l,node:s,getPos:i,onResize:(h,u)=>{a.style.width=`${h}px`,a.style.height=`${u}px`},onCommit:(h,u)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:h,height:u}).run()},onUpdate:(h,u,p)=>h.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),f=d.dom;return f.style.visibility="hidden",f.style.pointerEvents="none",a.onload=()=>{f.style.visibility="",f.style.pointerEvents=""},d}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[yc({find:Wh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Gh=Vh;function Qh(t){const e=P.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,o=ie(),l=typeof n.attrs.src=="string"?n.attrs.src:"",a=typeof n.attrs.alt=="string"?n.attrs.alt:"";let d;e[0]!==a||e[1]!==o?(d=a||o("markdownEditor.imageAltFallback"),e[0]=a,e[1]=o,e[2]=d):d=e[2];const f=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==f?(h=J("max-h-[420px] max-w-full rounded-lg border border-border object-contain",f),e[3]=f,e[4]=h):h=e[4];let u;e[5]!==l||e[6]!==d||e[7]!==h?(u=c.jsx("img",{src:l,alt:d,draggable:!1,className:h}),e[5]=l,e[6]=d,e[7]=h,e[8]=u):u=e[8];let p;e[9]!==i||e[10]!==s.isEditable||e[11]!==o?(p=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeImage"),onMouseDown:Xh,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:c.jsx(nn,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=o,e[12]=p):p=e[12];let m;return e[13]!==u||e[14]!==p?(m=c.jsxs(Yo,{className:"group/image relative my-3 w-fit max-w-full",children:[u,p]}),e[13]=u,e[14]=p,e[15]=m):m=e[15],m}function Xh(t){return t.preventDefault()}const Yh=Gh.extend({addNodeView(){return Qo(Qh)}}).configure({inline:!1,allowBase64:!1}),Hr="uploads",Zh="editor-images",ia="editor-files",Jh=new RegExp(`^/api/[^/]+/fs/${Hr}/read$`),co="http://relative.invalid";function ep(t){let e;try{e=new URL(t,co)}catch{return!1}return e.origin!==co||!Jh.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${ia}/`)}const tp={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},np=vc.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return ep(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function sp(t=""){return[wc.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),np.configure(tp),Xc.configure({placeholder:t}),Yh,Hh,Ph.configure({markedOptions:{breaks:!0}})]}const rp=10,ip=25,op={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function lp(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??op[t.type]??(Ni(t)?".png":"")}function Ni(t){return t.type.startsWith("image/")}function ap(){const t=ie(),{upload:e}=md(Hr),n=gd(Hr),[r,s]=w.useState(0);return{uploadFile:async o=>{const l=Ni(o),a=l?rp:ip;if(o.size>a*1024*1024)return vt.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(a)})),null;const d=l?Zh:ia,f=`${crypto.randomUUID()}${lp(o)}`;s(h=>h+1);try{return await e.mutateAsync({dir:d,files:[new File([o],f,{type:o.type})]}),n(`${d}/${f}`)}catch{return vt.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(h=>h-1)}},pending:r}}const cp=["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(" "),dp=["[&_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 uo(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(qt.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function up({defaultValue:t,onChange:e,placeholder:n,editable:r=!0}){const s=ie(),{uploadFile:i,pending:o}=ap(),l=w.useRef(null),a=w.useRef(e),d=w.useRef(i);a.current=e,d.current=i;const f=(p,m,b)=>m.length===0?!1:((async()=>{let y=b;for(const g of m){const x=await d.current(g);x&&(y=Ni(g)?uo(p,y,"image",{src:x,alt:g.name}):uo(p,y,"attachment",{href:x,name:g.name}))}})(),!0),h=Sc({extensions:sp(n),content:t,contentType:"markdown",editable:r,editorProps:{attributes:{class:J(cp,dp)},handlePaste:(p,m)=>f(p,Array.from(m.clipboardData?.files??[]),p.state.selection.to),handleDrop:(p,m,b,y)=>{if(y)return!1;const g=Array.from(m.dataTransfer?.files??[]),x=p.posAtCoords({left:m.clientX,top:m.clientY})?.pos;return x===void 0?!1:f(p,g,x)}},onUpdate:({editor:p})=>a.current(p.getMarkdown())});if(!h)return null;const u=p=>{!p||p.length===0||f(h.view,Array.from(p),h.state.selection.to)};return c.jsxs("div",{className:"flex flex-col",children:[c.jsx(Kf,{editor:h}),c.jsx(Cc,{editor:h,className:"text-[15px] text-foreground"}),c.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground",children:[r&&c.jsx(Me,{type:"button",variant:"ghost",size:"icon-sm","aria-label":s("markdownEditor.attachFile"),onClick:()=>l.current?.click(),children:c.jsx(_a,{size:14})}),o>0&&c.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[c.jsx(Ss,{size:12,className:"animate-spin"}),o===1?s("markdownEditor.uploading"):s("markdownEditor.uploadingCount",{count:String(o)})]})]}),c.jsx("input",{ref:l,type:"file",multiple:!0,className:"hidden",onChange:p=>{u(p.target.files),p.target.value=""}})]})}const fp=1e4;function hp(t){const e=P.c(10),{locator:n}=Be(),r=cn();let s;e[0]!==t||e[1]!==n?(s=xe.taskBoardItemPrs(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:t})).prs,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,refetchInterval:fp,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],Qe(l)}function oa(t){const e=P.c(10),{locator:n}=Be(),r=cn();let s;e[0]!==t||e[1]!==n?(s=xe.taskBoardActivity(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ACTIVITY_LIST",{taskBoardItemId:t})).activity,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],Qe(l)}function pp(t){const e=P.c(10),{locator:n}=Be(),r=cn(),s=an();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:xe.taskBoardItemPrs(n,t)}),s.invalidateQueries({queryKey:xe.taskBoardActivity(n,t)})},e[3]=t,e[4]=n,e[5]=s,e[6]=o):o=e[6];let l;return e[7]!==i||e[8]!==o?(l={mutationFn:i,onSuccess:o},e[7]=i,e[8]=o,e[9]=l):l=e[9],it(l)}function gp(t){const e=[];return t.qa&&e.push("qa"),t.codeReview&&e.push("code_review"),e}function mp(t,e){return e.length===0?!0:ec(t,e)}function Ri(t){const e=P.c(54),{members:n,onSelect:r}=t,s=ie();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=c.jsx(ti,{placeholder:i,className:"h-9"}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==s?(l=s("taskBoard.taskDialog.noMembersFound"),e[4]=s,e[5]=l):l=e[5];let a;e[6]!==l?(a=c.jsx(ni,{children:l}),e[6]=l,e[7]=a):a=e[7];let d;e[8]!==s?(d=s("taskBoard.taskDialog.superAgentLabel"),e[8]=s,e[9]=d):d=e[9];let f;e[10]!==r?(f=()=>r(qe),e[10]=r,e[11]=f):f=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(zt,{size:16}),e[12]=h):h=e[12];let u;e[13]!==s?(u=s("taskBoard.taskDialog.superAgentLabel"),e[13]=s,e[14]=u):u=e[14];let p;e[15]!==u?(p=c.jsx("span",{className:"truncate",children:u}),e[15]=u,e[16]=p):p=e[16];let m;e[17]!==d||e[18]!==f||e[19]!==p?(m=c.jsxs(Gt,{value:d,onSelect:f,className:"gap-2",children:[h,p]}),e[17]=d,e[18]=f,e[19]=p,e[20]=m):m=e[20];let b;e[21]!==s?(b=s("taskBoard.taskDialog.unassignedLabel"),e[21]=s,e[22]=b):b=e[22];let y;e[23]!==r?(y=()=>r(null),e[23]=r,e[24]=y):y=e[24];let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=c.jsx(Br,{size:16,className:"text-muted-foreground"}),e[25]=g):g=e[25];let x;e[26]!==s?(x=s("taskBoard.taskDialog.unassignedLabel"),e[26]=s,e[27]=x):x=e[27];let k;e[28]!==x?(k=c.jsx("span",{className:"truncate",children:x}),e[28]=x,e[29]=k):k=e[29];let v;e[30]!==b||e[31]!==y||e[32]!==k?(v=c.jsxs(Gt,{value:b,onSelect:y,className:"gap-2",children:[g,k]}),e[30]=b,e[31]=y,e[32]=k,e[33]=v):v=e[33];let C;e[34]!==m||e[35]!==v?(C=c.jsxs(Xn,{children:[m,v]}),e[34]=m,e[35]=v,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 T;e[42]!==r?(T=E=>c.jsxs(Gt,{value:E.user?.name??E.userId,onSelect:()=>r(E.userId),className:"gap-2",children:[c.jsx(It,{url:E.user?.image??void 0,fallback:Et(E.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:E.user?.name??E.userId})]},E.userId),e[42]=r,e[43]=T):T=e[43],S=n.map(T),e[39]=n,e[40]=r,e[41]=S}else S=e[41];let D;e[44]!==j||e[45]!==S?(D=c.jsx(Xn,{heading:j,children:S}),e[44]=j,e[45]=S,e[46]=D):D=e[46];let N;e[47]!==C||e[48]!==D||e[49]!==a?(N=c.jsxs(si,{children:[a,C,D]}),e[47]=C,e[48]=D,e[49]=a,e[50]=N):N=e[50];let R;return e[51]!==o||e[52]!==N?(R=c.jsxs(ri,{children:[o,N]}),e[51]=o,e[52]=N,e[53]=R):R=e[53],R}function xp({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=ie(),[l,a]=w.useState(""),[d,f]=w.useState(!1),[h,u]=w.useState(n),p=l.trim(),m=t.some(y=>y.name.toLowerCase()===p.toLowerCase()),b=async()=>{if(!(!p||m||d)){f(!0);try{await s(p,h),a("")}finally{f(!1)}}};return c.jsxs(ri,{children:[c.jsx(ti,{value:l,onValueChange:a,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),c.jsxs(si,{children:[p&&!m?c.jsx(Xn,{children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"color",value:h,onChange:y=>u(y.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"}),c.jsxs(Gt,{value:`create-${p}`,disabled:d,onSelect:b,className:"flex-1 gap-2",children:[c.jsx(ms,{size:16,className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:p})})]})]})}):c.jsx(ni,{children:o("taskBoard.taskDialog.noTagsFound")}),c.jsx(Xn,{children:t.map(y=>{const g=e.includes(y.id);return c.jsxs(Gt,{value:y.name,onSelect:()=>r(y.id),className:"group gap-2",children:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Rs(y.color)}}),c.jsx("span",{className:"flex-1 truncate",children:y.name}),c.jsx("button",{type:"button","aria-label":o("taskBoard.taskDialog.deleteTagAriaLabel",{name:y.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:x=>{x.stopPropagation(),i(y.id)},children:c.jsx(Qr,{size:13})}),g&&c.jsx(Cs,{size:14,className:"shrink-0 text-foreground"})]},y.id)})})]})]})}function bp(t){if(!t)return[];const e=[],n=new Set,r=(o,l)=>{n.has(o)||(n.add(o),e.push({url:o,label:l.trim()||o}))},s=t.replace(/!\[[^\]]*\]\([^)]*\)/g,"");for(const o of s.matchAll(/\[([^\]]*)\]\((https?:\/\/[^)\s]+)[^)]*\)/g))r(o[2]??"",o[1]??"");const i=s.replace(/\[[^\]]*\]\([^)]*\)/g,"");for(const o of i.matchAll(/https?:\/\/[^\s)]+/g))r(o[0],o[0]);return e}function yp(t){const e=P.c(40),{thread:n,me:r,onReply:s,onDelete:i,onToggleResolved:o}=t,l=ie(),[a,d]=w.useState(!1);if(n.resolved&&!a){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>d(!0),e[0]=x):x=e[0];let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Aa,{size:16,className:"shrink-0 text-muted-foreground"}),e[1]=k):k=e[1];let v;e[2]!==l||e[3]!==n?(v=vp(n,l),e[2]=l,e[3]=n,e[4]=v):v=e[4];let C;e[5]!==v?(C=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:v}),e[5]=v,e[6]=C):C=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(_c,{size:16,className:"shrink-0 text-muted-foreground"}),e[7]=j):j=e[7];let S;return e[8]!==C?(S=c.jsxs("button",{type:"button",onClick:x,className:"flex w-full items-center gap-2.5 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-muted/60",children:[k,C,j]}),e[8]=C,e[9]=S):S=e[9],S}let f;e[10]!==l||e[11]!==n.resolved?(f=n.resolved&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>d(!1),className:"flex items-center justify-between gap-2 rounded-t-xl bg-muted/40 px-4 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:text-foreground",children:[l("taskBoard.taskDialog.commentCollapseThread"),c.jsx(nn,{size:14,"aria-hidden":!0})]}),c.jsx(Ir,{})]}),e[10]=l,e[11]=n.resolved,e[12]=f):f=e[12];let h;e[13]!==r||e[14]!==i||e[15]!==n?(h=fo(n,r)?()=>i(n.id):void 0,e[13]=r,e[14]=i,e[15]=n,e[16]=h):h=e[16];let u;e[17]!==o||e[18]!==h||e[19]!==n?(u=c.jsx(ho,{comment:n,onDelete:h,resolved:n.resolved,onToggleResolved:o}),e[17]=o,e[18]=h,e[19]=n,e[20]=u):u=e[20];let p;if(e[21]!==r||e[22]!==i||e[23]!==n.replies){let x;e[25]!==r||e[26]!==i?(x=(k,v)=>c.jsxs(w.Fragment,{children:[c.jsx(Ir,{inset:v>0}),c.jsx(ho,{comment:k,onDelete:fo(k,r)?()=>i(k.id):void 0,isReply:!0})]},k.id),e[25]=r,e[26]=i,e[27]=x):x=e[27],p=n.replies.map(x),e[21]=r,e[22]=i,e[23]=n.replies,e[24]=p}else p=e[24];let m;e[28]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Ir,{}),e[28]=m):m=e[28];let b;e[29]!==l?(b=l("taskBoard.taskDialog.commentReplyPlaceholder"),e[29]=l,e[30]=b):b=e[30];let y;e[31]!==r||e[32]!==s||e[33]!==b?(y=c.jsx(aa,{variant:"reply",placeholder:b,author:r,onSubmit:s}),e[31]=r,e[32]=s,e[33]=b,e[34]=y):y=e[34];let g;return e[35]!==f||e[36]!==u||e[37]!==p||e[38]!==y?(g=c.jsxs("div",{className:"flex flex-col rounded-xl bg-card card-shadow",children:[f,u,p,m,y]}),e[35]=f,e[36]=u,e[37]=p,e[38]=y,e[39]=g):g=e[39],g}function fo(t,e){return t.author.id===e.id||t.author.isAgent===!0}const kp=new Intl.ListFormat(void 0,{style:"long",type:"conjunction"});function vp(t,e){const n=[t,...t.replies],r=kp.format([...new Set(n.map(s=>s.author.name))]);return n.length===1?e("taskBoard.taskDialog.commentResolvedSummaryOne",{names:r}):e("taskBoard.taskDialog.commentResolvedSummaryMany",{count:n.length,names:r})}function wp(t){const e=P.c(6),{me:n,onSubmit:r}=t,s=ie();let i;e[0]!==s?(i=s("taskBoard.taskDialog.commentPlaceholder"),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==r||e[4]!==i?(o=c.jsx(aa,{variant:"root",placeholder:i,author:n,onSubmit:r}),e[2]=n,e[3]=r,e[4]=i,e[5]=o):o=e[5],o}function Ir(t){const e=P.c(4),{inset:n}=t,r=n&&"ml-12";let s;e[0]!==r?(s=J("h-px bg-border/50",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==s?(i=c.jsx("span",{className:s}),e[2]=s,e[3]=i):i=e[3],i}function ho(t){const e=P.c(25),{comment:n,isReply:r,resolved:s,onDelete:i,onToggleResolved:o}=t;let l;e[0]!==n.author?(l=c.jsx(la,{author:n.author}),e[0]=n.author,e[1]=l):l=e[1];let a;e[2]!==n.author.name?(a=c.jsx("span",{className:"text-sm font-medium text-foreground",children:n.author.name}),e[2]=n.author.name,e[3]=a):a=e[3];let d;e[4]!==n.createdAt?(d=Zr(new Date(n.createdAt)),e[4]=n.createdAt,e[5]=d):d=e[5];let f;e[6]!==d?(f=c.jsx("span",{className:"text-sm text-muted-foreground",children:d}),e[6]=d,e[7]=f):f=e[7];let h;e[8]!==i||e[9]!==o||e[10]!==s?(h=(i||o)&&c.jsx(Sp,{resolved:s,onDelete:i,onToggleResolved:o}),e[8]=i,e[9]=o,e[10]=s,e[11]=h):h=e[11];let u;e[12]!==l||e[13]!==a||e[14]!==f||e[15]!==h?(u=c.jsxs("div",{className:"flex items-center gap-2",children:[l,a,f,h]}),e[12]=l,e[13]=a,e[14]=f,e[15]=h,e[16]=u):u=e[16];const p=r&&"pl-8";let m;e[17]!==p?(m=J("whitespace-pre-wrap text-[15px] leading-relaxed text-foreground",p),e[17]=p,e[18]=m):m=e[18];let b;e[19]!==n.body||e[20]!==m?(b=c.jsx("div",{className:m,children:n.body}),e[19]=n.body,e[20]=m,e[21]=b):b=e[21];let y;return e[22]!==u||e[23]!==b?(y=c.jsxs("div",{className:"group flex flex-col gap-1.5 p-4",children:[u,b]}),e[22]=u,e[23]=b,e[24]=y):y=e[24],y}function Sp(t){const e=P.c(18),{resolved:n,onDelete:r,onToggleResolved:s}=t,i=ie();let o;e[0]!==i?(o=i("taskBoard.taskDialog.commentActionsAriaLabel"),e[0]=i,e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(Xr,{size:16}),e[2]=l):l=e[2];let a;e[3]!==o?(a=c.jsx(sn,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":o,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-colors hover:bg-muted hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100",children:l})}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==s||e[6]!==n||e[7]!==i?(d=s&&c.jsxs(c.Fragment,{children:[c.jsxs(wt,{onSelect:s,children:[c.jsx(Cs,{size:16}),i(n?"taskBoard.taskDialog.commentUnresolveThread":"taskBoard.taskDialog.commentResolveThread")]}),c.jsx($o,{})]}),e[5]=s,e[6]=n,e[7]=i,e[8]=d):d=e[8];let f;e[9]!==r||e[10]!==i?(f=r&&c.jsxs(wt,{variant:"destructive",onSelect:r,children:[c.jsx(Qr,{size:16}),i("taskBoard.taskDialog.commentDelete")]}),e[9]=r,e[10]=i,e[11]=f):f=e[11];let h;e[12]!==d||e[13]!==f?(h=c.jsxs(rn,{align:"end",className:"w-48",children:[d,f]}),e[12]=d,e[13]=f,e[14]=h):h=e[14];let u;return e[15]!==a||e[16]!==h?(u=c.jsxs(on,{children:[a,h]}),e[15]=a,e[16]=h,e[17]=u):u=e[17],u}function la(t){const e=P.c(6),{author:n}=t;if(n.isAgent){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(zt,{size:24}),e[0]=o):o=e[0],o}const r=n.image??void 0;let s;e[1]!==n.name?(s=Et(n.name),e[1]=n.name,e[2]=s):s=e[2];let i;return e[3]!==r||e[4]!==s?(i=c.jsx(It,{url:r,fallback:s,shape:"circle",size:"xs"}),e[3]=r,e[4]=s,e[5]=i):i=e[5],i}function aa(t){const e=P.c(36),{variant:n,placeholder:r,author:s,onSubmit:i}=t,o=ie(),l=w.useRef(null),[a,d]=w.useState("");let f;e[0]!==i||e[1]!==a?(f=()=>{const O=a.trim();if(!O)return;i(O),d("");const I=l.current;I&&(I.value="",po(I))},e[0]=i,e[1]=a,e[2]=f):f=e[2];const h=f;let u;e[3]!==h?(u=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),h())},e[3]=h,e[4]=u):u=e[4];const p=u;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=O=>{d(O.currentTarget.value),po(O.currentTarget)},e[5]=m):m=e[5];const b=n==="root"&&"min-h-10";let y;e[6]!==b?(y=J("w-full resize-none overflow-hidden border-0 bg-transparent text-[15px] leading-relaxed text-foreground outline-none placeholder:text-muted-foreground",b),e[6]=b,e[7]=y):y=e[7];let g;e[8]!==p||e[9]!==r||e[10]!==y||e[11]!==a?(g=c.jsx("textarea",{ref:l,value:a,onChange:m,onKeyDown:p,placeholder:r,rows:1,className:y}),e[8]=p,e[9]=r,e[10]=y,e[11]=a,e[12]=g):g=e[12];const x=g;let k;e[13]!==a?(k=a.trim(),e[13]=a,e[14]=k):k=e[14];const v=!k;let C;e[15]!==o?(C=o("taskBoard.taskDialog.commentSubmitAriaLabel"),e[15]=o,e[16]=C):C=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Ic,{size:16}),e[17]=j):j=e[17];let S;e[18]!==h||e[19]!==v||e[20]!==C?(S=c.jsx("button",{type:"button",disabled:v,onClick:h,"aria-label":C,className:"flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40",children:j}),e[18]=h,e[19]=v,e[20]=C,e[21]=S):S=e[21];const D=S;let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=()=>l.current?.focus(),e[22]=N):N=e[22];const R=N;if(n==="root"){let O;e[23]!==D?(O=c.jsx("div",{className:"flex items-center justify-end",children:D}),e[23]=D,e[24]=O):O=e[24];let I;return e[25]!==O||e[26]!==x?(I=c.jsxs("div",{"data-testid":"new-comment-composer",onClick:R,className:"relative flex cursor-text flex-col gap-1 rounded-xl bg-card p-3 card-shadow",children:[x,O]}),e[25]=O,e[26]=x,e[27]=I):I=e[27],I}let T;e[28]!==s?(T=c.jsx("span",{className:"mt-0.5 shrink-0",children:c.jsx(la,{author:s})}),e[28]=s,e[29]=T):T=e[29];let E;e[30]!==x?(E=c.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:x}),e[30]=x,e[31]=E):E=e[31];let _;return e[32]!==D||e[33]!==T||e[34]!==E?(_=c.jsxs("div",{"data-testid":"reply-composer",onClick:R,className:"relative flex cursor-text items-start gap-2 p-3",children:[T,E,D]}),e[32]=D,e[33]=T,e[34]=E,e[35]=_):_=e[35],_}function po(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}function Cp(t){const e=t.filter(r=>!r.parentId).map(r=>({...r,replies:[]})),n=new Map(e.map(r=>[r.id,r]));for(const r of t)r.parentId&&n.get(r.parentId)?.replies.push(r);return e}function jp(t){const e=P.c(36),{locator:n}=Be(),r=cn(),s=an();let i;e[0]!==t||e[1]!==n?(i=xe.taskBoardComments(n,t??""),e[0]=t,e[1]=n,e[2]=i):i=e[2];const o=i,l=!!t;let a;e[3]!==t||e[4]!==r?(a=async()=>Cp((await r.call("TASK_BOARD_COMMENT_LIST",{taskBoardItemId:t})).comments),e[3]=t,e[4]=r,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==l||e[8]!==a?(d={queryKey:o,enabled:l,queryFn:a},e[6]=o,e[7]=l,e[8]=a,e[9]=d):d=e[9];const f=Qe(d);let h;e[10]!==s||e[11]!==o?(h=()=>s.invalidateQueries({queryKey:o}),e[10]=s,e[11]=o,e[12]=h):h=e[12];const u=h;let p;e[13]!==t||e[14]!==r?(p=D=>r.call("TASK_BOARD_COMMENT_CREATE",{taskBoardItemId:t,...D}),e[13]=t,e[14]=r,e[15]=p):p=e[15];let m;e[16]!==u||e[17]!==p?(m={mutationFn:p,onSuccess:u},e[16]=u,e[17]=p,e[18]=m):m=e[18];const b=it(m);let y;e[19]!==r?(y=D=>r.call("TASK_BOARD_COMMENT_UPDATE",D),e[19]=r,e[20]=y):y=e[20];let g;e[21]!==u||e[22]!==y?(g={mutationFn:y,onSuccess:u},e[21]=u,e[22]=y,e[23]=g):g=e[23];const x=it(g);let k;e[24]!==r?(k=D=>r.call("TASK_BOARD_COMMENT_DELETE",{id:D}),e[24]=r,e[25]=k):k=e[25];let v;e[26]!==u||e[27]!==k?(v={mutationFn:k,onSuccess:u},e[26]=u,e[27]=k,e[28]=v):v=e[28];const C=it(v);let j;e[29]!==f.data?(j=f.data??[],e[29]=f.data,e[30]=j):j=e[30];let S;return e[31]!==b||e[32]!==C||e[33]!==x||e[34]!==j?(S={threads:j,post:b,setResolved:x,remove:C},e[31]=b,e[32]=C,e[33]=x,e[34]=j,e[35]=S):S=e[35],S}function Wr(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function Vr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const ca=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),Hn="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 Tp(t){const e=P.c(300),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:l,onOpenThread:a,onNewChat:d,onAutoFix:f,isSaving:h}=t,u=ie(),{data:p}=Uo();let m;e[0]!==p?.data?.members?(m=p?.data?.members??[],e[0]=p?.data?.members,e[1]=m):m=e[1];const b=m,{handleCopy:y,copied:g}=Dc(),{data:x}=Ko();let k;e[2]!==x?(k=x===void 0?[]:x,e[2]=x,e[3]=k):k=e[3];const v=k,C=rc(),j=ic(),[S,D]=w.useState(s?.title??""),[N,R]=w.useState(s?.description??""),[T,E]=w.useState(s?.status??i??"triage"),[_,O]=w.useState(s?.priority??"medium"),[I,A]=w.useState(s?.assigneeId??null),B=s?.dueDate;let $;e[4]!==B?($=Vr(B),e[4]=B,e[5]=$):$=e[5];const[U,G]=w.useState($);let q;e[6]!==s?.tags?(q=s?.tags.map(Ip)??[],e[6]=s?.tags,e[7]=q):q=e[7];const[F,K]=w.useState(q),[Q,X]=w.useState(!1),[H,se]=w.useState(!1),[ee,oe]=w.useState(!1);let L;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?(L=()=>{D(s?.title??""),R(s?.description??""),E(s?.status??i??"triage"),O(s?.priority??"medium"),A(s?.assigneeId??null),G(Vr(s?.dueDate)),K(s?.tags.map(Ep)??[])},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]=L):L=e[16];const W=L;let Y;e[17]!==r||e[18]!==W?(Y=()=>{r(),W()},e[17]=r,e[18]=W,e[19]=Y):Y=e[19];const te=Y;let M;e[20]!==C?(M=async(V,Ce)=>{const Pe=await C.mutateAsync({name:V,color:Ce});K(Tt=>[...Tt,Pe.id])},e[20]=C,e[21]=M):M=e[21];const Z=M;let ne;e[22]!==j?(ne=V=>{j.mutate(V),K(Ce=>Ce.filter(Pe=>Pe!==V))},e[22]=j,e[23]=ne):ne=e[23];const de=ne;let ve;e[24]!==I||e[25]!==N||e[26]!==U||e[27]!==o||e[28]!==_||e[29]!==T||e[30]!==F||e[31]!==S?(ve=()=>{const V=S.trim();V&&o({title:V,description:N.trim()||null,status:T,priority:_,assigneeId:I,dueDate:U?Wr(U):null,tagIds:F})},e[24]=I,e[25]=N,e[26]=U,e[27]=o,e[28]=_,e[29]=T,e[30]=F,e[31]=S,e[32]=ve):ve=e[32];const Re=ve,he=I===qe,Ee=s&&f&&(T==="triage"||T==="todo")&&!he;let Ye;if(e[33]!==I||e[34]!==N||e[35]!==U||e[36]!==s||e[37]!==_||e[38]!==T||e[39]!==F||e[40]!==S){const V=s?.tags.map(Rp)??[];Ye=!s||S.trim()!==s.title||(N.trim()||null)!==s.description||T!==s.status||_!==s.priority||I!==(s.assigneeId??null)||(U?Wr(U):null)!==(s.dueDate??null)||F.length!==V.length||!F.every(Ce=>V.includes(Ce)),e[33]=I,e[34]=N,e[35]=U,e[36]=s,e[37]=_,e[38]=T,e[39]=F,e[40]=S,e[41]=Ye}else Ye=e[41];const Ct=Ye;let _t;if(e[42]!==I||e[43]!==b){let V;e[45]!==I?(V=Ce=>Ce.userId===I,e[45]=I,e[46]=V):V=e[46],_t=b.find(V),e[42]=I,e[43]=b,e[44]=_t}else _t=e[44];const ze=_t;let Oe;e[47]!==s||e[48]!==b?(Oe=s?.assignedBy?b.find(V=>V.userId===s.assignedBy):void 0,e[47]=s,e[48]=b,e[49]=Oe):Oe=e[49];const Te=Oe,Ze=Nt[T].icon;let ce,at,ue,we,Ft,Je,He,Ue,et,dt,tt,nt,st,be,Se,ye,Ie,ge,ke,De,_e;if(e[50]!==te||e[51]!==s||e[52]!==n||e[53]!==u||e[54]!==S){ue=!!s&&qo(s),at=xs,De=n,e[76]!==te?(_e=Tt=>!Tt&&te(),e[76]=te,e[77]=_e):_e=e[77],ce=bs,ye="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]",Ie="hidden";let V;e[78]!==s||e[79]!==u?(V=u(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[78]=s,e[79]=u,e[80]=V):V=e[80],e[81]!==V?(ge=c.jsx(ys,{className:"sr-only",children:V}),e[81]=V,e[82]=ge):ge=e[82];let Ce;e[83]!==u?(Ce=u("taskBoard.taskDialog.closeAriaLabel"),e[83]=u,e[84]=Ce):Ce=e[84];let Pe;e[85]===Symbol.for("react.memo_cache_sentinel")?(Pe=c.jsx(nn,{size:16}),e[85]=Pe):Pe=e[85],e[86]!==te||e[87]!==Ce?(ke=c.jsx("button",{type:"button","aria-label":Ce,onClick:te,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:Pe}),e[86]=te,e[87]=Ce,e[88]=ke):ke=e[88],Se="flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",be="flex min-w-0 flex-col sm:flex-1 sm:overflow-y-auto",st="sticky top-0 z-10 bg-background p-6 pb-0 sm:p-8 sm:pb-0",we=Np,Ft=S,Je=Tt=>{ue||(D(Tt.target.value),Tt.target.style.height="auto",Tt.target.style.height=`${Tt.target.scrollHeight}px`)},He=Dp,e[89]!==u?(Ue=u("taskBoard.taskDialog.taskTitlePlaceholder"),e[89]=u,e[90]=Ue):Ue=e[90],et=!0,dt=1,tt=ue,nt=J("w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30",ue&&"cursor-default"),e[50]=te,e[51]=s,e[52]=n,e[53]=u,e[54]=S,e[55]=ce,e[56]=at,e[57]=ue,e[58]=we,e[59]=Ft,e[60]=Je,e[61]=He,e[62]=Ue,e[63]=et,e[64]=dt,e[65]=tt,e[66]=nt,e[67]=st,e[68]=be,e[69]=Se,e[70]=ye,e[71]=Ie,e[72]=ge,e[73]=ke,e[74]=De,e[75]=_e}else ce=e[55],at=e[56],ue=e[57],we=e[58],Ft=e[59],Je=e[60],He=e[61],Ue=e[62],et=e[63],dt=e[64],tt=e[65],nt=e[66],st=e[67],be=e[68],Se=e[69],ye=e[70],Ie=e[71],ge=e[72],ke=e[73],De=e[74],_e=e[75];let fe;e[91]!==we||e[92]!==Ft||e[93]!==Je||e[94]!==He||e[95]!==Ue||e[96]!==et||e[97]!==dt||e[98]!==tt||e[99]!==nt?(fe=c.jsx("textarea",{ref:we,value:Ft,onChange:Je,onKeyDown:He,placeholder:Ue,autoFocus:et,rows:dt,readOnly:tt,className:nt}),e[91]=we,e[92]=Ft,e[93]=Je,e[94]=He,e[95]=Ue,e[96]=et,e[97]=dt,e[98]=tt,e[99]=nt,e[100]=fe):fe=e[100];let Ae;e[101]!==ue||e[102]!==u?(Ae=ue&&c.jsxs("p",{className:"mb-3 mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(wa,{size:12}),u("taskBoard.taskDialog.reportsContentLocked")]}),e[101]=ue,e[102]=u,e[103]=Ae):Ae=e[103];let Ne;e[104]!==st||e[105]!==fe||e[106]!==Ae?(Ne=c.jsxs("div",{className:st,children:[fe,Ae]}),e[104]=st,e[105]=fe,e[106]=Ae,e[107]=Ne):Ne=e[107];let $e;e[108]!==u?($e=u("taskBoard.taskDialog.descriptionPlaceholder"),e[108]=u,e[109]=$e):$e=e[109];const ut=!ue;let Ve;e[110]!==N||e[111]!==$e||e[112]!==ut?(Ve=c.jsx(up,{defaultValue:N,onChange:R,placeholder:$e,editable:ut}),e[110]=N,e[111]=$e,e[112]=ut,e[113]=Ve):Ve=e[113];let Le;e[114]!==g||e[115]!==N||e[116]!==y||e[117]!==u?(Le=N&&c.jsx(Me,{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(N),children:g?c.jsx(Cs,{size:14}):c.jsx(Nc,{size:14})}),e[114]=g,e[115]=N,e[116]=y,e[117]=u,e[118]=Le):Le=e[118];let Ge;e[119]!==Ve||e[120]!==Le?(Ge=c.jsxs("div",{className:"group relative flex flex-col",children:[Ve,Le]}),e[119]=Ve,e[120]=Le,e[121]=Ge):Ge=e[121];let We;e[122]!==s?(We=s&&c.jsx("hr",{className:"border-border"}),e[122]=s,e[123]=We):We=e[123];let ft;e[124]!==N||e[125]!==s||e[126]!==a?(ft=s?.id&&c.jsx(Fp,{item:s,description:N,onOpenThread:a}),e[124]=N,e[125]=s,e[126]=a,e[127]=ft):ft=e[127];let ht;e[128]!==Te||e[129]!==ze||e[130]!==s||e[131]!==b||e[132]!==a?(ht=s&&c.jsx(Kp,{item:s,members:b,startedBy:Te??ze,onOpenThread:a}),e[128]=Te,e[129]=ze,e[130]=s,e[131]=b,e[132]=a,e[133]=ht):ht=e[133];let pt;e[134]!==Ge||e[135]!==We||e[136]!==ft||e[137]!==ht?(pt=c.jsxs("div",{className:"flex flex-col gap-6 p-6 pt-6 sm:p-8 sm:pt-6",children:[Ge,We,ft,ht]}),e[134]=Ge,e[135]=We,e[136]=ft,e[137]=ht,e[138]=pt):pt=e[138];let gt;e[139]!==be||e[140]!==Ne||e[141]!==pt?(gt=c.jsxs("div",{className:be,children:[Ne,pt]}),e[139]=be,e[140]=Ne,e[141]=pt,e[142]=gt):gt=e[142];let mt;e[143]!==u?(mt=u("taskBoard.taskDialog.propertiesLabel"),e[143]=u,e[144]=mt):mt=e[144];let At;e[145]!==mt?(At=c.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:mt}),e[145]=mt,e[146]=At):At=e[146];let xt;e[147]!==s||e[148]!==T?(xt=J(s?gi({...s,status:T}):Nt[T].iconClassName),e[147]=s,e[148]=T,e[149]=xt):xt=e[149];let bt;e[150]!==Ze||e[151]!==xt?(bt=c.jsx(Ze,{size:16,className:xt}),e[150]=Ze,e[151]=xt,e[152]=bt):bt=e[152];const Qt=Nt[T];let yt;e[153]!==u||e[154]!==Qt.labelKey?(yt=u(Qt.labelKey),e[153]=u,e[154]=Qt.labelKey,e[155]=yt):yt=e[155];let kt;e[156]!==bt||e[157]!==yt?(kt=c.jsx(sn,{asChild:!0,children:c.jsxs("button",{type:"button",className:Hn,children:[bt,yt]})}),e[156]=bt,e[157]=yt,e[158]=kt):kt=e[158];let Bt;e[159]!==u?(Bt=tr.map(V=>{const Ce=Nt[V].icon;return c.jsxs(wt,{onSelect:()=>E(V),className:"gap-2",children:[c.jsx(Ce,{size:16,className:Nt[V].iconClassName}),u(Nt[V].labelKey)]},V)}),e[159]=u,e[160]=Bt):Bt=e[160];let z;e[161]!==Bt?(z=c.jsx(rn,{align:"start",className:"w-44",children:Bt}),e[161]=Bt,e[162]=z):z=e[162];let re;e[163]!==kt||e[164]!==z?(re=c.jsxs(on,{children:[kt,z]}),e[163]=kt,e[164]=z,e[165]=re):re=e[165];let me;e[166]!==ue||e[167]!==u?(me=ue?u("taskBoard.taskDialog.reportsContentLocked"):void 0,e[166]=ue,e[167]=u,e[168]=me):me=e[168];const rt=_==="none"&&"text-muted-foreground",Ot=ue&&"cursor-default opacity-60";let jt;e[169]!==rt||e[170]!==Ot?(jt=J(Hn,rt,Ot),e[169]=rt,e[170]=Ot,e[171]=jt):jt=e[171];let fn;e[172]!==_||e[173]!==u?(fn=_==="none"?c.jsxs(c.Fragment,{children:[c.jsx(Xr,{size:16}),u("taskBoard.taskDialog.setPriorityButton")]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:J("size-2 rounded-full",Rt[_].dotClassName)}),u(Rt[_].labelKey)]}),e[172]=_,e[173]=u,e[174]=fn):fn=e[174];let hn;e[175]!==ue||e[176]!==me||e[177]!==jt||e[178]!==fn?(hn=c.jsx(sn,{asChild:!0,children:c.jsx("button",{type:"button",disabled:ue,title:me,className:jt,children:fn})}),e[175]=ue,e[176]=me,e[177]=jt,e[178]=fn,e[179]=hn):hn=e[179];let pn;e[180]!==u?(pn=mi.map(V=>c.jsxs(wt,{onSelect:()=>O(V),children:[c.jsx("span",{className:J("size-2 rounded-full",Rt[V].dotClassName)}),u(Rt[V].labelKey)]},V)),e[180]=u,e[181]=pn):pn=e[181];let gn;e[182]!==pn?(gn=c.jsx(rn,{align:"start",className:"w-40",children:pn}),e[182]=pn,e[183]=gn):gn=e[183];let mn;e[184]!==hn||e[185]!==gn?(mn=c.jsxs(on,{children:[hn,gn]}),e[184]=hn,e[185]=gn,e[186]=mn):mn=e[186];const yr=!I&&"text-muted-foreground";let xn;e[187]!==yr?(xn=J(Hn,yr),e[187]=yr,e[188]=xn):xn=e[188];let bn;e[189]!==Te||e[190]!==ze||e[191]!==he||e[192]!==u?(bn=he&&Te?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[c.jsx(It,{url:Te.user?.image??void 0,fallback:Et(Te.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:Te.user?.name??u("taskBoard.taskDialog.superAgentDefaultName")})]}),c.jsxs("span",{className:"flex items-center gap-2 sm:hidden",children:[c.jsxs("span",{className:"inline-flex items-center",children:[c.jsx(It,{url:Te.user?.image??void 0,fallback:Et(Te.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),c.jsx(zt,{size:16,className:"ring-2 ring-background"})]}),u("taskBoard.taskDialog.superAgentLabel")]})]}):he?c.jsxs(c.Fragment,{children:[c.jsx(zt,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]}):ze?c.jsxs(c.Fragment,{children:[c.jsx(It,{url:ze.user?.image??void 0,fallback:Et(ze.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:ze.user?.name??u("taskBoard.taskDialog.unassignedLabel")})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ao,{size:16,className:"text-muted-foreground"}),u("taskBoard.taskDialog.assignButton")]}),e[189]=Te,e[190]=ze,e[191]=he,e[192]=u,e[193]=bn):bn=e[193];let yn;e[194]!==xn||e[195]!==bn?(yn=c.jsx(Vn,{asChild:!0,children:c.jsx("button",{type:"button",className:xn,children:bn})}),e[194]=xn,e[195]=bn,e[196]=yn):yn=e[196];let _s;e[197]===Symbol.for("react.memo_cache_sentinel")?(_s=V=>{A(V),se(!1)},e[197]=_s):_s=e[197];let kn;e[198]!==b?(kn=c.jsx(us,{align:"start",className:"w-56 p-0",children:c.jsx(Ri,{members:b,onSelect:_s})}),e[198]=b,e[199]=kn):kn=e[199];let vn;e[200]!==H||e[201]!==yn||e[202]!==kn?(vn=c.jsxs(fs,{open:H,onOpenChange:se,modal:!0,children:[yn,kn]}),e[200]=H,e[201]=yn,e[202]=kn,e[203]=vn):vn=e[203];let wn;e[204]!==Te||e[205]!==he||e[206]!==u?(wn=he&&Te&&c.jsxs("div",{className:"relative mt-1.5 hidden items-center pl-5 sm:flex",children:[c.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"}),c.jsxs("span",{className:J(Hn,"pointer-events-none"),children:[c.jsx(zt,{size:16}),u("taskBoard.taskDialog.superAgentLabel")]})]}),e[204]=Te,e[205]=he,e[206]=u,e[207]=wn):wn=e[207];let Sn;e[208]!==vn||e[209]!==wn?(Sn=c.jsxs("div",{className:"flex flex-col",children:[vn,wn]}),e[208]=vn,e[209]=wn,e[210]=Sn):Sn=e[210];const kr=!U&&"text-muted-foreground";let Cn;e[211]!==kr?(Cn=J(Hn,kr),e[211]=kr,e[212]=Cn):Cn=e[212];let As;e[213]===Symbol.for("react.memo_cache_sentinel")?(As=c.jsx(Gn,{size:16,className:"text-muted-foreground"}),e[213]=As):As=e[213];let jn;e[214]!==U||e[215]!==u?(jn=U?ca.format(U):u("taskBoard.taskDialog.dueDateLabel"),e[214]=U,e[215]=u,e[216]=jn):jn=e[216];let Tn;e[217]!==U||e[218]!==u?(Tn=U&&c.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:V=>{V.stopPropagation(),G(null)},onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),V.stopPropagation(),G(null))},children:c.jsx(nn,{size:12})}),e[217]=U,e[218]=u,e[219]=Tn):Tn=e[219];let Dn;e[220]!==Cn||e[221]!==jn||e[222]!==Tn?(Dn=c.jsx(Vn,{asChild:!0,children:c.jsxs("button",{type:"button",className:Cn,children:[As,jn,Tn]})}),e[220]=Cn,e[221]=jn,e[222]=Tn,e[223]=Dn):Dn=e[223];const vr=U??void 0;let Bs;e[224]===Symbol.for("react.memo_cache_sentinel")?(Bs=V=>{G(V??null),V&&X(!1)},e[224]=Bs):Bs=e[224];let Nn;e[225]!==vr?(Nn=c.jsx(us,{className:"w-auto p-0",align:"start",children:c.jsx(Zo,{mode:"single",selected:vr,onSelect:Bs,initialFocus:!0})}),e[225]=vr,e[226]=Nn):Nn=e[226];let Rn;e[227]!==Q||e[228]!==Dn||e[229]!==Nn?(Rn=c.jsxs(fs,{open:Q,onOpenChange:X,children:[Dn,Nn]}),e[227]=Q,e[228]=Dn,e[229]=Nn,e[230]=Rn):Rn=e[230];let En;e[231]!==v||e[232]!==u||e[233]!==F?(En=F.length===0?c.jsx(Vn,{asChild:!0,children:c.jsxs("button",{type:"button",className:J(Hn,"text-muted-foreground"),children:[c.jsx(Ba,{size:16}),u("taskBoard.taskDialog.tagsButton")]})}):c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[F.map(V=>{const Ce=v.find(Pe=>Pe.id===V);return Ce?c.jsxs("button",{type:"button",onClick:()=>oe(!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:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Rs(Ce.color)}}),c.jsx("span",{className:"truncate",children:Ce.name}),c.jsx("span",{role:"button",tabIndex:0,"aria-label":u("taskBoard.taskDialog.removeTagAriaLabel",{name:Ce.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:Pe=>{Pe.stopPropagation(),K(Tt=>Tt.filter(wr=>wr!==V))},onKeyDown:Pe=>{(Pe.key==="Enter"||Pe.key===" ")&&(Pe.preventDefault(),Pe.stopPropagation(),K(Tt=>Tt.filter(wr=>wr!==V)))},children:c.jsx(nn,{size:10})})]},V):null}),c.jsx(Vn,{asChild:!0,children:c.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:c.jsx(ms,{size:14})})})]}),e[231]=v,e[232]=u,e[233]=F,e[234]=En):En=e[234];let In;e[235]!==v.length?(In=Cf(v.length),e[235]=v.length,e[236]=In):In=e[236];let Os;e[237]===Symbol.for("react.memo_cache_sentinel")?(Os=V=>K(Ce=>Ce.includes(V)?Ce.filter(Pe=>Pe!==V):[...Ce,V]),e[237]=Os):Os=e[237];let _n;e[238]!==Z||e[239]!==de||e[240]!==v||e[241]!==In||e[242]!==F?(_n=c.jsx(us,{align:"start",className:"w-56 p-0",children:c.jsx(xp,{tags:v,selectedIds:F,defaultColor:In,onToggle:Os,onCreate:Z,onDelete:de})}),e[238]=Z,e[239]=de,e[240]=v,e[241]=In,e[242]=F,e[243]=_n):_n=e[243];let An;e[244]!==En||e[245]!==_n||e[246]!==ee?(An=c.jsxs(fs,{open:ee,onOpenChange:oe,modal:!0,children:[En,_n]}),e[244]=En,e[245]=_n,e[246]=ee,e[247]=An):An=e[247];let Bn;e[248]!==re||e[249]!==mn||e[250]!==Sn||e[251]!==Rn||e[252]!==An?(Bn=c.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[re,mn,Sn,Rn,An]}),e[248]=re,e[249]=mn,e[250]=Sn,e[251]=Rn,e[252]=An,e[253]=Bn):Bn=e[253];let On;e[254]!==At||e[255]!==Bn?(On=c.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:[At,Bn]}),e[254]=At,e[255]=Bn,e[256]=On):On=e[256];let $n;e[257]!==Se||e[258]!==gt||e[259]!==On?($n=c.jsxs("div",{className:Se,children:[gt,On]}),e[257]=Se,e[258]=gt,e[259]=On,e[260]=$n):$n=e[260];let Mn;e[261]!==s||e[262]!==l||e[263]!==u?(Mn=s&&l?c.jsx(Me,{variant:"ghost",size:"icon","aria-label":u("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:l,children:c.jsx(Qr,{size:16})}):c.jsx("span",{}),e[261]=s,e[262]=l,e[263]=u,e[264]=Mn):Mn=e[264];let zn;e[265]!==s||e[266]!==d||e[267]!==u?(zn=s&&d&&c.jsxs(Me,{variant:"outline",size:"sm",onClick:d,children:[c.jsx(Bo,{size:16}),u("taskBoard.taskDialog.newChatButton")]}),e[265]=s,e[266]=d,e[267]=u,e[268]=zn):zn=e[268];let Ln;e[269]!==f||e[270]!==Ee||e[271]!==u?(Ln=Ee&&c.jsxs(Me,{variant:"outline",size:"sm",onClick:f,children:[c.jsx(ar,{size:16}),u("taskBoard.taskBoard.autoFix")]}),e[269]=f,e[270]=Ee,e[271]=u,e[272]=Ln):Ln=e[272];let Pn;e[273]!==Ct||e[274]!==h||e[275]!==s||e[276]!==Re||e[277]!==u||e[278]!==S?(Pn=Ct&&c.jsxs(Me,{size:"sm",disabled:!S.trim()||h,onClick:Re,children:[s?null:c.jsx(ms,{size:16}),u(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton")]}),e[273]=Ct,e[274]=h,e[275]=s,e[276]=Re,e[277]=u,e[278]=S,e[279]=Pn):Pn=e[279];let Fn;e[280]!==zn||e[281]!==Ln||e[282]!==Pn?(Fn=c.jsxs("div",{className:"flex items-center gap-2",children:[zn,Ln,Pn]}),e[280]=zn,e[281]=Ln,e[282]=Pn,e[283]=Fn):Fn=e[283];let Un;e[284]!==Mn||e[285]!==Fn?(Un=c.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[Mn,Fn]}),e[284]=Mn,e[285]=Fn,e[286]=Un):Un=e[286];let qn;e[287]!==ce||e[288]!==ye||e[289]!==Ie||e[290]!==ge||e[291]!==ke||e[292]!==$n||e[293]!==Un?(qn=c.jsxs(ce,{className:ye,closeButtonClassName:Ie,children:[ge,ke,$n,Un]}),e[287]=ce,e[288]=ye,e[289]=Ie,e[290]=ge,e[291]=ke,e[292]=$n,e[293]=Un,e[294]=qn):qn=e[294];let $s;return e[295]!==at||e[296]!==De||e[297]!==_e||e[298]!==qn?($s=c.jsx(at,{open:De,onOpenChange:_e,children:qn}),e[295]=at,e[296]=De,e[297]=_e,e[298]=qn,e[299]=$s):$s=e[299],$s}function Dp(t){t.key==="Enter"&&t.preventDefault()}function Np(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function Rp(t){return t.id}function Ep(t){return t.id}function Ip(t){return t.id}function _p(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:$a};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:Yr};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:dn};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:cr};default:return t}}function Ap(t){const e=P.c(31),{thread:n,startedBy:r,onOpen:s}=t,i=ie();let o;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const l=n.status?_p(n.status,i):null,a=n.lastMessage;let d;e[5]!==n.title?(d=_i(n.title,"qa"),e[5]=n.title,e[6]=d):d=e[6];const f=d;let h;e[7]!==n.title?(h=_i(n.title,"code_review"),e[7]=n.title,e[8]=h):h=e[8];const u=h;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]!==u||e[13]!==f?(m=f?c.jsx($l,{size:16,className:"shrink-0"}):u?c.jsx(Ml,{size:16,className:"shrink-0"}):c.jsx(zt,{size:16,className:"shrink-0"}),e[12]=u,e[13]=f,e[14]=m):m=e[14];let b;e[15]!==i||e[16]!==n.title?(b=n.title||i("taskBoard.taskDialog.superAgentDefaultName"),e[15]=i,e[16]=n.title,e[17]=b):b=e[17];let y;e[18]!==b?(y=c.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:b}),e[18]=b,e[19]=y):y=e[19];let g;e[20]!==r||e[21]!==i?(g=r&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-sm text-muted-foreground/50",children:i("taskBoard.taskDialog.startedByLabel")}),c.jsx(It,{url:r.user?.image??void 0,fallback:Et(r.user?.name),shape:"circle",size:"2xs"}),c.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 x;e[23]!==s||e[24]!==i?(x=s&&c.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"),c.jsx(Jo,{size:14})]}),e[23]=s,e[24]=i,e[25]=x):x=e[25];let k;e[26]!==m||e[27]!==y||e[28]!==g||e[29]!==x?(k=c.jsxs("div",{className:"flex items-center gap-2",children:[m,y,g,x]}),e[26]=m,e[27]=y,e[28]=g,e[29]=x,e[30]=k):k=e[30],o=c.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,l&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:J("flex shrink-0 items-center gap-1.5",l.className),children:[c.jsx(l.icon,{size:15,className:J(l.spin&&"animate-spin")}),c.jsx("span",{className:"text-sm",children:l.label})]}),a&&c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:a})]})]}),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=o}else o=e[4];return o}function Bp(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:Oa}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:Sr}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:Sr}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:Sr}}function Op(t,e){switch(t){case"passing":return{label:e("taskBoard.taskDialog.prChecksPassing"),className:"text-success",icon:dn};case"failing":return{label:e("taskBoard.taskDialog.prChecksFailing"),className:"text-destructive",icon:cr};case"pending":return{label:e("taskBoard.taskDialog.prChecksPending"),className:"text-warning",icon:Ss};default:return null}}const $p=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);function Mp(t){if(t.status!=="completed")return{icon:Ss,className:"text-warning",spin:!0};const e=t.conclusion;return e&&$p.has(e)?{icon:cr,className:"text-destructive",spin:!1}:e==="success"||e==="neutral"||e==="skipped"?{icon:dn,className:"text-success",spin:!1}:{icon:Yr,className:"text-muted-foreground",spin:!1}}function zp(t){const e=P.c(37),{pr:n,previewThread:r,reviewsReady:s,shipPending:i,onShip:o,onOpenThread:l}=t,a=ie(),[d,f]=w.useState(!1);let h;if(e[0]!==d||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==a){const u=Bp(n,a),p=Op(n.checksStatus,a),m=n.state==="open"&&!n.merged,b=n.checksStatus!=="failing"&&n.checksStatus!=="pending",y=s&&m&&b,g=!!r||!!n.previewUrl||y;let x;e[9]!==n.checks?(x=n.checks??[],e[9]=n.checks,e[10]=x):x=e[10];const k=x,v=k.length>0||p!=null,C=k.length>0;let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(Ar,{className:"size-4 shrink-0 text-foreground"}),e[11]=j):j=e[11];const S=n.title??`${n.repoOwner}/${n.repoName}`;let D;e[12]!==S?(D=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:S}),e[12]=S,e[13]=D):D=e[13];const N=J("flex shrink-0 items-center gap-1 text-xs font-medium",u.className);let R;e[14]!==u?(R=c.jsx(u.icon,{size:13}),e[14]=u,e[15]=R):R=e[15];let T;e[16]!==u||e[17]!==N||e[18]!==R?(T=c.jsxs("span",{className:N,children:[R,u.label]}),e[16]=u,e[17]=N,e[18]=R,e[19]=T):T=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(Hs,{size:12,className:"text-muted-foreground/60 group-hover:text-foreground"}),e[20]=E):E=e[20];let _;e[21]!==n.number||e[22]!==n.url?(_=c.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]=_):_=e[23];let O;e[24]!==_||e[25]!==D||e[26]!==T?(O=c.jsxs("div",{className:"flex items-center gap-3",children:[j,D,T,_]}),e[24]=_,e[25]=D,e[26]=T,e[27]=O):O=e[27];let I;e[28]!==g||e[29]!==l||e[30]!==o||e[31]!==n.previewUrl||e[32]!==r||e[33]!==i||e[34]!==y||e[35]!==a?(I=g&&c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&c.jsxs(Me,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",title:a("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>l?.(r),children:[c.jsx(Bo,{size:13}),a("taskBoard.taskDialog.openPreviewButton")]}),n.previewUrl&&c.jsx(Me,{asChild:!0,type:"button",variant:"outline",size:"sm",className:"gap-1.5",children:c.jsxs("a",{href:n.previewUrl,target:"_blank",rel:"noreferrer",children:[c.jsx(el,{size:14}),a("taskBoard.taskDialog.previewLabel"),c.jsx(Hs,{size:12})]})}),y&&c.jsx(Me,{type:"button",variant:"success",size:"sm",disabled:i,onClick:o,children:a("taskBoard.taskDialog.shipToProductionButton")})]}),e[28]=g,e[29]=l,e[30]=o,e[31]=n.previewUrl,e[32]=r,e[33]=i,e[34]=y,e[35]=a,e[36]=I):I=e[36],h=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[O,I,v&&c.jsxs("div",{className:"border-t border-border pt-2 text-xs",children:[c.jsxs("button",{type:"button",disabled:!C,onClick:()=>f(Lp),className:"flex w-full items-center gap-1.5 font-medium disabled:cursor-default",children:[p?c.jsx(p.icon,{size:13,className:p.className}):c.jsx(dn,{size:13,className:"text-muted-foreground"}),c.jsx("span",{className:J(p?.className??"text-muted-foreground"),children:p?.label??a("taskBoard.taskDialog.prChecksLabel")}),C&&c.jsx(Jo,{size:14,className:J("ml-auto text-muted-foreground/60 transition-transform",d&&"rotate-90")})]}),d&&c.jsx("div",{className:"mt-2 flex flex-col gap-2",children:k.map(A=>{const B=Mp(A);return c.jsxs("div",{className:"rounded-md bg-muted/40 p-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(B.icon,{size:13,className:J("shrink-0",B.className,B.spin&&"animate-spin")}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:A.name}),A.detailsUrl&&c.jsx("a",{href:A.detailsUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:c.jsx(Hs,{size:12})})]}),A.summary&&c.jsx("div",{className:"mt-1.5 max-h-64 overflow-auto text-muted-foreground",children:c.jsx(jc,{id:`${n.url}-${A.name}`,text:A.summary})})]},A.name)})})]})]}),e[0]=d,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=a,e[8]=h}else h=e[8];return h}function Lp(t){return!t}function Pp(){const t=P.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Kn,{className:"size-4 shrink-0 rounded"}),c.jsx(Kn,{className:"h-4 min-w-0 flex-1"}),c.jsx(Kn,{className:"h-4 w-16 shrink-0"}),c.jsx(Kn,{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=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[e,c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Kn,{className:"h-7 w-20"}),c.jsx(Kn,{className:"h-7 w-28"})]})]}),t[1]=n):n=t[1],n}function Fp(t){const e=P.c(36),{item:n,description:r,onOpenThread:s}=t,i=ie(),{data:o,isLoading:l}=hp(n.id),{data:a}=oa(n.id),d=Ai("qa_agent_enabled"),f=Ai("code_reviewer_enabled"),h=pp(n.id);let u,p;if(e[0]!==a||e[1]!==f||e[2]!==r||e[3]!==n.status||e[4]!==n.threads||e[5]!==s||e[6]!==h||e[7]!==o||e[8]!==l||e[9]!==d||e[10]!==i){p=Symbol.for("react.early_return_sentinel");e:{const m=bp(r),b=l&&!o;if(!b&&(!o||o.length===0)&&m.length===0){p=null;break e}let y;e[13]!==a||e[14]!==f||e[15]!==n.status||e[16]!==d?(y=n.status==="in_review"&&mp(a??[],gp({qa:d,codeReview:f})),e[13]=a,e[14]=f,e[15]=n.status,e[16]=d,e[17]=y):y=e[17];const g=y;let x;e[18]!==h||e[19]!==i?(x=()=>h.mutate(void 0,{onSuccess:N=>N?.merged?vt.success(i("taskBoard.taskDialog.shipSuccess")):vt.error(i("taskBoard.taskDialog.shipError")),onError:()=>vt.error(i("taskBoard.taskDialog.shipError"))}),e[18]=h,e[19]=i,e[20]=x):x=e[20];const k=x;let v;e[21]!==n.threads||e[22]!==s?(v=s?n.threads.find(qp):void 0,e[21]=n.threads,e[22]=s,e[23]=v):v=e[23];const C=v;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=c.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:j}),e[26]=j,e[27]=S):S=e[27];let D;e[28]!==b||e[29]!==s||e[30]!==k||e[31]!==C||e[32]!==h||e[33]!==o||e[34]!==g?(D=b?c.jsx(Pp,{}):(o??[]).map(N=>c.jsx(zp,{pr:N,previewThread:C,reviewsReady:g,shipPending:h.isPending,onShip:k,onOpenThread:s},N.url)),e[28]=b,e[29]=s,e[30]=k,e[31]=C,e[32]=h,e[33]=o,e[34]=g,e[35]=D):D=e[35],u=c.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[S,D,m.map(Up)]})}e[0]=a,e[1]=f,e[2]=r,e[3]=n.status,e[4]=n.threads,e[5]=s,e[6]=h,e[7]=o,e[8]=l,e[9]=d,e[10]=i,e[11]=u,e[12]=p}else u=e[11],p=e[12];return p!==Symbol.for("react.early_return_sentinel")?p:u}function Up(t){return c.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:[c.jsx(el,{size:15,className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:t.label}),c.jsx(Hs,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function qp(t){return t.hasPreview&&t.virtualMcpId}function Kp(t){const e=P.c(6),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=ie(),{data:l}=oa(n.id),{data:a}=wo.useSession(),d=new Map(r.map(Qp)),f={id:a?.user?.id??"me",name:a?.user?.name??o("taskBoard.taskDialog.commentYouLabel"),image:a?.user?.image},h=jp(n.id),u=k=>{if(k===qe)return{id:k,name:o("taskBoard.taskDialog.superAgentLabel"),isAgent:!0};if(k===f.id)return f;const v=d.get(k);return{id:k,name:v?.user?.name??k,image:v?.user?.image}},p=h.threads.map(k=>({id:k.id,author:u(k.authorId),body:k.body,createdAt:k.createdAt,resolved:k.resolved,replies:k.replies.map(v=>({id:v.id,author:u(v.authorId),body:v.body,createdAt:v.createdAt,replies:[]}))})),m=[...(l??[]).map(Gp),...n.threads.map(Vp),...p.map(Wp)].sort(Hp),b=[];for(const k of m){if(k.kind==="thread"){b.push({type:"thread",thread:k.thread});continue}if(k.kind==="comment"){b.push({type:"comment",comment:k.comment});continue}const v=b[b.length-1];v?.type==="timeline"?v.items.push(k.activity):b.push({type:"timeline",items:[k.activity]})}let y;e[0]!==o?(y=o("taskBoard.taskDialog.activityLabel"),e[0]=o,e[1]=y):y=e[1];let g;e[2]!==y?(g=c.jsx("span",{className:"text-sm font-medium text-foreground",children:y}),e[2]=y,e[3]=g):g=e[3];let x;return e[4]!==h.post?(x=k=>h.post.mutate({body:k}),e[4]=h.post,e[5]=x):x=e[5],c.jsxs("div",{className:"flex flex-col gap-5 pb-2",children:[g,b.map((k,v)=>k.type==="timeline"?c.jsx(Yp,{items:k.items,memberByUserId:d},`timeline-${v}`):k.type==="comment"?c.jsx(yp,{thread:k.comment,me:f,onReply:C=>h.post.mutate({body:C,parentId:k.comment.id}),onDelete:C=>h.remove.mutate(C),onToggleResolved:()=>h.setResolved.mutate({id:k.comment.id,resolved:!k.comment.resolved})},`comment-${k.comment.id}`):c.jsx(Ap,{thread:k.thread,startedBy:s,onOpen:i},`thread-${k.thread.threadId}`)),c.jsx(wp,{me:f,onSubmit:x})]})}function Hp(t,e){return t.at-e.at}function Wp(t){return{kind:"comment",at:new Date(t.createdAt).getTime(),comment:t}}function Vp(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function Gp(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function Qp(t){return[t.userId,t]}function en(t){const e=P.c(7),{icon:n,label:r}=t;let s;e[0]!==n?(s=c.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=c.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=c.jsxs(c.Fragment,{children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6],o}const ir="\0";function Ks(t){return`${ir}${t}${ir}`}function Wn(t,e){return t.split(new RegExp(`${ir}(\\w+)${ir}`)).map((n,r)=>c.jsx(w.Fragment,{children:r%2===0?n:e[n]},r))}function ls(t,e){return e(t==="code_review"?"taskBoard.taskDialog.codeReviewerLabel":"taskBoard.taskDialog.qaAgentLabel")}function Xp(t,e,n){const r=u=>{const p=typeof u=="string"?Nt[u]:void 0;if(!p)return String(u??"");const m=p.icon;return c.jsx(en,{icon:c.jsx(m,{size:14,className:p.iconClassName}),label:e(p.labelKey)})},s=u=>{const p=typeof u=="string"?Rt[u]:void 0;return p?c.jsx(en,{icon:c.jsx("span",{className:J("size-2 rounded-full",p.dotClassName)}),label:e(p.labelKey)}):String(u??"")},i=u=>{const p=Vr(typeof u=="string"?u:null);return p?c.jsx(en,{icon:c.jsx(Gn,{size:14,className:"text-muted-foreground"}),label:ca.format(p)}):""},o=u=>!Array.isArray(u)||u.length===0?null:u.map((p,m)=>{const b=p;return c.jsx(en,{icon:c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:Rs(b.color)}}),label:b.name??""},b.id??m)}),l=u=>{if(u===qe)return c.jsx(en,{icon:c.jsx(zt,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const p=typeof u=="string"?n.get(u):void 0;return c.jsx(en,{icon:c.jsx(It,{url:p?.user?.image??void 0,fallback:Et(p?.user?.name),shape:"circle",size:"2xs"}),label:p?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},a=u=>c.jsx(en,{icon:u==="code_review"?c.jsx(Ml,{size:14}):c.jsx($l,{size:14}),label:ls(u,e)}),d=t.data,f=Ks("from"),h=Ks("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return Wn(d.from?e("taskBoard.taskDialog.activityMovedFromTo",{from:f,to:h}):e("taskBoard.taskDialog.activityMovedTo",{to:h}),{from:r(d.from),to:r(d.to)});case"assignee_changed":return d.to==null?e("taskBoard.taskDialog.activityUnassigned"):Wn(e(d.to===qe?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:Ks("name")}),{name:l(d.to)});case"priority_changed":return d.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):Wn(!d.from||d.from==="none"?e("taskBoard.taskDialog.activityPrioritySet",{to:h}):e("taskBoard.taskDialog.activityPriorityFromTo",{from:f,to:h}),{from:s(d.from),to:s(d.to)});case"due_date_changed":return d.to==null?e("taskBoard.taskDialog.activityDueDateCleared"):Wn(d.from==null?e("taskBoard.taskDialog.activityDueDateSet",{to:h}):e("taskBoard.taskDialog.activityDueDateFromTo",{from:f,to:h}),{from:i(d.from),to:i(d.to)});case"title_changed":return e("taskBoard.taskDialog.activityRenamed",{to:String(d.to??"")});case"description_changed":return e("taskBoard.taskDialog.activityDescriptionUpdated");case"tags_changed":return!Array.isArray(d.to)||d.to.length===0?e("taskBoard.taskDialog.activityTagsCleared"):Wn(e("taskBoard.taskDialog.activityTagsSet",{to:h}),{to:o(d.to)});case"review_requested":return Wn(e("taskBoard.taskDialog.activityDelegated",{name:Ks("name")}),{name:a(d.reviewer)});case"review_approved":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewApprovedWithNotes",{reviewer:ls(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewApproved",{reviewer:ls(d.reviewer,e)});case"review_changes_requested":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewChangesRequestedWithNotes",{reviewer:ls(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewChangesRequested",{reviewer:ls(d.reviewer,e)});case"merge_conflict_resolution":return e("taskBoard.taskDialog.activityMergeConflictResolution");default:{const u=t.action;return String(u)}}}function go(t){return!t||t===qe}function Yp(t){const e=P.c(21),{items:n,memberByUserId:r}=t,s=ie();let i;e[0]!==r||e[1]!==s?(i=u=>go(u)?s("taskBoard.taskDialog.superAgentLabel"):r.get(u)?.user?.name??s("taskBoard.taskDialog.someoneLabel"),e[0]=r,e[1]=s,e[2]=i):i=e[2];const o=i;let l;e[3]!==r?(l=u=>{if(go(u))return c.jsx("span",{className:"z-10 flex size-4 shrink-0 items-center justify-center bg-background",children:c.jsx(zt,{size:16})});const p=r.get(u);return c.jsx("span",{className:"z-10 shrink-0 rounded-full bg-background",children:c.jsx(It,{url:p?.user?.image??void 0,fallback:Et(p?.user?.name),shape:"circle",size:"2xs"})})},e[3]=r,e[4]=l):l=e[4];const a=l;let d;e[5]!==n.length?(d=n.length>1&&c.jsx("span",{"aria-hidden":!0,className:"absolute bottom-3 left-2 top-3 w-px bg-border"}),e[5]=n.length,e[6]=d):d=e[6];let f;if(e[7]!==a||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==s){let u;e[13]!==a||e[14]!==o||e[15]!==r||e[16]!==s?(u=p=>c.jsxs("div",{className:"relative flex items-center gap-2.5",children:[a(p.actorId),c.jsxs("span",{className:"min-w-0 truncate text-sm text-muted-foreground",children:[c.jsx("span",{className:"font-medium text-foreground",children:o(p.actorId)})," ",Xp(p,s,r),c.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",Zr(new Date(p.occurredAt))]})]})]},p.id),e[13]=a,e[14]=o,e[15]=r,e[16]=s,e[17]=u):u=e[17],f=n.map(u),e[7]=a,e[8]=o,e[9]=n,e[10]=r,e[11]=s,e[12]=f}else f=e[12];let h;return e[18]!==d||e[19]!==f?(h=c.jsxs("div",{className:"relative flex flex-col gap-4",children:[d,f]}),e[18]=d,e[19]=f,e[20]=h):h=e[20],h}const da="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",Zp=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],mo={price:"R$ 99",anchor:"R$ 499"};function Jp(t){const e=P.c(21),{onOpen:n}=t,r=ie();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-success/10",children:c.jsx(ar,{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=c.jsx("span",{className:"text-sm font-medium text-foreground",children:i}),e[3]=i,e[4]=o):o=e[4];let l;e[5]!==r?(l=r("taskBoard.backlogPaywall.bannerSubtitle"),e[5]=r,e[6]=l):l=e[6];let a;e[7]!==l?(a=c.jsx("span",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=a):a=e[8];let d;e[9]!==o||e[10]!==a?(d=c.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[s,c.jsxs("div",{className:"flex min-w-0 flex-col",children:[o,a]})]}),e[9]=o,e[10]=a,e[11]=d):d=e[11];let f;e[12]!==r?(f=r("taskBoard.backlogPaywall.unlockButton"),e[12]=r,e[13]=f):f=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(nl,{size:16}),e[14]=h):h=e[14];let u;e[15]!==n||e[16]!==f?(u=c.jsxs(Me,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:[f,h]}),e[15]=n,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==d||e[19]!==u?(p=c.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:[d,u]}),e[18]=d,e[19]=u,e[20]=p):p=e[20],p}function eg({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=ie(),[i,o]=w.useState(!1),l=async()=>{if(!n){r();return}o(!0);try{const a=await n.callTool({name:"start_checkout",arguments:{}}),{url:d}=Or(a);if(new URL(d).protocol!=="https:")throw new Error("unsafe checkout url");window.open(d,"_blank","noopener,noreferrer"),e(!1)}catch{r()}finally{o(!1)}};return c.jsx(xs,{open:t,onOpenChange:e,children:c.jsxs(bs,{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:[c.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:c.jsx("img",{src:da,alt:s("taskBoard.backlogPaywall.previewAlt"),className:"h-[208px] w-full object-cover object-left-top"})}),c.jsxs("div",{className:"flex flex-col gap-7 px-3 pb-3 pt-7",children:[c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx(ys,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),c.jsx("ul",{className:"flex flex-col gap-3.5",children:Zp.map(a=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(dn,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(a)})]},a))})]}),c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-2xl font-semibold text-foreground",children:mo.price}),c.jsx("span",{className:"text-sm text-muted-foreground line-through",children:mo.anchor})]}),c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[c.jsx(Me,{variant:"ghost",onClick:()=>e(!1),disabled:i,className:"order-2 w-full sm:order-none sm:w-auto",children:s("taskBoard.backlogPaywall.exploreButton")}),c.jsxs(Me,{onClick:l,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?c.jsx(lr,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&c.jsx(nl,{size:16})]})]})]})]})]})})}function _r(t){return`board-paywall-seen:${t}`}function tg(){const t=P.c(26),{org:e}=Be(),n=_o(),{diagnostic:r,cdClient:s,connectionId:i}=vd();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(_r(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[l,a]=w.useState(o);let d;t[2]!==l.open||t[3]!==l.orgId||t[4]!==e.id?(d=l.orgId===e.id?l.open:!sessionStorage.getItem(_r(e.id)),t[2]=l.open,t[3]=l.orgId,t[4]=e.id,t[5]=d):d=t[5];const f=d;if(!r?.locked)return null;let h;t[6]!==e.id?(h=v=>a({orgId:e.id,open:v}),t[6]=e.id,t[7]=h):h=t[7];const u=h;let p;t[8]!==e.id||t[9]!==u?(p=v=>{u(v),v||sessionStorage.setItem(_r(e.id),"1")},t[8]=e.id,t[9]=u,t[10]=p):p=t[10];const m=p;let b;t[11]!==i||t[12]!==n||t[13]!==e?(b=()=>{Ei("board_paywall_report_opened",{organization_id:e.id}),n(Sd(e,i))},t[11]=i,t[12]=n,t[13]=e,t[14]=b):b=t[14];const y=b;let g;t[15]!==e.id||t[16]!==u?(g=c.jsx(Jp,{onOpen:()=>{Ei("board_paywall_banner_clicked",{organization_id:e.id}),u(!0)}}),t[15]=e.id,t[16]=u,t[17]=g):g=t[17];let x;t[18]!==s||t[19]!==m||t[20]!==f||t[21]!==y?(x=c.jsx(eg,{open:f,onOpenChange:m,cdClient:s,onExpired:y}),t[18]=s,t[19]=m,t[20]=f,t[21]=y,t[22]=x):x=t[22];let k;return t[23]!==g||t[24]!==x?(k=c.jsxs(c.Fragment,{children:[g,x]}),t[23]=g,t[24]=x,t[25]=k):k=t[25],k}function ng(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(Sa,{fallback:null,children:c.jsx(tg,{})}),t[0]=e):e=t[0],e}const sg=["taskBoard.subscriptionPaywall.trialBenefitMonitoring","taskBoard.subscriptionPaywall.trialBenefitAutoFix","taskBoard.subscriptionPaywall.trialBenefitRuns"];function rg(t){const e=P.c(83),{kind:n,onOpenChange:r}=t,s=ie(),{mutate:i,isPending:o}=Ac("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");if(n==="trial_exhausted"){let v;e[0]!==s?(v=s("taskBoard.subscriptionPaywall.previewAlt"),e[0]=s,e[1]=v):v=e[1];let C;e[2]!==v?(C=c.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:c.jsx("img",{src:da,alt:v,className:"h-[160px] w-full object-cover object-left-top"})}),e[2]=v,e[3]=C):C=e[3];let j;e[4]!==s?(j=s("taskBoard.subscriptionPaywall.trialTitle"),e[4]=s,e[5]=j):j=e[5];let S;e[6]!==j?(S=c.jsx(ys,{className:"text-xl font-semibold text-foreground",children:j}),e[6]=j,e[7]=S):S=e[7];let D;e[8]!==s?(D=sg.map(se=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(dn,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(se)})]},se)),e[8]=s,e[9]=D):D=e[9];let N;e[10]!==D?(N=c.jsx("ul",{className:"flex flex-col gap-3",children:D}),e[10]=D,e[11]=N):N=e[11];let R;e[12]!==s?(R=s("taskBoard.subscriptionPaywall.trialPrice"),e[12]=s,e[13]=R):R=e[13];let T;e[14]!==R?(T=c.jsx("span",{className:"text-2xl font-semibold text-foreground",children:R}),e[14]=R,e[15]=T):T=e[15];let E;e[16]!==s?(E=s("taskBoard.subscriptionPaywall.trialPricePeriod"),e[16]=s,e[17]=E):E=e[17];let _;e[18]!==E?(_=c.jsx("span",{className:"text-sm text-muted-foreground",children:E}),e[18]=E,e[19]=_):_=e[19];let O;e[20]!==_||e[21]!==T?(O=c.jsxs("div",{className:"flex items-baseline gap-1.5",children:[T,_]}),e[20]=_,e[21]=T,e[22]=O):O=e[22];let I;e[23]!==r?(I=()=>r(!1),e[23]=r,e[24]=I):I=e[24];let A;e[25]!==s?(A=s("taskBoard.subscriptionPaywall.notNowButton"),e[25]=s,e[26]=A):A=e[26];let B;e[27]!==o||e[28]!==I||e[29]!==A?(B=c.jsx(Me,{variant:"ghost",onClick:I,disabled:o,className:"order-2 w-full sm:order-none sm:w-auto",children:A}),e[27]=o,e[28]=I,e[29]=A,e[30]=B):B=e[30];let $;e[31]!==r||e[32]!==i?($=()=>i(void 0,{onSuccess:()=>r(!1)}),e[31]=r,e[32]=i,e[33]=$):$=e[33];let U;e[34]!==o?(U=o&&c.jsx(lr,{size:16,className:"animate-spin"}),e[34]=o,e[35]=U):U=e[35];let G;e[36]!==s?(G=s("taskBoard.subscriptionPaywall.subscribeButton"),e[36]=s,e[37]=G):G=e[37];let q;e[38]!==o||e[39]!==$||e[40]!==U||e[41]!==G?(q=c.jsxs(Me,{disabled:o,onClick:$,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[U,G]}),e[38]=o,e[39]=$,e[40]=U,e[41]=G,e[42]=q):q=e[42];let F;e[43]!==B||e[44]!==q?(F=c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[B,q]}),e[43]=B,e[44]=q,e[45]=F):F=e[45];let K;e[46]!==O||e[47]!==F?(K=c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[O,F]}),e[46]=O,e[47]=F,e[48]=K):K=e[48];let Q;e[49]!==K||e[50]!==S||e[51]!==N?(Q=c.jsxs("div",{className:"flex flex-col gap-6 px-3 pb-3 pt-7",children:[S,N,K]}),e[49]=K,e[50]=S,e[51]=N,e[52]=Q):Q=e[52];let X;e[53]!==C||e[54]!==Q?(X=c.jsxs(bs,{className:"gap-0 p-3 sm:max-w-[440px]",closeButtonClassName:"z-10 rounded-full bg-background/70 p-1 text-foreground backdrop-blur transition-colors hover:bg-background",children:[C,Q]}),e[53]=C,e[54]=Q,e[55]=X):X=e[55];let H;return e[56]!==r||e[57]!==X?(H=c.jsx(xs,{open:!0,onOpenChange:r,children:X}),e[56]=r,e[57]=X,e[58]=H):H=e[58],H}let l;e[59]!==n||e[60]!==s?(l=n?{monthly_exhausted:{title:s("taskBoard.subscriptionPaywall.monthlyTitle"),description:s("taskBoard.subscriptionPaywall.monthlyDescription")},runs_exhausted:{title:s("taskBoard.subscriptionPaywall.runsTitle"),description:s("taskBoard.subscriptionPaywall.runsDescription")}}[n]:null,e[59]=n,e[60]=s,e[61]=l):l=e[61];const a=l,d=!!n,f=a?.title;let h;e[62]!==f?(h=c.jsx(ys,{children:f}),e[62]=f,e[63]=h):h=e[63];const u=a?.description;let p;e[64]!==u?(p=c.jsx(Lo,{children:u}),e[64]=u,e[65]=p):p=e[65];let m;e[66]!==h||e[67]!==p?(m=c.jsxs(Po,{children:[h,p]}),e[66]=h,e[67]=p,e[68]=m):m=e[68];let b;e[69]!==r?(b=()=>r(!1),e[69]=r,e[70]=b):b=e[70];let y;e[71]!==s?(y=s("taskBoard.subscriptionPaywall.dismissButton"),e[71]=s,e[72]=y):y=e[72];let g;e[73]!==b||e[74]!==y?(g=c.jsx(Fo,{children:c.jsx(Me,{variant:"ghost",onClick:b,children:y})}),e[73]=b,e[74]=y,e[75]=g):g=e[75];let x;e[76]!==g||e[77]!==m?(x=c.jsxs(bs,{className:"sm:max-w-[440px]",children:[m,g]}),e[76]=g,e[77]=m,e[78]=x):x=e[78];let k;return e[79]!==r||e[80]!==x||e[81]!==d?(k=c.jsx(xs,{open:d,onOpenChange:r,children:x}),e[79]=r,e[80]=x,e[81]=d,e[82]=k):k=e[82],k}const xo=380,ig=90,bo=5,og="cubic-bezier(0.22, 0.61, 0.36, 1)";function lg(t,e,n){const r=w.useRef(new Map),s=w.useRef(new Map);w.useLayoutEffect(()=>{const i=t.current;if(!i)return;const o=i.querySelectorAll("[data-flip-id]"),l=new Map,a=r.current;r.current=l;const d=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,f=[];for(const g of o){const x=g.dataset.flipId;if(!x)continue;const k=g.getBoundingClientRect(),v=g.dataset.flipLane;if(l.set(x,{rect:k,lane:v}),!n)continue;const C=a.get(x);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!==v})}if(!n||d||f.length===0)return;const h=s.current,u=g=>{g instanceof HTMLElement&&(h.set(g,(h.get(g)??0)+1),g.style.overflow="visible")},p=g=>{if(!(g instanceof HTMLElement))return;const x=(h.get(g)??1)-1;if(x>0){h.set(g,x);return}h.delete(g),g.style.overflow=""};for(const g of f){const x=g.lane?` rotate(${g.dx>0?bo:-bo}deg)`:"";g.el.style.transition="none",g.el.style.transform=`translate(${g.dx}px, ${g.dy}px)${x}`,g.lane&&(g.el.style.zIndex="10",u(g.el.closest("[data-lane-scroll]")))}let m=0;const b=[],y=requestAnimationFrame(()=>{for(const g of f){const x=g.lane?m++*ig:0;g.el.style.transition=`transform ${xo}ms ${og} ${x}ms`,g.el.style.transform="",b.push(window.setTimeout(()=>{g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&p(g.el.closest("[data-lane-scroll]"))},xo+x+30))}});return()=>{cancelAnimationFrame(y);for(const g of b)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 ag(t,e=[]){const n=[[`# Task: ${t.title}`,t.description?.trim()].filter(Boolean).join(`
72
-
73
- `)];if(e.length>0){const r=e.map(s=>{const i=s.merged?"merged":s.state??(s.draft?"draft":"open"),o=s.title?.trim()||`${s.repoOwner}/${s.repoName}`;return`- #${s.number} ${o} [${i}] ${s.url}`});n.push(["## Linked pull requests",...r].join(`
74
- `))}if(t.threads.length>0){const r=t.threads.map(s=>{const i=s.title?.trim()||"Untitled chat";return s.status?`- ${i} [${s.status}]`:`- ${i}`});n.push(["## Other chats on this task",...r].join(`
75
- `))}return n.join(`
76
-
77
- `)}const Gr="__unassigned__",or={assignee:null,priority:null,due:null};function cg(t){return t.assignee!==null||t.priority!==null||t.due!==null}function dg(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const ug=864e5;function fg(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 hg(t,e){if(e.assignee!==null){if(e.assignee===Gr){if(t.assigneeId!==null)return!1}else if(t.assigneeId!==e.assignee)return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const n=new Date(t.dueDate).getTime(),r=Date.now();if(e.due==="overdue"&&n>=r||e.due==="today"&&!fg(n,r)||e.due==="week"&&(n<r||n>r+7*ug))return!1}return!0}const yo={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function br(t,e=!1){return J("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 pg(t){const e=P.c(95),{value:n,members:r,onChange:s,block:i}=t,o=ie(),[l,a]=w.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Br,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let f=d,h;e[1]!==o?(h=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=h):h=e[2];let u=h;if(n===Gr){let L;e[3]!==o?(L=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=L):L=e[4],u=L}else if(n===qe){let L;e[5]===Symbol.for("react.memo_cache_sentinel")?(L=c.jsx(zt,{size:14}),e[5]=L):L=e[5],f=L;let W;e[6]!==o?(W=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=W):W=e[7],u=W}else if(n){let L,W,Y,te;if(e[8]!==r||e[9]!==n){let ne;e[14]!==n?(ne=de=>de.userId===n,e[14]=n,e[15]=ne):ne=e[15],W=r.find(ne),L=It,Y=W?.user?.image??void 0,te=Et(W?.user?.name),e[8]=r,e[9]=n,e[10]=L,e[11]=W,e[12]=Y,e[13]=te}else L=e[10],W=e[11],Y=e[12],te=e[13];let M;e[16]!==L||e[17]!==Y||e[18]!==te?(M=c.jsx(L,{url:Y,fallback:te,shape:"circle",size:"2xs"}),e[16]=L,e[17]=Y,e[18]=te,e[19]=M):M=e[19],f=M;let Z;e[20]!==W?.user?.name||e[21]!==o?(Z=W?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=W?.user?.name,e[21]=o,e[22]=Z):Z=e[22],u=Z}let p;e[23]!==s?(p=L=>{s(L),a(!1)},e[23]=s,e[24]=p):p=e[24];const m=p,b=n!==null;let y;e[25]!==i||e[26]!==b?(y=br(b,i),e[25]=i,e[26]=b,e[27]=y):y=e[27];const g=y,x=i&&"ml-auto";let k;e[28]!==x?(k=J("shrink-0 opacity-60",x),e[28]=x,e[29]=k):k=e[29];const v=k;let C;e[30]!==u?(C=c.jsx("span",{className:"max-w-[10rem] truncate",children:u}),e[30]=u,e[31]=C):C=e[31];let j;e[32]!==v?(j=c.jsx(ii,{size:12,className:v}),e[32]=v,e[33]=j):j=e[33];let S;e[34]!==f||e[35]!==C||e[36]!==j||e[37]!==g?(S=c.jsx(Vn,{asChild:!0,children:c.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 D;e[39]!==o?(D=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=D):D=e[40];let N;e[41]!==D?(N=c.jsx(ti,{placeholder:D,className:"h-9"}),e[41]=D,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 T;e[45]!==R?(T=c.jsx(ni,{children:R}),e[45]=R,e[46]=T):T=e[46];let E;e[47]!==m?(E=()=>m(null),e[47]=m,e[48]=E):E=e[48];let _;e[49]!==o?(_=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=_):_=e[50];let O;e[51]!==E||e[52]!==_?(O=c.jsx(Gt,{value:"Anyone",onSelect:E,children:_}),e[51]=E,e[52]=_,e[53]=O):O=e[53];let I;e[54]!==m?(I=()=>m(Gr),e[54]=m,e[55]=I):I=e[55];let A;e[56]===Symbol.for("react.memo_cache_sentinel")?(A=c.jsx(Br,{size:16,className:"text-muted-foreground"}),e[56]=A):A=e[56];let B;e[57]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=B):B=e[58];let $;e[59]!==I||e[60]!==B?($=c.jsxs(Gt,{value:"Unassigned",onSelect:I,className:"gap-2",children:[A,B]}),e[59]=I,e[60]=B,e[61]=$):$=e[61];let U;e[62]!==m?(U=()=>m(qe),e[62]=m,e[63]=U):U=e[63];let G;e[64]===Symbol.for("react.memo_cache_sentinel")?(G=c.jsx(zt,{size:16}),e[64]=G):G=e[64];let q;e[65]!==o?(q=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=q):q=e[66];let F;e[67]!==U||e[68]!==q?(F=c.jsxs(Gt,{value:"Super Agent",onSelect:U,className:"gap-2",children:[G,q]}),e[67]=U,e[68]=q,e[69]=F):F=e[69];let K;e[70]!==O||e[71]!==$||e[72]!==F?(K=c.jsxs(Xn,{children:[O,$,F]}),e[70]=O,e[71]=$,e[72]=F,e[73]=K):K=e[73];let Q;e[74]!==o?(Q=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=Q):Q=e[75];let X;if(e[76]!==r||e[77]!==m){let L;e[79]!==m?(L=W=>c.jsxs(Gt,{value:W.user?.name??W.userId,onSelect:()=>m(W.userId),className:"gap-2",children:[c.jsx(It,{url:W.user?.image??void 0,fallback:Et(W.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:W.user?.name??W.userId})]},W.userId),e[79]=m,e[80]=L):L=e[80],X=r.map(L),e[76]=r,e[77]=m,e[78]=X}else X=e[78];let H;e[81]!==Q||e[82]!==X?(H=c.jsx(Xn,{heading:Q,children:X}),e[81]=Q,e[82]=X,e[83]=H):H=e[83];let se;e[84]!==T||e[85]!==K||e[86]!==H?(se=c.jsxs(si,{children:[T,K,H]}),e[84]=T,e[85]=K,e[86]=H,e[87]=se):se=e[87];let ee;e[88]!==N||e[89]!==se?(ee=c.jsx(us,{align:"start",className:"w-56 p-0",children:c.jsxs(ri,{children:[N,se]})}),e[88]=N,e[89]=se,e[90]=ee):ee=e[90];let oe;return e[91]!==l||e[92]!==S||e[93]!==ee?(oe=c.jsxs(fs,{open:l,onOpenChange:a,children:[S,ee]}),e[91]=l,e[92]=S,e[93]=ee,e[94]=oe):oe=e[94],oe}function gg(t){const e=P.c(33),{value:n,onChange:r,block:s}=t,i=ie(),o=n!==null;let l;e[0]!==s||e[1]!==o?(l=br(o,s),e[0]=s,e[1]=o,e[2]=l):l=e[2];const a=l,d=s&&"ml-auto";let f;e[3]!==d?(f=J("shrink-0 opacity-60",d),e[3]=d,e[4]=f):f=e[4];const h=f;let u;e[5]!==n?(u=n?c.jsx("span",{className:J("size-2 shrink-0 rounded-full",Rt[n].dotClassName)}):c.jsx(Fc,{size:14,className:"shrink-0"}),e[5]=n,e[6]=u):u=e[6];let p;e[7]!==i||e[8]!==n?(p=i(n?Rt[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=n,e[9]=p):p=e[9];let m;e[10]!==h?(m=c.jsx(ii,{size:12,className:h}),e[10]=h,e[11]=m):m=e[11];let b;e[12]!==u||e[13]!==p||e[14]!==m||e[15]!==a?(b=c.jsx(sn,{asChild:!0,children:c.jsxs("button",{type:"button",className:a,children:[u,p,m]})}),e[12]=u,e[13]=p,e[14]=m,e[15]=a,e[16]=b):b=e[16];let y;e[17]!==r?(y=()=>r(null),e[17]=r,e[18]=y):y=e[18];let g;e[19]!==i?(g=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==g||e[22]!==y?(x=c.jsx(wt,{onSelect:y,children:g}),e[21]=g,e[22]=y,e[23]=x):x=e[23];let k;e[24]!==r||e[25]!==i?(k=mi.map(j=>c.jsxs(wt,{onSelect:()=>r(j),className:"gap-2",children:[c.jsx("span",{className:J("size-2 rounded-full",Rt[j].dotClassName)}),i(Rt[j].labelKey)]},j)),e[24]=r,e[25]=i,e[26]=k):k=e[26];let v;e[27]!==x||e[28]!==k?(v=c.jsxs(rn,{align:"start",className:"w-40",children:[x,k]}),e[27]=x,e[28]=k,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==b?(C=c.jsxs(on,{children:[b,v]}),e[30]=v,e[31]=b,e[32]=C):C=e[32],C}function mg(t){const e=P.c(35),{value:n,onChange:r,block:s}=t,i=ie();let o;e[0]!==i||e[1]!==n?(o=n?i(yo[n]):void 0,e[0]=i,e[1]=n,e[2]=o):o=e[2];const l=o,a=n!==null;let d;e[3]!==s||e[4]!==a?(d=br(a,s),e[3]=s,e[4]=a,e[5]=d):d=e[5];const f=d,h=s&&"ml-auto";let u;e[6]!==h?(u=J("shrink-0 opacity-60",h),e[6]=h,e[7]=u):u=e[7];const p=u;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Gn,{size:14,className:"shrink-0"}),e[8]=m):m=e[8];let b;e[9]!==l||e[10]!==i?(b=l??i("taskBoard.taskFilters.dueDateLabel"),e[9]=l,e[10]=i,e[11]=b):b=e[11];let y;e[12]!==p?(y=c.jsx(ii,{size:12,className:p}),e[12]=p,e[13]=y):y=e[13];let g;e[14]!==b||e[15]!==y||e[16]!==f?(g=c.jsx(sn,{asChild:!0,children:c.jsxs("button",{type:"button",className:f,children:[m,b,y]})}),e[14]=b,e[15]=y,e[16]=f,e[17]=g):g=e[17];let x;e[18]!==r?(x=()=>r(null),e[18]=r,e[19]=x):x=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Gn,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==i?(v=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=v):v=e[22];let C;e[23]!==x||e[24]!==v?(C=c.jsxs(wt,{onSelect:x,className:"gap-2",children:[k,v]}),e[23]=x,e[24]=v,e[25]=C):C=e[25];let j;e[26]!==r||e[27]!==i?(j=Object.entries(yo).map(N=>{const[R,T]=N,E=R==="overdue";return c.jsxs(wt,{onSelect:()=>r(R),className:J("gap-2",E&&"text-destructive"),children:[c.jsx(Gn,{size:16,className:J("shrink-0",E?"text-destructive":"text-muted-foreground")}),i(T)]},R)}),e[26]=r,e[27]=i,e[28]=j):j=e[28];let S;e[29]!==C||e[30]!==j?(S=c.jsxs(rn,{align:"start",className:"w-44",children:[C,j]}),e[29]=C,e[30]=j,e[31]=S):S=e[31];let D;return e[32]!==S||e[33]!==g?(D=c.jsxs(on,{children:[g,S]}),e[32]=S,e[33]=g,e[34]=D):D=e[34],D}function ua(t){const e=P.c(26),{filters:n,members:r,onChange:s,block:i}=t;let o;e[0]!==n||e[1]!==s?(o=p=>s({...n,assignee:p}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let l;e[3]!==i||e[4]!==n.assignee||e[5]!==r||e[6]!==o?(l=c.jsx(pg,{block:i,value:n.assignee,members:r,onChange:o}),e[3]=i,e[4]=n.assignee,e[5]=r,e[6]=o,e[7]=l):l=e[7];let a;e[8]!==n||e[9]!==s?(a=p=>s({...n,priority:p}),e[8]=n,e[9]=s,e[10]=a):a=e[10];let d;e[11]!==i||e[12]!==n.priority||e[13]!==a?(d=c.jsx(gg,{block:i,value:n.priority,onChange:a}),e[11]=i,e[12]=n.priority,e[13]=a,e[14]=d):d=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 h;e[18]!==i||e[19]!==n.due||e[20]!==f?(h=c.jsx(mg,{block:i,value:n.due,onChange:f}),e[18]=i,e[19]=n.due,e[20]=f,e[21]=h):h=e[21];let u;return e[22]!==l||e[23]!==d||e[24]!==h?(u=c.jsxs(c.Fragment,{children:[l,d,h]}),e[22]=l,e[23]=d,e[24]=h,e[25]=u):u=e[25],u}function xg(t){const e=P.c(12),{filters:n,members:r,onChange:s}=t,i=ie();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(rl,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let l;e[1]!==n||e[2]!==r||e[3]!==s?(l=c.jsx(ua,{filters:n,members:r,onChange:s}),e[1]=n,e[2]=r,e[3]=s,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==s||e[7]!==i?(a=cg(n)&&c.jsx("button",{type:"button",onClick:()=>s(or),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:i("taskBoard.taskFilters.clearButton")}),e[5]=n,e[6]=s,e[7]=i,e[8]=a):a=e[8];let d;return e[9]!==l||e[10]!==a?(d=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,l,a]}),e[9]=l,e[10]=a,e[11]=d):d=e[11],d}function bg(t){const e=P.c(38),{filters:n,members:r,onChange:s}=t,i=ie(),[o,l]=w.useState(!1),a=dg(n),d=a>0;let f;e[0]!==d?(f=br(d),e[0]=d,e[1]=f):f=e[1];const h=f;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx(rl,{size:14,className:"shrink-0"}),e[2]=u):u=e[2];let p;e[3]!==i?(p=i("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=i,e[4]=p):p=e[4];let m;e[5]!==a?(m=a>0&&c.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:a}),e[5]=a,e[6]=m):m=e[6];let b;e[7]!==p||e[8]!==m||e[9]!==h?(b=c.jsx(Oc,{asChild:!0,children:c.jsxs("button",{type:"button",className:h,children:[u,p,m]})}),e[7]=p,e[8]=m,e[9]=h,e[10]=b):b=e[10];let y;e[11]!==i?(y=i("taskBoard.taskFilters.filterDrawerTitle"),e[11]=i,e[12]=y):y=e[12];let g;e[13]!==y?(g=c.jsx($c,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=g):g=e[14];let x;e[15]!==n||e[16]!==r||e[17]!==s?(x=c.jsx("div",{className:"flex flex-col gap-2 p-4",children:c.jsx(ua,{block:!0,filters:n,members:r,onChange:s})}),e[15]=n,e[16]=r,e[17]=s,e[18]=x):x=e[18];let k;e[19]!==a||e[20]!==s||e[21]!==i?(k=a>0&&c.jsx(Me,{variant:"outline",className:"flex-1",onClick:()=>s(or),children:i("taskBoard.taskFilters.clearAllButton")}),e[19]=a,e[20]=s,e[21]=i,e[22]=k):k=e[22];let v;e[23]!==i?(v=i("taskBoard.taskFilters.doneButton"),e[23]=i,e[24]=v):v=e[24];let C;e[25]!==v?(C=c.jsx(Mc,{asChild:!0,children:c.jsx(Me,{className:"flex-1",children:v})}),e[25]=v,e[26]=C):C=e[26];let j;e[27]!==k||e[28]!==C?(j=c.jsxs(zc,{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]!==x?(S=c.jsxs(Lc,{className:"p-0",children:[g,x,j]}),e[30]=j,e[31]=g,e[32]=x,e[33]=S):S=e[33];let D;return e[34]!==o||e[35]!==S||e[36]!==b?(D=c.jsxs(Pc,{open:o,onOpenChange:l,direction:"bottom",children:[b,S]}),e[34]=o,e[35]=S,e[36]=b,e[37]=D):D=e[37],D}ja(()=>import("./index-CFiuX5sg.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,146,147,148])).catch(()=>{});function yg(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:c.jsx("div",{className:"h-full p-0.5 pt-0.25",children:c.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:c.jsx(xa,{})})})}),t[0]=e):e=t[0],e}const kg=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function vg(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:kg.format(e),overdue:n}}const Is="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 fa(){const t=P.c(9),e=ie();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=J(Is,"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=c.jsx(Yr,{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=c.jsxs("span",{className:n,title:r,children:[s,i]}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ha(t){const e=P.c(10),{priority:n}=t,r=ie(),s=Rt[n];let i;e[0]!==s.dotClassName?(i=J("size-2 rounded-full",s.dotClassName),e[0]=s.dotClassName,e[1]=i):i=e[1];let o;e[2]!==i?(o=c.jsx("span",{className:i}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==s.labelKey||e[5]!==r?(l=r(s.labelKey),e[4]=s.labelKey,e[5]=r,e[6]=l):l=e[6];let a;return e[7]!==o||e[8]!==l?(a=c.jsxs("span",{className:Is,children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9],a}function pa(t){const e=P.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:l,overdue:a}=vg(n);r=l,s=J(Is,a&&"border-destructive/30 text-destructive"),e[0]=n,e[1]=r,e[2]=s}else r=e[1],s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Gn,{size:14}),e[3]=i):i=e[3];let o;return e[4]!==r||e[5]!==s?(o=c.jsxs("span",{className:s,children:[i,r]}),e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function ga(t){const e=P.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=Rs(n.color),e[0]=n.color,e[1]=r):r=e[1];let s;e[2]!==r?(s=c.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=c.jsxs("span",{className:Is,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function ma(t){const e=P.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,l=ie(),[a,d]=w.useState(!1);if(n.assigneeId===qe){let x;e[0]!==s||e[1]!==l?(x=s?.user?.name?l("taskBoard.taskBoard.assignedToSuperAgentBy",{name:s.user.name}):l("taskBoard.taskBoard.assignedToSuperAgent"),e[0]=s,e[1]=l,e[2]=x):x=e[2];let k;e[3]!==s?(k=s&&c.jsx(It,{url:s.user?.image??void 0,fallback:Et(s.user?.name),shape:"circle",size:"xs",className:"-mr-2 ring-2 ring-background"}),e[3]=s,e[4]=k):k=e[4];let v;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsx(zt,{size:20,className:"ring-2 ring-background"}),e[5]=v):v=e[5];let C;return e[6]!==x||e[7]!==k?(C=c.jsxs("span",{className:"inline-flex items-center",title:x,children:[k,v]}),e[6]=x,e[7]=k,e[8]=C):C=e[8],C}if(r){const x=r.user?.image??void 0,k=r.user?.name;let v;e[9]!==k?(v=Et(k),e[9]=k,e[10]=v):v=e[10];let C;return e[11]!==x||e[12]!==v?(C=c.jsx(It,{url:x,fallback:v,shape:"circle",size:"xs"}),e[11]=x,e[12]=v,e[13]=C):C=e[13],C}if(!o||!i?.length)return null;let f;e[14]!==l?(f=l("taskBoard.taskBoard.assignButton"),e[14]=l,e[15]=f):f=e[15];let h;e[16]!==l?(h=l("taskBoard.taskBoard.assignButton"),e[16]=l,e[17]=h):h=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=x=>{x.stopPropagation(),d(!0)},e[18]=u):u=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Ao,{size:13}),e[19]=p):p=e[19];let m;e[20]!==f||e[21]!==h?(m=c.jsx(Vn,{asChild:!0,children:c.jsx("button",{type:"button",title:f,"aria-label":h,onClick:u,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]=h,e[22]=m):m=e[22];let b;e[23]!==o?(b=x=>{o(x),d(!1)},e[23]=o,e[24]=b):b=e[24];let y;e[25]!==i||e[26]!==b?(y=c.jsx(us,{className:"w-56 p-0",align:"end",side:"bottom",onClick:wg,children:c.jsx(Ri,{members:i,onSelect:b})}),e[25]=i,e[26]=b,e[27]=y):y=e[27];let g;return e[28]!==a||e[29]!==m||e[30]!==y?(g=c.jsxs(fs,{open:a,onOpenChange:d,children:[m,y]}),e[28]=a,e[29]=m,e[30]=y,e[31]=g):g=e[31],g}function wg(t){return t.stopPropagation()}function xa(){const t=P.c(137),e=ie(),{items:n,isLoading:r}=kf(),s=vf(),i=Ec(),o=Ga({slug:"mcp-github"})??[];let l;t[0]!==o?(l=o.some(Dg),t[0]=o,t[1]=l):l=t[1];const a=l,[d,f]=w.useState(!1),[h,u]=w.useState(!1);let p;t[2]!==a?(p=z=>z===qe&&!a?(f(!0),!0):!1,t[2]=a,t[3]=p):p=t[3];const m=p,[b,y]=w.useState(null);let g;t[4]===Symbol.for("react.memo_cache_sentinel")?(g=z=>{const re=Hc(z);re&&y(re)},t[4]=g):g=t[4];const x=g,{data:k}=Uo();let v,C;t[5]!==k?.data?.members?(v=k?.data?.members??[],C=new Map(v.map(Tg)),t[5]=k?.data?.members,t[6]=v,t[7]=C):(v=t[6],C=t[7]);const j=C,[S,D]=w.useState("board"),[N,R]=w.useState(or);let T;t[8]===Symbol.for("react.memo_cache_sentinel")?(T=new Set,t[8]=T):T=t[8];const[E,_]=w.useState(T);let O;t[9]===Symbol.for("react.memo_cache_sentinel")?(O=z=>_(re=>{const me=new Set(re);return me.has(z)?me.delete(z):me.add(z),me}),t[9]=O):O=t[9];const I=O,A=z=>_(re=>{const me=new Set(re);for(const rt of he)rt.status===z&&me.add(rt.id);return me});let B;t[10]===Symbol.for("react.memo_cache_sentinel")?(B=()=>_(new Set),t[10]=B):B=t[10];const $=B,[U,G]=w.useState(!1),[q,F]=w.useState(null),[K,Q]=w.useState(null),{setTaskId:X}=Uc(),{create:H}=qc(),se=cn(),{org:ee,locator:oe}=Be(),L=_o();let W;t[11]===Symbol.for("react.memo_cache_sentinel")?(W={strict:!1},t[11]=W):W=t[11];const{task:Y}=Ca(W);let te;t[12]!==Y||t[13]!==n?(te=Y?n.find(z=>z.id===Y)??null:null,t[12]=Y,t[13]=n,t[14]=te):te=t[14];const M=te;let Z;t[15]!==Y||t[16]!==L||t[17]!==ee?(Z=()=>{Y&&L({to:"/$org/board",params:{org:ee.slug},search:{},replace:!0})},t[15]=Y,t[16]=L,t[17]=ee,t[18]=Z):Z=t[18];const ne=Z;let de;t[19]!==s||t[20]!==H||t[21]!==oe||t[22]!==ee||t[23]!==X||t[24]!==se?(de=async z=>{const re=crypto.randomUUID(),me=Ka(ee.id).id,rt=await se.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:z.id}).then(jg).catch(Cg),Ot=ag(z,rt),jt={type:"doc",content:[{type:"paragraph",content:[Tc({id:z.id,name:z.title,char:"@",kind:"task",metadata:{title:z.title,description:z.description,context:Ot}}),{type:"text",text:" "}]}]};Gc(sessionStorage,oe,re,jt),G(!1);try{await H({id:re,virtual_mcp_id:me}),await s.link.mutateAsync({id:z.id,linkThreadId:re})}catch{}X(re,me)},t[19]=s,t[20]=H,t[21]=oe,t[22]=ee,t[23]=X,t[24]=se,t[25]=de):de=t[25];const ve=de;let Re;t[26]!==N?(Re=z=>hg(z,N),t[26]=N,t[27]=Re):Re=t[27];const he=n.filter(Re);let Ee;t[28]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>{F(null),Q(null),G(!0)},t[28]=Ee):Ee=t[28];const Ye=Ee;let Ct;t[29]===Symbol.for("react.memo_cache_sentinel")?(Ct=z=>{F(null),Q(z),G(!0)},t[29]=Ct):Ct=t[29];const _t=Ct;let ze;t[30]===Symbol.for("react.memo_cache_sentinel")?(ze=z=>{F(z),G(!0)},t[30]=ze):ze=t[30];const Te=ze;let Ze;t[31]!==M||t[32]!==q||t[33]!==n?(Ze=(q&&n.find(z=>z.id===q.id))??q??M,t[31]=M,t[32]=q,t[33]=n,t[34]=Ze):Ze=t[34];const ce=Ze,at=U||!!M;let ue;t[35]!==ne?(ue=()=>{G(!1),F(null),Q(null),ne()},t[35]=ne,t[36]=ue):ue=t[36];const we=ue;if(r&&n.length===0){let z;return t[37]===Symbol.for("react.memo_cache_sentinel")?(z=c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(lr,{size:20,className:"animate-spin text-muted-foreground"})}),t[37]=z):z=t[37],z}const Ft="relative flex min-h-0 flex-1 flex-col";let Je;t[38]!==e?(Je=e("taskBoard.taskBoard.tasksTitle"),t[38]=e,t[39]=Je):Je=t[39];let He;t[40]!==Je?(He=c.jsx("h1",{className:"text-xl font-medium text-foreground",children:Je}),t[40]=Je,t[41]=He):He=t[41];let Ue;t[42]!==i?(Ue=i&&c.jsx(ng,{}),t[42]=i,t[43]=Ue):Ue=t[43];let et;t[44]!==N||t[45]!==n.length||t[46]!==v?(et=n.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sm:hidden",children:c.jsx(bg,{filters:N,members:v,onChange:R})}),c.jsx("div",{className:"hidden sm:block",children:c.jsx(xg,{filters:N,members:v,onChange:R})})]}),t[44]=N,t[45]=n.length,t[46]=v,t[47]=et):et=t[47];const dt=S==="list";let tt;t[48]!==$?(tt=()=>{D("list"),$()},t[48]=$,t[49]=tt):tt=t[49];let nt;t[50]!==e?(nt=e("common.taskBoard.listView"),t[50]=e,t[51]=nt):nt=t[51];let st;t[52]!==dt||t[53]!==tt||t[54]!==nt?(st=c.jsx(ko,{active:dt,onClick:tt,icon:Oo,label:nt}),t[52]=dt,t[53]=tt,t[54]=nt,t[55]=st):st=t[55];const be=S==="board";let Se;t[56]===Symbol.for("react.memo_cache_sentinel")?(Se=()=>D("board"),t[56]=Se):Se=t[56];let ye;t[57]!==e?(ye=e("common.taskBoard.boardView"),t[57]=e,t[58]=ye):ye=t[58];let Ie;t[59]!==be||t[60]!==ye?(Ie=c.jsx(ko,{active:be,onClick:Se,icon:Ma,label:ye}),t[59]=be,t[60]=ye,t[61]=Ie):Ie=t[61];let ge;t[62]!==st||t[63]!==Ie?(ge=c.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[st,Ie]}),t[62]=st,t[63]=Ie,t[64]=ge):ge=t[64];let ke;t[65]===Symbol.for("react.memo_cache_sentinel")?(ke=c.jsx(ms,{size:16}),t[65]=ke):ke=t[65];let De;t[66]!==e?(De=e("taskBoard.taskBoard.newTask"),t[66]=e,t[67]=De):De=t[67];let _e;t[68]!==De?(_e=c.jsxs(Me,{size:"sm",onClick:Ye,children:[ke,De]}),t[68]=De,t[69]=_e):_e=t[69];let fe;t[70]!==ge||t[71]!==_e?(fe=c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[ge,_e]}),t[70]=ge,t[71]=_e,t[72]=fe):fe=t[72];let Ae;t[73]!==et||t[74]!==fe?(Ae=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[et,fe]}),t[73]=et,t[74]=fe,t[75]=Ae):Ae=t[75];let Ne;t[76]!==He||t[77]!==Ue||t[78]!==Ae?(Ne=c.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:[He,Ue,Ae]}),t[76]=He,t[77]=Ue,t[78]=Ae,t[79]=Ne):Ne=t[79];const $e=n.length===0?c.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:c.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")})}):he.length===0?c.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:c.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"),c.jsx(Me,{variant:"outline",size:"sm",onClick:()=>R(or),children:e("taskBoard.taskBoard.clearFilters")})]})}):S==="board"?c.jsx(Eg,{items:he,members:v,memberByUserId:j,selectedIds:E,onToggleSelect:I,onSelectAllInLane:A,onOpen:Te,onCreate:_t,onMove:(z,re,me)=>{const rt=Bl(me,z.length);z.forEach((Ot,jt)=>s.update.mutate({id:Ot,status:re,sortOrder:rt[jt]}))},onAssign:(z,re)=>{m(re)||s.update.mutate({id:z,assigneeId:re},{onError:x})},onAutoFix:z=>{m(qe)||s.update.mutate({id:z.id,assigneeId:qe},{onError:x})}}):c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-6 pb-16 sm:px-8",children:c.jsx("div",{className:"mx-auto flex max-w-[820px] flex-col gap-2",children:he.map(z=>c.jsx(Lg,{item:z,assignee:z.assigneeId?j.get(z.assigneeId):void 0,assignedBy:z.assignedBy?j.get(z.assignedBy):void 0,onOpen:()=>Te(z)},z.id))})}),ut=at?ce?.id??`new-${K??"default"}`:"closed",Ve=ce??void 0,Le=K??void 0,Ge=s.create.isPending||s.update.isPending;let We;t[80]!==s.create||t[81]!==s.update||t[82]!==ce||t[83]!==m||t[84]!==we?(We=z=>{if(m(z.assigneeId)){we();return}if(ce){const{title:re,description:me,priority:rt,...Ot}=z,jt=qo(ce)?{}:{title:re,description:me,priority:rt};s.update.mutate({id:ce.id,...Ot,...jt},{onError:x})}else s.create.mutate(z);we()},t[80]=s.create,t[81]=s.update,t[82]=ce,t[83]=m,t[84]=we,t[85]=We):We=t[85];let ft;t[86]!==s.remove||t[87]!==ce||t[88]!==we?(ft=ce?()=>{s.remove.mutate(ce.id),we()}:void 0,t[86]=s.remove,t[87]=ce,t[88]=we,t[89]=ft):ft=t[89];let ht;t[90]!==ce||t[91]!==ve?(ht=ce?()=>{ve(ce)}:void 0,t[90]=ce,t[91]=ve,t[92]=ht):ht=t[92];let pt;t[93]!==s.update||t[94]!==ce||t[95]!==m||t[96]!==we?(pt=ce?()=>{m(qe)||(s.update.mutate({id:ce.id,assigneeId:qe},{onError:x}),we())}:void 0,t[93]=s.update,t[94]=ce,t[95]=m,t[96]=we,t[97]=pt):pt=t[97];let gt;t[98]!==we||t[99]!==X?(gt=z=>{z.virtualMcpId&&(we(),X(z.threadId,z.virtualMcpId,{main:z.hasPreview?"preview":"board"}))},t[98]=we,t[99]=X,t[100]=gt):gt=t[100];let mt;t[101]!==we||t[102]!==at||t[103]!==ut||t[104]!==Ve||t[105]!==Le||t[106]!==Ge||t[107]!==We||t[108]!==ft||t[109]!==ht||t[110]!==pt||t[111]!==gt?(mt=c.jsx(Tp,{open:at,onClose:we,item:Ve,defaultStatus:Le,isSaving:Ge,onSubmit:We,onDelete:ft,onNewChat:ht,onAutoFix:pt,onOpenThread:gt},ut),t[101]=we,t[102]=at,t[103]=ut,t[104]=Ve,t[105]=Le,t[106]=Ge,t[107]=We,t[108]=ft,t[109]=ht,t[110]=pt,t[111]=gt,t[112]=mt):mt=t[112];let At;t[113]===Symbol.for("react.memo_cache_sentinel")?(At=()=>u(!0),t[113]=At):At=t[113];let xt;t[114]!==d?(xt=c.jsx(Ng,{open:d,onOpenChange:f,onConnected:At}),t[114]=d,t[115]=xt):xt=t[115];let bt;t[116]!==h?(bt=c.jsx(Wa,{mode:"connection",open:h,onOpenChange:u}),t[116]=h,t[117]=bt):bt=t[117];let Qt;t[118]===Symbol.for("react.memo_cache_sentinel")?(Qt=z=>!z&&y(null),t[118]=Qt):Qt=t[118];let yt;t[119]!==b?(yt=c.jsx(rg,{kind:b,onOpenChange:Qt}),t[119]=b,t[120]=yt):yt=t[120];let kt;t[121]!==s.removeMany||t[122]!==s.update||t[123]!==m||t[124]!==$||t[125]!==n||t[126]!==v||t[127]!==E?(kt=E.size>0&&c.jsx(Rg,{count:E.size,members:v,onMoveTo:z=>{for(const re of E)s.update.mutate({id:re,status:z});$()},onSetPriority:z=>{for(const re of E)s.update.mutate({id:re,priority:z});$()},onAddTag:z=>{for(const re of E){const me=n.find(Ot=>Ot.id===re);if(!me)continue;const rt=me.tags.map(Sg);rt.includes(z)||s.update.mutate({id:re,tagIds:[...rt,z]})}$()},onAssign:z=>{if(!m(z)){for(const re of E)s.update.mutate({id:re,assigneeId:z},{onError:x});$()}},onSetDueDate:z=>{const re=Wr(z);for(const me of E)s.update.mutate({id:me,dueDate:re});$()},onAutoFix:E.size>0&&Array.from(E).every(z=>{const re=n.find(me=>me.id===z);return re&&(re.status==="triage"||re.status==="todo")&&re.assigneeId!==qe})?()=>{if(!m(qe)){for(const z of E)s.update.mutate({id:z,assigneeId:qe},{onError:x});$()}}:void 0,onDelete:()=>{s.removeMany.mutate(Array.from(E)),$()},onClear:$}),t[121]=s.removeMany,t[122]=s.update,t[123]=m,t[124]=$,t[125]=n,t[126]=v,t[127]=E,t[128]=kt):kt=t[128];let Bt;return t[129]!==Ne||t[130]!==$e||t[131]!==mt||t[132]!==xt||t[133]!==bt||t[134]!==yt||t[135]!==kt?(Bt=c.jsxs("div",{className:Ft,children:[Ne,$e,mt,xt,bt,yt,kt]}),t[129]=Ne,t[130]=$e,t[131]=mt,t[132]=xt,t[133]=bt,t[134]=yt,t[135]=kt,t[136]=Bt):Bt=t[136],Bt}function Sg(t){return t.id}function Cg(){return[]}function jg(t){return t.prs}function Tg(t){return[t.userId,t]}function Dg(t){return t.status==="active"&&Qa(t)!==null}function Ng(t){const e=P.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=ie(),{connect:o,isConnecting:l}=Ju("deco/mcp-github");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx("div",{className:"flex h-28 items-center justify-center bg-gradient-to-br from-muted via-muted to-accent",children:c.jsx("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-foreground text-background shadow-sm",children:c.jsx(Ar,{className:"size-7"})})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=i("taskBoard.taskBoard.connectGithubTitle"),e[1]=i,e[2]=d):d=e[2];let f;e[3]!==d?(f=c.jsx(ys,{children:d}),e[3]=d,e[4]=f):f=e[4];let h;e[5]!==i?(h=i("taskBoard.taskBoard.connectGithubDescription"),e[5]=i,e[6]=h):h=e[6];let u;e[7]!==h?(u=c.jsx(Lo,{children:h}),e[7]=h,e[8]=u):u=e[8];let p;e[9]!==f||e[10]!==u?(p=c.jsxs(Po,{children:[f,u]}),e[9]=f,e[10]=u,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 b;e[16]!==l?(b=l?c.jsx(lr,{size:16,className:"animate-spin"}):c.jsx(Ar,{className:"size-4"}),e[16]=l,e[17]=b):b=e[17];let y;e[18]!==i?(y=i("taskBoard.taskBoard.connectGithubButton"),e[18]=i,e[19]=y):y=e[19];let g;e[20]!==l||e[21]!==m||e[22]!==b||e[23]!==y?(g=c.jsx(Fo,{children:c.jsxs(Me,{onClick:m,disabled:l,className:"gap-2",children:[b,y]})}),e[20]=l,e[21]=m,e[22]=b,e[23]=y,e[24]=g):g=e[24];let x;e[25]!==g||e[26]!==p?(x=c.jsxs(bs,{className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[a,c.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[p,g]})]}),e[25]=g,e[26]=p,e[27]=x):x=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==x?(k=c.jsx(xs,{open:n,onOpenChange:r,children:x}),e[28]=r,e[29]=n,e[30]=x,e[31]=k):k=e[31],k}function Rg(t){const e=P.c(91),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:l,onSetDueDate:a,onAutoFix:d,onDelete:f,onClear:h}=t,u=ie(),{data:p}=Ko();let m;e[0]!==p?(m=p===void 0?[]:p,e[0]=p,e[1]=m):m=e[1];const b=m;let y;e[2]!==n||e[3]!==u?(y=u("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=u,e[4]=y):y=e[4];let g;e[5]!==y?(g=c.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:y}),e[5]=y,e[6]=g):g=e[6];let x;e[7]!==u?(x=u("taskBoard.taskBoard.actionsButton"),e[7]=u,e[8]=x):x=e[8];let k;e[9]!==x?(k=c.jsx(sn,{asChild:!0,children:c.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:x})}),e[9]=x,e[10]=k):k=e[10];let v;e[11]!==u?(v=u("taskBoard.taskBoard.moveToButton"),e[11]=u,e[12]=v):v=e[12];let C;e[13]!==v?(C=c.jsx(ns,{children:v}),e[13]=v,e[14]=C):C=e[14];let j;e[15]!==s||e[16]!==u?(j=tr.map(M=>c.jsx(wt,{onClick:()=>s(M),children:u(Nt[M].labelKey)},M)),e[15]=s,e[16]=u,e[17]=j):j=e[17];let S;e[18]!==j?(S=c.jsx(ss,{children:j}),e[18]=j,e[19]=S):S=e[19];let D;e[20]!==S||e[21]!==C?(D=c.jsxs(ts,{children:[C,S]}),e[20]=S,e[21]=C,e[22]=D):D=e[22];let N;e[23]!==u?(N=u("taskBoard.taskBoard.changePriorityButton"),e[23]=u,e[24]=N):N=e[24];let R;e[25]!==N?(R=c.jsx(ns,{children:N}),e[25]=N,e[26]=R):R=e[26];let T;e[27]!==i||e[28]!==u?(T=mi.map(M=>c.jsxs(wt,{onClick:()=>i(M),children:[c.jsx("span",{className:J("size-2 rounded-full",Rt[M].dotClassName)}),u(Rt[M].labelKey)]},M)),e[27]=i,e[28]=u,e[29]=T):T=e[29];let E;e[30]!==T?(E=c.jsx(ss,{children:T}),e[30]=T,e[31]=E):E=e[31];let _;e[32]!==R||e[33]!==E?(_=c.jsxs(ts,{children:[R,E]}),e[32]=R,e[33]=E,e[34]=_):_=e[34];let O;e[35]!==u?(O=u("taskBoard.taskBoard.assignButton"),e[35]=u,e[36]=O):O=e[36];let I;e[37]!==O?(I=c.jsx(ns,{children:O}),e[37]=O,e[38]=I):I=e[38];let A;e[39]!==r||e[40]!==l?(A=c.jsx(ss,{className:"w-56 p-0",children:c.jsx(Ri,{members:r,onSelect:l})}),e[39]=r,e[40]=l,e[41]=A):A=e[41];let B;e[42]!==I||e[43]!==A?(B=c.jsxs(ts,{children:[I,A]}),e[42]=I,e[43]=A,e[44]=B):B=e[44];let $;e[45]!==u?($=u("taskBoard.taskBoard.dueDateButton"),e[45]=u,e[46]=$):$=e[46];let U;e[47]!==$?(U=c.jsx(ns,{children:$}),e[47]=$,e[48]=U):U=e[48];let G;e[49]!==a?(G=c.jsx(ss,{className:"w-auto p-0",children:c.jsx(Zo,{mode:"single",onSelect:M=>M&&a(M),initialFocus:!0})}),e[49]=a,e[50]=G):G=e[50];let q;e[51]!==U||e[52]!==G?(q=c.jsxs(ts,{children:[U,G]}),e[51]=U,e[52]=G,e[53]=q):q=e[53];let F;e[54]!==o||e[55]!==b||e[56]!==u?(F=b.length>0&&c.jsxs(ts,{children:[c.jsx(ns,{children:u("taskBoard.taskBoard.addTagButton")}),c.jsx(ss,{children:b.map(M=>c.jsxs(wt,{onClick:()=>o(M.id),children:[c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:Rs(M.color)}}),M.name]},M.id))})]}),e[54]=o,e[55]=b,e[56]=u,e[57]=F):F=e[57];let K;e[58]===Symbol.for("react.memo_cache_sentinel")?(K=c.jsx($o,{}),e[58]=K):K=e[58];let Q;e[59]!==u?(Q=u("taskBoard.taskBoard.deleteSelectedButton"),e[59]=u,e[60]=Q):Q=e[60];let X;e[61]!==f||e[62]!==Q?(X=c.jsx(wt,{variant:"destructive",onClick:f,children:Q}),e[61]=f,e[62]=Q,e[63]=X):X=e[63];let H;e[64]!==D||e[65]!==_||e[66]!==B||e[67]!==q||e[68]!==F||e[69]!==X?(H=c.jsxs(rn,{align:"center",side:"top",children:[D,_,B,q,F,K,X]}),e[64]=D,e[65]=_,e[66]=B,e[67]=q,e[68]=F,e[69]=X,e[70]=H):H=e[70];let se;e[71]!==H||e[72]!==k?(se=c.jsxs(on,{children:[k,H]}),e[71]=H,e[72]=k,e[73]=se):se=e[73];let ee;e[74]!==d||e[75]!==u?(ee=d&&c.jsxs("button",{type:"button",onClick:d,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:[c.jsx(ar,{size:14}),u("taskBoard.taskBoard.autoFix")]}),e[74]=d,e[75]=u,e[76]=ee):ee=e[76];let oe;e[77]!==u?(oe=u("taskBoard.taskBoard.clearSelectionButton"),e[77]=u,e[78]=oe):oe=e[78];let L;e[79]!==u?(L=u("taskBoard.taskBoard.clearSelectionButton"),e[79]=u,e[80]=L):L=e[80];let W;e[81]===Symbol.for("react.memo_cache_sentinel")?(W=c.jsx(nn,{size:16}),e[81]=W):W=e[81];let Y;e[82]!==h||e[83]!==oe||e[84]!==L?(Y=c.jsx("button",{type:"button","aria-label":oe,title:L,onClick:h,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:W}),e[82]=h,e[83]=oe,e[84]=L,e[85]=Y):Y=e[85];let te;return e[86]!==se||e[87]!==ee||e[88]!==Y||e[89]!==g?(te=c.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 z-20 flex justify-center",children:c.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 rounded-full bg-background px-3 py-2 card-shadow",children:[g,se,ee,Y]})}),e[86]=se,e[87]=ee,e[88]=Y,e[89]=g,e[90]=te):te=e[90],te}function ko(t){const e=P.c(14),{active:n,onClick:r,icon:s,label:i}=t,o=ie();let l;e[0]!==i||e[1]!==o?(l=o("taskBoard.taskBoard.layoutViewAriaLabel",{label:i}),e[0]=i,e[1]=o,e[2]=l):l=e[2];const a=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let d;e[3]!==a?(d=J("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",a),e[3]=a,e[4]=d):d=e[4];let f;e[5]!==s?(f=c.jsx(s,{size:14}),e[5]=s,e[6]=f):f=e[6];let h;return e[7]!==n||e[8]!==i||e[9]!==r||e[10]!==l||e[11]!==d||e[12]!==f?(h=c.jsxs("button",{type:"button",onClick:r,"aria-label":l,"aria-pressed":n,className:d,children:[f,i]}),e[7]=n,e[8]=i,e[9]=r,e[10]=l,e[11]=d,e[12]=f,e[13]=h):h=e[13],h}const ds="lane:";function vo(t,e){return t.sortOrder-e.sortOrder}function Eg(t){const e=P.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onMove:f,onAutoFix:h,onAssign:u}=t,[p,m]=w.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],e[0]=b):b=e[0];const[y,g]=w.useState(b);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=new Map,e[1]=x):x=e[1];const[k,v]=w.useState(x),C=w.useRef(null),j=k.size>0?n.map(M=>{const Z=k.get(M.id);return Z?{...M,...Z}:M}):n;if(k.size>0&&!p){const M=[...k].filter(Z=>{const[ne,de]=Z,ve=n.find(Re=>Re.id===ne);return ve?.status===de.status&&ve.sortOrder===de.sortOrder});M.length>0&&v(Z=>{const ne=new Map(Z);for(const[de]of M)ne.delete(de);return ne})}lg(C,j.map(Bg).join(","),p===null);const S=M=>j.filter(Z=>Z.status===M).sort(vo),D=M=>{if(M===void 0)return null;const Z=String(M);if(Z.startsWith(ds)){const ne=Z.slice(ds.length);return tr.find(de=>de===ne)??null}return j.find(ne=>ne.id===Z)?.status??null};let N;e[2]!==i?(N=M=>i.has(M)&&i.size>1?[M,...Array.from(i).filter(Z=>Z!==M)]:[M],e[2]=i,e[3]=N):N=e[3];const R=N;let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T=(M,Z,ne)=>{const de=Bl(ne,M.length);v(ve=>{const Re=new Map(ve);return M.forEach((he,Ee)=>Re.set(he,{status:Z,sortOrder:de[Ee]})),Re})},e[4]=T):T=e[4];const E=T;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_={activationConstraint:{distance:4}},e[5]=_):_=e[5];let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:xf},e[6]=O):O=e[6];const I=zd(Oi(fi,_),Oi(di,O)),A=M=>{const Z=String(M.active.id),ne=D(M.over?.id),de=j.find(Ee=>Ee.id===Z);if(!ne||!de||de.status===ne)return;const ve=R(Z),Re=String(M.over?.id??""),he=S(ne).filter(Ee=>!ve.includes(Ee.id));E(ve,ne,Xi(he,Re.startsWith(ds)?null:Re,Z))},B=M=>{const Z=String(M.active.id);m(null);const ne=D(M.over?.id)??j.find(Oe=>Oe.id===Z)?.status;if(!ne){v(new Map);return}const de=R(Z),ve=S(ne),Re=String(M.over?.id??""),he=ve.findIndex(Oe=>Oe.id===Z),Ee=Re.startsWith(ds)?ve.length-1:ve.findIndex(Oe=>Oe.id===Re),Ye=he===-1||Ee===-1?ve:pi(ve,he,Ee);if(n.filter(Oe=>Oe.status===ne).sort(vo).map(Ag).join()===Ye.map(_g).join()){v(new Map);return}const _t=Ye.slice(Ye.findIndex(Oe=>Oe.id===Z)+1).find(Oe=>!de.includes(Oe.id)),ze=Xi(ve.filter(Oe=>!de.includes(Oe.id)),_t?.id??null,Z);E(de,ne,ze),g(de),f(de,ne,ze)},$=p?j.find(M=>M.id===p):null;let U;e[7]!==p||e[8]!==R?(U=p?R(p):[],e[7]=p,e[8]=R,e[9]=U):U=e[9];const G=U,q=Bu,F=ul;let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=M=>{m(String(M.active.id)),g([])},e[10]=K):K=e[10];let Q;e[11]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(null),v(new Map)},e[11]=Q):Q=e[11];const X=tr.map(M=>c.jsx(Og,{status:M,items:S(M),members:r,memberByUserId:s,selectedIds:i,isTarget:$?.status===M,hiddenIds:G,landedIds:y,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onAutoFix:h,onAssign:u},M));let H;e[12]!==X?(H=c.jsx("div",{ref:C,className:"min-h-0 flex-1 overflow-x-auto",children:c.jsx("div",{className:"mx-auto flex h-full w-full max-w-[1680px] gap-3 px-4 pt-6 sm:px-8",children:X})}),e[12]=X,e[13]=H):H=e[13];const se=Yt.createPortal,ee=Zu,oe=null,L=$&&c.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[c.jsx(ba,{item:$,assignee:$.assigneeId?s.get($.assigneeId):void 0,assignedBy:$.assignedBy?s.get($.assignedBy):void 0,selected:i.has($.id),onOpen:Ig,className:"w-full shadow-lg"}),G.length>1&&c.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:G.length})]});let W;e[14]!==ee||e[15]!==L?(W=c.jsx(ee,{dropAnimation:oe,children:L}),e[14]=ee,e[15]=L,e[16]=W):W=e[16];let Y;e[17]!==se||e[18]!==W?(Y=se(W,document.body),e[17]=se,e[18]=W,e[19]=Y):Y=e[19];let te;return e[20]!==q||e[21]!==B||e[22]!==A||e[23]!==I||e[24]!==Q||e[25]!==H||e[26]!==Y||e[27]!==F||e[28]!==K?(te=c.jsxs(q,{sensors:I,collisionDetection:F,onDragStart:K,onDragOver:A,onDragEnd:B,onDragCancel:Q,children:[H,Y]}),e[20]=q,e[21]=B,e[22]=A,e[23]=I,e[24]=Q,e[25]=H,e[26]=Y,e[27]=F,e[28]=K,e[29]=te):te=e[29],te}function Ig(){}function _g(t){return t.id}function Ag(t){return t.id}function Bg(t){return`${t.id}:${t.status}`}function Og(t){const e=P.c(91),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:l,hiddenIds:a,landedIds:d,onToggleSelect:f,onSelectAllInLane:h,onOpen:u,onCreate:p,onAutoFix:m,onAssign:b}=t,y=ie(),g=Nt[n],x=g.icon,k=`${ds}${n}`;let v;e[0]!==k?(v={id:k},e[0]=k,e[1]=v):v=e[1];const{setNodeRef:C}=Nl(v),j=l&&"bg-muted/50";let S;e[2]!==j?(S=J("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 D=l?"bg-muted":"bg-background";let N;e[4]!==D?(N=J("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",D),e[4]=D,e[5]=N):N=e[5];let R;e[6]!==g.iconClassName?(R=J("shrink-0",g.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=g.iconClassName,e[7]=R):R=e[7];let T;e[8]!==x||e[9]!==R?(T=c.jsx(x,{size:15,className:R}),e[8]=x,e[9]=R,e[10]=T):T=e[10];let E;e[11]!==g.labelKey||e[12]!==y?(E=y(g.labelKey),e[11]=g.labelKey,e[12]=y,e[13]=E):E=e[13];let _;e[14]!==E?(_=c.jsx("span",{className:"text-sm font-medium text-foreground",children:E}),e[14]=E,e[15]=_):_=e[15];let O;e[16]!==r.length?(O=c.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]=O):O=e[17];let I;e[18]!==g.labelKey||e[19]!==y?(I=y("taskBoard.taskBoard.laneMenuAriaLabel",{lane:y(g.labelKey)}),e[18]=g.labelKey,e[19]=y,e[20]=I):I=e[20];let A;e[21]===Symbol.for("react.memo_cache_sentinel")?(A=c.jsx(Xr,{size:15}),e[21]=A):A=e[21];let B;e[22]!==I?(B=c.jsx(sn,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":I,className:"ml-auto flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:A})}),e[22]=I,e[23]=B):B=e[23];let $;e[24]!==h||e[25]!==n?($=()=>h(n),e[24]=h,e[25]=n,e[26]=$):$=e[26];let U;e[27]!==y?(U=y("taskBoard.taskBoard.selectAllInLane"),e[27]=y,e[28]=U):U=e[28];let G;e[29]!==$||e[30]!==U?(G=c.jsx(rn,{align:"end",children:c.jsx(wt,{onClick:$,children:U})}),e[29]=$,e[30]=U,e[31]=G):G=e[31];let q;e[32]!==B||e[33]!==G?(q=c.jsxs(on,{children:[B,G]}),e[32]=B,e[33]=G,e[34]=q):q=e[34];let F;e[35]!==g.labelKey||e[36]!==y?(F=y("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:y(g.labelKey)}),e[35]=g.labelKey,e[36]=y,e[37]=F):F=e[37];let K;e[38]!==g.labelKey||e[39]!==y?(K=y("taskBoard.taskBoard.newTaskInLaneTitle",{lane:y(g.labelKey)}),e[38]=g.labelKey,e[39]=y,e[40]=K):K=e[40];let Q;e[41]!==p||e[42]!==n?(Q=()=>p(n),e[41]=p,e[42]=n,e[43]=Q):Q=e[43];let X;e[44]===Symbol.for("react.memo_cache_sentinel")?(X=c.jsx(ms,{size:15}),e[44]=X):X=e[44];let H;e[45]!==F||e[46]!==K||e[47]!==Q?(H=c.jsx("button",{type:"button","aria-label":F,title:K,onClick:Q,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:X}),e[45]=F,e[46]=K,e[47]=Q,e[48]=H):H=e[48];let se;e[49]!==_||e[50]!==O||e[51]!==q||e[52]!==H||e[53]!==N||e[54]!==T?(se=c.jsxs("div",{className:N,children:[T,_,O,q,H]}),e[49]=_,e[50]=O,e[51]=q,e[52]=H,e[53]=N,e[54]=T,e[55]=se):se=e[55];let ee;e[56]!==r?(ee=r.map($g),e[56]=r,e[57]=ee):ee=e[57];let oe;if(e[58]!==a||e[59]!==r||e[60]!==d||e[61]!==i||e[62]!==s||e[63]!==b||e[64]!==m||e[65]!==u||e[66]!==f||e[67]!==o){let te;e[69]!==a||e[70]!==d||e[71]!==i||e[72]!==s||e[73]!==b||e[74]!==m||e[75]!==u||e[76]!==f||e[77]!==o?(te=M=>c.jsx(Mg,{item:M,assignee:M.assigneeId?i.get(M.assigneeId):void 0,assignedBy:M.assignedBy?i.get(M.assignedBy):void 0,members:s,selected:o.has(M.id),hidden:a.includes(M.id),landed:d.includes(M.id),onToggleSelect:()=>f(M.id),onOpen:()=>u(M),onAutoFix:m?()=>m(M):void 0,onAssign:b?Z=>b(M.id,Z):void 0},M.id),e[69]=a,e[70]=d,e[71]=i,e[72]=s,e[73]=b,e[74]=m,e[75]=u,e[76]=f,e[77]=o,e[78]=te):te=e[78],oe=r.map(te),e[58]=a,e[59]=r,e[60]=d,e[61]=i,e[62]=s,e[63]=b,e[64]=m,e[65]=u,e[66]=f,e[67]=o,e[68]=oe}else oe=e[68];let L;e[79]!==ee||e[80]!==oe?(L=c.jsx(lf,{items:ee,strategy:rf,children:oe}),e[79]=ee,e[80]=oe,e[81]=L):L=e[81];let W;e[82]!==C||e[83]!==n||e[84]!==L?(W=c.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:L}),e[82]=C,e[83]=n,e[84]=L,e[85]=W):W=e[85];let Y;return e[86]!==n||e[87]!==se||e[88]!==W||e[89]!==S?(Y=c.jsxs("div",{"data-lane":n,className:S,children:[se,W]}),e[86]=n,e[87]=se,e[88]=W,e[89]=S,e[90]=Y):Y=e[90],Y}function $g(t){return t.id}function Mg(t){const e=P.c(29);let n,r,s,i;e[0]!==t?({item:r,hidden:n,landed:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=s,e[4]=i):(n=e[1],r=e[2],s=e[3],i=e[4]);let o;e[5]!==r.id?(o={id:r.id},e[5]=r.id,e[6]=o):o=e[6];const{attributes:l,listeners:a,setNodeRef:d,transform:f,transition:h,isDragging:u}=pf(o),p=r.id,m=r.status;let b;e[7]!==l||e[8]!==a?(b={attributes:l,listeners:a},e[7]=l,e[8]=a,e[9]=b):b=e[9];const y=s&&"animate-card-land";let g;e[10]!==y?(g=J("w-full",y),e[10]=y,e[11]=g):g=e[11];let x;e[12]!==f?(x=Jt.Translate.toString(f),e[12]=f,e[13]=x):x=e[13];const k=u||n?0:void 0;let v;e[14]!==x||e[15]!==k||e[16]!==h?(v={transform:x,transition:h,opacity:k},e[14]=x,e[15]=k,e[16]=h,e[17]=v):v=e[17];let C;e[18]!==r||e[19]!==i||e[20]!==d||e[21]!==b||e[22]!==g||e[23]!==v?(C=c.jsx(ba,{...i,item:r,dragRef:d,bindings:b,className:g,style:v}),e[18]=r,e[19]=i,e[20]=d,e[21]=b,e[22]=g,e[23]=v,e[24]=C):C=e[24];let j;return e[25]!==r.id||e[26]!==r.status||e[27]!==C?(j=c.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 ba(t){const e=P.c(43),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:l,dragRef:a,bindings:d,style:f,onToggleSelect:h,onOpen:u,onAutoFix:p,onAssign:m}=t,b=ie(),y=Nt[n.status].icon,g=Sf(n)?.lastMessage,x=p&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==qe,k=d?.attributes,v=d?.listeners;let C;e[0]!==u||e[1]!==h?(C=$=>{$.shiftKey&&h?h():u()},e[0]=u,e[1]=h,e[2]=C):C=e[2];const j=o&&"bg-accent";let S;e[3]!==l||e[4]!==j?(S=J("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,l),e[3]=l,e[4]=j,e[5]=S):S=e[5];const D=n.title;let N;e[6]!==n?(N=J("mt-px shrink-0",gi(n)),e[6]=n,e[7]=N):N=e[7];let R;e[8]!==y||e[9]!==N?(R=c.jsx(y,{size:16,className:N}),e[8]=y,e[9]=N,e[10]=R):R=e[10];let T;e[11]!==n.title?(T=c.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]=T):T=e[12];let E;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==m?(E=c.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 _;e[19]!==E||e[20]!==R||e[21]!==T?(_=c.jsxs("div",{className:"flex items-start gap-2",children:[R,T,E]}),e[19]=E,e[20]=R,e[21]=T,e[22]=_):_=e[22];let O;e[23]!==g?(O=g&&c.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:g}),e[23]=g,e[24]=O):O=e[24];let I;e[25]!==n?(I=(er(n)||n.priority!=="none"||!!n.dueDate||n.tags.length>0)&&c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[er(n)&&c.jsx(fa,{}),n.priority!=="none"&&c.jsx(ha,{priority:n.priority}),n.dueDate&&c.jsx(pa,{iso:n.dueDate}),n.tags.map(zg)]}),e[25]=n,e[26]=I):I=e[26];let A;e[27]!==p||e[28]!==x||e[29]!==b?(A=x&&c.jsxs("button",{type:"button",onClick:$=>{$.stopPropagation(),p()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-accent",children:[c.jsx(ar,{size:12}),b("taskBoard.taskBoard.autoFix")]}),e[27]=p,e[28]=x,e[29]=b,e[30]=A):A=e[30];let B;return e[31]!==a||e[32]!==n.title||e[33]!==f||e[34]!==k||e[35]!==_||e[36]!==O||e[37]!==I||e[38]!==A||e[39]!==v||e[40]!==C||e[41]!==S?(B=c.jsxs("button",{type:"button",ref:a,style:f,...k,...v,onClick:C,className:S,title:D,children:[_,O,I,A]}),e[31]=a,e[32]=n.title,e[33]=f,e[34]=k,e[35]=_,e[36]=O,e[37]=I,e[38]=A,e[39]=v,e[40]=C,e[41]=S,e[42]=B):B=e[42],B}function zg(t){return c.jsx(ga,{tag:t},t.id)}function Lg(t){const e=P.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=Nt[n.status].icon;let l;e[0]!==n?(l=J("shrink-0",gi(n)),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==o||e[3]!==l?(a=c.jsx(o,{size:16,className:l}),e[2]=o,e[3]=l,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let f;e[7]!==n?(f=er(n)&&c.jsx(fa,{}),e[7]=n,e[8]=f):f=e[8];let h;e[9]!==n.priority?(h=n.priority!=="none"&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(ha,{priority:n.priority})}),e[9]=n.priority,e[10]=h):h=e[10];let u;e[11]!==n.dueDate?(u=n.dueDate&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(pa,{iso:n.dueDate})}),e[11]=n.dueDate,e[12]=u):u=e[12];let p;e[13]!==n.tags?(p=n.tags.length>0&&c.jsxs("span",{className:"hidden items-center gap-1.5 sm:inline-flex",children:[n.tags.slice(0,2).map(Pg),n.tags.length>2&&c.jsxs("span",{className:Is,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=c.jsx(ma,{item:n,assignee:r,assignedBy:s}),e[15]=s,e[16]=r,e[17]=n,e[18]=m):m=e[18];let b;e[19]!==n.createdAt?(b=Zr(new Date(n.createdAt)),e[19]=n.createdAt,e[20]=b):b=e[20];let y;e[21]!==b?(y=c.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:b}),e[21]=b,e[22]=y):y=e[22];let g;return e[23]!==i||e[24]!==y||e[25]!==a||e[26]!==d||e[27]!==f||e[28]!==h||e[29]!==u||e[30]!==p||e[31]!==m?(g=c.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-accent/60",children:[a,d,f,h,u,p,m,y]}),e[23]=i,e[24]=y,e[25]=a,e[26]=d,e[27]=f,e[28]=h,e[29]=u,e[30]=p,e[31]=m,e[32]=g):g=e[32],g}function Pg(t){return c.jsx(ga,{tag:t},t.id)}const r1=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:xa,default:yg},Symbol.toStringTag,{value:"Module"}));export{xa as $,pf as A,xf as B,Jt as C,Bu as D,pi as E,kf as F,vf as G,Mm as H,Nt as I,Rt as J,di as K,zt as L,ct as M,Xm as N,e1 as O,fi as P,Um as Q,s1 as R,nd as S,Tp as T,t1 as U,Km as V,gd as W,qm as X,Vm as Y,Zm as Z,Hm as _,sd as a,Rl as a0,r1 as a1,Fm as b,Qm as c,Wc as d,Lm as e,Ym as f,md as g,Jm as h,Xc as i,Wm as j,Gm as k,vd as l,bd as m,Sd as n,zd as o,Oi as p,Zu as q,zm as r,Hc as s,Mu as t,Pm as u,Ju as v,Gc as w,n1 as x,lf as y,rf as z};