decocms 4.518.3 → 4.520.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 (405) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-Docp8wLu.js → ActiveShapeUtils-a2DoNLsg.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-DbgHFTtO.js → AlertCircle-CePpxiVL.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CcL-fFKM.js → AreaChart-futTS77r.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-B24gv2xe.js → ArrowLeft-DPa6sZRI.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CgN1Qhsf.js → ArrowUp-Bc6Es12Z.js} +1 -1
  6. package/dist/client/assets/{BarChart-CCFGMu0H.js → BarChart-CJBobvga.js} +1 -1
  7. package/dist/client/assets/{Building02-DBmpU4M6.js → Building02-BbEppJaI.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-DHq2iPiU.js → CartesianChart-D2mofn_H.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-Do09x_e5.js → CategoricalChart-1f5JjzPP.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-Cqp__I1R.js → CheckCircle-Dlz5XR1a.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-Bg2KdIAv.js → ChevronSelectorVertical-BjvpkKQW.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BJfOFayd.js → ChevronUp-CHckv_8T.js} +1 -1
  13. package/dist/client/assets/{Copy01-C8oI3ru2.js → Copy01-ynYolVGY.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-DBg0t5KK.js → CreditCard01-CJRwgkVP.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-MgtYn_XR.js → DotsVertical-xGYJd_oZ.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-Bjgx2BpF.js → ErrorBarContext-Bu4h-9ud.js} +1 -1
  17. package/dist/client/assets/{Globe04-8XNa-DGn.js → Globe04-rKrlqbJ3.js} +1 -1
  18. package/dist/client/assets/{Image01-BYSI_JTy.js → Image01-J72Rm0Yr.js} +1 -1
  19. package/dist/client/assets/{Key01-CVBy3Esl.js → Key01-GACmaKDe.js} +1 -1
  20. package/dist/client/assets/{Link01-1YHKCfLl.js → Link01-Dy_bSHLe.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-D8vKURBw.js → LinkBroken01-Dbb_PbFz.js} +1 -1
  22. package/dist/client/assets/{Minus-D7Nn8Jj1.js → Minus-cuNEQYA9.js} +1 -1
  23. package/dist/client/assets/{Monitor01-th-leB7u.js → Monitor01-CW3G0lSo.js} +1 -1
  24. package/dist/client/assets/{Play-B3knqxcb.js → Play-RPF1C2F0.js} +1 -1
  25. package/dist/client/assets/{Plus-Bf8vM3Sx.js → Plus-DXIMcQkQ.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-DevuDJh8.js → ReferenceLine-CYgqeMqY.js} +1 -1
  27. package/dist/client/assets/{SearchMd-C1vd4NNy.js → SearchMd-DQ6xirDN.js} +1 -1
  28. package/dist/client/assets/{Sector-CjducGVR.js → Sector-fbb2Py22.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-Bkku1Te9.js → ShoppingBag01-B81IcYcu.js} +1 -1
  30. package/dist/client/assets/{Sun-C_rfv84K.js → Sun-Bd7hlMAK.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-DsxrRdFb.js → SwitchHorizontal01-QjLd4gai.js} +1 -1
  32. package/dist/client/assets/{Tool01-XzMXqYKz.js → Tool01-D7eccoeh.js} +1 -1
  33. package/dist/client/assets/{Trash01-C68DqBe-.js → Trash01-CTrNlbT8.js} +1 -1
  34. package/dist/client/assets/{Upload01-D4h8lLWj.js → Upload01-B9oMCz-6.js} +1 -1
  35. package/dist/client/assets/{User01-BKJMa06q.js → User01-BgWUolo8.js} +1 -1
  36. package/dist/client/assets/{UserSquare-ezkB_C7H.js → UserSquare-CZXKi88L.js} +1 -1
  37. package/dist/client/assets/{Users01-sQ3Jopve.js → Users01-B7zAiC4m.js} +1 -1
  38. package/dist/client/assets/{XClose-5-Y_ZVDY.js → XClose-C9XzQkao.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-CTwXyALk.js → ZoomOut-DKNOmfuK.js} +1 -1
  40. package/dist/client/assets/{access-gate-BAeTdIKF.js → access-gate-BBEga0hz.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-CzGzxkZf.js → add-connection-dialog-ldH4ynvN.js} +1 -1
  42. package/dist/client/assets/agent-analytics-CAeIvLpw.js +1 -0
  43. package/dist/client/assets/agent-app-BIZw6O6x.js +1 -0
  44. package/dist/client/assets/{agent-assets-CDrWVXsZ.js → agent-assets-BTuYhb0x.js} +1 -1
  45. package/dist/client/assets/{agent-automation-CANuyesn.js → agent-automation-CPVX6Ssc.js} +1 -1
  46. package/dist/client/assets/{agent-automations-FCLkmptj.js → agent-automations-Depk4_IZ.js} +1 -1
  47. package/dist/client/assets/agent-calendar-rSYcBUhL.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-DPRFzy_W.js → agent-connect-sources-B_w_bZyW.js} +1 -1
  49. package/dist/client/assets/agent-deck-BdTe1uEF.js +1 -0
  50. package/dist/client/assets/{agent-e2e-CGsydJDk.js → agent-e2e-BUjIk9_k.js} +1 -1
  51. package/dist/client/assets/agent-experiments-C9MFznl7.js +1 -0
  52. package/dist/client/assets/{agent-file-DZxHfHqj.js → agent-file-CD0Yoa7I.js} +1 -1
  53. package/dist/client/assets/{agent-hosting-DLdgWaMb.js → agent-hosting-DZFLF8mA.js} +1 -1
  54. package/dist/client/assets/{agent-icon-Bl0Q4nDQ.js → agent-icon-DtT3h4UX.js} +1 -1
  55. package/dist/client/assets/agent-library-ClrTwj50.js +1 -0
  56. package/dist/client/assets/agent-library-file-CAlMp336.js +1 -0
  57. package/dist/client/assets/agent-monitor-Bn4RTzzk.js +1 -0
  58. package/dist/client/assets/{agent-overview-DmbW8VOm.js → agent-overview-D3DqJ6Lq.js} +1 -1
  59. package/dist/client/assets/{agent-releases-DJsbXDlS.js → agent-releases-JCAWDH6g.js} +1 -1
  60. package/dist/client/assets/agent-settings-DUBumxG4.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-Dn7we51s.js → agent-site-editor-DmMopyU6.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-CXdBuByv.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-xxngWBr2.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-DBUt1iNd.js +1 -0
  65. package/dist/client/assets/agent-view-BiUQ1gj5.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-B0aDsWRb.js → agent-view-guard-MrJ6Jxxx.js} +1 -1
  67. package/dist/client/assets/{agents-list-lOOhfuKV.js → agents-list-6A96PYcg.js} +1 -1
  68. package/dist/client/assets/{ai-providers-Bm7atoS5.js → ai-providers-DLOQtpHm.js} +1 -1
  69. package/dist/client/assets/{alert-fsJICKf8.js → alert-BEazQOeN.js} +1 -1
  70. package/dist/client/assets/{alert-dialog-SFY1grIM.js → alert-dialog-DdGCb0IF.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-KGMek742.js → analytics-sections-BO4YnAjA.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-DrPnNwhC.js → analytics-tab-DaOlRgMk.js} +1 -1
  73. package/dist/client/assets/{api-keys-DGMEM3Pu.js → api-keys-BJgy-lS2.js} +1 -1
  74. package/dist/client/assets/api-keys-bhSN63jL.js +1 -0
  75. package/dist/client/assets/{app-editor-6m_ygtwU.js → app-editor-DLE8thcF.js} +1 -1
  76. package/dist/client/assets/{asset-utils-DJKQ3jqO.js → asset-utils-BCgXGBCC.js} +1 -1
  77. package/dist/client/assets/{auth-k-50r1Jm.js → auth-D6exVMlw.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-BDasxET4.js → auth-catchall-DvDQWdKb.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CIp781XC.js → auth-entry-C86oFADV.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-DKyMuscv.js → auth-split-layout-DyRJlWjB.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-Citp3_ku.js → authenticate-and-persist-oauth-ByNJ3IhY.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DCYvqhb1.js → automation-list-row-CX5dszCC.js} +1 -1
  83. package/dist/client/assets/{automation-runs-Bv01EPr_.js → automation-runs-CHeG76Ew.js} +1 -1
  84. package/dist/client/assets/{automations-CMa4N4ws.js → automations-BpcPPmZL.js} +1 -1
  85. package/dist/client/assets/{autosend-BUGExBM4.js → autosend-DJIOdR-h.js} +1 -1
  86. package/dist/client/assets/{avatar-DZp2nksb.js → avatar-49aPXdv7.js} +1 -1
  87. package/dist/client/assets/{badge-B8Ivcb6S.js → badge-Xi0bu-aJ.js} +1 -1
  88. package/dist/client/assets/{block-document-t9Z4rWQI.js → block-document-Cn8tlonv.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-guMABPcp.js → blocks-preview-workspace-context-QgOcURJH.js} +1 -1
  90. package/dist/client/assets/{blocks-tab-states-Ch0bvZWI.js → blocks-tab-states-BG-MFk9Q.js} +1 -1
  91. package/dist/client/assets/{blog-schema-DGhK3ld9.js → blog-schema-BO9IdDkD.js} +1 -1
  92. package/dist/client/assets/{buckets-PCZkbjVY.js → buckets-xqarwZ-o.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-Ba28GGJ7.js → build-improve-prompt-doc-D7Pi_LQA.js} +1 -1
  94. package/dist/client/assets/{calendar-BDnGPQeR.js → calendar-HcE4WZuE.js} +1 -1
  95. package/dist/client/assets/{campaigns-view-BzxbPG_g.js → campaigns-view-BLsQazTL.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-h9GaAVI2.js → capability-load-error-BzCsh693.js} +1 -1
  97. package/dist/client/assets/{category-editor-BCaNtr8G.js → category-editor-Cwe6Gn4P.js} +1 -1
  98. package/dist/client/assets/{cdn-tab-BxlHc73J.js → cdn-tab-tnk9RtCD.js} +1 -1
  99. package/dist/client/assets/{chart-CF2951Pl.js → chart-BKCzQrbM.js} +1 -1
  100. package/dist/client/assets/{chat-context-C_P788VD.js → chat-context-CwxNIspy.js} +1 -1
  101. package/dist/client/assets/{chat-draft-Cd62GOk3.js → chat-draft-Czzd6Fgc.js} +1 -1
  102. package/dist/client/assets/{checkbox-D_LpTCuo.js → checkbox-IscGSBh9.js} +1 -1
  103. package/dist/client/assets/{choose-editor-CB85FQ98.js → choose-editor-uAgHg51i.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-6cvMKGqI.js → cli-auth-success-BhFG_H4z.js} +1 -1
  105. package/dist/client/assets/{client-icons-CwlNIvVS.js → client-icons-CZ-ZSlxS.js} +1 -1
  106. package/dist/client/assets/cms-settings-editor-DVlUigtK.js +1 -0
  107. package/dist/client/assets/{collapsible-BHKr0Yuy.js → collapsible-D314pUSB.js} +1 -1
  108. package/dist/client/assets/{collection-detail--pNpxuBG.js → collection-detail-CuIOpuSM.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-CmGqnHZR.js → collection-display-button-kbHHi0Kq.js} +1 -1
  110. package/dist/client/assets/{collection-search-BfeTverb.js → collection-search-DCYm5aP4.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-DbYcMpOp.js → collection-table-wrapper-DDG00R7J.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-BCwnkCTo.js → collection-tabs-CpRvK4aY.js} +1 -1
  113. package/dist/client/assets/{column-rules-cuIMwEgL.js → column-rules-yLNPamrN.js} +1 -1
  114. package/dist/client/assets/{combobox-Br3ekqoF.js → combobox-uDe7w0z0.js} +1 -1
  115. package/dist/client/assets/{command-9a3EU_B7.js → command-DcKOVszs.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-Bict1-Py.js → companion-mcps-section-DZ2ioXzY.js} +1 -1
  117. package/dist/client/assets/{config-HnMhGwJ8.js → config-DlkgY7Jy.js} +1 -1
  118. package/dist/client/assets/{connect-layout-CoCuwn0R.js → connect-layout-DU417orE.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-tW0_dVgF.js → connect-source-dialog-B6k_6_M9.js} +1 -1
  120. package/dist/client/assets/{connect-CPP1LzMI.js → connect-wFJx1iR7.js} +1 -1
  121. package/dist/client/assets/{connection-DA0DdtmE.js → connection-CLuVf0UF.js} +1 -1
  122. package/dist/client/assets/{connection-card-D6khbIvi.js → connection-card-BaWG41H0.js} +1 -1
  123. package/dist/client/assets/{connection-detail-3DINZ9Ps.js → connection-detail-B8vzaLYN.js} +1 -1
  124. package/dist/client/assets/{connection-form-helpers-CD1Glq-b.js → connection-form-helpers-BWk506qj.js} +1 -1
  125. package/dist/client/assets/{connections-5zgE9hOg.js → connections-ajPWQmhT.js} +1 -1
  126. package/dist/client/assets/{content-tab-DsX079ZZ.js → content-tab-C9mWHRiZ.js} +3 -3
  127. package/dist/client/assets/{context-D_yEBKdV.js → context-BZM48LEC.js} +1 -1
  128. package/dist/client/assets/{context-menu-CQmIAsNX.js → context-menu-DuBXLH-0.js} +1 -1
  129. package/dist/client/assets/{context-shell-Cm9pkJeZ.js → context-shell-DBFau4jR.js} +3 -3
  130. package/dist/client/assets/{core.esm-KXf7B9P5.js → core.esm-r_1fOlla.js} +1 -1
  131. package/dist/client/assets/{create-organization-dialog-CU3HQ3J9.js → create-organization-dialog-DinRNNUe.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-BTMsF03t.js → daily-pulse-DIrHsqZA.js} +1 -1
  133. package/dist/client/assets/{discover-CF8v9Owa.js → discover-fUj70D62.js} +1 -1
  134. package/dist/client/assets/{domain-settings-BE6GV0Yp.js → domain-settings-CLujyp1m.js} +1 -1
  135. package/dist/client/assets/{drawer-BTNZfEU6.js → drawer-CyiQimHr.js} +1 -1
  136. package/dist/client/assets/{editor-swke_0an.js → editor-BpL3QDOn.js} +1 -1
  137. package/dist/client/assets/{editor-classes-DQrtem9w.js → editor-classes-DA3QHiC-.js} +1 -1
  138. package/dist/client/assets/{empty-state-CkRk6emt.js → empty-state-B0G_CGwR.js} +1 -1
  139. package/dist/client/assets/{empty-state-DjnYxJoJ.js → empty-state-Bw4axBb5.js} +1 -1
  140. package/dist/client/assets/{experiments-tab-6fYgjeCj.js → experiments-tab-BkzMMdcP.js} +1 -1
  141. package/dist/client/assets/{experiments-tab-choice-DLYJ3Xgw.js → experiments-tab-choice-BYO4Dw1S.js} +1 -1
  142. package/dist/client/assets/{extract-connection-data-BcSeYo2b.js → extract-connection-data-CwDf8Ns1.js} +1 -1
  143. package/dist/client/assets/{feature-gate-DnDfxxPc.js → feature-gate-BxG3yqt8.js} +1 -1
  144. package/dist/client/assets/{feature-paywall-DbYyln6a.js → feature-paywall-BHK5XVuW.js} +1 -1
  145. package/dist/client/assets/{file-explorer-CmXZRbDC.js → file-explorer-CPGV5tot.js} +1 -1
  146. package/dist/client/assets/{file-preview-CB-QuWoi.js → file-preview-BdEwMhOt.js} +1 -1
  147. package/dist/client/assets/{file-share-button-5DKLtCO8.js → file-share-button-C4MFpt4s.js} +1 -1
  148. package/dist/client/assets/{file-type-icon-BlPndn8R.js → file-type-icon-BnEUVv2h.js} +1 -1
  149. package/dist/client/assets/{folder-icon-50i43Zdi.js → folder-icon-DOB3P9Vd.js} +1 -1
  150. package/dist/client/assets/{form-CWlPjOiE.js → form-CpnGThcL.js} +1 -1
  151. package/dist/client/assets/{general-DiUoRhmp.js → general-7WS5B97k.js} +1 -1
  152. package/dist/client/assets/{home-DgNlH8AE.js → home-CfcdGSri.js} +1 -1
  153. package/dist/client/assets/{icon-button-BjI92SlL.js → icon-button-B1pb2_kW.js} +1 -1
  154. package/dist/client/assets/{index-DYNe4TdA.js → index-B-nEUC-m.js} +1 -1
  155. package/dist/client/assets/{index-YbD_X2Sg.js → index-B6fYZNK2.js} +1 -1
  156. package/dist/client/assets/{index-YVO_Peic.js → index-BlsmUzy2.js} +1 -1
  157. package/dist/client/assets/{index-BiGgRVLA.js → index-CDmfe_Ze.js} +1 -1
  158. package/dist/client/assets/{index-CImJlq71.js → index-CMKEBGKX.js} +36 -36
  159. package/dist/client/assets/{index-DfzKVEQZ.js → index-CMr2QK3C.js} +1 -1
  160. package/dist/client/assets/{index-D5TlKaB4.js → index-CXV4VJ6T.js} +1 -1
  161. package/dist/client/assets/{index-UjSXE0Iy.js → index-CZWqOlKo.js} +1 -1
  162. package/dist/client/assets/{index-D8VCkLtE.js → index-C_uum72U.js} +1 -1
  163. package/dist/client/assets/{index-BzTLQsHh.js → index-D2b1OQG0.js} +1 -1
  164. package/dist/client/assets/{index-DQ2PXCBR.js → index-DwGMmQy3.js} +1 -1
  165. package/dist/client/assets/{index-BT89s1_n.js → index-Okf21u4l.js} +1 -1
  166. package/dist/client/assets/{index-YTcaUBCs.js → index-P7t2U4iN.js} +1 -1
  167. package/dist/client/assets/{index-redirect-DDzvngbU.js → index-redirect-B2074CyX.js} +1 -1
  168. package/dist/client/assets/{index-AzZxgAUy.js → index-tbca9DY7.js} +1 -1
  169. package/dist/client/assets/{index-ChO_KP9v.js → index-uNmIis3_.js} +1 -1
  170. package/dist/client/assets/{infiniteQueryObserver-BPnYbZuQ.js → infiniteQueryObserver-sZS50x9h.js} +1 -1
  171. package/dist/client/assets/{infra-billing-BqdikAj2.js → infra-billing-Cf1YDWV8.js} +1 -1
  172. package/dist/client/assets/{input-BHFkZ3T9.js → input-DlOSVkNE.js} +3 -3
  173. package/dist/client/assets/{input-Cs9OOIz-.js → input-qA_oxMGt.js} +1 -1
  174. package/dist/client/assets/{integration-icon-B9snkXuC.js → integration-icon-mkTLlJYZ.js} +1 -1
  175. package/dist/client/assets/{jira-icon-DIYO8jdA.js → jira-icon-C5lcBXYi.js} +1 -1
  176. package/dist/client/assets/{label-CfvfFl3x.js → label-8_hsm0_y.js} +1 -1
  177. package/dist/client/assets/{layout-BRYkue1F.js → layout-C4N_3p9u.js} +1 -1
  178. package/dist/client/assets/{legacy-agents-deep-Sb6HNynM.js → legacy-agents-deep-Zsw21wnc.js} +1 -1
  179. package/dist/client/assets/{legacy-main-redirect-DxGhnvQi.js → legacy-main-redirect-RzdE-Ynb.js} +1 -1
  180. package/dist/client/assets/library-CKihNjtp.js +1 -0
  181. package/dist/client/assets/{login-BoKhcWPb.js → login-B439_6KR.js} +1 -1
  182. package/dist/client/assets/{markdown-BDnIqP7U.js → markdown-yQLRhm2z.js} +1 -1
  183. package/dist/client/assets/{mcp-app-renderer-vmvnP_G4.js → mcp-app-renderer-gJ1lyd1u.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-Bf1ymd_L.js → mcp-oauth-B64tInkO.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-De4zWGdY.js → mcp-oauth-BFUDXDf6.js} +1 -1
  186. package/dist/client/assets/{members-C_49FqGn.js → members-Beq92g_c.js} +1 -1
  187. package/dist/client/assets/{memory-DB-8JkBQ.js → memory-BkOPkUkc.js} +1 -1
  188. package/dist/client/assets/{mini-report-page-UFZ1_IfA.js → mini-report-page-BWPJGpfB.js} +1 -1
  189. package/dist/client/assets/{mock-board-uI6Kjr1q.js → mock-board-qTnFSOlt.js} +5 -5
  190. package/dist/client/assets/{monaco-editor-FMQP-sIq.js → monaco-editor-C2ej8TCv.js} +1 -1
  191. package/dist/client/assets/{monitoring-D8MQ-E4C.js → monitoring-BdT45NJd.js} +1 -1
  192. package/dist/client/assets/{monitoring-stats-row-BGPZUteu.js → monitoring-stats-row-QRt_yzIW.js} +1 -1
  193. package/dist/client/assets/{multi-select-CjpZ72b0.js → multi-select-D4sL81eP.js} +1 -1
  194. package/dist/client/assets/{mustache-wrPcgRSJ.js → mustache-3jnCJNSv.js} +1 -1
  195. package/dist/client/assets/{named-rule-uses-DUhhItNP.js → named-rule-uses-u1am7LRC.js} +1 -1
  196. package/dist/client/assets/{named-rule-view-DuazhL5D.js → named-rule-view-B49ZuZC_.js} +1 -1
  197. package/dist/client/assets/{new-project-dialog-CEUx8Wuz.js → new-project-dialog-DCNrhfVx.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-VCDp4Mdt.js → oauth-callback-D1lTLeuO.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ai-provider-DA8fj9mx.js → oauth-callback-ai-provider-uHk7H4_s.js} +1 -1
  200. package/dist/client/assets/{onboarding-CNAboKGM.js → onboarding-Cqmu7Q1I.js} +1 -1
  201. package/dist/client/assets/{openai-conversation-DzWEkMFW.js → openai-conversation-D9oaPp7I.js} +1 -1
  202. package/dist/client/assets/{optimistic-project-sidebar-views-DtUy3pl1.js → optimistic-project-sidebar-views-C2xkkt2n.js} +1 -1
  203. package/dist/client/assets/{order-monitor-day-AyxJmcAH.js → order-monitor-day-Bn2RftCy.js} +1 -1
  204. package/dist/client/assets/{organization-choice-BQVJgGgg.js → organization-choice-DbSR_Tq1.js} +1 -1
  205. package/dist/client/assets/{orgs-D0MWQorV.js → orgs-Dv6ZMLaR.js} +1 -1
  206. package/dist/client/assets/{page-seo-form-Dbm_mNqs.js → page-seo-form-CYdB-eYU.js} +1 -1
  207. package/dist/client/assets/{pair-CNR7-_qK.js → pair-DIRyClgs.js} +1 -1
  208. package/dist/client/assets/{parse-sections-BYTdQHxf.js → parse-sections-CvCJ7mYl.js} +1 -1
  209. package/dist/client/assets/{plan-CEyzI8hm.js → plan-bTtLskYs.js} +1 -1
  210. package/dist/client/assets/{plan-ladder-Chib98li.js → plan-ladder-DNfn-N6n.js} +1 -1
  211. package/dist/client/assets/{popover-BqGcOxqn.js → popover-n_tcLsd5.js} +1 -1
  212. package/dist/client/assets/{post-calendar-2c7rIKCZ.js → post-calendar-DnSIZDH2.js} +1 -1
  213. package/dist/client/assets/{post-editor-CRPwAV6k.js → post-editor-Ds8VBbi2.js} +1 -1
  214. package/dist/client/assets/{preview-content-C3GD-BQD.js → preview-content-YpNvTcZt.js} +1 -1
  215. package/dist/client/assets/{preview-dialog-vLTpbCc0.js → preview-dialog-DJ8srmsM.js} +1 -1
  216. package/dist/client/assets/{preview-panel-C6xrnpJj.js → preview-panel-C7cA2AYG.js} +1 -1
  217. package/dist/client/assets/{preview-tab-CBRKeC1b.js → preview-tab-lR6Zy9Kz.js} +3 -3
  218. package/dist/client/assets/{product-picker-dialog-DHVGLlrb.js → product-picker-dialog-BQZeexho.js} +1 -1
  219. package/dist/client/assets/{profile-C5h78yhG.js → profile-D9pE1ZCt.js} +1 -1
  220. package/dist/client/assets/project-app-view-BJMSCiLQ.js +1 -0
  221. package/dist/client/assets/{project-apps-D7YctFcN.js → project-apps-CKpWGbT4.js} +1 -1
  222. package/dist/client/assets/{project-feed-CpfPTWDh.js → project-feed-BFyTaEPY.js} +1 -1
  223. package/dist/client/assets/{project-icon-B-MVviOF.js → project-icon-BozuiJlT.js} +1 -1
  224. package/dist/client/assets/project-reports-B6AQHucI.js +1 -0
  225. package/dist/client/assets/project-tasks-DFBfLTNl.js +1 -0
  226. package/dist/client/assets/{projects-DrGNXye1.js → projects-Bj8bu01s.js} +1 -1
  227. package/dist/client/assets/{projects-empty-state-B6Ieq7wG.js → projects-empty-state-Co0D5JhR.js} +1 -1
  228. package/dist/client/assets/{prompts-DszjlGng.js → prompts-CUYrqR6B.js} +1 -1
  229. package/dist/client/assets/record-editor-Dq4w4KU3.js +1 -0
  230. package/dist/client/assets/{redirect-editor-D4gU7n0c.js → redirect-editor-tsiTjzIT.js} +1 -1
  231. package/dist/client/assets/{releases-api-CK0jSLYO.js → releases-api-DuhgreiH.js} +1 -1
  232. package/dist/client/assets/{reports-CjnzDShS.js → reports-BG2If9Qe.js} +1 -1
  233. package/dist/client/assets/reports-DhdnjILE.js +1 -0
  234. package/dist/client/assets/{reports-onboarding-C81Upwj7.js → reports-onboarding-DMCkOYqe.js} +1 -1
  235. package/dist/client/assets/{reports-tab-DJdkQM-o.js → reports-tab-LnruJoPA.js} +2 -2
  236. package/dist/client/assets/repositories-CBH2GIms.js +1 -0
  237. package/dist/client/assets/{repositories-IyZ5mwlx.js → repositories-D-cEWI3N.js} +1 -1
  238. package/dist/client/assets/{repository-binding-wXpkgUS5.js → repository-binding-BBtZf2zz.js} +1 -1
  239. package/dist/client/assets/{repository-import-picker-DWw4DnKc.js → repository-import-picker-Dm0ES3Rv.js} +1 -1
  240. package/dist/client/assets/{repository-picker-fHOvHVjl.js → repository-picker-CPuj3bZ1.js} +1 -1
  241. package/dist/client/assets/{require-capability-B4IJOpH-.js → require-capability-C24QIC4M.js} +1 -1
  242. package/dist/client/assets/{required-auth-layout-p9wTtbkA.js → required-auth-layout-PhuA3Ewp.js} +1 -1
  243. package/dist/client/assets/{reset-password-CpXnMk-E.js → reset-password-C8SdUbOh.js} +1 -1
  244. package/dist/client/assets/{resizable-CykEr2xO.js → resizable-miZzhQuc.js} +1 -1
  245. package/dist/client/assets/{resolve-tab-icon-dNyXGxcc.js → resolve-tab-icon-CpfXvomr.js} +1 -1
  246. package/dist/client/assets/{review-settings-D36VxF8a.js → review-settings-BrKUWarQ.js} +1 -1
  247. package/dist/client/assets/{roles-DPB4O14g.js → roles-BlQqDK5V.js} +1 -1
  248. package/dist/client/assets/{route-rXh3k9jX.js → route-C1AFWDaT.js} +1 -1
  249. package/dist/client/assets/route-DSfRBjPS.js +1 -0
  250. package/dist/client/assets/{route-CH9GHNDj.js → route-fvDFg13s.js} +1 -1
  251. package/dist/client/assets/{runnable-block-editor-CvNZGRDu.js → runnable-block-editor-Bn4b767r.js} +3 -3
  252. package/dist/client/assets/{sandbox-lifecycle-context-CsnW_1kh.js → sandbox-lifecycle-context-DR0GTBJX.js} +1 -1
  253. package/dist/client/assets/{schema-BjLtWzT5.js → schema-BRZOWw0d.js} +1 -1
  254. package/dist/client/assets/{schema-BXcU44Bp.js → schema-CylodOUQ.js} +1 -1
  255. package/dist/client/assets/{scroll-area-BZP0xkZ2.js → scroll-area-BH2Oy8PV.js} +1 -1
  256. package/dist/client/assets/{search-input-CLbrLBK4.js → search-input-RbNJNFgo.js} +1 -1
  257. package/dist/client/assets/{search-toggle-Bz--u_u6.js → search-toggle-BKYod6Wy.js} +1 -1
  258. package/dist/client/assets/{secret-ciphertext-DZQPZkTr.js → secret-ciphertext-IJ4Mey7K.js} +1 -1
  259. package/dist/client/assets/{secret-picker-r4BGxMfM.js → secret-picker-C-cbBnBP.js} +1 -1
  260. package/dist/client/assets/{secrets-CzuDVgfq.js → secrets-BvD9KlhJ.js} +1 -1
  261. package/dist/client/assets/{sections-DE80daGy.js → sections-C2rk7uX1.js} +1 -1
  262. package/dist/client/assets/{sections-editor-C5rNMLKQ.js → sections-editor-DTbMqnxy.js} +1 -1
  263. package/dist/client/assets/{select-CO-KeEXe.js → select-B-vRTlp8.js} +1 -1
  264. package/dist/client/assets/{select-model-B9aWAF7v.js → select-model-jzXUtlUA.js} +1 -1
  265. package/dist/client/assets/{seo-editor-C5HGby9p.js → seo-editor-BqtZxWFt.js} +1 -1
  266. package/dist/client/assets/{separator-Dr93-tcp.js → separator-DQdTCaJ6.js} +1 -1
  267. package/dist/client/assets/settings-tab-CPth5xHx.js +1 -0
  268. package/dist/client/assets/{sheet-DYqe447t.js → sheet-DIT9lGlU.js} +1 -1
  269. package/dist/client/assets/{shell-layout-Bmd6dXD4.js → shell-layout-NV-fbXIm.js} +1 -1
  270. package/dist/client/assets/{site-draft-actions-CNazOyJI.js → site-draft-actions-DpuJ9efE.js} +1 -1
  271. package/dist/client/assets/site-draft-view-D6YYVH6j.js +2 -0
  272. package/dist/client/assets/site-editor-CpNSE9w9.js +1 -0
  273. package/dist/client/assets/{site-editor-toast-Ckx512no.js → site-editor-toast-hxv14akZ.js} +1 -1
  274. package/dist/client/assets/{skills-Dq2dQBym.js → skills-Dmur65NR.js} +1 -1
  275. package/dist/client/assets/{slider-Dm9m4Zom.js → slider-DL5ZrKD2.js} +1 -1
  276. package/dist/client/assets/{sortable.esm-PpUBUYvN.js → sortable.esm-CmQjLRc-.js} +1 -1
  277. package/dist/client/assets/{sso-et00F2-M.js → sso-DJaANv0k.js} +1 -1
  278. package/dist/client/assets/{suggestion-CaGvyBH6.js → suggestion-Dp-vLwaS.js} +1 -1
  279. package/dist/client/assets/{switch-DGiOaGRn.js → switch-CWqn4x2S.js} +1 -1
  280. package/dist/client/assets/{symbol-ZVON6uKU.js → symbol-9K-WFQbg.js} +1 -1
  281. package/dist/client/assets/{synced-repos-CKQ3x7oT.js → synced-repos-C6pBMypP.js} +1 -1
  282. package/dist/client/assets/{tab-icon-glyph-DLj4dmeB.js → tab-icon-glyph-CM3k-yhU.js} +1 -1
  283. package/dist/client/assets/{table-DcqK9CO1.js → table-Clkje7xI.js} +1 -1
  284. package/dist/client/assets/{tabs-CU2NQvm6.js → tabs-SpJ7v19a.js} +1 -1
  285. package/dist/client/assets/{task-assignee-avatar-Cs9bBLeR.js → task-assignee-avatar-D7x8Ztl2.js} +1 -1
  286. package/dist/client/assets/{task-board-CRvOV9zQ.js → task-board-CEgpYip9.js} +1 -1
  287. package/dist/client/assets/{task-route-BPQ9h0t-.js → task-route-0IGfE2Sp.js} +1 -1
  288. package/dist/client/assets/{task-status-k_KZvqi3.js → task-status-DxuW2r4d.js} +1 -1
  289. package/dist/client/assets/{taskboard-analytics-DXKp_Xl8.js → taskboard-analytics-D5efiDoG.js} +1 -1
  290. package/dist/client/assets/{tasks-CJWFfvRo.js → tasks-BOOTk53y.js} +1 -1
  291. package/dist/client/assets/tasks-DBKhuSFQ.js +1 -0
  292. package/dist/client/assets/{textarea-Bp989dUN.js → textarea-DhtVYf8e.js} +1 -1
  293. package/dist/client/assets/{thread-analytics-CMG9NspT.js → thread-analytics-WxV3T9V2.js} +1 -1
  294. package/dist/client/assets/{thread-intent-DXY7orZh.js → thread-intent-BS7K-UuZ.js} +1 -1
  295. package/dist/client/assets/{thread-route-ChN9O-1A.js → thread-route-BZhEwUGV.js} +1 -1
  296. package/dist/client/assets/{thread-route-B1rrIJuw.js → thread-route-BkotEDA1.js} +1 -1
  297. package/dist/client/assets/{thread-sheet-body-D-x-TABK.js → thread-sheet-body-F9Cd7VsI.js} +1 -1
  298. package/dist/client/assets/{time-range-picker-B10kjTj_.js → time-range-picker-DgOYXLpU.js} +1 -1
  299. package/dist/client/assets/{toggle-group-K25Bl_Tm.js → toggle-group-errY3aOY.js} +1 -1
  300. package/dist/client/assets/{tool-namespace-ln4cIuCt.js → tool-namespace-BVXAR9Sk.js} +1 -1
  301. package/dist/client/assets/{toolbar-icon-button-NAoOtagz.js → toolbar-icon-button-Cq4ZT7sJ.js} +1 -1
  302. package/dist/client/assets/{tooltip-BB8x2ajM.js → tooltip-WTx8RFDb.js} +1 -1
  303. package/dist/client/assets/{tooltipContext-DG-hvJrr.js → tooltipContext-Ccm0pmDN.js} +1 -1
  304. package/dist/client/assets/{track-DwVNsvWy.js → track-DGHY3NJe.js} +1 -1
  305. package/dist/client/assets/{types-D4eFbg3n.js → types-C2kyJgqF.js} +1 -1
  306. package/dist/client/assets/{url-slug-Ck137SN4.js → url-slug-eBdSwuRg.js} +1 -1
  307. package/dist/client/assets/{usage-stats-DpZZQ75-.js → usage-stats-BCvxtMFR.js} +1 -1
  308. package/dist/client/assets/{use-ai-providers-Cng_Zcqq.js → use-ai-providers-BUYCLrsq.js} +1 -1
  309. package/dist/client/assets/{use-apply-named-rule-5US13ud-.js → use-apply-named-rule-D8uSRmIc.js} +1 -1
  310. package/dist/client/assets/{use-automations-BV-J2Ily.js → use-automations-BKnx1LOU.js} +1 -1
  311. package/dist/client/assets/{use-autosave-By6DVzfK.js → use-autosave-C0kQXP3a.js} +1 -1
  312. package/dist/client/assets/{use-chat-layout-state-CNkklJiF.js → use-chat-layout-state-CoSgX-8p.js} +1 -1
  313. package/dist/client/assets/{use-clock-tick-D95T8222.js → use-clock-tick-BVcS6c_m.js} +1 -1
  314. package/dist/client/assets/{use-connect-companion-BRWaN5AJ.js → use-connect-companion-Dfch6Pn5.js} +1 -1
  315. package/dist/client/assets/{use-connection-CAJy9ePc.js → use-connection-C2QTK4P4.js} +1 -1
  316. package/dist/client/assets/{use-content-sync-3FE60C_P.js → use-content-sync-cSja7hdH.js} +1 -1
  317. package/dist/client/assets/{use-copy-CvMH5zdo.js → use-copy-DedJIHzN.js} +1 -1
  318. package/dist/client/assets/{use-create-virtual-mcp-DTJ0zfpe.js → use-create-virtual-mcp-JDXemb5m.js} +1 -1
  319. package/dist/client/assets/{use-date-fns-locale-D3Iz1MzV.js → use-date-fns-locale-ByEf5sEV.js} +1 -1
  320. package/dist/client/assets/{use-debounced-autosave-CGLCHS8I.js → use-debounced-autosave-C_RB3agc.js} +1 -1
  321. package/dist/client/assets/{use-debounced-value-DvzjOUVw.js → use-debounced-value-ELHlrW87.js} +1 -1
  322. package/dist/client/assets/{use-deco-credits-D1dKlqXc.js → use-deco-credits-D6gi2fbm.js} +1 -1
  323. package/dist/client/assets/{use-decopilot-events-DvJkZDam.js → use-decopilot-events-CwR46UgN.js} +1 -1
  324. package/dist/client/assets/{use-delete-connection-D1ttYwJz.js → use-delete-connection-BTgka6iQ.js} +1 -1
  325. package/dist/client/assets/{use-deployment-admin-BpF0owio.js → use-deployment-admin-BCN-ylik.js} +1 -1
  326. package/dist/client/assets/{use-fast-preview-draft-url-C_TDHMYN.js → use-fast-preview-draft-url-CVZxF7Um.js} +1 -1
  327. package/dist/client/assets/{use-file-configs-Bf0fhL21.js → use-file-configs-Br5njpmm.js} +1 -1
  328. package/dist/client/assets/{use-inbox-feed-DFw-YlJH.js → use-inbox-feed-Dz2zKYVV.js} +1 -1
  329. package/dist/client/assets/{use-infinite-scroll-CwPqy0HC.js → use-infinite-scroll-C3u8iypP.js} +1 -1
  330. package/dist/client/assets/{use-join-requests-Z3CFtAeL.js → use-join-requests-D2Wm3dTe.js} +1 -1
  331. package/dist/client/assets/{use-main-panel-tabs-Cp-duvYv.js → use-main-panel-tabs-CTK-I6l5.js} +1 -1
  332. package/dist/client/assets/{use-mcp-auth-status-Db86wDh0.js → use-mcp-auth-status-BPhXIpD4.js} +1 -1
  333. package/dist/client/assets/{use-mcp-client-BT3MLYTJ.js → use-mcp-client-COM3gP2O.js} +1 -1
  334. package/dist/client/assets/{use-mcp-prompts-DvHpjECx.js → use-mcp-prompts-1pj8Mn9o.js} +1 -1
  335. package/dist/client/assets/{use-mcp-tools-DY3R7rf0.js → use-mcp-tools-DVMy4xzU.js} +1 -1
  336. package/dist/client/assets/{use-members-DrsTuCTp.js → use-members-BXYZ5GWT.js} +1 -1
  337. package/dist/client/assets/{use-mobile-Nz4my9ZZ.js → use-mobile-Bq3CXRKG.js} +1 -1
  338. package/dist/client/assets/{use-move-blocks-Ck3YCWT9.js → use-move-blocks-BrZbG7eM.js} +1 -1
  339. package/dist/client/assets/{use-navigate-to-agent-DqXhqPI9.js → use-navigate-to-agent-F9oDR6Aw.js} +1 -1
  340. package/dist/client/assets/{use-open-billing-url-BPZ_x4uz.js → use-open-billing-url-D4P9ija_.js} +1 -1
  341. package/dist/client/assets/{use-org-auth-client-BVmUiQl1.js → use-org-auth-client-C3gy1liR.js} +1 -1
  342. package/dist/client/assets/{use-org-fs-qBxAqXun.js → use-org-fs-BRfBBlvJ.js} +1 -1
  343. package/dist/client/assets/{use-org-repo-syncs-C4sXoqIp.js → use-org-repo-syncs-IArfEyUi.js} +1 -1
  344. package/dist/client/assets/{use-org-sso-B4zmaZVL.js → use-org-sso-ChkTjfH5.js} +1 -1
  345. package/dist/client/assets/{use-organization-roles-CfuwXcGJ.js → use-organization-roles-Dx88n2m6.js} +1 -1
  346. package/dist/client/assets/{use-organization-settings-DKJZVR_x.js → use-organization-settings-dAOl4U_-.js} +1 -1
  347. package/dist/client/assets/{use-panel-navigate-D57HPY2x.js → use-panel-navigate-CW6DUzf9.js} +1 -1
  348. package/dist/client/assets/{use-project-native-view-presence-C3HlYZwC.js → use-project-native-view-presence-CTc7wMZF.js} +1 -1
  349. package/dist/client/assets/{use-project-scope-CnnlA-du.js → use-project-scope-BFye4eeg.js} +1 -1
  350. package/dist/client/assets/{use-recent-apps-CeorMBvV.js → use-recent-apps-BU79Go-x.js} +1 -1
  351. package/dist/client/assets/{use-releases-fI9YxkQH.js → use-releases-CfZAXBwl.js} +1 -1
  352. package/dist/client/assets/{use-reports-diagnostic-J_fRdq7J.js → use-reports-diagnostic-CJiI0aEe.js} +1 -1
  353. package/dist/client/assets/{use-sandbox-events-CioMqxnO.js → use-sandbox-events-Bryc2tH_.js} +1 -1
  354. package/dist/client/assets/{use-secrets-OlxyEwyb.js → use-secrets-BBwZJiLY.js} +1 -1
  355. package/dist/client/assets/{use-section-preview-base-C3ZuHMr0.js → use-section-preview-base-B5gtsawP.js} +1 -1
  356. package/dist/client/assets/{use-session-runtime-DfVwDDov.js → use-session-runtime-C6i7UtWU.js} +1 -1
  357. package/dist/client/assets/{use-sidebar-collapsed-D3qR_zRH.js → use-sidebar-collapsed-CKSL9ORL.js} +1 -1
  358. package/dist/client/assets/{use-tags-CxN5zuRZ.js → use-tags-C7NcCL7l.js} +1 -1
  359. package/dist/client/assets/{use-task-board-analytics-C-0VTjUE.js → use-task-board-analytics-CmTEpb8g.js} +1 -1
  360. package/dist/client/assets/{use-task-board-events-BH7aE_i8.js → use-task-board-events-bChrXXDv.js} +1 -1
  361. package/dist/client/assets/{use-task-board-item-prs-BLDfRR9k.js → use-task-board-item-prs-B5n2Imtn.js} +1 -1
  362. package/dist/client/assets/{use-task-metadata-xGzNCL2M.js → use-task-metadata-CyLevNIC.js} +1 -1
  363. package/dist/client/assets/{use-thread-analytics-DJdxAjR-.js → use-thread-analytics-BdSD31wi.js} +1 -1
  364. package/dist/client/assets/{use-thread-outputs-D8VLF1dw.js → use-thread-outputs-COl9UfXy.js} +1 -1
  365. package/dist/client/assets/useInfiniteQuery-EcJS-_aQ.js +1 -0
  366. package/dist/client/assets/{useQueries-1QlJ0aQr.js → useQueries-Dgo1k5er.js} +1 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-XLLgwpcB.js +1 -0
  368. package/dist/client/assets/{users-C4R4jnJb.js → users-BOMrf4Fo.js} +1 -1
  369. package/dist/client/assets/{utils-Dc05pOUY.js → utils-fsgeKe9W.js} +1 -1
  370. package/dist/client/assets/{variant-calendar-B48hMXng.js → variant-calendar-CGX7TiEA.js} +1 -1
  371. package/dist/client/assets/{variant-matcher-override-f1vt09fC.js → variant-matcher-override-D3H0IPwr.js} +1 -1
  372. package/dist/client/assets/{virtual-mcp-CP4uoCBU.js → virtual-mcp-th0bGjq5.js} +1 -1
  373. package/dist/client/assets/{watch-sse-pool-HKRMih-U.js → watch-sse-pool-9c6_Ze8B.js} +1 -1
  374. package/dist/client/index.html +1 -1
  375. package/dist/server/server.js +2 -2
  376. package/package.json +1 -1
  377. package/dist/client/assets/agent-analytics-CyvLQ78l.js +0 -1
  378. package/dist/client/assets/agent-app-CNlTu6Xl.js +0 -1
  379. package/dist/client/assets/agent-calendar-ChKa8nwx.js +0 -1
  380. package/dist/client/assets/agent-deck-DgzTTX-H.js +0 -1
  381. package/dist/client/assets/agent-experiments-g1fOqVOr.js +0 -1
  382. package/dist/client/assets/agent-library-T0msL9vO.js +0 -1
  383. package/dist/client/assets/agent-library-file-Dc6tLUFf.js +0 -1
  384. package/dist/client/assets/agent-monitor-64lw2Ndx.js +0 -1
  385. package/dist/client/assets/agent-settings-BEGX73lw.js +0 -1
  386. package/dist/client/assets/agent-site-editor-code-MGF1GSqb.js +0 -2
  387. package/dist/client/assets/agent-site-editor-content-KSRD36m4.js +0 -1
  388. package/dist/client/assets/agent-site-editor-preview-jNYBd5Qs.js +0 -1
  389. package/dist/client/assets/agent-view-Cmt42rZM.js +0 -1
  390. package/dist/client/assets/api-keys-DxiLI10z.js +0 -1
  391. package/dist/client/assets/cms-settings-editor-CoBhi6-0.js +0 -1
  392. package/dist/client/assets/library-BWuIS4mc.js +0 -1
  393. package/dist/client/assets/project-app-view-C3iPvweM.js +0 -1
  394. package/dist/client/assets/project-reports-qKDYuHCF.js +0 -1
  395. package/dist/client/assets/project-tasks-C08bqxWt.js +0 -1
  396. package/dist/client/assets/record-editor-zoDoy66N.js +0 -1
  397. package/dist/client/assets/reports-CalnjK7E.js +0 -1
  398. package/dist/client/assets/repositories-C7NPKiSj.js +0 -1
  399. package/dist/client/assets/route-DsIfFih1.js +0 -1
  400. package/dist/client/assets/settings-tab-OQ9gNE2t.js +0 -1
  401. package/dist/client/assets/site-draft-view-CaiajxbQ.js +0 -2
  402. package/dist/client/assets/site-editor-BC9YFkDH.js +0 -1
  403. package/dist/client/assets/tasks-DfOAe8MK.js +0 -1
  404. package/dist/client/assets/useInfiniteQuery-BwyrFPWF.js +0 -1
  405. package/dist/client/assets/useSuspenseInfiniteQuery-DJXxpWPx.js +0 -1
