@decocms/mesh 2.123.2 → 2.123.4

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 (182) hide show
  1. package/dist/client/assets/{AlertCircle-BpvTeRWZ.js → AlertCircle-DiDJuuO7.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-KPbgj_fe.js → AlertOctagon-T8X2xR5Y.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-BQr7kJDW.js → AlertTriangle-BR7J9Jvh.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-6opPa7zy.js → ArrowLeft-CZ4ZZXqO.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Bt1al9WB.js → ArrowUp-CBTnQfpb.js} +1 -1
  6. package/dist/client/assets/{Check-COoTrHCh.js → Check-ebSdGxZp.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-Dif3Jy99.js → CheckCircle-BX10u03U.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-B8UrJ9b0.js → CheckDone01-BKZeNjYI.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-BXTAAE0g.js → CheckVerified02-Bc-TzDsw.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-5ys0844E.js → ChevronDown-BxrIQ2Hg.js} +1 -1
  11. package/dist/client/assets/{ChevronRight-B8put0eN.js → ChevronRight-D1zpPr9G.js} +1 -1
  12. package/dist/client/assets/{Clock-lQFxjk3U.js → Clock-ByTlM-Ae.js} +1 -1
  13. package/dist/client/assets/{Code01-BZ3OnS6C.js → Code01-62o0ASv5.js} +1 -1
  14. package/dist/client/assets/{Container-CYXpgUH-.js → Container-Cr2TCDTS.js} +1 -1
  15. package/dist/client/assets/{Copy01-RhM6GPKh.js → Copy01-CfVZSokb.js} +1 -1
  16. package/dist/client/assets/{Dataflow03-DQ3l0uK3.js → Dataflow03-CEYvQeh9.js} +1 -1
  17. package/dist/client/assets/{DotsHorizontal-CXUsxuDx.js → DotsHorizontal-D_wKOZTi.js} +1 -1
  18. package/dist/client/assets/{DotsVertical--UCmDvo-.js → DotsVertical-BNJZVkhj.js} +1 -1
  19. package/dist/client/assets/{Download01-RzJvHlJ-.js → Download01-CMusldak.js} +1 -1
  20. package/dist/client/assets/{Edit01-pUCJ7HNy.js → Edit01-BySGjbs-.js} +1 -1
  21. package/dist/client/assets/{Eye-Dk7SbACo.js → Eye-Wh_bq-Y4.js} +1 -1
  22. package/dist/client/assets/{File02-BuUCkwHe.js → File02-Drnn3tnJ.js} +1 -1
  23. package/dist/client/assets/{File06-BiAuw-uA.js → File06-CL04kImU.js} +1 -1
  24. package/dist/client/assets/{FilterLines-DAGdGqpc.js → FilterLines-DgwYDfry.js} +1 -1
  25. package/dist/client/assets/{Globe01-BW-Ba2wM.js → Globe01-BMVTN5_w.js} +1 -1
  26. package/dist/client/assets/{Globe02-JrHK1B-m.js → Globe02-BD3ZCWms.js} +1 -1
  27. package/dist/client/assets/{Grid01-B0TbJ6AU.js → Grid01-BWcrgmNx.js} +1 -1
  28. package/dist/client/assets/{Hash02-CjnFXmXE.js → Hash02-Dqi3bcQt.js} +1 -1
  29. package/dist/client/assets/{Home02-DygdOIOt.js → Home02-lTWiIHtK.js} +1 -1
  30. package/dist/client/assets/{Image01-CjAt3NIh.js → Image01-DcX1niB5.js} +1 -1
  31. package/dist/client/assets/{Inbox01-iihr_vaX.js → Inbox01-8_gDqife.js} +1 -1
  32. package/dist/client/assets/{InfoCircle-DgqWMR4R.js → InfoCircle-BKPaDpeK.js} +1 -1
  33. package/dist/client/assets/{Key01-CMhaJPaL.js → Key01-CyWdmMm6.js} +1 -1
  34. package/dist/client/assets/{LinkExternal01-zi5yhvLt.js → LinkExternal01-DPNrtGWV.js} +1 -1
  35. package/dist/client/assets/{List-BIF-EvrZ.js → List-DqeEnxu3.js} +1 -1
  36. package/dist/client/assets/{Loading01-BdPk5R9C.js → Loading01-BZRHfswB.js} +1 -1
  37. package/dist/client/assets/{Lock01-CPquSRx9.js → Lock01-BDqkVPGz.js} +1 -1
  38. package/dist/client/assets/{Pin01-CR3q25pP.js → Pin01-BDMJN64-.js} +1 -1
  39. package/dist/client/assets/{Play-C4BzmLav.js → Play-BKXV9SNy.js} +1 -1
  40. package/dist/client/assets/{Plus-BJkQ4qvs.js → Plus-YlJja9E2.js} +1 -1
  41. package/dist/client/assets/{RefreshCcw01-CMJUa0vf.js → RefreshCcw01-Ci0qepHw.js} +1 -1
  42. package/dist/client/assets/{RefreshCw01-CwUk_ICv.js → RefreshCw01-Sv3Ciq4-.js} +1 -1
  43. package/dist/client/assets/{Rows03-CaPKdXTG.js → Rows03-DjbwBGBI.js} +1 -1
  44. package/dist/client/assets/{Save01-pTgRxfLl.js → Save01-CUHpjboy.js} +1 -1
  45. package/dist/client/assets/{SearchMd-BkraDgIf.js → SearchMd-CdY2Qz31.js} +1 -1
  46. package/dist/client/assets/{Settings01-JN6f9_qk.js → Settings01-hHMZndAB.js} +1 -1
  47. package/dist/client/assets/{Shield01-MwzSK_IW.js → Shield01-BC6B_xBt.js} +1 -1
  48. package/dist/client/assets/{Terminal-D0agZcO6.js → Terminal-D2rGQta9.js} +1 -1
  49. package/dist/client/assets/{Tool01-VRdaPnbs.js → Tool01-8K3JOGke.js} +1 -1
  50. package/dist/client/assets/{Trash01-BS69Rn26.js → Trash01-DjSET-_p.js} +1 -1
  51. package/dist/client/assets/{Upload01-bzy9bCNi.js → Upload01-C0CPwbYb.js} +1 -1
  52. package/dist/client/assets/{Users03-13i8se4V.js → Users03-BiJcw06H.js} +1 -1
  53. package/dist/client/assets/{XCircle-Bnl7RwSj.js → XCircle-oJlXTAnn.js} +1 -1
  54. package/dist/client/assets/{XClose-CIsPKYhP.js → XClose-CNjsPY9p.js} +1 -1
  55. package/dist/client/assets/{agent-connections-preview-eu9uGyuz.js → agent-connections-preview-CyTgEjXK.js} +1 -1
  56. package/dist/client/assets/{agent-detail-wValyywk.js → agent-detail-9DFcapAu.js} +1 -1
  57. package/dist/client/assets/{agents-BQf_kwYr.js → agents-4gtiAnuv.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-CTIXpfNf.js → alert-dialog-DG1mgLiN.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-Co8IiazS.js → auth-catchall-BSjXqHGj.js} +1 -1
  60. package/dist/client/assets/{avatar-CUhi-qzb.js → avatar-CLzAk7bk.js} +1 -1
  61. package/dist/client/assets/{badge-BAIkBZff.js → badge-zj5rJqFG.js} +1 -1
  62. package/dist/client/assets/{binder-DZp12Y3n.js → binder-Yx0eVQL7.js} +1 -1
  63. package/dist/client/assets/{breadcrumb-C2msqz1b.js → breadcrumb-p3FP4YzT.js} +1 -1
  64. package/dist/client/assets/{button-BpEnz7t9.js → button-BlFVi9O-.js} +1 -1
  65. package/dist/client/assets/{card-DILUA5lp.js → card-C5XZXHnb.js} +1 -1
  66. package/dist/client/assets/{chart-yT8TpKTO.js → chart-CECGc95G.js} +1 -1
  67. package/dist/client/assets/{checkbox-DsMm03Et.js → checkbox-C81GTltZ.js} +1 -1
  68. package/dist/client/assets/{circle-alert-ld-jNaFW.js → circle-alert-DTrbbil0.js} +1 -1
  69. package/dist/client/assets/{collection-detail-Bps6AdGb.js → collection-detail-DC6lEGsR.js} +1 -1
  70. package/dist/client/assets/{collection-tab-Cb2OKmOU.js → collection-tab-dYtQ3dOc.js} +1 -1
  71. package/dist/client/assets/{collection-table-wrapper-BcYBtIFU.js → collection-table-wrapper-D3UQPYYs.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CJN7uriQ.js → collection-tabs-DXae7bMN.js} +1 -1
  73. package/dist/client/assets/{command-DFf8Hw6Q.js → command-C0Lk3OoX.js} +1 -1
  74. package/dist/client/assets/{connect-CjDjmgo0.js → connect-B0zgap2s.js} +1 -1
  75. package/dist/client/assets/{connection-card-Cxm32ifq.js → connection-card-Bfx8qlqL.js} +1 -1
  76. package/dist/client/assets/{connection-detail-3ns6XuoV.js → connection-detail-CFl60IV3.js} +1 -1
  77. package/dist/client/assets/{connections-DSBc-5jR.js → connections-40Z9p3na.js} +1 -1
  78. package/dist/client/assets/constants-0nWmzfAq.js +1 -0
  79. package/dist/client/assets/{constants-BoBHGSW8.js → constants-DS4O9R8r.js} +1 -1
  80. package/dist/client/assets/{context-KYYCma1O.js → context-CJpih0Aq.js} +2 -2
  81. package/dist/client/assets/{create-organization-dialog-pjo7W0nj.js → create-organization-dialog-BFIfEtVL.js} +1 -1
  82. package/dist/client/assets/{create-project-dialog-B6kkAgjA.js → create-project-dialog-D2mtQ7wt.js} +1 -1
  83. package/dist/client/assets/{deco-constants-DGRap-0f.js → deco-constants-B2fB4qCk.js} +1 -1
  84. package/dist/client/assets/{dialog-CKyGpmoE.js → dialog-BED3woG1.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-Df5G5zUr.js → dropdown-menu-Db2R0f6-.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-C7RtCIjV.js → dynamic-plugin-layout-BzLyvc2d.js} +1 -1
  87. package/dist/client/assets/{empty-state-BO_xpc7n.js → empty-state-CIZqXQMR.js} +1 -1
  88. package/dist/client/assets/{empty-state-CXRsSa_5.js → empty-state-DwKYfPjb.js} +1 -1
  89. package/dist/client/assets/{env-vars-editor-CWL7WVCl.js → env-vars-editor-CDWwUXgx.js} +1 -1
  90. package/dist/client/assets/{error-boundary-DKBJmhkm.js → error-boundary-DFWzxGF2.js} +1 -1
  91. package/dist/client/assets/{extract-connection-data-CVVFDhKc.js → extract-connection-data-1y_2LKN1.js} +1 -1
  92. package/dist/client/assets/{file-browser-DFvCuor8.js → file-browser-BLbb-Y8y.js} +2 -2
  93. package/dist/client/assets/{form-DW9viO4r.js → form-DdvC8UfL.js} +1 -1
  94. package/dist/client/assets/{grid-view-7qEPSoqU.js → grid-view-CqSeu3_O.js} +1 -1
  95. package/dist/client/assets/{home-BNkgmOcB.js → home-DlTcQ85K.js} +1 -1
  96. package/dist/client/assets/{index-ZJgHVjA9.js → index-6Tp9fsVX.js} +1 -1
  97. package/dist/client/assets/{index-42oFt7Vf.js → index-BG2jkRwM.js} +1 -1
  98. package/dist/client/assets/{index-CLnaj1R8.js → index-Bb5ajAZZ.js} +1 -1
  99. package/dist/client/assets/{index-C2ysDUMA.js → index-C5tdq0OE.js} +1 -1
  100. package/dist/client/assets/{index-DYSwonwp.js → index-CNFSBpm2.js} +1 -1
  101. package/dist/client/assets/{index-Dj3-TAFC.js → index-Chdo1wOf.js} +3 -3
  102. package/dist/client/assets/{index-LqsHIY-h.js → index-Cs9SJKB2.js} +1 -1
  103. package/dist/client/assets/{index-pyLbkMHd.js → index-D8_oQFvH.js} +1 -1
  104. package/dist/client/assets/{infiniteQueryObserver-CXT3S8iT.js → infiniteQueryObserver-DOxbID_2.js} +1 -1
  105. package/dist/client/assets/{input-BJdUVCMG.js → input-C2bYHqSZ.js} +1 -1
  106. package/dist/client/assets/{integration-icon-CitBcWGE.js → integration-icon-CHfvIBul.js} +1 -1
  107. package/dist/client/assets/{label-CLOKtxmE.js → label-Cz00Hk_C.js} +1 -1
  108. package/dist/client/assets/{layout-Bm2oJesN.js → layout-D8HdJww7.js} +1 -1
  109. package/dist/client/assets/{localstorage-keys-Bxhx_7VG.js → localstorage-keys-D6jY_B8O.js} +1 -1
  110. package/dist/client/assets/{login-C1DGsJab.js → login-B4sEC044.js} +1 -1
  111. package/dist/client/assets/{markdown-C6oZzbdV.js → markdown-W0glOUUc.js} +1 -1
  112. package/dist/client/assets/{mcp-oauth-BgGOZ6Yl.js → mcp-oauth-CxZiVIG0.js} +1 -1
  113. package/dist/client/assets/{mcp-server-card-Bs5CjNs8.js → mcp-server-card-MyE_33s4.js} +1 -1
  114. package/dist/client/assets/{mcp-server-detail-TYK4H4ys.js → mcp-server-detail-DPKP-AVk.js} +2 -2
  115. package/dist/client/assets/{members-Dtp6tHqv.js → members-C0wNcB0L.js} +1 -1
  116. package/dist/client/assets/{monitoring-D4yuvuET.js → monitoring-DnyUAZQs.js} +1 -1
  117. package/dist/client/assets/{monitoring-dashboard-edit-BhZoWvFY.js → monitoring-dashboard-edit-CeSLs60r.js} +1 -1
  118. package/dist/client/assets/{monitoring-dashboard-view-D3TquP25.js → monitoring-dashboard-view-CXYrse_E.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-deuUTi00.js → oauth-callback-CtEIzTst.js} +1 -1
  120. package/dist/client/assets/{page-DOr5GIYN.js → page-BaeXPwI_.js} +1 -1
  121. package/dist/client/assets/{page-D2E5ZzCU.js → page-wIVLNXO6.js} +1 -1
  122. package/dist/client/assets/{plugin-empty-state-TS8DmJJp.js → plugin-empty-state-C3dQRExn.js} +1 -1
  123. package/dist/client/assets/{plugin-empty-state-Bgs1lZLk.js → plugin-empty-state-CtOLvnau.js} +1 -1
  124. package/dist/client/assets/{plugin-header-BeCh7KII.js → plugin-header-BpYtnCvY.js} +1 -1
  125. package/dist/client/assets/{plugin-header-CBzycd5v.js → plugin-header-wMO8zy_s.js} +1 -1
  126. package/dist/client/assets/{popover-BvNaYtjG.js → popover-B4On8gSm.js} +1 -1
  127. package/dist/client/assets/{project-layout-DUPzxc2p.js → project-layout-1AjzWWMn.js} +1 -1
  128. package/dist/client/assets/{projects-list-BnTZ2oT-.js → projects-list-DNSZsINF.js} +1 -1
  129. package/dist/client/assets/{ranking-layout-CRWlaZ6i.js → ranking-layout-BgeMngBH.js} +1 -1
  130. package/dist/client/assets/{readme-viewer-BIh-4-st.js → readme-viewer-gb5hrmSg.js} +1 -1
  131. package/dist/client/assets/{registry-layout-DCY6UJG0.js → registry-layout-Cyki9u_h.js} +1 -1
  132. package/dist/client/assets/{registry-utils-fUWTJDy1.js → registry-utils-BL6Np0uD.js} +1 -1
  133. package/dist/client/assets/{reports-layout-D8otPyup.js → reports-layout-DImwy6ND.js} +1 -1
  134. package/dist/client/assets/{reset-password-B2xcsGcX.js → reset-password-ButVRXi9.js} +1 -1
  135. package/dist/client/assets/{resizable-B7M-KqaZ.js → resizable-DUdJ1A_O.js} +1 -1
  136. package/dist/client/assets/{save-actions-CnZBYHaQ.js → save-actions-BiCpAXjr.js} +1 -1
  137. package/dist/client/assets/{scroll-area-CK3Yk4ZG.js → scroll-area-C9Z4g4D3.js} +1 -1
  138. package/dist/client/assets/{select-D3Cqu_xI.js → select-DwyzrBGR.js} +1 -1
  139. package/dist/client/assets/{shell-layout-gULKyNae.js → shell-layout-BGf6BKNx.js} +1 -1
  140. package/dist/client/assets/{skeleton-BEJPNsmx.js → skeleton-DdrlSfda.js} +1 -1
  141. package/dist/client/assets/{spinner-DP-rnGOg.js → spinner-DeIV40-d.js} +1 -1
  142. package/dist/client/assets/{store-invite-7kH88tcd.js → store-invite-DHfus7Si.js} +1 -1
  143. package/dist/client/assets/{switch-Dc13mBjk.js → switch-BW_XeGpN.js} +1 -1
  144. package/dist/client/assets/{table-5zDBkIKt.js → table-N5hQy-1m.js} +1 -1
  145. package/dist/client/assets/{tasks-VFkq3Gln.js → tasks-CKkoq9mO.js} +1 -1
  146. package/dist/client/assets/{textarea-DQjt4TcB.js → textarea-B5CEImaf.js} +1 -1
  147. package/dist/client/assets/{time-range-picker-DlLbbTWq.js → time-range-picker-B3M_kZtN.js} +1 -1
  148. package/dist/client/assets/{toggle-group-7v5RUGzy.js → toggle-group-k8q-T2Qa.js} +1 -1
  149. package/dist/client/assets/{tools-list-CYXwR1B4.js → tools-list-TXvbi7bf.js} +1 -1
  150. package/dist/client/assets/{tooltip-jCrVkUGG.js → tooltip-BWW8lvJo.js} +1 -1
  151. package/dist/client/assets/{topbar-portal-BgsY0Tym.js → topbar-portal-m9wB0x-E.js} +1 -1
  152. package/dist/client/assets/{typewriter-title-CqQ7vz03.js → typewriter-title-DcVIzze1.js} +1 -1
  153. package/dist/client/assets/{use-binding-D1PhjEYd.js → use-binding-DT0OPEEL.js} +1 -1
  154. package/dist/client/assets/{use-connection-CU2MpSPl.js → use-connection-O4z2Mc_F.js} +1 -1
  155. package/dist/client/assets/{use-copy-52ScM36o.js → use-copy-Drx5AGFH.js} +1 -1
  156. package/dist/client/assets/{use-create-virtual-mcp-Dgc9LRMA.js → use-create-virtual-mcp-CZu2JnDv.js} +1 -1
  157. package/dist/client/assets/{use-deco-chat-open-DEcM1zJp.js → use-deco-chat-open-Qq9AtQ8h.js} +1 -1
  158. package/dist/client/assets/{use-install-from-registry-D0ma5MSu.js → use-install-from-registry-Dc84s0lp.js} +1 -1
  159. package/dist/client/assets/{use-list-state-CHfyM4gv.js → use-list-state-DQM_pDDC.js} +1 -1
  160. package/dist/client/assets/{use-llm-CeHDiSJa.js → use-llm-Z9GIoSzc.js} +1 -1
  161. package/dist/client/assets/{use-mcp-prompts-DKsdNnZ7.js → use-mcp-prompts-uD1aNW_g.js} +1 -1
  162. package/dist/client/assets/{use-mcp-tools-D1hnuDSz.js → use-mcp-tools-B8wkpbTs.js} +1 -1
  163. package/dist/client/assets/{use-mobile-Dn42c33D.js → use-mobile-ziAtnWz2.js} +1 -1
  164. package/dist/client/assets/{use-organization-settings-D7m45jWB.js → use-organization-settings-BJEr33WT.js} +1 -1
  165. package/dist/client/assets/{use-project-BPC08iXP.js → use-project-Dz1PHkz5.js} +1 -1
  166. package/dist/client/assets/{use-settings-modal-Ddi5OSQC.js → use-settings-modal-CYH_HZlL.js} +1 -1
  167. package/dist/client/assets/{use-view-mode-D6ejd-aW.js → use-view-mode-CRJUL6S-.js} +1 -1
  168. package/dist/client/assets/{use-virtual-mcp-BSB4fi0P.js → use-virtual-mcp-BateG3is.js} +1 -1
  169. package/dist/client/assets/useInfiniteQuery-BHuahm2t.js +1 -0
  170. package/dist/client/assets/{useMutation-DXvszu1D.js → useMutation-BTkDU0tp.js} +1 -1
  171. package/dist/client/assets/useQuery-C0AkqYB7.js +1 -0
  172. package/dist/client/assets/useSuspenseInfiniteQuery-DPaJK1nP.js +1 -0
  173. package/dist/client/assets/{workflow-tlR1uEKO.js → workflow-CTPlOYoh.js} +1 -1
  174. package/dist/client/index.html +1 -1
  175. package/dist/server/cli.js +211 -211
  176. package/dist/server/migrate.js +184 -184
  177. package/dist/server/server.js +190 -190
  178. package/package.json +1 -1
  179. package/dist/client/assets/constants-BU0VInXj.js +0 -1
  180. package/dist/client/assets/useInfiniteQuery-CrVQg4J6.js +0 -1
  181. package/dist/client/assets/useQuery-7VkeRbRj.js +0 -1
  182. package/dist/client/assets/useSuspenseInfiniteQuery-BUl5uhPk.js +0 -1
