decocms 4.451.1 → 4.452.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DDHQi3fm.js → AlertCircle-CQkRRGSg.js} +1 -1
- package/dist/client/assets/{AreaChart-xcCkJdeX.js → AreaChart-B-RuYs_G.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CIsJnvjF.js → ArrowLeft-DR8lCUOF.js} +1 -1
- package/dist/client/assets/{ArrowUp-CtvQk6Vg.js → ArrowUp-7FgpFlyY.js} +1 -1
- package/dist/client/assets/{Building02-BVSXudo-.js → Building02-7V26SUA6.js} +1 -1
- package/dist/client/assets/{CartesianChart-YXdY8HHd.js → CartesianChart-D2qv7oNB.js} +1 -1
- package/dist/client/assets/{Check-Cf-cMW3t.js → Check-CZYLh537.js} +1 -1
- package/dist/client/assets/{CheckCircle-BemNEpVg.js → CheckCircle-BcqKkSj5.js} +1 -1
- package/dist/client/assets/{ChevronUp-B79uJeZN.js → ChevronUp-riNbaljB.js} +1 -1
- package/dist/client/assets/{Copy01-DluK-JtU.js → Copy01-DFthUWqM.js} +1 -1
- package/dist/client/assets/{CreditCard01-BzBUMTax.js → CreditCard01-CyYVeRD3.js} +1 -1
- package/dist/client/assets/{DotsVertical-COzw8ydu.js → DotsVertical-rzfqPSdm.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CICGscAV.js → ErrorBarContext-DQp6cg0w.js} +1 -1
- package/dist/client/assets/{Image01-DnRAAkhy.js → Image01-CmS6lPNM.js} +1 -1
- package/dist/client/assets/{Key01-DXvy1NNO.js → Key01-CkznrEPX.js} +1 -1
- package/dist/client/assets/{Line-DooN19Jn.js → Line-TP8KMdrq.js} +1 -1
- package/dist/client/assets/{Link01-iwXPIeVc.js → Link01-BK2WDfDE.js} +1 -1
- package/dist/client/assets/{LinkBroken01-ChSpe7Cq.js → LinkBroken01-DE5GGQ-P.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BVDnNs6j.js → LinkExternal01-YQUR5lT6.js} +1 -1
- package/dist/client/assets/{Monitor01-BLZH5esy.js → Monitor01-mscEQ6pB.js} +1 -1
- package/dist/client/assets/{Palette-CaKXG6S_.js → Palette-U32cX76w.js} +1 -1
- package/dist/client/assets/{Plus-DjsQQqpw.js → Plus-B1zA6p-4.js} +1 -1
- package/dist/client/assets/{SearchMd-oXON6Mge.js → SearchMd-nUFR-fun.js} +1 -1
- package/dist/client/assets/{Sector-Df4GIa0t.js → Sector-IJN93tJL.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DktiI11o.js → ShoppingBag01-xjymcct3.js} +1 -1
- package/dist/client/assets/{Sun-BWosC3Su.js → Sun-CCW_4qiv.js} +1 -1
- package/dist/client/assets/{Tool01-BchdJG2X.js → Tool01-B62In8iq.js} +1 -1
- package/dist/client/assets/{Trash01-BfnCKCGB.js → Trash01-C2tQl3wO.js} +1 -1
- package/dist/client/assets/{Upload01-CNtxqXvb.js → Upload01-BWT4v0Wi.js} +1 -1
- package/dist/client/assets/{User01-DXNh3TnB.js → User01-CjZ2I7BX.js} +1 -1
- package/dist/client/assets/{UserSquare-DZJwwd71.js → UserSquare-CWUXupRN.js} +1 -1
- package/dist/client/assets/{Users01-DAfCqIN7.js → Users01-BCGnPOxS.js} +1 -1
- package/dist/client/assets/{X-C52mq3mn.js → X-CHFG7-mU.js} +1 -1
- package/dist/client/assets/{XAxis-DgLHWAdH.js → XAxis-DIIA1eR_.js} +1 -1
- package/dist/client/assets/{XClose-BqRoe3QG.js → XClose-DTOuD_e7.js} +1 -1
- package/dist/client/assets/{ZoomOut-BlDSjKri.js → ZoomOut-CTvv0VFv.js} +1 -1
- package/dist/client/assets/{access-gate-DbBQLMiF.js → access-gate-YoCC2cak.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Bll7Vib1.js → add-connection-dialog-BJoFO4TU.js} +1 -1
- package/dist/client/assets/{agent-analytics-DRKGLO_x.js → agent-analytics-pKyZniYD.js} +1 -1
- package/dist/client/assets/agent-app-DwiMM2IP.js +1 -0
- package/dist/client/assets/{agent-assets-D9BHI5EW.js → agent-assets-BBuETSa3.js} +1 -1
- package/dist/client/assets/{agent-automation-ClR5yW20.js → agent-automation-Gf_403yV.js} +1 -1
- package/dist/client/assets/{agent-automations-CCiWhcgf.js → agent-automations-DHEWASaU.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DFTkcmVS.js → agent-connect-sources-BJfN-vfW.js} +1 -1
- package/dist/client/assets/agent-deck-E2P9m0dI.js +1 -0
- package/dist/client/assets/{agent-e2e-pbVC7Vx7.js → agent-e2e-BUPuBpdn.js} +1 -1
- package/dist/client/assets/{agent-experiments-_aODOZpq.js → agent-experiments-DvP2aKwk.js} +1 -1
- package/dist/client/assets/{agent-file-DtN8kaxY.js → agent-file-CDAQ3_2M.js} +1 -1
- package/dist/client/assets/{agent-git-BCddyL27.js → agent-git-B3crMGWs.js} +1 -1
- package/dist/client/assets/{agent-hosting-CgLWSfX9.js → agent-hosting-MCkMzhov.js} +1 -1
- package/dist/client/assets/{agent-icon-DEoEcQYL.js → agent-icon-BJAncODg.js} +1 -1
- package/dist/client/assets/agent-library-Be8pU2hW.js +1 -0
- package/dist/client/assets/agent-library-file-CY8i2CE4.js +1 -0
- package/dist/client/assets/{agent-monitor-YUBiIydT.js → agent-monitor-CAKsywMv.js} +1 -1
- package/dist/client/assets/{agent-overview-HCAO8obL.js → agent-overview-BeUwu-KG.js} +1 -1
- package/dist/client/assets/agent-settings-CuDtw36W.js +1 -0
- package/dist/client/assets/{agent-site-editor-DH5igdCT.js → agent-site-editor-CiGatYz3.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DRE7bc_V.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CStkXfya.js +9 -0
- package/dist/client/assets/{agent-site-editor-preview-BBSy8s7P.js → agent-site-editor-preview-D9pvz5fY.js} +3 -3
- package/dist/client/assets/agent-view-CI9PvOjo.js +1 -0
- package/dist/client/assets/{agent-view-guard-BYimT8Jz.js → agent-view-guard-H46J6I2J.js} +1 -1
- package/dist/client/assets/{agents-list-C434Mp2b.js → agents-list-CfV4zbeg.js} +1 -1
- package/dist/client/assets/{ai-providers-DINDBcoG.js → ai-providers-BN2hQMhH.js} +1 -1
- package/dist/client/assets/{alert-_Nu0OQ4m.js → alert-DAHFLojl.js} +1 -1
- package/dist/client/assets/{alert-dialog-D9wz_Poi.js → alert-dialog-DfTPgIPX.js} +1 -1
- package/dist/client/assets/{analytics-sections-_zTIyETq.js → analytics-sections-yoOoelxF.js} +1 -1
- package/dist/client/assets/api-keys-CKqJk5_6.js +1 -0
- package/dist/client/assets/{api-keys-tqQH4z9A.js → api-keys-NZUBfE--.js} +1 -1
- package/dist/client/assets/app-editor-DS_J4EUn.js +1 -0
- package/dist/client/assets/{asset-utils-WUpNFBXm.js → asset-utils-Dg_L4rgJ.js} +1 -1
- package/dist/client/assets/{auth-catchall-mR81Birw.js → auth-catchall-CQNM5IYs.js} +1 -1
- package/dist/client/assets/{auth-entry-DCUAgWIX.js → auth-entry-Bg2aCMAm.js} +1 -1
- package/dist/client/assets/{auth-DDdLUET9.js → auth-g-eeEO2I.js} +1 -1
- package/dist/client/assets/{auth-split-layout-FX4F99rm.js → auth-split-layout-BHWXJwAv.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bb2l090x.js → authenticate-and-persist-oauth-D01FuEWu.js} +1 -1
- package/dist/client/assets/{automation-list-row-SxUdqZJz.js → automation-list-row-CyxwTlrF.js} +1 -1
- package/dist/client/assets/{automation-runs-Cw-2J5pa.js → automation-runs-xCwcCJC2.js} +1 -1
- package/dist/client/assets/{automations-DXUfchhU.js → automations-Ab2pgU9k.js} +1 -1
- package/dist/client/assets/{autosend-CeDtnxlk.js → autosend-5ui8IdtF.js} +1 -1
- package/dist/client/assets/{avatar-BeFEVdWT.js → avatar-CmjVNkwN.js} +1 -1
- package/dist/client/assets/{badge-Dw0XHZAq.js → badge-DRRTtn5O.js} +1 -1
- package/dist/client/assets/{block-document-HhERskFc.js → block-document-Cu1B3Znw.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BqdqlnAP.js → blocks-preview-workspace-context-DKUHWFsF.js} +1 -1
- package/dist/client/assets/{blog-schema-Bzw5lTdw.js → blog-schema-DsqMhqVM.js} +1 -1
- package/dist/client/assets/{buckets-C_vclPuO.js → buckets-yskqiFUf.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DG46Mbz-.js → build-improve-prompt-doc-Czr7rpOn.js} +1 -1
- package/dist/client/assets/{calendar-BGvJ_APz.js → calendar-hQQyUCsj.js} +1 -1
- package/dist/client/assets/{capability-load-error-m8D5eiRW.js → capability-load-error-CbMIev40.js} +1 -1
- package/dist/client/assets/{category-editor-BoAaFme1.js → category-editor-CERa-ic1.js} +1 -1
- package/dist/client/assets/{chart-AQf5J0lZ.js → chart-V4xaiNPC.js} +1 -1
- package/dist/client/assets/{chat-context-DHGUafJ4.js → chat-context-oxL7wGnz.js} +1 -1
- package/dist/client/assets/{chat-draft-Du6X8nKJ.js → chat-draft-Djy3dkUg.js} +1 -1
- package/dist/client/assets/{checkbox-D-g_vU3W.js → checkbox-D7WjpuVv.js} +1 -1
- package/dist/client/assets/{choose-editor-DJMezn9k.js → choose-editor-BEgt8mUY.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BTrkr4bY.js → claim-phase-copy-D-j3nn-u.js} +1 -1
- package/dist/client/assets/{cli-auth-success-M_9Lwmu5.js → cli-auth-success-CDTAwVf_.js} +1 -1
- package/dist/client/assets/{client-icons-Do1roBGh.js → client-icons-BRCUVaWX.js} +1 -1
- package/dist/client/assets/{collapsible-DUefED3P.js → collapsible-DIaN6Srf.js} +1 -1
- package/dist/client/assets/{collection-detail-CuQUNXH_.js → collection-detail-DJ79vvsb.js} +1 -1
- package/dist/client/assets/{collection-display-button-CMHxbURQ.js → collection-display-button-D_MeUzdg.js} +1 -1
- package/dist/client/assets/{collection-search-CKxipBbw.js → collection-search-CKIe33RH.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CN227TJm.js → collection-table-wrapper-BU7gTJT1.js} +1 -1
- package/dist/client/assets/{collection-tabs-z-VIWVMA.js → collection-tabs-Br7caoEY.js} +1 -1
- package/dist/client/assets/{column-rules-BOkclOCh.js → column-rules-C4SSRzGe.js} +1 -1
- package/dist/client/assets/{combobox-D_pkyBdU.js → combobox-ZWRPqCmz.js} +1 -1
- package/dist/client/assets/{command-B-LkMxT6.js → command-CBb61KwU.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BPWHNlmG.js → companion-mcps-section-B4YWrazT.js} +1 -1
- package/dist/client/assets/{config-F8FEDZHV.js → config-e26AxbQy.js} +1 -1
- package/dist/client/assets/{connect-CSAnQalo.js → connect-Cis4Tapn.js} +1 -1
- package/dist/client/assets/{connect-layout-CSKeZ95g.js → connect-layout-Dcio3Lf-.js} +1 -1
- package/dist/client/assets/{connection-Da57b2wi.js → connection-BHqwT0eD.js} +1 -1
- package/dist/client/assets/{connection-card-UvAhqwBj.js → connection-card-C2EkxrBF.js} +1 -1
- package/dist/client/assets/{connection-detail-C-Hcx_Z9.js → connection-detail-jcDwf2ZX.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DyaTkO-i.js → connection-form-helpers-9n8ribSs.js} +1 -1
- package/dist/client/assets/{connections-B2s4aP98.js → connections-D7jA8LjW.js} +1 -1
- package/dist/client/assets/{context-BPEjFj2c.js → context-izLsg2u9.js} +1 -1
- package/dist/client/assets/{context-menu-D65fsibc.js → context-menu-DerEN04P.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-rmBJe-TK.js → create-organization-dialog-CYAsWdo6.js} +1 -1
- package/dist/client/assets/{daily-pulse-39bOcAjW.js → daily-pulse-CnVCBpq0.js} +1 -1
- package/dist/client/assets/{decopilot-CDg-MCtI.js → decopilot-BLnyHUyj.js} +1 -1
- package/dist/client/assets/{device-hint-BckoyQwI.js → device-hint-BELnE8gL.js} +1 -1
- package/dist/client/assets/{dialog-C9YQM7Rb.js → dialog-BrqxKGpn.js} +1 -1
- package/dist/client/assets/{discover-B4mPS-t0.js → discover-CkexzJr8.js} +1 -1
- package/dist/client/assets/{domain-settings-C5SxoG2E.js → domain-settings-BZKJb9dL.js} +1 -1
- package/dist/client/assets/{download-app-dialog-D3HwAGf1.js → download-app-dialog-D4fZwg6L.js} +1 -1
- package/dist/client/assets/{drawer-BbtvDSmI.js → drawer-DnzsJxQZ.js} +1 -1
- package/dist/client/assets/{editor-DiFPb_7W.js → editor-CTFiwz0O.js} +1 -1
- package/dist/client/assets/{empty-state-Jq3vDmCi.js → empty-state-CIlXqsAy.js} +1 -1
- package/dist/client/assets/{empty-state-ChIdoRAZ.js → empty-state-L-fapaGY.js} +1 -1
- package/dist/client/assets/{extract-connection-data-0OXYM8zm.js → extract-connection-data-BojttbHn.js} +1 -1
- package/dist/client/assets/{feature-gate-DyX-49Cz.js → feature-gate-n8g4g4zp.js} +1 -1
- package/dist/client/assets/{feature-paywall-CMm2o9Ho.js → feature-paywall-KXd0tDN_.js} +1 -1
- package/dist/client/assets/{file-explorer-BsD7GHt-.js → file-explorer-BKwSFv0S.js} +1 -1
- package/dist/client/assets/{file-preview-DG7_swxk.js → file-preview-DTF7cqq1.js} +1 -1
- package/dist/client/assets/{file-share-button-d423tG-P.js → file-share-button-YKzQ30pm.js} +1 -1
- package/dist/client/assets/{file-type-icon-Zo3jfkM-.js → file-type-icon-DH3SCrZf.js} +1 -1
- package/dist/client/assets/flat-project-zMUH6pEW.js +1 -0
- package/dist/client/assets/{folder-icon-DrGtPSK9.js → folder-icon-mDaDXy1F.js} +1 -1
- package/dist/client/assets/{form-CYA-1Wz9.js → form-CwmR-nDp.js} +1 -1
- package/dist/client/assets/{gateway-client-DE4QITdV.js → gateway-client-BUVeQ8TP.js} +1 -1
- package/dist/client/assets/{general-C_08074W.js → general-pHKX0mlj.js} +1 -1
- package/dist/client/assets/{home-HCpI5IEw.js → home-DpJ0l_4_.js} +1 -1
- package/dist/client/assets/{icon-button-Cag62vyF.js → icon-button-CLFo5Lxf.js} +1 -1
- package/dist/client/assets/{index-Dm3Ro6iT.js → index-5Z-O-IC_.js} +1 -1
- package/dist/client/assets/{index-BGzd8qMa.js → index-BOU4FVnf.js} +1 -1
- package/dist/client/assets/{index-LffHYdj2.js → index-BQrJviGi.js} +1 -1
- package/dist/client/assets/{index-BiuSAlzd.js → index-BTRkPuaE.js} +5 -5
- package/dist/client/assets/{index-cj3FPIlo.js → index-B_3n7z-z.js} +1 -1
- package/dist/client/assets/{index-DzWyHXO2.js → index-BwZnKcdF.js} +1 -1
- package/dist/client/assets/{index-qFmYqkwW.js → index-CYfmFyzv.js} +3 -3
- package/dist/client/assets/{index-DBg3Da4o.js → index-Cmukyu5i.js} +1 -1
- package/dist/client/assets/{index-UAWA_mBS.js → index-CskCkMle.js} +1 -1
- package/dist/client/assets/{index-BxwNVsQv.js → index-D7BAQWSU.js} +1 -1
- package/dist/client/assets/{index-C-HKqiI5.js → index-D7EpZIyR.js} +1 -1
- package/dist/client/assets/{index-DX971x0F.js → index-DktJOqdm.js} +1 -1
- package/dist/client/assets/{index-C9yvlucI.js → index-DxdM0E0B.js} +1 -1
- package/dist/client/assets/{index-CFxmc0DR.js → index-NRQboip2.js} +1 -1
- package/dist/client/assets/{index-D3bKcVsq.js → index-q1e9PWXS.js} +1 -1
- package/dist/client/assets/{index-redirect-Cms0d9Rf.js → index-redirect-ClcE1C-w.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B7-m24Hr.js → infiniteQueryObserver-DDM1TL4D.js} +1 -1
- package/dist/client/assets/{infra-billing-BD4W3COQ.js → infra-billing-CNDnR1FE.js} +1 -1
- package/dist/client/assets/{input-CYlwvkm5.js → input-BkhtMOai.js} +3 -3
- package/dist/client/assets/{input-CpjWxr53.js → input-C7ggWsLT.js} +1 -1
- package/dist/client/assets/{input-B5d33h6X.js → input-_e15nvFZ.js} +1 -1
- package/dist/client/assets/{integration-icon-BcFb9WXn.js → integration-icon-C5Hxx8nt.js} +1 -1
- package/dist/client/assets/{label-BmSaj4OS.js → label-7CUu5Nng.js} +1 -1
- package/dist/client/assets/{layout-DKTnWTMe.js → layout-l5Dybhax.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CbFqRQlc.js → legacy-agents-deep-CdAR76HP.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-1k1KX6mL.js → legacy-main-redirect-FsmMt53b.js} +1 -1
- package/dist/client/assets/library-8wHr6YwM.js +1 -0
- package/dist/client/assets/{library-tab-rskkU2DA.js → library-tab-D8YaxhRw.js} +1 -1
- package/dist/client/assets/{login-BUVWJTBG.js → login-C-bgG6Sh.js} +1 -1
- package/dist/client/assets/{markdown-D5RcIxaz.js → markdown-B6rsJl8D.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-4bTrB0jF.js → mcp-app-renderer-C1z0J9GI.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-EEuNZg.js → mcp-oauth-DiCqLrTx.js} +1 -1
- package/dist/client/assets/{members-CWz-dF_G.js → members-CP1FamHG.js} +1 -1
- package/dist/client/assets/{memory-BfINHUTl.js → memory-CFfQuPfj.js} +1 -1
- package/dist/client/assets/{message-templates-Cq847r4U.js → message-templates-BLkI2XAu.js} +1 -1
- package/dist/client/assets/{mini-report-page-BxFxCQ_x.js → mini-report-page-DoPdD9qO.js} +1 -1
- package/dist/client/assets/{mock-board-BFAIWkA7.js → mock-board-BTXd0sAw.js} +1 -1
- package/dist/client/assets/{monaco-editor-DrtzucP0.js → monaco-editor-DynJau-q.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DWbeH1RS.js → monitoring-stats-row-DEGIuizb.js} +1 -1
- package/dist/client/assets/{multi-select-BidbKgY6.js → multi-select-BSBfkzHR.js} +1 -1
- package/dist/client/assets/{mustache-Dy9IxQRw.js → mustache-C6B9oTBs.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Dj5TFcCk.js → new-project-dialog-Ch4HsoZn.js} +1 -1
- package/dist/client/assets/{oauth-callback-Diqg-5tw.js → oauth-callback-KXWSibnc.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DdjEQJSy.js → oauth-callback-ai-provider-C9UxxVbB.js} +1 -1
- package/dist/client/assets/{onboarding-BiJRVogp.js → onboarding-NRECAyIG.js} +1 -1
- package/dist/client/assets/{openai-conversation-Cssz-znB.js → openai-conversation-CeIvqTTz.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Bl6nsH4A.js → optimistic-project-sidebar-views-BSGhW_VM.js} +1 -1
- package/dist/client/assets/{org-file-open-context-CTyFwctz.js → org-file-open-context-BXXF2r_W.js} +1 -1
- package/dist/client/assets/{organization-choice-BtNQMYzV.js → organization-choice-B4UdP9Qv.js} +1 -1
- package/dist/client/assets/{orgs-BYnZJx1z.js → orgs-B1zsOJOt.js} +1 -1
- package/dist/client/assets/{page-seo-form-RJHH5jjR.js → page-seo-form-_-ijKB5k.js} +1 -1
- package/dist/client/assets/{pair-PmQIQCBI.js → pair-BCFdDbiP.js} +1 -1
- package/dist/client/assets/{plan-ladder-BbGn-NgZ.js → plan-ladder-CsmVoXQQ.js} +1 -1
- package/dist/client/assets/{popover-DwQhmYZx.js → popover-CrZxQ_WL.js} +1 -1
- package/dist/client/assets/{post-calendar-u9yIz1ap.js → post-calendar-D7geM2YK.js} +1 -1
- package/dist/client/assets/{post-editor-zwUoRB_d.js → post-editor-ChtR1Ltr.js} +1 -1
- package/dist/client/assets/{preview-content-YklxPrDD.js → preview-content-BvBDv3Fi.js} +1 -1
- package/dist/client/assets/{preview-dialog-B6-Ghng-.js → preview-dialog-COx6Lotq.js} +1 -1
- package/dist/client/assets/{profile-DZ3TYytY.js → profile-Bc9S2aAt.js} +1 -1
- package/dist/client/assets/{project-app-view-B13_tHdE.js → project-app-view-ObUx-R3J.js} +1 -1
- package/dist/client/assets/{project-feed-CuWJElvp.js → project-feed-27M9wFaD.js} +1 -1
- package/dist/client/assets/{project-icon-C1TVO88N.js → project-icon-DfxqT1AH.js} +1 -1
- package/dist/client/assets/project-reports-CYg2nuJI.js +1 -0
- package/dist/client/assets/project-tasks-C8uyyfmf.js +1 -0
- package/dist/client/assets/{projects-qlg8VwGy.js → projects-70vA9Ztg.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BBcr5xLl.js → projects-empty-state-DXeCmI_E.js} +1 -1
- package/dist/client/assets/{prompts-IW4xrems.js → prompts-DEQvjN3W.js} +1 -1
- package/dist/client/assets/record-editor-_3tMo9Zr.js +1 -0
- package/dist/client/assets/{redirect-editor-Djr6TkEe.js → redirect-editor-nH8dYkmn.js} +1 -1
- package/dist/client/assets/{reports-DD_aD-uv.js → reports-BXOZrkbg.js} +1 -1
- package/dist/client/assets/reports-Bf-BvYhy.js +1 -0
- package/dist/client/assets/{reports-onboarding-Btv0f8sO.js → reports-onboarding-DL82A2cU.js} +1 -1
- package/dist/client/assets/{reports-tab-DoBMpRJD.js → reports-tab-DO_Lp8eH.js} +2 -2
- package/dist/client/assets/{repositories-ZgvcUEvA.js → repositories-CMKipbLK.js} +1 -1
- package/dist/client/assets/{repository-binding-CQsr_3Zk.js → repository-binding-Bbkm6nc1.js} +1 -1
- package/dist/client/assets/{repository-import-picker-D6vKdpbU.js → repository-import-picker-Cag3a6oY.js} +1 -1
- package/dist/client/assets/{repository-picker-DnfKLU2E.js → repository-picker-CfTYgBDn.js} +1 -1
- package/dist/client/assets/{require-capability-B1clucXi.js → require-capability-DwsTiirz.js} +1 -1
- package/dist/client/assets/{required-auth-layout-5x9XYN7k.js → required-auth-layout-yl3jbIxV.js} +1 -1
- package/dist/client/assets/{reset-password-JId6yrpe.js → reset-password-C5EXdCC7.js} +1 -1
- package/dist/client/assets/{resizable-00FuDjCF.js → resizable-CtYj4VXu.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-Bi-w5DjE.js → resolve-tab-icon-COPKEIag.js} +1 -1
- package/dist/client/assets/{review-settings-IzuHTtkG.js → review-settings-Dpq07FB5.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B3wmUrSm.js → rich-text-link-control-CDJeP4n9.js} +1 -1
- package/dist/client/assets/{roles-6EAMaiCw.js → roles-BCA_WGIg.js} +1 -1
- package/dist/client/assets/{route-Bp7poLJJ.js → route-BIN7HFum.js} +1 -1
- package/dist/client/assets/{route-DcKDacvo.js → route-DR7xqOI0.js} +1 -1
- package/dist/client/assets/route-DTM6T9N4.js +1 -0
- package/dist/client/assets/{runnable-block-editor-BPu9lbHb.js → runnable-block-editor-BaDSgAAv.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-_l6ILxBR.js → sandbox-lifecycle-context-AU726rjo.js} +1 -1
- package/dist/client/assets/{schema-CepQKFSq.js → schema-CUw1risJ.js} +1 -1
- package/dist/client/assets/{scroll-area-BNMPUKzn.js → scroll-area-C2S3fcxE.js} +1 -1
- package/dist/client/assets/{search-input-DroJjkYC.js → search-input-Dd4B3qzf.js} +1 -1
- package/dist/client/assets/{search-toggle-Vpxqce5X.js → search-toggle-CsGviyR_.js} +1 -1
- package/dist/client/assets/{secret-picker-CIV9Pyxx.js → secret-picker-oakuwK6W.js} +1 -1
- package/dist/client/assets/{secrets-Ddw-OUj-.js → secrets-CXgB5-m9.js} +1 -1
- package/dist/client/assets/{sections-editor-B6DapFds.js → sections-editor-D8pxq_yu.js} +1 -1
- package/dist/client/assets/{select-QknS4jya.js → select-C350dwBx.js} +1 -1
- package/dist/client/assets/{select-model-MWiJU5BO.js → select-model-CRWgLGNx.js} +1 -1
- package/dist/client/assets/{seo-editor-BmySIXEZ.js → seo-editor-1V2gYAl_.js} +1 -1
- package/dist/client/assets/{separator-C5QeX-ze.js → separator-CDghQ8gc.js} +1 -1
- package/dist/client/assets/{settings-tab-pWdRgoZd.js → settings-tab-CAkBws58.js} +1 -1
- package/dist/client/assets/{sheet-CuQcjl8J.js → sheet-B2gAUp07.js} +1 -1
- package/dist/client/assets/{shell-layout-DgCL-aOA.js → shell-layout-DT24w4k_.js} +1 -1
- package/dist/client/assets/{skills-C9HRCrz7.js → skills-CyVOwqjn.js} +1 -1
- package/dist/client/assets/{sso-eRxfAwx6.js → sso-CfVGd8zI.js} +1 -1
- package/dist/client/assets/{suggestion-CUAhSpKi.js → suggestion-yycalltA.js} +1 -1
- package/dist/client/assets/{switch-WI6sluFx.js → switch-C4OygJ1j.js} +1 -1
- package/dist/client/assets/{synced-repos-B7M4g-ab.js → synced-repos-CRCUc2yM.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BUy8eStz.js → tab-icon-glyph-CnzBc78s.js} +1 -1
- package/dist/client/assets/{table-DahiKrUr.js → table-BVqziFMU.js} +1 -1
- package/dist/client/assets/{tabs-mZ2AJpie.js → tabs-M4EGpP-K.js} +1 -1
- package/dist/client/assets/{task-board-Cg5OuTdd.js → task-board-Dy1oP9tV.js} +1 -1
- package/dist/client/assets/{task-route-CcdO9T8s.js → task-route-Dya6D_p7.js} +1 -1
- package/dist/client/assets/{task-status--I5ZFulR.js → task-status-uh1TpLCM.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CwIKc_CA.js → taskboard-analytics-dQI3iomY.js} +1 -1
- package/dist/client/assets/{tasks-Cx199_rB.js → tasks-D70uWBSC.js} +1 -1
- package/dist/client/assets/tasks-W04QS25_.js +1 -0
- package/dist/client/assets/{textarea-IAy-ownU.js → textarea-NMcEOyOg.js} +1 -1
- package/dist/client/assets/{thread-analytics-DoucYhij.js → thread-analytics-B54AXYt6.js} +1 -1
- package/dist/client/assets/{thread-button-BS5hFLVf.js → thread-button-CgP5Z586.js} +1 -1
- package/dist/client/assets/{thread-intent-ags1XWir.js → thread-intent-Jf2tKMef.js} +1 -1
- package/dist/client/assets/{thread-route-Cbe9daAp.js → thread-route-DxzVtF_c.js} +1 -1
- package/dist/client/assets/{thread-route-SwwHxRrN.js → thread-route-IxUDda00.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BzLo18UG.js → thread-sheet-body-B8X3wACw.js} +1 -1
- package/dist/client/assets/{toggle-group-C7J6hm1X.js → toggle-group-DpTIfIjE.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-MH5hFCTi.js → toolbar-icon-button-C_PK_Noh.js} +1 -1
- package/dist/client/assets/{tooltip-rVl8jzih.js → tooltip-BJNrweFg.js} +1 -1
- package/dist/client/assets/{track-D9Kj7slb.js → track-BtwjnpVQ.js} +1 -1
- package/dist/client/assets/{types-B77htmoi.js → types-Zvb_HNLy.js} +1 -1
- package/dist/client/assets/{usage-stats-B9NCjY7p.js → usage-stats-N89KL5SR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BBj3hH0A.js → use-ai-providers-Bb-AtX2R.js} +1 -1
- package/dist/client/assets/{use-automations-BMeSuYUl.js → use-automations-CySFN-Fc.js} +1 -1
- package/dist/client/assets/{use-autosave-DddhIIlH.js → use-autosave-DG37V9_z.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CcLE4xPO.js → use-chat-layout-state-CmdNghlG.js} +1 -1
- package/dist/client/assets/{use-clock-tick-WbPH8S5J.js → use-clock-tick-BPnWxYd_.js} +1 -1
- package/dist/client/assets/{use-connect-companion-ooa0I2Ht.js → use-connect-companion-ECuWJz0C.js} +1 -1
- package/dist/client/assets/{use-connection-BJVimXqv.js → use-connection-C0aQTMeC.js} +1 -1
- package/dist/client/assets/{use-copy-XLZP4Fnf.js → use-copy-BVWEkCC-.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-P_mw-sB2.js → use-create-virtual-mcp-DEMYuYyB.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-D1z6vY0T.js → use-date-fns-locale-Bd8PyfIy.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DM7h6lLt.js → use-debounced-autosave-DXb_Ac1O.js} +1 -1
- package/dist/client/assets/{use-debounced-value-PqnB6cMC.js → use-debounced-value-DBJBbNih.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CWMvx_aN.js → use-deco-credits-_QhU-dhT.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-B_Wj2FDs.js → use-decopilot-events-D3bXKKWM.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Ct_NbrFe.js → use-delete-connection-DSFkVlnh.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BrRZ5JXH.js → use-deployment-admin-BruYSdMh.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Ckawo-Vn.js → use-fast-preview-draft-url-ZFU-P35J.js} +1 -1
- package/dist/client/assets/{use-file-configs-BCUJhrSS.js → use-file-configs-RTbLyPOX.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DOZLICG8.js → use-infinite-scroll-opYdDO9U.js} +1 -1
- package/dist/client/assets/{use-join-requests-LL4W5sq2.js → use-join-requests-c0wYTiAF.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CUdUAhvy.js → use-main-panel-tabs-DLoT5JrG.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D_jLHFPt.js → use-mcp-auth-status-Bc_ELMHW.js} +1 -1
- package/dist/client/assets/{use-mcp-client-5sJCC1_2.js → use-mcp-client-DAfDiXAH.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-5OccjpiV.js → use-mcp-prompts-CDl0wJU0.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-cj_8qKci.js → use-mcp-tools-C7pm9vnU.js} +1 -1
- package/dist/client/assets/{use-members-C5RWM84Q.js → use-members-CyU3kEXW.js} +1 -1
- package/dist/client/assets/{use-mobile-D06E6E9A.js → use-mobile-DgFuzdmq.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-2D1RSJEE.js → use-navigate-to-agent-DrZpt_-x.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-CD7nCSQB.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CrzuSkfk.js → use-open-billing-url-C-if4cJf.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CXExidw4.js → use-org-auth-client-C7_w-QfK.js} +1 -1
- package/dist/client/assets/{use-org-fs-BI2aRf-g.js → use-org-fs-CKHreXlO.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DhxRO-sX.js → use-org-repo-syncs-CdOm1Gkh.js} +1 -1
- package/dist/client/assets/{use-org-sso-C8LeExfy.js → use-org-sso-CbL4kkEg.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Z4A7wlo_.js → use-organization-roles-DQ43ZVi5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-0Ql08vCb.js → use-organization-settings-_CCzAfB0.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DvFfVppm.js → use-panel-navigate-DJawwVTN.js} +1 -1
- package/dist/client/assets/{use-project-scope-DJC0Rmd2.js → use-project-scope-BTHyRdHp.js} +1 -1
- package/dist/client/assets/{use-releases-UqMY8RcZ.js → use-releases-BWJN6YTw.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-zVwryKCp.js → use-reports-diagnostic-CiKeDiTH.js} +1 -1
- package/dist/client/assets/{use-secrets-DGDpC9hp.js → use-secrets-CSjuIq4b.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DryOEAAN.js → use-section-preview-base-CeoNtR7i.js} +1 -1
- package/dist/client/assets/{use-session-runtime-Cosw4CCW.js → use-session-runtime-Wyvnx53o.js} +1 -1
- package/dist/client/assets/{use-tags-BCCzUzPa.js → use-tags-C3diByDZ.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CCFQvvsk.js → use-task-board-analytics-Csh4rD2k.js} +1 -1
- package/dist/client/assets/{use-task-board-events-B2orELe0.js → use-task-board-events-BwC1dILR.js} +1 -1
- package/dist/client/assets/{use-task-metadata-8O-Ga8Wr.js → use-task-metadata-DzFvwyIV.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BYmN2LQm.js → use-thread-analytics-DXqO4MwU.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DqnIgfuG.js → use-thread-outputs-C05qBJbv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DZS3Aawa.js +1 -0
- package/dist/client/assets/{useQueries-Cdt1TSyJ.js → useQueries-BcxNFZiu.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DGDEkzHG.js +1 -0
- package/dist/client/assets/{users-BLEnjq5F.js → users-Cc-KY6pD.js} +1 -1
- package/dist/client/assets/{utils-BiBoFq--.js → utils-DPdaJHGR.js} +1 -1
- package/dist/client/assets/{variant-calendar-Csv8MReF.js → variant-calendar-BJjVTz4W.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CdOGya1b.js → variant-matcher-override-CwgRSkJP.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D3nXTaNQ.js → view-mode-toggle-CQqizETf.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DUyYKScq.js → virtual-mcp-BdXZSyI0.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-DI84JCkP.js +0 -1
- package/dist/client/assets/agent-deck-CgsUwnay.js +0 -1
- package/dist/client/assets/agent-library-BMVOMtwg.js +0 -1
- package/dist/client/assets/agent-library-file-Bs_Ov692.js +0 -1
- package/dist/client/assets/agent-settings-JOvgc7kq.js +0 -1
- package/dist/client/assets/agent-site-editor-code-De-iSok_.js +0 -2
- package/dist/client/assets/agent-site-editor-content-Ch2WC4sl.js +0 -9
- package/dist/client/assets/agent-view-BtBtSuEv.js +0 -1
- package/dist/client/assets/api-keys-2hDzDTH9.js +0 -1
- package/dist/client/assets/app-editor-BqD9kpqg.js +0 -1
- package/dist/client/assets/flat-project-DUdVe5OD.js +0 -1
- package/dist/client/assets/library-D9RnFFGm.js +0 -1
- package/dist/client/assets/project-reports-hbeMiS7q.js +0 -1
- package/dist/client/assets/project-tasks-DcinQO1a.js +0 -1
- package/dist/client/assets/record-editor-DZiiw2X4.js +0 -1
- package/dist/client/assets/reports-RkncIczX.js +0 -1
- package/dist/client/assets/route-DLd5XMus.js +0 -1
- package/dist/client/assets/tasks-DQZjFSh-.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-DxwEKp1u.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BAMBgsXo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B_8hQc1u.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,br as ce,j as p,bp as _,bo as T,bm as C,bw as le,bq as de,bJ as ue,bF as fe,by as me}from"./index-
|
|
1
|
+
import{r as l,br as ce,j as p,bp as _,bo as T,bm as C,bw as le,bq as de,bJ as ue,bF as fe,by as me}from"./index-BTRkPuaE.js";import{e as Y}from"./select-C350dwBx.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[H,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],K]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);I(x,y)}function se(x){I(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function I(x,y,{commit:k}={commit:!1}){const F=_e(c),z=Ce(Math.round((x-n)/c)*c+n,F),A=Y(z,[n,s]);K((E=[])=>{const P=xe(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const U=String(P)!==String(E);return U&&k&&d(P),U?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(H.Provider,{scope:e.__scopeSlider,children:p.jsx(H.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&I(n,0,{commit:!0}),onEndKeyDown:()=>!a&&I(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const z=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,E=S[A],P=c*z*y;I(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(w){const S=R.current||i.getBoundingClientRect(),K=[0,S.width],B=O(K,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=D(w.clientX);r?.(S)},onSlideMove:w=>{const S=D(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const K=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:K?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,D=>b(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(H.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ie=q,Ae=te,Te=ne,Ve=oe;export{Ie as R,Ae as T,Te as a,Ve as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,b as j,r as E,j as x,l as K,t as ue,X as Tt,m as vt,K as At,aR as Mt,h as Xe}from"./index-BiuSAlzd.js";import{a as St,E as ie,j as Ct,h as Je,S as Rt,r as P,t as Et,v as $t,w as Ye,x as N,y as Ee,z as _t,A as Lt,B as $e,C as It,G as Z,N as D,m as H,H as Y,T as et,R as ke,I as be,J as zt,K as Pt,L as Ht,O as jt,s as Nt,Q as Ot,U as Bt,u as Dt,b as Ft}from"./index-DX971x0F.js";import{T as _,n as qt,i as Wt,E as Ut}from"./rich-text-link-control-B3wmUrSm.js";import{a as Gt,e as tt,s as Zt,S as Kt}from"./suggestion-CUAhSpKi.js";import{B as Vt,c as Qt,t as Xt,C as nt,f as Jt,g as _e,s as Yt,m as Le,a as Ie,b as en,d as ze,e as tn,h as nn,i as rn,j as sn,k as an,l as on,n as ln}from"./index-DzWyHXO2.js";import{ac as cn,ad as un,af as hn,I as dn,b7 as pn,aX as fn}from"./agent-icon-DEoEcQYL.js";import{i as gn}from"./XClose-BqRoe3QG.js";import{i as mn}from"./Check-Cf-cMW3t.js";import{i as kn}from"./Link01-iwXPIeVc.js";import{s as bn}from"./Trash01-BfnCKCGB.js";import{i as xn,b as wn}from"./use-org-fs-BI2aRf-g.js";import{E as Pe,i as rt,a as yn,b as Tn,A as vn,c as An,m as Mn,d as Sn,e as Cn}from"./markdown-D5RcIxaz.js";import{i as st}from"./X-C52mq3mn.js";import{A as Rn}from"./avatar-BeFEVdWT.js";import{f as En,C as $n,c as _n,a as Ln,b as In}from"./command-B-LkMxT6.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-CXExidw4.js";import{I as Hn}from"./icon-button-Cag62vyF.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,c]=E.useState(!1);let u;e[0]!==n?(u=n.isActive("link"),e[0]=n,e[1]=u):u=e[1];const h=u;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),c(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=qt(a);if(M===""){g();return}if(!Wt(M)){c(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),c(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:K("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(mn,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=St(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let c;e[4]!==r?(c=r("markdownEditor.heading2"),e[4]=r,e[5]=c):c=e[5];let u;e[6]!==r?(u=r("markdownEditor.heading3"),e[6]=r,e[7]=u):u=e[7];let h;e[8]!==o||e[9]!==c||e[10]!==u?(h={1:o,2:c,3:u},e[8]=o,e[9]=c,e[10]=u,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Vt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(cn,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(dn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(gn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=rt(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const c=l?yn:Tn,u=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:c,files:[new File([a],u,{type:a.type})]}),r(`${c}/${u}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Je("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Ct({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Zn(t,e){return ee.getState(t)?.get(e)}function Kn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,c=t.state.doc.resolve(e),u=c.parent.textBetween(Math.max(0,c.parentOffset-1),c.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...u&&!/\s/.test(u)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Rt.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Vn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=rt(g);Kn(h,Zn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Vn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,V=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:V,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",V).replace("heading",` *#{1,6} *[^
|
|
1
|
+
import{c as $,b as j,r as E,j as x,l as K,t as ue,X as Tt,m as vt,K as At,aR as Mt,h as Xe}from"./index-BTRkPuaE.js";import{a as St,E as ie,j as Ct,h as Je,S as Rt,r as P,t as Et,v as $t,w as Ye,x as N,y as Ee,z as _t,A as Lt,B as $e,C as It,G as Z,N as D,m as H,H as Y,T as et,R as ke,I as be,J as zt,K as Pt,L as Ht,O as jt,s as Nt,Q as Ot,U as Bt,u as Dt,b as Ft}from"./index-DktJOqdm.js";import{T as _,n as qt,i as Wt,E as Ut}from"./rich-text-link-control-CDJeP4n9.js";import{a as Gt,e as tt,s as Zt,S as Kt}from"./suggestion-yycalltA.js";import{B as Vt,c as Qt,t as Xt,C as nt,f as Jt,g as _e,s as Yt,m as Le,a as Ie,b as en,d as ze,e as tn,h as nn,i as rn,j as sn,k as an,l as on,n as ln}from"./index-BwZnKcdF.js";import{ac as cn,ad as un,af as hn,I as dn,b7 as pn,aX as fn}from"./agent-icon-BJAncODg.js";import{i as gn}from"./XClose-DTOuD_e7.js";import{i as mn}from"./Check-CZYLh537.js";import{i as kn}from"./Link01-BK2WDfDE.js";import{s as bn}from"./Trash01-C2tQl3wO.js";import{i as xn,b as wn}from"./use-org-fs-CKHreXlO.js";import{E as Pe,i as rt,a as yn,b as Tn,A as vn,c as An,m as Mn,d as Sn,e as Cn}from"./markdown-B6rsJl8D.js";import{i as st}from"./X-CHFG7-mU.js";import{A as Rn}from"./avatar-CmjVNkwN.js";import{f as En,C as $n,c as _n,a as Ln,b as In}from"./command-CBb61KwU.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-C7_w-QfK.js";import{I as Hn}from"./icon-button-CLFo5Lxf.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,c]=E.useState(!1);let u;e[0]!==n?(u=n.isActive("link"),e[0]=n,e[1]=u):u=e[1];const h=u;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),c(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=qt(a);if(M===""){g();return}if(!Wt(M)){c(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),c(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:K("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(mn,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=St(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let c;e[4]!==r?(c=r("markdownEditor.heading2"),e[4]=r,e[5]=c):c=e[5];let u;e[6]!==r?(u=r("markdownEditor.heading3"),e[6]=r,e[7]=u):u=e[7];let h;e[8]!==o||e[9]!==c||e[10]!==u?(h={1:o,2:c,3:u},e[8]=o,e[9]=c,e[10]=u,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Vt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(cn,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(dn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(gn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=rt(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const c=l?yn:Tn,u=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:c,files:[new File([a],u,{type:a.type})]}),r(`${c}/${u}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Je("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Ct({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Zn(t,e){return ee.getState(t)?.get(e)}function Kn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,c=t.state.doc.resolve(e),u=c.parent.textBetween(Math.max(0,c.parentOffset-1),c.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...u&&!/\s/.test(u)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Rt.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Vn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=rt(g);Kn(h,Zn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Vn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,V=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:V,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",V).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ur=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ut=/^( {2,}|\\)\n(?!\s*$)/,dr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,Me=/[^\s\p{P}\p{S}]/u,pr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),ht=/(?!~)[\p{P}\p{S}]/u,fr=/(?!~)[\s\p{P}\p{S}]/u,gr=/(?:[^\s\p{P}\p{S}]|~)/u,mr=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kr=A(dt,"u").replace(/punct/g,q).getRegex(),br=A(dt,"u").replace(/punct/g,ht).getRegex(),pt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=A(pt,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,q).getRegex(),wr=A(pt,"gu").replace(/notPunctSpace/g,gr).replace(/punctSpace/g,fr).replace(/punct/g,ht).getRegex(),yr=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,q).getRegex(),Tr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,q).getRegex(),vr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ar=A(vr,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,q).getRegex(),Mr=A(/\\(punct)/,"gu").replace(/punct/g,q).getRegex(),Sr=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cr=A(ve).replace("(?:-->|$)","-->").getRegex(),Rr=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Er=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ft=A(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),gt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),$r=A("reflink|nolink(?!\\()","g").replace("reflink",ft).replace("nolink",gt).getRegex(),Ne=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Se={_backpedal:O,anyPunctuation:Mr,autolink:Sr,blockSkip:mr,br:ut,code:hr,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:kr,emStrongRDelimAst:xr,emStrongRDelimUnd:yr,escape:ur,link:Er,nolink:gt,punctuation:pr,reflink:ft,reflinkSearch:$r,tag:Rr,text:dr,url:O},_r={...Se,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},de={...Se,emStrongRDelimAst:wr,emStrongLDelim:br,delLDelim:Tr,delRDelim:Ar,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ne).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ne).getRegex()},Lr={...de,br:A(ut).replace("{2,}","*").getRegex(),text:A(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Ae,gfm:lr,pedantic:cr},W={normal:Se,gfm:de,breaks:Lr,pedantic:_r},Ir={"&":"&","<":"<",">":">",'"':""","'":"'"},Oe=t=>Ir[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Oe)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Oe);return t}function Be(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function De(t,e){let n=t.replace(R.findPipe,(i,a,l)=>{let o=!1,c=a;for(;--c>=0&&l[c]==="\\";)o=!o;return o?"|":" |"}),r=n.split(R.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(R.slashPipe,"|");return r}function U(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function zr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Fe(t,e,n,r,s){let i=e.href,a=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Hr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
|
3
3
|
`).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
4
4
|
`)}var ne=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:U(n,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,U as X,V as Q,b as q,X as Z,Y as ee,k as te,j as s,L as ne,n as G,r as F,d as se,ax as ae,E as oe,P as I,aM as ie,B as le}from"./index-BiuSAlzd.js";import{u as re}from"./use-mobile-D06E6E9A.js";import{m as ce,a as ue,u as de,t as fe}from"./thread-button-BS5hFLVf.js";import{a as Y,R as he,b as me}from"./resizable-00FuDjCF.js";import{f as pe,d as ge,m as be}from"./use-chat-layout-state-CcLE4xPO.js";import{J as xe,k as ye}from"./agent-icon-DEoEcQYL.js";import{s as je}from"./XClose-BqRoe3QG.js";import{I as Se}from"./icon-button-Cag62vyF.js";import{b as ve,T as Ce,a as Te}from"./tooltip-rVl8jzih.js";import{T as U}from"./toolbar-icon-button-MH5hFCTi.js";import{a as Le}from"./use-project-scope-DJC0Rmd2.js";import{c as Ne}from"./repository-binding-CQsr_3Zk.js";function W(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=O.c(8);let i;a[0]!==e?(i=c=>W(c,e),a[0]=e,a[1]=i):i=a[1];const[t,n]=X(l,i);let o;a[2]!==e||a[3]!==t?(o=W(t,e),a[2]=e,a[3]=t,a[4]=o):o=a[4];let r;return a[5]!==n||a[6]!==o?(r=[o,n],a[5]=n,a[6]=o,a[7]=r):r=a[7],r}const ze=33;function _e(){const l=O.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=Q.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function Oe(l){const e=O.c(60),{actions:a,navigation:i}=l,t=q(),{org:n}=Z(),o=Le(),r=Ne(o),c=ce(),{toggleSidebar:d}=ue(),u=de(),f=J(),h=ee();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={select:Ee},e[0]=g):g=e[0];const y=te(g),b=y?.mainView==="overview";let N;e[1]!==r?.title||e[2]!==t?(N=r?.title??t("common.loading"),e[1]=r?.title,e[2]=t,e[3]=N):N=e[3];const m=N;let _;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==m||e[7]!==o||e[8]!==t?(_=b?o?m:t("sidebar.navDestinations.home"):t(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=m,e[7]=o,e[8]=t,e[9]=_):_=e[9];const S=_;let v;e[10]!==n.slug||e[11]!==h||e[12]!==o?(v=h?{to:"/$org/projects",params:{org:n.slug},search:{project:o??void 0}}:{to:"/$org/projects/$agentId",params:{org:n.slug,agentId:o??""}},e[10]=n.slug,e[11]=h,e[12]=o,e[13]=v):v=e[13];const x=v;let j;if(e[14]!==c||e[15]!==b||e[16]!==n.slug||e[17]!==x||e[18]!==m||e[19]!==o||e[20]!==t||e[21]!==S){if(j=[],c){let L;e[23]!==t?(L=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=L):L=e[24];let k;e[25]!==n.slug?(k={to:"/$org/settings/general",params:{org:n.slug}},e[25]=n.slug,e[26]=k):k=e[26];let $;e[27]!==L||e[28]!==k?($={key:"settings",label:L,link:k},e[27]=L,e[28]=k,e[29]=$):$=e[29],j.push($)}else if(o&&!b){let L;e[30]!==x||e[31]!==m?(L={key:"project",label:m,link:x},e[30]=x,e[31]=m,e[32]=L):L=e[32],j.push(L)}let B;e[33]!==S?(B={key:"page",label:S},e[33]=S,e[34]=B):B=e[34],j.push(B),e[14]=c,e[15]=b,e[16]=n.slug,e[17]=x,e[18]=m,e[19]=o,e[20]=t,e[21]=S,e[22]=j}else j=e[22];let p;e[35]!==x||e[36]!==o||e[37]!==t||e[38]!==u?(p=u&&o&&s.jsx(Se,{label:t("projects.flat.close"),asChild:!0,children:s.jsx(ne,{...x,children:s.jsx(je,{size:16})})}),e[35]=x,e[36]=o,e[37]=t,e[38]=u,e[39]=p):p=e[39];const C=p;let P;e[40]!==f||e[41]!==t||e[42]!==u?(P=u&&f&&s.jsxs(ve,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(U,{"aria-label":t(f.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":f.threadOpen,active:f.threadOpen,onClick:f.toggleThread,children:s.jsx(xe,{size:16})})}),s.jsx(Te,{side:"bottom",children:t(f.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=f,e[41]=t,e[42]=u,e[43]=P):P=e[43];const T=P;let z;e[44]!==t?(z=t("layouts.shellControls.toggleSidebar"),e[44]=t,e[45]=z):z=e[45];let A;e[46]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ye,{size:16}),e[46]=A):A=e[46];let E;e[47]!==z||e[48]!==d?(E=s.jsx(U,{className:"md:hidden",onClick:d,"aria-label":z,children:A}),e[47]=z,e[48]=d,e[49]=E):E=e[49];let w;e[50]!==T||e[51]!==E?(w=s.jsxs(s.Fragment,{children:[E,T]}),e[50]=T,e[51]=E,e[52]=w):w=e[52];let R;return e[53]!==a||e[54]!==j||e[55]!==C||e[56]!==i||e[57]!==n.name||e[58]!==w?(R=s.jsx(G.Header,{leading:w,breadcrumbs:j,scope:n.name,actions:a,trailingActions:C,navigation:i}),e[53]=a,e[54]=j,e[55]=C,e[56]=i,e[57]=n.name,e[58]=w,e[59]=R):R=e[59],R}function Ee(l){return l.matches.findLast(we)?.staticData}function we(l){return l.staticData.pageTitle}const M="chat-layout-thread",D="chat-layout-content",K=F.createContext(null);function ke(){return H()}function J(){return F.use(K)}function H(){const l=F.use(K);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=O.c(25),{children:a,...i}=l,t=re(),n=se(),o=F.useRef(null),[r,c]=_e(),{threadOpen:d,contentOpen:u}=i,f=pe(i),h=d&&u?r:f.side,g=100-h,y=p=>{const C=p.getLayout(),P=C[M],T=C[D];typeof P!="number"||typeof T!="number"||Math.abs(P-h)<.001&&Math.abs(T-g)<.001||p.setLayout({[M]:h,[D]:g})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let N;e[0]!==t||e[1]!==i||e[2]!==b?(N={...i,isMobile:t,mobileSurface:b},e[0]=t,e[1]=i,e[2]=b,e[3]=N):N=e[3];const m=N,_=t?m.mobileSurface==="chat":d;let S;e[4]!==t||e[5]!==i||e[6]!==n||e[7]!==m?(S=()=>{t?n({to:".",search:p=>({...p,...be(m.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()},e[4]=t,e[5]=i,e[6]=n,e[7]=m,e[8]=S):S=e[8];let v;e[9]!==_||e[10]!==S?(v=s.jsx(fe,{open:_,onToggle:S}),e[9]=_,e[10]=S,e[11]=v):v=e[11];let x;e[12]!==a||e[13]!==u||e[14]!==g||e[15]!==t||e[16]!==c||e[17]!==y||e[18]!==d||e[19]!==h?(x=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(he,{ref:p=>{if(o.current=p,!p)return;let C=!0;return queueMicrotask(()=>{C&&y(p)}),()=>{C=!1,o.current===p&&(o.current=null)}},defaultLayout:{[M]:h,[D]:g},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,C)=>{const{isUserInteraction:P}=C;if(!P){const z=o.current;z&&y(z);return}const T=p[M];d&&u&&typeof T=="number"&&T>0&&T<100&&c(T)},children:a}),e[12]=a,e[13]=u,e[14]=g,e[15]=t,e[16]=c,e[17]=y,e[18]=d,e[19]=h,e[20]=x):x=e[20];let j;return e[21]!==v||e[22]!==x||e[23]!==m?(j=s.jsxs(K,{value:m,children:[v,x]}),e[21]=v,e[22]=x,e[23]=m,e[24]=j):j=e[24],j}function Me(l){const e=O.c(16),{children:a,topbar:i}=l,t=H();if(t.isMobile){let f;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==i?(f=t.mobileSurface==="chat"?s.jsxs(I,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(I.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=i,e[3]=f):f=e[3],f}const n=t.threadOpen?"":void 0;let o;e[4]!==a||e[5]!==t.threadOpen||e[6]!==i?(o=t.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(I.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=i,e[7]=o):o=e[7];let r;e[8]!==o?(r=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(I,{"data-testid":"side-panel",children:o})}),e[8]=o,e[9]=r):r=e[9];let c;e[10]!==n||e[11]!==r?(c=s.jsx(Y,{id:M,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n,className:"min-w-0 overflow-hidden bg-sidebar",children:r}),e[10]=n,e[11]=r,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(me,{className:"bg-sidebar"}),e[13]=d):d=e[13];let u;return e[14]!==c?(u=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=u):u=e[15],u}function Ae({children:l,routeId:e}){return l}function V(l){const e=O.c(25),{children:a,actions:i,drawer:t}=l,n=H();if(n.isMobile&&n.mobileSurface!=="main")return null;const o=n.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==n.contentActions?(r=s.jsxs(s.Fragment,{children:[n.contentActions,i]}),e[0]=i,e[1]=n.contentActions,e[2]=r):r=e[2];let c;e[3]!==n.contentNavigation||e[4]!==r?(c=s.jsx(Oe,{navigation:n.contentNavigation,actions:r}),e[3]=n.contentNavigation,e[4]=r,e[5]=c):c=e[5];let d;e[6]!==a||e[7]!==n.contentKey?(d=s.jsx(ae,{children:s.jsx(Ae,{routeId:n.contentKey,children:a})}),e[6]=a,e[7]=n.contentKey,e[8]=d):d=e[8];let u;e[9]!==n.contentKey||e[10]!==d?(u=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(oe,{children:d},n.contentKey)}),e[9]=n.contentKey,e[10]=d,e[11]=u):u=e[11];let f;e[12]!==t||e[13]!==u?(f=s.jsxs(I.Content,{children:[u,t]}),e[12]=t,e[13]=u,e[14]=f):f=e[14];let h;e[15]!==c||e[16]!==f?(h=s.jsxs(G.Breadcrumbs.Provider,{children:[c,f]}),e[15]=c,e[16]=f,e[17]=h):h=e[17];let g;e[18]!==o||e[19]!==h?(g=s.jsx(I,{"data-testid":"main-panel",variant:o,children:h}),e[18]=o,e[19]=h,e[20]=g):g=e[20];const y=g;let b;return e[21]!==n.contentOpen||e[22]!==n.isMobile||e[23]!==y?(b=n.isMobile?y:s.jsx(Y,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsx("div",{className:"h-full min-h-0 p-0.5",children:y})}),e[21]=n.contentOpen,e[22]=n.isMobile,e[23]=y,e[24]=b):b=e[24],b}function Re(){const l=O.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function Be(l){const e=O.c(18),{error:a,reset:i}=l,t=q();let n;e[0]!==t?(n=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=n):n=e[1];let o;e[2]!==n?(o=s.jsx("h2",{className:"text-lg font-medium",children:n}),e[2]=n,e[3]=o):o=e[3];let r;e[4]!==a.message||e[5]!==t?(r=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=r):r=e[6];let c;e[7]!==r?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let u;e[11]!==i||e[12]!==d?(u=s.jsx(le,{variant:"outline",onClick:i,children:d}),e[11]=i,e[12]=d,e[13]=u):u=e[13];let f;return e[14]!==o||e[15]!==c||e[16]!==u?(f=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[o,c,u]})}),e[14]=o,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}const $e=Object.assign(Ie,{Thread:Me,Content:V}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:$e,ChatLayoutError:Be,ChatLayoutPending:Re,useChatLayout:ke,useOptionalChatLayout:J},Symbol.toStringTag,{value:"Module"}));export{$e as C,Oe as R,Qe as i};
|
|
1
|
+
import{c as O,U as X,V as Q,b as q,X as Z,Y as ee,k as te,j as s,L as ne,n as G,r as F,d as se,ax as ae,E as oe,P as I,aM as ie,B as le}from"./index-BTRkPuaE.js";import{u as re}from"./use-mobile-DgFuzdmq.js";import{m as ce,a as ue,u as de,t as fe}from"./thread-button-CgP5Z586.js";import{a as Y,R as he,b as me}from"./resizable-CtYj4VXu.js";import{f as pe,d as ge,m as be}from"./use-chat-layout-state-CmdNghlG.js";import{J as xe,k as ye}from"./agent-icon-BJAncODg.js";import{s as je}from"./XClose-DTOuD_e7.js";import{I as Se}from"./icon-button-CLFo5Lxf.js";import{b as ve,T as Ce,a as Te}from"./tooltip-BJNrweFg.js";import{T as U}from"./toolbar-icon-button-C_PK_Noh.js";import{a as Le}from"./use-project-scope-BTHyRdHp.js";import{c as Ne}from"./repository-binding-Bbkm6nc1.js";function W(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=O.c(8);let i;a[0]!==e?(i=c=>W(c,e),a[0]=e,a[1]=i):i=a[1];const[t,n]=X(l,i);let o;a[2]!==e||a[3]!==t?(o=W(t,e),a[2]=e,a[3]=t,a[4]=o):o=a[4];let r;return a[5]!==n||a[6]!==o?(r=[o,n],a[5]=n,a[6]=o,a[7]=r):r=a[7],r}const ze=33;function _e(){const l=O.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=Q.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function Oe(l){const e=O.c(60),{actions:a,navigation:i}=l,t=q(),{org:n}=Z(),o=Le(),r=Ne(o),c=ce(),{toggleSidebar:d}=ue(),u=de(),f=J(),h=ee();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={select:Ee},e[0]=g):g=e[0];const y=te(g),b=y?.mainView==="overview";let N;e[1]!==r?.title||e[2]!==t?(N=r?.title??t("common.loading"),e[1]=r?.title,e[2]=t,e[3]=N):N=e[3];const m=N;let _;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==m||e[7]!==o||e[8]!==t?(_=b?o?m:t("sidebar.navDestinations.home"):t(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=m,e[7]=o,e[8]=t,e[9]=_):_=e[9];const S=_;let v;e[10]!==n.slug||e[11]!==h||e[12]!==o?(v=h?{to:"/$org/projects",params:{org:n.slug},search:{project:o??void 0}}:{to:"/$org/projects/$agentId",params:{org:n.slug,agentId:o??""}},e[10]=n.slug,e[11]=h,e[12]=o,e[13]=v):v=e[13];const x=v;let j;if(e[14]!==c||e[15]!==b||e[16]!==n.slug||e[17]!==x||e[18]!==m||e[19]!==o||e[20]!==t||e[21]!==S){if(j=[],c){let L;e[23]!==t?(L=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=L):L=e[24];let k;e[25]!==n.slug?(k={to:"/$org/settings/general",params:{org:n.slug}},e[25]=n.slug,e[26]=k):k=e[26];let $;e[27]!==L||e[28]!==k?($={key:"settings",label:L,link:k},e[27]=L,e[28]=k,e[29]=$):$=e[29],j.push($)}else if(o&&!b){let L;e[30]!==x||e[31]!==m?(L={key:"project",label:m,link:x},e[30]=x,e[31]=m,e[32]=L):L=e[32],j.push(L)}let B;e[33]!==S?(B={key:"page",label:S},e[33]=S,e[34]=B):B=e[34],j.push(B),e[14]=c,e[15]=b,e[16]=n.slug,e[17]=x,e[18]=m,e[19]=o,e[20]=t,e[21]=S,e[22]=j}else j=e[22];let p;e[35]!==x||e[36]!==o||e[37]!==t||e[38]!==u?(p=u&&o&&s.jsx(Se,{label:t("projects.flat.close"),asChild:!0,children:s.jsx(ne,{...x,children:s.jsx(je,{size:16})})}),e[35]=x,e[36]=o,e[37]=t,e[38]=u,e[39]=p):p=e[39];const C=p;let P;e[40]!==f||e[41]!==t||e[42]!==u?(P=u&&f&&s.jsxs(ve,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(U,{"aria-label":t(f.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":f.threadOpen,active:f.threadOpen,onClick:f.toggleThread,children:s.jsx(xe,{size:16})})}),s.jsx(Te,{side:"bottom",children:t(f.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=f,e[41]=t,e[42]=u,e[43]=P):P=e[43];const T=P;let z;e[44]!==t?(z=t("layouts.shellControls.toggleSidebar"),e[44]=t,e[45]=z):z=e[45];let A;e[46]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ye,{size:16}),e[46]=A):A=e[46];let E;e[47]!==z||e[48]!==d?(E=s.jsx(U,{className:"md:hidden",onClick:d,"aria-label":z,children:A}),e[47]=z,e[48]=d,e[49]=E):E=e[49];let w;e[50]!==T||e[51]!==E?(w=s.jsxs(s.Fragment,{children:[E,T]}),e[50]=T,e[51]=E,e[52]=w):w=e[52];let R;return e[53]!==a||e[54]!==j||e[55]!==C||e[56]!==i||e[57]!==n.name||e[58]!==w?(R=s.jsx(G.Header,{leading:w,breadcrumbs:j,scope:n.name,actions:a,trailingActions:C,navigation:i}),e[53]=a,e[54]=j,e[55]=C,e[56]=i,e[57]=n.name,e[58]=w,e[59]=R):R=e[59],R}function Ee(l){return l.matches.findLast(we)?.staticData}function we(l){return l.staticData.pageTitle}const M="chat-layout-thread",D="chat-layout-content",K=F.createContext(null);function ke(){return H()}function J(){return F.use(K)}function H(){const l=F.use(K);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=O.c(25),{children:a,...i}=l,t=re(),n=se(),o=F.useRef(null),[r,c]=_e(),{threadOpen:d,contentOpen:u}=i,f=pe(i),h=d&&u?r:f.side,g=100-h,y=p=>{const C=p.getLayout(),P=C[M],T=C[D];typeof P!="number"||typeof T!="number"||Math.abs(P-h)<.001&&Math.abs(T-g)<.001||p.setLayout({[M]:h,[D]:g})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let N;e[0]!==t||e[1]!==i||e[2]!==b?(N={...i,isMobile:t,mobileSurface:b},e[0]=t,e[1]=i,e[2]=b,e[3]=N):N=e[3];const m=N,_=t?m.mobileSurface==="chat":d;let S;e[4]!==t||e[5]!==i||e[6]!==n||e[7]!==m?(S=()=>{t?n({to:".",search:p=>({...p,...be(m.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()},e[4]=t,e[5]=i,e[6]=n,e[7]=m,e[8]=S):S=e[8];let v;e[9]!==_||e[10]!==S?(v=s.jsx(fe,{open:_,onToggle:S}),e[9]=_,e[10]=S,e[11]=v):v=e[11];let x;e[12]!==a||e[13]!==u||e[14]!==g||e[15]!==t||e[16]!==c||e[17]!==y||e[18]!==d||e[19]!==h?(x=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(he,{ref:p=>{if(o.current=p,!p)return;let C=!0;return queueMicrotask(()=>{C&&y(p)}),()=>{C=!1,o.current===p&&(o.current=null)}},defaultLayout:{[M]:h,[D]:g},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,C)=>{const{isUserInteraction:P}=C;if(!P){const z=o.current;z&&y(z);return}const T=p[M];d&&u&&typeof T=="number"&&T>0&&T<100&&c(T)},children:a}),e[12]=a,e[13]=u,e[14]=g,e[15]=t,e[16]=c,e[17]=y,e[18]=d,e[19]=h,e[20]=x):x=e[20];let j;return e[21]!==v||e[22]!==x||e[23]!==m?(j=s.jsxs(K,{value:m,children:[v,x]}),e[21]=v,e[22]=x,e[23]=m,e[24]=j):j=e[24],j}function Me(l){const e=O.c(16),{children:a,topbar:i}=l,t=H();if(t.isMobile){let f;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==i?(f=t.mobileSurface==="chat"?s.jsxs(I,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(I.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=i,e[3]=f):f=e[3],f}const n=t.threadOpen?"":void 0;let o;e[4]!==a||e[5]!==t.threadOpen||e[6]!==i?(o=t.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(I.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=i,e[7]=o):o=e[7];let r;e[8]!==o?(r=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(I,{"data-testid":"side-panel",children:o})}),e[8]=o,e[9]=r):r=e[9];let c;e[10]!==n||e[11]!==r?(c=s.jsx(Y,{id:M,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n,className:"min-w-0 overflow-hidden bg-sidebar",children:r}),e[10]=n,e[11]=r,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(me,{className:"bg-sidebar"}),e[13]=d):d=e[13];let u;return e[14]!==c?(u=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=u):u=e[15],u}function Ae({children:l,routeId:e}){return l}function V(l){const e=O.c(25),{children:a,actions:i,drawer:t}=l,n=H();if(n.isMobile&&n.mobileSurface!=="main")return null;const o=n.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==n.contentActions?(r=s.jsxs(s.Fragment,{children:[n.contentActions,i]}),e[0]=i,e[1]=n.contentActions,e[2]=r):r=e[2];let c;e[3]!==n.contentNavigation||e[4]!==r?(c=s.jsx(Oe,{navigation:n.contentNavigation,actions:r}),e[3]=n.contentNavigation,e[4]=r,e[5]=c):c=e[5];let d;e[6]!==a||e[7]!==n.contentKey?(d=s.jsx(ae,{children:s.jsx(Ae,{routeId:n.contentKey,children:a})}),e[6]=a,e[7]=n.contentKey,e[8]=d):d=e[8];let u;e[9]!==n.contentKey||e[10]!==d?(u=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(oe,{children:d},n.contentKey)}),e[9]=n.contentKey,e[10]=d,e[11]=u):u=e[11];let f;e[12]!==t||e[13]!==u?(f=s.jsxs(I.Content,{children:[u,t]}),e[12]=t,e[13]=u,e[14]=f):f=e[14];let h;e[15]!==c||e[16]!==f?(h=s.jsxs(G.Breadcrumbs.Provider,{children:[c,f]}),e[15]=c,e[16]=f,e[17]=h):h=e[17];let g;e[18]!==o||e[19]!==h?(g=s.jsx(I,{"data-testid":"main-panel",variant:o,children:h}),e[18]=o,e[19]=h,e[20]=g):g=e[20];const y=g;let b;return e[21]!==n.contentOpen||e[22]!==n.isMobile||e[23]!==y?(b=n.isMobile?y:s.jsx(Y,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsx("div",{className:"h-full min-h-0 p-0.5",children:y})}),e[21]=n.contentOpen,e[22]=n.isMobile,e[23]=y,e[24]=b):b=e[24],b}function Re(){const l=O.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function Be(l){const e=O.c(18),{error:a,reset:i}=l,t=q();let n;e[0]!==t?(n=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=n):n=e[1];let o;e[2]!==n?(o=s.jsx("h2",{className:"text-lg font-medium",children:n}),e[2]=n,e[3]=o):o=e[3];let r;e[4]!==a.message||e[5]!==t?(r=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=r):r=e[6];let c;e[7]!==r?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let u;e[11]!==i||e[12]!==d?(u=s.jsx(le,{variant:"outline",onClick:i,children:d}),e[11]=i,e[12]=d,e[13]=u):u=e[13];let f;return e[14]!==o||e[15]!==c||e[16]!==u?(f=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[o,c,u]})}),e[14]=o,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}const $e=Object.assign(Ie,{Thread:Me,Content:V}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:$e,ChatLayoutError:Be,ChatLayoutPending:Re,useChatLayout:ke,useOptionalChatLayout:J},Symbol.toStringTag,{value:"Module"}));export{$e as C,Oe as R,Qe as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{co as _}from"./index-
|
|
1
|
+
import{co as _}from"./index-BTRkPuaE.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as fo,r as F,b as cc,as as Hf,j as R,h as Vf,B as cl,av as ul,au as jf,at as Wf,en as uc,eo as Kf,aR as Uf,ep as Kt,eq as _f,l as dc}from"./index-BiuSAlzd.js";import{d as qf,g as Jf}from"./gateway-client-DE4QITdV.js";import{d as Gf,c as Yf,e as Xf,b as Qf,D as Zf}from"./dialog-C9YQM7Rb.js";import{a as eh,F as th,b as nh,c as rh,d as ih,f as sh}from"./form-CYA-1Wz9.js";import{I as oh}from"./input-B5d33h6X.js";import{t as dl}from"./utils-CVEq3hMx.js";import{a as lh}from"./org-file-open-context-CTyFwctz.js";import{T as ah,a as ch,b as uh}from"./tooltip-rVl8jzih.js";function dh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?ul().min(1,e):ul();return jf(n)}function fh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function yx(t){const e=fo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=F.useId(),l=cc();let a,c;if(e[0]!==n||e[1]!==l){const ie=dh(n,l("chat.dialogPromptArguments.required"));c=Wf,a=Hf(ie),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?fh(n,s):{},e[4]=s,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ie=>{await i(ie),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ie=>{ie||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||qf(n.name,Jf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=R.jsx(Gf,{children:R.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let T;e[25]!==n.description?(T=n.description&&R.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=T):T=e[26];let N;e[27]!==T||e[28]!==C?(N=R.jsxs(Yf,{children:[C,T]}),e[27]=T,e[28]=C,e[29]=N):N=e[29];let v;e[30]!==f||e[31]!==m?(v=ie=>{ie.stopPropagation(),f.handleSubmit(m)(ie)},e[30]=f,e[31]=m,e[32]=v):v=e[32];let O;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ie;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ie=Le=>R.jsx(th,{control:f.control,name:Le.name,render:En=>{const{field:We}=En;return R.jsxs(nh,{children:[R.jsxs(rh,{className:"text-xs",children:[Le.name,Le.required?null:R.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),R.jsx(ih,{children:R.jsx(oh,{...We,value:We.value??"",required:Le.required,placeholder:Le.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),R.jsx(sh,{})]})}},Le.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ie):ie=e[41],O=p.map(ie),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=O}else O=e[37];let P;e[42]!==b?(P=()=>b(!1),e[42]=b,e[43]=P):P=e[43];const _=f.formState.isSubmitting;let ne;e[44]!==l?(ne=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=ne):ne=e[45];let ce;e[46]!==f.formState.isSubmitting||e[47]!==P||e[48]!==ne?(ce=R.jsx(cl,{type:"button",variant:"ghost",onClick:P,disabled:_,children:ne}),e[46]=f.formState.isSubmitting,e[47]=P,e[48]=ne,e[49]=ce):ce=e[49];let H;e[50]!==f.formState.isSubmitting||e[51]!==l?(H=f.formState.isSubmitting?R.jsxs("span",{className:"flex items-center gap-2",children:[R.jsx(Vf,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=H):H=e[52];let J;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==H?(J=R.jsx(cl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:H}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=H,e[56]=J):J=e[56];let V;e[57]!==ce||e[58]!==J?(V=R.jsxs(Xf,{children:[ce,J]}),e[57]=ce,e[58]=J,e[59]=V):V=e[59];let re;e[60]!==o||e[61]!==v||e[62]!==O||e[63]!==V?(re=R.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[O,V]}),e[60]=o,e[61]=v,e[62]=O,e[63]=V,e[64]=re):re=e[64];let Se;e[65]!==f||e[66]!==re?(Se=R.jsx(eh,{...f,children:re}),e[65]=f,e[66]=re,e[67]=Se):Se=e[67];let Pe;e[68]!==N||e[69]!==Se?(Pe=R.jsxs(Qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,Se]}),e[68]=N,e[69]=Se,e[70]=Pe):Pe=e[70];let ot;return e[71]!==b||e[72]!==Pe?(ot=R.jsx(Zf,{open:!0,onOpenChange:b,children:Pe}),e[71]=b,e[72]=Pe,e[73]=ot):ot=e[73],ot}var fl=Object.defineProperty,hh=(t,e)=>{let n={};for(var r in t)fl(n,r,{get:t[r],enumerable:!0});return fl(n,Symbol.toStringTag,{value:"Module"}),n};function se(t){this.content=t}se.prototype={constructor:se,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new se(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},addToStart:function(t,e){return new se([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new se(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function fc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&mc(o.charCodeAt(a-1))&&pc(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=fc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function hc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&mc(c.charCodeAt(d-1))&&pc(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=hc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function pc(t){return t>=56320&&t<57344}function mc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return fc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return hc(this,e,n,r)}findIndex(e){if(e==0)return xr(0,e);if(e==this.size)return xr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?xr(n+1,s):xr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Ji={index:0,offset:0};function xr(t,e){return Ji.index=t,Ji.offset=e,Ji}function Hr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Hr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Hr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class Es{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Hr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Es.none;if(e instanceof Es)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Qn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=yc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(gc(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function gc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(gc(s.content,e-i-1,n-i-1)))}function yc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=yc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ph(t,e,n){if(n.openStart>t.depth)throw new Qn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Qn("Inconsistent open depths");return bc(t,e,n,0)}function bc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=bc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return zt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=mh(n,t);return zt(s,Sc(t,o,l,e,r))}else return zt(s,Vr(t,e,r))}function kc(t,e){if(!e.type.compatibleContent(t.type))throw new Qn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return kc(r,e.node(n)),r}function $t(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function zn(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&($t(t.nodeAfter,r),s++));for(let l=s;l<o;l++)$t(i.child(l),r);e&&e.depth==n&&e.textOffset&&$t(e.nodeBefore,r)}function zt(t,e){if(!t.type.validContent(e))throw new Qn("Invalid content for node "+t.type.name);return t.copy(e)}function Sc(t,e,n,r,i){let s=t.depth>i&&Ts(t,e,i+1),o=r.depth>i&&Ts(n,r,i+1),l=[];return zn(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(kc(s,o),$t(zt(s,Sc(t,e,n,r,i+1)),l)):(s&&$t(zt(s,Vr(t,e,i+1)),l),zn(e,n,i,l),o&&$t(zt(o,Vr(n,r,i+1)),l)),zn(r,null,i,l),new k(l)}function Vr(t,e,n){let r=[];if(zn(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);$t(zt(i,Vr(t,e,n+1)),r)}return zn(e,null,n,r),new k(r)}function mh(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Zn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new jr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Zn(n,r,s)}static resolveCached(e,n){let r=hl.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else hl.set(e,r=new gh);let i=r.elts[r.i]=Zn.resolve(e,n);return r.i=(r.i+1)%yh,i}}class gh{constructor(){this.elts=[],this.i=0}}const yh=12,hl=new WeakMap;class jr{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const bh=Object.create(null);let Bt=class ws{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Hr(this.attrs,n||e.defaultAttrs||bh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new ws(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ws(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ph(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Zn.resolveCached(this,e)}resolveNoCache(e){return Zn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),xc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Bt.prototype.text=void 0;class Wr extends Bt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Wr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Wr(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function xc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ut{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kh(e,n);if(r.next==null)return Ut.empty;let i=Cc(r);r.next&&r.err("Unexpected trailing text");let s=wh(Th(i));return vh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
1
|
+
import{c as fo,r as F,b as cc,as as Hf,j as R,h as Vf,B as cl,av as ul,au as jf,at as Wf,en as uc,eo as Kf,aR as Uf,ep as Kt,eq as _f,l as dc}from"./index-BTRkPuaE.js";import{d as qf,g as Jf}from"./gateway-client-BUVeQ8TP.js";import{d as Gf,c as Yf,e as Xf,b as Qf,D as Zf}from"./dialog-BrqxKGpn.js";import{a as eh,F as th,b as nh,c as rh,d as ih,f as sh}from"./form-CwmR-nDp.js";import{I as oh}from"./input-_e15nvFZ.js";import{t as dl}from"./utils-CVEq3hMx.js";import{a as lh}from"./org-file-open-context-BXXF2r_W.js";import{T as ah,a as ch,b as uh}from"./tooltip-BJNrweFg.js";function dh(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?ul().min(1,e):ul();return jf(n)}function fh(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function yx(t){const e=fo.c(74),{prompt:n,setPrompt:r,onSubmit:i,defaultValues:s}=t,o=F.useId(),l=cc();let a,c;if(e[0]!==n||e[1]!==l){const ie=dh(n,l("chat.dialogPromptArguments.required"));c=Wf,a=Hf(ie),e[0]=n,e[1]=l,e[2]=a,e[3]=c}else a=e[2],c=e[3];let u;e[4]!==s||e[5]!==n?(u=n?fh(n,s):{},e[4]=s,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==a||e[8]!==u?(d={resolver:a,defaultValues:u,mode:"onChange"},e[7]=a,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const p=h;let g;e[12]!==f||e[13]!==i||e[14]!==r?(g=async ie=>{await i(ie),r(null),f.reset()},e[12]=f,e[13]=i,e[14]=r,e[15]=g):g=e[15];const m=g;let y;e[16]!==f||e[17]!==r?(y=ie=>{ie||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=y):y=e[18];const b=y;if(!n)return null;let S;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(S=n.title||qf(n.name,Jf(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=S):S=e[22];let C;e[23]!==S?(C=R.jsx(Gf,{children:R.jsx("span",{className:"capitalize",children:S})}),e[23]=S,e[24]=C):C=e[24];let T;e[25]!==n.description?(T=n.description&&R.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=T):T=e[26];let N;e[27]!==T||e[28]!==C?(N=R.jsxs(Yf,{children:[C,T]}),e[27]=T,e[28]=C,e[29]=N):N=e[29];let v;e[30]!==f||e[31]!==m?(v=ie=>{ie.stopPropagation(),f.handleSubmit(m)(ie)},e[30]=f,e[31]=m,e[32]=v):v=e[32];let O;if(e[33]!==p||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==l){let ie;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==l?(ie=Le=>R.jsx(th,{control:f.control,name:Le.name,render:En=>{const{field:We}=En;return R.jsxs(nh,{children:[R.jsxs(rh,{className:"text-xs",children:[Le.name,Le.required?null:R.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",l("chat.dialogPromptArguments.optional")]})]}),R.jsx(ih,{children:R.jsx(oh,{...We,value:We.value??"",required:Le.required,placeholder:Le.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),R.jsx(sh,{})]})}},Le.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=l,e[41]=ie):ie=e[41],O=p.map(ie),e[33]=p,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=l,e[37]=O}else O=e[37];let P;e[42]!==b?(P=()=>b(!1),e[42]=b,e[43]=P):P=e[43];const _=f.formState.isSubmitting;let ne;e[44]!==l?(ne=l("chat.dialogPromptArguments.cancel"),e[44]=l,e[45]=ne):ne=e[45];let ce;e[46]!==f.formState.isSubmitting||e[47]!==P||e[48]!==ne?(ce=R.jsx(cl,{type:"button",variant:"ghost",onClick:P,disabled:_,children:ne}),e[46]=f.formState.isSubmitting,e[47]=P,e[48]=ne,e[49]=ce):ce=e[49];let H;e[50]!==f.formState.isSubmitting||e[51]!==l?(H=f.formState.isSubmitting?R.jsxs("span",{className:"flex items-center gap-2",children:[R.jsx(Vf,{size:"xs"}),l("chat.dialogPromptArguments.loading")]}):l("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=l,e[52]=H):H=e[52];let J;e[53]!==f.formState.isSubmitting||e[54]!==o||e[55]!==H?(J=R.jsx(cl,{type:"submit",form:o,disabled:f.formState.isSubmitting,children:H}),e[53]=f.formState.isSubmitting,e[54]=o,e[55]=H,e[56]=J):J=e[56];let V;e[57]!==ce||e[58]!==J?(V=R.jsxs(Xf,{children:[ce,J]}),e[57]=ce,e[58]=J,e[59]=V):V=e[59];let re;e[60]!==o||e[61]!==v||e[62]!==O||e[63]!==V?(re=R.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[O,V]}),e[60]=o,e[61]=v,e[62]=O,e[63]=V,e[64]=re):re=e[64];let Se;e[65]!==f||e[66]!==re?(Se=R.jsx(eh,{...f,children:re}),e[65]=f,e[66]=re,e[67]=Se):Se=e[67];let Pe;e[68]!==N||e[69]!==Se?(Pe=R.jsxs(Qf,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,Se]}),e[68]=N,e[69]=Se,e[70]=Pe):Pe=e[70];let ot;return e[71]!==b||e[72]!==Pe?(ot=R.jsx(Zf,{open:!0,onOpenChange:b,children:Pe}),e[71]=b,e[72]=Pe,e[73]=ot):ot=e[73],ot}var fl=Object.defineProperty,hh=(t,e)=>{let n={};for(var r in t)fl(n,r,{get:t[r],enumerable:!0});return fl(n,Symbol.toStringTag,{value:"Module"}),n};function se(t){this.content=t}se.prototype={constructor:se,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new se(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},addToStart:function(t,e){return new se([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new se(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function fc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let o=i.text,l=s.text,a=0;for(;o[a]==l[a];a++)n++;return a&&a<o.length&&a<l.length&&mc(o.charCodeAt(a-1))&&pc(o.charCodeAt(a))&&n--,n}if(i.content.size||s.content.size){let o=fc(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function hc(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){n-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let c=o.text,u=l.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&mc(c.charCodeAt(d-1))&&pc(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||l.content.size){let c=hc(o.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}function pc(t){return t>=56320&&t<57344}function mc(t){return t>=55296&&t<56320}class k{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=a}return new k(r,i)}cutByIndex(e,n){return e==n?k.empty:e==0&&n==this.content.length?this:new k(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return fc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return hc(this,e,n,r)}findIndex(e){if(e==0)return xr(0,e);if(e==this.size)return xr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?xr(n+1,s):xr(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return k.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return k.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new k(n||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Ji={index:0,offset:0};function xr(t,e){return Ji.index=t,Ji.offset=e,Ji}function Hr(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Hr(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Hr(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $=class Es{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Hr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Es.none;if(e instanceof Es)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$.none=[];class Qn extends Error{}class M{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=yc(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,n){return new M(gc(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return M.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(k.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new M(e,r,i)}}M.empty=new M(k.empty,0,0);function gc(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(gc(s.content,e-i-1,n-i-1)))}function yc(t,e,n,r,i,s){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=yc(a.content,e-l-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,a);return c&&t.replaceChild(o,a.copy(c))}function ph(t,e,n){if(n.openStart>t.depth)throw new Qn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Qn("Inconsistent open depths");return bc(t,e,n,0)}function bc(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=bc(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,l=o.content;return zt(o,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=mh(n,t);return zt(s,Sc(t,o,l,e,r))}else return zt(s,Vr(t,e,r))}function kc(t,e){if(!e.type.compatibleContent(t.type))throw new Qn("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return kc(r,e.node(n)),r}function $t(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function zn(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&($t(t.nodeAfter,r),s++));for(let l=s;l<o;l++)$t(i.child(l),r);e&&e.depth==n&&e.textOffset&&$t(e.nodeBefore,r)}function zt(t,e){if(!t.type.validContent(e))throw new Qn("Invalid content for node "+t.type.name);return t.copy(e)}function Sc(t,e,n,r,i){let s=t.depth>i&&Ts(t,e,i+1),o=r.depth>i&&Ts(n,r,i+1),l=[];return zn(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(kc(s,o),$t(zt(s,Sc(t,e,n,r,i+1)),l)):(s&&$t(zt(s,Vr(t,e,i+1)),l),zn(e,n,i,l),o&&$t(zt(o,Vr(n,r,i+1)),l)),zn(r,null,i,l),new k(l)}function Vr(t,e,n){let r=[];if(zn(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);$t(zt(i,Vr(t,e,n+1)),r)}return zn(e,null,n,r),new k(r)}function mh(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(k.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Zn{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new jr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),c=s-a;if(r.push(o,l,i+a),!c||(o=o.child(l),o.isText))break;s=c-1,i+=a+1}return new Zn(n,r,s)}static resolveCached(e,n){let r=hl.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else hl.set(e,r=new gh);let i=r.elts[r.i]=Zn.resolve(e,n);return r.i=(r.i+1)%yh,i}}class gh{constructor(){this.elts=[],this.i=0}}const yh=12,hl=new WeakMap;class jr{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const bh=Object.create(null);let Bt=class ws{constructor(e,n,r,i=$.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Hr(this.attrs,n||e.defaultAttrs||bh)&&$.sameSet(this.marks,r||$.none)}copy(e=null){return e==this.content?this:new ws(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ws(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return M.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),c=i.node(o).content.cut(i.pos-l,s.pos-l);return new M(c,i.depth-o,s.depth-o)}replace(e,n,r){return ph(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Zn.resolveCached(this,e)}resolveNoCache(e){return Zn.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),xc(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=k.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=k.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Bt.prototype.text=void 0;class Wr extends Bt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Wr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Wr(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function xc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ut{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kh(e,n);if(r.next==null)return Ut.empty;let i=Cc(r);r.next&&r.err("Unexpected trailing text");let s=wh(Th(i));return vh(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,l){let a=o.matchFragment(e,r);if(a&&(!n||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:a}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
2
2
|
`)}}Ut.empty=new Ut(!0);class kh{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Cc(t){let e=[];do e.push(Sh(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Sh(t){let e=[];do e.push(xh(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function xh(t){let e=Eh(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Ch(t,e);else break;return e}function pl(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Ch(t,e){let n=pl(t),r=n;return t.eat(",")&&(t.next!="}"?r=pl(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Mh(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Eh(t){if(t.eat("(")){let e=Cc(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Mh(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Th(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=s(o.exprs[a],l);if(a==o.exprs.length-1)return c;i(c,l=n())}else if(o.type=="star"){let a=n();return r(l,a),i(s(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=n();return i(s(o.expr,l),a),i(s(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=n();i(s(o.expr,a),u),a=u}if(o.max==-1)i(s(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=n();r(a,u),i(s(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Mc(t,e){return e-t}function ml(t,e){let n=[];return r(e),n.sort(Mc);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:l,to:a}=s[o];!l&&n.indexOf(a)==-1&&r(a)}}}function wh(t){let e=Object.create(null);return n(ml(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<i.length;u++)i[u][0]==l&&(c=i[u][1]);ml(t,a).forEach(u=>{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new Ut(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(Mc);s.next.push({type:i[o][0],next:e[l.join(",")]||n(l)})}return s}}function vh(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:a,next:c}=i.next[l];o.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ec(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Tc(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function wc(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function vc(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Nh(t,r,e[r]);return n}let gl=class Ac{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=vc(e,r.attrs),this.defaultAttrs=Ec(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ut.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Tc(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Bt(this,this.computeAttrs(e),k.from(n),$.setFrom(r))}createChecked(e=null,n,r){return n=k.from(n),this.checkContent(n),new Bt(this,this.computeAttrs(e),n,$.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=k.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(k.empty,!0);return s?new Bt(this,e,n.append(s),$.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){wc(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:$.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Ac(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ah(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Nh{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ah(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ri{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=vc(e,i.attrs),this.excluded=null;let s=Ec(this.attrs);this.instance=s?new $(this,s):null}create(e=null){return!e&&this.instance?this.instance:new $(this,Tc(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Ri(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){wc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Nc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=se.from(e.nodes),n.marks=se.from(e.marks||{}),this.nodes=gl.compile(this.spec.nodes,this),this.marks=Ri.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Ut.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?yl(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:yl(this,o.split(" "))}this.nodeFromJSON=i=>Bt.fromJSON(this,i),this.markFromJSON=i=>$.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof gl){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Wr(r,r.defaultAttrs,e,$.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function yl(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let l in t.marks){let a=t.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Oh(t){return t.tag!=null}function Dh(t){return t.style!=null}class He{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Oh(i))this.tags.push(i);else if(Dh(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new kl(this,n,!1);return r.addAll(e,$.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new kl(this,n,!0);return r.addAll(e,$.none,n.from,n.to),M.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Ph(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(o.getAttrs){let a=o.getAttrs(n);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Sl(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=Sl(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new He(e,He.schemaRules(e)))}}const Oc={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Rh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Dc={ol:!0,ul:!0},er=1,vs=2,Bn=4;function bl(t,e,n){return e!=null?(e?er:0)|(e==="full"?vs:0):t&&t.whitespace=="pre"?er|vs:n&~Bn}class Cr{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=$.none,this.match=s||(o&Bn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(k.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&er)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=k.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Oc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class kl{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=bl(null,n.preserveWhitespace,0)|(r?Bn:0);i?s=new Cr(i.type,i.attrs,$.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Cr(null,null,$.none,!0,null,o):s=new Cr(e.schema.topNodeType,null,$.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&vs?"full":this.localPreserveWS||(i.options&er)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(o.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Dc.hasOwnProperty(o)&&this.parser.normalizeLists&&Ih(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Rh.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Oc.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=a&&a.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,n.attrs||null,r,n.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=$.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):xl(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=bl(e,s,o.options);o.options&Bn&&o.content.length==0&&(l|=Bn);let a=$.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):xl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Cr(e,n,a,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=er)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Ih(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Dc.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Ph(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Sl(t){let e={};for(let n in t)e[n]=t[n];return e}function xl(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class nt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Mr(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,n);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return Mr(n).createTextNode(e.text);let{dom:r,contentDOM:i}=Lr(Mr(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Lr(Mr(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:Lr(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new nt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Cl(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Cl(e.marks)}}function Cl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Mr(t){return t.document||window.document}const Ml=new WeakMap;function Lh(t){let e=Ml.get(t);return e===void 0&&Ml.set(t,e=$h(t)),e}function $h(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Lr(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Lh(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let l,a=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(t.createTextNode(f));else{let{dom:h,contentDOM:p}=Lr(t,f,n,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Rc=65535,Ic=Math.pow(2,16);function zh(t,e){return t+e*Ic}function El(t){return t&Rc}function Bh(t){return(t-(t&Rc))/Ic}const Pc=1,Lc=2,$r=4,$c=8;class As{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&$c)>0}get deletedBefore(){return(this.delInfo&(Pc|$r))>0}get deletedAfter(){return(this.delInfo&(Lc|$r))>0}get deletedAcross(){return(this.delInfo&$r)>0}}class xe{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&xe.empty)return xe.empty}recover(e){let n=0,r=El(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Bh(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,h=a+i+(f<0?0:u);if(r)return h;let p=e==(n<0?a:d)?null:zh(l/3,e-a),g=e==a?Lc:e==d?Pc:$r;return(n<0?e!=a:e!=d)&&(g|=$c),new As(h,g,p)}i+=u-c}return r?e+i:new As(e+i,0,null)}touches(e,n){let r=0,i=El(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),c=this.ranges[i+n],u=this.ranges[i+r];e(l,l+c,a,a+u),s+=u-c}}invert(){return new xe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?xe.empty:new xe(e<0?[0,-e,0]:[0,0,e])}}xe.empty=new xe([]);class tr{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new tr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new tr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new As(e,i,null)}}const Gi=Object.create(null);class fe{getMap(){return xe.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Gi[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Gi)throw new RangeError("Duplicate use of step JSON ID "+e);return Gi[e]=n,n.prototype.jsonID=e,n}}class G{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new G(e,null)}static fail(e){return new G(null,e)}static fromReplace(e,n,r,i){try{return G.ok(e.replace(n,r,i))}catch(s){if(s instanceof Qn)return G.fail(s.message);throw s}}}function ho(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(ho(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return k.fromArray(r)}class mt extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new M(ho(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,s)}invert(){return new De(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new mt(n.pos,r.pos,this.mark)}merge(e){return e instanceof mt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new mt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new mt(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("addMark",mt);class De extends fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new M(ho(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return G.fromReplace(e,this.from,this.to,r)}invert(){return new mt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new De(n.pos,r.pos,this.mark)}merge(e){return e instanceof De&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new De(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new De(n.from,n.to,e.markFromJSON(n.mark))}}fe.jsonID("removeMark",De);class gt extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new gt(this.pos,n.marks[i]);return new gt(this.pos,this.mark)}}return new _t(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new gt(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new gt(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("addNodeMark",gt);class _t extends fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return G.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return G.fromReplace(e,this.pos,this.pos+1,new M(k.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new gt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new _t(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new _t(n.pos,e.markFromJSON(n.mark))}}fe.jsonID("removeNodeMark",_t);class q extends fe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Ns(e,this.from,this.to)?G.fail("Structure replace would overwrite content"):G.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xe([this.from,this.to-this.from,this.slice.size])}invert(e){return new q(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&q.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new q(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof q)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new q(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new q(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new q(n.from,n.to,M.fromJSON(e,n.slice),!!n.structure)}}q.MAP_BIAS=1;fe.jsonID("replace",q);class ee extends fe{constructor(e,n,r,i,s,o,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ns(e,this.from,this.gapFrom)||Ns(e,this.gapTo,this.to)))return G.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return G.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?G.fromReplace(e,this.from,this.to,r):G.fail("Content does not fit in gap")}getMap(){return new xe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new ee(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new ee(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ee(n.from,n.to,n.gapFrom,n.gapTo,M.fromJSON(e,n.slice),n.insert,!!n.structure)}}fe.jsonID("replaceAround",ee);function Ns(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Fh(t,e,n,r){let i=[],s=[],o,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:i.push(o=new De(f,h,d[g])));l&&l.to==f?l.to=h:s.push(l=new mt(f,h,r))}}),i.forEach(a=>t.step(a)),s.forEach(a=>t.step(a))}function Hh(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof Ri){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&d.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(l,e),to:c,step:s})}}}),i.forEach(o=>t.step(new De(o.from,o.to,o.style)))}function po(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new q(l,u,M.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new De(l,u,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new M(k.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new q(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);t.replace(l,l,new M(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function Vh(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Mn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),l=t.$from.index(r)+i,a=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(l,a,n))return r;if(r==0||o.type.spec.isolating||!Vh(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function jh(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),l=i.after(s+1),a=o,c=l,u=k.empty,d=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=s,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=k.from(i.node(p).copy(f)),h++):c++;t.step(new ee(a,c,o,l,new M(u.append(f),d,h),u.size-d,!0))}function mo(t,e,n=null,r=t){let i=Wh(t,e),s=i&&Kh(r,e);return s?i.map(Tl).concat({type:e,attrs:n}).concat(s.map(Tl)):null}function Tl(t){return{type:t,attrs:null}}function Wh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function Kh(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<i;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:o}function Uh(t,e,n){let r=k.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new ee(i,s,i,s,new M(r,0,0),n.length,!0))}function _h(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,a)&&qh(t.doc,t.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Bc(t,o,l,s),po(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return t.step(new ee(d,f,d+1,f-1,new M(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&zc(t,o,l,s),!1}})}function zc(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Bc(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as r}from"./index-
|
|
1
|
+
import{c as s,j as r}from"./index-BTRkPuaE.js";import{D as n,b as c}from"./decopilot-BLnyHUyj.js";function d(l){const e=s.c(2),{onClose:o}=l;let t;return e[0]!==o?(t=r.jsx(c,{onClose:o}),e[0]=o,e[1]=t):t=e[1],t}function p(l){const e=s.c(4);let o;e[0]!==l?({...o}=l,e[0]=l,e[1]=o):o=e[1];let t;return e[2]!==o?(t=r.jsx(n,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{p as M,d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,X as h,e5 as d,j as g,N as m,a6 as p,M as j}from"./index-
|
|
1
|
+
import{c as f,X as h,e5 as d,j as g,N as m,a6 as p,M as j}from"./index-BTRkPuaE.js";import{L as v}from"./legacy-main-redirect-FsmMt53b.js";import"./thread-route-IxUDda00.js";const x=j("/shell/$org/org-shell/");function L(){const e=f.c(19),{org:r}=h(),l=x.useSearch(),{main:i,virtualmcpid:o}=l;if(i!==void 0){let t;e[0]!==i||e[1]!==r.slug||e[2]!==l||e[3]!==o?(t=d({org:r.slug,agentId:o,main:i,search:l}),e[0]=i,e[1]=r.slug,e[2]=l,e[3]=o,e[4]=t):t=e[4];const s=t;if(s?.kind==="canonical"){let a;return e[5]!==s?(a=g.jsx(v,{target:s}),e[5]=s,e[6]=a):a=e[6],a}}let n;e[7]!==o?(n=o?.trim()||null,e[7]=o,e[8]=n):n=e[8];const u=n;if(u){let t;e[9]!==r.slug||e[10]!==u?(t={org:r.slug,agentId:u},e[9]=r.slug,e[10]=u,e[11]=t):t=e[11];let s;e[12]!==l?(s={...l,virtualmcpid:void 0},e[12]=l,e[13]=s):s=e[13];let a;return e[14]!==t||e[15]!==s?(a=g.jsx(m,{to:p.projects,params:t,search:s,hash:!0,replace:!0}),e[14]=t,e[15]=s,e[16]=a):a=e[16],a}let c;return e[17]!==r.slug?(c=g.jsx(m,{to:p.home,params:{org:r.slug},search:N,hash:!0,replace:!0}),e[17]=r.slug,e[18]=c):c=e[18],c}function N(e){return{...e,virtualmcpid:void 0}}export{L as default};
|