@@ -1 +1 @@
1
- import{n as $,x as D,_ as We,T as H,$ as je,a0 as I,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-DpZZQ75-.js";import{eW as ye,fz as Ce,eV as Se,fA as Re,fB as Ee,fC as Te,fD as Oe,fE as Ae,eY as Ie,d$ as Me,r as C,b3 as ze}from"./index-CImJlq71.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function A(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(I.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(I.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(I.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=I.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!A(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!A(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!A(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!A(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(I.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(I.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(I.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(I.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,I.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!A(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[I.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function At(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var It=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=It,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:At},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!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:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.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.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),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())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ie(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.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()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({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 Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!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=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},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())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ie({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.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:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({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})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.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 T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
1
+ import{n as $,x as D,_ as We,T as H,$ as je,a0 as I,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-BCvxtMFR.js";import{eW as ye,fz as Ce,eV as Se,fA as Re,fB as Ee,fC as Te,fD as Oe,fE as Ae,eY as Ie,d$ as Me,r as C,b3 as ze}from"./index-CMKEBGKX.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new $("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function A(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(I.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(I.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(I.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new $("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!A(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=I.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!A(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!A(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!A(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!A(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(I.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(I.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(I.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(I.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,I.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return k(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return k(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),k(n,o,c)}}}function _(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?k(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!A(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[I.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function At(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var It=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=It,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:At},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function $t(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var Bt=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():$t(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!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:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.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.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),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())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ie(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.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()}};const Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Be({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 Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ae(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!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=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},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())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ie({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.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()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.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:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({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})]:[]}});function Ke(e,t){return e??new $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),kt=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function ke(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.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 T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=Be({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
@@ -1,4 +1,4 @@
1
- import{c as ue,r as xe,d as ns,a2 as ht,b as Pe,j as t,B as je,t as dt,af as Yt,an as as,K as bt,m as Et,a3 as As,l as ot,f0 as _s,h as Ks,b2 as Us,L as Vs,u as qs,n as _t,y as Wt,H as Hs,b5 as Bs,J as Js,W as Gs,I as Xt}from"./index-CImJlq71.js";import{S as Qs}from"./search-input-CLbrLBK4.js";import{E as Ht}from"./empty-state-CkRk6emt.js";import{R as Ys}from"./require-capability-B4IJOpH-.js";import{f as js}from"./pair-CNR7-_qK.js";import{u as ts}from"./use-connection-CAJy9ePc.js";import{g as Ps}from"./connection-slug-CITJ0kGN.js";import{B as Lt}from"./badge-B8Ivcb6S.js";import{P as cs,a as ds,b as ms}from"./popover-BqGcOxqn.js";import{c as Pt,T as Dt,a as Rt,b as Ws}from"./tooltip-BB8x2ajM.js";import{a as Ut}from"./Copy01-C8oI3ru2.js";import{n as Ns}from"./ZoomOut-CTwXyALk.js";import{I as us,bM as Xs,a0 as Zs}from"./agent-icon-Bl0Q4nDQ.js";import{i as el}from"./Key01-CVBy3Esl.js";import{i as tl}from"./Play-B3knqxcb.js";import{MonacoCodeEditor as bs}from"./monaco-editor-FMQP-sIq.js";import{a as sl}from"./use-members-DrsTuCTp.js";import{u as ll}from"./use-mcp-client-BT3MLYTJ.js";import{b as rl}from"./repository-binding-wXpkgUS5.js";import{n as Ot}from"./LinkBroken01-D8vKURBw.js";import{c as il}from"./SwitchHorizontal01-DsxrRdFb.js";import{s as ol}from"./Plus-Bf8vM3Sx.js";import{s as nl}from"./Trash01-C68DqBe-.js";import{M as zt}from"./multi-select-CjpZ72b0.js";import{b as yt,a as wt,c as ze,d as St,S as It}from"./select-CO-KeEXe.js";import{e as ys,T as al}from"./time-range-picker-B10kjTj_.js";import{T as cl}from"./textarea-Bp989dUN.js";import{C as Ds}from"./collection-tabs-BCwnkCTo.js";import{S as dl}from"./switch-DGiOaGRn.js";import{L as ml}from"./label-CfvfFl3x.js";import{I as Ct}from"./integration-icon-B9snkXuC.js";import{A as fs}from"./avatar-DZp2nksb.js";import{A as ul,a as fl,b as xl}from"./alert-fsJICKf8.js";import{K as gt}from"./monitoring-stats-row-BGPZUteu.js";import{c as Bt}from"./use-decopilot-events-DvJkZDam.js";import{g as pl,b as ws,f as Nt,c as Zt,d as gl,e as Ss,a as xs,h as hl,i as ps,T as vl,j as jl,r as Nl,k as bl}from"./thread-sheet-body-D-x-TABK.js";import{u as yl}from"./useSuspenseInfiniteQuery-DJXxpWPx.js";import{c as wl,S as Sl,b as Rs,a as Ls}from"./sheet-DYqe447t.js";import{c as _e,b as vt,d as Jt,e as Gt,T as ge,a as Qt}from"./table-DcqK9CO1.js";import{n as ss,t as ls}from"./ChevronUp-BJfOFayd.js";import{u as Os,A as Il}from"./automation-runs-Bv01EPr_.js";import{u as Fs}from"./use-infinite-scroll-CwPqy0HC.js";import{u as Cl}from"./useInfiniteQuery-BwyrFPWF.js";import{g as Tl}from"./task-status-k_KZvqi3.js";import{u as kl,d as Ml}from"./use-automations-BV-J2Ily.js";import{i as _l}from"./ArrowLeft-B24gv2xe.js";import{E as Is}from"./empty-state-DjnYxJoJ.js";import{O as $s}from"./watch-sse-pool-HKRMih-U.js";import{t as Pl}from"./task-key-BCHdFiOO.js";import{a as Dl}from"./format-time-Cq80KKvY.js";import{u as Rl,r as Ll,O as Ol,d as Fl}from"./order-monitor-day-AyxJmcAH.js";import{F as $l}from"./feature-gate-DnDfxxPc.js";import"./SearchMd-C1vd4NNy.js";import"./access-gate-BAeTdIKF.js";import"./capability-load-error-h9GaAVI2.js";import"./Tool01-XzMXqYKz.js";import"./collapsible-BHKr0Yuy.js";import"./use-copy-CvMH5zdo.js";import"./usage-stats-DpZZQ75-.js";import"./tool-namespace-ln4cIuCt.js";import"./form-CWlPjOiE.js";import"./utils-CVEq3hMx.js";import"./markdown-BDnIqP7U.js";import"./location-V0VwTJTt.js";import"./use-mobile-Nz4my9ZZ.js";import"./use-panel-navigate-D57HPY2x.js";import"./thread-route-B1rrIJuw.js";import"./use-project-scope-CnnlA-du.js";import"./chat-context-C_P788VD.js";import"./autosend-BUGExBM4.js";import"./thread-intent-DXY7orZh.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-Cng_Zcqq.js";import"./use-organization-settings-DKJZVR_x.js";import"./schema-BXcU44Bp.js";import"./task-board-CRvOV9zQ.js";import"./use-clock-tick-D95T8222.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-vmvnP_G4.js";import"./types-D4eFbg3n.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-DbgHFTtO.js";import"./Image01-BYSI_JTy.js";import"./XClose-5-Y_ZVDY.js";import"./ShoppingBag01-Bkku1Te9.js";import"./shell-layout-Bmd6dXD4.js";import"./Building02-DBmpU4M6.js";import"./UserSquare-ezkB_C7H.js";import"./CheckCircle-Cqp__I1R.js";import"./Monitor01-th-leB7u.js";import"./command-9a3EU_B7.js";import"./index-UjSXE0Iy.js";import"./project-icon-B-MVviOF.js";import"./new-project-dialog-CEUx8Wuz.js";import"./repository-import-picker-DWw4DnKc.js";import"./use-navigate-to-agent-DqXhqPI9.js";import"./repository-picker-fHOvHVjl.js";import"./collection-search-BfeTverb.js";import"./use-debounced-value-DvzjOUVw.js";import"./required-auth-layout-p9wTtbkA.js";import"./use-org-sso-B4zmaZVL.js";import"./Link01-1YHKCfLl.js";import"./use-mcp-prompts-DvHpjECx.js";import"./use-thread-outputs-D8VLF1dw.js";import"./file-type-icon-BlPndn8R.js";import"./index-DQ2PXCBR.js";import"./ArrowUp-CgN1Qhsf.js";import"./ChevronSelectorVertical-Bg2KdIAv.js";import"./CreditCard01-DBg0t5KK.js";import"./DotsVertical-MgtYn_XR.js";import"./Globe04-8XNa-DGn.js";import"./Minus-D7Nn8Jj1.js";import"./Sun-C_rfv84K.js";import"./Upload01-D4h8lLWj.js";import"./User01-BKJMa06q.js";import"./Users01-sQ3Jopve.js";import"./editor-swke_0an.js";import"./use-org-auth-client-BVmUiQl1.js";import"./auth-k-50r1Jm.js";import"./checkbox-D_LpTCuo.js";import"./index-BdQq_4o_.js";import"./scroll-area-BZP0xkZ2.js";import"./calendar-BDnGPQeR.js";import"./chart-CF2951Pl.js";import"./index-BzTLQsHh.js";import"./symbol-ZVON6uKU.js";import"./CategoricalChart-Do09x_e5.js";import"./CartesianChart-DHq2iPiU.js";import"./AreaChart-CcL-fFKM.js";import"./tooltipContext-DG-hvJrr.js";import"./BarChart-CCFGMu0H.js";import"./ActiveShapeUtils-Docp8wLu.js";import"./Sector-CjducGVR.js";import"./ErrorBarContext-Bjgx2BpF.js";import"./infiniteQueryObserver-BPnYbZuQ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./useQueries-1QlJ0aQr.js";import"./ReferenceLine-DevuDJh8.js";import"./feature-paywall-DbYyln6a.js";import"./plan-ladder-Chib98li.js";const rs={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},zl=["eq","contains","exists","in"];function El(s){return zl.includes(s)}function jt(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Al(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...m]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&El(i)?i:"eq",value:decodeURIComponent(m.join(":")||"")}}).filter(e=>e!==void 0)}function Vt(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as ue,r as xe,d as ns,a2 as ht,b as Pe,j as t,B as je,t as dt,af as Yt,an as as,K as bt,m as Et,a3 as As,l as ot,f0 as _s,h as Ks,b2 as Us,L as Vs,u as qs,n as _t,y as Wt,H as Hs,b5 as Bs,J as Js,W as Gs,I as Xt}from"./index-CMKEBGKX.js";import{S as Qs}from"./search-input-RbNJNFgo.js";import{E as Ht}from"./empty-state-B0G_CGwR.js";import{R as Ys}from"./require-capability-C24QIC4M.js";import{f as js}from"./pair-DIRyClgs.js";import{u as ts}from"./use-connection-C2QTK4P4.js";import{g as Ps}from"./connection-slug-CITJ0kGN.js";import{B as Lt}from"./badge-Xi0bu-aJ.js";import{P as cs,a as ds,b as ms}from"./popover-n_tcLsd5.js";import{c as Pt,T as Dt,a as Rt,b as Ws}from"./tooltip-WTx8RFDb.js";import{a as Ut}from"./Copy01-ynYolVGY.js";import{n as Ns}from"./ZoomOut-DKNOmfuK.js";import{I as us,bM as Xs,a0 as Zs}from"./agent-icon-DtT3h4UX.js";import{i as el}from"./Key01-GACmaKDe.js";import{i as tl}from"./Play-RPF1C2F0.js";import{MonacoCodeEditor as bs}from"./monaco-editor-C2ej8TCv.js";import{a as sl}from"./use-members-BXYZ5GWT.js";import{u as ll}from"./use-mcp-client-COM3gP2O.js";import{b as rl}from"./repository-binding-BBtZf2zz.js";import{n as Ot}from"./LinkBroken01-Dbb_PbFz.js";import{c as il}from"./SwitchHorizontal01-QjLd4gai.js";import{s as ol}from"./Plus-DXIMcQkQ.js";import{s as nl}from"./Trash01-CTrNlbT8.js";import{M as zt}from"./multi-select-D4sL81eP.js";import{b as yt,a as wt,c as ze,d as St,S as It}from"./select-B-vRTlp8.js";import{e as ys,T as al}from"./time-range-picker-DgOYXLpU.js";import{T as cl}from"./textarea-DhtVYf8e.js";import{C as Ds}from"./collection-tabs-CpRvK4aY.js";import{S as dl}from"./switch-CWqn4x2S.js";import{L as ml}from"./label-8_hsm0_y.js";import{I as Ct}from"./integration-icon-mkTLlJYZ.js";import{A as fs}from"./avatar-49aPXdv7.js";import{A as ul,a as fl,b as xl}from"./alert-BEazQOeN.js";import{K as gt}from"./monitoring-stats-row-QRt_yzIW.js";import{c as Bt}from"./use-decopilot-events-CwR46UgN.js";import{g as pl,b as ws,f as Nt,c as Zt,d as gl,e as Ss,a as xs,h as hl,i as ps,T as vl,j as jl,r as Nl,k as bl}from"./thread-sheet-body-F9Cd7VsI.js";import{u as yl}from"./useSuspenseInfiniteQuery-XLLgwpcB.js";import{c as wl,S as Sl,b as Rs,a as Ls}from"./sheet-DIT9lGlU.js";import{c as _e,b as vt,d as Jt,e as Gt,T as ge,a as Qt}from"./table-Clkje7xI.js";import{n as ss,t as ls}from"./ChevronUp-CHckv_8T.js";import{u as Os,A as Il}from"./automation-runs-CHeG76Ew.js";import{u as Fs}from"./use-infinite-scroll-C3u8iypP.js";import{u as Cl}from"./useInfiniteQuery-EcJS-_aQ.js";import{g as Tl}from"./task-status-DxuW2r4d.js";import{u as kl,d as Ml}from"./use-automations-BKnx1LOU.js";import{i as _l}from"./ArrowLeft-DPa6sZRI.js";import{E as Is}from"./empty-state-Bw4axBb5.js";import{O as $s}from"./watch-sse-pool-9c6_Ze8B.js";import{t as Pl}from"./task-key-BCHdFiOO.js";import{a as Dl}from"./format-time-Cq80KKvY.js";import{u as Rl,r as Ll,O as Ol,d as Fl}from"./order-monitor-day-Bn2RftCy.js";import{F as $l}from"./feature-gate-BxG3yqt8.js";import"./SearchMd-DQ6xirDN.js";import"./access-gate-BBEga0hz.js";import"./capability-load-error-BzCsh693.js";import"./Tool01-D7eccoeh.js";import"./collapsible-D314pUSB.js";import"./use-copy-DedJIHzN.js";import"./usage-stats-BCvxtMFR.js";import"./tool-namespace-BVXAR9Sk.js";import"./form-CpnGThcL.js";import"./utils-CVEq3hMx.js";import"./markdown-yQLRhm2z.js";import"./location-V0VwTJTt.js";import"./use-mobile-Bq3CXRKG.js";import"./use-panel-navigate-CW6DUzf9.js";import"./thread-route-BkotEDA1.js";import"./use-project-scope-BFye4eeg.js";import"./chat-context-CwxNIspy.js";import"./autosend-DJIOdR-h.js";import"./thread-intent-BS7K-UuZ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-BUYCLrsq.js";import"./use-organization-settings-dAOl4U_-.js";import"./schema-CylodOUQ.js";import"./task-board-CEgpYip9.js";import"./use-clock-tick-BVcS6c_m.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-gJ1lyd1u.js";import"./types-C2kyJgqF.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-CePpxiVL.js";import"./Image01-J72Rm0Yr.js";import"./XClose-C9XzQkao.js";import"./ShoppingBag01-B81IcYcu.js";import"./shell-layout-NV-fbXIm.js";import"./Building02-BbEppJaI.js";import"./UserSquare-CZXKi88L.js";import"./CheckCircle-Dlz5XR1a.js";import"./Monitor01-CW3G0lSo.js";import"./command-DcKOVszs.js";import"./index-CZWqOlKo.js";import"./project-icon-BozuiJlT.js";import"./new-project-dialog-DCNrhfVx.js";import"./repository-import-picker-Dm0ES3Rv.js";import"./use-navigate-to-agent-F9oDR6Aw.js";import"./repository-picker-CPuj3bZ1.js";import"./collection-search-DCYm5aP4.js";import"./use-debounced-value-ELHlrW87.js";import"./required-auth-layout-PhuA3Ewp.js";import"./use-org-sso-ChkTjfH5.js";import"./Link01-Dy_bSHLe.js";import"./use-mcp-prompts-1pj8Mn9o.js";import"./use-thread-outputs-COl9UfXy.js";import"./file-type-icon-BnEUVv2h.js";import"./index-DwGMmQy3.js";import"./ArrowUp-Bc6Es12Z.js";import"./ChevronSelectorVertical-BjvpkKQW.js";import"./CreditCard01-CJRwgkVP.js";import"./DotsVertical-xGYJd_oZ.js";import"./Globe04-rKrlqbJ3.js";import"./Minus-cuNEQYA9.js";import"./Sun-Bd7hlMAK.js";import"./Upload01-B9oMCz-6.js";import"./User01-BgWUolo8.js";import"./Users01-B7zAiC4m.js";import"./editor-BpL3QDOn.js";import"./use-org-auth-client-C3gy1liR.js";import"./auth-D6exVMlw.js";import"./checkbox-IscGSBh9.js";import"./index-BdQq_4o_.js";import"./scroll-area-BH2Oy8PV.js";import"./calendar-HcE4WZuE.js";import"./chart-BKCzQrbM.js";import"./index-D2b1OQG0.js";import"./symbol-9K-WFQbg.js";import"./CategoricalChart-1f5JjzPP.js";import"./CartesianChart-D2mofn_H.js";import"./AreaChart-futTS77r.js";import"./tooltipContext-Ccm0pmDN.js";import"./BarChart-CJBobvga.js";import"./ActiveShapeUtils-a2DoNLsg.js";import"./Sector-fbb2Py22.js";import"./ErrorBarContext-Bu4h-9ud.js";import"./infiniteQueryObserver-sZS50x9h.js";import"./differenceInSeconds-C3x8sHUj.js";import"./useQueries-Dgo1k5er.js";import"./ReferenceLine-CYgqeMqY.js";import"./feature-paywall-BHK5XVuW.js";import"./plan-ladder-DNfn-N6n.js";const rs={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},zl=["eq","contains","exists","in"];function El(s){return zl.includes(s)}function jt(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Al(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...m]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&El(i)?i:"eq",value:decodeURIComponent(m.join(":")||"")}}).filter(e=>e!==void 0)}function Vt(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Cs(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[l,...i]=e.split("=");return{key:l||"",operator:"eq",value:i.join("=")}}if(e.includes("~")){const[l,...i]=e.split("~");return{key:l||"",operator:"contains",value:i.join("~")}}if(e.includes("@")){const[l,...i]=e.split("@");return{key:l||"",operator:"in",value:i.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Kl(s){const e={},l={},i=[],m={};for(const n of s)if(n.key.trim())switch(n.operator){case"eq":n.value&&(e[n.key]=n.value);break;case"contains":n.value&&(l[n.key]=`%${n.value}%`);break;case"exists":i.push(n.key);break;case"in":n.value&&(m[n.key]=n.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(l).length>0?l:void 0,propertyKeys:i.length>0?i:void 0,propertyInValues:Object.keys(m).length>0?m:void 0}}function Ts(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};const e=s._decocms_truncated;if(typeof e=="string"&&e.length>0)return{content:e,isTruncated:!0,originalSize:e.length};let l;try{l=JSON.stringify(s,null,2)}catch{return{content:"[Unable to serialize JSON]",isTruncated:!1,originalSize:0}}const i=l.length;return i<=rs.maxJsonRenderSize?{content:l,isTruncated:!1,originalSize:i}:{content:l.slice(0,rs.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{r as n,bA as j,dj as R,dk as Ee,dl as ke,dm as Se,aK as xe,dn as V}from"./index-CImJlq71.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Ke=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Ke.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Fe(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",K="data-value",qe=(t,l,r)=>Fe(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=F(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=F(()=>new Set),u=F(()=>new Map),c=F(()=>new Map),d=F(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=j(),ne=j(),N=j(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${K}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(K);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(K))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(K))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Ne(s,P):Te(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(K)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Pe,Input:Oe,Group:Ve,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function F(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(K,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=F(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
1
+ import{r as n,bA as j,dj as R,dk as Ee,dl as ke,dm as Se,aK as xe,dn as V}from"./index-CMKEBGKX.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Ke=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Ke.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Fe(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",K="data-value",qe=(t,l,r)=>Fe(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=F(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=F(()=>new Set),u=F(()=>new Map),c=F(()=>new Map),d=F(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=j(),ne=j(),N=j(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${K}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(K);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(K))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(K))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Ne(s,P):Te(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(K)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Pe,Input:Oe,Group:Ve,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function F(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(K,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=F(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
@@ -1 +1 @@
1
- import{c as G,j as i,b as J,r as q,B as Ne,a as be,t as de,G as He,au as ye,aw as _e,l as Y,m as Xe,K as qe,ae as Ye,a2 as Le,d as Ue,aD as Je,k as Ve,E as Qe,L as ke,Y as Ze,y as je,aa as Pe,P as et}from"./index-CImJlq71.js";import{u as Re,c as De,i as tt,j as st,k as nt,l as it}from"./use-sidebar-collapsed-D3qR_zRH.js";import{S as rt,a as ot,b as lt}from"./sheet-DYqe447t.js";import{u as at}from"./use-mobile-Nz4my9ZZ.js";import{u as ct,a as dt,D as ut,c as ft,C as ht,P as mt}from"./core.esm-KXf7B9P5.js";import{S as gt,v as pt,u as xt}from"./sortable.esm-PpUBUYvN.js";import{i as bt}from"./Tool01-XzMXqYKz.js";import{D as jt,A as yt,E as Ae,F as vt}from"./agent-icon-Bl0Q4nDQ.js";import{s as St}from"./Plus-Bf8vM3Sx.js";import{s as Me}from"./XClose-5-Y_ZVDY.js";import{T as he,a as me,c as ge}from"./tooltip-BB8x2ajM.js";import{C as ze,f as wt,g as zt,e as Ot}from"./context-menu-CQmIAsNX.js";import{A as _t}from"./avatar-DZp2nksb.js";import{C as Rt}from"./create-organization-dialog-CU3HQ3J9.js";import{P as Ct}from"./project-apps-D7YctFcN.js";import{u as Nt,a as At}from"./use-recent-apps-CeorMBvV.js";import{b as Et}from"./use-navigate-to-agent-DqXhqPI9.js";import{u as Tt,a as It}from"./use-project-scope-CnnlA-du.js";import{i as Lt}from"./UserSquare-ezkB_C7H.js";import{C as Ee,e as kt,b as Pt,c as Dt,f as Mt}from"./command-9a3EU_B7.js";import{u as $t}from"./use-debounced-value-DvzjOUVw.js";const Kt={xs:"xs",sm:"xs",lg:"md"};function Ce(t){const e=G.c(4),{org:s,size:o}=t,r=o===void 0?"sm":o,l=s.logo??void 0,n=Kt[r];let a;return e[0]!==s.name||e[1]!==l||e[2]!==n?(a=i.jsx(_t,{url:l,fallback:s.name,size:n,tone:"solid"}),e[0]=s.name,e[1]=l,e[2]=n,e[3]=a):a=e[3],a}function Gs({invitation:t,onChanged:e}){const s=J(),[o,r]=q.useState(!1),l=t.organizationName??s("header.orgSwitcher.unknownOrganization"),n=async()=>{r(!0);try{const d=await be.organization.acceptInvitation({invitationId:t.id});if(d.error){de.error(d.error.message),r(!1);return}}catch{de.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}de.success(s("header.orgSwitcher.joined",{name:l})),He();let c;try{c=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{r(!0);try{const c=await be.organization.rejectInvitation({invitationId:t.id});if(c.error){de.error(c.error.message),r(!1);return}de.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{de.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(Ce,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(Ne,{size:"sm",variant:"default",onClick:n,disabled:o,children:s("header.orgSwitcher.accept")}),i.jsx(Ne,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground",onClick:a,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(Me,{size:14})})]})]})}const Wt=3,$e=10,Ft=440,Bt=55;function Ke(t){const e=Math.floor((t-Ft)/Bt);return Math.min($e,Math.max(Wt,e))}function Gt(t,e,s=$e*3,o=[]){return[...new Set([e,...o,...t])].slice(0,s)}function Ht(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function Xt(t,e,s,o,r=[]){if(t.length<=o)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),n=new Set;s&&l.has(s)&&n.add(s);for(const a of r)l.has(a)&&n.add(a);for(const a of e){if(n.size>=o)break;l.has(a)&&n.add(a)}for(const a of t){if(n.size>=o)break;n.add(a.slug)}return{shown:t.filter(a=>n.has(a.slug)),hidden:t.filter(a=>!n.has(a.slug))}}const Te=[];function qt(){const t=G.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=_e.recentOrgs(),t[0]=e):e=t[0];const[s,o]=ye(e,Te),r=Array.isArray(s)?s:Te;let l;t[1]!==o?(l=(a,c)=>o(d=>Gt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=o,t[2]=l):l=t[2];let n;return t[3]!==r||t[4]!==l?(n={recent:r,remember:l},t[3]=r,t[4]=l,t[5]=n):n=t[5],n}const We={hidden:[],pinned:[],order:[]},fe=(t,e)=>t.filter(s=>s!==e);function ue(t){if(typeof t!="object"||t===null)return We;const e=o=>Array.isArray(o)?o.filter(r=>typeof r=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function Yt(t,e){return{...t,hidden:[...fe(t.hidden,e),e],pinned:fe(t.pinned,e)}}function Ut(t,e){return{...t,hidden:fe(t.hidden,e)}}function Jt(t,e){return t.pinned.includes(e)?{...t,pinned:fe(t.pinned,e)}:{...t,hidden:fe(t.hidden,e),pinned:[...t.pinned,e]}}function Vt(t,e,s){const o=r=>{const l=e.order.indexOf(r);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(r=>r.slug===s||!e.hidden.includes(r.slug)).map((r,l)=>({org:r,index:l})).sort((r,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(r.org.slug))||o(r.org.slug)-o(l.org.slug)||r.index-l.index).map(({org:r})=>r)}function Qt(t,e,s,o){const r=e.indexOf(s),l=e.indexOf(o);if(r===-1||l===-1||r===l||t.pinned.includes(s)!==t.pinned.includes(o))return t;const n=[...e];return n.splice(r,1),n.splice(l,0,s),{...t,order:[...n,...t.order.filter(a=>!n.includes(a))]}}function ve(t){const e=G.c(11),{active:s,label:o,children:r}=t,l=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let n;e[0]!==l?(n=Y("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=n):n=e[1];let a;e[2]!==n?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:i.jsx("span",{className:n})}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==o?(c=o&&i.jsx("span",{"aria-hidden":!0,className:Y("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:o}),e[4]=s,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,r,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Zt(t){return typeof t=="object"&&t!==null&&Array.isArray(t.items)}function es(t){const e=G.c(13),s=t.trim(),{data:o}=be.useSession(),r=o?.user?.id??"",l=s.length>0&&!!r,n=qe.organizationSearch(r,s);let a;e[0]!==s?(a=async w=>{const{signal:O}=w,p=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:O});if(!p.ok)throw new Error(`Organization search failed: ${p.status}`);const y=await p.json();if(!Zt(y))throw new Error("Invalid organization search response");return y},e[0]=s,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==n||e[4]!==a?(c={queryKey:n,queryFn:a,enabled:l,placeholderData:Ye,staleTime:3e4,retry:!1},e[2]=l,e[3]=n,e[4]=a,e[5]=c):c=e[5];const{data:d,isFetching:g,isPlaceholderData:m,isError:h}=Xe(c);let f;e[6]!==d?.items?(f=d?.items??[],e[6]=d?.items,e[7]=f):f=e[7];const u=l&&g,x=l&&m;let j;return e[8]!==h||e[9]!==f||e[10]!==u||e[11]!==x?(j={hits:f,isSearching:u,isStale:x,isError:h},e[8]=h,e[9]=f,e[10]=u,e[11]=x,e[12]=j):j=e[12],j}function ts(t){const e=G.c(61),{orgs:s,currentSlug:o,hiddenCount:r,onSelect:l}=t,n=J(),[a,c]=q.useState(!1),[d,g]=q.useState("");let m;e[0]!==d?(m=d.trim(),e[0]=d,e[1]=m):m=e[1];const h=m,f=$t(h,150),u=h.length>0,x=f===h,{hits:j,isSearching:w,isStale:O,isError:p}=es(u?f:""),y=u?j:s;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=H=>{c(H),H||g("")},e[2]=v):v=e[2];const z=v;let b;e[3]!==n?(b=n("sidebar.rail.searchOrganizations"),e[3]=n,e[4]=b):b=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>z(!0),e[5]=A):A=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=i.jsx(Lt,{size:18}),e[6]=I):I=e[6];let _;e[7]!==b?(_=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":b,onClick:A,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:I})}),e[7]=b,e[8]=_):_=e[8];let E;e[9]!==r||e[10]!==n?(E=r>0?n("sidebar.rail.searchMoreOrganizations",{count:r}):n("sidebar.rail.searchOrganizations"),e[9]=r,e[10]=n,e[11]=E):E=e[11];let R;e[12]!==E?(R=i.jsx(me,{side:"right",children:E}),e[12]=E,e[13]=R):R=e[13];let T;e[14]!==_||e[15]!==R?(T=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[_,R]})}),e[14]=_,e[15]=R,e[16]=T):T=e[16];let P;e[17]!==n?(P=n("sidebar.rail.searchOrganizations"),e[17]=n,e[18]=P):P=e[18];let S;e[19]!==n?(S=n("sidebar.rail.searchPlaceholder"),e[19]=n,e[20]=S):S=e[20];let C;e[21]!==n?(C=n("sidebar.rail.searchPlaceholder"),e[21]=n,e[22]=C):C=e[22];let M;e[23]!==d||e[24]!==C?(M=i.jsx(kt,{value:d,onValueChange:g,placeholder:C}),e[23]=d,e[24]=C,e[25]=M):M=e[25];const F=u&&(O||!x)&&"opacity-50";let K;e[26]!==F?(K=Y(F),e[26]=F,e[27]=K):K=e[27];let D;e[28]!==p||e[29]!==u||e[30]!==n?(D=u&&p&&i.jsx(Ee,{children:n("sidebar.rail.searchFailed")}),e[28]=p,e[29]=u,e[30]=n,e[31]=D):D=e[31];let $;e[32]!==p||e[33]!==w||e[34]!==y.length||e[35]!==x||e[36]!==n?($=!p&&x&&!w&&y.length===0&&i.jsx(Ee,{children:n("sidebar.rail.searchEmpty")}),e[32]=p,e[33]=w,e[34]=y.length,e[35]=x,e[36]=n,e[37]=$):$=e[37];let L;if(e[38]!==o||e[39]!==l||e[40]!==y||e[41]!==n){let H;e[43]!==o||e[44]!==l||e[45]!==n?(H=X=>i.jsxs(Pt,{value:X.slug,onSelect:()=>{z(!1),X.slug!==o&&l(X.slug)},className:"gap-2.5",children:[i.jsx(Ce,{org:X,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:X.name}),X.slug===o&&i.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},X.id),e[43]=o,e[44]=l,e[45]=n,e[46]=H):H=e[46],L=y.map(H),e[38]=o,e[39]=l,e[40]=y,e[41]=n,e[42]=L}else L=e[42];let k;e[47]!==K||e[48]!==D||e[49]!==$||e[50]!==L?(k=i.jsxs(Dt,{className:K,children:[D,$,L]}),e[47]=K,e[48]=D,e[49]=$,e[50]=L,e[51]=k):k=e[51];let W;e[52]!==a||e[53]!==P||e[54]!==S||e[55]!==M||e[56]!==k?(W=i.jsxs(Mt,{open:a,onOpenChange:z,title:P,description:S,shouldFilter:!1,children:[M,k]}),e[52]=a,e[53]=P,e[54]=S,e[55]=M,e[56]=k,e[57]=W):W=e[57];let U;return e[58]!==W||e[59]!==T?(U=i.jsxs(i.Fragment,{children:[T,W]}),e[58]=W,e[59]=T,e[60]=U):U=e[60],U}function ss(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const ns=()=>Ke(globalThis.innerHeight),is=()=>Ke(0);function rs(t){const e=G.c(59),{org:s,active:o,onSelect:r,pinned:l,onOpenSettings:n,onTogglePin:a,onHide:c}=t,d=J();let g;e[0]!==s.slug?(g={id:s.slug},e[0]=s.slug,e[1]=g):g=e[1];const{setNodeRef:m,listeners:h,transform:f,transition:u,isDragging:x}=xt(g);let j;e[2]!==f?(j=ht.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=j):j=e[3];const w=x?1:void 0,O=`rail-org-${s.slug}`;let p;e[4]!==j||e[5]!==w||e[6]!==O||e[7]!==u?(p={transform:j,transition:u,zIndex:w,viewTransitionName:O},e[4]=j,e[5]=w,e[6]=O,e[7]=u,e[8]=p):p=e[8];const y=s.name,v=o||void 0,z=o?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",b=r&&"cursor-pointer";let A;e[9]!==z||e[10]!==b?(A=Y("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",z,b),e[9]=z,e[10]=b,e[11]=A):A=e[11];let I;e[12]!==s?(I=i.jsx(Ce,{org:s,size:"lg"}),e[12]=s,e[13]=I):I=e[13];let _;e[14]!==l?(_=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(Ae,{size:9})}),e[14]=l,e[15]=_):_=e[15];let E;e[16]!==r||e[17]!==s.name||e[18]!==A||e[19]!==I||e[20]!==_||e[21]!==v?(E=i.jsx(he,{asChild:!0,children:i.jsx(wt,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":y,"aria-current":v,onClick:r,className:A,children:[I,_]})})}),e[16]=r,e[17]=s.name,e[18]=A,e[19]=I,e[20]=_,e[21]=v,e[22]=E):E=e[22];let R;e[23]!==s.name?(R=i.jsx(me,{side:"right",children:s.name}),e[23]=s.name,e[24]=R):R=e[24];let T;e[25]!==E||e[26]!==R?(T=i.jsxs(ge,{children:[E,R]}),e[25]=E,e[26]=R,e[27]=T):T=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(vt,{}),e[28]=P):P=e[28];let S;e[29]!==d?(S=d("sidebar.rail.organizationSettings"),e[29]=d,e[30]=S):S=e[30];let C;e[31]!==n||e[32]!==S?(C=i.jsxs(ze,{onSelect:n,children:[P,S]}),e[31]=n,e[32]=S,e[33]=C):C=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx(Ae,{}),e[34]=M):M=e[34];let F;e[35]!==l||e[36]!==d?(F=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=l,e[36]=d,e[37]=F):F=e[37];let K;e[38]!==a||e[39]!==F?(K=i.jsxs(ze,{onSelect:a,children:[M,F]}),e[38]=a,e[39]=F,e[40]=K):K=e[40];let D;e[41]!==c||e[42]!==d?(D=c&&i.jsxs(ze,{onSelect:c,children:[i.jsx(bt,{}),d("sidebar.rail.hideOrganization")]}),e[41]=c,e[42]=d,e[43]=D):D=e[43];let $;e[44]!==C||e[45]!==K||e[46]!==D?($=i.jsxs(zt,{children:[C,K,D]}),e[44]=C,e[45]=K,e[46]=D,e[47]=$):$=e[47];let L;e[48]!==T||e[49]!==$?(L=i.jsxs(Ot,{children:[T,$]}),e[48]=T,e[49]=$,e[50]=L):L=e[50];let k;e[51]!==o||e[52]!==L?(k=i.jsx(ve,{active:o,children:L}),e[51]=o,e[52]=L,e[53]=k):k=e[53];let W;return e[54]!==h||e[55]!==m||e[56]!==k||e[57]!==p?(W=i.jsx("div",{ref:m,...h,style:p,className:"w-full shrink-0 touch-none",children:k}),e[54]=h,e[55]=m,e[56]=k,e[57]=p,e[58]=W):W=e[58],W}function os(t){const e=G.c(64),{project:s,orgSlug:o,active:r,onClose:l,onNavigate:n}=t,a=J();let c,d,g,m,h,f,u,x,j,w,O;if(e[0]!==r||e[1]!==n||e[2]!==o||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const M=jt(s.icon,s.title);O="group/rail relative flex w-full flex-col items-center gap-1",g=ge,d=he,w=!0,c=ke,m=Ze.root,e[17]!==o||e[18]!==s.id?(h={org:o,agentId:s.id},e[17]=o,e[18]=s.id,e[19]=h):h=e[19],f=s.title,u=r||void 0,e[20]!==n?(x=()=>{je("org_rail_recent_project_opened"),n?.()},e[20]=n,e[21]=x):x=e[21],j=Y("flex shrink-0 rounded-lg focus-ring",M.text,r&&"ring-[1.5px] ring-current"),e[0]=r,e[1]=n,e[2]=o,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=c,e[7]=d,e[8]=g,e[9]=m,e[10]=h,e[11]=f,e[12]=u,e[13]=x,e[14]=j,e[15]=w,e[16]=O}else c=e[6],d=e[7],g=e[8],m=e[9],h=e[10],f=e[11],u=e[12],x=e[13],j=e[14],w=e[15],O=e[16];let p;e[22]!==s.icon||e[23]!==s.title?(p=i.jsx(yt,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=p):p=e[24];let y;e[25]!==c||e[26]!==m||e[27]!==h||e[28]!==f||e[29]!==u||e[30]!==x||e[31]!==j||e[32]!==p?(y=i.jsx(c,{to:m,params:h,"aria-label":f,"aria-current":u,onClick:x,className:j,children:p}),e[25]=c,e[26]=m,e[27]=h,e[28]=f,e[29]=u,e[30]=x,e[31]=j,e[32]=p,e[33]=y):y=e[33];let v;e[34]!==d||e[35]!==y||e[36]!==w?(v=i.jsx(d,{asChild:w,children:y}),e[34]=d,e[35]=y,e[36]=w,e[37]=v):v=e[37];let z;e[38]!==s.title?(z=i.jsx(me,{side:"right",children:s.title}),e[38]=s.title,e[39]=z):z=e[39];let b;e[40]!==g||e[41]!==v||e[42]!==z?(b=i.jsxs(g,{children:[v,z]}),e[40]=g,e[41]=v,e[42]=z,e[43]=b):b=e[43];const A=r?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let I;e[44]!==A?(I=Y("line-clamp-2 w-full text-center text-2xs break-words transition-colors",A),e[44]=A,e[45]=I):I=e[45];let _;e[46]!==s.title||e[47]!==I?(_=i.jsx("span",{"aria-hidden":!0,className:I,children:s.title}),e[46]=s.title,e[47]=I,e[48]=_):_=e[48];let E;e[49]!==s.title||e[50]!==a?(E=a("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=a,e[51]=E):E=e[51];let R;e[52]!==l?(R=()=>{je("org_rail_recent_project_closed"),l()},e[52]=l,e[53]=R):R=e[53];let T,P;e[54]===Symbol.for("react.memo_cache_sentinel")?(T=Y("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),P=i.jsx(Me,{size:10}),e[54]=T,e[55]=P):(T=e[54],P=e[55]);let S;e[56]!==E||e[57]!==R?(S=i.jsx("button",{type:"button","aria-label":E,onClick:R,className:T,children:P}),e[56]=E,e[57]=R,e[58]=S):S=e[58];let C;return e[59]!==b||e[60]!==_||e[61]!==S||e[62]!==O?(C=i.jsxs("div",{className:O,children:[b,_,S]}),e[59]=b,e[60]=_,e[61]=S,e[62]=O,e[63]=C):C=e[63],C}const ls={"site-editor":"/site-editor"};function as(t){const e=G.c(26),{app:s}=t,o=J(),r=Ct[s],l=ls[s];if(!r||!l)return null;let n;e[0]!==r.labelKey||e[1]!==o?(n=o(r.labelKey),e[0]=r.labelKey,e[1]=o,e[2]=n):n=e[2];let a;e[3]!==r.labelKey||e[4]!==o?(a=o(r.labelKey),e[3]=r.labelKey,e[4]=o,e[5]=a):a=e[5];let c;e[6]!==r.tone?(c=Y("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",r.tone),e[6]=r.tone,e[7]=c):c=e[7];let d;e[8]!==r.Icon?(d=i.jsx(r.Icon,{size:18}),e[8]=r.Icon,e[9]=d):d=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(g=i.jsx(he,{asChild:!0,children:i.jsx(ke,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=g):g=e[14];let m;e[15]!==r.labelKey||e[16]!==o?(m=o(r.labelKey),e[15]=r.labelKey,e[16]=o,e[17]=m):m=e[17];let h;e[18]!==m?(h=i.jsx(me,{side:"right",children:m}),e[18]=m,e[19]=h):h=e[19];let f;e[20]!==g||e[21]!==h?(f=i.jsxs(ge,{children:[g,h]}),e[20]=g,e[21]=h,e[22]=f):f=e[22];let u;return e[23]!==n||e[24]!==f?(u=i.jsx(ve,{active:!0,label:n,children:f}),e[23]=n,e[24]=f,e[25]=u):u=e[25],u}function cs(){const{org:t}=Le();return Nt(t.slug),null}function Fe(t){const e=G.c(56),{onNavigate:s}=t===void 0?{}:t,o=J(),r=Ue(),{org:l}=Le(),n=Je();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:hs},e[0]=a):a=e[0];const c=Ve(a);let d;e[1]!==c||e[2]!==n?(d=c?n({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=c,e[2]=n,e[3]=d):d=e[3];const g=d,m=g?g.org:l.slug,{data:h}=Qe(),[f,u]=q.useState(!1),x=Re(),{recent:j,forget:w}=Et(l.slug),{projects:O}=Tt(),p=It(),y=At(),v=y&&y.projectId===null?y.app:null,z=v?[]:j.flatMap(N=>O.filter(B=>B.id===N)),b=Ht(h??[],l),{recent:A,remember:I}=qt();let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=_e.railOrgPrefs(),e[4]=_):_=e[4];const[E,R]=ye(_,We),T=ue(E),P=q.useSyncExternalStore(ss,ns,is),{shown:S}=Xt(Vt(b,T,l.slug),A,l.slug,P,T.pinned);let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[5]=C):C=e[5];const M=ct(dt(mt,C)),F=N=>{const{active:B,over:ce}=N;ce&&(je("org_rail_reordered"),R(Ge=>Qt(ue(Ge),S.map(fs),String(B.id),String(ce.id))))},K=N=>{s?.(),r({to:"/$org/home",params:{org:N},viewTransition:!0})},D=N=>{je("org_rail_travel");const B=S.some(ce=>ce.slug===N);R(ce=>Ut(ue(ce),N)),I(N,B?S.map(us):void 0),K(N)},$=!x&&"border-r border-sidebar-border";let L;e[6]!==$?(L=Y("flex w-[68px] shrink-0 flex-col items-center gap-2.5 overflow-y-auto bg-sidebar px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",$),e[6]=$,e[7]=L):L=e[7];let k;e[8]!==o?(k=o("sidebar.rail.ariaLabel"),e[8]=o,e[9]=k):k=e[9];const W=ut,U=ft,H=gt,X=S.map(ds),Se=pt,we=S.map(N=>i.jsxs(q.Fragment,{children:[i.jsx(rs,{org:N,active:N.slug===m,pinned:T.pinned.includes(N.slug),onSelect:N.slug!==l.slug?()=>D(N.slug):p?()=>K(N.slug):void 0,onOpenSettings:()=>{s?.(),r({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>R(B=>Jt(ue(B),N.slug)),onHide:N.slug===l.slug?void 0:()=>R(B=>Yt(ue(B),N.slug))}),N.slug===l.slug&&z.length>0&&i.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:z.map(B=>i.jsx(os,{project:B,orgSlug:l.slug,active:p===B.id,onClose:()=>w(B.id),onNavigate:s},B.id))})]},N.id));let V;e[10]!==H||e[11]!==X||e[12]!==Se||e[13]!==we?(V=i.jsx(H,{items:X,strategy:Se,children:we}),e[10]=H,e[11]=X,e[12]=Se,e[13]=we,e[14]=V):V=e[14];let Q;e[15]!==W||e[16]!==F||e[17]!==M||e[18]!==V||e[19]!==U?(Q=i.jsx(W,{sensors:M,collisionDetection:U,onDragEnd:F,children:V}),e[15]=W,e[16]=F,e[17]=M,e[18]=V,e[19]=U,e[20]=Q):Q=e[20];let Z;e[21]!==l.slug||e[22]!==b||e[23]!==S.length||e[24]!==D?(Z=b.length>S.length&&i.jsx(ts,{orgs:b,currentSlug:l.slug,hiddenCount:b.length-S.length,onSelect:D}),e[21]=l.slug,e[22]=b,e[23]=S.length,e[24]=D,e[25]=Z):Z=e[25];let ee;e[26]!==o?(ee=o("sidebar.picker.newOrganization"),e[26]=o,e[27]=ee):ee=e[27];let te;e[28]!==u?(te=()=>u(!0),e[28]=u,e[29]=te):te=e[29];let pe;e[30]===Symbol.for("react.memo_cache_sentinel")?(pe=i.jsx(St,{size:18}),e[30]=pe):pe=e[30];let se;e[31]!==ee||e[32]!==te?(se=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":ee,onClick:te,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:pe})}),e[31]=ee,e[32]=te,e[33]=se):se=e[33];let ne;e[34]!==o?(ne=o("sidebar.picker.newOrganization"),e[34]=o,e[35]=ne):ne=e[35];let ie;e[36]!==ne?(ie=i.jsx(me,{side:"right",children:ne}),e[36]=ne,e[37]=ie):ie=e[37];let re;e[38]!==se||e[39]!==ie?(re=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[se,ie]})}),e[38]=se,e[39]=ie,e[40]=re):re=e[40];let oe;e[41]!==v?(oe=v&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),i.jsx(as,{app:v})]}),e[41]=v,e[42]=oe):oe=e[42];let le;e[43]!==Q||e[44]!==Z||e[45]!==re||e[46]!==oe||e[47]!==L||e[48]!==k?(le=i.jsxs("div",{className:L,"aria-label":k,children:[Q,Z,re,oe]}),e[43]=Q,e[44]=Z,e[45]=re,e[46]=oe,e[47]=L,e[48]=k,e[49]=le):le=e[49];let ae;e[50]!==f||e[51]!==u?(ae=i.jsx(Rt,{open:f,onOpenChange:u}),e[50]=f,e[51]=u,e[52]=ae):ae=e[52];let xe;return e[53]!==le||e[54]!==ae?(xe=i.jsxs(i.Fragment,{children:[le,ae]}),e[53]=le,e[54]=ae,e[55]=xe):xe=e[55],xe}function ds(t){return t.slug}function us(t){return t.slug}function fs(t){return t.slug}function hs(t){return t.isLoading}function ms(t){const e=G.c(15),{width:s,minWidth:o,maxWidth:r,onPointerDown:l,onKeyDown:n,onDoubleClick:a}=t,c=J(),{isMobile:d}=De(),g=Re();if(d||g)return null;let m;e[0]!==c?(m=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=m):m=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let f,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},u=i.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=f,e[5]=u):(f=e[4],u=e[5]);let x;return e[6]!==r||e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==l||e[11]!==m||e[12]!==h||e[13]!==s?(x=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":m,"aria-valuenow":s,"aria-valuemin":o,"aria-valuemax":r,title:h,tabIndex:0,onPointerDown:l,onKeyDown:n,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:u}),e[6]=r,e[7]=o,e[8]=a,e[9]=n,e[10]=l,e[11]=m,e[12]=h,e[13]=s,e[14]=x):x=e[14],x}const Oe=400,Ie=16,gs="sidebar.width.v2";function ps(){const t=G.c(14),e=xs;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=u=>typeof u=="number"?e(u):192,t[0]=s):s=t[0];const[o,r]=ye(gs,s),l=q.useRef(null);let n;t[1]!==r||t[2]!==o?(n=u=>{u.preventDefault();const x=u.clientX,j=e(o),w=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),O=w?Array.from(w.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const v of O)v.style.transition="none";const p=v=>{const z=e(j+(v.clientX-x));w?.style.setProperty("--sidebar-width",`${z}px`)},y=v=>{const z=e(j+(v.clientX-x));r(z);for(const b of O)b.style.transition="";window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",p),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)},t[1]=r,t[2]=o,t[3]=n):n=t[3];const a=n;let c;t[4]!==r?(c=()=>{r(192)},t[4]=r,t[5]=c):c=t[5];const d=c;let g;t[6]!==r||t[7]!==o?(g=u=>{if(u.key==="ArrowLeft")r(e(o-Ie));else if(u.key==="ArrowRight")r(e(o+Ie));else if(u.key==="Home")r(192);else if(u.key==="End")r(Oe);else return;u.preventDefault()},t[6]=r,t[7]=o,t[8]=g):g=t[8];const m=g,h=e(o);let f;return t[9]!==m||t[10]!==a||t[11]!==d||t[12]!==h?(f={width:h,minWidth:192,maxWidth:Oe,wrapperRef:l,onStartResize:a,onKeyDownResize:m,resetWidth:d},t[9]=m,t[10]=a,t[11]=d,t[12]=h,t[13]=f):f=t[13],f}function xs(t){return Math.max(192,Math.min(Oe,t))}const Be=q.createContext(null);function bs(){const t=q.use(Be);if(!t)throw new Error("Layout regions require a Layout");return t}function js({children:t,notice:e,outsideOrg:s}){const o=at(),[r,l]=ye(_e.sidebarOpen(),!0),n=ps(),a=Pe();return i.jsx(Be,{value:{isMobile:o,resize:n},children:i.jsx(tt,{open:r,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!s&&i.jsx(cs,{}),!o&&a&&(s?.rail??!0)&&i.jsx(Fe,{}),i.jsx(st,{ref:n.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${n.width}px`,"--sidebar-width-icon":a?"0px":"3.125rem"},children:i.jsx(nt,{children:t})})]})]})})})}function ys(t){const e=G.c(37),{children:s,renderMobile:o}=t,r=J(),{isMobile:l,resize:n}=bs(),{openMobile:a,setOpenMobile:c}=De(),d=Re(),g=Pe();let m;e[0]!==c?(m=()=>c(!1),e[0]=c,e[1]=m):m=e[1];const h=m;if(!l){const v=g&&d;let z;e[2]!==s||e[3]!==v?(z=i.jsx("div",{className:"contents",inert:v,children:s}),e[2]=s,e[3]=v,e[4]=z):z=e[4];let b;e[5]!==n.maxWidth||e[6]!==n.minWidth||e[7]!==n.onKeyDownResize||e[8]!==n.onStartResize||e[9]!==n.resetWidth||e[10]!==n.width?(b=i.jsx(ms,{width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,onPointerDown:n.onStartResize,onKeyDown:n.onKeyDownResize,onDoubleClick:n.resetWidth}),e[5]=n.maxWidth,e[6]=n.minWidth,e[7]=n.onKeyDownResize,e[8]=n.onStartResize,e[9]=n.resetWidth,e[10]=n.width,e[11]=b):b=e[11];let A;return e[12]!==z||e[13]!==b?(A=i.jsxs(i.Fragment,{children:[z,b]}),e[12]=z,e[13]=b,e[14]=A):A=e[14],A}let f;e[15]!==r?(f=r("layouts.shellControls.navigationTitle"),e[15]=r,e[16]=f):f=e[16];let u;e[17]!==f?(u=i.jsx(rt,{className:"sr-only",children:f}),e[17]=f,e[18]=u):u=e[18];let x;e[19]!==h||e[20]!==g?(x=g&&i.jsx(Fe,{onNavigate:h}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let j;e[22]!==h||e[23]!==o?(j=o({onClose:h}),e[22]=h,e[23]=o,e[24]=j):j=e[24];let w;e[25]!==j?(w=i.jsx("div",{className:"min-w-0 flex-1",children:j}),e[25]=j,e[26]=w):w=e[26];let O;e[27]!==x||e[28]!==w?(O=i.jsxs("div",{className:"flex h-full min-h-0",children:[x,w]}),e[27]=x,e[28]=w,e[29]=O):O=e[29];let p;e[30]!==u||e[31]!==O?(p=i.jsxs(ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:vs,children:[u,O]}),e[30]=u,e[31]=O,e[32]=p):p=e[32];let y;return e[33]!==a||e[34]!==c||e[35]!==p?(y=i.jsx(lt,{open:a,onOpenChange:c,children:p}),e[33]=a,e[34]=c,e[35]=p,e[36]=y):y=e[36],y}function vs(t){return t.preventDefault()}function Ss(t){const e=G.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={background:"transparent",containerType:"inline-size"},e[0]=o):o=e[0];let r;return e[1]!==s?(r=i.jsx(it,{className:"flex flex-col min-h-0",style:o,children:i.jsx(et,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=r):r=e[2],r}const Hs=Object.assign(js,{Sidebar:ys,Content:Ss});export{Gs as I,Hs as L,Ce as O,es as u,Ht as w};
1
+ import{c as G,j as i,b as J,r as q,B as Ne,a as be,t as de,G as He,au as ye,aw as _e,l as Y,m as Xe,K as qe,ae as Ye,a2 as Le,d as Ue,aD as Je,k as Ve,E as Qe,L as ke,Y as Ze,y as je,aa as Pe,P as et}from"./index-CMKEBGKX.js";import{u as Re,c as De,i as tt,j as st,k as nt,l as it}from"./use-sidebar-collapsed-CKSL9ORL.js";import{S as rt,a as ot,b as lt}from"./sheet-DIT9lGlU.js";import{u as at}from"./use-mobile-Bq3CXRKG.js";import{u as ct,a as dt,D as ut,c as ft,C as ht,P as mt}from"./core.esm-r_1fOlla.js";import{S as gt,v as pt,u as xt}from"./sortable.esm-CmQjLRc-.js";import{i as bt}from"./Tool01-D7eccoeh.js";import{D as jt,A as yt,E as Ae,F as vt}from"./agent-icon-DtT3h4UX.js";import{s as St}from"./Plus-DXIMcQkQ.js";import{s as Me}from"./XClose-C9XzQkao.js";import{T as he,a as me,c as ge}from"./tooltip-WTx8RFDb.js";import{C as ze,f as wt,g as zt,e as Ot}from"./context-menu-DuBXLH-0.js";import{A as _t}from"./avatar-49aPXdv7.js";import{C as Rt}from"./create-organization-dialog-DinRNNUe.js";import{P as Ct}from"./project-apps-CKpWGbT4.js";import{u as Nt,a as At}from"./use-recent-apps-BU79Go-x.js";import{b as Et}from"./use-navigate-to-agent-F9oDR6Aw.js";import{u as Tt,a as It}from"./use-project-scope-BFye4eeg.js";import{i as Lt}from"./UserSquare-CZXKi88L.js";import{C as Ee,e as kt,b as Pt,c as Dt,f as Mt}from"./command-DcKOVszs.js";import{u as $t}from"./use-debounced-value-ELHlrW87.js";const Kt={xs:"xs",sm:"xs",lg:"md"};function Ce(t){const e=G.c(4),{org:s,size:o}=t,r=o===void 0?"sm":o,l=s.logo??void 0,n=Kt[r];let a;return e[0]!==s.name||e[1]!==l||e[2]!==n?(a=i.jsx(_t,{url:l,fallback:s.name,size:n,tone:"solid"}),e[0]=s.name,e[1]=l,e[2]=n,e[3]=a):a=e[3],a}function Gs({invitation:t,onChanged:e}){const s=J(),[o,r]=q.useState(!1),l=t.organizationName??s("header.orgSwitcher.unknownOrganization"),n=async()=>{r(!0);try{const d=await be.organization.acceptInvitation({invitationId:t.id});if(d.error){de.error(d.error.message),r(!1);return}}catch{de.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}de.success(s("header.orgSwitcher.joined",{name:l})),He();let c;try{c=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{r(!0);try{const c=await be.organization.rejectInvitation({invitationId:t.id});if(c.error){de.error(c.error.message),r(!1);return}de.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{de.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(Ce,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(Ne,{size:"sm",variant:"default",onClick:n,disabled:o,children:s("header.orgSwitcher.accept")}),i.jsx(Ne,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground",onClick:a,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(Me,{size:14})})]})]})}const Wt=3,$e=10,Ft=440,Bt=55;function Ke(t){const e=Math.floor((t-Ft)/Bt);return Math.min($e,Math.max(Wt,e))}function Gt(t,e,s=$e*3,o=[]){return[...new Set([e,...o,...t])].slice(0,s)}function Ht(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function Xt(t,e,s,o,r=[]){if(t.length<=o)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),n=new Set;s&&l.has(s)&&n.add(s);for(const a of r)l.has(a)&&n.add(a);for(const a of e){if(n.size>=o)break;l.has(a)&&n.add(a)}for(const a of t){if(n.size>=o)break;n.add(a.slug)}return{shown:t.filter(a=>n.has(a.slug)),hidden:t.filter(a=>!n.has(a.slug))}}const Te=[];function qt(){const t=G.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=_e.recentOrgs(),t[0]=e):e=t[0];const[s,o]=ye(e,Te),r=Array.isArray(s)?s:Te;let l;t[1]!==o?(l=(a,c)=>o(d=>Gt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=o,t[2]=l):l=t[2];let n;return t[3]!==r||t[4]!==l?(n={recent:r,remember:l},t[3]=r,t[4]=l,t[5]=n):n=t[5],n}const We={hidden:[],pinned:[],order:[]},fe=(t,e)=>t.filter(s=>s!==e);function ue(t){if(typeof t!="object"||t===null)return We;const e=o=>Array.isArray(o)?o.filter(r=>typeof r=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function Yt(t,e){return{...t,hidden:[...fe(t.hidden,e),e],pinned:fe(t.pinned,e)}}function Ut(t,e){return{...t,hidden:fe(t.hidden,e)}}function Jt(t,e){return t.pinned.includes(e)?{...t,pinned:fe(t.pinned,e)}:{...t,hidden:fe(t.hidden,e),pinned:[...t.pinned,e]}}function Vt(t,e,s){const o=r=>{const l=e.order.indexOf(r);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(r=>r.slug===s||!e.hidden.includes(r.slug)).map((r,l)=>({org:r,index:l})).sort((r,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(r.org.slug))||o(r.org.slug)-o(l.org.slug)||r.index-l.index).map(({org:r})=>r)}function Qt(t,e,s,o){const r=e.indexOf(s),l=e.indexOf(o);if(r===-1||l===-1||r===l||t.pinned.includes(s)!==t.pinned.includes(o))return t;const n=[...e];return n.splice(r,1),n.splice(l,0,s),{...t,order:[...n,...t.order.filter(a=>!n.includes(a))]}}function ve(t){const e=G.c(11),{active:s,label:o,children:r}=t,l=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let n;e[0]!==l?(n=Y("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=n):n=e[1];let a;e[2]!==n?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:i.jsx("span",{className:n})}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==o?(c=o&&i.jsx("span",{"aria-hidden":!0,className:Y("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:o}),e[4]=s,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,r,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Zt(t){return typeof t=="object"&&t!==null&&Array.isArray(t.items)}function es(t){const e=G.c(13),s=t.trim(),{data:o}=be.useSession(),r=o?.user?.id??"",l=s.length>0&&!!r,n=qe.organizationSearch(r,s);let a;e[0]!==s?(a=async w=>{const{signal:O}=w,p=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:O});if(!p.ok)throw new Error(`Organization search failed: ${p.status}`);const y=await p.json();if(!Zt(y))throw new Error("Invalid organization search response");return y},e[0]=s,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==n||e[4]!==a?(c={queryKey:n,queryFn:a,enabled:l,placeholderData:Ye,staleTime:3e4,retry:!1},e[2]=l,e[3]=n,e[4]=a,e[5]=c):c=e[5];const{data:d,isFetching:g,isPlaceholderData:m,isError:h}=Xe(c);let f;e[6]!==d?.items?(f=d?.items??[],e[6]=d?.items,e[7]=f):f=e[7];const u=l&&g,x=l&&m;let j;return e[8]!==h||e[9]!==f||e[10]!==u||e[11]!==x?(j={hits:f,isSearching:u,isStale:x,isError:h},e[8]=h,e[9]=f,e[10]=u,e[11]=x,e[12]=j):j=e[12],j}function ts(t){const e=G.c(61),{orgs:s,currentSlug:o,hiddenCount:r,onSelect:l}=t,n=J(),[a,c]=q.useState(!1),[d,g]=q.useState("");let m;e[0]!==d?(m=d.trim(),e[0]=d,e[1]=m):m=e[1];const h=m,f=$t(h,150),u=h.length>0,x=f===h,{hits:j,isSearching:w,isStale:O,isError:p}=es(u?f:""),y=u?j:s;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=H=>{c(H),H||g("")},e[2]=v):v=e[2];const z=v;let b;e[3]!==n?(b=n("sidebar.rail.searchOrganizations"),e[3]=n,e[4]=b):b=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>z(!0),e[5]=A):A=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=i.jsx(Lt,{size:18}),e[6]=I):I=e[6];let _;e[7]!==b?(_=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":b,onClick:A,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:I})}),e[7]=b,e[8]=_):_=e[8];let E;e[9]!==r||e[10]!==n?(E=r>0?n("sidebar.rail.searchMoreOrganizations",{count:r}):n("sidebar.rail.searchOrganizations"),e[9]=r,e[10]=n,e[11]=E):E=e[11];let R;e[12]!==E?(R=i.jsx(me,{side:"right",children:E}),e[12]=E,e[13]=R):R=e[13];let T;e[14]!==_||e[15]!==R?(T=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[_,R]})}),e[14]=_,e[15]=R,e[16]=T):T=e[16];let P;e[17]!==n?(P=n("sidebar.rail.searchOrganizations"),e[17]=n,e[18]=P):P=e[18];let S;e[19]!==n?(S=n("sidebar.rail.searchPlaceholder"),e[19]=n,e[20]=S):S=e[20];let C;e[21]!==n?(C=n("sidebar.rail.searchPlaceholder"),e[21]=n,e[22]=C):C=e[22];let M;e[23]!==d||e[24]!==C?(M=i.jsx(kt,{value:d,onValueChange:g,placeholder:C}),e[23]=d,e[24]=C,e[25]=M):M=e[25];const F=u&&(O||!x)&&"opacity-50";let K;e[26]!==F?(K=Y(F),e[26]=F,e[27]=K):K=e[27];let D;e[28]!==p||e[29]!==u||e[30]!==n?(D=u&&p&&i.jsx(Ee,{children:n("sidebar.rail.searchFailed")}),e[28]=p,e[29]=u,e[30]=n,e[31]=D):D=e[31];let $;e[32]!==p||e[33]!==w||e[34]!==y.length||e[35]!==x||e[36]!==n?($=!p&&x&&!w&&y.length===0&&i.jsx(Ee,{children:n("sidebar.rail.searchEmpty")}),e[32]=p,e[33]=w,e[34]=y.length,e[35]=x,e[36]=n,e[37]=$):$=e[37];let L;if(e[38]!==o||e[39]!==l||e[40]!==y||e[41]!==n){let H;e[43]!==o||e[44]!==l||e[45]!==n?(H=X=>i.jsxs(Pt,{value:X.slug,onSelect:()=>{z(!1),X.slug!==o&&l(X.slug)},className:"gap-2.5",children:[i.jsx(Ce,{org:X,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:X.name}),X.slug===o&&i.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},X.id),e[43]=o,e[44]=l,e[45]=n,e[46]=H):H=e[46],L=y.map(H),e[38]=o,e[39]=l,e[40]=y,e[41]=n,e[42]=L}else L=e[42];let k;e[47]!==K||e[48]!==D||e[49]!==$||e[50]!==L?(k=i.jsxs(Dt,{className:K,children:[D,$,L]}),e[47]=K,e[48]=D,e[49]=$,e[50]=L,e[51]=k):k=e[51];let W;e[52]!==a||e[53]!==P||e[54]!==S||e[55]!==M||e[56]!==k?(W=i.jsxs(Mt,{open:a,onOpenChange:z,title:P,description:S,shouldFilter:!1,children:[M,k]}),e[52]=a,e[53]=P,e[54]=S,e[55]=M,e[56]=k,e[57]=W):W=e[57];let U;return e[58]!==W||e[59]!==T?(U=i.jsxs(i.Fragment,{children:[T,W]}),e[58]=W,e[59]=T,e[60]=U):U=e[60],U}function ss(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const ns=()=>Ke(globalThis.innerHeight),is=()=>Ke(0);function rs(t){const e=G.c(59),{org:s,active:o,onSelect:r,pinned:l,onOpenSettings:n,onTogglePin:a,onHide:c}=t,d=J();let g;e[0]!==s.slug?(g={id:s.slug},e[0]=s.slug,e[1]=g):g=e[1];const{setNodeRef:m,listeners:h,transform:f,transition:u,isDragging:x}=xt(g);let j;e[2]!==f?(j=ht.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=j):j=e[3];const w=x?1:void 0,O=`rail-org-${s.slug}`;let p;e[4]!==j||e[5]!==w||e[6]!==O||e[7]!==u?(p={transform:j,transition:u,zIndex:w,viewTransitionName:O},e[4]=j,e[5]=w,e[6]=O,e[7]=u,e[8]=p):p=e[8];const y=s.name,v=o||void 0,z=o?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",b=r&&"cursor-pointer";let A;e[9]!==z||e[10]!==b?(A=Y("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",z,b),e[9]=z,e[10]=b,e[11]=A):A=e[11];let I;e[12]!==s?(I=i.jsx(Ce,{org:s,size:"lg"}),e[12]=s,e[13]=I):I=e[13];let _;e[14]!==l?(_=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(Ae,{size:9})}),e[14]=l,e[15]=_):_=e[15];let E;e[16]!==r||e[17]!==s.name||e[18]!==A||e[19]!==I||e[20]!==_||e[21]!==v?(E=i.jsx(he,{asChild:!0,children:i.jsx(wt,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":y,"aria-current":v,onClick:r,className:A,children:[I,_]})})}),e[16]=r,e[17]=s.name,e[18]=A,e[19]=I,e[20]=_,e[21]=v,e[22]=E):E=e[22];let R;e[23]!==s.name?(R=i.jsx(me,{side:"right",children:s.name}),e[23]=s.name,e[24]=R):R=e[24];let T;e[25]!==E||e[26]!==R?(T=i.jsxs(ge,{children:[E,R]}),e[25]=E,e[26]=R,e[27]=T):T=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(vt,{}),e[28]=P):P=e[28];let S;e[29]!==d?(S=d("sidebar.rail.organizationSettings"),e[29]=d,e[30]=S):S=e[30];let C;e[31]!==n||e[32]!==S?(C=i.jsxs(ze,{onSelect:n,children:[P,S]}),e[31]=n,e[32]=S,e[33]=C):C=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx(Ae,{}),e[34]=M):M=e[34];let F;e[35]!==l||e[36]!==d?(F=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=l,e[36]=d,e[37]=F):F=e[37];let K;e[38]!==a||e[39]!==F?(K=i.jsxs(ze,{onSelect:a,children:[M,F]}),e[38]=a,e[39]=F,e[40]=K):K=e[40];let D;e[41]!==c||e[42]!==d?(D=c&&i.jsxs(ze,{onSelect:c,children:[i.jsx(bt,{}),d("sidebar.rail.hideOrganization")]}),e[41]=c,e[42]=d,e[43]=D):D=e[43];let $;e[44]!==C||e[45]!==K||e[46]!==D?($=i.jsxs(zt,{children:[C,K,D]}),e[44]=C,e[45]=K,e[46]=D,e[47]=$):$=e[47];let L;e[48]!==T||e[49]!==$?(L=i.jsxs(Ot,{children:[T,$]}),e[48]=T,e[49]=$,e[50]=L):L=e[50];let k;e[51]!==o||e[52]!==L?(k=i.jsx(ve,{active:o,children:L}),e[51]=o,e[52]=L,e[53]=k):k=e[53];let W;return e[54]!==h||e[55]!==m||e[56]!==k||e[57]!==p?(W=i.jsx("div",{ref:m,...h,style:p,className:"w-full shrink-0 touch-none",children:k}),e[54]=h,e[55]=m,e[56]=k,e[57]=p,e[58]=W):W=e[58],W}function os(t){const e=G.c(64),{project:s,orgSlug:o,active:r,onClose:l,onNavigate:n}=t,a=J();let c,d,g,m,h,f,u,x,j,w,O;if(e[0]!==r||e[1]!==n||e[2]!==o||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const M=jt(s.icon,s.title);O="group/rail relative flex w-full flex-col items-center gap-1",g=ge,d=he,w=!0,c=ke,m=Ze.root,e[17]!==o||e[18]!==s.id?(h={org:o,agentId:s.id},e[17]=o,e[18]=s.id,e[19]=h):h=e[19],f=s.title,u=r||void 0,e[20]!==n?(x=()=>{je("org_rail_recent_project_opened"),n?.()},e[20]=n,e[21]=x):x=e[21],j=Y("flex shrink-0 rounded-lg focus-ring",M.text,r&&"ring-[1.5px] ring-current"),e[0]=r,e[1]=n,e[2]=o,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=c,e[7]=d,e[8]=g,e[9]=m,e[10]=h,e[11]=f,e[12]=u,e[13]=x,e[14]=j,e[15]=w,e[16]=O}else c=e[6],d=e[7],g=e[8],m=e[9],h=e[10],f=e[11],u=e[12],x=e[13],j=e[14],w=e[15],O=e[16];let p;e[22]!==s.icon||e[23]!==s.title?(p=i.jsx(yt,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=p):p=e[24];let y;e[25]!==c||e[26]!==m||e[27]!==h||e[28]!==f||e[29]!==u||e[30]!==x||e[31]!==j||e[32]!==p?(y=i.jsx(c,{to:m,params:h,"aria-label":f,"aria-current":u,onClick:x,className:j,children:p}),e[25]=c,e[26]=m,e[27]=h,e[28]=f,e[29]=u,e[30]=x,e[31]=j,e[32]=p,e[33]=y):y=e[33];let v;e[34]!==d||e[35]!==y||e[36]!==w?(v=i.jsx(d,{asChild:w,children:y}),e[34]=d,e[35]=y,e[36]=w,e[37]=v):v=e[37];let z;e[38]!==s.title?(z=i.jsx(me,{side:"right",children:s.title}),e[38]=s.title,e[39]=z):z=e[39];let b;e[40]!==g||e[41]!==v||e[42]!==z?(b=i.jsxs(g,{children:[v,z]}),e[40]=g,e[41]=v,e[42]=z,e[43]=b):b=e[43];const A=r?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let I;e[44]!==A?(I=Y("line-clamp-2 w-full text-center text-2xs break-words transition-colors",A),e[44]=A,e[45]=I):I=e[45];let _;e[46]!==s.title||e[47]!==I?(_=i.jsx("span",{"aria-hidden":!0,className:I,children:s.title}),e[46]=s.title,e[47]=I,e[48]=_):_=e[48];let E;e[49]!==s.title||e[50]!==a?(E=a("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=a,e[51]=E):E=e[51];let R;e[52]!==l?(R=()=>{je("org_rail_recent_project_closed"),l()},e[52]=l,e[53]=R):R=e[53];let T,P;e[54]===Symbol.for("react.memo_cache_sentinel")?(T=Y("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),P=i.jsx(Me,{size:10}),e[54]=T,e[55]=P):(T=e[54],P=e[55]);let S;e[56]!==E||e[57]!==R?(S=i.jsx("button",{type:"button","aria-label":E,onClick:R,className:T,children:P}),e[56]=E,e[57]=R,e[58]=S):S=e[58];let C;return e[59]!==b||e[60]!==_||e[61]!==S||e[62]!==O?(C=i.jsxs("div",{className:O,children:[b,_,S]}),e[59]=b,e[60]=_,e[61]=S,e[62]=O,e[63]=C):C=e[63],C}const ls={"site-editor":"/site-editor"};function as(t){const e=G.c(26),{app:s}=t,o=J(),r=Ct[s],l=ls[s];if(!r||!l)return null;let n;e[0]!==r.labelKey||e[1]!==o?(n=o(r.labelKey),e[0]=r.labelKey,e[1]=o,e[2]=n):n=e[2];let a;e[3]!==r.labelKey||e[4]!==o?(a=o(r.labelKey),e[3]=r.labelKey,e[4]=o,e[5]=a):a=e[5];let c;e[6]!==r.tone?(c=Y("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",r.tone),e[6]=r.tone,e[7]=c):c=e[7];let d;e[8]!==r.Icon?(d=i.jsx(r.Icon,{size:18}),e[8]=r.Icon,e[9]=d):d=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(g=i.jsx(he,{asChild:!0,children:i.jsx(ke,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=g):g=e[14];let m;e[15]!==r.labelKey||e[16]!==o?(m=o(r.labelKey),e[15]=r.labelKey,e[16]=o,e[17]=m):m=e[17];let h;e[18]!==m?(h=i.jsx(me,{side:"right",children:m}),e[18]=m,e[19]=h):h=e[19];let f;e[20]!==g||e[21]!==h?(f=i.jsxs(ge,{children:[g,h]}),e[20]=g,e[21]=h,e[22]=f):f=e[22];let u;return e[23]!==n||e[24]!==f?(u=i.jsx(ve,{active:!0,label:n,children:f}),e[23]=n,e[24]=f,e[25]=u):u=e[25],u}function cs(){const{org:t}=Le();return Nt(t.slug),null}function Fe(t){const e=G.c(56),{onNavigate:s}=t===void 0?{}:t,o=J(),r=Ue(),{org:l}=Le(),n=Je();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:hs},e[0]=a):a=e[0];const c=Ve(a);let d;e[1]!==c||e[2]!==n?(d=c?n({to:"/$org",fuzzy:!0,pending:!0}):!1,e[1]=c,e[2]=n,e[3]=d):d=e[3];const g=d,m=g?g.org:l.slug,{data:h}=Qe(),[f,u]=q.useState(!1),x=Re(),{recent:j,forget:w}=Et(l.slug),{projects:O}=Tt(),p=It(),y=At(),v=y&&y.projectId===null?y.app:null,z=v?[]:j.flatMap(N=>O.filter(B=>B.id===N)),b=Ht(h??[],l),{recent:A,remember:I}=qt();let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=_e.railOrgPrefs(),e[4]=_):_=e[4];const[E,R]=ye(_,We),T=ue(E),P=q.useSyncExternalStore(ss,ns,is),{shown:S}=Xt(Vt(b,T,l.slug),A,l.slug,P,T.pinned);let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[5]=C):C=e[5];const M=ct(dt(mt,C)),F=N=>{const{active:B,over:ce}=N;ce&&(je("org_rail_reordered"),R(Ge=>Qt(ue(Ge),S.map(fs),String(B.id),String(ce.id))))},K=N=>{s?.(),r({to:"/$org/home",params:{org:N},viewTransition:!0})},D=N=>{je("org_rail_travel");const B=S.some(ce=>ce.slug===N);R(ce=>Ut(ue(ce),N)),I(N,B?S.map(us):void 0),K(N)},$=!x&&"border-r border-sidebar-border";let L;e[6]!==$?(L=Y("flex w-[68px] shrink-0 flex-col items-center gap-2.5 overflow-y-auto bg-sidebar px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",$),e[6]=$,e[7]=L):L=e[7];let k;e[8]!==o?(k=o("sidebar.rail.ariaLabel"),e[8]=o,e[9]=k):k=e[9];const W=ut,U=ft,H=gt,X=S.map(ds),Se=pt,we=S.map(N=>i.jsxs(q.Fragment,{children:[i.jsx(rs,{org:N,active:N.slug===m,pinned:T.pinned.includes(N.slug),onSelect:N.slug!==l.slug?()=>D(N.slug):p?()=>K(N.slug):void 0,onOpenSettings:()=>{s?.(),r({to:"/$org/settings",params:{org:N.slug}})},onTogglePin:()=>R(B=>Jt(ue(B),N.slug)),onHide:N.slug===l.slug?void 0:()=>R(B=>Yt(ue(B),N.slug))}),N.slug===l.slug&&z.length>0&&i.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:z.map(B=>i.jsx(os,{project:B,orgSlug:l.slug,active:p===B.id,onClose:()=>w(B.id),onNavigate:s},B.id))})]},N.id));let V;e[10]!==H||e[11]!==X||e[12]!==Se||e[13]!==we?(V=i.jsx(H,{items:X,strategy:Se,children:we}),e[10]=H,e[11]=X,e[12]=Se,e[13]=we,e[14]=V):V=e[14];let Q;e[15]!==W||e[16]!==F||e[17]!==M||e[18]!==V||e[19]!==U?(Q=i.jsx(W,{sensors:M,collisionDetection:U,onDragEnd:F,children:V}),e[15]=W,e[16]=F,e[17]=M,e[18]=V,e[19]=U,e[20]=Q):Q=e[20];let Z;e[21]!==l.slug||e[22]!==b||e[23]!==S.length||e[24]!==D?(Z=b.length>S.length&&i.jsx(ts,{orgs:b,currentSlug:l.slug,hiddenCount:b.length-S.length,onSelect:D}),e[21]=l.slug,e[22]=b,e[23]=S.length,e[24]=D,e[25]=Z):Z=e[25];let ee;e[26]!==o?(ee=o("sidebar.picker.newOrganization"),e[26]=o,e[27]=ee):ee=e[27];let te;e[28]!==u?(te=()=>u(!0),e[28]=u,e[29]=te):te=e[29];let pe;e[30]===Symbol.for("react.memo_cache_sentinel")?(pe=i.jsx(St,{size:18}),e[30]=pe):pe=e[30];let se;e[31]!==ee||e[32]!==te?(se=i.jsx(he,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":ee,onClick:te,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:pe})}),e[31]=ee,e[32]=te,e[33]=se):se=e[33];let ne;e[34]!==o?(ne=o("sidebar.picker.newOrganization"),e[34]=o,e[35]=ne):ne=e[35];let ie;e[36]!==ne?(ie=i.jsx(me,{side:"right",children:ne}),e[36]=ne,e[37]=ie):ie=e[37];let re;e[38]!==se||e[39]!==ie?(re=i.jsx(ve,{active:!1,children:i.jsxs(ge,{children:[se,ie]})}),e[38]=se,e[39]=ie,e[40]=re):re=e[40];let oe;e[41]!==v?(oe=v&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),i.jsx(as,{app:v})]}),e[41]=v,e[42]=oe):oe=e[42];let le;e[43]!==Q||e[44]!==Z||e[45]!==re||e[46]!==oe||e[47]!==L||e[48]!==k?(le=i.jsxs("div",{className:L,"aria-label":k,children:[Q,Z,re,oe]}),e[43]=Q,e[44]=Z,e[45]=re,e[46]=oe,e[47]=L,e[48]=k,e[49]=le):le=e[49];let ae;e[50]!==f||e[51]!==u?(ae=i.jsx(Rt,{open:f,onOpenChange:u}),e[50]=f,e[51]=u,e[52]=ae):ae=e[52];let xe;return e[53]!==le||e[54]!==ae?(xe=i.jsxs(i.Fragment,{children:[le,ae]}),e[53]=le,e[54]=ae,e[55]=xe):xe=e[55],xe}function ds(t){return t.slug}function us(t){return t.slug}function fs(t){return t.slug}function hs(t){return t.isLoading}function ms(t){const e=G.c(15),{width:s,minWidth:o,maxWidth:r,onPointerDown:l,onKeyDown:n,onDoubleClick:a}=t,c=J(),{isMobile:d}=De(),g=Re();if(d||g)return null;let m;e[0]!==c?(m=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=m):m=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let f,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},u=i.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=f,e[5]=u):(f=e[4],u=e[5]);let x;return e[6]!==r||e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==l||e[11]!==m||e[12]!==h||e[13]!==s?(x=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":m,"aria-valuenow":s,"aria-valuemin":o,"aria-valuemax":r,title:h,tabIndex:0,onPointerDown:l,onKeyDown:n,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:u}),e[6]=r,e[7]=o,e[8]=a,e[9]=n,e[10]=l,e[11]=m,e[12]=h,e[13]=s,e[14]=x):x=e[14],x}const Oe=400,Ie=16,gs="sidebar.width.v2";function ps(){const t=G.c(14),e=xs;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=u=>typeof u=="number"?e(u):192,t[0]=s):s=t[0];const[o,r]=ye(gs,s),l=q.useRef(null);let n;t[1]!==r||t[2]!==o?(n=u=>{u.preventDefault();const x=u.clientX,j=e(o),w=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),O=w?Array.from(w.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const v of O)v.style.transition="none";const p=v=>{const z=e(j+(v.clientX-x));w?.style.setProperty("--sidebar-width",`${z}px`)},y=v=>{const z=e(j+(v.clientX-x));r(z);for(const b of O)b.style.transition="";window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",p),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)},t[1]=r,t[2]=o,t[3]=n):n=t[3];const a=n;let c;t[4]!==r?(c=()=>{r(192)},t[4]=r,t[5]=c):c=t[5];const d=c;let g;t[6]!==r||t[7]!==o?(g=u=>{if(u.key==="ArrowLeft")r(e(o-Ie));else if(u.key==="ArrowRight")r(e(o+Ie));else if(u.key==="Home")r(192);else if(u.key==="End")r(Oe);else return;u.preventDefault()},t[6]=r,t[7]=o,t[8]=g):g=t[8];const m=g,h=e(o);let f;return t[9]!==m||t[10]!==a||t[11]!==d||t[12]!==h?(f={width:h,minWidth:192,maxWidth:Oe,wrapperRef:l,onStartResize:a,onKeyDownResize:m,resetWidth:d},t[9]=m,t[10]=a,t[11]=d,t[12]=h,t[13]=f):f=t[13],f}function xs(t){return Math.max(192,Math.min(Oe,t))}const Be=q.createContext(null);function bs(){const t=q.use(Be);if(!t)throw new Error("Layout regions require a Layout");return t}function js({children:t,notice:e,outsideOrg:s}){const o=at(),[r,l]=ye(_e.sidebarOpen(),!0),n=ps(),a=Pe();return i.jsx(Be,{value:{isMobile:o,resize:n},children:i.jsx(tt,{open:r,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!s&&i.jsx(cs,{}),!o&&a&&(s?.rail??!0)&&i.jsx(Fe,{}),i.jsx(st,{ref:n.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${n.width}px`,"--sidebar-width-icon":a?"0px":"3.125rem"},children:i.jsx(nt,{children:t})})]})]})})})}function ys(t){const e=G.c(37),{children:s,renderMobile:o}=t,r=J(),{isMobile:l,resize:n}=bs(),{openMobile:a,setOpenMobile:c}=De(),d=Re(),g=Pe();let m;e[0]!==c?(m=()=>c(!1),e[0]=c,e[1]=m):m=e[1];const h=m;if(!l){const v=g&&d;let z;e[2]!==s||e[3]!==v?(z=i.jsx("div",{className:"contents",inert:v,children:s}),e[2]=s,e[3]=v,e[4]=z):z=e[4];let b;e[5]!==n.maxWidth||e[6]!==n.minWidth||e[7]!==n.onKeyDownResize||e[8]!==n.onStartResize||e[9]!==n.resetWidth||e[10]!==n.width?(b=i.jsx(ms,{width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,onPointerDown:n.onStartResize,onKeyDown:n.onKeyDownResize,onDoubleClick:n.resetWidth}),e[5]=n.maxWidth,e[6]=n.minWidth,e[7]=n.onKeyDownResize,e[8]=n.onStartResize,e[9]=n.resetWidth,e[10]=n.width,e[11]=b):b=e[11];let A;return e[12]!==z||e[13]!==b?(A=i.jsxs(i.Fragment,{children:[z,b]}),e[12]=z,e[13]=b,e[14]=A):A=e[14],A}let f;e[15]!==r?(f=r("layouts.shellControls.navigationTitle"),e[15]=r,e[16]=f):f=e[16];let u;e[17]!==f?(u=i.jsx(rt,{className:"sr-only",children:f}),e[17]=f,e[18]=u):u=e[18];let x;e[19]!==h||e[20]!==g?(x=g&&i.jsx(Fe,{onNavigate:h}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let j;e[22]!==h||e[23]!==o?(j=o({onClose:h}),e[22]=h,e[23]=o,e[24]=j):j=e[24];let w;e[25]!==j?(w=i.jsx("div",{className:"min-w-0 flex-1",children:j}),e[25]=j,e[26]=w):w=e[26];let O;e[27]!==x||e[28]!==w?(O=i.jsxs("div",{className:"flex h-full min-h-0",children:[x,w]}),e[27]=x,e[28]=w,e[29]=O):O=e[29];let p;e[30]!==u||e[31]!==O?(p=i.jsxs(ot,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:vs,children:[u,O]}),e[30]=u,e[31]=O,e[32]=p):p=e[32];let y;return e[33]!==a||e[34]!==c||e[35]!==p?(y=i.jsx(lt,{open:a,onOpenChange:c,children:p}),e[33]=a,e[34]=c,e[35]=p,e[36]=y):y=e[36],y}function vs(t){return t.preventDefault()}function Ss(t){const e=G.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={background:"transparent",containerType:"inline-size"},e[0]=o):o=e[0];let r;return e[1]!==s?(r=i.jsx(it,{className:"flex flex-col min-h-0",style:o,children:i.jsx(et,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=r):r=e[2],r}const Hs=Object.assign(js,{Sidebar:ys,Content:Ss});export{Gs as I,Hs as L,Ce as O,es as u,Ht as w};
@@ -1 +1 @@
1
- import{cv as _}from"./index-CImJlq71.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
1
+ import{cv as _}from"./index-CMKEBGKX.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
@@ -1 +1 @@
1
- import{r as i,j as t,bD as o}from"./index-CImJlq71.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};
1
+ import{r as i,j as t,bD as o}from"./index-CMKEBGKX.js";var s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d="VisuallyHidden",e=i.forwardRef((r,a)=>t.jsx(o.span,{...r,ref:a,style:{...s,...r.style}}));e.displayName=d;var n=e;export{n as R,s as V};