@@ -1 +1 @@
1
- import{r as v,c as M,j as s,m as O,t as w,H as q}from"./index-Dj3-TAFC.js";import{u as D}from"./topbar-portal-BgsY0Tym.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-DFvCuor8.js";import{c as I,B as E}from"./button-BpEnz7t9.js";import{i as S}from"./AlertCircle-BpvTeRWZ.js";import{n as A}from"./Download01-RzJvHlJ-.js";import{i as $}from"./File02-BuUCkwHe.js";import{i as J}from"./File06-BiAuw-uA.js";import{a as P}from"./Image01-CjAt3NIh.js";import{i as T}from"./Loading01-BdPk5R9C.js";import{s as V}from"./Trash01-BS69Rn26.js";import{i as Y}from"./Upload01-bzy9bCNi.js";import{u as _}from"./useMutation-DXvszu1D.js";import{u as X}from"./useQuery-7VkeRbRj.js";import"./useInfiniteQuery-CrVQg4J6.js";import"./infiniteQueryObserver-CXT3S8iT.js";import"./checkbox-DsMm03Et.js";import"./Check-COoTrHCh.js";import"./ChevronRight-B8put0eN.js";import"./Grid01-B0TbJ6AU.js";import"./Home02-DygdOIOt.js";import"./List-BIF-EvrZ.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const H=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));H.displayName="FileCode01";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));K.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),a=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{a.current&&(a.current.disconnect(),a.current=null),u&&!d.current&&(a.current=new IntersectionObserver(y=>{const[c]=y;c?.isIntersecting&&!d.current&&(d.current=!0,g(!0),a.current?.disconnect(),a.current=null)},i),a.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:a}=i,d=a===void 0?"":a,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let c;e[1]!==n||e[2]!==t?(c=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=c):c=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==c||e[9]!==f?(k={queryKey:c,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=c,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:K,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:H,Folder:q};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:a,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const c=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!c&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==c||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=c?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=c,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==c||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=c?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=c,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==a?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),a(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=a,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function Ee({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),a=O(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:c,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),a.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),a.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&c()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ee as default};
1
+ import{r as v,c as M,j as s,m as O,t as w,H as q}from"./index-Chdo1wOf.js";import{u as D}from"./topbar-portal-m9wB0x-E.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-BLbb-Y8y.js";import{c as I,B as E}from"./button-BlFVi9O-.js";import{i as S}from"./AlertCircle-DiDJuuO7.js";import{n as A}from"./Download01-CMusldak.js";import{i as $}from"./File02-Drnn3tnJ.js";import{i as J}from"./File06-CL04kImU.js";import{a as P}from"./Image01-DcX1niB5.js";import{i as T}from"./Loading01-BZRHfswB.js";import{s as V}from"./Trash01-DjSET-_p.js";import{i as Y}from"./Upload01-C0CPwbYb.js";import{u as _}from"./useMutation-BTkDU0tp.js";import{u as X}from"./useQuery-C0AkqYB7.js";import"./useInfiniteQuery-BHuahm2t.js";import"./infiniteQueryObserver-DOxbID_2.js";import"./checkbox-C81GTltZ.js";import"./Check-ebSdGxZp.js";import"./ChevronRight-D1zpPr9G.js";import"./Grid01-BWcrgmNx.js";import"./Home02-lTWiIHtK.js";import"./List-DqeEnxu3.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const H=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));H.displayName="FileCode01";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));K.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),a=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{a.current&&(a.current.disconnect(),a.current=null),u&&!d.current&&(a.current=new IntersectionObserver(y=>{const[c]=y;c?.isIntersecting&&!d.current&&(d.current=!0,g(!0),a.current?.disconnect(),a.current=null)},i),a.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:a}=i,d=a===void 0?"":a,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let c;e[1]!==n||e[2]!==t?(c=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=c):c=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==c||e[9]!==f?(k={queryKey:c,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=c,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:K,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:H,Folder:q};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:a,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const c=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!c&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==c||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=c?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=c,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==c||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=c?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=c,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==a?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),a(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=a,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function Ee({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),a=O(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:c,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),a.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),a.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&c()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ee as default};
@@ -1 +1 @@
1
- import{c as f,j as s,d as I,r as C,b6 as F,b as E,m as O,t as w}from"./index-Dj3-TAFC.js";import{C as k}from"./card-DILUA5lp.js";import{c as y,B as $}from"./button-BpEnz7t9.js";import{A as R}from"./avatar-CUhi-qzb.js";import{i as D}from"./AlertCircle-BpvTeRWZ.js";import{i as H}from"./Check-COoTrHCh.js";import{s as G}from"./Plus-BJkQ4qvs.js";import{i as Q}from"./SearchMd-BkraDgIf.js";import{s as q}from"./XClose-CIsPKYhP.js";import{I as B}from"./input-BJdUVCMG.js";import{C as T}from"./create-organization-dialog-pjo7W0nj.js";import"./alert-dialog-CTIXpfNf.js";import"./form-DW9viO4r.js";import"./label-CLOKtxmE.js";import"./spinner-DP-rnGOg.js";import"./useMutation-DXvszu1D.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"&&new Date(d.expiresAt)>new Date),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function Ae(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{Ae as default};
1
+ import{c as f,j as s,d as I,r as C,b6 as F,b as E,m as O,t as w}from"./index-Chdo1wOf.js";import{C as k}from"./card-C5XZXHnb.js";import{c as y,B as $}from"./button-BlFVi9O-.js";import{A as R}from"./avatar-CLzAk7bk.js";import{i as D}from"./AlertCircle-DiDJuuO7.js";import{i as H}from"./Check-ebSdGxZp.js";import{s as G}from"./Plus-YlJja9E2.js";import{i as Q}from"./SearchMd-CdY2Qz31.js";import{s as q}from"./XClose-CNjsPY9p.js";import{I as B}from"./input-C2bYHqSZ.js";import{C as T}from"./create-organization-dialog-BFIfEtVL.js";import"./alert-dialog-DG1mgLiN.js";import"./form-DdvC8UfL.js";import"./label-Cz00Hk_C.js";import"./spinner-DeIV40-d.js";import"./useMutation-BTkDU0tp.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"&&new Date(d.expiresAt)>new Date),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function Ae(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{Ae as default};
@@ -1 +1 @@
1
- import{r as k,c as p,j as o,T as L,J as K,I as V,Q as W,W as G,U,M as X,v as q,y as F}from"./index-Dj3-TAFC.js";import{u as J}from"./use-mobile-Dn42c33D.js";import{c as b,B as Q}from"./button-BpEnz7t9.js";import{i as Y,a as M,c as D,b as P,T as A}from"./tooltip-jCrVkUGG.js";const R=({size:i=24,color:e="currentColor",...t})=>k.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},k.createElement("path",{d:"M9 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));R.displayName="LayoutLeft";function Z(i){const e=p.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let a;return e[2]!==t?(a=o.jsx(V,{"data-slot":"sheet",...t}),e[2]=t,e[3]=a):a=e[3],a}function ee(i){const e=p.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let a;return e[2]!==t?(a=o.jsx(W,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function te(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx(U,{"data-slot":"sheet-overlay",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function se(i){const e=p.c(17);let t,a,s,l;e[0]!==i?({className:a,children:t,side:l,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l):(t=e[1],a=e[2],s=e[3],l=e[4]);const c=l===void 0?"right":l;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(te,{}),e[5]=r):r=e[5];const n=c==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",f=c==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",u=c==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",h=c==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let d;e[6]!==a||e[7]!==n||e[8]!==f||e[9]!==u||e[10]!==h?(d=b("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n,f,u,h,a),e[6]=a,e[7]=n,e[8]=f,e[9]=u,e[10]=h,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsxs(G,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(Y,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=m):m=e[12];let N;return e[13]!==t||e[14]!==s||e[15]!==d?(N=o.jsxs(ee,{children:[r,o.jsxs(K,{"data-slot":"sheet-content",className:d,...s,children:[t,m]})]}),e[13]=t,e[14]=s,e[15]=d,e[16]=N):N=e[16],N}function ae(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sheet-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function le(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("text-foreground font-semibold",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx(L,{"data-slot":"sheet-title",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function ie(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("text-muted-foreground text-sm",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx(X,{"data-slot":"sheet-description",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}const oe="sidebar_state",ne=3600*24*7,re="16rem",de="18rem",ce="3rem",fe="b",B=k.createContext(null);function O(){const i=k.useContext(B);if(!i)throw new Error("useSidebar must be used within a SidebarProvider.");return i}function Se(i){const e=p.c(21),{defaultOpen:t,open:a,onOpenChange:s,children:l}=i,c=t===void 0?!0:t,r=J(),[n,f]=k.useState(!1),[u,h]=k.useState(c),d=a??u;let m;e[0]!==d||e[1]!==s?(m=$=>{const y=typeof $=="function"?$(d):$;s?s(y):h(y),document.cookie=`${oe}=${y}; path=/; max-age=${ne}`},e[0]=d,e[1]=s,e[2]=m):m=e[2];const N=m;let E;e[3]!==r||e[4]!==N?(E=()=>r?f(pe):N(ue),e[3]=r,e[4]=N,e[5]=E):E=e[5];const g=E;let C,j;e[6]!==g?(C=()=>{const $=y=>{if(y.key===fe&&(y.metaKey||y.ctrlKey)){const T=y.target;if(T.tagName==="INPUT"||T.tagName==="TEXTAREA"||T.isContentEditable)return;y.preventDefault(),g()}};return globalThis.addEventListener("keydown",$),()=>globalThis.removeEventListener("keydown",$)},j=[g],e[6]=g,e[7]=C,e[8]=j):(C=e[7],j=e[8]),k.useEffect(C,j);const w=d?"expanded":"collapsed";let S;e[9]!==r||e[10]!==d||e[11]!==n||e[12]!==N||e[13]!==w||e[14]!==g?(S={state:w,open:d,setOpen:N,isMobile:r,openMobile:n,setOpenMobile:f,toggleSidebar:g},e[9]=r,e[10]=d,e[11]=n,e[12]=N,e[13]=w,e[14]=g,e[15]=S):S=e[15];const _=S;let x;e[16]!==l?(x=o.jsx(D,{delayDuration:0,children:l}),e[16]=l,e[17]=x):x=e[17];let v;return e[18]!==_||e[19]!==x?(v=o.jsx(B.Provider,{value:_,children:x}),e[18]=_,e[19]=x,e[20]=v):v=e[20],v}function ue(i){return!i}function pe(i){return!i}function _e(i){const e=p.c(14);let t,a,s,l;e[0]!==i?({className:a,style:l,children:t,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l):(t=e[1],a=e[2],s=e[3],l=e[4]);let c;e[5]!==l?(c={"--sidebar-width":re,"--sidebar-width-icon":ce,...l},e[5]=l,e[6]=c):c=e[6];const r=c;let n;e[7]!==a?(n=b("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=n):n=e[8];let f;return e[9]!==t||e[10]!==s||e[11]!==r||e[12]!==n?(f=o.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:n,...s,children:t}),e[9]=t,e[10]=s,e[11]=r,e[12]=n,e[13]=f):f=e[13],f}function Ce(i){const e=p.c(42);let t,a,s,l,c,r;e[0]!==i?({side:l,variant:c,collapsible:r,className:a,children:t,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l,e[5]=c,e[6]=r):(t=e[1],a=e[2],s=e[3],l=e[4],c=e[5],r=e[6]);const n=l===void 0?"left":l,f=c===void 0?"sidebar":c,u=r===void 0?"offcanvas":r,{isMobile:h,state:d,openMobile:m,setOpenMobile:N}=O();if(u==="none"){let x;e[7]!==a?(x=b("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=x):x=e[8];let v;return e[9]!==t||e[10]!==s||e[11]!==x?(v=o.jsx("div",{"data-slot":"sidebar",className:x,...s,children:t}),e[9]=t,e[10]=s,e[11]=x,e[12]=v):v=e[12],v}if(h){let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x={"--sidebar-width":de},e[13]=x):x=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsxs(ae,{className:"sr-only",children:[o.jsx(le,{children:"Sidebar"}),o.jsx(ie,{children:"Displays the mobile sidebar."})]}),e[14]=v):v=e[14];let $;e[15]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[15]=t,e[16]=$):$=e[16];let y;e[17]!==n||e[18]!==$?(y=o.jsxs(se,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:x,side:n,children:[v,$]}),e[17]=n,e[18]=$,e[19]=y):y=e[19];let T;return e[20]!==m||e[21]!==s||e[22]!==N||e[23]!==y?(T=o.jsx(Z,{open:m,onOpenChange:N,...s,children:y}),e[20]=m,e[21]=s,e[22]=N,e[23]=y,e[24]=T):T=e[24],T}const E=f==="floating"||f==="inset"?"data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"data-[collapsible=icon]:w-(--sidebar-width-icon)";let g;e[25]!==E?(g=b("group peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","w-(--sidebar-width) transition-[width] duration-300 ease-[var(--ease-out-quart)]","data-[collapsible=offcanvas]:w-0",E),e[25]=E,e[26]=g):g=e[26];const C=d==="collapsed"?u:"";let j;e[27]!==a?(j=b("flex flex-col h-full w-(--sidebar-width)",a),e[27]=a,e[28]=j):j=e[28];let w;e[29]!==t?(w=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:t}),e[29]=t,e[30]=w):w=e[30];let S;e[31]!==s||e[32]!==j||e[33]!==w?(S=o.jsx("div",{"data-slot":"sidebar-container",className:j,...s,children:w}),e[31]=s,e[32]=j,e[33]=w,e[34]=S):S=e[34];let _;return e[35]!==n||e[36]!==d||e[37]!==g||e[38]!==C||e[39]!==S||e[40]!==f?(_=o.jsx("div",{className:g,"data-state":d,"data-collapsible":C,"data-variant":f,"data-side":n,"data-slot":"sidebar",children:S}),e[35]=n,e[36]=d,e[37]=g,e[38]=C,e[39]=S,e[40]=f,e[41]=_):_=e[41],_}function be(i){const e=p.c(18);let t,a,s;e[0]!==i?({className:t,onClick:a,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s):(t=e[1],a=e[2],s=e[3]);const{toggleSidebar:l}=O();let c;e[4]!==t?(c=b("size-7",t),e[4]=t,e[5]=c):c=e[5];let r;e[6]!==a||e[7]!==l?(r=m=>{a?.(m),l()},e[6]=a,e[7]=l,e[8]=r):r=e[8];let n,f;e[9]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(R,{}),f=o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=n,e[10]=f):(n=e[9],f=e[10]);let u;e[11]!==s||e[12]!==c||e[13]!==r?(u=o.jsx(M,{asChild:!0,children:o.jsxs(Q,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:c,onClick:r,...s,children:[n,f]})}),e[11]=s,e[12]=c,e[13]=r,e[14]=u):u=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsxs(P,{side:"bottom",className:"flex items-center gap-2",children:["Collapse sidebar",o.jsx("kbd",{className:"bg-background/20 rounded px-1 py-0.5 text-[10px] font-mono",children:"⌘B"})]}),e[15]=h):h=e[15];let d;return e[16]!==u?(d=o.jsx(D,{delayDuration:300,children:o.jsxs(A,{children:[u,h]})}),e[16]=u,e[17]=d):d=e[17],d}function $e(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("main",{"data-slot":"sidebar-inset",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Ee(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function ke(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Te(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("h-4 m-0! w-full",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-sidebar":"separator",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Oe(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Ie(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Me(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("w-full text-sm",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function De(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex w-full min-w-0 flex-col gap-1",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Pe(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("group/menu-item relative",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}const me=F("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md py-0 pr-0.5 pl-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ae(i){const e=p.c(28);let t,a,s,l,c,r,n;e[0]!==i?({asChild:s,isActive:l,variant:c,size:r,tooltip:n,className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l,e[5]=c,e[6]=r,e[7]=n):(t=e[1],a=e[2],s=e[3],l=e[4],c=e[5],r=e[6],n=e[7]);const f=s===void 0?!1:s,u=l===void 0?!1:l,h=c===void 0?"default":c,d=r===void 0?"default":r,m=f?q:"button",{isMobile:N,state:E}=O();let g;e[8]!==t||e[9]!==d||e[10]!==h?(g=b(me({variant:h,size:d}),t),e[8]=t,e[9]=d,e[10]=h,e[11]=g):g=e[11];let C;e[12]!==m||e[13]!==u||e[14]!==a||e[15]!==d||e[16]!==g?(C=o.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":d,"data-active":u,className:g,...a}),e[12]=m,e[13]=u,e[14]=a,e[15]=d,e[16]=g,e[17]=C):C=e[17];const j=C;if(!n)return j;if(typeof n=="string"){let v;e[18]!==n?(v={children:n},e[18]=n,e[19]=v):v=e[19],n=v}let w;e[20]!==j?(w=o.jsx(M,{asChild:!0,children:j}),e[20]=j,e[21]=w):w=e[21];const S=E!=="collapsed"||N;let _;e[22]!==S||e[23]!==n?(_=o.jsx(P,{side:"right",align:"center",hidden:S,...n}),e[22]=S,e[23]=n,e[24]=_):_=e[24];let x;return e[25]!==w||e[26]!==_?(x=o.jsxs(A,{children:[w,_]}),e[25]=w,e[26]=_,e[27]=x):x=e[27],x}function I(i,e){const t=k.Children.toArray(i);for(const a of t)if(k.isValidElement(a)&&a.type===e)return a;return null}function he(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex flex-col h-full bg-background overflow-hidden",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}function xe(i){const e=p.c(16),{children:t,className:a,hideSidebarTrigger:s}=i;let l;e[0]!==t?(l=I(t,z),e[0]=t,e[1]=l):l=e[1];const c=l;let r;e[2]!==t?(r=I(t,H),e[2]=t,e[3]=r):r=e[3];const n=r,f=s?"pl-4":"pl-2";let u;e[4]!==a||e[5]!==f?(u=b("shrink-0 w-full border-b border-border/50 h-11 overflow-x-auto","flex items-center justify-between gap-3 pr-4 min-w-max",f,a),e[4]=a,e[5]=f,e[6]=u):u=e[6];let h;e[7]!==s?(h=!s&&o.jsx(be,{className:"text-muted-foreground"}),e[7]=s,e[8]=h):h=e[8];let d;e[9]!==c||e[10]!==h?(d=o.jsxs("div",{className:"flex items-center gap-1",children:[h,c]}),e[9]=c,e[10]=h,e[11]=d):d=e[11];let m;return e[12]!==n||e[13]!==u||e[14]!==d?(m=o.jsxs("div",{className:u,children:[d,n]}),e[12]=n,e[13]=u,e[14]=d,e[15]=m):m=e[15],m}function z(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex items-center gap-2 shrink-0 overflow-hidden",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}function H(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex items-center gap-2 shrink-0 overflow-hidden border-l border-border pl-3",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}function ge(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex-1 overflow-auto",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}const Re=Object.assign(he,{Header:Object.assign(xe,{Left:z,Right:H}),Content:ge});export{Re as P,ae as S,le as a,se as b,Z as c,De as d,Pe as e,Ae as f,Me as g,Ie as h,Te as i,Oe as j,Ce as k,Ee as l,ke as m,Se as n,$e as o,_e as p,O as u};
1
+ import{r as k,c as p,j as o,T as L,J as K,I as V,Q as W,W as G,U,M as X,v as q,y as F}from"./index-Chdo1wOf.js";import{u as J}from"./use-mobile-ziAtnWz2.js";import{c as b,B as Q}from"./button-BlFVi9O-.js";import{i as Y,a as M,c as D,b as P,T as A}from"./tooltip-BWW8lvJo.js";const R=({size:i=24,color:e="currentColor",...t})=>k.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},k.createElement("path",{d:"M9 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));R.displayName="LayoutLeft";function Z(i){const e=p.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let a;return e[2]!==t?(a=o.jsx(V,{"data-slot":"sheet",...t}),e[2]=t,e[3]=a):a=e[3],a}function ee(i){const e=p.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let a;return e[2]!==t?(a=o.jsx(W,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function te(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx(U,{"data-slot":"sheet-overlay",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function se(i){const e=p.c(17);let t,a,s,l;e[0]!==i?({className:a,children:t,side:l,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l):(t=e[1],a=e[2],s=e[3],l=e[4]);const c=l===void 0?"right":l;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(te,{}),e[5]=r):r=e[5];const n=c==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",f=c==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",u=c==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",h=c==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let d;e[6]!==a||e[7]!==n||e[8]!==f||e[9]!==u||e[10]!==h?(d=b("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n,f,u,h,a),e[6]=a,e[7]=n,e[8]=f,e[9]=u,e[10]=h,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsxs(G,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(Y,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=m):m=e[12];let N;return e[13]!==t||e[14]!==s||e[15]!==d?(N=o.jsxs(ee,{children:[r,o.jsxs(K,{"data-slot":"sheet-content",className:d,...s,children:[t,m]})]}),e[13]=t,e[14]=s,e[15]=d,e[16]=N):N=e[16],N}function ae(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sheet-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function le(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("text-foreground font-semibold",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx(L,{"data-slot":"sheet-title",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function ie(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("text-muted-foreground text-sm",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx(X,{"data-slot":"sheet-description",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}const oe="sidebar_state",ne=3600*24*7,re="16rem",de="18rem",ce="3rem",fe="b",B=k.createContext(null);function O(){const i=k.useContext(B);if(!i)throw new Error("useSidebar must be used within a SidebarProvider.");return i}function Se(i){const e=p.c(21),{defaultOpen:t,open:a,onOpenChange:s,children:l}=i,c=t===void 0?!0:t,r=J(),[n,f]=k.useState(!1),[u,h]=k.useState(c),d=a??u;let m;e[0]!==d||e[1]!==s?(m=$=>{const y=typeof $=="function"?$(d):$;s?s(y):h(y),document.cookie=`${oe}=${y}; path=/; max-age=${ne}`},e[0]=d,e[1]=s,e[2]=m):m=e[2];const N=m;let E;e[3]!==r||e[4]!==N?(E=()=>r?f(pe):N(ue),e[3]=r,e[4]=N,e[5]=E):E=e[5];const g=E;let C,j;e[6]!==g?(C=()=>{const $=y=>{if(y.key===fe&&(y.metaKey||y.ctrlKey)){const T=y.target;if(T.tagName==="INPUT"||T.tagName==="TEXTAREA"||T.isContentEditable)return;y.preventDefault(),g()}};return globalThis.addEventListener("keydown",$),()=>globalThis.removeEventListener("keydown",$)},j=[g],e[6]=g,e[7]=C,e[8]=j):(C=e[7],j=e[8]),k.useEffect(C,j);const w=d?"expanded":"collapsed";let S;e[9]!==r||e[10]!==d||e[11]!==n||e[12]!==N||e[13]!==w||e[14]!==g?(S={state:w,open:d,setOpen:N,isMobile:r,openMobile:n,setOpenMobile:f,toggleSidebar:g},e[9]=r,e[10]=d,e[11]=n,e[12]=N,e[13]=w,e[14]=g,e[15]=S):S=e[15];const _=S;let x;e[16]!==l?(x=o.jsx(D,{delayDuration:0,children:l}),e[16]=l,e[17]=x):x=e[17];let v;return e[18]!==_||e[19]!==x?(v=o.jsx(B.Provider,{value:_,children:x}),e[18]=_,e[19]=x,e[20]=v):v=e[20],v}function ue(i){return!i}function pe(i){return!i}function _e(i){const e=p.c(14);let t,a,s,l;e[0]!==i?({className:a,style:l,children:t,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l):(t=e[1],a=e[2],s=e[3],l=e[4]);let c;e[5]!==l?(c={"--sidebar-width":re,"--sidebar-width-icon":ce,...l},e[5]=l,e[6]=c):c=e[6];const r=c;let n;e[7]!==a?(n=b("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=n):n=e[8];let f;return e[9]!==t||e[10]!==s||e[11]!==r||e[12]!==n?(f=o.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:n,...s,children:t}),e[9]=t,e[10]=s,e[11]=r,e[12]=n,e[13]=f):f=e[13],f}function Ce(i){const e=p.c(42);let t,a,s,l,c,r;e[0]!==i?({side:l,variant:c,collapsible:r,className:a,children:t,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l,e[5]=c,e[6]=r):(t=e[1],a=e[2],s=e[3],l=e[4],c=e[5],r=e[6]);const n=l===void 0?"left":l,f=c===void 0?"sidebar":c,u=r===void 0?"offcanvas":r,{isMobile:h,state:d,openMobile:m,setOpenMobile:N}=O();if(u==="none"){let x;e[7]!==a?(x=b("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=x):x=e[8];let v;return e[9]!==t||e[10]!==s||e[11]!==x?(v=o.jsx("div",{"data-slot":"sidebar",className:x,...s,children:t}),e[9]=t,e[10]=s,e[11]=x,e[12]=v):v=e[12],v}if(h){let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x={"--sidebar-width":de},e[13]=x):x=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsxs(ae,{className:"sr-only",children:[o.jsx(le,{children:"Sidebar"}),o.jsx(ie,{children:"Displays the mobile sidebar."})]}),e[14]=v):v=e[14];let $;e[15]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[15]=t,e[16]=$):$=e[16];let y;e[17]!==n||e[18]!==$?(y=o.jsxs(se,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:x,side:n,children:[v,$]}),e[17]=n,e[18]=$,e[19]=y):y=e[19];let T;return e[20]!==m||e[21]!==s||e[22]!==N||e[23]!==y?(T=o.jsx(Z,{open:m,onOpenChange:N,...s,children:y}),e[20]=m,e[21]=s,e[22]=N,e[23]=y,e[24]=T):T=e[24],T}const E=f==="floating"||f==="inset"?"data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"data-[collapsible=icon]:w-(--sidebar-width-icon)";let g;e[25]!==E?(g=b("group peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","w-(--sidebar-width) transition-[width] duration-300 ease-[var(--ease-out-quart)]","data-[collapsible=offcanvas]:w-0",E),e[25]=E,e[26]=g):g=e[26];const C=d==="collapsed"?u:"";let j;e[27]!==a?(j=b("flex flex-col h-full w-(--sidebar-width)",a),e[27]=a,e[28]=j):j=e[28];let w;e[29]!==t?(w=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:t}),e[29]=t,e[30]=w):w=e[30];let S;e[31]!==s||e[32]!==j||e[33]!==w?(S=o.jsx("div",{"data-slot":"sidebar-container",className:j,...s,children:w}),e[31]=s,e[32]=j,e[33]=w,e[34]=S):S=e[34];let _;return e[35]!==n||e[36]!==d||e[37]!==g||e[38]!==C||e[39]!==S||e[40]!==f?(_=o.jsx("div",{className:g,"data-state":d,"data-collapsible":C,"data-variant":f,"data-side":n,"data-slot":"sidebar",children:S}),e[35]=n,e[36]=d,e[37]=g,e[38]=C,e[39]=S,e[40]=f,e[41]=_):_=e[41],_}function be(i){const e=p.c(18);let t,a,s;e[0]!==i?({className:t,onClick:a,...s}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s):(t=e[1],a=e[2],s=e[3]);const{toggleSidebar:l}=O();let c;e[4]!==t?(c=b("size-7",t),e[4]=t,e[5]=c):c=e[5];let r;e[6]!==a||e[7]!==l?(r=m=>{a?.(m),l()},e[6]=a,e[7]=l,e[8]=r):r=e[8];let n,f;e[9]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(R,{}),f=o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=n,e[10]=f):(n=e[9],f=e[10]);let u;e[11]!==s||e[12]!==c||e[13]!==r?(u=o.jsx(M,{asChild:!0,children:o.jsxs(Q,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:c,onClick:r,...s,children:[n,f]})}),e[11]=s,e[12]=c,e[13]=r,e[14]=u):u=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsxs(P,{side:"bottom",className:"flex items-center gap-2",children:["Collapse sidebar",o.jsx("kbd",{className:"bg-background/20 rounded px-1 py-0.5 text-[10px] font-mono",children:"⌘B"})]}),e[15]=h):h=e[15];let d;return e[16]!==u?(d=o.jsx(D,{delayDuration:300,children:o.jsxs(A,{children:[u,h]})}),e[16]=u,e[17]=d):d=e[17],d}function $e(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("main",{"data-slot":"sidebar-inset",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Ee(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function ke(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Te(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("h-4 m-0! w-full",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-sidebar":"separator",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Oe(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Ie(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Me(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("w-full text-sm",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function De(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("flex w-full min-w-0 flex-col gap-1",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}function Pe(i){const e=p.c(8);let t,a;e[0]!==i?({className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=b("group/menu-item relative",t),e[3]=t,e[4]=s):s=e[4];let l;return e[5]!==a||e[6]!==s?(l=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:s,...a}),e[5]=a,e[6]=s,e[7]=l):l=e[7],l}const me=F("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md py-0 pr-0.5 pl-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ae(i){const e=p.c(28);let t,a,s,l,c,r,n;e[0]!==i?({asChild:s,isActive:l,variant:c,size:r,tooltip:n,className:t,...a}=i,e[0]=i,e[1]=t,e[2]=a,e[3]=s,e[4]=l,e[5]=c,e[6]=r,e[7]=n):(t=e[1],a=e[2],s=e[3],l=e[4],c=e[5],r=e[6],n=e[7]);const f=s===void 0?!1:s,u=l===void 0?!1:l,h=c===void 0?"default":c,d=r===void 0?"default":r,m=f?q:"button",{isMobile:N,state:E}=O();let g;e[8]!==t||e[9]!==d||e[10]!==h?(g=b(me({variant:h,size:d}),t),e[8]=t,e[9]=d,e[10]=h,e[11]=g):g=e[11];let C;e[12]!==m||e[13]!==u||e[14]!==a||e[15]!==d||e[16]!==g?(C=o.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":d,"data-active":u,className:g,...a}),e[12]=m,e[13]=u,e[14]=a,e[15]=d,e[16]=g,e[17]=C):C=e[17];const j=C;if(!n)return j;if(typeof n=="string"){let v;e[18]!==n?(v={children:n},e[18]=n,e[19]=v):v=e[19],n=v}let w;e[20]!==j?(w=o.jsx(M,{asChild:!0,children:j}),e[20]=j,e[21]=w):w=e[21];const S=E!=="collapsed"||N;let _;e[22]!==S||e[23]!==n?(_=o.jsx(P,{side:"right",align:"center",hidden:S,...n}),e[22]=S,e[23]=n,e[24]=_):_=e[24];let x;return e[25]!==w||e[26]!==_?(x=o.jsxs(A,{children:[w,_]}),e[25]=w,e[26]=_,e[27]=x):x=e[27],x}function I(i,e){const t=k.Children.toArray(i);for(const a of t)if(k.isValidElement(a)&&a.type===e)return a;return null}function he(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex flex-col h-full bg-background overflow-hidden",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}function xe(i){const e=p.c(16),{children:t,className:a,hideSidebarTrigger:s}=i;let l;e[0]!==t?(l=I(t,z),e[0]=t,e[1]=l):l=e[1];const c=l;let r;e[2]!==t?(r=I(t,H),e[2]=t,e[3]=r):r=e[3];const n=r,f=s?"pl-4":"pl-2";let u;e[4]!==a||e[5]!==f?(u=b("shrink-0 w-full border-b border-border/50 h-11 overflow-x-auto","flex items-center justify-between gap-3 pr-4 min-w-max",f,a),e[4]=a,e[5]=f,e[6]=u):u=e[6];let h;e[7]!==s?(h=!s&&o.jsx(be,{className:"text-muted-foreground"}),e[7]=s,e[8]=h):h=e[8];let d;e[9]!==c||e[10]!==h?(d=o.jsxs("div",{className:"flex items-center gap-1",children:[h,c]}),e[9]=c,e[10]=h,e[11]=d):d=e[11];let m;return e[12]!==n||e[13]!==u||e[14]!==d?(m=o.jsxs("div",{className:u,children:[d,n]}),e[12]=n,e[13]=u,e[14]=d,e[15]=m):m=e[15],m}function z(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex items-center gap-2 shrink-0 overflow-hidden",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}function H(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex items-center gap-2 shrink-0 overflow-hidden border-l border-border pl-3",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}function ge(i){const e=p.c(5),{children:t,className:a}=i;let s;e[0]!==a?(s=b("flex-1 overflow-auto",a),e[0]=a,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==s?(l=o.jsx("div",{className:s,children:t}),e[2]=t,e[3]=s,e[4]=l):l=e[4],l}const Re=Object.assign(he,{Header:Object.assign(xe,{Left:z,Right:H}),Content:ge});export{Re as P,ae as S,le as a,se as b,Z as c,De as d,Pe as e,Ae as f,Me as g,Ie as h,Te as i,Oe as j,Ce as k,Ee as l,ke as m,Se as n,$e as o,_e as p,O as u};
@@ -1 +1 @@
1
- import{bq as _}from"./index-Dj3-TAFC.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{bq as _}from"./index-Chdo1wOf.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,4 +1,4 @@
1
- import{r as O,c as K,o as mr,k as O1,l as L1,j as E,s as ei,bX as D1,bY as _C,bm as Ge,bZ as CC,G as M1,u as gr,t as Pt,ak as IC,b_ as RC,b5 as P1,b$ as kC,c0 as At,c1 as Hs,c2 as xC,c3 as $s,c4 as wC,c5 as OC,c6 as LC,c7 as DC,n as MC,K as eh,c8 as PC,c9 as FC,ca as BC,cb as UC,m as F1,b as B1,O as za,cc as ti,bq as HC,d as $C}from"./index-Dj3-TAFC.js";import{B as be,c as ne}from"./button-BpEnz7t9.js";import{u as Zi,b as Qi,m as U1,M as qC,t as H1,C as jC}from"./context-KYYCma1O.js";import{b as br,P as Er,a as Tr}from"./popover-BvNaYtjG.js";import{S as Tm}from"./skeleton-BEJPNsmx.js";import{S as Ji}from"./spinner-DP-rnGOg.js";import{T as pt,a as ft,b as ht,c as es,i as $1}from"./tooltip-jCrVkUGG.js";import{d as q1,u as th,i as ar,f as zC}from"./constants-BoBHGSW8.js";import{u as GC,g as j1,l as ym,a as Sm,r as VC}from"./use-mcp-prompts-DKsdNnZ7.js";import{E as WC}from"./error-boundary-DKBJmhkm.js";import{c as YC,b as KC,e as XC,a as ZC,D as QC}from"./dialog-CKyGpmoE.js";import{a as sf,F as ts,b as ns,c as JC,d as rs,f as as}from"./form-DW9viO4r.js";import{I as z1}from"./input-BJdUVCMG.js";import{I as is}from"./integration-icon-CitBcWGE.js";import{c as eI,a as tI,e as nI}from"./usage-B8eRkRZY.js";import{i as rI}from"./ArrowUp-Bt1al9WB.js";import{t as of}from"./ChevronDown-5ys0844E.js";import{i as aI}from"./Edit01-pUCJ7HNy.js";import{t as ir}from"./Users03-13i8se4V.js";import{i as iI}from"./XCircle-Bnl7RwSj.js";import{i as sI}from"./AlertCircle-BpvTeRWZ.js";import{i as oI}from"./AlertTriangle-BQr7kJDW.js";import{c as lI,b as uI,d as cI,i as dI,e as G1,f as V1,C as W1,u as pI}from"./use-deco-chat-open-DEcM1zJp.js";import{i as fI}from"./ArrowLeft-6opPa7zy.js";import{i as hI,t as Y1,u as K1}from"./use-copy-52ScM36o.js";import{B as mI}from"./badge-BAIkBZff.js";import{i as Bn}from"./Check-COoTrHCh.js";import{i as gI}from"./Code01-BZ3OnS6C.js";import{b as bI}from"./use-virtual-mcp-BSB4fi0P.js";import{i as X1}from"./SearchMd-BkraDgIf.js";import{u as EI}from"./use-create-virtual-mcp-Dgc9LRMA.js";import{i as TI,O as yI,a as SI}from"./deco-constants-DGRap-0f.js";import{i as Z1}from"./ChevronRight-B8put0eN.js";import{m as AI}from"./marked.esm-BaswSlok.js";import{f as nh,p as Am,a as Nm,n as vm,h as ss,s as Ea,o as lf,b as NI,c as vI,d as Un,v as _I,e as Q1,g as _m,m as CI,i as II,r as RI}from"./markdown-C6oZzbdV.js";import{a as ls}from"./Copy01-RhM6GPKh.js";import{a as kI}from"./tools-list-CYXwR1B4.js";import{E as xI}from"./empty-state-CXRsSa_5.js";import{g as wI,h as OI}from"./use-connection-CU2MpSPl.js";import{g as LI}from"./generate-id-Dyweu44Y.js";import{s as Cm}from"./Clock-lQFxjk3U.js";import{s as DI}from"./Trash01-BS69Rn26.js";const J1=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"}));J1.displayName="Activity";const eA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));eA.displayName="Atom02";const tA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"m21.152 10.9-9.015 9.015a5.25 5.25 0 0 1-7.425-7.425l9.016-9.015a3.5 3.5 0 1 1 4.95 4.95l-8.662 8.662a1.75 1.75 0 1 1-2.475-2.475l7.601-7.602"}));tA.displayName="Attachment01";const rh=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));rh.displayName="Edit02";const nA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));nA.displayName="Lightbulb01";const rA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));rA.displayName="Stop";const aA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));aA.displayName="Target04";const Im={}.hasOwnProperty;function iA(t,e){const n=e||{};function r(a,...i){let s=r.invalid;const o=r.handlers;if(a&&Im.call(a,t)){const l=String(a[t]);s=Im.call(o,l)?o[l]:r.unknown}if(s)return s.call(this,a,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function MI(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?ei().min(1,"Required"):ei();return mr(e)}function PI(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function sA(t){const e=K.c(64),{prompt:n,setPrompt:r,onSubmit:a}=t,i=O.useId();let s;if(e[0]!==n){const F=n?MI(n):mr({});s=O1(F),e[0]=n,e[1]=s}else s=e[1];const l=s;let u;e[2]!==n?(u=n?PI(n):{},e[2]=n,e[3]=u):u=e[3];let c;e[4]!==l||e[5]!==u?(c={resolver:l,defaultValues:u,mode:"onChange"},e[4]=l,e[5]=u,e[6]=c):c=e[6];const d=L1(c);let p;e[7]!==n?.arguments?(p=n?.arguments??[],e[7]=n?.arguments,e[8]=p):p=e[8];const f=p;let m;e[9]!==d||e[10]!==a||e[11]!==r?(m=async F=>{await a(F),r(null),d.reset()},e[9]=d,e[10]=a,e[11]=r,e[12]=m):m=e[12];const g=m;let b;e[13]!==d||e[14]!==r?(b=F=>{F||(d.reset(),r(null))},e[13]=d,e[14]=r,e[15]=b):b=e[15];const y=b;if(!n)return null;let T;e[16]!==n.name||e[17]!==n.title?(T=n.title||n.name.replace(/_/g," "),e[16]=n.name,e[17]=n.title,e[18]=T):T=e[18];let S;e[19]!==T?(S=E.jsx(YC,{children:T}),e[19]=T,e[20]=S):S=e[20];let A;e[21]!==n.description?(A=n.description&&E.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[21]=n.description,e[22]=A):A=e[22];let v;e[23]!==A||e[24]!==S?(v=E.jsxs(KC,{children:[S,A]}),e[23]=A,e[24]=S,e[25]=v):v=e[25];let N;e[26]!==d||e[27]!==g?(N=F=>{F.stopPropagation(),d.handleSubmit(g)(F)},e[26]=d,e[27]=g,e[28]=N):N=e[28];let C;if(e[29]!==f||e[30]!==d.control||e[31]!==d.formState.isSubmitting){let F;e[33]!==d.control||e[34]!==d.formState.isSubmitting?(F=Y=>E.jsx(ts,{control:d.control,name:Y.name,render:Z=>{const{field:W}=Z;return E.jsxs(ns,{children:[E.jsxs(JC,{className:"text-xs",children:[Y.name,Y.required?null:E.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),E.jsx(rs,{children:E.jsx(z1,{...W,value:W.value??"",required:Y.required,placeholder:Y.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),E.jsx(as,{})]})}},Y.name),e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=F):F=e[35],C=f.map(F),e[29]=f,e[30]=d.control,e[31]=d.formState.isSubmitting,e[32]=C}else C=e[32];let x;e[36]!==y?(x=()=>y(!1),e[36]=y,e[37]=x):x=e[37];let R;e[38]!==d.formState.isSubmitting||e[39]!==x?(R=E.jsx(be,{type:"button",variant:"ghost",onClick:x,disabled:d.formState.isSubmitting,children:"Cancel"}),e[38]=d.formState.isSubmitting,e[39]=x,e[40]=R):R=e[40];const D=!d.formState.isValid||d.formState.isSubmitting;let w;e[41]!==d.formState.isSubmitting?(w=d.formState.isSubmitting?E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx(Ji,{size:"xs"}),"Loading..."]}):"Use prompt",e[41]=d.formState.isSubmitting,e[42]=w):w=e[42];let P;e[43]!==i||e[44]!==D||e[45]!==w?(P=E.jsx(be,{type:"submit",form:i,disabled:D,children:w}),e[43]=i,e[44]=D,e[45]=w,e[46]=P):P=e[46];let U;e[47]!==R||e[48]!==P?(U=E.jsxs(XC,{children:[R,P]}),e[47]=R,e[48]=P,e[49]=U):U=e[49];let B;e[50]!==i||e[51]!==N||e[52]!==C||e[53]!==U?(B=E.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:N,children:[C,U]}),e[50]=i,e[51]=N,e[52]=C,e[53]=U,e[54]=B):B=e[54];let G;e[55]!==d||e[56]!==B?(G=E.jsx(sf,{...d,children:B}),e[55]=d,e[56]=B,e[57]=G):G=e[57];let H;e[58]!==v||e[59]!==G?(H=E.jsxs(ZC,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,G]}),e[58]=v,e[59]=G,e[60]=H):H=e[60];let V;return e[61]!==y||e[62]!==H?(V=E.jsx(QC,{open:!0,onOpenChange:y,children:H}),e[61]=y,e[62]=H,e[63]=V):V=e[63],V}function Me(t){this.content=t}Me.prototype={constructor:Me,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,a=r.find(t),i=r.content.slice();return a==-1?i.push(n||t,e):(i[a+1]=e,n&&(i[a]=n)),new Me(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Me(n)},addToStart:function(t,e){return new Me([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Me(n)},addBefore:function(t,e,n){var r=this.remove(e),a=r.content.slice(),i=r.find(t);return a.splice(i==-1?a.length:i,0,e,n),new Me(a)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Me.from(t),t.size?new Me(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Me.from(t),t.size?new Me(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Me.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Me.from=function(t){if(t instanceof Me)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Me(e)};function oA(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let a=t.child(r),i=e.child(r);if(a==i){n+=a.nodeSize;continue}if(!a.sameMarkup(i))return n;if(a.isText&&a.text!=i.text){for(let s=0;a.text[s]==i.text[s];s++)n++;return n}if(a.content.size||i.content.size){let s=oA(a.content,i.content,n+1);if(s!=null)return s}n+=a.nodeSize}}function lA(t,e,n,r){for(let a=t.childCount,i=e.childCount;;){if(a==0||i==0)return a==i?null:{a:n,b:r};let s=t.child(--a),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=lA(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class q{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,a=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>e&&r(l,a+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,a+c)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,a){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?a?typeof a=="function"?a(o):a:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,a=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(a[a.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)a.push(e.content[i]);return new q(a,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],a=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),a+=o.nodeSize),s=l}return new q(r,a)}cutByIndex(e,n){return e==n?q.empty:e==0&&n==this.content.length?this:new q(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let a=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return a[e]=n,new q(a,i)}addToStart(e){return new q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new q(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let a=this.content[n];e(a,r,n),r+=a.nodeSize}}findDiffStart(e,n=0){return oA(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return lA(this,e,n,r)}findIndex(e){if(e==0)return Ra(0,e);if(e==this.size)return Ra(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let a=this.child(n),i=r+a.nodeSize;if(i>=e)return i==e?Ra(n+1,i):Ra(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return q.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new q(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return q.empty;let n,r=0;for(let a=0;a<e.length;a++){let i=e[a];r+=i.nodeSize,a&&i.isText&&e[a-1].sameMarkup(i)?(n||(n=e.slice(0,a)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new q(n||e,r)}static from(e){if(!e)return q.empty;if(e instanceof q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const qs={index:0,offset:0};function Ra(t,e){return qs.index=t,qs.offset=e,qs}function ni(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ni(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ni(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let pe=class uf{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let a=0;a<e.length;a++){let i=e[a];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,a));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,a)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ni(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let a=r.create(n.attrs);return r.checkAttrs(a.attrs),a}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return uf.none;if(e instanceof uf)return[e];let n=e.slice();return n.sort((r,a)=>r.type.rank-a.type.rank),n}};pe.none=[];class ri extends Error{}class X{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cA(this.content,e+this.openStart,n);return r&&new X(r,this.openStart,this.openEnd)}removeBetween(e,n){return new X(uA(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return X.empty;let r=n.openStart||0,a=n.openEnd||0;if(typeof r!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new X(q.fromJSON(e,n.content),r,a)}static maxOpen(e,n=!0){let r=0,a=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)a++;return new X(e,r,a)}}X.empty=new X(q.empty,0,0);function uA(t,e,n){let{index:r,offset:a}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(a==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(uA(i.content,e-a-1,n-a-1)))}function cA(t,e,n,r){let{index:a,offset:i}=t.findIndex(e),s=t.maybeChild(a);if(i==e||s.isText)return r&&!r.canReplace(a,a,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=cA(s.content,e-i-1,n,s);return o&&t.replaceChild(a,s.copy(o))}function FI(t,e,n){if(n.openStart>t.depth)throw new ri("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ri("Inconsistent open depths");return dA(t,e,n,0)}function dA(t,e,n,r){let a=t.index(r),i=t.node(r);if(a==e.index(r)&&r<t.depth-n.openStart){let s=dA(t,e,n,r+1);return i.copy(i.content.replaceChild(a,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return In(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=BI(n,t);return In(i,fA(t,s,o,e,r))}else return In(i,ai(t,e,r))}function pA(t,e){if(!e.type.compatibleContent(t.type))throw new ri("Cannot join "+e.type.name+" onto "+t.type.name)}function cf(t,e,n){let r=t.node(n);return pA(r,e.node(n)),r}function Cn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function $r(t,e,n,r){let a=(e||t).node(n),i=0,s=e?e.index(n):a.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Cn(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Cn(a.child(o),r);e&&e.depth==n&&e.textOffset&&Cn(e.nodeBefore,r)}function In(t,e){return t.type.checkContent(e),t.copy(e)}function fA(t,e,n,r,a){let i=t.depth>a&&cf(t,e,a+1),s=r.depth>a&&cf(n,r,a+1),o=[];return $r(null,t,a,o),i&&s&&e.index(a)==n.index(a)?(pA(i,s),Cn(In(i,fA(t,e,n,r,a+1)),o)):(i&&Cn(In(i,ai(t,e,a+1)),o),$r(e,n,a,o),s&&Cn(In(s,ai(n,r,a+1)),o)),$r(r,null,a,o),new q(o)}function ai(t,e,n){let r=[];if($r(null,t,n,r),t.depth>n){let a=cf(t,e,n+1);Cn(In(a,ai(t,e,n+1)),r)}return $r(e,null,n,r),new q(r)}function BI(t,e){let n=e.depth-t.openStart,a=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)a=e.node(i).copy(q.from(a));return{start:a.resolveNoCache(t.openStart+n),end:a.resolveNoCache(a.content.size-t.openEnd-n)}}class ra{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],a=e.child(n);return r?e.child(n).cut(r):a}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],a=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)a+=r.child(i).nodeSize;return a}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return pe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),a=e.maybeChild(n);if(!r){let o=r;r=a,a=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!a||!i[s].isInSet(a.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,a=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!a||!r[i].isInSet(a.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ii(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],a=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,o,a+l),!u||(s=s.child(o),s.isText))break;i=u-1,a+=l+1}return new ra(n,r,i)}static resolveCached(e,n){let r=Rm.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Rm.set(e,r=new UI);let a=r.elts[r.i]=ra.resolve(e,n);return r.i=(r.i+1)%HI,a}}class UI{constructor(){this.elts=[],this.i=0}}const HI=12,Rm=new WeakMap;class ii{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const $I=Object.create(null);let nn=class df{constructor(e,n,r,a=pe.none){this.type=e,this.attrs=n,this.marks=a,this.content=r||q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,a=0){this.content.nodesBetween(e,n,r,a,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,a){return this.content.textBetween(e,n,r,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ni(this.attrs,n||e.defaultAttrs||$I)&&pe.sameSet(this.marks,r||pe.none)}copy(e=null){return e==this.content?this:new df(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new df(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return X.empty;let a=this.resolve(e),i=this.resolve(n),s=r?0:a.sharedDepth(n),o=a.start(s),u=a.node(s).content.cut(a.pos-o,i.pos-o);return new X(u,a.depth-s,i.depth-s)}replace(e,n,r){return FI(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:a}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(a==e||n.isText)return n;e-=a+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let a=this.content.child(n-1);return{node:a,index:n-1,offset:r-a.nodeSize}}resolve(e){return ra.resolveCached(this,e)}resolveNoCache(e){return ra.resolve(this,e)}rangeHasMark(e,n,r){let a=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),hA(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=q.empty,a=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,a,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=a;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,a){if(a&&!this.type.allowsMarks(a))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=pe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let a=q.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,a,r);return i.type.checkAttrs(i.attrs),i}};nn.prototype.text=void 0;class si extends nn{constructor(e,n,r,a){if(super(e,n,null,a),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):hA(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new si(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new si(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function hA(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ln{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new qI(e,n);if(r.next==null)return Ln.empty;let a=mA(r);r.next&&r.err("Unexpected trailing text");let i=KI(YI(a));return XI(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let a=this;for(let i=n;a&&i<r;i++)a=a.matchType(e.child(i).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let a=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return q.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&a.indexOf(d)==-1){a.push(d);let p=i(d,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let a=r.shift(),i=a.match;if(i.matchType(e)){let s=[];for(let o=a;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!a.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:a}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let a=0;a<r.next.length;a++)e.indexOf(r.next[a].next)==-1&&n(r.next[a].next)}return n(this),e.map((r,a)=>{let i=a+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
1
+ import{r as O,c as K,o as mr,k as O1,l as L1,j as E,s as ei,bX as D1,bY as _C,bm as Ge,bZ as CC,G as M1,u as gr,t as Pt,ak as IC,b_ as RC,b5 as P1,b$ as kC,c0 as At,c1 as Hs,c2 as xC,c3 as $s,c4 as wC,c5 as OC,c6 as LC,c7 as DC,n as MC,K as eh,c8 as PC,c9 as FC,ca as BC,cb as UC,m as F1,b as B1,O as za,cc as ti,bq as HC,d as $C}from"./index-Chdo1wOf.js";import{B as be,c as ne}from"./button-BlFVi9O-.js";import{u as Zi,b as Qi,m as U1,M as qC,t as H1,C as jC}from"./context-CJpih0Aq.js";import{b as br,P as Er,a as Tr}from"./popover-B4On8gSm.js";import{S as Tm}from"./skeleton-DdrlSfda.js";import{S as Ji}from"./spinner-DeIV40-d.js";import{T as pt,a as ft,b as ht,c as es,i as $1}from"./tooltip-BWW8lvJo.js";import{d as q1,u as th,i as ar,f as zC}from"./constants-DS4O9R8r.js";import{u as GC,g as j1,l as ym,a as Sm,r as VC}from"./use-mcp-prompts-uD1aNW_g.js";import{E as WC}from"./error-boundary-DFWzxGF2.js";import{c as YC,b as KC,e as XC,a as ZC,D as QC}from"./dialog-BED3woG1.js";import{a as sf,F as ts,b as ns,c as JC,d as rs,f as as}from"./form-DdvC8UfL.js";import{I as z1}from"./input-C2bYHqSZ.js";import{I as is}from"./integration-icon-CHfvIBul.js";import{c as eI,a as tI,e as nI}from"./usage-B8eRkRZY.js";import{i as rI}from"./ArrowUp-CBTnQfpb.js";import{t as of}from"./ChevronDown-BxrIQ2Hg.js";import{i as aI}from"./Edit01-BySGjbs-.js";import{t as ir}from"./Users03-BiJcw06H.js";import{i as iI}from"./XCircle-oJlXTAnn.js";import{i as sI}from"./AlertCircle-DiDJuuO7.js";import{i as oI}from"./AlertTriangle-BR7J9Jvh.js";import{c as lI,b as uI,d as cI,i as dI,e as G1,f as V1,C as W1,u as pI}from"./use-deco-chat-open-Qq9AtQ8h.js";import{i as fI}from"./ArrowLeft-CZ4ZZXqO.js";import{i as hI,t as Y1,u as K1}from"./use-copy-Drx5AGFH.js";import{B as mI}from"./badge-zj5rJqFG.js";import{i as Bn}from"./Check-ebSdGxZp.js";import{i as gI}from"./Code01-62o0ASv5.js";import{b as bI}from"./use-virtual-mcp-BateG3is.js";import{i as X1}from"./SearchMd-CdY2Qz31.js";import{u as EI}from"./use-create-virtual-mcp-CZu2JnDv.js";import{i as TI,O as yI,a as SI}from"./deco-constants-B2fB4qCk.js";import{i as Z1}from"./ChevronRight-D1zpPr9G.js";import{m as AI}from"./marked.esm-BaswSlok.js";import{f as nh,p as Am,a as Nm,n as vm,h as ss,s as Ea,o as lf,b as NI,c as vI,d as Un,v as _I,e as Q1,g as _m,m as CI,i as II,r as RI}from"./markdown-W0glOUUc.js";import{a as ls}from"./Copy01-CfVZSokb.js";import{a as kI}from"./tools-list-TXvbi7bf.js";import{E as xI}from"./empty-state-DwKYfPjb.js";import{g as wI,h as OI}from"./use-connection-O4z2Mc_F.js";import{g as LI}from"./generate-id-Dyweu44Y.js";import{s as Cm}from"./Clock-ByTlM-Ae.js";import{s as DI}from"./Trash01-DjSET-_p.js";const J1=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"}));J1.displayName="Activity";const eA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));eA.displayName="Atom02";const tA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"m21.152 10.9-9.015 9.015a5.25 5.25 0 0 1-7.425-7.425l9.016-9.015a3.5 3.5 0 1 1 4.95 4.95l-8.662 8.662a1.75 1.75 0 1 1-2.475-2.475l7.601-7.602"}));tA.displayName="Attachment01";const rh=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));rh.displayName="Edit02";const nA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));nA.displayName="Lightbulb01";const rA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));rA.displayName="Stop";const aA=({size:t=24,color:e="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));aA.displayName="Target04";const Im={}.hasOwnProperty;function iA(t,e){const n=e||{};function r(a,...i){let s=r.invalid;const o=r.handlers;if(a&&Im.call(a,t)){const l=String(a[t]);s=Im.call(o,l)?o[l]:r.unknown}if(s)return s.call(this,a,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function MI(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?ei().min(1,"Required"):ei();return mr(e)}function PI(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function sA(t){const e=K.c(64),{prompt:n,setPrompt:r,onSubmit:a}=t,i=O.useId();let s;if(e[0]!==n){const F=n?MI(n):mr({});s=O1(F),e[0]=n,e[1]=s}else s=e[1];const l=s;let u;e[2]!==n?(u=n?PI(n):{},e[2]=n,e[3]=u):u=e[3];let c;e[4]!==l||e[5]!==u?(c={resolver:l,defaultValues:u,mode:"onChange"},e[4]=l,e[5]=u,e[6]=c):c=e[6];const d=L1(c);let p;e[7]!==n?.arguments?(p=n?.arguments??[],e[7]=n?.arguments,e[8]=p):p=e[8];const f=p;let m;e[9]!==d||e[10]!==a||e[11]!==r?(m=async F=>{await a(F),r(null),d.reset()},e[9]=d,e[10]=a,e[11]=r,e[12]=m):m=e[12];const g=m;let b;e[13]!==d||e[14]!==r?(b=F=>{F||(d.reset(),r(null))},e[13]=d,e[14]=r,e[15]=b):b=e[15];const y=b;if(!n)return null;let T;e[16]!==n.name||e[17]!==n.title?(T=n.title||n.name.replace(/_/g," "),e[16]=n.name,e[17]=n.title,e[18]=T):T=e[18];let S;e[19]!==T?(S=E.jsx(YC,{children:T}),e[19]=T,e[20]=S):S=e[20];let A;e[21]!==n.description?(A=n.description&&E.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[21]=n.description,e[22]=A):A=e[22];let v;e[23]!==A||e[24]!==S?(v=E.jsxs(KC,{children:[S,A]}),e[23]=A,e[24]=S,e[25]=v):v=e[25];let N;e[26]!==d||e[27]!==g?(N=F=>{F.stopPropagation(),d.handleSubmit(g)(F)},e[26]=d,e[27]=g,e[28]=N):N=e[28];let C;if(e[29]!==f||e[30]!==d.control||e[31]!==d.formState.isSubmitting){let F;e[33]!==d.control||e[34]!==d.formState.isSubmitting?(F=Y=>E.jsx(ts,{control:d.control,name:Y.name,render:Z=>{const{field:W}=Z;return E.jsxs(ns,{children:[E.jsxs(JC,{className:"text-xs",children:[Y.name,Y.required?null:E.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),E.jsx(rs,{children:E.jsx(z1,{...W,value:W.value??"",required:Y.required,placeholder:Y.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),E.jsx(as,{})]})}},Y.name),e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=F):F=e[35],C=f.map(F),e[29]=f,e[30]=d.control,e[31]=d.formState.isSubmitting,e[32]=C}else C=e[32];let x;e[36]!==y?(x=()=>y(!1),e[36]=y,e[37]=x):x=e[37];let R;e[38]!==d.formState.isSubmitting||e[39]!==x?(R=E.jsx(be,{type:"button",variant:"ghost",onClick:x,disabled:d.formState.isSubmitting,children:"Cancel"}),e[38]=d.formState.isSubmitting,e[39]=x,e[40]=R):R=e[40];const D=!d.formState.isValid||d.formState.isSubmitting;let w;e[41]!==d.formState.isSubmitting?(w=d.formState.isSubmitting?E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx(Ji,{size:"xs"}),"Loading..."]}):"Use prompt",e[41]=d.formState.isSubmitting,e[42]=w):w=e[42];let P;e[43]!==i||e[44]!==D||e[45]!==w?(P=E.jsx(be,{type:"submit",form:i,disabled:D,children:w}),e[43]=i,e[44]=D,e[45]=w,e[46]=P):P=e[46];let U;e[47]!==R||e[48]!==P?(U=E.jsxs(XC,{children:[R,P]}),e[47]=R,e[48]=P,e[49]=U):U=e[49];let B;e[50]!==i||e[51]!==N||e[52]!==C||e[53]!==U?(B=E.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:N,children:[C,U]}),e[50]=i,e[51]=N,e[52]=C,e[53]=U,e[54]=B):B=e[54];let G;e[55]!==d||e[56]!==B?(G=E.jsx(sf,{...d,children:B}),e[55]=d,e[56]=B,e[57]=G):G=e[57];let H;e[58]!==v||e[59]!==G?(H=E.jsxs(ZC,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,G]}),e[58]=v,e[59]=G,e[60]=H):H=e[60];let V;return e[61]!==y||e[62]!==H?(V=E.jsx(QC,{open:!0,onOpenChange:y,children:H}),e[61]=y,e[62]=H,e[63]=V):V=e[63],V}function Me(t){this.content=t}Me.prototype={constructor:Me,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,a=r.find(t),i=r.content.slice();return a==-1?i.push(n||t,e):(i[a+1]=e,n&&(i[a]=n)),new Me(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Me(n)},addToStart:function(t,e){return new Me([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Me(n)},addBefore:function(t,e,n){var r=this.remove(e),a=r.content.slice(),i=r.find(t);return a.splice(i==-1?a.length:i,0,e,n),new Me(a)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Me.from(t),t.size?new Me(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Me.from(t),t.size?new Me(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Me.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Me.from=function(t){if(t instanceof Me)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Me(e)};function oA(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let a=t.child(r),i=e.child(r);if(a==i){n+=a.nodeSize;continue}if(!a.sameMarkup(i))return n;if(a.isText&&a.text!=i.text){for(let s=0;a.text[s]==i.text[s];s++)n++;return n}if(a.content.size||i.content.size){let s=oA(a.content,i.content,n+1);if(s!=null)return s}n+=a.nodeSize}}function lA(t,e,n,r){for(let a=t.childCount,i=e.childCount;;){if(a==0||i==0)return a==i?null:{a:n,b:r};let s=t.child(--a),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=lA(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class q{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,a=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>e&&r(l,a+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,a+c)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,a){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?a?typeof a=="function"?a(o):a:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,a=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(a[a.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)a.push(e.content[i]);return new q(a,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],a=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),a+=o.nodeSize),s=l}return new q(r,a)}cutByIndex(e,n){return e==n?q.empty:e==0&&n==this.content.length?this:new q(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let a=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return a[e]=n,new q(a,i)}addToStart(e){return new q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new q(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let a=this.content[n];e(a,r,n),r+=a.nodeSize}}findDiffStart(e,n=0){return oA(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return lA(this,e,n,r)}findIndex(e){if(e==0)return Ra(0,e);if(e==this.size)return Ra(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let a=this.child(n),i=r+a.nodeSize;if(i>=e)return i==e?Ra(n+1,i):Ra(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return q.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new q(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return q.empty;let n,r=0;for(let a=0;a<e.length;a++){let i=e[a];r+=i.nodeSize,a&&i.isText&&e[a-1].sameMarkup(i)?(n||(n=e.slice(0,a)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new q(n||e,r)}static from(e){if(!e)return q.empty;if(e instanceof q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const qs={index:0,offset:0};function Ra(t,e){return qs.index=t,qs.offset=e,qs}function ni(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ni(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ni(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let pe=class uf{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let a=0;a<e.length;a++){let i=e[a];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,a));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,a)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ni(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let a=r.create(n.attrs);return r.checkAttrs(a.attrs),a}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return uf.none;if(e instanceof uf)return[e];let n=e.slice();return n.sort((r,a)=>r.type.rank-a.type.rank),n}};pe.none=[];class ri extends Error{}class X{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cA(this.content,e+this.openStart,n);return r&&new X(r,this.openStart,this.openEnd)}removeBetween(e,n){return new X(uA(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return X.empty;let r=n.openStart||0,a=n.openEnd||0;if(typeof r!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new X(q.fromJSON(e,n.content),r,a)}static maxOpen(e,n=!0){let r=0,a=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)a++;return new X(e,r,a)}}X.empty=new X(q.empty,0,0);function uA(t,e,n){let{index:r,offset:a}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(a==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(uA(i.content,e-a-1,n-a-1)))}function cA(t,e,n,r){let{index:a,offset:i}=t.findIndex(e),s=t.maybeChild(a);if(i==e||s.isText)return r&&!r.canReplace(a,a,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=cA(s.content,e-i-1,n,s);return o&&t.replaceChild(a,s.copy(o))}function FI(t,e,n){if(n.openStart>t.depth)throw new ri("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ri("Inconsistent open depths");return dA(t,e,n,0)}function dA(t,e,n,r){let a=t.index(r),i=t.node(r);if(a==e.index(r)&&r<t.depth-n.openStart){let s=dA(t,e,n,r+1);return i.copy(i.content.replaceChild(a,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return In(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=BI(n,t);return In(i,fA(t,s,o,e,r))}else return In(i,ai(t,e,r))}function pA(t,e){if(!e.type.compatibleContent(t.type))throw new ri("Cannot join "+e.type.name+" onto "+t.type.name)}function cf(t,e,n){let r=t.node(n);return pA(r,e.node(n)),r}function Cn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function $r(t,e,n,r){let a=(e||t).node(n),i=0,s=e?e.index(n):a.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Cn(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Cn(a.child(o),r);e&&e.depth==n&&e.textOffset&&Cn(e.nodeBefore,r)}function In(t,e){return t.type.checkContent(e),t.copy(e)}function fA(t,e,n,r,a){let i=t.depth>a&&cf(t,e,a+1),s=r.depth>a&&cf(n,r,a+1),o=[];return $r(null,t,a,o),i&&s&&e.index(a)==n.index(a)?(pA(i,s),Cn(In(i,fA(t,e,n,r,a+1)),o)):(i&&Cn(In(i,ai(t,e,a+1)),o),$r(e,n,a,o),s&&Cn(In(s,ai(n,r,a+1)),o)),$r(r,null,a,o),new q(o)}function ai(t,e,n){let r=[];if($r(null,t,n,r),t.depth>n){let a=cf(t,e,n+1);Cn(In(a,ai(t,e,n+1)),r)}return $r(e,null,n,r),new q(r)}function BI(t,e){let n=e.depth-t.openStart,a=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)a=e.node(i).copy(q.from(a));return{start:a.resolveNoCache(t.openStart+n),end:a.resolveNoCache(a.content.size-t.openEnd-n)}}class ra{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],a=e.child(n);return r?e.child(n).cut(r):a}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],a=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)a+=r.child(i).nodeSize;return a}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return pe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),a=e.maybeChild(n);if(!r){let o=r;r=a,a=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!a||!i[s].isInSet(a.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,a=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!a||!r[i].isInSet(a.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ii(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],a=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,o,a+l),!u||(s=s.child(o),s.isText))break;i=u-1,a+=l+1}return new ra(n,r,i)}static resolveCached(e,n){let r=Rm.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Rm.set(e,r=new UI);let a=r.elts[r.i]=ra.resolve(e,n);return r.i=(r.i+1)%HI,a}}class UI{constructor(){this.elts=[],this.i=0}}const HI=12,Rm=new WeakMap;class ii{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const $I=Object.create(null);let nn=class df{constructor(e,n,r,a=pe.none){this.type=e,this.attrs=n,this.marks=a,this.content=r||q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,a=0){this.content.nodesBetween(e,n,r,a,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,a){return this.content.textBetween(e,n,r,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ni(this.attrs,n||e.defaultAttrs||$I)&&pe.sameSet(this.marks,r||pe.none)}copy(e=null){return e==this.content?this:new df(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new df(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return X.empty;let a=this.resolve(e),i=this.resolve(n),s=r?0:a.sharedDepth(n),o=a.start(s),u=a.node(s).content.cut(a.pos-o,i.pos-o);return new X(u,a.depth-s,i.depth-s)}replace(e,n,r){return FI(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:a}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(a==e||n.isText)return n;e-=a+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let a=this.content.child(n-1);return{node:a,index:n-1,offset:r-a.nodeSize}}resolve(e){return ra.resolveCached(this,e)}resolveNoCache(e){return ra.resolve(this,e)}rangeHasMark(e,n,r){let a=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),hA(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=q.empty,a=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,a,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=a;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,a){if(a&&!this.type.allowsMarks(a))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=pe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let a=q.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,a,r);return i.type.checkAttrs(i.attrs),i}};nn.prototype.text=void 0;class si extends nn{constructor(e,n,r,a){if(super(e,n,null,a),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):hA(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new si(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new si(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function hA(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ln{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new qI(e,n);if(r.next==null)return Ln.empty;let a=mA(r);r.next&&r.err("Unexpected trailing text");let i=KI(YI(a));return XI(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let a=this;for(let i=n;a&&i<r;i++)a=a.matchType(e.child(i).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let a=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return q.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&a.indexOf(d)==-1){a.push(d);let p=i(d,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let a=r.shift(),i=a.match;if(i.matchType(e)){let s=[];for(let o=a;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!a.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:a}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let a=0;a<r.next.length;a++)e.indexOf(r.next[a].next)==-1&&n(r.next[a].next)}return n(this),e.map((r,a)=>{let i=a+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
2
  `)}}Ln.empty=new Ln(!0);class qI{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function mA(t){let e=[];do e.push(jI(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function jI(t){let e=[];do e.push(zI(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function zI(t){let e=WI(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=GI(t,e);else break;return e}function km(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function GI(t,e){let n=km(t),r=n;return t.eat(",")&&(t.next!="}"?r=km(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function VI(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let a=[];for(let i in n){let s=n[i];s.isInGroup(e)&&a.push(s)}return a.length==0&&t.err("No node type or group '"+e+"' found"),a}function WI(t){if(t.eat("(")){let e=mA(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=VI(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function YI(t){let e=[[]];return a(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,o,l){let u={term:l,to:o};return e[s].push(u),u}function a(s,o){s.forEach(l=>l.to=o)}function i(s,o){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(i(u,o)),[]);if(s.type=="seq")for(let l=0;;l++){let u=i(s.exprs[l],o);if(l==s.exprs.length-1)return u;a(u,o=n())}else if(s.type=="star"){let l=n();return r(o,l),a(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return a(i(s.expr,o),l),a(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(i(s.expr,o));if(s.type=="range"){let l=o;for(let u=0;u<s.min;u++){let c=n();a(i(s.expr,l),c),l=c}if(s.max==-1)a(i(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();r(l,c),a(i(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function gA(t,e){return e-t}function xm(t,e){let n=[];return r(e),n.sort(gA);function r(a){let i=t[a];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(a);for(let s=0;s<i.length;s++){let{term:o,to:l}=i[s];!o&&n.indexOf(l)==-1&&r(l)}}}function KI(t){let e=Object.create(null);return n(xm(t,0));function n(r){let a=[];r.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let c=0;c<a.length;c++)a[c][0]==o&&(u=a[c][1]);xm(t,l).forEach(c=>{u||a.push([o,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let i=e[r.join(",")]=new Ln(r.indexOf(t.length-1)>-1);for(let s=0;s<a.length;s++){let o=a[s][1].sort(gA);i.next.push({type:a[s][0],next:e[o.join(",")]||n(o)})}return i}}function XI(t,e){for(let n=0,r=[t];n<r.length;n++){let a=r[n],i=!a.validEnd,s=[];for(let o=0;o<a.next.length;o++){let{type:l,next:u}=a.next[o];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function bA(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function EA(t,e){let n=Object.create(null);for(let r in t){let a=e&&e[r];if(a===void 0){let i=t[r];if(i.hasDefault)a=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=a}return n}function TA(t,e,n,r){for(let a in e)if(!(a in t))throw new RangeError(`Unsupported attribute ${a} for ${n} of type ${a}`);for(let a in t){let i=t[a];i.validate&&i.validate(e[a])}}function yA(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new QI(t,r,e[r]);return n}let wm=class SA{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=yA(e,r.attrs),this.defaultAttrs=bA(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ln.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:EA(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new nn(this,this.computeAttrs(e),q.from(n),pe.setFrom(r))}createChecked(e=null,n,r){return n=q.from(n),this.checkContent(n),new nn(this,this.computeAttrs(e),n,pe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=q.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let a=this.contentMatch.matchFragment(n),i=a&&a.fillBefore(q.empty,!0);return i?new nn(this,e,n.append(i),pe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){TA(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:pe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new SA(i,n,s));let a=n.spec.topNode||"doc";if(!r[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function ZI(t,e,n){let r=n.split("|");return a=>{let i=a===null?"null":typeof a;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class QI{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?ZI(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class us{constructor(e,n,r,a){this.name=e,this.rank=n,this.schema=r,this.spec=a,this.attrs=yA(e,a.attrs),this.excluded=null;let i=bA(this.attrs);this.instance=i?new pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,EA(this.attrs,e))}static compile(e,n){let r=Object.create(null),a=0;return e.forEach((i,s)=>r[i]=new us(i,a++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){TA(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class AA{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let a in e)n[a]=e[a];n.nodes=Me.from(e.nodes),n.marks=Me.from(e.marks||{}),this.nodes=wm.compile(this.spec.nodes,this),this.marks=us.compile(this.spec.marks,this);let r=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");let i=this.nodes[a],s=i.spec.content||"",o=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Ln.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=o=="_"?null:o?Om(this,o.split(" ")):o==""||!i.inlineContent?[]:null}for(let a in this.marks){let i=this.marks[a],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Om(this,s.split(" "))}this.nodeFromJSON=a=>nn.fromJSON(this,a),this.markFromJSON=a=>pe.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,a){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof wm){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,a)}text(e,n){let r=this.nodes.text;return new si(r,r.defaultAttrs,e,pe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Om(t,e){let n=[];for(let r=0;r<e.length;r++){let a=e[r],i=t.marks[a],s=i;if(i)n.push(i);else for(let o in t.marks){let l=t.marks[o];(a=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(a)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function JI(t){return t.tag!=null}function eR(t){return t.style!=null}class rn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(a=>{if(JI(a))this.tags.push(a);else if(eR(a)){let i=/[^=]*/.exec(a.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(a=>{if(!/^(ul|ol)\b/.test(a.tag)||!a.node)return!1;let i=e.nodes[a.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Dm(this,n,!1);return r.addAll(e,pe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Dm(this,n,!0);return r.addAll(e,pe.none,n.from,n.to),X.maxOpen(r.finish())}matchTag(e,n,r){for(let a=r?this.tags.indexOf(r)+1:0;a<this.tags.length;a++){let i=this.tags[a];if(rR(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,a){for(let i=a?this.styles.indexOf(a)+1:0;i<this.styles.length;i++){let s=this.styles[i],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(a){let i=a.priority==null?50:a.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<i)break}n.splice(s,0,a)}for(let a in e.marks){let i=e.marks[a].spec.parseDOM;i&&i.forEach(s=>{r(s=Mm(s)),s.mark||s.ignore||s.clearMark||(s.mark=a)})}for(let a in e.nodes){let i=e.nodes[a].spec.parseDOM;i&&i.forEach(s=>{r(s=Mm(s)),s.node||s.ignore||s.mark||(s.node=a)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new rn(e,rn.schemaRules(e)))}}const NA={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},tR={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},vA={ol:!0,ul:!0},aa=1,pf=2,qr=4;function Lm(t,e,n){return e!=null?(e?aa:0)|(e==="full"?pf:0):t&&t.whitespace=="pre"?aa|pf:n&~qr}class ka{constructor(e,n,r,a,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=a,this.options=s,this.content=[],this.activeMarks=pe.none,this.match=i||(s&qr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(q.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,a;return(a=r.findWrapping(e.type))?(this.match=r,a):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&aa)){let r=this.content[this.content.length-1],a;if(r&&r.isText&&(a=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==a[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-a[0].length))}}let n=q.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(q.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!NA.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Dm{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let a=n.topNode,i,s=Lm(null,n.preserveWhitespace,0)|(r?qr:0);a?i=new ka(a.type,a.attrs,pe.none,!0,n.topMatch||a.type.contentMatch,s):r?i=new ka(null,null,pe.none,!0,null,s):i=new ka(e.schema.topNodeType,null,pe.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,a=this.top,i=a.options&pf?"full":this.localPreserveWS||(a.options&aa)>0,{schema:s}=this.parser;if(i==="full"||a.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(s.text(o[l]),n,!/\S/.test(o[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=a.content[a.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let a=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;vA.hasOwnProperty(s)&&this.parser.normalizeLists&&nR(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(l?l.ignore:tR.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(NA.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(i),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?o:void 0)}this.localPreserveWS=a}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let i=this.parser.matchedStyles[a],s=r.getPropertyValue(i);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(i,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(e,n,r,a){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(a)this.addElement(e,r,a);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(o)&&this.open--}addAll(e,n,r,a){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,o=a==null?null:e.childNodes[a];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let a,i;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!a||a.length>u.length+o)&&(a=u,i=l,!u.length))break;if(l.solid){if(r)break;o+=2}}if(!a)return null;this.sync(i);for(let s=0;s<a.length;s++)n=this.enterInner(a[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let a=this.findPlace(e,n,r);if(a){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=pe.none;for(let o of a.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):Pm(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,a){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,a)),i}enterInner(e,n,r,a=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=Lm(e,i,s.options);s.options&qr&&s.content.length==0&&(o|=qr);let l=pe.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):Pm(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new ka(e,n,l,a,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=aa)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let a=r.length-1;a>=0;a--)e+=r[a].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let a=0;a<this.find.length;a++)this.find[a].pos==null&&e.nodeType==1&&e.contains(this.find[a].node)&&n.compareDocumentPosition(this.find[a].node)&(r?2:4)&&(this.find[a].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,a=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(a?0:1),s=(o,l)=>{for(;o>=0;o--){let u=n[o];if(u==""){if(o==n.length-1||o==0)continue;for(;l>=i;l--)if(s(o-1,l))return!0;return!1}else{let c=l>0||l==0&&a?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function nR(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&vA.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function rR(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Mm(t){let e={};for(let n in t)e[n]=t[n];return e}function Pm(t,e){let n=e.schema.nodes;for(let r in n){let a=n[r];if(!a.allowsMarkType(t))continue;let i=[],s=o=>{i.push(o);for(let l=0;l<o.edgeCount;l++){let{type:u,next:c}=o.edge(l);if(u==e||i.indexOf(c)<0&&s(c))return!0}};if(s(a.contentMatch))return!0}}class Hn{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=js(n).createDocumentFragment());let a=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let o=0,l=0;for(;o<i.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(i[o][0])||u.type.spec.spanning===!1)break;o++,l++}for(;o<i.length;)a=i.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(i.push([u,a]),a.appendChild(c.dom),a=c.contentDOM||c.dom)}}a.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:a}=Ga(js(n),this.nodes[e.type.name](e),null,e.attrs);if(a){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,a)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let a=e.marks.length-1;a>=0;a--){let i=this.serializeMark(e.marks[a],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let a=this.marks[e.type.name];return a&&Ga(js(r),a(e,n),null,e.attrs)}static renderSpec(e,n,r=null,a){return Ga(e,n,r,a)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Hn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Fm(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Fm(e.marks)}}function Fm(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function js(t){return t.document||window.document}const Bm=new WeakMap;function aR(t){let e=Bm.get(t);return e===void 0&&Bm.set(t,e=iR(t)),e}function iR(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let a=0;a<r.length;a++)n(r[a]);else for(let a in r)n(r[a])}return n(t),e}function Ga(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let a=e[0],i;if(typeof a!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=aR(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=a.indexOf(" ");s>0&&(n=a.slice(0,s),a=a.slice(s+1));let o,l=n?t.createElementNS(n,a):t.createElement(a),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let p=e[d];if(p===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=Ga(t,p,n,r);if(l.appendChild(f),m){if(o)throw new RangeError("Multiple content holes");o=m}}}return{dom:l,contentDOM:o}}const _A=65535,CA=Math.pow(2,16);function sR(t,e){return t+e*CA}function Um(t){return t&_A}function oR(t){return(t-(t&_A))/CA}const IA=1,RA=2,Va=4,kA=8;class ff{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&kA)>0}get deletedBefore(){return(this.delInfo&(IA|Va))>0}get deletedAfter(){return(this.delInfo&(RA|Va))>0}get deletedAcross(){return(this.delInfo&Va)>0}}class tt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&tt.empty)return tt.empty}recover(e){let n=0,r=Um(e);if(!this.inverted)for(let a=0;a<r;a++)n+=this.ranges[a*3+2]-this.ranges[a*3+1];return this.ranges[r*3]+n+oR(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let a=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?a:0);if(l>e)break;let u=this.ranges[o+i],c=this.ranges[o+s],d=l+u;if(e<=d){let p=u?e==l?-1:e==d?1:n:n,f=l+a+(p<0?0:c);if(r)return f;let m=e==(n<0?l:d)?null:sR(o/3,e-l),g=e==l?RA:e==d?IA:Va;return(n<0?e!=l:e!=d)&&(g|=kA),new ff(f,g,m)}a+=c-u}return r?e+a:new ff(e+a,0,null)}touches(e,n){let r=0,a=Um(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[o+i],c=l+u;if(e<=c&&o==a*3)return!0;r+=this.ranges[o+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let a=0,i=0;a<this.ranges.length;a+=3){let s=this.ranges[a],o=s-(this.inverted?i:0),l=s+(this.inverted?0:i),u=this.ranges[a+n],c=this.ranges[a+r];e(o,o+u,l,l+c),i+=c-u}}invert(){return new tt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?tt.empty:new tt(e<0?[0,-e,0]:[0,0,e])}}tt.empty=new tt([]);class ia{constructor(e,n,r=0,a=e?e.length:0){this.mirror=n,this.from=r,this.to=a,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new ia(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let a=e.getMirror(n);this.appendMap(e._maps[n],a!=null&&a<n?r+a:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let a=e.getMirror(n);this.appendMap(e._maps[n].invert(),a!=null&&a>n?r-a-1:void 0)}}invert(){let e=new ia;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let a=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],o=s.mapResult(e,n);if(o.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(o.recover);continue}}a|=o.delInfo,e=o.pos}return r?e:new ff(e,a,null)}}const zs=Object.create(null);class je{getMap(){return tt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=zs[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in zs)throw new RangeError("Duplicate use of step JSON ID "+e);return zs[e]=n,n.prototype.jsonID=e,n}}class ve{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ve(e,null)}static fail(e){return new ve(null,e)}static fromReplace(e,n,r,a){try{return ve.ok(e.replace(n,r,a))}catch(i){if(i instanceof ri)return ve.fail(i.message);throw i}}}function ah(t,e,n){let r=[];for(let a=0;a<t.childCount;a++){let i=t.child(a);i.content.size&&(i=i.copy(ah(i.content,e,i))),i.isInline&&(i=e(i,n,a)),r.push(i)}return q.fromArray(r)}class Zt extends je{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),a=r.node(r.sharedDepth(this.to)),i=new X(ah(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),a),n.openStart,n.openEnd);return ve.fromReplace(e,this.from,this.to,i)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Zt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Zt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Zt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Zt(n.from,n.to,e.markFromJSON(n.mark))}}je.jsonID("addMark",Zt);class dt extends je{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new X(ah(n.content,a=>a.mark(this.mark.removeFromSet(a.marks)),e),n.openStart,n.openEnd);return ve.fromReplace(e,this.from,this.to,r)}invert(){return new Zt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new dt(n.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new dt(n.from,n.to,e.markFromJSON(n.mark))}}je.jsonID("removeMark",dt);class Qt extends je{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ve.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ve.fromReplace(e,this.pos,this.pos+1,new X(q.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let a=0;a<n.marks.length;a++)if(!n.marks[a].isInSet(r))return new Qt(this.pos,n.marks[a]);return new Qt(this.pos,this.mark)}}return new Dn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Qt(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qt(n.pos,e.markFromJSON(n.mark))}}je.jsonID("addNodeMark",Qt);class Dn extends je{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ve.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ve.fromReplace(e,this.pos,this.pos+1,new X(q.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Qt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Dn(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Dn(n.pos,e.markFromJSON(n.mark))}}je.jsonID("removeNodeMark",Dn);class we extends je{constructor(e,n,r,a=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=a}apply(e){return this.structure&&hf(e,this.from,this.to)?ve.fail("Structure replace would overwrite content"):ve.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new tt([this.from,this.to-this.from,this.slice.size])}invert(e){return new we(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new we(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof we)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?X.empty:new X(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new we(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?X.empty:new X(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new we(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new we(n.from,n.to,X.fromJSON(e,n.slice),!!n.structure)}}je.jsonID("replace",we);class Le extends je{constructor(e,n,r,a,i,s,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=a,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(hf(e,this.from,this.gapFrom)||hf(e,this.gapTo,this.to)))return ve.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ve.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ve.fromReplace(e,this.from,this.to,r):ve.fail("Content does not fit in gap")}getMap(){return new tt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Le(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),a=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||a<n.pos||i>r.pos?null:new Le(n.pos,r.pos,a,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Le(n.from,n.to,n.gapFrom,n.gapTo,X.fromJSON(e,n.slice),n.insert,!!n.structure)}}je.jsonID("replaceAround",Le);function hf(t,e,n){let r=t.resolve(e),a=n-e,i=r.depth;for(;a>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,a--;if(a>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;a>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,a--}}return!1}function lR(t,e,n,r){let a=[],i=[],s,o;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let p=Math.max(u,e),f=Math.min(u+l.nodeSize,n),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(s&&s.to==p&&s.mark.eq(d[g])?s.to=f:a.push(s=new dt(p,f,d[g])));o&&o.to==p?o.to=f:i.push(o=new Zt(p,f,r))}}),a.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function uR(t,e,n,r){let a=[],i=0;t.doc.nodesBetween(e,n,(s,o)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof us){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(o+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],p;for(let f=0;f<a.length;f++){let m=a[f];m.step==i-1&&d.eq(a[f].style)&&(p=m)}p?(p.to=u,p.step=i):a.push({style:d,from:Math.max(o,e),to:u,step:i})}}}),a.forEach(s=>t.step(new dt(s.from,s.to,s.style)))}function ih(t,e,n,r=n.contentMatch,a=!0){let i=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<i.childCount;l++){let u=i.child(l),c=o+u.nodeSize,d=r.matchType(u.type);if(!d)s.push(new we(o,c,X.empty));else{r=d;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new dt(o,c,u.marks[p]));if(a&&u.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,m;for(;p=f.exec(u.text);)m||(m=new X(q.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new we(o+p.index,o+p.index+p[0].length,m))}}o=c}if(!r.validEnd){let l=r.fillBefore(q.empty,!0);t.replace(o,o,new X(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function cR(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function yr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,a=0,i=0;;--r){let s=t.$from.node(r),o=t.$from.index(r)+a,l=t.$to.indexAfter(r)-i;if(r<t.depth&&s.canReplace(o,l,n))return r;if(r==0||s.type.spec.isolating||!cR(s,o,l))break;o&&(a=1),l<s.childCount&&(i=1)}return null}function dR(t,e,n){let{$from:r,$to:a,depth:i}=e,s=r.before(i+1),o=a.after(i+1),l=s,u=o,c=q.empty,d=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,c=q.from(r.node(m).copy(c)),d++):l--;let p=q.empty,f=0;for(let m=i,g=!1;m>n;m--)g||a.after(m+1)<a.end(m)?(g=!0,p=q.from(a.node(m).copy(p)),f++):u++;t.step(new Le(l,u,s,o,new X(c.append(p),d,f),c.size-d,!0))}function sh(t,e,n=null,r=t){let a=pR(t,e),i=a&&fR(r,e);return i?a.map(Hm).concat({type:e,attrs:n}).concat(i.map(Hm)):null}function Hm(t){return{type:t,attrs:null}}function pR(t,e){let{parent:n,startIndex:r,endIndex:a}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,a,s)?i:null}function fR(t,e){let{parent:n,startIndex:r,endIndex:a}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=r;l&&u<a;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function hR(t,e,n){let r=q.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=q.from(n[s].type.create(n[s].attrs,r))}let a=e.start,i=e.end;t.step(new Le(a,i,a,i,new X(r,0,0),n.length,!0))}function mR(t,e,n,r,a){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,o)=>{let l=typeof a=="function"?a(s):a;if(s.isTextblock&&!s.hasMarkup(r,l)&&gR(t.doc,t.mapping.slice(i).map(o),r)){let u=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?u=!1:!f&&m&&(u=!0)}u===!1&&wA(t,s,o,i),ih(t,t.mapping.slice(i).map(o,1),r,void 0,u===null);let c=t.mapping.slice(i),d=c.map(o,1),p=c.map(o+s.nodeSize,1);return t.step(new Le(d,p,d+1,p-1,new X(q.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&xA(t,s,o,i),!1}})}function xA(t,e,n,r){e.forEach((a,i)=>{if(a.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(a.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function wA(t,e,n,r){e.forEach((a,i)=>{if(a.type==a.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`