decocms 4.123.2 → 4.123.3
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.
- package/dist/client/assets/{AlertCircle-XCC42vnv.js → AlertCircle-eRcWDqyz.js} +1 -1
- package/dist/client/assets/{AreaChart-BbeQRNr_.js → AreaChart-CWCyj3e3.js} +1 -1
- package/dist/client/assets/{ArrowRight-BKBmhaLR.js → ArrowRight-p9iPk5i0.js} +1 -1
- package/dist/client/assets/{ArrowUp-CIc1qLBi.js → ArrowUp-DpycHbYJ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BfP64txw.js → ArrowUpRight-CfTkoU4B.js} +1 -1
- package/dist/client/assets/{Check-BqbTs6Sp.js → Check-BdLBTBRG.js} +1 -1
- package/dist/client/assets/{CheckCircle-BPEhKJ6_.js → CheckCircle-CCKZTxeZ.js} +1 -1
- package/dist/client/assets/{ChevronDown-BeuEDkJI.js → ChevronDown-Bx3JuxA4.js} +1 -1
- package/dist/client/assets/{ChevronRight-CpxTzNTm.js → ChevronRight-CFrIQqny.js} +1 -1
- package/dist/client/assets/{ChevronUp-tFv_O9M0.js → ChevronUp-Dq6n-X7O.js} +1 -1
- package/dist/client/assets/{Copy01-DqXF8bW_.js → Copy01-XmlYTCnq.js} +1 -1
- package/dist/client/assets/{DotsVertical-Ue6eGmYj.js → DotsVertical-ws7g1gHH.js} +1 -1
- package/dist/client/assets/{Eye-Bk2Xgrvg.js → Eye-BBuEG2Wd.js} +1 -1
- package/dist/client/assets/{FilterLines-8U9bkKls.js → FilterLines-C8U7CVV9.js} +1 -1
- package/dist/client/assets/{Globe01-D61pxNbc.js → Globe01-C4KqixhG.js} +1 -1
- package/dist/client/assets/{Globe04-BVIaxGYK.js → Globe04-BqWPfPhC.js} +1 -1
- package/dist/client/assets/{HardDrive-Dp3ZELAy.js → HardDrive-C_ycSVMi.js} +1 -1
- package/dist/client/assets/{Image01-C0tZD_4N.js → Image01-DVjQLwZ-.js} +1 -1
- package/dist/client/assets/{Key01-C1OrSDs9.js → Key01-FIEtfPiH.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BR0426bP.js → LayoutLeft-Dnm3NgQz.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dbdi7ThP.js → LinkExternal01-DunixMNV.js} +1 -1
- package/dist/client/assets/{LogOut01-BGKt8uk-.js → LogOut01-DlvBCesx.js} +1 -1
- package/dist/client/assets/{Monitor01-BpV1xCDw.js → Monitor01-JoeiLfz-.js} +1 -1
- package/dist/client/assets/{Package-CPikbMFw.js → Package-fVT5gTF_.js} +1 -1
- package/dist/client/assets/{Palette-CI2gPMub.js → Palette-BWnu1KwQ.js} +1 -1
- package/dist/client/assets/{Play-Ce8b-45f.js → Play-HYSZBOc2.js} +1 -1
- package/dist/client/assets/{Plus-BHn273te.js → Plus-CyjW8iPH.js} +1 -1
- package/dist/client/assets/{SearchLg-BhaN5Dkw.js → SearchLg-B2jol46R.js} +1 -1
- package/dist/client/assets/{SearchMd-ZOU8eHm5.js → SearchMd-DkKUttLm.js} +1 -1
- package/dist/client/assets/{Settings02-BMEbk95n.js → Settings02-BrdhYfJi.js} +1 -1
- package/dist/client/assets/{Shield01-ByBmvv87.js → Shield01-B1XsHete.js} +1 -1
- package/dist/client/assets/{Star01-CXoaBlcx.js → Star01-Hbm6yGaD.js} +1 -1
- package/dist/client/assets/{Stars01-DzME0iEm.js → Stars01-DipJVSzo.js} +1 -1
- package/dist/client/assets/{Stars02-aAWJ3II4.js → Stars02-D2qzcZbs.js} +1 -1
- package/dist/client/assets/{Sun-BvXvztsJ.js → Sun-D9gwkrf5.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D0-CcWGL.js → SwitchHorizontal01-Bt3ZhF2O.js} +1 -1
- package/dist/client/assets/{Tool01-CsQku2ha.js → Tool01-DvE5TzJB.js} +1 -1
- package/dist/client/assets/{Tool02-9ZNic0qo.js → Tool02-_NBLVeeV.js} +1 -1
- package/dist/client/assets/{Trash01-DxhoFTU2.js → Trash01-BepZYT7H.js} +1 -1
- package/dist/client/assets/{TrendUp01-DolEYhiE.js → TrendUp01-BKJLyuI9.js} +1 -1
- package/dist/client/assets/{Upload01-Cw1RTJdA.js → Upload01-BubHQTIU.js} +1 -1
- package/dist/client/assets/{User01-B9tHPp45.js → User01-DkpYEYe6.js} +1 -1
- package/dist/client/assets/{Users01-CtZ6-BIN.js → Users01-DjvWkBZ9.js} +1 -1
- package/dist/client/assets/{Users03-DKzOXdwZ.js → Users03-Ci9mYAgC.js} +1 -1
- package/dist/client/assets/{X-BlyIKSVp.js → X-HQl8Aj_L.js} +1 -1
- package/dist/client/assets/{XCircle-BS-TfzRr.js → XCircle-BizT01hc.js} +1 -1
- package/dist/client/assets/{XClose-CRX1ODGE.js → XClose-CcoerXx4.js} +1 -1
- package/dist/client/assets/{Zap-BbOt7jmA.js → Zap-BF-fUeLE.js} +1 -1
- package/dist/client/assets/{ZapSquare-CmpVcXwq.js → ZapSquare-vjVCshpw.js} +1 -1
- package/dist/client/assets/{ZoomOut-0gQoEQDY.js → ZoomOut-B_jcciLR.js} +1 -1
- package/dist/client/assets/{access-gate-BVvy6Xvh.js → access-gate-BqHB36ZF.js} +1 -1
- package/dist/client/assets/{add-section-modal-Q5ILcd5n.js → add-section-modal-CQaBEUCu.js} +1 -1
- package/dist/client/assets/{agent-icon-D8X6NgHQ.js → agent-icon-ibE4Mzzu.js} +1 -1
- package/dist/client/assets/{agents-list-Djdw5X52.js → agents-list-0DDVnJrl.js} +1 -1
- package/dist/client/assets/{ai-providers-CZhLConq.js → ai-providers-DqD3zgSv.js} +1 -1
- package/dist/client/assets/{alert-DZt6s1-5.js → alert-DDQjZ7Sa.js} +1 -1
- package/dist/client/assets/{alert-dialog-BbSxHfpk.js → alert-dialog-BWhpN8gU.js} +1 -1
- package/dist/client/assets/{app-editor-meMLTo05.js → app-editor-DVkvKRDN.js} +1 -1
- package/dist/client/assets/{auth-C0wxe8j1.js → auth-D8HvRHHP.js} +1 -1
- package/dist/client/assets/{auth-catchall-y2fJEFYv.js → auth-catchall-C_KTlh8d.js} +1 -1
- package/dist/client/assets/{auth-entry-DcpdTLhj.js → auth-entry-DyZakAOt.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BKK4N-N6.js → auth-split-layout-C79zlQMZ.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bkljayza.js → authenticate-and-persist-oauth-D2zBt4t0.js} +1 -1
- package/dist/client/assets/{automation-list-row-BjXQjt1z.js → automation-list-row-7FNfxpyb.js} +1 -1
- package/dist/client/assets/{automation-runs-B-1RH_oI.js → automation-runs-cQOAIuK1.js} +1 -1
- package/dist/client/assets/{automations-B_fbLWl9.js → automations-DFHU57uN.js} +1 -1
- package/dist/client/assets/{autosend-Be-3DD9j.js → autosend-Btkz6-0l.js} +1 -1
- package/dist/client/assets/{avatar-CfUWjhDf.js → avatar-DtoeWk0Z.js} +1 -1
- package/dist/client/assets/{badge-DF-If9rp.js → badge-Coz8TMU0.js} +1 -1
- package/dist/client/assets/{block-document-QDu2JdkJ.js → block-document-TkTeRgax.js} +1 -1
- package/dist/client/assets/{brand-context-dVMghOOW.js → brand-context-DyrNgbHb.js} +1 -1
- package/dist/client/assets/{buckets-Buo3pKQm.js → buckets-jEkDUMWc.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CvwIPpKb.js → bulk-category-panel-DcFs9iGz.js} +1 -1
- package/dist/client/assets/{calendar-DDdEu02Z.js → calendar-CUO5b1ow.js} +1 -1
- package/dist/client/assets/{capability-load-error-B47bErtJ.js → capability-load-error-B7XmMBaL.js} +1 -1
- package/dist/client/assets/{card-Di-QpnW-.js → card-OSM07-YE.js} +1 -1
- package/dist/client/assets/{category-editor-BYmynf3_.js → category-editor-Kdrp5Ecc.js} +1 -1
- package/dist/client/assets/{chat-context-Bnmr5Esu.js → chat-context-DoZ1baNe.js} +1 -1
- package/dist/client/assets/{checkbox-Ca7NY1wR.js → checkbox-5Dqb50rX.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BM4UbwaW.js → cli-auth-success-5-sqgCR1.js} +1 -1
- package/dist/client/assets/{collection-detail-C_jvvVx2.js → collection-detail-BtHBlghi.js} +1 -1
- package/dist/client/assets/{collection-display-button-Dvi-6XHb.js → collection-display-button-CnPuuZw0.js} +1 -1
- package/dist/client/assets/{collection-search-2V1qih3c.js → collection-search-5eKJWC8a.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CVTrxPz3.js → collection-table-wrapper-Bt4X8CDw.js} +1 -1
- package/dist/client/assets/{collection-tabs-u1HJ_eBo.js → collection-tabs-CNvc5FXj.js} +1 -1
- package/dist/client/assets/{command-DfYO983M.js → command-F60Vvdw9.js} +1 -1
- package/dist/client/assets/{commerce-onboarding--4NONN4b.js → commerce-onboarding-9CZnisfq.js} +1 -1
- package/dist/client/assets/{companions-core-BBPRO-hx.js → companions-core-DlPclFME.js} +1 -1
- package/dist/client/assets/{connect-CxMb3kaP.js → connect-Ce_xd66Z.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CVoQrJ8F.js → connect-desktop-dialog-DUZxmsUO.js} +1 -1
- package/dist/client/assets/{connection-BbilOib-.js → connection-DvYP4ame.js} +1 -1
- package/dist/client/assets/{connection-card-DrMoCtl4.js → connection-card-Cdfh1gnU.js} +1 -1
- package/dist/client/assets/{connection-detail-DhhlgQDD.js → connection-detail-q5RUuSrv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-jobllNge.js → connection-form-helpers-ofcrOZAr.js} +1 -1
- package/dist/client/assets/{connections-Cbwi0auT.js → connections-eosewDDm.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BuymyfF0.js → decopilot-sse-pool-BjZ-wPbg.js} +1 -1
- package/dist/client/assets/{dialog-poX5N6OF.js → dialog-CKP-t2d8.js} +1 -1
- package/dist/client/assets/{domain-settings-Bf7aOGCi.js → domain-settings-Bg5U7NKI.js} +1 -1
- package/dist/client/assets/{drawer-CemU5qiA.js → drawer-DQHW9t04.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C_IfrJtZ.js → dropdown-menu-ylG9Kkc3.js} +1 -1
- package/dist/client/assets/{empty-state-BPgoMkQH.js → empty-state-C08XplZ3.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BP-6YHKf.js → extract-connection-data-C_r5IGMb.js} +1 -1
- package/dist/client/assets/{file-explorer-Ba3Y3MJx.js → file-explorer-CICAaSO_.js} +1 -1
- package/dist/client/assets/{file-type-icon-CCvkC4UX.js → file-type-icon-BlvOD0PX.js} +1 -1
- package/dist/client/assets/{files-z7S0toY0.js → files-Dp05Y0HV.js} +1 -1
- package/dist/client/assets/{form-CBy1yFE7.js → form-BOHVNPhz.js} +1 -1
- package/dist/client/assets/{general-CT5NFN2-.js → general-BRGJds_Q.js} +1 -1
- package/dist/client/assets/{github-repo-picker-WGLIOn68.js → github-repo-picker-DcHCLyjR.js} +1 -1
- package/dist/client/assets/{hooks-DO_GgbQ9.js → hooks-C9juaECv.js} +1 -1
- package/dist/client/assets/{index-BYB7faC2.js → index-4jOyya6Y.js} +1 -1
- package/dist/client/assets/{index-BTDLuR6K.js → index-70mmTZc_.js} +1 -1
- package/dist/client/assets/index-BgF6OVaJ.css +1 -0
- package/dist/client/assets/{index-CrVcfr0w.js → index-Bp_8bhFo.js} +3 -3
- package/dist/client/assets/{index-DAtTWfgt.js → index-C7paW5qO.js} +3 -3
- package/dist/client/assets/{index-NwnGjivz.js → index-CCsdUvVs.js} +1 -1
- package/dist/client/assets/{index-BUOc0Rlo.js → index-CHQBwCua.js} +1 -1
- package/dist/client/assets/{index-BZketn2G.js → index-COt3Wzd4.js} +1 -1
- package/dist/client/assets/{index-AqXdWiS8.js → index-CeSX2hgY.js} +1 -1
- package/dist/client/assets/{index-yo4ZLMjW.js → index-CpkyNb-g.js} +1 -1
- package/dist/client/assets/{index-COExXZVa.js → index-CvSG3gCR.js} +5 -5
- package/dist/client/assets/{index-BipIQ3Z0.js → index-DIGsSdbK.js} +1 -1
- package/dist/client/assets/{index-Dd3322Xk.js → index-DvmOfoBg.js} +1 -1
- package/dist/client/assets/{index-C8Q5qfXW.js → index-mMZ1-UT7.js} +1 -1
- package/dist/client/assets/{index-redirect-XUFJEhWY.js → index-redirect-DowabVtC.js} +1 -1
- package/dist/client/assets/{input-BTaZQTwt.js → input-B7NjdaWP.js} +1 -1
- package/dist/client/assets/{integration-icon-BFQyCHkv.js → integration-icon-DEmdrigW.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-UtoUhAQN.js → invite-member-dialog-Do_rh2sG.js} +1 -1
- package/dist/client/assets/{label-CFiSNSYm.js → label-BsC9V_2x.js} +1 -1
- package/dist/client/assets/{layout-DNQqS4dI.js → layout-DttsLFsc.js} +1 -1
- package/dist/client/assets/{login-x836Suod.js → login-Bc-4_kHz.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DjzzahSx.js → mcp-oauth-iPqAJoGm.js} +1 -1
- package/dist/client/assets/{members-C0PCyfD6.js → members-Df_EE43H.js} +1 -1
- package/dist/client/assets/{monaco-editor-BQlr5iHl.js → monaco-editor-B9OF3jRu.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CYTksZ0o.js → monitoring-stats-row-BPtjhObG.js} +1 -1
- package/dist/client/assets/{multi-select-g0Zcdpuc.js → multi-select-B8L-uR0Z.js} +1 -1
- package/dist/client/assets/{oauth-callback-CUqReAyz.js → oauth-callback-Dr5zVhyV.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BO8s14-F.js → oauth-callback-ai-provider-DMC1bSAT.js} +1 -1
- package/dist/client/assets/{onboarding-ifaPlnD7.js → onboarding-fiTo09oR.js} +1 -1
- package/dist/client/assets/{org-install-HCRLLUwR.js → org-install-B2bM7ppY.js} +1 -1
- package/dist/client/assets/{org-layout-37oPrsYr.js → org-layout-DZyE1NBJ.js} +1 -1
- package/dist/client/assets/{organization-choice-D4wTlG5B.js → organization-choice-CSaGCmhQ.js} +1 -1
- package/dist/client/assets/{orgs-CO8Ia10y.js → orgs-DQh8lqIU.js} +1 -1
- package/dist/client/assets/{page-seo-form-BElu4PcX.js → page-seo-form-BGL3rL7i.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CsLUJ1Yf.js +1 -0
- package/dist/client/assets/{popover-6uiYyt5u.js → popover-BARdtmQ6.js} +1 -1
- package/dist/client/assets/{post-editor-CsfSnGeq.js → post-editor-C7J0K8nu.js} +1 -1
- package/dist/client/assets/{primitives-BQwrCqaw.js → primitives-DLF6JtPS.js} +1 -1
- package/dist/client/assets/{profile-BLmFaHgn.js → profile-BqTzXs9x.js} +1 -1
- package/dist/client/assets/project-app-view-4XZrS0Mr.js +1 -0
- package/dist/client/assets/record-editor-YzJoN9bv.js +1 -0
- package/dist/client/assets/{redirect-editor-CAt-r8L6.js → redirect-editor-YHB4gvcQ.js} +1 -1
- package/dist/client/assets/registry-DKMLAjwr.js +2 -0
- package/dist/client/assets/{registry-layout-DzeMIQ1B.js → registry-layout-C0zwUwDi.js} +1 -1
- package/dist/client/assets/{reports-CjTucZb2.js → reports-BG46h4YF.js} +1 -1
- package/dist/client/assets/{require-capability-AlDMTe2M.js → require-capability-l1pPM6L3.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CxsIwght.js → required-auth-layout-Dgwezb2q.js} +1 -1
- package/dist/client/assets/{reset-password-fK3yI8C1.js → reset-password-C7WC8kCI.js} +1 -1
- package/dist/client/assets/{roles-8n-_hcZU.js → roles-55zZDlTP.js} +1 -1
- package/dist/client/assets/{search-input-BIlo3d_x.js → search-input-Rf45slkr.js} +1 -1
- package/dist/client/assets/{secrets-C5IXt4y-.js → secrets-CumVvXzE.js} +1 -1
- package/dist/client/assets/{sections-editor-C5e3xbtX.js → sections-editor-AIZ_vXyM.js} +1 -1
- package/dist/client/assets/{select-C-lRFMd0.js → select-Cofdiz7g.js} +1 -1
- package/dist/client/assets/{select-model-CnP2KvlX.js → select-model-CQjdy8JP.js} +1 -1
- package/dist/client/assets/{self-tool-result-WKXfGLIo.js → self-tool-result-CZ8BrxAv.js} +1 -1
- package/dist/client/assets/{seo-editor-DDHhP88k.js → seo-editor-Bg3KN1r0.js} +1 -1
- package/dist/client/assets/{settings-layout-Bv0OyYHJ.js → settings-layout-BO3edXkv.js} +1 -1
- package/dist/client/assets/{settings-section-DcvaTSLo.js → settings-section-CW4yLPtI.js} +1 -1
- package/dist/client/assets/{shell-controls-7jsmZLrB.js → shell-controls-cEHP32Pv.js} +1 -1
- package/dist/client/assets/{shell-layout-CxYEqHLt.js → shell-layout-BbDwMSR1.js} +1 -1
- package/dist/client/assets/{sidebar-BAm9qD2e.js → sidebar-CsCKy7i2.js} +1 -1
- package/dist/client/assets/{skeleton-rk4WuHqh.js → skeleton-C6T-49IJ.js} +1 -1
- package/dist/client/assets/{sso-CzAtA7Zs.js → sso-D-Fm27Br.js} +1 -1
- package/dist/client/assets/{store-DTElmzZA.js → store-BizgsZ6V.js} +1 -1
- package/dist/client/assets/store-registry-BSBzU8Cs.js +2 -0
- package/dist/client/assets/{studio-tools-B1eVxu6k.js → studio-tools-BgcbqxiX.js} +1 -1
- package/dist/client/assets/{switch-DItIkDat.js → switch-CcOR9vLu.js} +1 -1
- package/dist/client/assets/{table-Cp9c4BcU.js → table-BAGpdfFB.js} +1 -1
- package/dist/client/assets/{tabs-D7y8E5Ya.js → tabs-BBIq1chp.js} +1 -1
- package/dist/client/assets/{textarea-uMNP0LCC.js → textarea-Cu9wZQ0x.js} +1 -1
- package/dist/client/assets/{toggle-group-BqEa1TEc.js → toggle-group-3NzAw3cD.js} +1 -1
- package/dist/client/assets/{toolbar-Dk_EQcxK.js → toolbar-BCd7IYjs.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B3a3a06z.js → toolbar-icon-button-CdCR26vG.js} +1 -1
- package/dist/client/assets/{tooltip-D1kWwXpZ.js → tooltip-Du-iZy7N.js} +1 -1
- package/dist/client/assets/{use-ai-providers-laCpnXdd.js → use-ai-providers-DVcvRuW8.js} +1 -1
- package/dist/client/assets/{use-api-keys-CsDXZwqL.js → use-api-keys-V0LOyd3c.js} +1 -1
- package/dist/client/assets/{use-automations-BfXgjd_V.js → use-automations-CEI45ay4.js} +1 -1
- package/dist/client/assets/{use-autosave-BAraq6AW.js → use-autosave-CJsA34KG.js} +1 -1
- package/dist/client/assets/{use-capability-DzC2Klfd.js → use-capability-Cx0l8hzs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DRjNjgqA.js → use-clock-tick-C_-xNV1u.js} +1 -1
- package/dist/client/assets/{use-connection-Bmwh1M0H.js → use-connection-IvaPXMMI.js} +1 -1
- package/dist/client/assets/{use-copy-CnoszhL7.js → use-copy-B_1XRnig.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BsqQsVxp.js → use-create-virtual-mcp-CIJjVQB3.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BCK-z4zD.js → use-debounced-autosave-Br4PVksK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CV3OhKhZ.js → use-debounced-value-DbPd-3pt.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DJYZaYfn.js → use-deco-credits-FKsuCiez.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CJAX9qbZ.js → use-decopilot-events-DbYP1aYj.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BbE8VrIR.js → use-delete-connection-5AZ2BCY9.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BB1Jrj8e.js → use-deployment-admin-3b1R1FZS.js} +1 -1
- package/dist/client/assets/{use-file-configs-dIk120-N.js → use-file-configs-VWs6VY08.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B7e1w8Ad.js → use-infinite-scroll-BZi9tXU0.js} +1 -1
- package/dist/client/assets/{use-join-requests-BuakQTEO.js → use-join-requests-CsMCalmA.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DUPES28-.js → use-mcp-auth-status-DnXazVhb.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B36Osh-D.js → use-mcp-client-D_VzqTLh.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C_xSJpE0.js → use-mcp-tools-DjkP_M1a.js} +1 -1
- package/dist/client/assets/{use-members-B218nv1M.js → use-members-DV4j3UXl.js} +1 -1
- package/dist/client/assets/{use-mobile--PifyK00.js → use-mobile-CWC5nRCB.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BBbQ-aHe.js → use-navigate-to-agent-DroDm4RE.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DK6Nh6IP.js → use-org-auth-client-BCUT78RS.js} +1 -1
- package/dist/client/assets/{use-org-sso-DZihocwz.js → use-org-sso-Dv2OfSjz.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CdFvxl4s.js → use-organization-roles-CoETHAsw.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CAH1_Gfq.js → use-organization-settings-U7F2Hhh2.js} +1 -1
- package/dist/client/assets/{use-registry-app-Bs5fLaKB.js → use-registry-app-CXrI3NDe.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C0Ibblmm.js → use-registry-connections-BUuKAzIu.js} +1 -1
- package/dist/client/assets/{use-secrets-BTSjhTGA.js → use-secrets-r-sdg8_V.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CMNbO4bj.js → use-status-sounds-D7DlFxOJ.js} +1 -1
- package/dist/client/assets/{use-view-mode-CPAZulMe.js → use-view-mode-ZZSYMSJV.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CQaiGnUU.js → use-virtual-mcp-CBDJvgVd.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-xktR2NpE.js +1 -0
- package/dist/client/assets/{useQueries-CF9YH8lZ.js → useQueries-CJGiUc5a.js} +1 -1
- package/dist/client/assets/{useRouterState-C8-zqAk7.js → useRouterState-v18d10us.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CvxvsZx8.js +1 -0
- package/dist/client/assets/{users-BC5ArrE1.js → users-DB009SMi.js} +1 -1
- package/dist/client/assets/{variant-calendar-B8wZWFL-.js → variant-calendar-ZP0jU61K.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Bmph2BY4.js → view-mode-toggle-Dnn6UOzU.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-BUug5fNW.css +0 -1
- package/dist/client/assets/page-seo-sheet-BqtOe7CO.js +0 -1
- package/dist/client/assets/project-app-view-QX-ZdCUU.js +0 -1
- package/dist/client/assets/record-editor-Bl1Ur8U7.js +0 -1
- package/dist/client/assets/registry-7xJw8GM7.js +0 -2
- package/dist/client/assets/store-registry-BuSUDYda.js +0 -2
- package/dist/client/assets/useInfiniteQuery-ByuEOZ10.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BVdkw7ML.js +0 -1
package/dist/client/assets/{github-repo-picker-WGLIOn68.js → github-repo-picker-DcHCLyjR.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as xe,a as ye,o as me,r as H,_ as oe,c as se,b as ee,j as t,k as Z,e as ge,t as le,dR as Ne,K as te,G as ve,n as ke,m as ue,B as ce,x as Ce,y as Re}from"./index-DAtTWfgt.js";import{a as we,b as Se,d as Pe,e as Ie}from"./dialog-poX5N6OF.js";import{C as _e}from"./collection-search-2V1qih3c.js";import{u as Ee}from"./use-debounced-value-CV3OhKhZ.js";import{b as pe,u as Te}from"./use-connection-Bmwh1M0H.js";import{u as re,S as he}from"./use-mcp-client-B36Osh-D.js";import{a as be}from"./authenticate-and-persist-oauth-Bkljayza.js";import{b as de}from"./Settings02-BMEbk95n.js";import{n as Ae}from"./LinkExternal01-Dbdi7ThP.js";import{P as ze}from"./agent-icon-D8X6NgHQ.js";import{u as Le,G as q}from"./use-registry-app-Bs5fLaKB.js";import{e as Ge}from"./extract-connection-data-BP-6YHKf.js";import{c as Fe}from"./use-navigate-to-agent-BBbQ-aHe.js";import{p as fe,f as Oe}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{g as Ue}from"./github-repo-scope-DjMZbiKa.js";const De="deco/mcp-github";function He(P){const{org:e}=xe(),{data:u}=ye.useSession(),p=pe(),k=me(),[l,r]=H.useState("idle"),[o,s]=H.useState(null),[f,v]=H.useState(null),{data:j,isLoading:R}=Le(De,{enabled:P.enabled}),d=H.useRef(!1);P.enabled&&j&&!R&&!d.current&&u?.user?.id&&l==="idle"&&(d.current=!0,c());async function c(){if(!(!j||!u?.user?.id||!e))try{r("installing"),s(null);const i=Ge(j,e.id,u.user.id,{remoteIndex:0});if(!i.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await p.create.mutateAsync(i);r("authenticating");const b=await be({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>p.update.mutateAsync({id:x,data:{connection_token:m}}).then(()=>{})});if(b.ran&&!b.ok){try{await p.delete.mutateAsync(x)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}oe(k,e.id),v(i),r("ready")}catch(i){s(i instanceof Error?i.message:String(i)),r("error")}}function a(){r("idle"),s(null),v(null),d.current=!1}return P.enabled&&R&&l==="idle"?{status:"installing",error:null,connection:null,retry:a}:{status:l,error:o,connection:f,retry:a}}function at(P){const e=se.c(27),{open:u,onOpenChange:p,title:k,onImportComplete:l,mode:r}=P,o=r===void 0?"agent":r,s=ee();let f;e[0]!==o||e[1]!==s||e[2]!==k?(f=k??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=k,e[3]=f):f=e[3];const v=f,[j,R]=H.useState(null);let d;e[4]!==v?(d=t.jsx(we,{className:"sr-only",children:t.jsx(Se,{children:v})}),e[4]=v,e[5]=d):d=e[5];let c;e[6]!==v||e[7]!==j||e[8]!==s?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:j?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>R(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:j.avatarUrl,alt:j.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:j.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v})]})}),e[6]=v,e[7]=j,e[8]=s,e[9]=c):c=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10];let i;e[11]!==p?(i=()=>p(!1),e[11]=p,e[12]=i):i=e[12];let g;e[13]!==o||e[14]!==l||e[15]!==u||e[16]!==j||e[17]!==i?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:a,children:t.jsx($e,{open:u,onComplete:i,selectedInstallation:j,onSelectInstallation:R,onImportComplete:l,mode:o})})}),e[13]=o,e[14]=l,e[15]=u,e[16]=j,e[17]=i,e[18]=g):g=e[18];let x;e[19]!==d||e[20]!==c||e[21]!==g?(x=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,c,g]}),e[19]=d,e[20]=c,e[21]=g,e[22]=x):x=e[22];let b;return e[23]!==p||e[24]!==u||e[25]!==x?(b=t.jsx(Ie,{open:u,onOpenChange:p,children:x}),e[23]=p,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function $e({open:P,onComplete:e,selectedInstallation:u,onSelectInstallation:p,onImportComplete:k,mode:l="agent"}){const r=ee(),{org:o}=xe(),s=me(),f=Fe(),[v,j]=H.useState(null),R=Te({slug:"mcp-github"}),d=Ue(R),c=He({enabled:P&&d.length===0}),a=d.length===1?d[0]??null:v,i=re({connectionId:a?.id??"",orgId:o.id,orgSlug:o.slug}),g=re({connectionId:he,orgId:o.id,orgSlug:o.slug}),x=async(n,y)=>{try{const w=await i.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:y}});if(w.isError)return null;const S=w.content?.find(I=>I.type==="resource")?.resource?.text;if(!S)return null;try{const I=JSON.parse(S);return typeof I=="string"?I:JSON.stringify(I)}catch{return S}}catch{return null}},b=(n,y)=>{Promise.all([x(y,"AGENTS.md"),x(y,"CLAUDE.md")]).then(async([N,w])=>{const C=N??w??null;C&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:C}}}}),oe(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},m=ge({mutationFn:async n=>{if(!a||!u)throw new Error("No GitHub connection or installation");const y=u.installationId;if(l==="connection"){const{childConnectionId:C}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:S=>i.callTool(S),selfCallTool:S=>g.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:C,item:null}}const{childConnectionId:N}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:C=>i.callTool(C),selfCallTool:C=>g.callTool(C)});let w=null;try{const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:y,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),S=C.structuredContent??C,I=S.item?.id;if(!S.item||!I)throw new Error("Failed to create the imported agent");return w=I,{virtualMcpId:I,repo:n,connectionId:N,item:S.item}}catch(C){throw w&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:w}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),C}},onSuccess:({virtualMcpId:n,repo:y,connectionId:N,item:w})=>{if(l==="connection"||!n||!w){oe(s,o.id),Ne(s,o.id),le.success(r("common.githubRepoPicker.addedRepo",{name:y.name})),e();return}if(s.setQueryData(te.collectionItem(g,o.id,"","VIRTUAL_MCP",n),{item:w}),oe(s,o.id),b(n,y),k){k({virtualMcpId:n,repo:y,connectionId:N});return}le.success(r("common.githubRepoPicker.importedRepo",{name:y.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),f(n)},onError:n=>{le.error(r("common.githubRepoPicker.failedImport",{error:n instanceof Error?n.message:r("common.githubRepoPicker.unknownError")}))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(ae,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(ae,{status:"error",error:c.error,retry:c.retry}):d.length===0&&c.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:c.retry}):d.length>1&&!a?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.githubRepoPicker.selectConnection")})}),d.map(n=>t.jsxs("button",{type:"button",onClick:()=>j(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?u?t.jsx(Qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,installation:u,onSelectRepo:n=>m.mutate(n),isSaving:m.isPending}):t.jsx(qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,onSelect:p,showBackButton:d.length>1,onBack:()=>j(null)}):null}function qe(P){const e=se.c(126),{connectionId:u,orgId:p,orgSlug:k,onSelect:l,showBackButton:r,onBack:o}=P,s=ee();let f;e[0]!==p||e[1]!==k?(f={connectionId:he,orgId:p,orgSlug:k},e[0]=p,e[1]=k,e[2]=f):f=e[2];const v=re(f),j=me(),R=pe();let d;e[3]!==u||e[4]!==p?(d=te.githubUserOrgs(p,u),e[3]=u,e[4]=p,e[5]=d):d=e[5];let c;e[6]!==u||e[7]!==v?(c=()=>Oe(h=>v.callTool(h),u),e[6]=u,e[7]=v,e[8]=c):c=e[8];let a;e[9]!==d||e[10]!==c?(a={queryKey:d,queryFn:c},e[9]=d,e[10]=c,e[11]=a):a=e[11];const i=ke(a);let g;e[12]!==R||e[13]!==u||e[14]!==i||e[15]!==p||e[16]!==k||e[17]!==j?(g=async()=>{const h=await be({connectionId:u,orgId:p,orgSlug:k,persistFallback:A=>R.update.mutateAsync({id:u,data:{connection_token:A}}).then(Me)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${k}/mcp/${u}`,window.location.origin);await j.invalidateQueries({queryKey:te.isMCPAuthenticated(_.href,null)}),await j.invalidateQueries({queryKey:te.mcpClientPrefix()}),await i.refetch()},e[12]=R,e[13]=u,e[14]=i,e[15]=p,e[16]=k,e[17]=j,e[18]=g):g=e[18];let x;e[19]!==s?(x=h=>{le.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=x):x=e[20];let b;e[21]!==g||e[22]!==x?(b={mutationFn:g,onError:x},e[21]=g,e[22]=x,e[23]=b):b=e[23];const m=ge(b);if(i.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=h):h=e[24],h}if(i.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let _;e[27]!==h?(_=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=_):_=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==m?(L=()=>m.mutate(),e[33]=m,e[34]=L):L=e[34];const $=m.isPending;let G;e[35]!==m.isPending?(G=m.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(q,{className:"size-3.5"}),e[35]=m.isPending,e[36]=G):G=e[36];let F;e[37]!==s?(F=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=F):F=e[38];let O;e[39]!==m.isPending||e[40]!==L||e[41]!==G||e[42]!==F?(O=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:$,children:[G,F]}),e[39]=m.isPending,e[40]=L,e[41]=G,e[42]=F,e[43]=O):O=e[43];let D;return e[44]!==z||e[45]!==O||e[46]!==_?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[_,z,O]}),e[44]=z,e[45]=O,e[46]=_,e[47]=D):D=e[47],D}const n=i.data;if(!n)return null;const y=n.appSlug?`https://github.com/apps/${n.appSlug}/installations/new`:"https://github.com/settings/installations";if(n.installations.length===0){let h;e[48]!==o||e[49]!==r||e[50]!==s?(h=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=r,e[50]=s,e[51]=h):h=e[51];let _;e[52]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-8 text-foreground"})}),e[52]=_):_=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let G;e[60]!==$?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=G):G=e[61];let F;e[62]!==s?(F=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=F):F=e[63];let O;e[64]!==F?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:F}),e[64]=F,e[65]=O):O=e[65];let D;e[66]!==s?(D=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=D):D=e[67];let ne;e[68]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Ae,{size:14}),e[68]=ne):ne=e[68];let M;e[69]!==y||e[70]!==D?(M=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:[D,ne]})}),e[69]=y,e[70]=D,e[71]=M):M=e[71];let Q;e[72]!==i?(Q=()=>{i.refetch()},e[72]=i,e[73]=Q):Q=e[73];const je=i.isFetching;let B;e[74]!==i.isFetching?(B=i.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[74]=i.isFetching,e[75]=B):B=e[75];let V;e[76]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=V):V=e[77];let K;e[78]!==i.isFetching||e[79]!==Q||e[80]!==B||e[81]!==V?(K=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:Q,disabled:je,children:[B,V]}),e[78]=i.isFetching,e[79]=Q,e[80]=B,e[81]=V,e[82]=K):K=e[82];let J;e[83]!==M||e[84]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[M,K]}),e[83]=M,e[84]=K,e[85]=J):J=e[85];let W;e[86]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=W):W=e[87];let Y;e[88]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[88]=W,e[89]=Y):Y=e[89];let X;e[90]!==L||e[91]!==G||e[92]!==O||e[93]!==J||e[94]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[_,L,G,O,J,Y]}),e[90]=L,e[91]=G,e[92]=O,e[93]=J,e[94]=Y,e[95]=X):X=e[95];let ie;return e[96]!==X||e[97]!==h?(ie=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,X]}),e[96]=X,e[97]=h,e[98]=ie):ie=e[98],ie}let N;e[99]!==o||e[100]!==r||e[101]!==s?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=o,e[100]=r,e[101]=s,e[102]=N):N=e[102];let w;if(e[103]!==n.installations||e[104]!==l||e[105]!==s){let h;e[107]!==l||e[108]!==s?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},_.installationId),e[107]=l,e[108]=s,e[109]=h):h=e[109],w=n.installations.map(h),e[103]=n.installations,e[104]=l,e[105]=s,e[106]=w}else w=e[106];let C;e[110]!==w?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:w}),e[110]=w,e[111]=C):C=e[111];let S;e[112]!==s?(S=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=S):S=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let E;e[116]!==I?(E=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=E):E=e[117];let T;e[118]!==y||e[119]!==S||e[120]!==E?(T=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[S," ",E]})}),e[118]=y,e[119]=S,e[120]=E,e[121]=T):T=e[121];let U;return e[122]!==C||e[123]!==T||e[124]!==N?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,C,T]}),e[122]=C,e[123]=T,e[124]=N,e[125]=U):U=e[125],U}function Me(){}function Qe(P){const e=se.c(23),{connectionId:u,orgId:p,orgSlug:k,installation:l,onSelectRepo:r,isSaving:o}=P,s=ee(),[f,v]=H.useState(""),j=Ee(f,300),R=H.useDeferredValue(j),d=f!==R;let c;e[0]!==s?(c=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==d||e[3]!==f||e[4]!==c?(a=t.jsx(_e,{placeholder:c,value:f,onChange:v,isSearching:d}),e[2]=d,e[3]=f,e[4]=c,e[5]=a):a=e[5];const i=d?"opacity-40":"opacity-100";let g;e[6]!==i?(g=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",i),e[6]=i,e[7]=g):g=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=x):x=e[8];let b;e[9]!==u||e[10]!==R||e[11]!==l||e[12]!==o||e[13]!==r||e[14]!==p||e[15]!==k?(b=t.jsx(H.Suspense,{fallback:x,children:t.jsx(Be,{connectionId:u,orgId:p,orgSlug:k,installation:l,query:R,onSelectRepo:r,isSaving:o})}),e[9]=u,e[10]=R,e[11]=l,e[12]=o,e[13]=r,e[14]=p,e[15]=k,e[16]=b):b=e[16];let m;e[17]!==g||e[18]!==b?(m=t.jsx("div",{className:g,children:b}),e[17]=g,e[18]=b,e[19]=m):m=e[19];let n;return e[20]!==a||e[21]!==m?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a,m]}),e[20]=a,e[21]=m,e[22]=n):n=e[22],n}function Be(P){const e=se.c(36),{connectionId:u,orgId:p,orgSlug:k,installation:l,query:r,onSelectRepo:o,isSaving:s}=P,f=ee();let v;e[0]!==u||e[1]!==p||e[2]!==k?(v={connectionId:u,orgId:p,orgSlug:k},e[0]=u,e[1]=p,e[2]=k,e[3]=v):v=e[3];const j=re(v),R=l.type==="User"?"user":"org",d=r?`${R}:${l.login} ${r} in:name`:`${R}:${l.login}`;let c;e[4]!==u||e[5]!==l.login||e[6]!==p||e[7]!==r?(c=te.githubOrgRepos(p,u,l.login,r),e[4]=u,e[5]=l.login,e[6]=p,e[7]=r,e[8]=c):c=e[8];let a;e[9]!==j||e[10]!==d?(a=async m=>{const{signal:n}=m,N=(await j.callTool({name:"search_repositories",arguments:{query:d,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Ve)},e[9]=j,e[10]=d,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i={queryKey:c,queryFn:a},e[12]=c,e[13]=a,e[14]=i):i=e[14];const{data:g}=Ce(i);if(g.length===0){let m;e[15]!==f?(m=f("common.githubRepoPicker.noRepositoriesFound"),e[15]=f,e[16]=m):m=e[16];let n;e[17]!==m?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[17]=m,e[18]=n):n=e[18];let y;e[19]!==r||e[20]!==f?(y=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:f("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=r,e[20]=f,e[21]=y):y=e[21];let N;return e[22]!==n||e[23]!==y?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,y]}),e[22]=n,e[23]=y,e[24]=N):N=e[24],N}let x;if(e[25]!==s||e[26]!==o||e[27]!==g||e[28]!==f){let m;e[30]!==s||e[31]!==o||e[32]!==f?(m=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(q,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:n.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(Re,{size:10}):t.jsx(ze,{size:10}),n.private?f("common.githubRepoPicker.private"):f("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=f,e[33]=m):m=e[33],x=g.map(m),e[25]=s,e[26]=o,e[27]=g,e[28]=f,e[29]=x}else x=e[29];let b;return e[34]!==x?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[34]=x,e[35]=b):b=e[35],b}function Ve(P){return{name:P.name,fullName:P.full_name,owner:P.full_name.split("/")[0]??"",url:P.html_url,private:P.private,description:P.description,updatedAt:P.updated_at}}function ae(P){const e=se.c(51),{status:u,error:p,retry:k}=P,l=ee();if(u==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let w;e[1]!==l?(w=l("common.githubRepoPicker.connectionFailed"),e[1]=l,e[2]=w):w=e[2];let C;e[3]!==w?(C=t.jsx("p",{className:"text-sm font-medium",children:w}),e[3]=w,e[4]=C):C=e[4];let S;e[5]!==p||e[6]!==l?(S=p??l("common.githubRepoPicker.somethingWentWrong"),e[5]=p,e[6]=l,e[7]=S):S=e[7];let I;e[8]!==S?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:S}),e[8]=S,e[9]=I):I=e[9];let E;e[10]!==C||e[11]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,I]}),e[10]=C,e[11]=I,e[12]=E):E=e[12];let T;e[13]!==l?(T=l("common.githubRepoPicker.tryAgain"),e[13]=l,e[14]=T):T=e[14];let U;e[15]!==k||e[16]!==T?(U=t.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:T}),e[15]=k,e[16]=T,e[17]=U):U=e[17];let h;return e[18]!==E||e[19]!==U?(h=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,E,U]}),e[18]=E,e[19]=U,e[20]=h):h=e[20],h}const r=u==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let f;e[23]!==r||e[24]!==l?(f=l(r?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=r,e[24]=l,e[25]=f):f=e[25];let v;e[26]!==f?(v=t.jsx("p",{className:"text-sm font-medium",children:f}),e[26]=f,e[27]=v):v=e[27];let j;e[28]!==r||e[29]!==l?(j=l(r?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=r,e[29]=l,e[30]=j):j=e[30];let R;e[31]!==j?(R=t.jsx("p",{className:"text-xs text-muted-foreground",children:j}),e[31]=j,e[32]=R):R=e[32];let d;e[33]!==v||e[34]!==R?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,R]}),e[33]=v,e[34]=R,e[35]=d):d=e[35];const c=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[36]!==c?(a=ue("size-1.5 rounded-full",c),e[36]=c,e[37]=a):a=e[37];let i;e[38]!==a?(i=t.jsx("span",{className:a}),e[38]=a,e[39]=i):i=e[39];const g=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[40]!==g?(x=ue("size-1.5 rounded-full",g),e[40]=g,e[41]=x):x=e[41];let b;e[42]!==x?(b=t.jsx("span",{className:x}),e[42]=x,e[43]=b):b=e[43];let m;e[44]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=m):m=e[44];let n;e[45]!==i||e[46]!==b?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[i,b,m]}),e[45]=i,e[46]=b,e[47]=n):n=e[47];let y;return e[48]!==n||e[49]!==d?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,d,n]}),e[48]=n,e[49]=d,e[50]=y):y=e[50],y}export{at as G,He as u};
|
|
1
|
+
import{F as xe,a as ye,o as me,r as H,_ as oe,c as se,b as ee,j as t,k as Z,e as ge,t as le,dR as Ne,K as te,G as ve,n as ke,m as ue,B as ce,x as Ce,y as Re}from"./index-C7paW5qO.js";import{a as we,b as Se,d as Pe,e as Ie}from"./dialog-CKP-t2d8.js";import{C as _e}from"./collection-search-5eKJWC8a.js";import{u as Ee}from"./use-debounced-value-DbPd-3pt.js";import{b as pe,u as Te}from"./use-connection-IvaPXMMI.js";import{u as re,S as he}from"./use-mcp-client-D_VzqTLh.js";import{a as be}from"./authenticate-and-persist-oauth-D2zBt4t0.js";import{b as de}from"./Settings02-BrdhYfJi.js";import{n as Ae}from"./LinkExternal01-DunixMNV.js";import{P as ze}from"./agent-icon-ibE4Mzzu.js";import{u as Le,G as q}from"./use-registry-app-CXrI3NDe.js";import{e as Ge}from"./extract-connection-data-C_r5IGMb.js";import{c as Fe}from"./use-navigate-to-agent-DroDm4RE.js";import{p as fe,f as Oe}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{g as Ue}from"./github-repo-scope-DjMZbiKa.js";const De="deco/mcp-github";function He(P){const{org:e}=xe(),{data:u}=ye.useSession(),p=pe(),k=me(),[l,r]=H.useState("idle"),[o,s]=H.useState(null),[f,v]=H.useState(null),{data:j,isLoading:R}=Le(De,{enabled:P.enabled}),d=H.useRef(!1);P.enabled&&j&&!R&&!d.current&&u?.user?.id&&l==="idle"&&(d.current=!0,c());async function c(){if(!(!j||!u?.user?.id||!e))try{r("installing"),s(null);const i=Ge(j,e.id,u.user.id,{remoteIndex:0});if(!i.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await p.create.mutateAsync(i);r("authenticating");const b=await be({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>p.update.mutateAsync({id:x,data:{connection_token:m}}).then(()=>{})});if(b.ran&&!b.ok){try{await p.delete.mutateAsync(x)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}oe(k,e.id),v(i),r("ready")}catch(i){s(i instanceof Error?i.message:String(i)),r("error")}}function a(){r("idle"),s(null),v(null),d.current=!1}return P.enabled&&R&&l==="idle"?{status:"installing",error:null,connection:null,retry:a}:{status:l,error:o,connection:f,retry:a}}function at(P){const e=se.c(27),{open:u,onOpenChange:p,title:k,onImportComplete:l,mode:r}=P,o=r===void 0?"agent":r,s=ee();let f;e[0]!==o||e[1]!==s||e[2]!==k?(f=k??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=k,e[3]=f):f=e[3];const v=f,[j,R]=H.useState(null);let d;e[4]!==v?(d=t.jsx(we,{className:"sr-only",children:t.jsx(Se,{children:v})}),e[4]=v,e[5]=d):d=e[5];let c;e[6]!==v||e[7]!==j||e[8]!==s?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:j?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>R(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:j.avatarUrl,alt:j.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:j.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v})]})}),e[6]=v,e[7]=j,e[8]=s,e[9]=c):c=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10];let i;e[11]!==p?(i=()=>p(!1),e[11]=p,e[12]=i):i=e[12];let g;e[13]!==o||e[14]!==l||e[15]!==u||e[16]!==j||e[17]!==i?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:a,children:t.jsx($e,{open:u,onComplete:i,selectedInstallation:j,onSelectInstallation:R,onImportComplete:l,mode:o})})}),e[13]=o,e[14]=l,e[15]=u,e[16]=j,e[17]=i,e[18]=g):g=e[18];let x;e[19]!==d||e[20]!==c||e[21]!==g?(x=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,c,g]}),e[19]=d,e[20]=c,e[21]=g,e[22]=x):x=e[22];let b;return e[23]!==p||e[24]!==u||e[25]!==x?(b=t.jsx(Ie,{open:u,onOpenChange:p,children:x}),e[23]=p,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function $e({open:P,onComplete:e,selectedInstallation:u,onSelectInstallation:p,onImportComplete:k,mode:l="agent"}){const r=ee(),{org:o}=xe(),s=me(),f=Fe(),[v,j]=H.useState(null),R=Te({slug:"mcp-github"}),d=Ue(R),c=He({enabled:P&&d.length===0}),a=d.length===1?d[0]??null:v,i=re({connectionId:a?.id??"",orgId:o.id,orgSlug:o.slug}),g=re({connectionId:he,orgId:o.id,orgSlug:o.slug}),x=async(n,y)=>{try{const w=await i.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:y}});if(w.isError)return null;const S=w.content?.find(I=>I.type==="resource")?.resource?.text;if(!S)return null;try{const I=JSON.parse(S);return typeof I=="string"?I:JSON.stringify(I)}catch{return S}}catch{return null}},b=(n,y)=>{Promise.all([x(y,"AGENTS.md"),x(y,"CLAUDE.md")]).then(async([N,w])=>{const C=N??w??null;C&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:C}}}}),oe(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},m=ge({mutationFn:async n=>{if(!a||!u)throw new Error("No GitHub connection or installation");const y=u.installationId;if(l==="connection"){const{childConnectionId:C}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:S=>i.callTool(S),selfCallTool:S=>g.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:C,item:null}}const{childConnectionId:N}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:C=>i.callTool(C),selfCallTool:C=>g.callTool(C)});let w=null;try{const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:y,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),S=C.structuredContent??C,I=S.item?.id;if(!S.item||!I)throw new Error("Failed to create the imported agent");return w=I,{virtualMcpId:I,repo:n,connectionId:N,item:S.item}}catch(C){throw w&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:w}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),C}},onSuccess:({virtualMcpId:n,repo:y,connectionId:N,item:w})=>{if(l==="connection"||!n||!w){oe(s,o.id),Ne(s,o.id),le.success(r("common.githubRepoPicker.addedRepo",{name:y.name})),e();return}if(s.setQueryData(te.collectionItem(g,o.id,"","VIRTUAL_MCP",n),{item:w}),oe(s,o.id),b(n,y),k){k({virtualMcpId:n,repo:y,connectionId:N});return}le.success(r("common.githubRepoPicker.importedRepo",{name:y.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),f(n)},onError:n=>{le.error(r("common.githubRepoPicker.failedImport",{error:n instanceof Error?n.message:r("common.githubRepoPicker.unknownError")}))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(ae,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(ae,{status:"error",error:c.error,retry:c.retry}):d.length===0&&c.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:c.retry}):d.length>1&&!a?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.githubRepoPicker.selectConnection")})}),d.map(n=>t.jsxs("button",{type:"button",onClick:()=>j(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?u?t.jsx(Qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,installation:u,onSelectRepo:n=>m.mutate(n),isSaving:m.isPending}):t.jsx(qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,onSelect:p,showBackButton:d.length>1,onBack:()=>j(null)}):null}function qe(P){const e=se.c(126),{connectionId:u,orgId:p,orgSlug:k,onSelect:l,showBackButton:r,onBack:o}=P,s=ee();let f;e[0]!==p||e[1]!==k?(f={connectionId:he,orgId:p,orgSlug:k},e[0]=p,e[1]=k,e[2]=f):f=e[2];const v=re(f),j=me(),R=pe();let d;e[3]!==u||e[4]!==p?(d=te.githubUserOrgs(p,u),e[3]=u,e[4]=p,e[5]=d):d=e[5];let c;e[6]!==u||e[7]!==v?(c=()=>Oe(h=>v.callTool(h),u),e[6]=u,e[7]=v,e[8]=c):c=e[8];let a;e[9]!==d||e[10]!==c?(a={queryKey:d,queryFn:c},e[9]=d,e[10]=c,e[11]=a):a=e[11];const i=ke(a);let g;e[12]!==R||e[13]!==u||e[14]!==i||e[15]!==p||e[16]!==k||e[17]!==j?(g=async()=>{const h=await be({connectionId:u,orgId:p,orgSlug:k,persistFallback:A=>R.update.mutateAsync({id:u,data:{connection_token:A}}).then(Me)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${k}/mcp/${u}`,window.location.origin);await j.invalidateQueries({queryKey:te.isMCPAuthenticated(_.href,null)}),await j.invalidateQueries({queryKey:te.mcpClientPrefix()}),await i.refetch()},e[12]=R,e[13]=u,e[14]=i,e[15]=p,e[16]=k,e[17]=j,e[18]=g):g=e[18];let x;e[19]!==s?(x=h=>{le.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=x):x=e[20];let b;e[21]!==g||e[22]!==x?(b={mutationFn:g,onError:x},e[21]=g,e[22]=x,e[23]=b):b=e[23];const m=ge(b);if(i.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=h):h=e[24],h}if(i.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let _;e[27]!==h?(_=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=_):_=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==m?(L=()=>m.mutate(),e[33]=m,e[34]=L):L=e[34];const $=m.isPending;let G;e[35]!==m.isPending?(G=m.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(q,{className:"size-3.5"}),e[35]=m.isPending,e[36]=G):G=e[36];let F;e[37]!==s?(F=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=F):F=e[38];let O;e[39]!==m.isPending||e[40]!==L||e[41]!==G||e[42]!==F?(O=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:$,children:[G,F]}),e[39]=m.isPending,e[40]=L,e[41]=G,e[42]=F,e[43]=O):O=e[43];let D;return e[44]!==z||e[45]!==O||e[46]!==_?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[_,z,O]}),e[44]=z,e[45]=O,e[46]=_,e[47]=D):D=e[47],D}const n=i.data;if(!n)return null;const y=n.appSlug?`https://github.com/apps/${n.appSlug}/installations/new`:"https://github.com/settings/installations";if(n.installations.length===0){let h;e[48]!==o||e[49]!==r||e[50]!==s?(h=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=r,e[50]=s,e[51]=h):h=e[51];let _;e[52]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-8 text-foreground"})}),e[52]=_):_=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let G;e[60]!==$?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=G):G=e[61];let F;e[62]!==s?(F=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=F):F=e[63];let O;e[64]!==F?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:F}),e[64]=F,e[65]=O):O=e[65];let D;e[66]!==s?(D=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=D):D=e[67];let ne;e[68]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Ae,{size:14}),e[68]=ne):ne=e[68];let M;e[69]!==y||e[70]!==D?(M=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:[D,ne]})}),e[69]=y,e[70]=D,e[71]=M):M=e[71];let Q;e[72]!==i?(Q=()=>{i.refetch()},e[72]=i,e[73]=Q):Q=e[73];const je=i.isFetching;let B;e[74]!==i.isFetching?(B=i.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[74]=i.isFetching,e[75]=B):B=e[75];let V;e[76]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=V):V=e[77];let K;e[78]!==i.isFetching||e[79]!==Q||e[80]!==B||e[81]!==V?(K=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:Q,disabled:je,children:[B,V]}),e[78]=i.isFetching,e[79]=Q,e[80]=B,e[81]=V,e[82]=K):K=e[82];let J;e[83]!==M||e[84]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[M,K]}),e[83]=M,e[84]=K,e[85]=J):J=e[85];let W;e[86]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=W):W=e[87];let Y;e[88]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[88]=W,e[89]=Y):Y=e[89];let X;e[90]!==L||e[91]!==G||e[92]!==O||e[93]!==J||e[94]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[_,L,G,O,J,Y]}),e[90]=L,e[91]=G,e[92]=O,e[93]=J,e[94]=Y,e[95]=X):X=e[95];let ie;return e[96]!==X||e[97]!==h?(ie=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,X]}),e[96]=X,e[97]=h,e[98]=ie):ie=e[98],ie}let N;e[99]!==o||e[100]!==r||e[101]!==s?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=o,e[100]=r,e[101]=s,e[102]=N):N=e[102];let w;if(e[103]!==n.installations||e[104]!==l||e[105]!==s){let h;e[107]!==l||e[108]!==s?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},_.installationId),e[107]=l,e[108]=s,e[109]=h):h=e[109],w=n.installations.map(h),e[103]=n.installations,e[104]=l,e[105]=s,e[106]=w}else w=e[106];let C;e[110]!==w?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:w}),e[110]=w,e[111]=C):C=e[111];let S;e[112]!==s?(S=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=S):S=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let E;e[116]!==I?(E=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=E):E=e[117];let T;e[118]!==y||e[119]!==S||e[120]!==E?(T=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[S," ",E]})}),e[118]=y,e[119]=S,e[120]=E,e[121]=T):T=e[121];let U;return e[122]!==C||e[123]!==T||e[124]!==N?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,C,T]}),e[122]=C,e[123]=T,e[124]=N,e[125]=U):U=e[125],U}function Me(){}function Qe(P){const e=se.c(23),{connectionId:u,orgId:p,orgSlug:k,installation:l,onSelectRepo:r,isSaving:o}=P,s=ee(),[f,v]=H.useState(""),j=Ee(f,300),R=H.useDeferredValue(j),d=f!==R;let c;e[0]!==s?(c=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==d||e[3]!==f||e[4]!==c?(a=t.jsx(_e,{placeholder:c,value:f,onChange:v,isSearching:d}),e[2]=d,e[3]=f,e[4]=c,e[5]=a):a=e[5];const i=d?"opacity-40":"opacity-100";let g;e[6]!==i?(g=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",i),e[6]=i,e[7]=g):g=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=x):x=e[8];let b;e[9]!==u||e[10]!==R||e[11]!==l||e[12]!==o||e[13]!==r||e[14]!==p||e[15]!==k?(b=t.jsx(H.Suspense,{fallback:x,children:t.jsx(Be,{connectionId:u,orgId:p,orgSlug:k,installation:l,query:R,onSelectRepo:r,isSaving:o})}),e[9]=u,e[10]=R,e[11]=l,e[12]=o,e[13]=r,e[14]=p,e[15]=k,e[16]=b):b=e[16];let m;e[17]!==g||e[18]!==b?(m=t.jsx("div",{className:g,children:b}),e[17]=g,e[18]=b,e[19]=m):m=e[19];let n;return e[20]!==a||e[21]!==m?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a,m]}),e[20]=a,e[21]=m,e[22]=n):n=e[22],n}function Be(P){const e=se.c(36),{connectionId:u,orgId:p,orgSlug:k,installation:l,query:r,onSelectRepo:o,isSaving:s}=P,f=ee();let v;e[0]!==u||e[1]!==p||e[2]!==k?(v={connectionId:u,orgId:p,orgSlug:k},e[0]=u,e[1]=p,e[2]=k,e[3]=v):v=e[3];const j=re(v),R=l.type==="User"?"user":"org",d=r?`${R}:${l.login} ${r} in:name`:`${R}:${l.login}`;let c;e[4]!==u||e[5]!==l.login||e[6]!==p||e[7]!==r?(c=te.githubOrgRepos(p,u,l.login,r),e[4]=u,e[5]=l.login,e[6]=p,e[7]=r,e[8]=c):c=e[8];let a;e[9]!==j||e[10]!==d?(a=async m=>{const{signal:n}=m,N=(await j.callTool({name:"search_repositories",arguments:{query:d,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Ve)},e[9]=j,e[10]=d,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i={queryKey:c,queryFn:a},e[12]=c,e[13]=a,e[14]=i):i=e[14];const{data:g}=Ce(i);if(g.length===0){let m;e[15]!==f?(m=f("common.githubRepoPicker.noRepositoriesFound"),e[15]=f,e[16]=m):m=e[16];let n;e[17]!==m?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[17]=m,e[18]=n):n=e[18];let y;e[19]!==r||e[20]!==f?(y=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:f("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=r,e[20]=f,e[21]=y):y=e[21];let N;return e[22]!==n||e[23]!==y?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,y]}),e[22]=n,e[23]=y,e[24]=N):N=e[24],N}let x;if(e[25]!==s||e[26]!==o||e[27]!==g||e[28]!==f){let m;e[30]!==s||e[31]!==o||e[32]!==f?(m=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(q,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:n.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(Re,{size:10}):t.jsx(ze,{size:10}),n.private?f("common.githubRepoPicker.private"):f("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=f,e[33]=m):m=e[33],x=g.map(m),e[25]=s,e[26]=o,e[27]=g,e[28]=f,e[29]=x}else x=e[29];let b;return e[34]!==x?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[34]=x,e[35]=b):b=e[35],b}function Ve(P){return{name:P.name,fullName:P.full_name,owner:P.full_name.split("/")[0]??"",url:P.html_url,private:P.private,description:P.description,updatedAt:P.updated_at}}function ae(P){const e=se.c(51),{status:u,error:p,retry:k}=P,l=ee();if(u==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let w;e[1]!==l?(w=l("common.githubRepoPicker.connectionFailed"),e[1]=l,e[2]=w):w=e[2];let C;e[3]!==w?(C=t.jsx("p",{className:"text-sm font-medium",children:w}),e[3]=w,e[4]=C):C=e[4];let S;e[5]!==p||e[6]!==l?(S=p??l("common.githubRepoPicker.somethingWentWrong"),e[5]=p,e[6]=l,e[7]=S):S=e[7];let I;e[8]!==S?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:S}),e[8]=S,e[9]=I):I=e[9];let E;e[10]!==C||e[11]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,I]}),e[10]=C,e[11]=I,e[12]=E):E=e[12];let T;e[13]!==l?(T=l("common.githubRepoPicker.tryAgain"),e[13]=l,e[14]=T):T=e[14];let U;e[15]!==k||e[16]!==T?(U=t.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:T}),e[15]=k,e[16]=T,e[17]=U):U=e[17];let h;return e[18]!==E||e[19]!==U?(h=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,E,U]}),e[18]=E,e[19]=U,e[20]=h):h=e[20],h}const r=u==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let f;e[23]!==r||e[24]!==l?(f=l(r?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=r,e[24]=l,e[25]=f):f=e[25];let v;e[26]!==f?(v=t.jsx("p",{className:"text-sm font-medium",children:f}),e[26]=f,e[27]=v):v=e[27];let j;e[28]!==r||e[29]!==l?(j=l(r?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=r,e[29]=l,e[30]=j):j=e[30];let R;e[31]!==j?(R=t.jsx("p",{className:"text-xs text-muted-foreground",children:j}),e[31]=j,e[32]=R):R=e[32];let d;e[33]!==v||e[34]!==R?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,R]}),e[33]=v,e[34]=R,e[35]=d):d=e[35];const c=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[36]!==c?(a=ue("size-1.5 rounded-full",c),e[36]=c,e[37]=a):a=e[37];let i;e[38]!==a?(i=t.jsx("span",{className:a}),e[38]=a,e[39]=i):i=e[39];const g=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[40]!==g?(x=ue("size-1.5 rounded-full",g),e[40]=g,e[41]=x):x=e[41];let b;e[42]!==x?(b=t.jsx("span",{className:x}),e[42]=x,e[43]=b):b=e[43];let m;e[44]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=m):m=e[44];let n;e[45]!==i||e[46]!==b?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[i,b,m]}),e[45]=i,e[46]=b,e[47]=n):n=e[47];let y;return e[48]!==n||e[49]!==d?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,d,n]}),e[48]=n,e[49]=d,e[50]=y):y=e[50],y}export{at as G,He as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{du as St,dv as It,b9 as N,X as c,dw as de,bf as ze,dx as Et,b8 as Tt,aG as wt,a4 as O,a3 as W,a1 as oe,W as _,ba as m,a$ as U,co as Mt,dy as I,a2 as At,t as ge,c as Ee,r as J,F as Ot,j as Ct}from"./index-
|
|
1
|
+
import{du as St,dv as It,b9 as N,X as c,dw as de,bf as ze,dx as Et,b8 as Tt,aG as wt,a4 as O,a3 as W,a1 as oe,W as _,ba as m,a$ as U,co as Mt,dy as I,a2 as At,t as ge,c as Ee,r as J,F as Ot,j as Ct}from"./index-C7paW5qO.js";import{S as Nt,u as Rt}from"./use-mcp-client-D_VzqTLh.js";import{d as xt}from"./delay-CnY5UFtP.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{d as Dt,D as Lt}from"./decopilot-sse-pool-BjZ-wPbg.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",kt=Symbol.for(Je),Ce,Ne,Z=class We extends(Ne=Error,Ce=kt,Ne){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Re,xe,Zt=class extends(xe=Z,Re=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,Le=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${Ge(e)}`,cause:e}),this[Pe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Xe)}},Qe="AI_TypeValidationError",Ke=`vercel.ai.error.${Qe}`,Ut=Symbol.for(Ke),ke,je,X=class ve extends(je=Z,ke=Ut,je){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Qe,message:`${s}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${Ge(a)}`,cause:a}),this[ke]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Ke)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Zt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ft=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Bt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ze(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ft.test(t)===!1&&Bt.test(t)===!1?e:Vt(e)}function Vt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function zt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ze(t)}try{return Ze(t)}finally{Error.stackTraceLimit=e}}function Te(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=V(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(V):V(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(V)),t.allOf!=null&&(t.allOf=t.allOf.map(V)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(V));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=V(e[a]);return t}function V(t){return typeof t=="boolean"?t:Te(t)}var Jt=Symbol("Let zodToJsonSchema decide on which parser to use"),$e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Wt=t=>typeof t=="string"?{...$e,name:t}:{...$e,...t};function R(){return{}}function Gt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Yt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Ht(){return{type:"boolean"}}function et(t,e){return b(t.type._def,e)}var qt=(t,e)=>b(t.innerType._def,e);function tt(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>tt(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Xt(t)}}var Xt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Qt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Kt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):R()}function ea(t){return{type:"string",enum:Array.from(t.values)}}var ta=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function aa(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ta(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function ra(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function at(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?na(t):t}var sa=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function na(t){let e="";for(let a=0;a<t.length;a++)sa.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ue(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Ue(e,r)}function Ue(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as E,F as ue,o as tt,e as Xe,K as X,n as oe,aU as kn,r as N,ab as Es,m as de,j as l,v as Ts,k as Ds,B as Z,b as se,av as Sn,t as fe,y as Fs,L as Is,f as Ls,d as Nn,u as Pn,E as Tt}from"./index-DAtTWfgt.js";import{s as Cn}from"./Eye-Bk2Xgrvg.js";import{a as ht}from"./Palette-CI2gPMub.js";import{s as Ms}from"./Plus-BHn273te.js";import{i as Os}from"./SearchLg-BhaN5Dkw.js";import{i as mt}from"./Upload01-Cw1RTJdA.js";import{s as zn}from"./XClose-CRX1ODGE.js";import{i as Ut}from"./Zap-BbOt7jmA.js";import{u as $n}from"./use-mobile--PifyK00.js";import{A as Rs,a as As,b as _s,c as Bs,d as Us,e as Hs,f as Ks,g as qs}from"./alert-dialog-BbSxHfpk.js";import{a as En,b as Ue,d as nt,e as st,i as Tn,h as Ws,c as Vs}from"./dialog-poX5N6OF.js";import{I as Ye}from"./input-BTaZQTwt.js";import{F as Ne,M as Ht,d as Dn}from"./file-type-icon-CCvkC4UX.js";import{T as Gs}from"./toolbar-Dk_EQcxK.js";import{a as Xs}from"./Package-CPikbMFw.js";import{u as Qs}from"./use-debounced-value-CV3OhKhZ.js";import{p as gt,b as ne,a as Me,c as Fn,d as Ys}from"./location-BpLtHjTZ.js";import{c as Zs,f as dt,s as Js,b as nn,d as er,g as tr,i as nr,h as In,a as Ln,j as sr,e as rr}from"./ZoomOut-0gQoEQDY.js";import{S as ce}from"./skeleton-rk4WuHqh.js";import{T as lr}from"./textarea-uMNP0LCC.js";import{t as ir}from"./ChevronDown-BeuEDkJI.js";import{n as ar}from"./ChevronUp-tFv_O9M0.js";import{i as pt}from"./X-BlyIKSVp.js";import{a as or,b as cr,P as dr}from"./popover-6uiYyt5u.js";import{c as ve,T as we,a as je}from"./tooltip-D1kWwXpZ.js";import{i as ur}from"./Check-BqbTs6Sp.js";import{a as fr}from"./Copy01-DqXF8bW_.js";import{n as Ze,i as yt}from"./Globe01-D61pxNbc.js";import{i as Mn}from"./Key01-C1OrSDs9.js";import{n as On}from"./LinkExternal01-Dbdi7ThP.js";import{l as hr,F as mr}from"./index-AqXdWiS8.js";import{a as pr}from"./Image01-C0tZD_4N.js";import{c as Kt,D as qt,b as Wt,a as Ie}from"./dropdown-menu-C_IfrJtZ.js";import{i as xr}from"./LayoutLeft-BR0426bP.js";import{i as br}from"./ChevronRight-CpxTzNTm.js";import{t as gr}from"./Stars01-DzME0iEm.js";import{a as Rn}from"./DotsVertical-Ue6eGmYj.js";import{s as An}from"./Trash01-DxhoFTU2.js";function _n(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function be(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function he(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Vt(n,e){const t=E.c(11),{org:s}=ue();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=X.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=r):r=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await he(be(s.slug,n,"list",{path:e}))).json()).entries.toSorted(yr),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let a;return t[8]!==r||t[9]!==i?(a={queryKey:r,placeholderData:kn,queryFn:i},t[8]=r,t[9]=i,t[10]=a):a=t[10],oe(a)}function yr(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function Bn(n,e,t){const s=E.c(15),{org:r}=ue();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=X.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let o;s[6]!==r.slug||s[7]!==e||s[8]!==n?(o=async()=>{const f=await he(be(r.slug,n??"","stat",{path:e}),void 0,{allow404:!0});return f.status===404?null:(await f.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=o):o=s[9];let d;return s[10]!==i||s[11]!==a||s[12]!==c||s[13]!==o?(d={queryKey:i,enabled:a,refetchInterval:c,queryFn:o},s[10]=i,s[11]=a,s[12]=c,s[13]=o,s[14]=d):d=s[14],oe(d)}function vr(n){const e=E.c(9),{org:t}=ue();let s;e[0]!==t.id||e[1]!==n?(s=X.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async()=>await(await he(be(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,queryFn:r},e[6]=s,e[7]=r,e[8]=i):i=e[8],oe(i)}function wr(n,e){const t=E.c(9),s=n===void 0?60:n,{org:r}=ue();let i;t[0]!==r.id?(i=X.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let c;t[2]!==s||t[3]!==r.slug?(c=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=c):c=t[4];let o;return t[5]!==i||t[6]!==a||t[7]!==c?(o={queryKey:i,enabled:a,queryFn:c},t[5]=i,t[6]=a,t[7]=c,t[8]=o):o=t[8],oe(o)}function jr(n,e){const t=E.c(11),s=50,{org:r}=ue();let i;t[0]!==r.id||t[1]!==n?(i=X.orgFsSearch(r.id,n),t[0]=r.id,t[1]=n,t[2]=i):i=t[2];const a=n.length>0;let c;t[3]!==s||t[4]!==r.slug||t[5]!==n?(c=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=r.slug,t[5]=n,t[6]=c):c=t[6];let o;return t[7]!==i||t[8]!==a||t[9]!==c?(o={queryKey:i,enabled:a,placeholderData:kn,queryFn:c},t[7]=i,t[8]=a,t[9]=c,t[10]=o):o=t[10],oe(o)}function Aa(n){const e=E.c(8),{org:t}=ue();let s;e[0]!==t.id?(s=X.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const c=await he(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:o}=await c.json();return o.map(kr)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],oe(a)}function kr(n){return{volume:n.volume,path:n.path}}async function _a(n){const e=await he(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function Sr(n,e,t){return(await he(be(n,e,"read",{path:t}))).text()}const Nr=new Set(["md","mdx","markdown","txt","text"]),Pr=25,Cr=64*1024,zr=256*1024,$r=4;function Er(n){const e=n.lastIndexOf(".");return e===-1?!1:Nr.has(n.slice(e+1).toLowerCase())}async function Ba(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],c=[{path:t,depth:0}];for(;c.length>0;){const u=c.shift();if(!u)break;let h;try{h=(await(await he(be(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,x)=>p.path.localeCompare(x.path))){if(m.kind==="dir"){u.depth<$r&&c.push({path:m.path,depth:u.depth+1});continue}Er(m.path)&&m.size<=Cr&&i.length<Pr?i.push(m.path):a.push(r(m.path))}}const o=await Promise.all(i.map(u=>Sr(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=o[h];if(m==null||f+m.length>zr){a.push(r(u));return}f+=m.length,d.push({relPath:r(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),a.sort(),{files:d,omittedPaths:a}}function Un(){const n=E.c(7),{org:e}=ue();let t;n[0]!==e.id?(t=X.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await he(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],oe(r)}function Tr(n){const e=E.c(3),{org:t}=ue();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>be(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function rt(){const n=E.c(2),{org:e}=ue();let t;return n[0]!==e.slug?(t=(s,r)=>be(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function Hn(n){const e=E.c(3),{org:t}=ue();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await he(be(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],Xe(s)}function Dr(n){const e=E.c(18),{org:t}=ue(),s=tt();let r;e[0]!==t||e[1]!==n?(r=async d=>(await(await he(be(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async d=>{const f=X.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let c;e[9]!==t||e[10]!==s||e[11]!==n?(c=(d,f,u)=>{s.invalidateQueries({queryKey:X.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=c):c=e[12];let o;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==c?(o={mutationFn:r,onMutate:i,onError:a,onSettled:c},e[13]=r,e[14]=i,e[15]=a,e[16]=c,e[17]=o):o=e[17],Xe(o)}function Rt(n){const e=E.c(26),{org:t}=ue(),s=tt();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async b=>{const w=(await Promise.allSettled(b.files.map(j=>{const C=b.dir?`${b.dir}/${j.name}`:j.name;return he(be(t.slug,n,"file",{path:C}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(Fr);if(w)throw w.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let c;e[7]!==i||e[8]!==a?(c={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=c):c=e[9];const o=Xe(c);let d;e[10]!==t||e[11]!==n?(d=async b=>{await he(be(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=Xe(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await he(be(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=Xe(m);let x;return e[22]!==u||e[23]!==p||e[24]!==o?(x={upload:o,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=o,e[25]=x):x=e[25],x}function Fr(n){return n.status==="rejected"}const vt=N.createContext(null);vt.displayName="PanelGroupContext";const te={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Gt=10,Fe=N.useLayoutEffect,sn=Es.useId,Ir=typeof sn=="function"?sn:()=>null;let Lr=0;function Xt(n=null){const e=Ir(),t=N.useRef(n||e||null);return t.current===null&&(t.current=""+Lr++),n??t.current}function Kn({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:a,maxSize:c,minSize:o,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...x}){const b=N.useContext(vt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:w,getPanelSize:j,getPanelStyle:C,groupId:S,isPanelCollapsed:v,reevaluatePanelConstraints:g,registerPanel:$,resizePanel:W,unregisterPanel:M}=b,A=Xt(a),k=N.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:c,minSize:o},id:A,idIsFromProps:a!==void 0,order:h});N.useRef({didLogMissingDefaultSizeWarning:!1}),Fe(()=>{const{callbacks:q,constraints:K}=k.current,U={...K};k.current.id=A,k.current.idIsFromProps=a!==void 0,k.current.order=h,q.onCollapse=d,q.onExpand=f,q.onResize=u,K.collapsedSize=t,K.collapsible=s,K.defaultSize=r,K.maxSize=c,K.minSize=o,(U.collapsedSize!==K.collapsedSize||U.collapsible!==K.collapsible||U.maxSize!==K.maxSize||U.minSize!==K.minSize)&&g(k.current,U)}),Fe(()=>{const q=k.current;return $(q),()=>{M(q)}},[h,A,$,M]),N.useImperativeHandle(i,()=>({collapse:()=>{y(k.current)},expand:q=>{w(k.current,q)},getId(){return A},getSize(){return j(k.current)},isCollapsed(){return v(k.current)},isExpanded(){return!v(k.current)},resize:q=>{W(k.current,q)}}),[y,w,j,v,A,W]);const G=C(k.current,r);return N.createElement(p,{...x,children:n,className:e,id:A,style:{...G,...m},[te.groupId]:S,[te.panel]:"",[te.panelCollapsible]:s||void 0,[te.panelId]:A,[te.panelSize]:parseFloat(""+G.flexGrow).toFixed(1)})}const qn=N.forwardRef((n,e)=>N.createElement(Kn,{...n,forwardedRef:e}));Kn.displayName="Panel";qn.displayName="forwardRef(Panel)";let At=null,ft=-1,Ce=null;function Mr(n,e){if(e){const t=(e&Qn)!==0,s=(e&Yn)!==0,r=(e&Zn)!==0,i=(e&Jn)!==0;if(t)return r?"se-resize":i?"ne-resize":"e-resize";if(s)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Or(){Ce!==null&&(document.head.removeChild(Ce),At=null,Ce=null,ft=-1)}function Dt(n,e){var t,s;const r=Mr(n,e);if(At!==r){if(At=r,Ce===null&&(Ce=document.createElement("style"),document.head.appendChild(Ce)),ft>=0){var i;(i=Ce.sheet)===null||i===void 0||i.removeRule(ft)}ft=(t=(s=Ce.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function Wn(n){return n.type==="keydown"}function Vn(n){return n.type.startsWith("pointer")}function Gn(n){return n.type.startsWith("mouse")}function wt(n){if(Vn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Gn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rr(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ar(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function _r(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:an(n),b:an(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;V(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:ln(rn(t.a)),b:ln(rn(t.b))};if(r.a===r.b){const i=s.childNodes,a={a:t.a.at(-1),b:t.b.at(-1)};let c=i.length;for(;c--;){const o=i[c];if(o===a.a)return 1;if(o===a.b)return-1}}return Math.sign(r.a-r.b)}const Br=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Ur(n){var e;const t=getComputedStyle((e=Xn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Hr(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Ur(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Br.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function rn(n){let e=n.length;for(;e--;){const t=n[e];if(V(t,"Missing node"),Hr(t))return t}return null}function ln(n){return n&&Number(getComputedStyle(n).zIndex)||0}function an(n){const e=[];for(;n;)e.push(n),n=Xn(n);return e}function Xn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Qn=1,Yn=2,Zn=4,Jn=8,Kr=Rr()==="coarse";let ge=[],Be=!1,De=new Map,jt=new Map;const Je=new Set;function qr(n,e,t,s,r){var i;const{ownerDocument:a}=e,c={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},o=(i=De.get(a))!==null&&i!==void 0?i:0;return De.set(a,o+1),Je.add(c),xt(),function(){var f;jt.delete(n),Je.delete(c);const u=(f=De.get(a))!==null&&f!==void 0?f:1;if(De.set(a,u-1),xt(),u===1&&De.delete(a),ge.includes(c)){const h=ge.indexOf(c);h>=0&&ge.splice(h,1),Yt(),r("up",!0,null)}}}function Wr(n){const{target:e}=n,{x:t,y:s}=wt(n);Be=!0,Qt({target:e,x:t,y:s}),xt(),ge.length>0&&(bt("down",n),n.preventDefault(),es(e)||n.stopImmediatePropagation())}function Ft(n){const{x:e,y:t}=wt(n);if(Be&&n.buttons===0&&(Be=!1,bt("up",n)),!Be){const{target:s}=n;Qt({target:s,x:e,y:t})}bt("move",n),Yt(),ge.length>0&&n.preventDefault()}function It(n){const{target:e}=n,{x:t,y:s}=wt(n);jt.clear(),Be=!1,ge.length>0&&(n.preventDefault(),es(e)||n.stopImmediatePropagation()),bt("up",n),Qt({target:e,x:t,y:s}),Yt(),xt()}function es(n){let e=n;for(;e;){if(e.hasAttribute(te.resizeHandle))return!0;e=e.parentElement}return!1}function Qt({target:n,x:e,y:t}){ge.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Je.forEach(r=>{const{element:i,hitAreaMargins:a}=r,c=i.getBoundingClientRect(),{bottom:o,left:d,right:f,top:u}=c,h=Kr?a.coarse:a.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=o+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&_r(s,i)>0){let p=s,x=!1;for(;p&&!p.contains(i);){if(Ar(p.getBoundingClientRect(),c)){x=!0;break}p=p.parentElement}if(x)return}ge.push(r)}})}function Lt(n,e){jt.set(n,e)}function Yt(){let n=!1,e=!1;ge.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;jt.forEach(s=>{t|=s}),n&&e?Dt("intersection",t):n?Dt("horizontal",t):e?Dt("vertical",t):Or()}let Mt=new AbortController;function xt(){Mt.abort(),Mt=new AbortController;const n={capture:!0,signal:Mt.signal};Je.size&&(Be?(ge.length>0&&De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",It,n),s.addEventListener("pointerleave",Ft,n),s.addEventListener("pointermove",Ft,n))}),window.addEventListener("pointerup",It,n),window.addEventListener("pointercancel",It,n)):De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Wr,n),s.addEventListener("pointermove",Ft,n))}))}function bt(n,e){Je.forEach(t=>{const{setResizeHandlerState:s}=t,r=ge.includes(t);s(n,r,e)})}function Vr(){const[n,e]=N.useState(0);return N.useCallback(()=>e(t=>t+1),[])}function V(n,e){if(!n)throw console.error(e),Error(e)}function Le(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function ke(n,e,t=Gt){return Le(n,e,t)===0}function xe(n,e,t){return Le(n,e,t)===0}function Gr(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const r=n[s],i=e[s];if(!xe(r,i,t))return!1}return!0}function _e({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];V(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:a=100,minSize:c=0}=s;if(Le(t,c)<0)if(i){const o=(r+c)/2;Le(t,o)<0?t=r:t=c}else t=c;return t=Math.min(a,t),t=parseFloat(t.toFixed(Gt)),t}function We({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(xe(n,0))return e;const a=[...e],[c,o]=s;V(c!=null,"Invalid first pivot index"),V(o!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?o:c,h=t[u];V(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:x=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),xe(b,m)){const y=x-b;Le(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}{const u=n<0?c:o,h=t[u];V(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:x=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),xe(b,x)){const y=b-m;Le(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}}{const u=n<0?1:-1;let h=n<0?o:c,m=0;for(;;){const x=e[h];V(x!=null,`Previous layout not found for panel index ${h}`);const y=_e({panelConstraints:t,panelIndex:h,size:100})-x;if(m+=y,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?c:o;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];V(p!=null,`Previous layout not found for panel index ${h}`);const x=p-m,b=_e({panelConstraints:t,panelIndex:h,size:x});if(!xe(p,b)&&(d+=p-b,a[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(Gr(r,a))return r;{const u=n<0?o:c,h=e[u];V(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=_e({panelConstraints:t,panelIndex:u,size:m});if(a[u]=p,!xe(p,m)){let x=m-p,y=n<0?o:c;for(;y>=0&&y<t.length;){const w=a[y];V(w!=null,`Previous layout not found for panel index ${y}`);const j=w+x,C=_e({panelConstraints:t,panelIndex:y,size:j});if(xe(w,C)||(x-=C-w,a[y]=C),xe(x,0))break;n>0?y--:y++}}}const f=a.reduce((u,h)=>h+u,0);return xe(f,100)?a:r}function Xr({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,a=0;const c=t[0];V(c!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:x=0}=m;h===c?(s=x,r=p):(i+=x,a+=p)});const o=Math.min(r,100-i),d=Math.max(s,100-a),f=n[c];return{valueMax:o,valueMin:d,valueNow:f}}function et(n,e=document){return Array.from(e.querySelectorAll(`[${te.resizeHandleId}][data-panel-group-id="${n}"]`))}function ts(n,e,t=document){const r=et(n,t).findIndex(i=>i.getAttribute(te.resizeHandleId)===e);return r??null}function ns(n,e,t){const s=ts(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function ss(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function kt(n,e=document){const t=e.querySelector(`[${te.resizeHandleId}="${n}"]`);return t||null}function Qr(n,e,t,s=document){var r,i,a,c;const o=kt(e,s),d=et(n,s),f=o?d.indexOf(o):-1,u=(r=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,h=(a=(c=t[f+1])===null||c===void 0?void 0:c.id)!==null&&a!==void 0?a:null;return[u,h]}function Yr({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:a}){N.useRef({didWarnAboutMissingResizeHandle:!1}),Fe(()=>{if(!i)return;const c=et(t,i);for(let o=0;o<r.length-1;o++){const{valueMax:d,valueMin:f,valueNow:u}=Xr({layout:s,panelsArray:r,pivotIndices:[o,o+1]}),h=c[o];if(h!=null){const m=r[o];V(m,`No panel data found for index "${o}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{c.forEach((o,d)=>{o.removeAttribute("aria-controls"),o.removeAttribute("aria-valuemax"),o.removeAttribute("aria-valuemin"),o.removeAttribute("aria-valuenow")})}},[t,s,r,i]),N.useEffect(()=>{if(!i)return;const c=e.current;V(c,"Eager values not found");const{panelDataArray:o}=c,d=ss(t,i);V(d!=null,`No group found for id "${t}"`);const f=et(t,i);V(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(te.resizeHandleId);V(m,"Resize handle element has no handle id attribute");const[p,x]=Qr(t,m,o,i);if(p==null||x==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const w=o.findIndex(j=>j.id===p);if(w>=0){const j=o[w];V(j,`No panel data found for index ${w}`);const C=s[w],{collapsedSize:S=0,collapsible:v,minSize:g=0}=j.constraints;if(C!=null&&v){const $=We({delta:xe(C,S)?g-S:S-C,initialLayout:s,panelConstraints:o.map(W=>W.constraints),pivotIndices:ns(t,m,i),prevLayout:s,trigger:"keyboard"});s!==$&&a($)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,r,a])}function on(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function rs(n,e){const t=n==="horizontal",{x:s,y:r}=wt(e);return t?s:r}function Zr(n,e,t,s,r){const i=t==="horizontal",a=kt(e,r);V(a,`No resize handle element found for id "${e}"`);const c=a.getAttribute(te.groupId);V(c,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=s;const d=rs(t,n),f=ss(c,r);V(f,`No group element found for id "${c}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-o)/h*100}function Jr(n,e,t,s,r,i){if(Wn(n)){const a=t==="horizontal";let c=0;n.shiftKey?c=100:r!=null?c=r:c=10;let o=0;switch(n.key){case"ArrowDown":o=a?0:c;break;case"ArrowLeft":o=a?-c:0;break;case"ArrowRight":o=a?c:0;break;case"ArrowUp":o=a?0:-c;break;case"End":o=100;break;case"Home":o=-100;break}return o}else return s==null?0:Zr(n,e,t,s,i)}function el({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,r=100;for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:c}=a;c!=null&&(s++,e[i]=c,r-=c)}for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:c}=a;if(c!=null)continue;const o=n.length-s,d=r/o;s++,e[i]=d,r-=d}return e}function Oe(n,e,t){e.forEach((s,r)=>{const i=n[r];V(i,`Panel data not found for index ${r}`);const{callbacks:a,constraints:c,id:o}=i,{collapsedSize:d=0,collapsible:f}=c,u=t[o];if(u==null||s!==u){t[o]=s;const{onCollapse:h,onExpand:m,onResize:p}=a;p&&p(s,u),f&&(h||m)&&(m&&(u==null||ke(u,d))&&!ke(s,d)&&m(),h&&(u==null||!ke(u,d))&&ke(s,d)&&h())}})}function ut(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function tl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const a=t[r];let c;return a==null?c=n!=null?n.toPrecision(i):"1":s.length===1?c="1":c=a.toPrecision(i),{flexBasis:0,flexGrow:c,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function nl(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function cn(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function ls(n){return`react-resizable-panels:${n}`}function is(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:r,order:i}=e;return r?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function as(n,e){try{const t=ls(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function sl(n,e,t){var s,r;const i=(s=as(n,t))!==null&&s!==void 0?s:{},a=is(e);return(r=i[a])!==null&&r!==void 0?r:null}function rl(n,e,t,s,r){var i;const a=ls(n),c=is(e),o=(i=as(n,r))!==null&&i!==void 0?i:{};o[c]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(a,JSON.stringify(o))}catch(d){console.error(d)}}function dn({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,a)=>i+a,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!xe(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const c=100/s*a;t[i]=c}let r=0;for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const c=_e({panelConstraints:e,panelIndex:i,size:a});a!=c&&(r+=a-c,t[i]=c)}if(!xe(r,0))for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const c=a+r,o=_e({panelConstraints:e,panelIndex:i,size:c});if(a!==o&&(r-=o-a,t[i]=o,xe(r,0)))break}return t}const ll=100,Ve={getItem:n=>(cn(Ve),Ve.getItem(n)),setItem:(n,e)=>{cn(Ve),Ve.setItem(n,e)}},un={};function os({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:a=null,keyboardResizeBy:c=null,storage:o=Ve,style:d,tagName:f="div",...u}){const h=Xt(i),m=N.useRef(null),[p,x]=N.useState(null),[b,y]=N.useState([]),w=Vr(),j=N.useRef({}),C=N.useRef(new Map),S=N.useRef(0),v=N.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:c,onLayout:a,storage:o}),g=N.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});N.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),N.useImperativeHandle(r,()=>({getId:()=>v.current.id,getLayout:()=>{const{layout:P}=g.current;return P},setLayout:P=>{const{onLayout:I}=v.current,{layout:O,panelDataArray:F}=g.current,D=dn({layout:P,panelConstraints:F.map(R=>R.constraints)});on(O,D)||(y(D),g.current.layout=D,I&&I(D),Oe(F,D,j.current))}}),[]),Fe(()=>{v.current.autoSaveId=n,v.current.direction=s,v.current.dragState=p,v.current.id=h,v.current.onLayout=a,v.current.storage=o}),Yr({committedValuesRef:v,eagerValuesRef:g,groupId:h,layout:b,panelDataArray:g.current.panelDataArray,setLayout:y,panelGroupElement:m.current}),N.useEffect(()=>{const{panelDataArray:P}=g.current;if(n){if(b.length===0||b.length!==P.length)return;let I=un[n];I==null&&(I=nl(rl,ll),un[n]=I);const O=[...P],F=new Map(C.current);I(n,O,F,b,o)}},[n,b,o]),N.useEffect(()=>{});const $=N.useCallback(P=>{const{onLayout:I}=v.current,{layout:O,panelDataArray:F}=g.current;if(P.constraints.collapsible){const D=F.map(me=>me.constraints),{collapsedSize:R=0,panelSize:Y,pivotIndices:ee}=Te(F,P,O);if(V(Y!=null,`Panel size not found for panel "${P.id}"`),!ke(Y,R)){C.current.set(P.id,Y);const pe=Re(F,P)===F.length-1?Y-R:R-Y,z=We({delta:pe,initialLayout:O,panelConstraints:D,pivotIndices:ee,prevLayout:O,trigger:"imperative-api"});ut(O,z)||(y(z),g.current.layout=z,I&&I(z),Oe(F,z,j.current))}}},[]),W=N.useCallback((P,I)=>{const{onLayout:O}=v.current,{layout:F,panelDataArray:D}=g.current;if(P.constraints.collapsible){const R=D.map(J=>J.constraints),{collapsedSize:Y=0,panelSize:ee=0,minSize:me=0,pivotIndices:pe}=Te(D,P,F),z=I??me;if(ke(ee,Y)){const J=C.current.get(P.id),ie=J!=null&&J>=z?J:z,$e=Re(D,P)===D.length-1?ee-ie:ie-ee,ae=We({delta:$e,initialLayout:F,panelConstraints:R,pivotIndices:pe,prevLayout:F,trigger:"imperative-api"});ut(F,ae)||(y(ae),g.current.layout=ae,O&&O(ae),Oe(D,ae,j.current))}}},[]),M=N.useCallback(P=>{const{layout:I,panelDataArray:O}=g.current,{panelSize:F}=Te(O,P,I);return V(F!=null,`Panel size not found for panel "${P.id}"`),F},[]),A=N.useCallback((P,I)=>{const{panelDataArray:O}=g.current,F=Re(O,P);return tl({defaultSize:I,dragState:p,layout:b,panelData:O,panelIndex:F})},[p,b]),k=N.useCallback(P=>{const{layout:I,panelDataArray:O}=g.current,{collapsedSize:F=0,collapsible:D,panelSize:R}=Te(O,P,I);return V(R!=null,`Panel size not found for panel "${P.id}"`),D===!0&&ke(R,F)},[]),G=N.useCallback(P=>{const{layout:I,panelDataArray:O}=g.current,{collapsedSize:F=0,collapsible:D,panelSize:R}=Te(O,P,I);return V(R!=null,`Panel size not found for panel "${P.id}"`),!D||Le(R,F)>0},[]),q=N.useCallback(P=>{const{panelDataArray:I}=g.current;I.push(P),I.sort((O,F)=>{const D=O.order,R=F.order;return D==null&&R==null?0:D==null?-1:R==null?1:D-R}),g.current.panelDataArrayChanged=!0,w()},[w]);Fe(()=>{if(g.current.panelDataArrayChanged){g.current.panelDataArrayChanged=!1;const{autoSaveId:P,onLayout:I,storage:O}=v.current,{layout:F,panelDataArray:D}=g.current;let R=null;if(P){const ee=sl(P,D,O);ee&&(C.current=new Map(Object.entries(ee.expandToSizes)),R=ee.layout)}R==null&&(R=el({panelDataArray:D}));const Y=dn({layout:R,panelConstraints:D.map(ee=>ee.constraints)});on(F,Y)||(y(Y),g.current.layout=Y,I&&I(Y),Oe(D,Y,j.current))}}),Fe(()=>{const P=g.current;return()=>{P.layout=[]}},[]);const K=N.useCallback(P=>{let I=!1;const O=m.current;return O&&window.getComputedStyle(O,null).getPropertyValue("direction")==="rtl"&&(I=!0),function(D){D.preventDefault();const R=m.current;if(!R)return()=>null;const{direction:Y,dragState:ee,id:me,keyboardResizeBy:pe,onLayout:z}=v.current,{layout:J,panelDataArray:ie}=g.current,{initialLayout:ye}=ee??{},$e=ns(me,P,R);let ae=Jr(D,P,Y,ee,pe,R);const Ke=Y==="horizontal";Ke&&I&&(ae=-ae);const $t=ie.map(Et=>Et.constraints),Ee=We({delta:ae,initialLayout:ye??J,panelConstraints:$t,pivotIndices:$e,prevLayout:J,trigger:Wn(D)?"keyboard":"mouse-or-touch"}),ot=!ut(J,Ee);(Vn(D)||Gn(D))&&S.current!=ae&&(S.current=ae,!ot&&ae!==0?Ke?Lt(P,ae<0?Qn:Yn):Lt(P,ae<0?Zn:Jn):Lt(P,0)),ot&&(y(Ee),g.current.layout=Ee,z&&z(Ee),Oe(ie,Ee,j.current))}},[]),U=N.useCallback((P,I)=>{const{onLayout:O}=v.current,{layout:F,panelDataArray:D}=g.current,R=D.map(J=>J.constraints),{panelSize:Y,pivotIndices:ee}=Te(D,P,F);V(Y!=null,`Panel size not found for panel "${P.id}"`);const pe=Re(D,P)===D.length-1?Y-I:I-Y,z=We({delta:pe,initialLayout:F,panelConstraints:R,pivotIndices:ee,prevLayout:F,trigger:"imperative-api"});ut(F,z)||(y(z),g.current.layout=z,O&&O(z),Oe(D,z,j.current))},[]),H=N.useCallback((P,I)=>{const{layout:O,panelDataArray:F}=g.current,{collapsedSize:D=0,collapsible:R}=I,{collapsedSize:Y=0,collapsible:ee,maxSize:me=100,minSize:pe=0}=P.constraints,{panelSize:z}=Te(F,P,O);z!=null&&(R&&ee&&ke(z,D)?ke(D,Y)||U(P,Y):z<pe?U(P,pe):z>me&&U(P,me))},[U]),_=N.useCallback((P,I)=>{const{direction:O}=v.current,{layout:F}=g.current;if(!m.current)return;const D=kt(P,m.current);V(D,`Drag handle element not found for id "${P}"`);const R=rs(O,I);x({dragHandleId:P,dragHandleRect:D.getBoundingClientRect(),initialCursorPosition:R,initialLayout:F})},[]),Q=N.useCallback(()=>{x(null)},[]),le=N.useCallback(P=>{const{panelDataArray:I}=g.current,O=Re(I,P);O>=0&&(I.splice(O,1),delete j.current[P.id],g.current.panelDataArrayChanged=!0,w())},[w]),T=N.useMemo(()=>({collapsePanel:$,direction:s,dragState:p,expandPanel:W,getPanelSize:M,getPanelStyle:A,groupId:h,isPanelCollapsed:k,isPanelExpanded:G,reevaluatePanelConstraints:H,registerPanel:q,registerResizeHandle:K,resizePanel:U,startDragging:_,stopDragging:Q,unregisterPanel:le,panelGroupElement:m.current}),[$,p,s,W,M,A,h,k,G,H,q,K,U,_,Q,le]),B={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return N.createElement(vt.Provider,{value:T},N.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...B,...d},[te.group]:"",[te.groupDirection]:s,[te.groupId]:h}))}const cs=N.forwardRef((n,e)=>N.createElement(os,{...n,forwardedRef:e}));os.displayName="PanelGroup";cs.displayName="forwardRef(PanelGroup)";function Re(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Te(n,e,t){const s=Re(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],a=t[s];return{...e.constraints,panelSize:a,pivotIndices:i}}function il({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){N.useEffect(()=>{if(n||t==null||s==null)return;const r=kt(e,s);if(r==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),t(a);break}case"F6":{a.preventDefault();const c=r.getAttribute(te.groupId);V(c,`No group element found for id "${c}"`);const o=et(c,s),d=ts(c,e,s);V(d!==null,`No resize element found for id "${e}"`);const f=a.shiftKey?d>0?d-1:o.length-1:d+1<o.length?d+1:0;o[f].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[s,n,e,t])}function ds({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:a,onDragging:c,onFocus:o,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var x,b;const y=N.useRef(null),w=N.useRef({onClick:a,onDragging:c,onPointerDown:d,onPointerUp:f});N.useEffect(()=>{w.current.onClick=a,w.current.onDragging=c,w.current.onPointerDown=d,w.current.onPointerUp=f});const j=N.useContext(vt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:C,groupId:S,registerResizeHandle:v,startDragging:g,stopDragging:$,panelGroupElement:W}=j,M=Xt(r),[A,k]=N.useState("inactive"),[G,q]=N.useState(!1),[K,U]=N.useState(null),H=N.useRef({state:A});Fe(()=>{H.current.state=A}),N.useEffect(()=>{if(t)U(null);else{const T=v(M);U(()=>T)}},[t,M,v]);const _=(x=s?.coarse)!==null&&x!==void 0?x:15,Q=(b=s?.fine)!==null&&b!==void 0?b:5;N.useEffect(()=>{if(t||K==null)return;const T=y.current;V(T,"Element ref not attached");let B=!1;return qr(M,T,C,{coarse:_,fine:Q},(I,O,F)=>{if(!O){k("inactive");return}switch(I){case"down":{k("drag"),B=!1,V(F,'Expected event to be defined for "down" action'),g(M,F);const{onDragging:D,onPointerDown:R}=w.current;D?.(!0),R?.();break}case"move":{const{state:D}=H.current;B=!0,D!=="drag"&&k("hover"),V(F,'Expected event to be defined for "move" action'),K(F);break}case"up":{k("hover"),$();const{onClick:D,onDragging:R,onPointerUp:Y}=w.current;R?.(!1),Y?.(),B||D?.();break}}})},[_,C,t,Q,v,M,K,g,$]),il({disabled:t,handleId:M,resizeHandler:K,panelGroupElement:W});const le={touchAction:"none",userSelect:"none"};return N.createElement(m,{...p,children:n,className:e,id:r,onBlur:()=>{q(!1),i?.()},onFocus:()=>{q(!0),o?.()},ref:y,role:"separator",style:{...le,...u},tabIndex:h,[te.groupDirection]:C,[te.groupId]:S,[te.resizeHandle]:"",[te.resizeHandleActive]:A==="drag"?"pointer":G?"keyboard":void 0,[te.resizeHandleEnabled]:!t,[te.resizeHandleId]:M,[te.resizeHandleState]:A})}ds.displayName="PanelResizeHandle";function al(n){const e=E.c(10);let t,s,r;e[0]!==n?({className:t,ref:r,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let a;return e[6]!==s||e[7]!==r||e[8]!==i?(a=l.jsx(cs,{ref:r,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=r,e[8]=i,e[9]=a):a=e[9],a}function fn(n){const e=E.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(qn,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function ol(n){const e=E.c(12);let t,s,r;e[0]!==n?({withHandle:r,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r?(a=r&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(Zs,{className:"size-2.5"})}),e[6]=r,e[7]=a):a=e[7];let c;return e[8]!==s||e[9]!==i||e[10]!==a?(c=l.jsx(ds,{"data-slot":"resizable-handle",className:i,...s,children:a}),e[8]=s,e[9]=i,e[10]=a,e[11]=c):c=e[11],c}function cl(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function dl(n){if(cl(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function ul(n){try{return decodeURIComponent(n)}catch{return n}}function fl(n){return dl(n),encodeURIComponent(n)}function hl(n){return`.deco/blocks/${fl(n)}.json`}function Ua(n){return`/${hl(n)}`}const Ha=1e4,ml=3;function _t(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function St(n){return n.startsWith("/")?n.slice(1):n}function Ka(n){const e=St(n);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}function He(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function pl(n){const e=He(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function qa(n,e){const t=e.replace(/^\/+|\/+$/g,"");return He(t?`${n==="/"?"":n}/${t}`:n)}function Wa(n,e){return e==="directory"?n:pl(n)}function Va(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function xl(n){const e=St(n);return e?e.split("/").filter(Boolean).length:0}function Ga(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Xa(n,e){return xl(n)>=ml&&!e.has(n)}function Qa(n,e,t=[]){const s=St(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const r=`${s}/`;return e.some(i=>i.startsWith(r))||t.some(i=>i.startsWith(r))}function Ya(n){const e=St(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return ul(s)}function bl(n){if(!n)return"plaintext";const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}const gl="#94a3b8";function Za(n){const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:dt,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:dt,color:"#d9a441"}:e.endsWith(".json")?{Icon:Js,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:dt,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:dt,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:pr,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:nn,color:"#64748b"}:{Icon:nn,color:gl}}function Ja(n){const e=_t(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function eo(n,e=[]){const t={path:"/",children:[]},s=new Map,r=c=>{let o=s.get(c.path);return o||(o=new Map,s.set(c.path,o)),o},i=c=>{const d=_t(c).split("/").filter(Boolean);let f=t,u="";for(const h of d){u+=`/${h}`;const m=r(f);let p=m.get(h);p?p.kind==="file"&&(p.kind="directory"):(p={name:h,path:u,kind:"directory",children:[]},f.children.push(p),m.set(h,p)),f=p}};for(const c of n){const d=_t(c).split("/").filter(Boolean);let f=t,u="";d.forEach((h,m)=>{u+=`/${h}`;const p=m===d.length-1,x=r(f);let b=x.get(h);b||(b={name:h,path:u,kind:p?"file":"directory",children:[]},f.children.push(b),x.set(h,b)),f=b})}for(const c of e)i(He(c));const a=c=>{c.sort((o,d)=>o.kind!==d.kind?o.kind==="directory"?-1:1:o.name.localeCompare(d.name));for(const o of c)o.children.length>0&&a(o.children)};return a(t.children),t.children}function yl(n,e,t=0){const s=[];for(const r of n)r.name!==".gitkeep"&&(s.push({node:r,depth:t}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&s.push(...yl(r.children,e,t+1)));return s}function to(n){const e=[];for(const t of n.split(`
|
|
1
|
+
import{c as E,F as ue,o as tt,e as Xe,K as X,n as oe,aU as kn,r as N,ab as Es,m as de,j as l,v as Ts,k as Ds,B as Z,b as se,av as Sn,t as fe,y as Fs,L as Is,f as Ls,d as Nn,u as Pn,E as Tt}from"./index-C7paW5qO.js";import{s as Cn}from"./Eye-BBuEG2Wd.js";import{a as ht}from"./Palette-BWnu1KwQ.js";import{s as Ms}from"./Plus-CyjW8iPH.js";import{i as Os}from"./SearchLg-B2jol46R.js";import{i as mt}from"./Upload01-BubHQTIU.js";import{s as zn}from"./XClose-CcoerXx4.js";import{i as Ut}from"./Zap-BF-fUeLE.js";import{u as $n}from"./use-mobile-CWC5nRCB.js";import{A as Rs,a as As,b as _s,c as Bs,d as Us,e as Hs,f as Ks,g as qs}from"./alert-dialog-BWhpN8gU.js";import{a as En,b as Ue,d as nt,e as st,i as Tn,h as Ws,c as Vs}from"./dialog-CKP-t2d8.js";import{I as Ye}from"./input-B7NjdaWP.js";import{F as Ne,M as Ht,d as Dn}from"./file-type-icon-BlvOD0PX.js";import{T as Gs}from"./toolbar-BCd7IYjs.js";import{a as Xs}from"./Package-fVT5gTF_.js";import{u as Qs}from"./use-debounced-value-DbPd-3pt.js";import{p as gt,b as ne,a as Me,c as Fn,d as Ys}from"./location-BpLtHjTZ.js";import{c as Zs,f as dt,s as Js,b as nn,d as er,g as tr,i as nr,h as In,a as Ln,j as sr,e as rr}from"./ZoomOut-B_jcciLR.js";import{S as ce}from"./skeleton-C6T-49IJ.js";import{T as lr}from"./textarea-Cu9wZQ0x.js";import{t as ir}from"./ChevronDown-Bx3JuxA4.js";import{n as ar}from"./ChevronUp-Dq6n-X7O.js";import{i as pt}from"./X-HQl8Aj_L.js";import{a as or,b as cr,P as dr}from"./popover-BARdtmQ6.js";import{c as ve,T as we,a as je}from"./tooltip-Du-iZy7N.js";import{i as ur}from"./Check-BdLBTBRG.js";import{a as fr}from"./Copy01-XmlYTCnq.js";import{n as Ze,i as yt}from"./Globe01-C4KqixhG.js";import{i as Mn}from"./Key01-FIEtfPiH.js";import{n as On}from"./LinkExternal01-DunixMNV.js";import{l as hr,F as mr}from"./index-CeSX2hgY.js";import{a as pr}from"./Image01-DVjQLwZ-.js";import{c as Kt,D as qt,b as Wt,a as Ie}from"./dropdown-menu-ylG9Kkc3.js";import{i as xr}from"./LayoutLeft-Dnm3NgQz.js";import{i as br}from"./ChevronRight-CFrIQqny.js";import{t as gr}from"./Stars01-DipJVSzo.js";import{a as Rn}from"./DotsVertical-ws7g1gHH.js";import{s as An}from"./Trash01-BepZYT7H.js";function _n(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function be(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function he(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Vt(n,e){const t=E.c(11),{org:s}=ue();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=X.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=r):r=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await he(be(s.slug,n,"list",{path:e}))).json()).entries.toSorted(yr),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let a;return t[8]!==r||t[9]!==i?(a={queryKey:r,placeholderData:kn,queryFn:i},t[8]=r,t[9]=i,t[10]=a):a=t[10],oe(a)}function yr(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function Bn(n,e,t){const s=E.c(15),{org:r}=ue();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=X.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let o;s[6]!==r.slug||s[7]!==e||s[8]!==n?(o=async()=>{const f=await he(be(r.slug,n??"","stat",{path:e}),void 0,{allow404:!0});return f.status===404?null:(await f.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=o):o=s[9];let d;return s[10]!==i||s[11]!==a||s[12]!==c||s[13]!==o?(d={queryKey:i,enabled:a,refetchInterval:c,queryFn:o},s[10]=i,s[11]=a,s[12]=c,s[13]=o,s[14]=d):d=s[14],oe(d)}function vr(n){const e=E.c(9),{org:t}=ue();let s;e[0]!==t.id||e[1]!==n?(s=X.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async()=>await(await he(be(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,queryFn:r},e[6]=s,e[7]=r,e[8]=i):i=e[8],oe(i)}function wr(n,e){const t=E.c(9),s=n===void 0?60:n,{org:r}=ue();let i;t[0]!==r.id?(i=X.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let c;t[2]!==s||t[3]!==r.slug?(c=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=c):c=t[4];let o;return t[5]!==i||t[6]!==a||t[7]!==c?(o={queryKey:i,enabled:a,queryFn:c},t[5]=i,t[6]=a,t[7]=c,t[8]=o):o=t[8],oe(o)}function jr(n,e){const t=E.c(11),s=50,{org:r}=ue();let i;t[0]!==r.id||t[1]!==n?(i=X.orgFsSearch(r.id,n),t[0]=r.id,t[1]=n,t[2]=i):i=t[2];const a=n.length>0;let c;t[3]!==s||t[4]!==r.slug||t[5]!==n?(c=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=r.slug,t[5]=n,t[6]=c):c=t[6];let o;return t[7]!==i||t[8]!==a||t[9]!==c?(o={queryKey:i,enabled:a,placeholderData:kn,queryFn:c},t[7]=i,t[8]=a,t[9]=c,t[10]=o):o=t[10],oe(o)}function Aa(n){const e=E.c(8),{org:t}=ue();let s;e[0]!==t.id?(s=X.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const c=await he(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:o}=await c.json();return o.map(kr)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],oe(a)}function kr(n){return{volume:n.volume,path:n.path}}async function _a(n){const e=await he(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function Sr(n,e,t){return(await he(be(n,e,"read",{path:t}))).text()}const Nr=new Set(["md","mdx","markdown","txt","text"]),Pr=25,Cr=64*1024,zr=256*1024,$r=4;function Er(n){const e=n.lastIndexOf(".");return e===-1?!1:Nr.has(n.slice(e+1).toLowerCase())}async function Ba(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],c=[{path:t,depth:0}];for(;c.length>0;){const u=c.shift();if(!u)break;let h;try{h=(await(await he(be(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,x)=>p.path.localeCompare(x.path))){if(m.kind==="dir"){u.depth<$r&&c.push({path:m.path,depth:u.depth+1});continue}Er(m.path)&&m.size<=Cr&&i.length<Pr?i.push(m.path):a.push(r(m.path))}}const o=await Promise.all(i.map(u=>Sr(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=o[h];if(m==null||f+m.length>zr){a.push(r(u));return}f+=m.length,d.push({relPath:r(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),a.sort(),{files:d,omittedPaths:a}}function Un(){const n=E.c(7),{org:e}=ue();let t;n[0]!==e.id?(t=X.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await he(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],oe(r)}function Tr(n){const e=E.c(3),{org:t}=ue();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>be(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function rt(){const n=E.c(2),{org:e}=ue();let t;return n[0]!==e.slug?(t=(s,r)=>be(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function Hn(n){const e=E.c(3),{org:t}=ue();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await he(be(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],Xe(s)}function Dr(n){const e=E.c(18),{org:t}=ue(),s=tt();let r;e[0]!==t||e[1]!==n?(r=async d=>(await(await he(be(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async d=>{const f=X.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let c;e[9]!==t||e[10]!==s||e[11]!==n?(c=(d,f,u)=>{s.invalidateQueries({queryKey:X.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=c):c=e[12];let o;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==c?(o={mutationFn:r,onMutate:i,onError:a,onSettled:c},e[13]=r,e[14]=i,e[15]=a,e[16]=c,e[17]=o):o=e[17],Xe(o)}function Rt(n){const e=E.c(26),{org:t}=ue(),s=tt();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:X.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:X.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:X.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async b=>{const w=(await Promise.allSettled(b.files.map(j=>{const C=b.dir?`${b.dir}/${j.name}`:j.name;return he(be(t.slug,n,"file",{path:C}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(Fr);if(w)throw w.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let c;e[7]!==i||e[8]!==a?(c={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=c):c=e[9];const o=Xe(c);let d;e[10]!==t||e[11]!==n?(d=async b=>{await he(be(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=Xe(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await he(be(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=Xe(m);let x;return e[22]!==u||e[23]!==p||e[24]!==o?(x={upload:o,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=o,e[25]=x):x=e[25],x}function Fr(n){return n.status==="rejected"}const vt=N.createContext(null);vt.displayName="PanelGroupContext";const te={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Gt=10,Fe=N.useLayoutEffect,sn=Es.useId,Ir=typeof sn=="function"?sn:()=>null;let Lr=0;function Xt(n=null){const e=Ir(),t=N.useRef(n||e||null);return t.current===null&&(t.current=""+Lr++),n??t.current}function Kn({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:a,maxSize:c,minSize:o,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...x}){const b=N.useContext(vt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:w,getPanelSize:j,getPanelStyle:C,groupId:S,isPanelCollapsed:v,reevaluatePanelConstraints:g,registerPanel:$,resizePanel:W,unregisterPanel:M}=b,A=Xt(a),k=N.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:c,minSize:o},id:A,idIsFromProps:a!==void 0,order:h});N.useRef({didLogMissingDefaultSizeWarning:!1}),Fe(()=>{const{callbacks:q,constraints:K}=k.current,U={...K};k.current.id=A,k.current.idIsFromProps=a!==void 0,k.current.order=h,q.onCollapse=d,q.onExpand=f,q.onResize=u,K.collapsedSize=t,K.collapsible=s,K.defaultSize=r,K.maxSize=c,K.minSize=o,(U.collapsedSize!==K.collapsedSize||U.collapsible!==K.collapsible||U.maxSize!==K.maxSize||U.minSize!==K.minSize)&&g(k.current,U)}),Fe(()=>{const q=k.current;return $(q),()=>{M(q)}},[h,A,$,M]),N.useImperativeHandle(i,()=>({collapse:()=>{y(k.current)},expand:q=>{w(k.current,q)},getId(){return A},getSize(){return j(k.current)},isCollapsed(){return v(k.current)},isExpanded(){return!v(k.current)},resize:q=>{W(k.current,q)}}),[y,w,j,v,A,W]);const G=C(k.current,r);return N.createElement(p,{...x,children:n,className:e,id:A,style:{...G,...m},[te.groupId]:S,[te.panel]:"",[te.panelCollapsible]:s||void 0,[te.panelId]:A,[te.panelSize]:parseFloat(""+G.flexGrow).toFixed(1)})}const qn=N.forwardRef((n,e)=>N.createElement(Kn,{...n,forwardedRef:e}));Kn.displayName="Panel";qn.displayName="forwardRef(Panel)";let At=null,ft=-1,Ce=null;function Mr(n,e){if(e){const t=(e&Qn)!==0,s=(e&Yn)!==0,r=(e&Zn)!==0,i=(e&Jn)!==0;if(t)return r?"se-resize":i?"ne-resize":"e-resize";if(s)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Or(){Ce!==null&&(document.head.removeChild(Ce),At=null,Ce=null,ft=-1)}function Dt(n,e){var t,s;const r=Mr(n,e);if(At!==r){if(At=r,Ce===null&&(Ce=document.createElement("style"),document.head.appendChild(Ce)),ft>=0){var i;(i=Ce.sheet)===null||i===void 0||i.removeRule(ft)}ft=(t=(s=Ce.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function Wn(n){return n.type==="keydown"}function Vn(n){return n.type.startsWith("pointer")}function Gn(n){return n.type.startsWith("mouse")}function wt(n){if(Vn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Gn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Rr(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ar(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function _r(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:an(n),b:an(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;V(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:ln(rn(t.a)),b:ln(rn(t.b))};if(r.a===r.b){const i=s.childNodes,a={a:t.a.at(-1),b:t.b.at(-1)};let c=i.length;for(;c--;){const o=i[c];if(o===a.a)return 1;if(o===a.b)return-1}}return Math.sign(r.a-r.b)}const Br=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Ur(n){var e;const t=getComputedStyle((e=Xn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Hr(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Ur(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Br.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function rn(n){let e=n.length;for(;e--;){const t=n[e];if(V(t,"Missing node"),Hr(t))return t}return null}function ln(n){return n&&Number(getComputedStyle(n).zIndex)||0}function an(n){const e=[];for(;n;)e.push(n),n=Xn(n);return e}function Xn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Qn=1,Yn=2,Zn=4,Jn=8,Kr=Rr()==="coarse";let ge=[],Be=!1,De=new Map,jt=new Map;const Je=new Set;function qr(n,e,t,s,r){var i;const{ownerDocument:a}=e,c={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},o=(i=De.get(a))!==null&&i!==void 0?i:0;return De.set(a,o+1),Je.add(c),xt(),function(){var f;jt.delete(n),Je.delete(c);const u=(f=De.get(a))!==null&&f!==void 0?f:1;if(De.set(a,u-1),xt(),u===1&&De.delete(a),ge.includes(c)){const h=ge.indexOf(c);h>=0&&ge.splice(h,1),Yt(),r("up",!0,null)}}}function Wr(n){const{target:e}=n,{x:t,y:s}=wt(n);Be=!0,Qt({target:e,x:t,y:s}),xt(),ge.length>0&&(bt("down",n),n.preventDefault(),es(e)||n.stopImmediatePropagation())}function Ft(n){const{x:e,y:t}=wt(n);if(Be&&n.buttons===0&&(Be=!1,bt("up",n)),!Be){const{target:s}=n;Qt({target:s,x:e,y:t})}bt("move",n),Yt(),ge.length>0&&n.preventDefault()}function It(n){const{target:e}=n,{x:t,y:s}=wt(n);jt.clear(),Be=!1,ge.length>0&&(n.preventDefault(),es(e)||n.stopImmediatePropagation()),bt("up",n),Qt({target:e,x:t,y:s}),Yt(),xt()}function es(n){let e=n;for(;e;){if(e.hasAttribute(te.resizeHandle))return!0;e=e.parentElement}return!1}function Qt({target:n,x:e,y:t}){ge.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Je.forEach(r=>{const{element:i,hitAreaMargins:a}=r,c=i.getBoundingClientRect(),{bottom:o,left:d,right:f,top:u}=c,h=Kr?a.coarse:a.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=o+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&_r(s,i)>0){let p=s,x=!1;for(;p&&!p.contains(i);){if(Ar(p.getBoundingClientRect(),c)){x=!0;break}p=p.parentElement}if(x)return}ge.push(r)}})}function Lt(n,e){jt.set(n,e)}function Yt(){let n=!1,e=!1;ge.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;jt.forEach(s=>{t|=s}),n&&e?Dt("intersection",t):n?Dt("horizontal",t):e?Dt("vertical",t):Or()}let Mt=new AbortController;function xt(){Mt.abort(),Mt=new AbortController;const n={capture:!0,signal:Mt.signal};Je.size&&(Be?(ge.length>0&&De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",It,n),s.addEventListener("pointerleave",Ft,n),s.addEventListener("pointermove",Ft,n))}),window.addEventListener("pointerup",It,n),window.addEventListener("pointercancel",It,n)):De.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Wr,n),s.addEventListener("pointermove",Ft,n))}))}function bt(n,e){Je.forEach(t=>{const{setResizeHandlerState:s}=t,r=ge.includes(t);s(n,r,e)})}function Vr(){const[n,e]=N.useState(0);return N.useCallback(()=>e(t=>t+1),[])}function V(n,e){if(!n)throw console.error(e),Error(e)}function Le(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function ke(n,e,t=Gt){return Le(n,e,t)===0}function xe(n,e,t){return Le(n,e,t)===0}function Gr(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const r=n[s],i=e[s];if(!xe(r,i,t))return!1}return!0}function _e({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];V(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:a=100,minSize:c=0}=s;if(Le(t,c)<0)if(i){const o=(r+c)/2;Le(t,o)<0?t=r:t=c}else t=c;return t=Math.min(a,t),t=parseFloat(t.toFixed(Gt)),t}function We({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(xe(n,0))return e;const a=[...e],[c,o]=s;V(c!=null,"Invalid first pivot index"),V(o!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?o:c,h=t[u];V(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:x=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),xe(b,m)){const y=x-b;Le(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}{const u=n<0?c:o,h=t[u];V(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:x=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),xe(b,x)){const y=b-m;Le(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}}{const u=n<0?1:-1;let h=n<0?o:c,m=0;for(;;){const x=e[h];V(x!=null,`Previous layout not found for panel index ${h}`);const y=_e({panelConstraints:t,panelIndex:h,size:100})-x;if(m+=y,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?c:o;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];V(p!=null,`Previous layout not found for panel index ${h}`);const x=p-m,b=_e({panelConstraints:t,panelIndex:h,size:x});if(!xe(p,b)&&(d+=p-b,a[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(Gr(r,a))return r;{const u=n<0?o:c,h=e[u];V(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=_e({panelConstraints:t,panelIndex:u,size:m});if(a[u]=p,!xe(p,m)){let x=m-p,y=n<0?o:c;for(;y>=0&&y<t.length;){const w=a[y];V(w!=null,`Previous layout not found for panel index ${y}`);const j=w+x,C=_e({panelConstraints:t,panelIndex:y,size:j});if(xe(w,C)||(x-=C-w,a[y]=C),xe(x,0))break;n>0?y--:y++}}}const f=a.reduce((u,h)=>h+u,0);return xe(f,100)?a:r}function Xr({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,a=0;const c=t[0];V(c!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:x=0}=m;h===c?(s=x,r=p):(i+=x,a+=p)});const o=Math.min(r,100-i),d=Math.max(s,100-a),f=n[c];return{valueMax:o,valueMin:d,valueNow:f}}function et(n,e=document){return Array.from(e.querySelectorAll(`[${te.resizeHandleId}][data-panel-group-id="${n}"]`))}function ts(n,e,t=document){const r=et(n,t).findIndex(i=>i.getAttribute(te.resizeHandleId)===e);return r??null}function ns(n,e,t){const s=ts(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function ss(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function kt(n,e=document){const t=e.querySelector(`[${te.resizeHandleId}="${n}"]`);return t||null}function Qr(n,e,t,s=document){var r,i,a,c;const o=kt(e,s),d=et(n,s),f=o?d.indexOf(o):-1,u=(r=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,h=(a=(c=t[f+1])===null||c===void 0?void 0:c.id)!==null&&a!==void 0?a:null;return[u,h]}function Yr({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:a}){N.useRef({didWarnAboutMissingResizeHandle:!1}),Fe(()=>{if(!i)return;const c=et(t,i);for(let o=0;o<r.length-1;o++){const{valueMax:d,valueMin:f,valueNow:u}=Xr({layout:s,panelsArray:r,pivotIndices:[o,o+1]}),h=c[o];if(h!=null){const m=r[o];V(m,`No panel data found for index "${o}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{c.forEach((o,d)=>{o.removeAttribute("aria-controls"),o.removeAttribute("aria-valuemax"),o.removeAttribute("aria-valuemin"),o.removeAttribute("aria-valuenow")})}},[t,s,r,i]),N.useEffect(()=>{if(!i)return;const c=e.current;V(c,"Eager values not found");const{panelDataArray:o}=c,d=ss(t,i);V(d!=null,`No group found for id "${t}"`);const f=et(t,i);V(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(te.resizeHandleId);V(m,"Resize handle element has no handle id attribute");const[p,x]=Qr(t,m,o,i);if(p==null||x==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const w=o.findIndex(j=>j.id===p);if(w>=0){const j=o[w];V(j,`No panel data found for index ${w}`);const C=s[w],{collapsedSize:S=0,collapsible:v,minSize:g=0}=j.constraints;if(C!=null&&v){const $=We({delta:xe(C,S)?g-S:S-C,initialLayout:s,panelConstraints:o.map(W=>W.constraints),pivotIndices:ns(t,m,i),prevLayout:s,trigger:"keyboard"});s!==$&&a($)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,r,a])}function on(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function rs(n,e){const t=n==="horizontal",{x:s,y:r}=wt(e);return t?s:r}function Zr(n,e,t,s,r){const i=t==="horizontal",a=kt(e,r);V(a,`No resize handle element found for id "${e}"`);const c=a.getAttribute(te.groupId);V(c,"Resize handle element has no group id attribute");let{initialCursorPosition:o}=s;const d=rs(t,n),f=ss(c,r);V(f,`No group element found for id "${c}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-o)/h*100}function Jr(n,e,t,s,r,i){if(Wn(n)){const a=t==="horizontal";let c=0;n.shiftKey?c=100:r!=null?c=r:c=10;let o=0;switch(n.key){case"ArrowDown":o=a?0:c;break;case"ArrowLeft":o=a?-c:0;break;case"ArrowRight":o=a?c:0;break;case"ArrowUp":o=a?0:-c;break;case"End":o=100;break;case"Home":o=-100;break}return o}else return s==null?0:Zr(n,e,t,s,i)}function el({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,r=100;for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:c}=a;c!=null&&(s++,e[i]=c,r-=c)}for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:c}=a;if(c!=null)continue;const o=n.length-s,d=r/o;s++,e[i]=d,r-=d}return e}function Oe(n,e,t){e.forEach((s,r)=>{const i=n[r];V(i,`Panel data not found for index ${r}`);const{callbacks:a,constraints:c,id:o}=i,{collapsedSize:d=0,collapsible:f}=c,u=t[o];if(u==null||s!==u){t[o]=s;const{onCollapse:h,onExpand:m,onResize:p}=a;p&&p(s,u),f&&(h||m)&&(m&&(u==null||ke(u,d))&&!ke(s,d)&&m(),h&&(u==null||!ke(u,d))&&ke(s,d)&&h())}})}function ut(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function tl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const a=t[r];let c;return a==null?c=n!=null?n.toPrecision(i):"1":s.length===1?c="1":c=a.toPrecision(i),{flexBasis:0,flexGrow:c,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function nl(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function cn(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function ls(n){return`react-resizable-panels:${n}`}function is(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:r,order:i}=e;return r?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function as(n,e){try{const t=ls(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function sl(n,e,t){var s,r;const i=(s=as(n,t))!==null&&s!==void 0?s:{},a=is(e);return(r=i[a])!==null&&r!==void 0?r:null}function rl(n,e,t,s,r){var i;const a=ls(n),c=is(e),o=(i=as(n,r))!==null&&i!==void 0?i:{};o[c]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(a,JSON.stringify(o))}catch(d){console.error(d)}}function dn({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,a)=>i+a,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!xe(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const c=100/s*a;t[i]=c}let r=0;for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const c=_e({panelConstraints:e,panelIndex:i,size:a});a!=c&&(r+=a-c,t[i]=c)}if(!xe(r,0))for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const c=a+r,o=_e({panelConstraints:e,panelIndex:i,size:c});if(a!==o&&(r-=o-a,t[i]=o,xe(r,0)))break}return t}const ll=100,Ve={getItem:n=>(cn(Ve),Ve.getItem(n)),setItem:(n,e)=>{cn(Ve),Ve.setItem(n,e)}},un={};function os({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:a=null,keyboardResizeBy:c=null,storage:o=Ve,style:d,tagName:f="div",...u}){const h=Xt(i),m=N.useRef(null),[p,x]=N.useState(null),[b,y]=N.useState([]),w=Vr(),j=N.useRef({}),C=N.useRef(new Map),S=N.useRef(0),v=N.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:c,onLayout:a,storage:o}),g=N.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});N.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),N.useImperativeHandle(r,()=>({getId:()=>v.current.id,getLayout:()=>{const{layout:P}=g.current;return P},setLayout:P=>{const{onLayout:I}=v.current,{layout:O,panelDataArray:F}=g.current,D=dn({layout:P,panelConstraints:F.map(R=>R.constraints)});on(O,D)||(y(D),g.current.layout=D,I&&I(D),Oe(F,D,j.current))}}),[]),Fe(()=>{v.current.autoSaveId=n,v.current.direction=s,v.current.dragState=p,v.current.id=h,v.current.onLayout=a,v.current.storage=o}),Yr({committedValuesRef:v,eagerValuesRef:g,groupId:h,layout:b,panelDataArray:g.current.panelDataArray,setLayout:y,panelGroupElement:m.current}),N.useEffect(()=>{const{panelDataArray:P}=g.current;if(n){if(b.length===0||b.length!==P.length)return;let I=un[n];I==null&&(I=nl(rl,ll),un[n]=I);const O=[...P],F=new Map(C.current);I(n,O,F,b,o)}},[n,b,o]),N.useEffect(()=>{});const $=N.useCallback(P=>{const{onLayout:I}=v.current,{layout:O,panelDataArray:F}=g.current;if(P.constraints.collapsible){const D=F.map(me=>me.constraints),{collapsedSize:R=0,panelSize:Y,pivotIndices:ee}=Te(F,P,O);if(V(Y!=null,`Panel size not found for panel "${P.id}"`),!ke(Y,R)){C.current.set(P.id,Y);const pe=Re(F,P)===F.length-1?Y-R:R-Y,z=We({delta:pe,initialLayout:O,panelConstraints:D,pivotIndices:ee,prevLayout:O,trigger:"imperative-api"});ut(O,z)||(y(z),g.current.layout=z,I&&I(z),Oe(F,z,j.current))}}},[]),W=N.useCallback((P,I)=>{const{onLayout:O}=v.current,{layout:F,panelDataArray:D}=g.current;if(P.constraints.collapsible){const R=D.map(J=>J.constraints),{collapsedSize:Y=0,panelSize:ee=0,minSize:me=0,pivotIndices:pe}=Te(D,P,F),z=I??me;if(ke(ee,Y)){const J=C.current.get(P.id),ie=J!=null&&J>=z?J:z,$e=Re(D,P)===D.length-1?ee-ie:ie-ee,ae=We({delta:$e,initialLayout:F,panelConstraints:R,pivotIndices:pe,prevLayout:F,trigger:"imperative-api"});ut(F,ae)||(y(ae),g.current.layout=ae,O&&O(ae),Oe(D,ae,j.current))}}},[]),M=N.useCallback(P=>{const{layout:I,panelDataArray:O}=g.current,{panelSize:F}=Te(O,P,I);return V(F!=null,`Panel size not found for panel "${P.id}"`),F},[]),A=N.useCallback((P,I)=>{const{panelDataArray:O}=g.current,F=Re(O,P);return tl({defaultSize:I,dragState:p,layout:b,panelData:O,panelIndex:F})},[p,b]),k=N.useCallback(P=>{const{layout:I,panelDataArray:O}=g.current,{collapsedSize:F=0,collapsible:D,panelSize:R}=Te(O,P,I);return V(R!=null,`Panel size not found for panel "${P.id}"`),D===!0&&ke(R,F)},[]),G=N.useCallback(P=>{const{layout:I,panelDataArray:O}=g.current,{collapsedSize:F=0,collapsible:D,panelSize:R}=Te(O,P,I);return V(R!=null,`Panel size not found for panel "${P.id}"`),!D||Le(R,F)>0},[]),q=N.useCallback(P=>{const{panelDataArray:I}=g.current;I.push(P),I.sort((O,F)=>{const D=O.order,R=F.order;return D==null&&R==null?0:D==null?-1:R==null?1:D-R}),g.current.panelDataArrayChanged=!0,w()},[w]);Fe(()=>{if(g.current.panelDataArrayChanged){g.current.panelDataArrayChanged=!1;const{autoSaveId:P,onLayout:I,storage:O}=v.current,{layout:F,panelDataArray:D}=g.current;let R=null;if(P){const ee=sl(P,D,O);ee&&(C.current=new Map(Object.entries(ee.expandToSizes)),R=ee.layout)}R==null&&(R=el({panelDataArray:D}));const Y=dn({layout:R,panelConstraints:D.map(ee=>ee.constraints)});on(F,Y)||(y(Y),g.current.layout=Y,I&&I(Y),Oe(D,Y,j.current))}}),Fe(()=>{const P=g.current;return()=>{P.layout=[]}},[]);const K=N.useCallback(P=>{let I=!1;const O=m.current;return O&&window.getComputedStyle(O,null).getPropertyValue("direction")==="rtl"&&(I=!0),function(D){D.preventDefault();const R=m.current;if(!R)return()=>null;const{direction:Y,dragState:ee,id:me,keyboardResizeBy:pe,onLayout:z}=v.current,{layout:J,panelDataArray:ie}=g.current,{initialLayout:ye}=ee??{},$e=ns(me,P,R);let ae=Jr(D,P,Y,ee,pe,R);const Ke=Y==="horizontal";Ke&&I&&(ae=-ae);const $t=ie.map(Et=>Et.constraints),Ee=We({delta:ae,initialLayout:ye??J,panelConstraints:$t,pivotIndices:$e,prevLayout:J,trigger:Wn(D)?"keyboard":"mouse-or-touch"}),ot=!ut(J,Ee);(Vn(D)||Gn(D))&&S.current!=ae&&(S.current=ae,!ot&&ae!==0?Ke?Lt(P,ae<0?Qn:Yn):Lt(P,ae<0?Zn:Jn):Lt(P,0)),ot&&(y(Ee),g.current.layout=Ee,z&&z(Ee),Oe(ie,Ee,j.current))}},[]),U=N.useCallback((P,I)=>{const{onLayout:O}=v.current,{layout:F,panelDataArray:D}=g.current,R=D.map(J=>J.constraints),{panelSize:Y,pivotIndices:ee}=Te(D,P,F);V(Y!=null,`Panel size not found for panel "${P.id}"`);const pe=Re(D,P)===D.length-1?Y-I:I-Y,z=We({delta:pe,initialLayout:F,panelConstraints:R,pivotIndices:ee,prevLayout:F,trigger:"imperative-api"});ut(F,z)||(y(z),g.current.layout=z,O&&O(z),Oe(D,z,j.current))},[]),H=N.useCallback((P,I)=>{const{layout:O,panelDataArray:F}=g.current,{collapsedSize:D=0,collapsible:R}=I,{collapsedSize:Y=0,collapsible:ee,maxSize:me=100,minSize:pe=0}=P.constraints,{panelSize:z}=Te(F,P,O);z!=null&&(R&&ee&&ke(z,D)?ke(D,Y)||U(P,Y):z<pe?U(P,pe):z>me&&U(P,me))},[U]),_=N.useCallback((P,I)=>{const{direction:O}=v.current,{layout:F}=g.current;if(!m.current)return;const D=kt(P,m.current);V(D,`Drag handle element not found for id "${P}"`);const R=rs(O,I);x({dragHandleId:P,dragHandleRect:D.getBoundingClientRect(),initialCursorPosition:R,initialLayout:F})},[]),Q=N.useCallback(()=>{x(null)},[]),le=N.useCallback(P=>{const{panelDataArray:I}=g.current,O=Re(I,P);O>=0&&(I.splice(O,1),delete j.current[P.id],g.current.panelDataArrayChanged=!0,w())},[w]),T=N.useMemo(()=>({collapsePanel:$,direction:s,dragState:p,expandPanel:W,getPanelSize:M,getPanelStyle:A,groupId:h,isPanelCollapsed:k,isPanelExpanded:G,reevaluatePanelConstraints:H,registerPanel:q,registerResizeHandle:K,resizePanel:U,startDragging:_,stopDragging:Q,unregisterPanel:le,panelGroupElement:m.current}),[$,p,s,W,M,A,h,k,G,H,q,K,U,_,Q,le]),B={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return N.createElement(vt.Provider,{value:T},N.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...B,...d},[te.group]:"",[te.groupDirection]:s,[te.groupId]:h}))}const cs=N.forwardRef((n,e)=>N.createElement(os,{...n,forwardedRef:e}));os.displayName="PanelGroup";cs.displayName="forwardRef(PanelGroup)";function Re(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function Te(n,e,t){const s=Re(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],a=t[s];return{...e.constraints,panelSize:a,pivotIndices:i}}function il({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){N.useEffect(()=>{if(n||t==null||s==null)return;const r=kt(e,s);if(r==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),t(a);break}case"F6":{a.preventDefault();const c=r.getAttribute(te.groupId);V(c,`No group element found for id "${c}"`);const o=et(c,s),d=ts(c,e,s);V(d!==null,`No resize element found for id "${e}"`);const f=a.shiftKey?d>0?d-1:o.length-1:d+1<o.length?d+1:0;o[f].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[s,n,e,t])}function ds({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:a,onDragging:c,onFocus:o,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var x,b;const y=N.useRef(null),w=N.useRef({onClick:a,onDragging:c,onPointerDown:d,onPointerUp:f});N.useEffect(()=>{w.current.onClick=a,w.current.onDragging=c,w.current.onPointerDown=d,w.current.onPointerUp=f});const j=N.useContext(vt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:C,groupId:S,registerResizeHandle:v,startDragging:g,stopDragging:$,panelGroupElement:W}=j,M=Xt(r),[A,k]=N.useState("inactive"),[G,q]=N.useState(!1),[K,U]=N.useState(null),H=N.useRef({state:A});Fe(()=>{H.current.state=A}),N.useEffect(()=>{if(t)U(null);else{const T=v(M);U(()=>T)}},[t,M,v]);const _=(x=s?.coarse)!==null&&x!==void 0?x:15,Q=(b=s?.fine)!==null&&b!==void 0?b:5;N.useEffect(()=>{if(t||K==null)return;const T=y.current;V(T,"Element ref not attached");let B=!1;return qr(M,T,C,{coarse:_,fine:Q},(I,O,F)=>{if(!O){k("inactive");return}switch(I){case"down":{k("drag"),B=!1,V(F,'Expected event to be defined for "down" action'),g(M,F);const{onDragging:D,onPointerDown:R}=w.current;D?.(!0),R?.();break}case"move":{const{state:D}=H.current;B=!0,D!=="drag"&&k("hover"),V(F,'Expected event to be defined for "move" action'),K(F);break}case"up":{k("hover"),$();const{onClick:D,onDragging:R,onPointerUp:Y}=w.current;R?.(!1),Y?.(),B||D?.();break}}})},[_,C,t,Q,v,M,K,g,$]),il({disabled:t,handleId:M,resizeHandler:K,panelGroupElement:W});const le={touchAction:"none",userSelect:"none"};return N.createElement(m,{...p,children:n,className:e,id:r,onBlur:()=>{q(!1),i?.()},onFocus:()=>{q(!0),o?.()},ref:y,role:"separator",style:{...le,...u},tabIndex:h,[te.groupDirection]:C,[te.groupId]:S,[te.resizeHandle]:"",[te.resizeHandleActive]:A==="drag"?"pointer":G?"keyboard":void 0,[te.resizeHandleEnabled]:!t,[te.resizeHandleId]:M,[te.resizeHandleState]:A})}ds.displayName="PanelResizeHandle";function al(n){const e=E.c(10);let t,s,r;e[0]!==n?({className:t,ref:r,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let a;return e[6]!==s||e[7]!==r||e[8]!==i?(a=l.jsx(cs,{ref:r,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=r,e[8]=i,e[9]=a):a=e[9],a}function fn(n){const e=E.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(qn,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function ol(n){const e=E.c(12);let t,s,r;e[0]!==n?({withHandle:r,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r?(a=r&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(Zs,{className:"size-2.5"})}),e[6]=r,e[7]=a):a=e[7];let c;return e[8]!==s||e[9]!==i||e[10]!==a?(c=l.jsx(ds,{"data-slot":"resizable-handle",className:i,...s,children:a}),e[8]=s,e[9]=i,e[10]=a,e[11]=c):c=e[11],c}function cl(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function dl(n){if(cl(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function ul(n){try{return decodeURIComponent(n)}catch{return n}}function fl(n){return dl(n),encodeURIComponent(n)}function hl(n){return`.deco/blocks/${fl(n)}.json`}function Ua(n){return`/${hl(n)}`}const Ha=1e4,ml=3;function _t(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function St(n){return n.startsWith("/")?n.slice(1):n}function Ka(n){const e=St(n);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}function He(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function pl(n){const e=He(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function qa(n,e){const t=e.replace(/^\/+|\/+$/g,"");return He(t?`${n==="/"?"":n}/${t}`:n)}function Wa(n,e){return e==="directory"?n:pl(n)}function Va(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function xl(n){const e=St(n);return e?e.split("/").filter(Boolean).length:0}function Ga(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Xa(n,e){return xl(n)>=ml&&!e.has(n)}function Qa(n,e,t=[]){const s=St(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const r=`${s}/`;return e.some(i=>i.startsWith(r))||t.some(i=>i.startsWith(r))}function Ya(n){const e=St(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return ul(s)}function bl(n){if(!n)return"plaintext";const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}const gl="#94a3b8";function Za(n){const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:dt,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:dt,color:"#d9a441"}:e.endsWith(".json")?{Icon:Js,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:dt,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:dt,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:pr,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:nn,color:"#64748b"}:{Icon:nn,color:gl}}function Ja(n){const e=_t(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function eo(n,e=[]){const t={path:"/",children:[]},s=new Map,r=c=>{let o=s.get(c.path);return o||(o=new Map,s.set(c.path,o)),o},i=c=>{const d=_t(c).split("/").filter(Boolean);let f=t,u="";for(const h of d){u+=`/${h}`;const m=r(f);let p=m.get(h);p?p.kind==="file"&&(p.kind="directory"):(p={name:h,path:u,kind:"directory",children:[]},f.children.push(p),m.set(h,p)),f=p}};for(const c of n){const d=_t(c).split("/").filter(Boolean);let f=t,u="";d.forEach((h,m)=>{u+=`/${h}`;const p=m===d.length-1,x=r(f);let b=x.get(h);b||(b={name:h,path:u,kind:p?"file":"directory",children:[]},f.children.push(b),x.set(h,b)),f=b})}for(const c of e)i(He(c));const a=c=>{c.sort((o,d)=>o.kind!==d.kind?o.kind==="directory"?-1:1:o.name.localeCompare(d.name));for(const o of c)o.children.length>0&&a(o.children)};return a(t.children),t.children}function yl(n,e,t=0){const s=[];for(const r of n)r.name!==".gitkeep"&&(s.push({node:r,depth:t}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&s.push(...yl(r.children,e,t+1)));return s}function to(n){const e=[];for(const t of n.split(`
|
|
2
2
|
`)){if(!t)continue;const s=t.indexOf(":");if(s<0)continue;const r=t.indexOf(":",s+1);if(r<0)continue;const i=Number.parseInt(t.slice(s+1,r),10);Number.isFinite(i)&&e.push({path:He(t.slice(0,s)),line:i,text:t.slice(r+1)})}return e}function no(n,e,t){const s=e.trim().toLowerCase();if(!s)return[];const r=[];for(const i of n)if((i.split("/").pop()??i).toLowerCase().includes(s)&&(r.push(He(i)),r.length>=t))break;return r}const hn=24;function so(n,e){const t=n.replace(/^\s+/,""),s=e.trim().toLowerCase();if(!s)return{leadingEllipsis:!1,segments:[{text:t,match:!1}]};const r=t.toLowerCase().indexOf(s);if(r<0)return{leadingEllipsis:!1,segments:[{text:t,match:!1}]};const i=r>hn,a=i?t.slice(r-hn):t,c=a.toLowerCase(),o=[];let d=0;for(;;){const f=c.indexOf(s,d);if(f<0){d<a.length&&o.push({text:a.slice(d),match:!1});break}f>d&&o.push({text:a.slice(d,f),match:!1}),o.push({text:a.slice(f,f+s.length),match:!0}),d=f+s.length}return{leadingEllipsis:i,segments:o}}function ro(n){const e=[],t=new Map;for(const s of n){let r=t.get(s.path);r||(r={path:s.path,matches:[]},t.set(s.path,r),e.push(r)),r.matches.push(s)}return e}function lo(n){return n.split(`
|
|
3
3
|
`).map(e=>e.replace(/^\d+\t/,"")).join(`
|
|
4
4
|
`)}function vl(n){const e=E.c(10),{icon:t,className:s}=n,r=s===void 0?"size-4":s;if(t.kind==="component"){const{Component:a}=t;let c;return e[0]!==a||e[1]!==r?(c=l.jsx(a,{className:r}),e[0]=a,e[1]=r,e[2]=c):c=e[2],c}if(t.kind==="url"){const a=t.src;let c;e[3]!==r?(c=de(r,"rounded-sm object-cover"),e[3]=r,e[4]=c):c=e[4];let o;return e[5]!==t.src||e[6]!==c?(o=l.jsx("img",{src:a,alt:"",className:c}),e[5]=t.src,e[6]=c,e[7]=o):o=e[7],o}let i;return e[8]!==r?(i=l.jsx(Xs,{className:r}),e[8]=r,e[9]=i):i=e[9],i}function wl(n){const e=E.c(19),{title:t,icon:s,active:r,onClick:i,disabled:a,locked:c,className:o,testId:d,dataTour:f}=n,u=a===void 0?!1:a,h=c===void 0?!1:c,m=h||void 0,p=h&&"pointer-events-none",x=r?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let b;e[0]!==o||e[1]!==p||e[2]!==x?(b=de("shrink-0 flex items-center gap-1.5 h-7 rounded-md px-2","[transition:background-color_180ms_ease,color_180ms_ease]","disabled:opacity-40 disabled:pointer-events-none",p,x,o),e[0]=o,e[1]=p,e[2]=x,e[3]=b):b=e[3];let y;e[4]!==s?(y=l.jsx("span",{className:"flex size-5 items-center justify-center shrink-0",children:l.jsx(vl,{icon:s})}),e[4]=s,e[5]=y):y=e[5];let w;e[6]!==t?(w=l.jsx("span",{className:"max-md:hidden whitespace-nowrap text-sm font-medium leading-none",children:t}),e[6]=t,e[7]=w):w=e[7];let j;return e[8]!==r||e[9]!==f||e[10]!==u||e[11]!==i||e[12]!==m||e[13]!==b||e[14]!==y||e[15]!==w||e[16]!==d||e[17]!==t?(j=l.jsxs("button",{type:"button",onClick:i,disabled:u,"data-testid":d,"data-tour":f,"aria-pressed":r,"aria-disabled":m,"aria-label":t,className:b,children:[y,w]}),e[8]=r,e[9]=f,e[10]=u,e[11]=i,e[12]=m,e[13]=b,e[14]=y,e[15]=w,e[16]=d,e[17]=t,e[18]=j):j=e[18],j}hr.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function jl(n){const e=E.c(11),{value:t,filename:s}=n,[r]=Ts(),i=r.theme==="dark"||r.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let a;e[0]!==s?(a=bl(s),e[0]=s,e[1]=a):a=e[1];const c=i?"vs-dark":"light";let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsx(Ds,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=o):o=e[2];let d,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={enabled:!1},f={top:12,bottom:12},e[3]=d,e[4]=f):(d=e[3],f=e[4]);let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:d,padding:f,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=u):u=e[5];let h;return e[6]!==s||e[7]!==a||e[8]!==c||e[9]!==t?(h=l.jsx(mr,{path:s,language:a,value:t,theme:c,loading:o,options:u},s),e[6]=s,e[7]=a,e[8]=c,e[9]=t,e[10]=h):h=e[10],h}function us(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const kl=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Sl=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),mn=2*1024*1024;function Nl(n,e){const t=n.split(".").pop()?.toLowerCase()??"";return kl.has(t)?"image":t==="pdf"?"pdf":t==="html"||t==="htm"?"html":t==="md"||t==="markdown"?e<=mn?"markdown":"download":Sl.has(t)&&e<=mn?"text":"download"}function fs(){const n=E.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ce,{className:"h-6 w-2/3"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(ce,{className:"h-3 w-full"}),l.jsx(ce,{className:"h-3 w-5/6"}),l.jsx(ce,{className:"h-3 w-2/3"})]})]})}),n[1]=t):t=n[1],t}function hs(n){const e=E.c(20),{file:t,note:s}=n;let r;e[0]!==t.filename?(r=l.jsx(Ne,{filename:t.filename,className:"h-12 w-10"}),e[0]=t.filename,e[1]=r):r=e[1];let i;e[2]!==t.filename?(i=l.jsx("span",{className:"text-sm font-medium text-foreground",children:t.filename}),e[2]=t.filename,e[3]=i):i=e[3];let a;e[4]!==t.size?(a=us(t.size),e[4]=t.size,e[5]=a):a=e[5];const c=s?` · ${s}`:"";let o;e[6]!==a||e[7]!==c?(o=l.jsxs("span",{className:"text-xs text-muted-foreground",children:[a,c]}),e[6]=a,e[7]=c,e[8]=o):o=e[8];let d;e[9]!==i||e[10]!==o?(d=l.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i,o]}),e[9]=i,e[10]=o,e[11]=d):d=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(Ze,{size:14}),e[12]=f):f=e[12];let u;e[13]!==t.downloadUrl||e[14]!==t.filename?(u=l.jsx(Z,{asChild:!0,variant:"outline",size:"sm",children:l.jsxs("a",{href:t.downloadUrl,download:t.filename,children:[f,"Download"]})}),e[13]=t.downloadUrl,e[14]=t.filename,e[15]=u):u=e[15];let h;return e[16]!==r||e[17]!==d||e[18]!==u?(h=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[r,d,u]})}),e[16]=r,e[17]=d,e[18]=u,e[19]=h):h=e[19],h}function pn(n){const e=E.c(16),{file:t,markdown:s}=n;let r;e[0]!==t.downloadUrl?(r=X.fileText(t.downloadUrl),e[0]=t.downloadUrl,e[1]=r):r=e[1];let i;e[2]!==t.downloadUrl?(i=async()=>{const u=await fetch(t.downloadUrl,{credentials:"include"});if(!u.ok)throw new Error(`fetch failed: ${u.status}`);return u.text()},e[2]=t.downloadUrl,e[3]=i):i=e[3];let a;e[4]!==r||e[5]!==i?(a={queryKey:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=r,e[5]=i,e[6]=a):a=e[6];const{data:c,isPending:o,isError:d}=oe(a);if(o){let u;return e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(fs,{}),e[7]=u):u=e[7],u}if(d||c===void 0){let u;return e[8]!==t?(u=l.jsx(hs,{file:t,note:"preview unavailable"}),e[8]=t,e[9]=u):u=e[9],u}if(s){const u=`file-preview-${t.key}`;let h;return e[10]!==c||e[11]!==u?(h=l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:l.jsx(Ht,{id:u,text:c})})}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}let f;return e[13]!==c||e[14]!==t.filename?(f=l.jsx(jl,{value:c,filename:t.filename}),e[13]=c,e[14]=t.filename,e[15]=f):f=e[15],f}function ms(n){const e=E.c(15),{file:t}=n;switch(Nl(t.filename,t.size)){case"image":{let r;return e[0]!==t.downloadUrl||e[1]!==t.filename?(r=l.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:l.jsx("img",{src:t.downloadUrl,alt:t.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=t.downloadUrl,e[1]=t.filename,e[2]=r):r=e[2],r}case"pdf":{let r;return e[3]!==t.downloadUrl||e[4]!==t.filename?(r=l.jsx("iframe",{src:t.downloadUrl,title:t.filename,className:"block h-full w-full bg-white"}),e[3]=t.downloadUrl,e[4]=t.filename,e[5]=r):r=e[5],r}case"html":{let r;return e[6]!==t.downloadUrl||e[7]!==t.filename?(r=l.jsx("iframe",{src:t.downloadUrl,title:t.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=t.downloadUrl,e[7]=t.filename,e[8]=r):r=e[8],r}case"markdown":{let r;return e[9]!==t?(r=l.jsx(pn,{file:t,markdown:!0}),e[9]=t,e[10]=r):r=e[10],r}case"text":{let r;return e[11]!==t?(r=l.jsx(pn,{file:t,markdown:!1}),e[11]=t,e[12]=r):r=e[12],r}default:{let r;return e[13]!==t?(r=l.jsx(hs,{file:t}),e[13]=t,e[14]=r):r=e[14],r}}}function Pl(n){const e=E.c(52),{readUrl:t,editor:s,downloadName:r,trailing:i}=n,a=se();let c;e[0]!==t?(c=new URL(t,window.location.origin).toString(),e[0]=t,e[1]=c):c=e[1];const o=c;let d;e[2]!==s||e[3]!==a?(d=s.deckDetected&&l.jsxs(ve,{children:[l.jsx(we,{asChild:!0,children:l.jsx(Z,{variant:s.railOpen?"secondary":"ghost",size:"icon","aria-label":s.railOpen?a("deck.deckToolbar.hideSlideList"):a("deck.deckToolbar.showSlideList"),onClick:()=>s.setRailOpen(!s.railOpen),children:l.jsx(xr,{size:14})})}),l.jsx(je,{side:"bottom",children:s.railOpen?a("deck.deckToolbar.hideSlideList"):a("deck.deckToolbar.showSlideList")})]}),e[2]=s,e[3]=a,e[4]=d):d=e[4];let f;e[5]!==o?(f=()=>window.open(o,"_blank","noopener"),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==o?(u=l.jsx("span",{className:"truncate",children:o}),e[7]=o,e[8]=u):u=e[8];let h;e[9]!==o||e[10]!==f||e[11]!==u?(h=l.jsx("button",{type:"button",onClick:f,className:"flex min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:o,children:u}),e[9]=o,e[10]=f,e[11]=u,e[12]=h):h=e[12];let m;e[13]!==s.agentUpdated||e[14]!==s.reload||e[15]!==a?(m=s.agentUpdated&&l.jsxs(ve,{children:[l.jsx(we,{asChild:!0,children:l.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:s.reload,children:[l.jsx(Sn,{size:12}),a("deck.deckToolbar.agentUpdatedReload")]})}),l.jsx(je,{side:"bottom",children:a("deck.deckToolbar.agentRewriteWarning")})]}),e[13]=s.agentUpdated,e[14]=s.reload,e[15]=a,e[16]=m):m=e[16];let p;e[17]!==s.saving||e[18]!==a?(p=s.saving&&l.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:a("deck.deckToolbar.saving")}),e[17]=s.saving,e[18]=a,e[19]=p):p=e[19];let x;e[20]!==s||e[21]!==a?(x=s.deckDetected&&s.writable&&l.jsxs(ve,{children:[l.jsx(we,{asChild:!0,children:l.jsx(Z,{variant:s.editMode?"secondary":"ghost",size:"icon","aria-label":s.editMode?a("deck.deckToolbar.doneEditing"):a("deck.deckToolbar.editInline"),className:de(s.editMode&&"text-primary"),onClick:()=>s.setEditMode(!s.editMode),children:l.jsx(er,{size:14})})}),l.jsx(je,{side:"bottom",children:s.editMode?a("deck.deckToolbar.doneEditing"):a("deck.deckToolbar.editInlineTooltip")})]}),e[20]=s,e[21]=a,e[22]=x):x=e[22];let b;e[23]!==o||e[24]!==r||e[25]!==s.deckDetected||e[26]!==a?(b=s.deckDetected?l.jsxs(Kt,{children:[l.jsx(qt,{asChild:!0,children:l.jsx(Z,{variant:"ghost",size:"icon","aria-label":a("deck.deckToolbar.download"),children:l.jsx(Ze,{size:14})})}),l.jsxs(Wt,{align:"end",children:[l.jsxs(Ie,{onClick:()=>window.open(`${o}#print`,"_blank","noopener"),children:[l.jsx(tr,{size:14}),a("deck.deckToolbar.exportAsPdf")]}),l.jsx(Ie,{asChild:!0,children:l.jsxs("a",{href:o,download:r,children:[l.jsx(nr,{size:14}),a("deck.deckToolbar.downloadHtml")]})})]})]}):l.jsxs(ve,{children:[l.jsx(we,{asChild:!0,children:l.jsx(Z,{variant:"ghost",size:"icon","aria-label":a("deck.deckToolbar.download"),asChild:!0,children:l.jsx("a",{href:o,download:r,children:l.jsx(Ze,{size:14})})})}),l.jsx(je,{side:"bottom",children:a("deck.deckToolbar.download")})]}),e[23]=o,e[24]=r,e[25]=s.deckDetected,e[26]=a,e[27]=b):b=e[27];let y;e[28]!==a?(y=a("deck.deckToolbar.openInNewTab"),e[28]=a,e[29]=y):y=e[29];let w;e[30]!==o?(w=()=>window.open(o,"_blank","noopener"),e[30]=o,e[31]=w):w=e[31];let j;e[32]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(On,{size:14}),e[32]=j):j=e[32];let C;e[33]!==y||e[34]!==w?(C=l.jsx(we,{asChild:!0,children:l.jsx(Z,{variant:"ghost",size:"icon","aria-label":y,onClick:w,children:j})}),e[33]=y,e[34]=w,e[35]=C):C=e[35];let S;e[36]!==a?(S=a("deck.deckToolbar.openInNewTab"),e[36]=a,e[37]=S):S=e[37];let v;e[38]!==S?(v=l.jsx(je,{side:"bottom",children:S}),e[38]=S,e[39]=v):v=e[39];let g;e[40]!==C||e[41]!==v?(g=l.jsxs(ve,{children:[C,v]}),e[40]=C,e[41]=v,e[42]=g):g=e[42];let $;return e[43]!==g||e[44]!==d||e[45]!==h||e[46]!==m||e[47]!==p||e[48]!==x||e[49]!==b||e[50]!==i?($=l.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[d,h,m,p,x,b,g,i]}),e[43]=g,e[44]=d,e[45]=h,e[46]=m,e[47]=p,e[48]=x,e[49]=b,e[50]=i,e[51]=$):$=e[51],$}const Ae=1;function Cl(n){if(typeof n!="object"||n===null||n.v!==Ae||n.source!=="deck-viewer")return null;const e=n;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}class Pe extends Error{constructor(e,t){super(e),this.code=t,this.name="DeckOpError"}code}function ps(n){return[...n.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function zl(n){const t=new DOMParser().parseFromString(n,"text/html").querySelector("deck-viewer");return t?ps(t).length:null}function $l(n,e){const t=new DOMParser().parseFromString(n,"text/html"),s=t.querySelector("deck-viewer");if(!s)throw new Pe("no <deck-viewer> element in source","no-viewer");const r=ps(s),i=e.kind==="move"?e.from:e.at,a=r[i];if(!a)throw new Pe(`slide index ${i} out of range (${r.length})`,"stale-index");switch(e.kind){case"remove":{if(r.length<=1)throw new Pe("cannot remove the last slide","bad-op");a.remove();break}case"duplicate":{const o=a.cloneNode(!0);o.removeAttribute("id");for(const d of o.querySelectorAll("[id]"))d.removeAttribute("id");a.after(o);break}case"move":{if(e.to<0||e.to>=r.length)throw new Pe(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const o=e.to<e.from?r[e.to]:r[e.to].nextSibling;s.insertBefore(a,o)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new Pe(`invalid attribute name: ${e.name}`,"bad-op");a.setAttribute(e.name,e.value);break}case"remove-attr":{a.removeAttribute(e.name);break}case"replace":{const d=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!d)throw new Pe("replace html has no root element","bad-op");a.replaceWith(t.importNode(d,!0));break}default:throw new Pe(`unknown op kind: ${e.kind}`,"bad-op")}return`${n.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,aE as q,dX as R,cJ as Ee,cL as ke,cN as Se,H as xe,dY as V}from"./index-DAtTWfgt.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Le=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),j=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:H=!1,vimBindings:A=!0,...O}=t,N=q(),ne=q(),U=q(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")X(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(U);y?y.focus():(a=document.getElementById(N))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),J=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{X(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{X(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:N,inputId:U,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Le;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;L().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=L().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function X(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function L(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function Y(e){let o=L()[e];o&&k.setState("value",o.getAttribute(F))}function G(e){var o;let s=D(),a=L(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Ue(s,P):Je(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):G(e)}let ie=()=>Y(L().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):G(1)},ce=e=>{e.preventDefault(),e.metaKey?Y(0):e.altKey?ue(-1):G(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),Y(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:J.inputId,id:J.labelId,style:Xe},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:J},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=j(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;H(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function H(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:N,forceMount:ne,keywords:U,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:H,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=j(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),je=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=j();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=j();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),He=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ne=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ge=Object.assign(be,{List:Be,Item:Pe,Input:Oe,Group:Ve,Separator:je,Dialog:ze,Empty:He,Loading:Ne});function Ue(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Je(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=j();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Xe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ge as _};
|
|
1
|
+
import{r as n,aE as q,dX as R,cJ as Ee,cL as ke,cN as Se,H as xe,dY as V}from"./index-C7paW5qO.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Le=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),j=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:H=!1,vimBindings:A=!0,...O}=t,N=q(),ne=q(),U=q(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")X(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(U);y?y.focus():(a=document.getElementById(N))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),J=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{X(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{X(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:N,inputId:U,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Le;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;L().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=L().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function X(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function L(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function Y(e){let o=L()[e];o&&k.setState("value",o.getAttribute(F))}function G(e){var o;let s=D(),a=L(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Ue(s,P):Je(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):G(e)}let ie=()=>Y(L().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):G(1)},ce=e=>{e.preventDefault(),e.metaKey?Y(0):e.altKey?ue(-1):G(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),Y(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:J.inputId,id:J.labelId,style:Xe},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:J},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=j(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;H(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function H(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:N,forceMount:ne,keywords:U,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:H,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=j(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),je=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=j();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=j();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),He=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ne=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ge=Object.assign(be,{List:Be,Item:Pe,Input:Oe,Group:Ve,Separator:je,Dialog:ze,Empty:He,Loading:Ne});function Ue(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Je(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=j();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Xe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ge as _};
|