@p4code/cli 0.8.10 → 0.8.11
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/bin.mjs +1 -1
- package/dist/{binCli-CqXltjbH.mjs → binCli-DY9l0jFs.mjs} +2 -2
- package/dist/client/.vite/manifest.json +1302 -1302
- package/dist/client/assets/{AuthSurfaceShell-kd42gI_H.js → AuthSurfaceShell-B_P0_qZ6.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-CVZHYvIk.js → ChatGptUsageButton-fMcoYEDa.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-CyAwyBCe.js → ChatMarkdown-B7b91JUl.js} +4 -4
- package/dist/client/assets/{CodexSetupSection.logic-Bg24iMBv.js → CodexSetupSection.logic-CeUTTu-x.js} +2 -2
- package/dist/client/assets/{CommandBlock-DfFKmmpW.js → CommandBlock-BI3ZCXsB.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-BUr_9EhS.js → ComposerPromptEditor-BkRvKIiZ.js} +4 -4
- package/dist/client/assets/{DevicePanel-CEAHHS0L.js → DevicePanel-B_jOvmeL.js} +2 -2
- package/dist/client/assets/{DeviceSetup-BlB01a4k.js → DeviceSetup-BXjqCO_9.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-DJ5wq6nm.js → DiffCommentAnnotation-D_1Iw0oL.js} +2 -2
- package/dist/client/assets/{DiffFileTree-C5ZwieTz.js → DiffFileTree-D6386u9x.js} +2 -2
- package/dist/client/assets/{DiffPanel-deSBv-2a.js → DiffPanel-D6VVj6BF.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-B5VjaCIu.js → DiffWorkerPoolProvider-Cw5WeG1t.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-CPW-9E2n.js → EmbeddedDesign-Drkomo9K.js} +2 -2
- package/dist/client/assets/{FileDiff-DHQS5O_i.js → FileDiff-FK4mtyx3.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-3ustJhi8.js → FilePreviewPanel-ncsuf7iX.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-DaTUDHXw.js → FoldedSettingsSection-CRlh3-BO.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-BP4MUjf4.js → NoProjectsHero-8d3l2unf.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-BNd5egB9.js → PanelLayoutControls-3fTyX_SN.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-CBahrBiu.js → PierreEntryIcon-DtlkLdir.js} +2 -2
- package/dist/client/assets/{PreviewPanel-rlVHqhKP.js → PreviewPanel-Ca3_DPh_.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-Da05OPtO.js → ProjectDefaultsSettings-B--7QlKN.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-Bkz2srRd.js → ProjectFavicon-YdOZ4g5-.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-BpLImfmo.js → ProjectIconPickerDialog-C23nnU1a.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-ClXCW2ZL.js → ProviderAuthTerminal-YztsMr2F.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-BsAWSSR8.js → ProviderModelPicker-S_tiGeLH.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-BaWOGIat.js → ProviderSettingsForm-C3nbCFfS.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-CgecnYur.js → PullRequestCodeTab-BdP3_tNe.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-CQr-JCID.js → ReadOnlySourcePreview-BNe8pyVf.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-C3EBbed9.js → RenderErrorBoundary-DEgVmtJL.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-CTKk7p1m.js → ScheduledTasksSettings-CISo4C7r.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-BhNULF6o.js → ScopedSwitch-eWB5GlaA.js} +2 -2
- package/dist/client/assets/{SettingsPanels-Dp_sFsPo.js → SettingsPanels-DA7lXl0N.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-C9V5Hz91.js → SettingsPanels.logic-lCZaJhKM.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-DSSyI0jy.js → SettingsScopeNotice-BAtVWG0d.js} +2 -2
- package/dist/client/assets/{T3ConnectAccountPages-B3e2wzII.js → T3ConnectAccountPages-nabxuL18.js} +2 -2
- package/dist/client/assets/{T3ConnectSidebarSignIn-BjQbm8G_.js → T3ConnectSidebarSignIn-CSVR5Zot.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-AmBMRSJo.js → ThemeEditorPanel-BMtL4rIt.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-BtTayxlc.js → ThreadTerminalDrawer-CLfVfvoq.js} +2 -2
- package/dist/client/assets/{Virtualizer-D4YaDR_b.js → Virtualizer-Bi8p4Z6E.js} +2 -2
- package/dist/client/assets/{_chat-DV6w-2C3.js → _chat-D-Gcj0-9.js} +5 -5
- package/dist/client/assets/{_chat.index--w9wFkxu.js → _chat.index-k4jctzPr.js} +2 -2
- package/dist/client/assets/{_chat.new--MAUGvmU.js → _chat.new-BlFtqZqt.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-0A2xwMPy.js → _chat.pull-requests-DrLHGpqx.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-zLaAF-3J.js → abnfDiagram-VCTEODGH-BVKlsgtX.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-BNBr3Sao.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-DGrGnnOa.js → architectureDiagram-5GKGNRK7-zBJWGViu.js} +2 -2
- package/dist/client/assets/{assets-BwCKLAtY.js → assets-BhchpDuq.js} +2 -2
- package/dist/client/assets/{blockDiagram-I7D4REHJ-B5kjOwUJ.js → blockDiagram-I7D4REHJ-BdiAAtHi.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-C4q3a0XH.js → browserHistoryStore-CqGVWa5a.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-BrW2R2w9.js → browserLinkTarget-CINrbcxi.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-N-lKEret.js → c4Diagram-7LVT6UL2-CqnmSo8f.js} +2 -2
- package/dist/client/assets/channel-CfHDq-fp.js +2 -0
- package/dist/client/assets/{chunk-4HAMMTFA-DIgHroFa.js → chunk-4HAMMTFA-BpyojyCk.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-BA8jPDfc.js → chunk-75Z2AOVW-LBmwoUvq.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-Dj0ZwIfN.js → chunk-DU6HZSFF-zhv2Vnfx.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-CIY-Y3U7.js → chunk-F27PBJKO-K5uPeDhv.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-CpRREKUL.js → chunk-GMAD6QVW-CAAu3Cn5.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-BNRFhCn1.js → chunk-GVQU2GXP-Br_UAx49.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-CwVumyvU.js → chunk-IMKFNOWR-Kqfxrrdn.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-DmnnKxVD.js → chunk-L3NEJ4N5-D1cWO7rm.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-CVpY8qRB.js → chunk-OSK3NFVY-BiMJbcHf.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-BXtrm_uK.js → chunk-P2QGCYS3-BuGzzo3g.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-BMv4TRlv.js → chunk-POPQ4Y6H-C_w0mNLk.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-ChjYfHBz.js → chunk-PWAF6VOD-CJFd7LKC.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-B8_bIgln.js → chunk-SHT3W25Y-Beev3ZeU.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-B_6y-HJg.js → chunk-SVP7TREG-BqpBEmtK.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-UT10I24y.js → chunk-TICWLB2K-B0vIU1Au.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-Cm99q1tS.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cm99q1tS.js +2 -0
- package/dist/client/assets/{connect-DhHj4PkS.js → connect-DGwXUKTk.js} +2 -2
- package/dist/client/assets/{connect-agent-BncssQEd.js → connect-agent-DFwOzcLG.js} +2 -2
- package/dist/client/assets/{cynefin-OW5HDTMX-CZNEfbCg.js → cynefin-OW5HDTMX-BjcFswd0.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BKEovqGL.js → cynefinDiagram-5FMLGOSQ-BDWLg5Tt.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-D4NJOZw7.js → dagre-GXQ25YYZ-DZpVjkDw.js} +2 -2
- package/dist/client/assets/{device-CPrc6WRl.js → device-BEgZIK7u.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-DAVijJym.js → diagram-S7CK7UJ4-BpVs-kYJ.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-Cj6mxCST.js → diagram-UQ7AKVKN-EN7yKI08.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-B8WJLooX.js → diagram-VSXAHHWV-B2oljv94.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-BC6KWAr-.js → diagram-VX7I27RA-BIl0lJ6d.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-JUka6Rlo.js → diagram-Z3DM3KII-B8uoK-O5.js} +2 -2
- package/dist/client/assets/{diffRendering-DPsheMQA.js → diffRendering-DeZLcalP.js} +2 -2
- package/dist/client/assets/{dist-Byy10brL.js → dist-Bd1WIVAz.js} +2 -2
- package/dist/client/assets/{duoViewer-BguMFnDx.js → duoViewer-BZ7rNqkx.js} +2 -2
- package/dist/client/assets/{dynamic-DZ1i7e73.js → dynamic-BMz3CcWG.js} +2 -2
- package/dist/client/assets/{ebnfDiagram-PWID7BFC--X0uMdp8.js → ebnfDiagram-PWID7BFC-BQcQotuk.js} +2 -2
- package/dist/client/assets/{embeddedScripts-DtvNyJpi.js → embeddedScripts-Cek5ppgQ.js} +2 -2
- package/dist/client/assets/{entities-DSlJSLqU.js → entities-DPIZFvN7.js} +2 -2
- package/dist/client/assets/{environments-DcJA_6Bd.js → environments-Dm2_6Uan.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-D40nNb49.js → erDiagram-RLTQ6QDP-Y5XhNz9b.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-B7plRWX7.js +1 -0
- package/dist/client/assets/{fileLinks-D1jJMhdN.js → fileLinks-1xYacDKI.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-g3uA37tp.js → fileTreeExpansion-B24BhRqA.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-BEpQPBfI.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CUTw8cyG.js → ganttDiagram-EL5Y4UJY-DqWb0OUJ.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-BEkxNzZ-.js → getDiffFileInput-CCYVAWRm.js} +2 -2
- package/dist/client/assets/{gitGraph-4MIJSDKK-CNrKR9iC.js → gitGraph-4MIJSDKK-5lcY1dZk.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BDOHc4qo.js → gitGraphDiagram-WWUBYQGX-BJKz_rGI.js} +2 -2
- package/dist/client/assets/{guideRunStore-DjlqVSzn.js → guideRunStore-BhlldU3q.js} +2 -2
- package/dist/client/assets/{index-1TY23MT4.js → index-Dc7GC03y.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-CcpUa_F0.js → info-A6RAGUB7-BWnMlmF7.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-DSI34MwN.js → infoDiagram-27XIBGKW-DKW68xDy.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CP954DlA.js → ishikawaDiagram-5VMMS53U-dRMCvDN0.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-eT4l5GzW.js → journeyDiagram-3NMN7TZE-CAxCpgF5.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-C77A2Ei7.js → kanban-definition-UXKFOSKX-BaSkJW47.js} +2 -2
- package/dist/client/assets/{line-CLiRrUp0.js → line-B59oA22i.js} +2 -2
- package/dist/client/assets/{linkedPrompt-B-9VpB-9.js → linkedPrompt-Cqfqh2Aq.js} +2 -2
- package/dist/client/assets/main-Ch-SjebX.css +2 -0
- package/dist/client/assets/{main-BxSUUHl7.js → main-CxOeqlhD.js} +7 -7
- package/dist/client/assets/{mediaReference-Co0MbQU1.js → mediaReference-DRC-8GdL.js} +2 -2
- package/dist/client/assets/{mediaSource-CakREDG9.js → mediaSource-DWSwwPfV.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-Dm-CGUQK.js → mermaid-parser.core-DcamukpZ.js} +4 -4
- package/dist/client/assets/{mermaid.core-BUABPjrf.js → mermaid.core-C6GXL70P.js} +5 -5
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-DdthJce-.js → mindmap-definition-YA3MSWOX-CEVz3xGI.js} +2 -2
- package/dist/client/assets/{onboarding-qFB0UvmL.js → onboarding-CLIRA2Sa.js} +2 -2
- package/dist/client/assets/{openFileInPreview-DH1_MQQg.js → openFileInPreview-uS9Qgrru.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-Czc_hMvK.js → p4ProjectFile-CIYnqKbl.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-C3W7XCMm.js → packet-AYTQ26CC-B9XAEihD.js} +1 -1
- package/dist/client/assets/{pair-CcIVxc7L.js → pair-DTfs9_4K.js} +2 -2
- package/dist/client/assets/{pegDiagram-XKGWAZYB-DMWX9FLy.js → pegDiagram-XKGWAZYB-tcLsMhrs.js} +2 -2
- package/dist/client/assets/{phoneViewer-EcEiirVA.js → phoneViewer-wYjPQP4U.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-Bdmc_LNt.js → pie-WAS4IAKB-B3ig0TFp.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-D7g18I6h.js → pieDiagram-E7YTZNPT-uaJgfQOp.js} +2 -2
- package/dist/client/assets/{pierre-icons-BF6Bv7EQ.js → pierre-icons-Dav7jMBk.js} +2 -2
- package/dist/client/assets/popover-Bc0WvoPP.js +2 -0
- package/dist/client/assets/{preview-CzRHMudX.js → preview-C4lGbDhm.js} +2 -2
- package/dist/client/assets/{primary-BeYRWn1V.js → primary-CRkgnOCY.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-BLsual21.js → primaryCloudLinkState-B_VNTJYL.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-DA41YjI0.js → projectFilesQueryState-U08pztRu.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-BQz7SQAB.js → projectScriptEditor-D8mxKLOb.js} +2 -2
- package/dist/client/assets/{providerSkills-BqTkgag1.js → providerSkills-C7CtJefh.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-DZT0G8Eq.js → pullRequestDetail.logic-DGX-Sd8d.js} +2 -2
- package/dist/client/assets/{pullRequests-D40-ZAXm.js → pullRequests-BbD7hNlR.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-B7fD9ov3.js → quadrantDiagram-AXDQQJYC-BOFUpnyi.js} +2 -2
- package/dist/client/assets/{queries-G1w-VoW0.js → queries-BVPZtaQA.js} +2 -2
- package/dist/client/assets/{radar-RG4KPBEZ-XnqFD0Vk.js → radar-RG4KPBEZ--djmIj49.js} +1 -1
- package/dist/client/assets/{railroad-74A4TZTK-DTwlNXl5.js → railroad-74A4TZTK-DMMw049f.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BJdCwb3O.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-a9vhoAEG.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-Cyo-vXW_.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-CvCkOq5l.js → railroadDiagram-O6MQD6OU-Df9rhhFk.js} +2 -2
- package/dist/client/assets/{renderScheduler-pSLV-XuI.js → renderScheduler-b0pOdWwc.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-taBU_pva.js → requirementDiagram-BXWQKSXE-BtGYMd7U.js} +2 -2
- package/dist/client/assets/{runtime-BtqGaFGQ.js → runtime-Bc4kgQim.js} +2 -2
- package/dist/client/assets/{runtime-B3_ce0WW.js → runtime-DZfpb67Q.js} +3 -3
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DZUz0diJ.js → sankeyDiagram-P5KCCOFB-D7_y-s_u.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-C0Ez1DaI.js → scheduledTasksSettings.logic-CvvQA-b7.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-CljKM3sv.js → sequenceDiagram-WJ2MYXX4-AuXrX-b5.js} +2 -2
- package/dist/client/assets/{server-BP2BG-G5.js → server-LJ0-FVGH.js} +2 -2
- package/dist/client/assets/{session-B20XW_sH.js → session-Bc1P10r_.js} +2 -2
- package/dist/client/assets/{session-logic-BtEgohgO.js → session-logic-BNtU33qU.js} +2 -2
- package/dist/client/assets/{settings-DBl7ZVnV.js → settings-CZSrxmjf.js} +2 -2
- package/dist/client/assets/{settings.appearance-D8k8SMD3.js → settings.appearance-B_LipS5_.js} +2 -2
- package/dist/client/assets/settings.archived-B_h3CK_T.js +2 -0
- package/dist/client/assets/{settings.computer-use-pik9jKva.js → settings.computer-use-BAzpb53_.js} +2 -2
- package/dist/client/assets/{settings.connections-DCVjT1D4.js → settings.connections-Bv37N8Tm.js} +2 -2
- package/dist/client/assets/{settings.data-controls-immNwXN9.js → settings.data-controls-DIkcwUy1.js} +2 -2
- package/dist/client/assets/{settings.decisions-DWMEFgyI.js → settings.decisions-BN9ozN_A.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-BU0rF2oy.js → settings.diagnostics-DuoGRNGf.js} +2 -2
- package/dist/client/assets/{settings.general-Dlcf9Hk5.js → settings.general-B-Bt2-nG.js} +2 -2
- package/dist/client/assets/{settings.integrations-CYXx2aGC.js → settings.integrations-CT3opViE.js} +2 -2
- package/dist/client/assets/{settings.keybindings-CZlUIeZC.js → settings.keybindings-BBTkicWk.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-Df90UmKw.js → settings.open-source-licenses-C_hoYTwe.js} +2 -2
- package/dist/client/assets/{settings.plugins-DGKWDNbJ.js → settings.plugins-DafKnC5Q.js} +2 -2
- package/dist/client/assets/{settings.projects-BaH4TdtU.js → settings.projects-r2ZcxKud.js} +3 -3
- package/dist/client/assets/{settings.providers-jRQxDtSb.js → settings.providers-jbZijXPV.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-DedR0Odt.js → settings.scheduled-tasks-C0d4wkYE.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-BphQmu0k.js → settings.snap-shot-D-zJVnjT.js} +2 -2
- package/dist/client/assets/{settings.source-control-raEHGAxv.js → settings.source-control-DIU1xRUy.js} +2 -2
- package/dist/client/assets/{settings.storage-CGgPDbYR.js → settings.storage-DRxTKEjG.js} +2 -2
- package/dist/client/assets/{settingsLayout-C0HMxLxU.js → settingsLayout-Cbpy7Mfz.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DJA_Uu9w.js → sidebarProjectGrouping-DXnDcqLY.js} +2 -2
- package/dist/client/assets/{sortable.esm-cggA232Z.js → sortable.esm-Boen_E7K.js} +2 -2
- package/dist/client/assets/{sourceControl-oqWEMILZ.js → sourceControl-DE9QO1yg.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-8ubzI9Qu.js → stateDiagram-D77RDMKH-EwB2WAAm.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CcnJHQ4a.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-BbvNjSwa.js → swimlanes-42K2YHIH-RngRFsjR.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CrkPrysy.js +9 -0
- package/dist/client/assets/{terminalSessions-B774652v.js → terminalSessions-Cj-MqjH8.js} +2 -2
- package/dist/client/assets/{threadSort-Broxuoqw.js → threadSort-DD61dseb.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-BxF3SHfH.js → timeline-definition-24CTP7MA-BfIggpP3.js} +2 -2
- package/dist/client/assets/{toast-Dm5S3V1c.js → toast-DYfY2t_z.js} +2 -2
- package/dist/client/assets/{treeView-Q6P3EWNA-CGSjigr_.js → treeView-Q6P3EWNA-BjKaOr9u.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-BS1Y39WM.js → treemap-WGGIJYW6-ffFPsmk1.js} +1 -1
- package/dist/client/assets/{usage-ByG67Q9r.js → usage-CRK5JZJm.js} +2 -2
- package/dist/client/assets/{use-atom-command-COr3-BfL.js → use-atom-command-Dz_yqN35.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-BWKsU_Gt.js → useHandleNewThread-DjevdE0U.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-C65BTMJa.js → usePullRequestActions-BKpChcp1.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-D2Bb81KH.js → useScopedModelAvailability-mUid6EfJ.js} +2 -2
- package/dist/client/assets/{useSettings-WGf2H_E7.js → useSettings-DCI8Hv09.js} +2 -2
- package/dist/client/assets/{useT3ConnectAuthPrompt-DkfGkujP.js → useT3ConnectAuthPrompt-C7Dm8xCm.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-CUgwItfg.js → vcsRefInvalidation-3pHpDJC2.js} +2 -2
- package/dist/client/assets/{vennDiagram-4TSXK5OY-D82sXWUt.js → vennDiagram-4TSXK5OY-Bw5_1h9Y.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-wxkoFCaM.js → wardley-WFR3VGLG-BzzHb86M.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-DZkAGgtY.js → wardleyDiagram-VM6X3IG4-RCSx0hV5.js} +2 -2
- package/dist/client/assets/{welcome-CbLsZSs9.js → welcome-RXSMyzlx.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BqDefNNt.js → xychartDiagram-S5SC5T6Z-CcISZM46.js} +2 -2
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-BnVYv_Tj.js +0 -1
- package/dist/client/assets/channel-ke6KlN2m.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-_dDKzg70.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-_dDKzg70.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-BxLxqsIB.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-CEdMSh3v.js +0 -1
- package/dist/client/assets/main-r-P9O3jD.css +0 -2
- package/dist/client/assets/popover-BDFZje9T.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DZY_wWOl.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-DuwTAynV.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-wPuXkdeA.js +0 -1
- package/dist/client/assets/settings.archived-DQ04FuiA.js +0 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-hQOpsZ3n.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BA9BVweg.js +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{IT as n,Kd as r,ME as i,Qy as a,Yo as o,cE as s,eh as c,hd as l,l as u,n_ as d,nh as f,sr as p,t as m,t_ as h,vd as g,y_ as _}from"./utils-CRwA5SKO.js";import{R as v,W as y}from"./runtime-B3_ce0WW.js";import{n as b,s as x,t as ee}from"./environments-DcJA_6Bd.js";import{f as S}from"./server-BP2BG-G5.js";import{i as te,n as C}from"./session-B20XW_sH.js";import{n as w}from"./query-CpOQgkic.js";import{t as T}from"./use-atom-command-COr3-BfL.js";import{L as ne,f as re}from"./useSettings-WGf2H_E7.js";import{n as E,t as D}from"./radio-group-CfHe3q1m.js";import{t as ie}from"./input-DhWmPSxf.js";import{a as ae,c as O,i as oe,r as se,s as ce,t as le}from"./dialog-x5a5g_fa.js";import{x as k}from"./Icons-BFyKltvl.js";import{t as ue}from"./preview-IWIgXHdy.js";import{S as A,t as de}from"./ChatGptUsageButton-CVZHYvIk.js";import{a as fe}from"./settingsLayout-C0HMxLxU.js";import{Aa as j,Fa as M,Ki as pe,Ma as me,Pa as he,fr as N,ja as ge,ka as P,qi as F}from"./main-BxSUUHl7.js";var I=e(t(),1),L=i(),R=e(s(),1);function z(e){let t=(0,L.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,R.jsx)(k,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,R.jsxs)(p,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function _e(e){let t=(0,L.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(ye),[s,c]=(0,I.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=le,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=ce,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,R.jsxs)(ae,{children:[(0,R.jsx)(O,{children:`Reconnect ChatGPT`}),(0,R.jsx)(se,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(ve),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,R.jsx)(D,{value:`chatgpt-change-account`}),(0,R.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,R.jsx)(`div`,{className:`px-6 pb-6`,children:(0,R.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,R.jsx)(oe,{children:(0,R.jsx)(z,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,R.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,R.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function ve(e){return(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,R.jsx)(D,{value:e.id}),(0,R.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function ye(e){return e.id.startsWith(`chatgpt-profile:`)}function be(e){let t=(0,L.c)(36),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,s=te(n,_),c=re(n),l;t[0]===n?l=t[1]:(l=S.providersValueAtom(n),t[0]=n,t[1]=l);let f=o(l),m=T(S.updateSettings,`Add ChatGPT account`),[g,v]=(0,I.useState)(`Personal`),y;t[2]===g?y=t[3]:(y=g.trim(),t[2]=g,t[3]=y);let b=`ChatGPT - ${y}`,[x,ee]=(0,I.useState)(null),[w,ne]=(0,I.useState)(!1),E=f?.find(e=>e.instanceId===x),D=A(E),ae=(0,I.useEffectEvent)(r);(0,I.useEffect)(()=>{D&&ae()},[D]);let O;t[4]!==b||t[5]!==n||t[6]!==g||t[7]!==a||t[8]!==r||t[9]!==w||t[10]!==c||t[11]!==m?(O=async()=>{if(w||!g.trim()||!C(n,`providers:manage`))return;ne(!0);let e=d.make(`codex_${u()}`);(await m({environmentId:n,input:{patch:{providerInstances:{...c.providerInstances,[e]:{driver:h.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):ee(e)),ne(!1)},t[4]=b,t[5]=n,t[6]=g,t[7]=a,t[8]=r,t[9]=w,t[10]=c,t[11]=m,t[12]=O):O=t[12];let oe=O,se=le,ce=!D,k;t[13]===r?k=t[14]:(k=e=>{e||r()},t[13]=r,t[14]=k);let ue=me,de=x?b:`Add ChatGPT account`,M;t[15]===de?M=t[16]:(M=(0,R.jsx)(j,{title:de,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[15]=de,t[16]=M);let pe=ge,he=x?E?.setup?i(x,E):(0,R.jsx)(fe,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,R.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),oe()},children:(0,R.jsx)(fe,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,R.jsx)(ie,{"aria-label":`Account name`,value:g,disabled:w,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),N;t[17]!==pe||t[18]!==he?(N=(0,R.jsx)(pe,{children:he}),t[17]=pe,t[18]=he,t[19]=N):N=t[19];let F;t[20]!==s||t[21]!==x||t[22]!==g||t[23]!==r||t[24]!==w?(F=(0,R.jsx)(P,{children:x?(0,R.jsx)(p,{variant:`outline`,onClick:r,children:`Finish later`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p,{variant:`outline`,disabled:w,onClick:r,children:`Cancel`}),(0,R.jsx)(p,{type:`submit`,form:`add-codex-account`,disabled:w||!g.trim()||!s,children:w?`Adding account…`:`Continue`})]})}),t[20]=s,t[21]=x,t[22]=g,t[23]=r,t[24]=w,t[25]=F):F=t[25];let z;t[26]!==ue||t[27]!==N||t[28]!==F||t[29]!==M?(z=(0,R.jsxs)(ue,{size:`wide`,children:[M,N,F]}),t[26]=ue,t[27]=N,t[28]=F,t[29]=M,t[30]=z):z=t[30];let _e;return t[31]!==se||t[32]!==z||t[33]!==ce||t[34]!==k?(_e=(0,R.jsx)(se,{open:ce,onOpenChange:k,children:z}),t[31]=se,t[32]=z,t[33]=ce,t[34]=k,t[35]=_e):_e=t[35],_e}var xe=a(c),Se=a(f),Ce=/^[A-Za-z0-9_./:\\-]+$/;function we(e,t,n){return Ce.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Te(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var B={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function V(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||B[Te(n)]>B[Te(e)])&&t.set(n.driver,n)}return t}var Ee={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function De(e,t){let n=Ee[e];return t===`windows`?n.windows:n.posix}function Oe(e,t,r){let i=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=xe(i?.config??{});return`${we(n(e)?e.value.binaryPath:`claude`,`claude`,r)} auth login`}if(e.driver===`codex`){let e=Se(i?.config??{});return`${we(n(e)?e.value.binaryPath:`codex`,`codex`,r)} login`}return e.driver}var ke={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function H(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function U(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var Ae={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function je(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=U(n)??t.recommendedRange;return{title:Ae[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=U(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var Me=()=>void 0;function Ne(e){let t=(0,L.c)(11),[n,r]=(0,I.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Te(e.provider),t[0]=e.provider,t[1]=i);let a=i,o=e.enabled&&a===`ready`,s=e.provider?.auth.status===`authenticated`,c=a===`checking`,u;t[2]===e.provider?u=t[3]:(u=H(e.provider),t[2]=e.provider,t[3]=u);let d=u,f;return t[4]!==s||t[5]!==c||t[6]!==o||t[7]!==d||t[8]!==e||t[9]!==n?(f=e.mode===`existing`&&e.presentation===`onboarding`?(0,R.jsx)(Le,{title:e.displayName||e.provider?.displayName||`Codex`,description:o?e.provider?.auth.email?.trim()?(0,R.jsxs)(R.Fragment,{children:[`Signed in as`,` `,(0,R.jsx)(N,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:c?`Checking your Codex CLI...`:e.provider?.installed?d.headline:`Code with your ChatGPT subscription.`,control:o?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,R.jsx)(l,{className:`size-3.5`}),`Ready`]}):c?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):s?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d.headline}):(0,R.jsx)(z,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!s&&!o&&!c?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,R.jsx)(Le,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,R.jsx)(Ie,{}),control:(0,R.jsx)(p,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,R.jsx)(fe,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,R.jsx)(Fe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=s,t[5]=c,t[6]=o,t[7]=d,t[8]=e,t[9]=n,t[10]=f):f=t[10],f}function Pe(e){let t=(0,L.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=te(n,_),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,R.jsx)(Fe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:Me,onModeChange:Me,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,R.jsx)(be,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Fe({environmentId:e,instanceId:t,provider:n,enabled:i,readOnly:a,onModeChange:o,autoStart:s,onAutoStartConsumed:c,allowExistingCli:u=!0,presentation:d,displayName:f,onSignInCancelled:h}){let g={environmentId:e,input:{instanceId:t}},_=w(S.providerAuthState(g)),te=w(S.providerInstallState(g)),[C,re]=(0,I.useState)(null),E=w(C?S.chatGptHandoffState(C):null),D=E.data?.phase===`auth`?E.data.state:_.data,[ae,O]=(0,I.useState)(!1),[oe,se]=(0,I.useState)(`chatgpt`),ce=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,le=D?.methods?.find(e=>e.id===oe)?.accountEmail,k=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),A=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,j=te.data,me=b(e),ge=me!==null&&ue(new URL(me).hostname),P={reportFailure:!1,reportDefect:!1},L=T(S.startProviderAuth,P),ve=T(S.refreshProviders,P),ye=T(S.completeProviderAuth,P),be=T(S.cancelProviderAuth,P),xe=T(S.logoutProviderAuth,P),Se=T(S.startProviderInstall,P),Ce=T(S.cancelProviderInstall,P),we=T(S.chatGptReconnectProfile,P),Te=T(S.chatGptImportProfile,P),B=!C&&(!ge||window.desktopBridge?.receiveProviderAuthCallback!==void 0),V=B&&!window.desktopBridge?.receiveProviderAuthCallback,Ee=x(),De=ee(Ee),Oe=b(Ee),ke=!ge&&Ee&&De?.connection.phase===`connected`&&Oe&&ue(new URL(Oe).hostname)&&(window.desktopBridge!==void 0||ue(window.location.hostname))?Ee:null,H=new URL(window.location.href);H.pathname===`/welcome`&&(H.hash=`agents:${e}`),H.pathname===`/settings/providers`&&H.searchParams.set(`instanceId`,t);let U=V,Ae=(0,I.useId)(),[je,Me]=(0,I.useState)(!1),[Ne,Pe]=(0,I.useState)({flowId:``,value:``}),Fe=Ne.flowId===D?.flowId?Ne.value:``,[W,Re]=(0,I.useState)(!1),[ze,Be]=(0,I.useState)(null),Ve=(0,I.useRef)(!1),[He,Ue]=(0,I.useState)(null),G=(0,I.useRef)(null),K=(0,I.useRef)(!1),We=(0,I.useRef)(null),[Ge,Ke]=(0,I.useState)(!1),q=j?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&j?.source!==`local`&&j?.version!=null&&j.version!==j.installedVersion,Je=ze!==null&&!J&&(D?.phase===`succeeded`||ze===`handoff`);(0,I.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&Be(null)},[J,D?.phase]),(0,I.useEffect)(()=>{ze&&D?.phase===`succeeded`&&ve({environmentId:e,input:{instanceId:t}})},[ze,D?.phase,ve,e,t]);let Ye=s&&!Ge,Xe=ze===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||C!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=j?.phase===`downloading`||j?.phase===`extracting`||j?.phase===`verifying`,X=Ye||Ze||W&&!Y,Z=a||!i||W||_.error!==null||te.error!==null,Q=W||Ze||Y,$=(0,I.useCallback)(async(e,t)=>{if(Ve.current)return!1;Ve.current=!0,Re(!0),Ue(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!v(r)){let e=y(r);Ue(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{Ue(`Codex setup failed. Try again.`)}return Ve.current=!1,Re(!1),n},[]),Qe=(0,I.useId)(),$e=(0,I.useRef)(0),et=(0,I.useRef)(null),[tt,nt]=(0,I.useState)(!1),rt=(0,I.useCallback)(async n=>{let r=await $(()=>Te({environmentId:e,input:{instanceId:t,profile:n}}));r&&(Be(`handoff`),re(null)),nt(!r)},[$,Te,e,t]);(0,I.useEffect)(()=>{if(!C||E.data?.phase!==`finished`)return;let e=C.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[C,E.data,rt]),(0,I.useEffect)(()=>{C&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(Ue(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),re(null))},[C,E.data,E.error]);let it=(0,I.useCallback)(()=>(Be(null),C?(re(null),Promise.resolve()):$(()=>be({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[C,$,be,e,t,D]),at=(0,I.useCallback)(async(n=`chatgpt`)=>{if(Ve.current)return;K.current=!0,nt(!1),se(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),ke){let i=`${Qe}:${++$e.current}`;await $(()=>we({environmentId:e,input:{instanceId:t,methodId:n}}),n=>re({environmentId:ke,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(K.current=!1);return}await $(()=>L({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:B?`client`:`server`}}),()=>Be(`sign-in`))||(K.current=!1)},[e,t,$,L,B,ke,we,Qe]),ot=(0,I.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(G.current=n,await $(()=>Se({environmentId:e,input:{instanceId:t}}))||(G.current=null)))},[Z,Q,q,qe,at,$,Se,e,t]);(0,I.useEffect)(()=>{!s||Ge||Z||Q||j===null||!n?.setup?.canInstall||(Ke(!0),c(),ot())},[s,Ge,Z,Q,j,n?.setup?.canInstall,c,ot]),(0,I.useEffect)(()=>{if(!(!G.current||W||Y)){if(j?.phase===`failed`||j?.phase===`cancelled`)G.current=null;else if(q){let e=G.current;G.current=null,at(e)}}},[W,Y,j?.phase,q,at]);let st=(0,I.useRef)(null),ct=D?.flowId,lt=(0,I.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&B&&ct){if(st.current===n){await ne().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>ye({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await ne().shell.openExternal(n)}catch{Ue(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[B,ct,$,ye,e,t]);(0,I.useEffect)(()=>{if(B&&A&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===A&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(A).catch(()=>void 0)}},[B,A]),(0,I.useEffect)(()=>{K.current&&D?.phase===`waiting`&&D.flowId&&A&&We.current!==D.flowId&&(We.current=D.flowId,K.current=!1,V||lt(A))},[D?.phase,D?.flowId,A,lt,V]);let ut=j?.phase===`downloading`?`Downloading ${(j.downloadedBytes/1e6).toFixed(1)}${j.totalBytes===null?``:` of ${(j.totalBytes/1e6).toFixed(1)}`} MB.`:j?.phase===`extracting`?`Installing Codex.`:j?.phase===`verifying`?`Checking Codex.`:q?`${j?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${j?.installedVersion?` · v${j.installedVersion}`:``}.`:j?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&le?`Continue as ${le} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,R.jsxs)(R.Fragment,{children:[`Signed in as`,` `,(0,R.jsx)(N,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:ce??`Use your ChatGPT subscription.`,ft=U&&A&&D?.flowId&&F(H.toString())?pe({authorizationUrl:A,returnUrl:H.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,R.jsx)(p,{size:`sm`,variant:V?`default`:`outline`,className:d===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?W||!tt:!A||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):A&<(A)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?V?`Open ChatGPT sign-in`:`Open sign-in page`:d===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!C&&D?.phase===`waiting`&&A?(0,R.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,R.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,R.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Fe.trim())return;let r=Fe.trim(),i=D.flowId;$(()=>ye({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Pe({flowId:i,value:``})})},children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Fe,maxLength:16384,disabled:W||a,onChange:e=>Pe({flowId:D.flowId??``,value:e.target.value})})}),(0,R.jsx)(p,{variant:`outline`,type:`submit`,disabled:W||a||!Fe.trim(),children:`Connect`})]}),V?null:(0,R.jsx)(`div`,{children:(0,R.jsxs)(p,{size:`xs`,variant:`ghost-muted`,onClick:()=>void ne().shell.openExternal(A),children:[`Try sign-in in your browser`,(0,R.jsx)(r,{className:`size-3.5`})]})}),ft?(0,R.jsxs)(`details`,{children:[(0,R.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,R.jsx)(p,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,R.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,R.jsx)(he,{open:je,children:(0,R.jsx)(M,{children:(0,R.jsx)(`div`,{id:Ae,className:m(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=U?mt:mt?(0,R.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,R.jsx)(Ie,{label:`Having trouble signing in?`,expanded:je,controls:Ae,onToggle:()=>Me(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,R.jsx)(_e,{open:ae,methods:D?.methods??[],onClose:()=>O(!1),onSelect:e=>{O(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(d===`onboarding`){let r=vt??He??(_.error||te.error?`Could not read setup status. Reconnect and try again.`:j?.phase===`failed`?j.message:null);return(0,R.jsxs)(R.Fragment,{children:[_t,(0,R.jsxs)(Le,{title:f||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,R.jsxs)(R.Fragment,{children:[`Signed in as`,` `,(0,R.jsx)(N,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!U?(0,R.jsx)(Ie,{expanded:je,controls:Ae,onToggle:()=>Me(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||W&&!Y?(0,R.jsx)(Ie,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,R.jsx)(l,{className:`size-3.5`}),`Ready`]}):X?pt:(0,R.jsx)(z,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{k?O(!0):ot()},children:Y||W?`Setting up...`:k?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:W||a,onClick:()=>{K.current=!1,G.current=null,C||X&&D?.flowId?it():j?.operationId&&$(()=>Ce({environmentId:e,input:{instanceId:t,operationId:j.operationId}}))},children:`Cancel`}):!X&&!J&&k?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&u?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:a||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null,children:[U?gt:ht(),r?(0,R.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,R.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,R.jsx)(fe,{title:`ChatGPT account`,description:dt,control:(0,R.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:X?(0,R.jsxs)(R.Fragment,{children:[pt,!Je&&(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:W||a,onClick:()=>{(C||D?.flowId)&&(K.current=!1,it(),h?.())},children:`Cancel`})]}):Y?(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:W||a,onClick:()=>{j?.operationId&&(G.current=null,$(()=>Ce({environmentId:e,input:{instanceId:t,operationId:j.operationId}})))},children:`Cancel`}):J?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>O(!0),children:`Change account`}),(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>xe(g)),children:`Disconnect`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{k?O(!0):ot()},children:W?`Setting up...`:k?`Reconnect account`:`Continue with ChatGPT`}),k?(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null]})})}),J?(0,R.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,R.jsx)(de,{})}):null,vt?(0,R.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,R.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,He||_.error||te.error||j?.phase===`failed`?(0,R.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:He??(j?.phase===`failed`?j.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function W(e){let t=(0,L.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=S.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=w(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,R.jsx)(fe,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,R.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,R.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,R.jsx)(fe,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,R.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,R.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,R.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,R.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,R.jsx)(fe,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,R.jsxs)(R.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Ie(e){let t=(0,L.c)(10),{label:n,expanded:r,controls:i,onToggle:a}=e,o=n===void 0?`Complete sign-in in your browser.`:n,s=r!==void 0&&r;if(!a){let e;return t[0]===o?e=t[1]:(e=(0,R.jsx)(`div`,{className:`leading-relaxed`,children:o}),t[0]=o,t[1]=e),e}let c=`size-3 shrink-0 ${s?`rotate-90`:``}`,l;t[2]===c?l=t[3]:(l=(0,R.jsx)(g,{"aria-hidden":!0,className:c}),t[2]=c,t[3]=l);let u;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==a||t[8]!==l?(u=(0,R.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":s,"aria-controls":i,onClick:a,children:[o,l]}),t[4]=i,t[5]=s,t[6]=o,t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function Le(e){let t=(0,L.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=I.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,R.jsx)(k,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,R.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,R.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,R.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,R.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Re(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{ke as a,U as c,Oe as d,V as f,Ne as i,Te as l,Pe as n,H as o,z as p,W as r,je as s,Re as t,De as u};
|
|
2
|
-
//# sourceMappingURL=CodexSetupSection.logic-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{IT as n,Kd as r,ME as i,Qy as a,Yo as o,cE as s,eh as c,hd as l,l as u,n_ as d,nh as f,sr as p,t as m,t_ as h,vd as g,y_ as _}from"./utils-CRwA5SKO.js";import{R as v,W as y}from"./runtime-DZfpb67Q.js";import{n as b,s as x,t as ee}from"./environments-Dm2_6Uan.js";import{f as S}from"./server-LJ0-FVGH.js";import{i as te,n as C}from"./session-Bc1P10r_.js";import{n as w}from"./query-CpOQgkic.js";import{t as T}from"./use-atom-command-Dz_yqN35.js";import{L as ne,f as re}from"./useSettings-DCI8Hv09.js";import{n as E,t as D}from"./radio-group-CfHe3q1m.js";import{t as ie}from"./input-DhWmPSxf.js";import{a as ae,c as O,i as oe,r as se,s as ce,t as le}from"./dialog-x5a5g_fa.js";import{x as k}from"./Icons-BFyKltvl.js";import{t as ue}from"./preview-IWIgXHdy.js";import{S as A,t as de}from"./ChatGptUsageButton-fMcoYEDa.js";import{a as fe}from"./settingsLayout-Cbpy7Mfz.js";import{Aa as j,Fa as M,Ki as pe,Ma as me,Pa as he,fr as N,ja as ge,ka as P,qi as F}from"./main-CxOeqlhD.js";var I=e(t(),1),L=i(),R=e(s(),1);function z(e){let t=(0,L.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,R.jsx)(k,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,R.jsxs)(p,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function _e(e){let t=(0,L.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(ye),[s,c]=(0,I.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=le,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=ce,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,R.jsxs)(ae,{children:[(0,R.jsx)(O,{children:`Reconnect ChatGPT`}),(0,R.jsx)(se,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(ve),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,R.jsx)(D,{value:`chatgpt-change-account`}),(0,R.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,R.jsx)(`div`,{className:`px-6 pb-6`,children:(0,R.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,R.jsx)(oe,{children:(0,R.jsx)(z,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,R.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,R.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function ve(e){return(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,R.jsx)(D,{value:e.id}),(0,R.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function ye(e){return e.id.startsWith(`chatgpt-profile:`)}function be(e){let t=(0,L.c)(36),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,s=te(n,_),c=re(n),l;t[0]===n?l=t[1]:(l=S.providersValueAtom(n),t[0]=n,t[1]=l);let f=o(l),m=T(S.updateSettings,`Add ChatGPT account`),[g,v]=(0,I.useState)(`Personal`),y;t[2]===g?y=t[3]:(y=g.trim(),t[2]=g,t[3]=y);let b=`ChatGPT - ${y}`,[x,ee]=(0,I.useState)(null),[w,ne]=(0,I.useState)(!1),E=f?.find(e=>e.instanceId===x),D=A(E),ae=(0,I.useEffectEvent)(r);(0,I.useEffect)(()=>{D&&ae()},[D]);let O;t[4]!==b||t[5]!==n||t[6]!==g||t[7]!==a||t[8]!==r||t[9]!==w||t[10]!==c||t[11]!==m?(O=async()=>{if(w||!g.trim()||!C(n,`providers:manage`))return;ne(!0);let e=d.make(`codex_${u()}`);(await m({environmentId:n,input:{patch:{providerInstances:{...c.providerInstances,[e]:{driver:h.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):ee(e)),ne(!1)},t[4]=b,t[5]=n,t[6]=g,t[7]=a,t[8]=r,t[9]=w,t[10]=c,t[11]=m,t[12]=O):O=t[12];let oe=O,se=le,ce=!D,k;t[13]===r?k=t[14]:(k=e=>{e||r()},t[13]=r,t[14]=k);let ue=me,de=x?b:`Add ChatGPT account`,M;t[15]===de?M=t[16]:(M=(0,R.jsx)(j,{title:de,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[15]=de,t[16]=M);let pe=ge,he=x?E?.setup?i(x,E):(0,R.jsx)(fe,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,R.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),oe()},children:(0,R.jsx)(fe,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,R.jsx)(ie,{"aria-label":`Account name`,value:g,disabled:w,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),N;t[17]!==pe||t[18]!==he?(N=(0,R.jsx)(pe,{children:he}),t[17]=pe,t[18]=he,t[19]=N):N=t[19];let F;t[20]!==s||t[21]!==x||t[22]!==g||t[23]!==r||t[24]!==w?(F=(0,R.jsx)(P,{children:x?(0,R.jsx)(p,{variant:`outline`,onClick:r,children:`Finish later`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p,{variant:`outline`,disabled:w,onClick:r,children:`Cancel`}),(0,R.jsx)(p,{type:`submit`,form:`add-codex-account`,disabled:w||!g.trim()||!s,children:w?`Adding account…`:`Continue`})]})}),t[20]=s,t[21]=x,t[22]=g,t[23]=r,t[24]=w,t[25]=F):F=t[25];let z;t[26]!==ue||t[27]!==N||t[28]!==F||t[29]!==M?(z=(0,R.jsxs)(ue,{size:`wide`,children:[M,N,F]}),t[26]=ue,t[27]=N,t[28]=F,t[29]=M,t[30]=z):z=t[30];let _e;return t[31]!==se||t[32]!==z||t[33]!==ce||t[34]!==k?(_e=(0,R.jsx)(se,{open:ce,onOpenChange:k,children:z}),t[31]=se,t[32]=z,t[33]=ce,t[34]=k,t[35]=_e):_e=t[35],_e}var xe=a(c),Se=a(f),Ce=/^[A-Za-z0-9_./:\\-]+$/;function we(e,t,n){return Ce.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Te(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var B={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function V(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||B[Te(n)]>B[Te(e)])&&t.set(n.driver,n)}return t}var Ee={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function De(e,t){let n=Ee[e];return t===`windows`?n.windows:n.posix}function Oe(e,t,r){let i=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=xe(i?.config??{});return`${we(n(e)?e.value.binaryPath:`claude`,`claude`,r)} auth login`}if(e.driver===`codex`){let e=Se(i?.config??{});return`${we(n(e)?e.value.binaryPath:`codex`,`codex`,r)} login`}return e.driver}var ke={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function H(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function U(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var Ae={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function je(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=U(n)??t.recommendedRange;return{title:Ae[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=U(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var Me=()=>void 0;function Ne(e){let t=(0,L.c)(11),[n,r]=(0,I.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Te(e.provider),t[0]=e.provider,t[1]=i);let a=i,o=e.enabled&&a===`ready`,s=e.provider?.auth.status===`authenticated`,c=a===`checking`,u;t[2]===e.provider?u=t[3]:(u=H(e.provider),t[2]=e.provider,t[3]=u);let d=u,f;return t[4]!==s||t[5]!==c||t[6]!==o||t[7]!==d||t[8]!==e||t[9]!==n?(f=e.mode===`existing`&&e.presentation===`onboarding`?(0,R.jsx)(Le,{title:e.displayName||e.provider?.displayName||`Codex`,description:o?e.provider?.auth.email?.trim()?(0,R.jsxs)(R.Fragment,{children:[`Signed in as`,` `,(0,R.jsx)(N,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:c?`Checking your Codex CLI...`:e.provider?.installed?d.headline:`Code with your ChatGPT subscription.`,control:o?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,R.jsx)(l,{className:`size-3.5`}),`Ready`]}):c?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):s?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d.headline}):(0,R.jsx)(z,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!s&&!o&&!c?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,R.jsx)(Le,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,R.jsx)(Ie,{}),control:(0,R.jsx)(p,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,R.jsx)(fe,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,R.jsx)(Fe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=s,t[5]=c,t[6]=o,t[7]=d,t[8]=e,t[9]=n,t[10]=f):f=t[10],f}function Pe(e){let t=(0,L.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=te(n,_),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,R.jsx)(Fe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:Me,onModeChange:Me,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,R.jsx)(be,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Fe({environmentId:e,instanceId:t,provider:n,enabled:i,readOnly:a,onModeChange:o,autoStart:s,onAutoStartConsumed:c,allowExistingCli:u=!0,presentation:d,displayName:f,onSignInCancelled:h}){let g={environmentId:e,input:{instanceId:t}},_=w(S.providerAuthState(g)),te=w(S.providerInstallState(g)),[C,re]=(0,I.useState)(null),E=w(C?S.chatGptHandoffState(C):null),D=E.data?.phase===`auth`?E.data.state:_.data,[ae,O]=(0,I.useState)(!1),[oe,se]=(0,I.useState)(`chatgpt`),ce=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,le=D?.methods?.find(e=>e.id===oe)?.accountEmail,k=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),A=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,j=te.data,me=b(e),ge=me!==null&&ue(new URL(me).hostname),P={reportFailure:!1,reportDefect:!1},L=T(S.startProviderAuth,P),ve=T(S.refreshProviders,P),ye=T(S.completeProviderAuth,P),be=T(S.cancelProviderAuth,P),xe=T(S.logoutProviderAuth,P),Se=T(S.startProviderInstall,P),Ce=T(S.cancelProviderInstall,P),we=T(S.chatGptReconnectProfile,P),Te=T(S.chatGptImportProfile,P),B=!C&&(!ge||window.desktopBridge?.receiveProviderAuthCallback!==void 0),V=B&&!window.desktopBridge?.receiveProviderAuthCallback,Ee=x(),De=ee(Ee),Oe=b(Ee),ke=!ge&&Ee&&De?.connection.phase===`connected`&&Oe&&ue(new URL(Oe).hostname)&&(window.desktopBridge!==void 0||ue(window.location.hostname))?Ee:null,H=new URL(window.location.href);H.pathname===`/welcome`&&(H.hash=`agents:${e}`),H.pathname===`/settings/providers`&&H.searchParams.set(`instanceId`,t);let U=V,Ae=(0,I.useId)(),[je,Me]=(0,I.useState)(!1),[Ne,Pe]=(0,I.useState)({flowId:``,value:``}),Fe=Ne.flowId===D?.flowId?Ne.value:``,[W,Re]=(0,I.useState)(!1),[ze,Be]=(0,I.useState)(null),Ve=(0,I.useRef)(!1),[He,Ue]=(0,I.useState)(null),G=(0,I.useRef)(null),K=(0,I.useRef)(!1),We=(0,I.useRef)(null),[Ge,Ke]=(0,I.useState)(!1),q=j?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&j?.source!==`local`&&j?.version!=null&&j.version!==j.installedVersion,Je=ze!==null&&!J&&(D?.phase===`succeeded`||ze===`handoff`);(0,I.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&Be(null)},[J,D?.phase]),(0,I.useEffect)(()=>{ze&&D?.phase===`succeeded`&&ve({environmentId:e,input:{instanceId:t}})},[ze,D?.phase,ve,e,t]);let Ye=s&&!Ge,Xe=ze===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||C!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=j?.phase===`downloading`||j?.phase===`extracting`||j?.phase===`verifying`,X=Ye||Ze||W&&!Y,Z=a||!i||W||_.error!==null||te.error!==null,Q=W||Ze||Y,$=(0,I.useCallback)(async(e,t)=>{if(Ve.current)return!1;Ve.current=!0,Re(!0),Ue(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!v(r)){let e=y(r);Ue(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{Ue(`Codex setup failed. Try again.`)}return Ve.current=!1,Re(!1),n},[]),Qe=(0,I.useId)(),$e=(0,I.useRef)(0),et=(0,I.useRef)(null),[tt,nt]=(0,I.useState)(!1),rt=(0,I.useCallback)(async n=>{let r=await $(()=>Te({environmentId:e,input:{instanceId:t,profile:n}}));r&&(Be(`handoff`),re(null)),nt(!r)},[$,Te,e,t]);(0,I.useEffect)(()=>{if(!C||E.data?.phase!==`finished`)return;let e=C.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[C,E.data,rt]),(0,I.useEffect)(()=>{C&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(Ue(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),re(null))},[C,E.data,E.error]);let it=(0,I.useCallback)(()=>(Be(null),C?(re(null),Promise.resolve()):$(()=>be({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[C,$,be,e,t,D]),at=(0,I.useCallback)(async(n=`chatgpt`)=>{if(Ve.current)return;K.current=!0,nt(!1),se(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),ke){let i=`${Qe}:${++$e.current}`;await $(()=>we({environmentId:e,input:{instanceId:t,methodId:n}}),n=>re({environmentId:ke,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(K.current=!1);return}await $(()=>L({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:B?`client`:`server`}}),()=>Be(`sign-in`))||(K.current=!1)},[e,t,$,L,B,ke,we,Qe]),ot=(0,I.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(G.current=n,await $(()=>Se({environmentId:e,input:{instanceId:t}}))||(G.current=null)))},[Z,Q,q,qe,at,$,Se,e,t]);(0,I.useEffect)(()=>{!s||Ge||Z||Q||j===null||!n?.setup?.canInstall||(Ke(!0),c(),ot())},[s,Ge,Z,Q,j,n?.setup?.canInstall,c,ot]),(0,I.useEffect)(()=>{if(!(!G.current||W||Y)){if(j?.phase===`failed`||j?.phase===`cancelled`)G.current=null;else if(q){let e=G.current;G.current=null,at(e)}}},[W,Y,j?.phase,q,at]);let st=(0,I.useRef)(null),ct=D?.flowId,lt=(0,I.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&B&&ct){if(st.current===n){await ne().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>ye({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await ne().shell.openExternal(n)}catch{Ue(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[B,ct,$,ye,e,t]);(0,I.useEffect)(()=>{if(B&&A&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===A&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(A).catch(()=>void 0)}},[B,A]),(0,I.useEffect)(()=>{K.current&&D?.phase===`waiting`&&D.flowId&&A&&We.current!==D.flowId&&(We.current=D.flowId,K.current=!1,V||lt(A))},[D?.phase,D?.flowId,A,lt,V]);let ut=j?.phase===`downloading`?`Downloading ${(j.downloadedBytes/1e6).toFixed(1)}${j.totalBytes===null?``:` of ${(j.totalBytes/1e6).toFixed(1)}`} MB.`:j?.phase===`extracting`?`Installing Codex.`:j?.phase===`verifying`?`Checking Codex.`:q?`${j?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${j?.installedVersion?` · v${j.installedVersion}`:``}.`:j?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&le?`Continue as ${le} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,R.jsxs)(R.Fragment,{children:[`Signed in as`,` `,(0,R.jsx)(N,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:ce??`Use your ChatGPT subscription.`,ft=U&&A&&D?.flowId&&F(H.toString())?pe({authorizationUrl:A,returnUrl:H.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,R.jsx)(p,{size:`sm`,variant:V?`default`:`outline`,className:d===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?W||!tt:!A||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):A&<(A)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?V?`Open ChatGPT sign-in`:`Open sign-in page`:d===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!C&&D?.phase===`waiting`&&A?(0,R.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,R.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,R.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Fe.trim())return;let r=Fe.trim(),i=D.flowId;$(()=>ye({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Pe({flowId:i,value:``})})},children:[(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Fe,maxLength:16384,disabled:W||a,onChange:e=>Pe({flowId:D.flowId??``,value:e.target.value})})}),(0,R.jsx)(p,{variant:`outline`,type:`submit`,disabled:W||a||!Fe.trim(),children:`Connect`})]}),V?null:(0,R.jsx)(`div`,{children:(0,R.jsxs)(p,{size:`xs`,variant:`ghost-muted`,onClick:()=>void ne().shell.openExternal(A),children:[`Try sign-in in your browser`,(0,R.jsx)(r,{className:`size-3.5`})]})}),ft?(0,R.jsxs)(`details`,{children:[(0,R.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,R.jsx)(p,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,R.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,R.jsx)(he,{open:je,children:(0,R.jsx)(M,{children:(0,R.jsx)(`div`,{id:Ae,className:m(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=U?mt:mt?(0,R.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,R.jsx)(Ie,{label:`Having trouble signing in?`,expanded:je,controls:Ae,onToggle:()=>Me(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,R.jsx)(_e,{open:ae,methods:D?.methods??[],onClose:()=>O(!1),onSelect:e=>{O(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(d===`onboarding`){let r=vt??He??(_.error||te.error?`Could not read setup status. Reconnect and try again.`:j?.phase===`failed`?j.message:null);return(0,R.jsxs)(R.Fragment,{children:[_t,(0,R.jsxs)(Le,{title:f||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,R.jsxs)(R.Fragment,{children:[`Signed in as`,` `,(0,R.jsx)(N,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!U?(0,R.jsx)(Ie,{expanded:je,controls:Ae,onToggle:()=>Me(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||W&&!Y?(0,R.jsx)(Ie,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,R.jsx)(l,{className:`size-3.5`}),`Ready`]}):X?pt:(0,R.jsx)(z,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{k?O(!0):ot()},children:Y||W?`Setting up...`:k?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:W||a,onClick:()=>{K.current=!1,G.current=null,C||X&&D?.flowId?it():j?.operationId&&$(()=>Ce({environmentId:e,input:{instanceId:t,operationId:j.operationId}}))},children:`Cancel`}):!X&&!J&&k?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&u?(0,R.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:a||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null,children:[U?gt:ht(),r?(0,R.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,R.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,R.jsx)(fe,{title:`ChatGPT account`,description:dt,control:(0,R.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:X?(0,R.jsxs)(R.Fragment,{children:[pt,!Je&&(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:W||a,onClick:()=>{(C||D?.flowId)&&(K.current=!1,it(),h?.())},children:`Cancel`})]}):Y?(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:W||a,onClick:()=>{j?.operationId&&(G.current=null,$(()=>Ce({environmentId:e,input:{instanceId:t,operationId:j.operationId}})))},children:`Cancel`}):J?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>O(!0),children:`Change account`}),(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>xe(g)),children:`Disconnect`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{k?O(!0):ot()},children:W?`Setting up...`:k?`Reconnect account`:`Continue with ChatGPT`}),k?(0,R.jsx)(p,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null]})})}),J?(0,R.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,R.jsx)(de,{})}):null,vt?(0,R.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,R.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,He||_.error||te.error||j?.phase===`failed`?(0,R.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:He??(j?.phase===`failed`?j.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function W(e){let t=(0,L.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=S.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=w(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,R.jsx)(fe,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,R.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,R.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,R.jsx)(fe,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,R.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,R.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,R.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,R.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,R.jsx)(fe,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,R.jsxs)(R.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Ie(e){let t=(0,L.c)(10),{label:n,expanded:r,controls:i,onToggle:a}=e,o=n===void 0?`Complete sign-in in your browser.`:n,s=r!==void 0&&r;if(!a){let e;return t[0]===o?e=t[1]:(e=(0,R.jsx)(`div`,{className:`leading-relaxed`,children:o}),t[0]=o,t[1]=e),e}let c=`size-3 shrink-0 ${s?`rotate-90`:``}`,l;t[2]===c?l=t[3]:(l=(0,R.jsx)(g,{"aria-hidden":!0,className:c}),t[2]=c,t[3]=l);let u;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==a||t[8]!==l?(u=(0,R.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":s,"aria-controls":i,onClick:a,children:[o,l]}),t[4]=i,t[5]=s,t[6]=o,t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function Le(e){let t=(0,L.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=I.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,R.jsx)(k,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,R.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,R.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,R.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,R.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Re(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{ke as a,U as c,Oe as d,V as f,Ne as i,Te as l,Pe as n,H as o,z as p,W as r,je as s,Re as t,De as u};
|
|
2
|
+
//# sourceMappingURL=CodexSetupSection.logic-CeUTTu-x.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{ME as t,cE as n,sr as r,t as i}from"./utils-CRwA5SKO.js";import{p as a}from"./toast-
|
|
2
|
-
//# sourceMappingURL=CommandBlock-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{ME as t,cE as n,sr as r,t as i}from"./utils-CRwA5SKO.js";import{p as a}from"./toast-DYfY2t_z.js";import{c as o,l as s,y as c}from"./tooltip-924Ikq0L.js";var l=t(),u=e(n(),1);function d(e){let t=(0,l.c)(19),{command:n,className:d,prominent:f}=e,p=f!==void 0&&f,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={timeout:1500,target:`command`},t[0]=m):m=t[0];let{copyToClipboard:h,isCopied:g}=a(m),_=p?`px-4 py-3.5 text-base`:`px-3 py-2.5 text-sm`,v;t[1]!==d||t[2]!==_?(v=i(`flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/50 font-mono`,_,d),t[1]=d,t[2]=_,t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,u.jsx)(`span`,{className:`mr-2 text-muted-foreground`,children:`$`}),t[4]=y):y=t[4];let b;t[5]===n?b=t[6]:(b=(0,u.jsxs)(`span`,{className:`min-w-0 truncate`,children:[y,n]}),t[5]=n,t[6]=b);let x;t[7]!==n||t[8]!==h?(x=()=>h(n,void 0),t[7]=n,t[8]=h,t[9]=x):x=t[9];let S=g?s:c,C;t[10]===S?C=t[11]:(C=(0,u.jsx)(o,{className:`size-3.5`,icon:S}),t[10]=S,t[11]=C);let w;t[12]!==x||t[13]!==C?(w=(0,u.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy command`,onClick:x,children:C}),t[12]=x,t[13]=C,t[14]=w):w=t[14];let T;return t[15]!==w||t[16]!==v||t[17]!==b?(T=(0,u.jsxs)(`div`,{className:v,children:[b,w]}),t[15]=w,t[16]=v,t[17]=b,t[18]=T):T=t[18],T}export{d as t};
|
|
2
|
+
//# sourceMappingURL=CommandBlock-BI3ZCXsB.js.map
|
package/dist/client/assets/{ComposerPromptEditor-BUr_9EhS.js → ComposerPromptEditor-BkRvKIiZ.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReadOnlySourcePreview-CQr-JCID.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-CRwA5SKO.js","assets/activity-C1Y3O_v1.js","assets/createLucideIcon-CacG5mZC.js","assets/alarm-clock-Pw90g7hE.js","assets/app-window-D2LBv8RE.js","assets/archive-0Qz6rgBl.js","assets/arrow-down-up-B46gw0xW.js","assets/arrow-down-DvRecXuy.js","assets/arrow-left-BLE461db.js","assets/arrow-right-left-BqjFeAD_.js","assets/arrow-right-CoV5ameY.js","assets/arrow-up-down-ibtVnemT.js","assets/arrow-up-left-BMvgV_8i.js","assets/arrow-up-right-C6IM-WPd.js","assets/arrow-up-3Yp3lsoe.js","assets/battery-Bjbw2yxu.js","assets/bell-CLuvLMth.js","assets/blocks-B-VfW07Q.js","assets/book-open-HEEW8eqT.js","assets/bookmark-HM-xwl47.js","assets/bot-DpQzHyXo.js","assets/box-CKWcQvdq.js","assets/bug-Dtc5BRVF.js","assets/calendar-arrow-down-CAFi0Chs.js","assets/calendar-arrow-up-Cs2MbLyZ.js","assets/calendar-clock-DTUOomkO.js","assets/calendar-c_JH_1V1.js","assets/camera-V1Ufc9sC.js","assets/chart-no-axes-column-DKbSsm0y.js","assets/check-Cmy7pM2Y.js","assets/chevron-down-DHV04o66.js","assets/chevron-left-DrNh6cTh.js","assets/chevron-right-NbahR9_s.js","assets/chevron-up-C-w52bD6.js","assets/chevrons-left-right-ellipsis-D2Qu5H2y.js","assets/chevrons-up-down-BMPucOK_.js","assets/chromium-BusoCgri.js","assets/circle-alert-B83jEPoh.js","assets/circle-arrow-up-kT0Pa2jA.js","assets/circle-check-Y1T60J9X.js","assets/circle-dashed-ChJzoouS.js","assets/circle-dot-DSAuCGJf.js","assets/circle-slash-Ceo-2WKq.js","assets/circle-x-C-GXnJRB.js","assets/circle-4zZlZno3.js","assets/clock-3-SBiWJYHb.js","assets/clock-bc9N_wA2.js","assets/cloud-download-BE7c7r3I.js","assets/cloud-upload-noux3Cbp.js","assets/cloud-DyVMWy7X.js","assets/code-xml-CbuCFrkh.js","assets/code-DuFehkNQ.js","assets/columns-2-D1kdFD9w.js","assets/copy-CoM62e83.js","assets/corner-left-up-BCqW4dF8.js","assets/corner-up-right--t3OPVhh.js","assets/cpu-mffhvvYB.js","assets/database-DipbOz0U.js","assets/download-BAp4p4A-.js","assets/earth-CTY23Bx1.js","assets/ellipsis-vertical-fYTS1grT.js","assets/ellipsis-6x3R4_IB.js","assets/external-link-NWS0I_zo.js","assets/eye-off-BJFC-Vn7.js","assets/eye-Dh5UEUs_.js","assets/file-braces-CcggTVd0.js","assets/file-code-corner-Dt6PpZnb.js","assets/file-diff-BE4sroJp.js","assets/file-search-DotMSEoS.js","assets/file-spreadsheet-Boc78Vjm.js","assets/file-text-xj3y_Xbg.js","assets/file-1cutE11R.js","assets/files-CQwG7JjF.js","assets/film-CYJIuMHb.js","assets/flask-conical-WkWFg73e.js","assets/folder-closed-zBKiY8_q.js","assets/folder-cog-BMK_9DOi.js","assets/folder-git-2-BxqGR5ht.js","assets/folder-git-CoMYGJp_.js","assets/folder-open-BqgCWh1y.js","assets/folder-plus-BHa3aD6W.js","assets/folder-tree-CIpeR87A.js","assets/folder-CMIvEUJv.js","assets/gauge-C_4eEUrj.js","assets/git-branch-plus-BQ_ISFgF.js","assets/git-branch-CAP5iwh8.js","assets/git-commit-horizontal-6IR7R88i.js","assets/git-fork-BEEZa2l_.js","assets/git-merge-C47N_dux.js","assets/git-pull-request-arrow-C9_ZycDh.js","assets/git-pull-request-closed-BkRFT_Rl.js","assets/git-pull-request-draft-BNpXqUsz.js","assets/globe-BygqUCSx.js","assets/grip-vertical-B8ERFH5y.js","assets/hammer-BRTj-Vot.js","assets/hard-drive-CVWUL95f.js","assets/history-B22_6xEN.js","assets/house-D_gjXlRt.js","assets/image-xUrgiZ2i.js","assets/inbox-48iST-IJ.js","assets/info-BHB-83EA.js","assets/keyboard-9HUE6Zs7.js","assets/laptop-05PEAB3d.js","assets/layers-BqgDAlx3.js","assets/lightbulb-CEqRo_1f.js","assets/link-2-B_p2EG7Q.js","assets/link-zAXVcUwk.js","assets/list-checks-CQu2FTgJ.js","assets/list-filter-BOx8tW9q.js","assets/list-ordered-f2n8ZhGo.js","assets/list-todo-D7F9k-PE.js","assets/list-BAEaXVbr.js","assets/loader-circle-B3Ce8JIQ.js","assets/lock-open-Bt3QlIE2.js","assets/lock-Cc3mNdEd.js","assets/log-in-BpPtfyCd.js","assets/mail-J8kfrAC7.js","assets/maximize-2-CHT2IkVy.js","assets/maximize-CoWtPryT.js","assets/memory-stick-C7kBEkBW.js","assets/message-circle-question-mark-Blboafqi.js","assets/message-circle-CwQpPAbq.js","assets/message-square-dashed-DrEYZ6F3.js","assets/message-square-off-BstjdZP9.js","assets/message-square-text-CJTpB0rs.js","assets/message-square-warning-I95tWaoN.js","assets/message-square-DLzUyuIE.js","assets/messages-square-BNeF2306.js","assets/minimize-2-DOhpJbnX.js","assets/minus-C7W28oE7.js","assets/monitor-Ddj8MK6z.js","assets/moon-B9ss2TfK.js","assets/mouse-pointer-2-DbBU41il.js","assets/mouse-pointer-click-DsDE4K7M.js","assets/octagon-alert-BKVCgU--.js","assets/package-plus-Cl7EzKuY.js","assets/package-CeeyHFJU.js","assets/paintbrush-D1BKpWrm.js","assets/palette-Xj4s0pmv.js","assets/panel-bottom-BzpRd9wr.js","assets/panel-left-DzXd97so.js","assets/panel-right-C3EFo10c.js","assets/paperclip-BCpF_jt0.js","assets/panels-top-left-C5lf6BGD.js","assets/pen-line-BeMREvYs.js","assets/pencil-ruler-CU_Sl28D.js","assets/pencil-CnxrJI7X.js","assets/picture-in-picture-2-g5nsWFVw.js","assets/pilcrow-DMiXqMTk.js","assets/pin-DfMqpQHz.js","assets/play-Bvcnzkvl.js","assets/plug-2-DkrvJqyh.js","assets/plus-Cr075-cy.js","assets/plug-Cdxb0djR.js","assets/power-BZu57mPF.js","assets/presentation-DvMc9hxG.js","assets/puzzle-Bv9mngwk.js","assets/qr-code-D3ZNC-wH.js","assets/quote-zNyOHYG3.js","assets/radio-tower-CT5Np78y.js","assets/redo-2-DRHZshO-.js","assets/refresh-cw-PY_ECjtI.js","assets/rotate-ccw-Dr4MwDMq.js","assets/rotate-cw-10CQA0Ej.js","assets/route-CQ6wZzks.js","assets/rows-3-Bhc8vjss.js","assets/scale-V7dmr96y.js","assets/search-Cr9eaeTj.js","assets/send-CMOvB09P.js","assets/server-Le_hLOlf.js","assets/settings-2-XzWAl_8P.js","assets/settings-CTjEqsg3.js","assets/shield-check-k2SY7zjx.js","assets/shield-question-mark-pgYZYoSI.js","assets/shield-veV1FXDO.js","assets/sliders-horizontal-lg5XUMZM.js","assets/smartphone-zkhAIn1Q.js","assets/smile-plus-20kjE9KX.js","assets/sparkles-cStmYKbH.js","assets/square-arrow-out-up-right-DRKYZdVU.js","assets/square-pen-DIW48FdK.js","assets/square-plus-CeFmBUPF.js","assets/square-split-horizontal-Ba4BZbro.js","assets/square-split-vertical-BqJX4cZa.js","assets/square-terminal-CB0QR1vW.js","assets/square-DVrCvZRU.js","assets/star-DJ6Ycqv6.js","assets/sun-C8irSiA-.js","assets/tag-DhRIoqTo.js","assets/target-DziMQLku.js","assets/terminal-6kKaKv-Q.js","assets/text-align-start-C-EHiBr4.js","assets/text-search-BsqmpFYh.js","assets/text-wrap-C8SwAUbc.js","assets/ticket-LnwYlhC1.js","assets/trash-2-CiyAV2xI.js","assets/trending-down-CZZKiTTZ.js","assets/trending-up-CyMfjRD-.js","assets/triangle-alert-BiHUyRl3.js","assets/type-ChjbxAhu.js","assets/undo-2-ZlIXiNdF.js","assets/unlink-2-DKAoaBiV.js","assets/unplug-Dg15iaHA.js","assets/upload-D9-Kv89Z.js","assets/user-check-BtCtF_-l.js","assets/user-lock-BWt0Um72.js","assets/user-plus-DbG1t95t.js","assets/user-round-x-D7izbSMH.js","assets/user-round-GtkOza8y.js","assets/users-LmqvhHnq.js","assets/wifi-off-DtJhRDhE.js","assets/workflow-Za5zYpKH.js","assets/wrench-CSZxFJCP.js","assets/x-CSwbgjBe.js","assets/zap-CrtYfJ8v.js","assets/useSettings-WGf2H_E7.js","assets/runtime-B3_ce0WW.js","assets/runtime-BtqGaFGQ.js","assets/toast-Dm5S3V1c.js","assets/TooltipViewport-Wc_QpRGI.js","assets/spinner-Bnjv_L8F.js","assets/useParams-DdYFF9g9.js","assets/tooltip-924Ikq0L.js","assets/env-wK1YYxA8.js","assets/environments-DcJA_6Bd.js","assets/server-BP2BG-G5.js","assets/session-B20XW_sH.js","assets/use-atom-command-COr3-BfL.js","assets/themePalette-CdoksNDx.js","assets/diffRendering-DPsheMQA.js","assets/index-1TY23MT4.js","assets/Virtualizer-D4YaDR_b.js","assets/getDiffFileInput-BEkxNzZ-.js","assets/main-BxSUUHl7.js","assets/vcsRefInvalidation-CUgwItfg.js","assets/entities-DSlJSLqU.js","assets/query-CpOQgkic.js","assets/number-field-N4gbrhyd.js","assets/useRegisterFieldControl-Bmw-33lq.js","assets/FormContext-DTtr4Y3v.js","assets/CSPContext-D8hlJ4eS.js","assets/select-BQxcmO_1.js","assets/SelectScrollUpArrow-CAd5YEsi.js","assets/link-DQB3a7WC.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-ZmKiS4iU.js","assets/useNavigate-Dvl9uiuL.js","assets/useLocation-UcmQE5FC.js","assets/rightPanelStore-37-59X44.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-G1w-VoW0.js","assets/session-logic-BtEgohgO.js","assets/htmlRender-Egw4Y-80.js","assets/mediaSource-CakREDG9.js","assets/fileLinks-D1jJMhdN.js","assets/mediaReference-Co0MbQU1.js","assets/usageFormat-B-HlJYM5.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton-oZHFXSZp.js","assets/useAriaLabelledBy-DZIzyiAY.js","assets/toggle-DLuCM2ny.js","assets/toggle-group-RZD18_sD.js","assets/CompositeRoot-B9Xvst63.js","assets/command-BB0IyhBc.js","assets/ComboboxClear-Di7TLMMS.js","assets/input-DhWmPSxf.js","assets/Input-DoZ73vNO.js","assets/FieldControl-CIaYJhnp.js","assets/scroll-area-BDT5qfX2.js","assets/ScrollAreaCorner-SeZ1sx-t.js","assets/DialogTitle-BzKEBo4W.js","assets/dialog-x5a5g_fa.js","assets/dist-Byy10brL.js","assets/sidebar-D5nBG54l.js","assets/useResizeDrag-KJl_F2EN.js","assets/CollapsiblePanel-kfl4yLKn.js","assets/observeResize-Cpph8C0G.js","assets/AnimatedHeight-D-OJUoBJ.js","assets/assets-BwCKLAtY.js","assets/sourceControl-oqWEMILZ.js","assets/openFileInPreview-DH1_MQQg.js","assets/browserHistoryStore-C4q3a0XH.js","assets/preview-IWIgXHdy.js","assets/keybindings-B3kvDAJC.js","assets/Icons-BFyKltvl.js","assets/preview-CzRHMudX.js","assets/PierreEntryIcon-CBahrBiu.js","assets/pierre-icons-BF6Bv7EQ.js","assets/RenderErrorBoundary-C3EBbed9.js","assets/threadSort-Broxuoqw.js","assets/browserLinkTarget-BrW2R2w9.js","assets/pullRequestIcons-BaQbmCBu.js","assets/pullRequests-D40-ZAXm.js","assets/popover-BDFZje9T.js","assets/PopoverHandle-D2swQJBt.js","assets/ProjectFavicon-Bkz2srRd.js","assets/ProjectMonogram-BMGWdmjv.js","assets/projectFilesQueryState-DA41YjI0.js","assets/checkbox-DU_a7ZnJ.js","assets/CheckboxIndicator-BzFOZwIv.js","assets/FieldItemContext-Bn6xBVJg.js","assets/terminalSessions-B774652v.js","assets/AlertDialogRoot-Bb5-VhZe.js","assets/guideRunStore-DjlqVSzn.js","assets/pullRequestDetail.logic-DZT0G8Eq.js","assets/pullRequestReviewStore-wpVYihKr.js","assets/sortable.esm-cggA232Z.js","assets/p4ProjectFile-Czc_hMvK.js","assets/sidebarProjectGrouping-DJA_Uu9w.js","assets/useHandleNewThread-BWKsU_Gt.js","assets/EnvironmentMachineIcon-COX4G5YJ.js","assets/alert-B2wk0CaO.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-CVZHYvIk.js","assets/kbd-I5TavBvc.js","assets/settingsLayout-C0HMxLxU.js","assets/WorkspacePageContainer-COKQZB3N.js","assets/KeybindingsSettings.logic-_oQM9Dzv.js","assets/usageShortcuts-CUsmDt-0.js","assets/primaryCloudLinkState-BLsual21.js","assets/ConnectionStatusDot-DtKQQSMi.js","assets/standalone-page-Davc_MrS.js","assets/primary-BeYRWn1V.js","assets/onboarding-qFB0UvmL.js","assets/scheduledTasksSettings.logic-C0Ez1DaI.js","assets/main-r-P9O3jD.css","assets/DiffWorkerPoolProvider-B5VjaCIu.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReadOnlySourcePreview-BNe8pyVf.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-CRwA5SKO.js","assets/activity-C1Y3O_v1.js","assets/createLucideIcon-CacG5mZC.js","assets/alarm-clock-Pw90g7hE.js","assets/app-window-D2LBv8RE.js","assets/archive-0Qz6rgBl.js","assets/arrow-down-up-B46gw0xW.js","assets/arrow-down-DvRecXuy.js","assets/arrow-left-BLE461db.js","assets/arrow-right-left-BqjFeAD_.js","assets/arrow-right-CoV5ameY.js","assets/arrow-up-down-ibtVnemT.js","assets/arrow-up-left-BMvgV_8i.js","assets/arrow-up-right-C6IM-WPd.js","assets/arrow-up-3Yp3lsoe.js","assets/battery-Bjbw2yxu.js","assets/bell-CLuvLMth.js","assets/blocks-B-VfW07Q.js","assets/book-open-HEEW8eqT.js","assets/bookmark-HM-xwl47.js","assets/bot-DpQzHyXo.js","assets/box-CKWcQvdq.js","assets/bug-Dtc5BRVF.js","assets/calendar-arrow-down-CAFi0Chs.js","assets/calendar-arrow-up-Cs2MbLyZ.js","assets/calendar-clock-DTUOomkO.js","assets/calendar-c_JH_1V1.js","assets/camera-V1Ufc9sC.js","assets/chart-no-axes-column-DKbSsm0y.js","assets/check-Cmy7pM2Y.js","assets/chevron-down-DHV04o66.js","assets/chevron-left-DrNh6cTh.js","assets/chevron-right-NbahR9_s.js","assets/chevron-up-C-w52bD6.js","assets/chevrons-left-right-ellipsis-D2Qu5H2y.js","assets/chevrons-up-down-BMPucOK_.js","assets/chromium-BusoCgri.js","assets/circle-alert-B83jEPoh.js","assets/circle-arrow-up-kT0Pa2jA.js","assets/circle-check-Y1T60J9X.js","assets/circle-dashed-ChJzoouS.js","assets/circle-dot-DSAuCGJf.js","assets/circle-slash-Ceo-2WKq.js","assets/circle-x-C-GXnJRB.js","assets/circle-4zZlZno3.js","assets/clock-3-SBiWJYHb.js","assets/clock-bc9N_wA2.js","assets/cloud-download-BE7c7r3I.js","assets/cloud-upload-noux3Cbp.js","assets/cloud-DyVMWy7X.js","assets/code-xml-CbuCFrkh.js","assets/code-DuFehkNQ.js","assets/columns-2-D1kdFD9w.js","assets/copy-CoM62e83.js","assets/corner-left-up-BCqW4dF8.js","assets/corner-up-right--t3OPVhh.js","assets/cpu-mffhvvYB.js","assets/database-DipbOz0U.js","assets/download-BAp4p4A-.js","assets/earth-CTY23Bx1.js","assets/ellipsis-vertical-fYTS1grT.js","assets/ellipsis-6x3R4_IB.js","assets/external-link-NWS0I_zo.js","assets/eye-off-BJFC-Vn7.js","assets/eye-Dh5UEUs_.js","assets/file-braces-CcggTVd0.js","assets/file-code-corner-Dt6PpZnb.js","assets/file-diff-BE4sroJp.js","assets/file-search-DotMSEoS.js","assets/file-spreadsheet-Boc78Vjm.js","assets/file-text-xj3y_Xbg.js","assets/file-1cutE11R.js","assets/files-CQwG7JjF.js","assets/film-CYJIuMHb.js","assets/flask-conical-WkWFg73e.js","assets/folder-closed-zBKiY8_q.js","assets/folder-cog-BMK_9DOi.js","assets/folder-git-2-BxqGR5ht.js","assets/folder-git-CoMYGJp_.js","assets/folder-open-BqgCWh1y.js","assets/folder-plus-BHa3aD6W.js","assets/folder-tree-CIpeR87A.js","assets/folder-CMIvEUJv.js","assets/gauge-C_4eEUrj.js","assets/git-branch-plus-BQ_ISFgF.js","assets/git-branch-CAP5iwh8.js","assets/git-commit-horizontal-6IR7R88i.js","assets/git-fork-BEEZa2l_.js","assets/git-merge-C47N_dux.js","assets/git-pull-request-arrow-C9_ZycDh.js","assets/git-pull-request-closed-BkRFT_Rl.js","assets/git-pull-request-draft-BNpXqUsz.js","assets/globe-BygqUCSx.js","assets/grip-vertical-B8ERFH5y.js","assets/hammer-BRTj-Vot.js","assets/hard-drive-CVWUL95f.js","assets/history-B22_6xEN.js","assets/house-D_gjXlRt.js","assets/image-xUrgiZ2i.js","assets/inbox-48iST-IJ.js","assets/info-BHB-83EA.js","assets/keyboard-9HUE6Zs7.js","assets/laptop-05PEAB3d.js","assets/layers-BqgDAlx3.js","assets/lightbulb-CEqRo_1f.js","assets/link-2-B_p2EG7Q.js","assets/link-zAXVcUwk.js","assets/list-checks-CQu2FTgJ.js","assets/list-filter-BOx8tW9q.js","assets/list-ordered-f2n8ZhGo.js","assets/list-todo-D7F9k-PE.js","assets/list-BAEaXVbr.js","assets/loader-circle-B3Ce8JIQ.js","assets/lock-open-Bt3QlIE2.js","assets/lock-Cc3mNdEd.js","assets/log-in-BpPtfyCd.js","assets/mail-J8kfrAC7.js","assets/maximize-2-CHT2IkVy.js","assets/maximize-CoWtPryT.js","assets/memory-stick-C7kBEkBW.js","assets/message-circle-question-mark-Blboafqi.js","assets/message-circle-CwQpPAbq.js","assets/message-square-dashed-DrEYZ6F3.js","assets/message-square-off-BstjdZP9.js","assets/message-square-text-CJTpB0rs.js","assets/message-square-warning-I95tWaoN.js","assets/message-square-DLzUyuIE.js","assets/messages-square-BNeF2306.js","assets/minimize-2-DOhpJbnX.js","assets/minus-C7W28oE7.js","assets/monitor-Ddj8MK6z.js","assets/moon-B9ss2TfK.js","assets/mouse-pointer-2-DbBU41il.js","assets/mouse-pointer-click-DsDE4K7M.js","assets/octagon-alert-BKVCgU--.js","assets/package-plus-Cl7EzKuY.js","assets/package-CeeyHFJU.js","assets/paintbrush-D1BKpWrm.js","assets/palette-Xj4s0pmv.js","assets/panel-bottom-BzpRd9wr.js","assets/panel-left-DzXd97so.js","assets/panel-right-C3EFo10c.js","assets/paperclip-BCpF_jt0.js","assets/panels-top-left-C5lf6BGD.js","assets/pen-line-BeMREvYs.js","assets/pencil-ruler-CU_Sl28D.js","assets/pencil-CnxrJI7X.js","assets/picture-in-picture-2-g5nsWFVw.js","assets/pilcrow-DMiXqMTk.js","assets/pin-DfMqpQHz.js","assets/play-Bvcnzkvl.js","assets/plug-2-DkrvJqyh.js","assets/plus-Cr075-cy.js","assets/plug-Cdxb0djR.js","assets/power-BZu57mPF.js","assets/presentation-DvMc9hxG.js","assets/puzzle-Bv9mngwk.js","assets/qr-code-D3ZNC-wH.js","assets/quote-zNyOHYG3.js","assets/radio-tower-CT5Np78y.js","assets/redo-2-DRHZshO-.js","assets/refresh-cw-PY_ECjtI.js","assets/rotate-ccw-Dr4MwDMq.js","assets/rotate-cw-10CQA0Ej.js","assets/route-CQ6wZzks.js","assets/rows-3-Bhc8vjss.js","assets/scale-V7dmr96y.js","assets/search-Cr9eaeTj.js","assets/send-CMOvB09P.js","assets/server-Le_hLOlf.js","assets/settings-2-XzWAl_8P.js","assets/settings-CTjEqsg3.js","assets/shield-check-k2SY7zjx.js","assets/shield-question-mark-pgYZYoSI.js","assets/shield-veV1FXDO.js","assets/sliders-horizontal-lg5XUMZM.js","assets/smartphone-zkhAIn1Q.js","assets/smile-plus-20kjE9KX.js","assets/sparkles-cStmYKbH.js","assets/square-arrow-out-up-right-DRKYZdVU.js","assets/square-pen-DIW48FdK.js","assets/square-plus-CeFmBUPF.js","assets/square-split-horizontal-Ba4BZbro.js","assets/square-split-vertical-BqJX4cZa.js","assets/square-terminal-CB0QR1vW.js","assets/square-DVrCvZRU.js","assets/star-DJ6Ycqv6.js","assets/sun-C8irSiA-.js","assets/tag-DhRIoqTo.js","assets/target-DziMQLku.js","assets/terminal-6kKaKv-Q.js","assets/text-align-start-C-EHiBr4.js","assets/text-search-BsqmpFYh.js","assets/text-wrap-C8SwAUbc.js","assets/ticket-LnwYlhC1.js","assets/trash-2-CiyAV2xI.js","assets/trending-down-CZZKiTTZ.js","assets/trending-up-CyMfjRD-.js","assets/triangle-alert-BiHUyRl3.js","assets/type-ChjbxAhu.js","assets/undo-2-ZlIXiNdF.js","assets/unlink-2-DKAoaBiV.js","assets/unplug-Dg15iaHA.js","assets/upload-D9-Kv89Z.js","assets/user-check-BtCtF_-l.js","assets/user-lock-BWt0Um72.js","assets/user-plus-DbG1t95t.js","assets/user-round-x-D7izbSMH.js","assets/user-round-GtkOza8y.js","assets/users-LmqvhHnq.js","assets/wifi-off-DtJhRDhE.js","assets/workflow-Za5zYpKH.js","assets/wrench-CSZxFJCP.js","assets/x-CSwbgjBe.js","assets/zap-CrtYfJ8v.js","assets/useSettings-DCI8Hv09.js","assets/runtime-DZfpb67Q.js","assets/runtime-Bc4kgQim.js","assets/toast-DYfY2t_z.js","assets/TooltipViewport-Wc_QpRGI.js","assets/spinner-Bnjv_L8F.js","assets/useParams-DdYFF9g9.js","assets/tooltip-924Ikq0L.js","assets/env-wK1YYxA8.js","assets/environments-Dm2_6Uan.js","assets/server-LJ0-FVGH.js","assets/session-Bc1P10r_.js","assets/use-atom-command-Dz_yqN35.js","assets/themePalette-CdoksNDx.js","assets/diffRendering-DeZLcalP.js","assets/index-Dc7GC03y.js","assets/Virtualizer-Bi8p4Z6E.js","assets/getDiffFileInput-CCYVAWRm.js","assets/main-CxOeqlhD.js","assets/vcsRefInvalidation-3pHpDJC2.js","assets/entities-DPIZFvN7.js","assets/query-CpOQgkic.js","assets/number-field-N4gbrhyd.js","assets/useRegisterFieldControl-Bmw-33lq.js","assets/FormContext-DTtr4Y3v.js","assets/CSPContext-D8hlJ4eS.js","assets/select-BQxcmO_1.js","assets/SelectScrollUpArrow-CAd5YEsi.js","assets/link-DQB3a7WC.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-ZmKiS4iU.js","assets/useNavigate-Dvl9uiuL.js","assets/useLocation-UcmQE5FC.js","assets/rightPanelStore-37-59X44.js","assets/toastHelpers-Dsph6LwL.js","assets/queries-BVPZtaQA.js","assets/session-logic-BNtU33qU.js","assets/htmlRender-Egw4Y-80.js","assets/mediaSource-DWSwwPfV.js","assets/fileLinks-1xYacDKI.js","assets/mediaReference-DRC-8GdL.js","assets/usageFormat-B-HlJYM5.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton-oZHFXSZp.js","assets/useAriaLabelledBy-DZIzyiAY.js","assets/toggle-DLuCM2ny.js","assets/toggle-group-RZD18_sD.js","assets/CompositeRoot-B9Xvst63.js","assets/command-BB0IyhBc.js","assets/ComboboxClear-Di7TLMMS.js","assets/input-DhWmPSxf.js","assets/Input-DoZ73vNO.js","assets/FieldControl-CIaYJhnp.js","assets/scroll-area-BDT5qfX2.js","assets/ScrollAreaCorner-SeZ1sx-t.js","assets/DialogTitle-BzKEBo4W.js","assets/dialog-x5a5g_fa.js","assets/dist-Bd1WIVAz.js","assets/sidebar-D5nBG54l.js","assets/useResizeDrag-KJl_F2EN.js","assets/CollapsiblePanel-kfl4yLKn.js","assets/observeResize-Cpph8C0G.js","assets/AnimatedHeight-D-OJUoBJ.js","assets/assets-BhchpDuq.js","assets/sourceControl-DE9QO1yg.js","assets/openFileInPreview-uS9Qgrru.js","assets/browserHistoryStore-CqGVWa5a.js","assets/preview-IWIgXHdy.js","assets/keybindings-B3kvDAJC.js","assets/Icons-BFyKltvl.js","assets/preview-C4lGbDhm.js","assets/PierreEntryIcon-DtlkLdir.js","assets/pierre-icons-Dav7jMBk.js","assets/RenderErrorBoundary-DEgVmtJL.js","assets/threadSort-DD61dseb.js","assets/browserLinkTarget-CINrbcxi.js","assets/pullRequestIcons-BaQbmCBu.js","assets/pullRequests-BbD7hNlR.js","assets/popover-Bc0WvoPP.js","assets/PopoverHandle-D2swQJBt.js","assets/ProjectFavicon-YdOZ4g5-.js","assets/ProjectMonogram-BMGWdmjv.js","assets/projectFilesQueryState-U08pztRu.js","assets/checkbox-DU_a7ZnJ.js","assets/CheckboxIndicator-BzFOZwIv.js","assets/FieldItemContext-Bn6xBVJg.js","assets/terminalSessions-Cj-MqjH8.js","assets/AlertDialogRoot-Bb5-VhZe.js","assets/guideRunStore-BhlldU3q.js","assets/pullRequestDetail.logic-DGX-Sd8d.js","assets/pullRequestReviewStore-wpVYihKr.js","assets/sortable.esm-Boen_E7K.js","assets/p4ProjectFile-CIYnqKbl.js","assets/sidebarProjectGrouping-DXnDcqLY.js","assets/useHandleNewThread-DjevdE0U.js","assets/EnvironmentMachineIcon-COX4G5YJ.js","assets/alert-B2wk0CaO.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-fMcoYEDa.js","assets/kbd-I5TavBvc.js","assets/settingsLayout-Cbpy7Mfz.js","assets/WorkspacePageContainer-COKQZB3N.js","assets/KeybindingsSettings.logic-_oQM9Dzv.js","assets/usageShortcuts-CUsmDt-0.js","assets/primaryCloudLinkState-B_VNTJYL.js","assets/ConnectionStatusDot-DtKQQSMi.js","assets/standalone-page-Davc_MrS.js","assets/primary-CRkgnOCY.js","assets/onboarding-CLIRA2Sa.js","assets/scheduledTasksSettings.logic-CvvQA-b7.js","assets/main-Ch-SjebX.css","assets/DiffWorkerPoolProvider-Cw5WeG1t.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-Dc7GC03y.js";import{r as n}from"./Icon-l19w4AjM.js";import{$ as r,Au as i,Bm as a,Ci as o,Cm as s,Ct as c,Dc as l,J as u,ME as d,Oc as f,Q as p,Qf as m,Rg as h,Sc as g,Um as _,Vg as v,Wd as y,X as b,Y as x,Yo as S,_m as C,_t as w,ap as T,bt as E,cE as ee,gd as te,hd as ne,it as D,jc as re,jt as O,ju as ie,ku as ae,lc as oe,mt as se,ot as ce,pp as le,rt as ue,sr as de,st as fe,t as pe,va as me,vc as he,vd as ge,vt as _e,wi as ve,wt as k,y as ye,yc as be,yt as xe}from"./utils-CRwA5SKO.js";import{O as Se}from"./entities-DPIZFvN7.js";import{l as Ce,o as we,s as Te}from"./runtime-Bc4kgQim.js";import{A as Ee,C as De,D as Oe,E as ke,M as Ae,N as A,O as je,P as Me,S as Ne,T as Pe,b as Fe,j as Ie,k as Le,l as Re,n as ze,r as Be,s as Ve}from"./ChatMarkdown-B7b91JUl.js";import{t as He}from"./spinner-Bnjv_L8F.js";import{t as Ue}from"./link-DQB3a7WC.js";import{i as We,p as Ge}from"./toast-DYfY2t_z.js";import{a as Ke,c as qe,l as Je,n as Ye,t as Xe,v as Ze,x as Qe,y as $e,z as et}from"./tooltip-924Ikq0L.js";import{f as tt,s as nt}from"./server-LJ0-FVGH.js";import{I as rt,R as it,s as at,v as ot}from"./useSettings-DCI8Hv09.js";import{F as st,H as ct,_ as lt,m as ut,v as dt,z as ft}from"./themePalette-CdoksNDx.js";import{l as pt,t as mt}from"./diffRendering-DeZLcalP.js";import{c as ht,d as gt,f as _t,l as vt,o as yt,p as bt,s as xt,t as St,u as Ct}from"./htmlRender-Egw4Y-80.js";import{n as wt,o as Tt}from"./pierre-icons-Dav7jMBk.js";import{t as Et}from"./toggle-DLuCM2ny.js";import{i as Dt,l as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./combobox-CZradSHe.js";import{t as Pt}from"./scroll-area-BDT5qfX2.js";import{o as Ft}from"./openFileInPreview-uS9Qgrru.js";import{v as It}from"./keybindings-B3kvDAJC.js";import{o as Lt,t as Rt}from"./PierreEntryIcon-DtlkLdir.js";import{A as zt,H as Bt,k as Vt,z as Ht}from"./RenderErrorBoundary-DEgVmtJL.js";import{n as Ut}from"./pullRequestIcons-BaQbmCBu.js";import{At as Wt,Ft as Gt,Ht as Kt,Lt as qt,Sa as Jt,Ut as Yt,Vt as Xt,jt as Zt,za as Qt,zt as $t}from"./main-CxOeqlhD.js";var j=e(n(),1),M=d(),N=e(ee(),1),en=e(me(),1),tn=ve(),nn=o();function rn(e){let t=e.mimeType?.split(`;`,1)[0]?.trim().toLowerCase();return t===`text/csv`?`,`:t===`text/tab-separated-values`?` `:t&&t!==`text/plain`&&t!==`application/octet-stream`?null:/\.csv$/i.test(e.name)?`,`:/\.tsv$/i.test(e.name)?` `:null}function an(e,t){let n=[],r=[],i=``,a=!1,o=!1,s=+(e.charCodeAt(0)===65279),c=()=>{r.length<30?r.push(i):o=!0,i=``};for(let l=s;l<e.length;l++){let u=e[l];if(u===`"`){if(a&&e[l+1]===`"`){i.length<2e3?i+=`"`:o=!0,l++;continue}if(a||i===``){a=!a;continue}}if(!a&&(u===t||u===`
|
|
3
3
|
`||u===`\r`)){if(c(),u!==t&&(n.push(r),r=[],u===`\r`&&e[l+1]===`
|
|
4
4
|
`&&l++,s=l+1,n.length===100))return{rows:n,truncated:o||l<e.length-1}}else i.length<2e3?i+=u:o=!0}return s<e.length&&(c(),n.push(r)),{rows:n,truncated:o||a}}async function on(e,t){if(!e.ok)throw e.body?.cancel().catch(()=>void 0),Error(`The file could not be loaded. Reconnect and try again.`);if(t.aborted)throw Error(`Preview cancelled.`);let n=we+1,r=e.body?.getReader();if(!r)throw Error(`Streaming file previews are unavailable in this runtime.`);let i=()=>{r.cancel().catch(()=>void 0)};t.addEventListener(`abort`,i,{once:!0});let a=[],o=0;try{for(;o<n;){if(t.aborted)throw Error(`Preview cancelled.`);let e=await r.read();if(e.done)break;let i=e.value.subarray(0,n-o);a.push(i),o+=i.length}}finally{t.removeEventListener(`abort`,i),await r.cancel()}if(t.aborted)throw Error(`Preview cancelled.`);let s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.length;return Te(s)}function sn(e){let t=(0,M.c)(4),n;return t[0]!==e.name||t[1]!==e.onError||t[2]!==e.src?(n=(0,N.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6`,children:(0,N.jsx)(`audio`,{controls:!0,preload:`metadata`,src:e.src,"aria-label":e.name,className:`w-full max-w-xl`,onError:e.onError})}),t[0]=e.name,t[1]=e.onError,t[2]=e.src,t[3]=n):n=t[3],n}function cn(e,t,n){let r=dt(st(e,t,n));return r===null?ut(n):lt(r,n)??r.colors}function ln(){let e=(0,M.c)(11),{theme:t,resolvedTheme:n,themeHalves:r}=rt(),i;e[0]!==n||e[1]!==t||e[2]!==r?(i=()=>cn(t,r,n),e[0]=n,e[1]=t,e[2]=r,e[3]=i):i=e[3];let a;e[4]===n?a=e[5]:(a=()=>ut(n),e[4]=n,e[5]=a);let o=(0,j.useSyncExternalStore)(ft,i,a),s=at(fn),c=at(dn),l;return e[6]!==o||e[7]!==c||e[8]!==n||e[9]!==s?(l=ht(Object.fromEntries(Object.entries(o).map(un)),n,{sans:Jt(s,St.sans),mono:Jt(c,St.mono)}),e[6]=o,e[7]=c,e[8]=n,e[9]=s,e[10]=l):l=e[10],l}function un(e){let[t,n]=e;return[t,ct(n)??n]}function dn(e){return e.fontFamilyCode}function fn(e){return e.fontFamilySans}var pn=`#toolbar=0&view=FitH`,mn=new Set([`commandPalette.toggle`,`filePicker.toggle`,`projectSearch.toggle`,`chat.find`,`sidebar.toggle`,`rightPanel.toggle`,`rightPanel.toggleMaximized`,`threadPanel.toggle`,`terminal.toggle`,`preview.toggle`,`navigation.back`,`navigation.forward`,`thread.previous`,`thread.next`,...v,...h]),hn=e=>/\.pdf$/i.test(e.split(/[?#]/,1)[0]??``);function gn(e){let t=(0,M.c)(6),n;return t[0]!==e.htmlRender||t[1]!==e.pdf||t[2]!==e.src||t[3]!==e.threadRef||t[4]!==e.title?(n=e.pdf?(0,N.jsx)(`iframe`,{src:`${e.src}${pn}`,title:e.title,className:`min-h-0 flex-1 border-0 bg-white`},e.src):e.htmlRender?(0,N.jsx)(_n,{src:e.src,title:e.title,threadRef:e.threadRef,className:`min-h-0 flex-1`},e.src):(0,N.jsx)(`iframe`,{src:e.src,title:e.title,className:`min-h-0 flex-1 border-0 bg-white`,sandbox:`allow-scripts allow-forms allow-popups allow-downloads`},e.src),t[0]=e.htmlRender,t[1]=e.pdf,t[2]=e.src,t[3]=e.threadRef,t[4]=e.title,t[5]=n):n=t[5],n}function _n(e){let t=(0,M.c)(46),n=ln(),r=(0,j.useRef)(null),i;t[0]!==e.src||t[1]!==n?(i=()=>`${e.src.split(`#`,1)[0]}${vt(n)}`,t[0]=e.src,t[1]=n,t[2]=i):i=t[2];let[a]=(0,j.useState)(i),[o,s]=(0,j.useState)(!1),c;t[3]===n?c=t[4]:(c=()=>{r.current?.contentWindow?.postMessage(Ct(n),`*`)},t[3]=n,t[4]=c);let u=c,d;t[5]===n?d=t[6]:(d=[n],t[5]=n,t[6]=d),(0,j.useEffect)(u,d);let p=S(nt),m=S(tt.configValueAtom(e.threadRef?.environmentId??null))?.keybindings,h;if(t[7]!==m||t[8]!==p){let e=l(navigator.platform),n=t=>({key:t.key,metaKey:t.metaKey||t.modKey&&e,ctrlKey:t.ctrlKey||t.modKey&&!e,shiftKey:t.shiftKey,altKey:t.altKey}),r=[...p,...m??[]].filter(Sn).map(e=>n(e.shortcut)),i=new Map;for(let{command:e,shortcut:t}of p)mn.has(e)&&(t.metaKey||t.ctrlKey||t.modKey)&&i.set(It(t),n(t));h={shortcuts:[...i.values()],blocked:r},t[7]=m,t[8]=p,t[9]=h}else h=t[9];let{shortcuts:g,blocked:_}=h,v;t[10]!==_||t[11]!==g?(v=()=>{r.current?.contentWindow?.postMessage(xt(g,_),`*`)},t[10]=_,t[11]=g,t[12]=v):v=t[12];let y=v,b;t[13]!==_||t[14]!==g?(b=[_,g],t[13]=_,t[14]=g,t[15]=b):b=t[15],(0,j.useEffect)(y,b);let x;t[16]!==_||t[17]!==g?(x=e=>{let t=t=>f(e,{...t,modKey:!1},navigator.platform),n=g.filter(t);return n.length>0&&!_.some(t)&&(e.key.length===1||e.key===`Dead`||n.some(t=>t.key===re(e.key)))},t[16]=_,t[17]=g,t[18]=x):x=t[18];let C=(0,j.useEffectEvent)(x),w=Ht(e.threadRef),T=Bt(e.threadRef),E;t[19]!==w||t[20]!==T||t[21]!==e.threadRef?(E=(t,n)=>{if(n.metaKey||n.ctrlKey){it()?.shell.openExternal(t).catch(xn);return}e.threadRef!==void 0&&w({...n,preventDefault:bn,stopPropagation:yn},t,void 0,e.threadRef.environmentId)||T(t,{event:n}).catch(vn)},t[19]=w,t[20]=T,t[21]=e.threadRef,t[22]=E):E=t[22];let ee=(0,j.useEffectEvent)(E),te;t[23]===ee?te=t[24]:(te=()=>{let e=e=>{let t=r.current,n=bt(e.data);n!==void 0&&t!==null&&e.source===t.contentWindow&&document.activeElement===t&&navigator.userActivation?.isActive!==!1&&(ee(n.url,n),t.contentWindow?.postMessage(yt(n.id),`*`))};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},t[23]=ee,t[24]=te);let ne;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(ne=[],t[25]=ne):ne=t[25],(0,j.useEffect)(te,ne);let D;t[26]===C?D=t[27]:(D=()=>{let e=e=>{let t=r.current,n=_t(e.data);n!==void 0&&t!==null&&e.source===t.contentWindow&&document.activeElement===t&&navigator.userActivation?.isActive!==!1&&C(n)&&t.dispatchEvent(new KeyboardEvent(`keydown`,{...n,bubbles:!0,cancelable:!0}))};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},t[26]=C,t[27]=D);let O;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[28]=O):O=t[28],(0,j.useEffect)(D,O);let{onContentHeight:ie}=e,ae,oe;t[29]===ie?(ae=t[30],oe=t[31]):(ae=()=>{if(ie===void 0)return;let e=e=>{let t=gt(e.data);t!==void 0&&e.source===r.current?.contentWindow&&ie(t)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},oe=[ie],t[29]=ie,t[30]=ae,t[31]=oe),(0,j.useLayoutEffect)(ae,oe);let se=e.title,ce;t[32]!==y||t[33]!==u?(ce=()=>{s(!0),u(),y()},t[32]=y,t[33]=u,t[34]=ce):ce=t[34];let le;t[35]===e.className?le=t[36]:(le=pe(`border-0 scheme-light`,e.className),t[35]=e.className,t[36]=le);let ue;t[37]!==o||t[38]!==n?(ue=o?{colorScheme:n.appearance}:void 0,t[37]=o,t[38]=n,t[39]=ue):ue=t[39];let de;return t[40]!==e.title||t[41]!==a||t[42]!==ce||t[43]!==le||t[44]!==ue?(de=(0,N.jsx)(`iframe`,{ref:r,src:a,title:se,sandbox:`allow-scripts allow-forms`,loading:`lazy`,onLoad:ce,className:le,style:ue}),t[40]=e.title,t[41]=a,t[42]=ce,t[43]=le,t[44]=ue,t[45]=de):de=t[45],de}function vn(e){return console.error(e)}function yn(){}function bn(){}function xn(e){return console.error(e)}function Sn(e){return!mn.has(e.command)}var Cn=`flex h-10 min-h-10 shrink-0 items-center gap-2 border-b border-border/60 bg-background px-3 in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,wn=`data-file-link-reveal`,Tn=`
|
|
5
5
|
${mt}
|
|
@@ -45,7 +45,7 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-1TY23MT
|
|
|
45
45
|
) !important;
|
|
46
46
|
color: var(--diffs-selection-number-fg) !important;
|
|
47
47
|
}
|
|
48
|
-
`;function En(e){let t=(0,M.c)(11),n=e.pressed,r;t[0]!==n||t[1]!==e.children||t[2]!==e.disabled||t[3]!==e.label||t[4]!==e.onPress?(r=(0,N.jsx)(Ke,{render:n===void 0?(0,N.jsx)(de,{type:`button`,className:`shrink-0`,disabled:e.disabled??!1,onClick:e.onPress,"aria-label":e.label,variant:`ghost`,size:`icon-sm`,children:e.children}):(0,N.jsx)(Et,{className:`shrink-0`,pressed:n,disabled:e.disabled??!1,onPressedChange:e.onPress,"aria-label":e.label,variant:`ghost`,size:`sm`,children:e.children})}),t[0]=n,t[1]=e.children,t[2]=e.disabled,t[3]=e.label,t[4]=e.onPress,t[5]=r):r=t[5];let i;t[6]===e.label?i=t[7]:(i=(0,N.jsx)(Ye,{children:e.label}),t[6]=e.label,t[7]=i);let a;return t[8]!==r||t[9]!==i?(a=(0,N.jsxs)(Xe,{children:[r,i]}),t[8]=r,t[9]=i,t[10]=a):a=t[10],a}function Dn(e){let t=(0,M.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,N.jsx)(`div`,{role:`status`,className:`shrink-0 border-b border-warning/20 bg-warning-surface px-3 py-1.5 text-2xs text-warning-foreground`,children:e.children}),t[0]=e.children,t[1]=n),n}function On(e){let t=(0,M.c)(5),n;t[0]===e.className?n=t[1]:(n=pe(`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,e.className),t[0]=e.className,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,N.jsx)(He,{size:`lg`}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,N.jsx)(`div`,{role:`status`,"aria-label":`Loading file`,className:n,children:r}),t[3]=n,t[4]=i),i}function kn(e){let t=(0,M.c)(7),n;t[0]===e.message?n=t[1]:(n=(0,N.jsx)(`p`,{className:`text-destructive`,children:e.message}),t[0]=e.message,t[1]=n);let r;t[2]===e.onRetry?r=t[3]:(r=e.onRetry?(0,N.jsx)(`button`,{type:`button`,onClick:e.onRetry,className:`rounded-md border border-input px-2.5 py-1 text-xs text-foreground hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:`Try again`}):null,t[2]=e.onRetry,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,N.jsxs)(`div`,{role:`alert`,className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center text-xs leading-relaxed`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function An(e){let t=(0,M.c)(29),n;t[0]!==e.delimiter||t[1]!==e.text?(n=an(e.text,e.delimiter),t[0]=e.delimiter,t[1]=e.text,t[2]=n):n=t[2];let r=n,i,a,o,s,c,l,u;if(t[3]!==e.name||t[4]!==r.rows||t[5]!==r.truncated){let[n,...d]=r.rows;c=`flex min-h-0 flex-1 flex-col`,t[13]===r.truncated?l=t[14]:(l=r.truncated?(0,N.jsx)(Dn,{children:`Table limited to the first 100 rows and 30 columns. Switch to source for the rest.`}):null,t[13]=r.truncated,t[14]=l),s=`min-h-0 flex-1 overflow-auto`,i=`min-w-full border-separate border-spacing-0 text-xs`,a=e.name,t[15]===n?o=t[16]:(o=n?(0,N.jsx)(`thead`,{className:`sticky top-0 z-10`,children:(0,N.jsx)(`tr`,{children:n.map(Nn)})}):null,t[15]=n,t[16]=o),u=(0,N.jsx)(`tbody`,{children:d.map(jn)}),t[3]=e.name,t[4]=r.rows,t[5]=r.truncated,t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=u}else i=t[6],a=t[7],o=t[8],s=t[9],c=t[10],l=t[11],u=t[12];let d;t[17]!==i||t[18]!==a||t[19]!==o||t[20]!==u?(d=(0,N.jsxs)(`table`,{className:i,"aria-label":a,children:[o,u]}),t[17]=i,t[18]=a,t[19]=o,t[20]=u,t[21]=d):d=t[21];let f;t[22]!==s||t[23]!==d?(f=(0,N.jsx)(`div`,{className:s,children:d}),t[22]=s,t[23]=d,t[24]=f):f=t[24];let p;return t[25]!==c||t[26]!==l||t[27]!==f?(p=(0,N.jsxs)(`div`,{className:c,children:[l,f]}),t[25]=c,t[26]=l,t[27]=f,t[28]=p):p=t[28],p}function jn(e,t){return(0,N.jsx)(`tr`,{className:`even:bg-muted/30`,children:e.map(Mn)},t)}function Mn(e,t){return(0,N.jsx)(`td`,{className:`max-w-80 border-b border-border/60 px-3 py-1.5 align-top whitespace-pre-wrap break-words tabular-nums`,children:e},t)}function Nn(e,t){return(0,N.jsx)(`th`,{scope:`col`,className:`max-w-80 border-b border-border bg-muted/60 px-3 py-1.5 text-left align-bottom font-medium whitespace-pre-wrap break-words backdrop-blur`,children:e},t)}var Pn=(0,j.lazy)(()=>t(()=>import(`./ReadOnlySourcePreview-CQr-JCID.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329]))),Fn=3e5;function In(e){let t=(0,M.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,N.jsx)(On,{className:`p-4`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,N.jsx)(j.Suspense,{fallback:n,children:(0,N.jsx)(Pn,{...e})}),t[1]=e,t[2]=r),r}function Ln(e,t){return e===`markdown`?t?`Show markdown source`:`Show rendered markdown`:e===`table`?t?`Show source`:`Show table`:t?`Show HTML source`:`Show rendered page`}function Rn(e){let t=Ce(e),n=rn(e),r=t===`markdown`?`markdown`:t===`html`?`html`:n?`table`:null,i=e.asset?.attachmentId,{copyToClipboard:o,isCopied:c}=Ge({target:e.name}),l=(0,j.useMemo)(()=>i?{_tag:`attachment`,attachmentId:i,fileName:e.name,mimeType:e.mimeType,disposition:`inline`}:null,[i,e.name,e.mimeType]),u=Ft(e.file?null:e.asset?.environmentId??null,e.file?null:l),d=(0,j.useMemo)(()=>l?{...l,disposition:`attachment`}:null,[l]),f=Ft(e.asset?.environmentId??null,d),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null),[v,b]=(0,j.useState)(null),[x,S]=(0,j.useState)(!0),[C,w]=(0,j.useState)(0),[T,E]=(0,j.useState)(null),[ee,te]=(0,j.useState)(null),[ne,D]=(0,j.useState)(null),re=(0,j.useRef)(0);(0,j.useEffect)(()=>{if(!e.file)return;let t=URL.createObjectURL(e.file);return g(t),()=>URL.revokeObjectURL(t)},[e.file]),(0,j.useEffect)(()=>{if(e.file)return;let t=!1;return b(null),te(null),u().then(e=>{if(!t){if(!e)throw Error(`Reconnect to the environment and try again.`);re.current=Date.now(),b(e)}}).catch(e=>{t||te(e instanceof Error?e.message:`The attachment is unavailable.`)}),()=>{t=!0}},[e.file,u,C]);let O=e.file?h:v,ie=t===`text`||t===`markdown`||t===`html`&&!x;(0,j.useEffect)(()=>{if(!ie||!O)return;let t=new AbortController;E(null),D(null);let n=e.file;return(async()=>{if(!n&&Date.now()-re.current>Fn){let e=await u();if(t.signal.aborted)return;if(!e)throw Error(`Reconnect to the environment and try again.`);if(re.current=Date.now(),e!==O){b(e);return}}let r=await on(n?{ok:!0,body:n.stream()}:await fetch(O,{signal:t.signal,...e.sizeBytes>0?{headers:{Range:`bytes=0-${we}`}}:{},cache:C===0?`default`:`reload`}),t.signal);t.signal.aborted||E(r)})().catch(e=>{t.signal.aborted||D(e instanceof Error?e.message:`Could not load this file.`)}),()=>t.abort()},[O,ie,C,e.sizeBytes,e.file,u]);let ae=ee??(ie?ne:null),oe=at(e=>e.wordWrap),se=ot(),ce=ae===null&&ie&&T!==null&&!(n&&x)&&!(t===`markdown`&&x),le=()=>{m(!0),(async()=>{try{let t=e.file;if(!t){let e=await f();if(!e)throw Error(`Reconnect to the environment and try again.`);let n=await fetch(e);if(!n.ok)throw Error(`The file could not be loaded. Try again.`);t=await n.blob()}let n=URL.createObjectURL(t);try{let t=document.createElement(`a`);t.href=n,t.download=e.name,t.click()}finally{setTimeout(()=>URL.revokeObjectURL(n),3e4)}}catch(e){We.add({type:`error`,title:`Could not save file`,description:e instanceof Error?e.message:`Please try again.`})}finally{m(!1)}})()},ue=ae?(0,N.jsx)(kn,{message:ae,onRetry:()=>{te(null),w(e=>e+1)}}):!O||ie&&!T?(0,N.jsx)(On,{}):ie&&T?n&&x?(0,N.jsx)(An,{name:e.name,text:T.text,delimiter:n}):t===`markdown`&&x?(0,N.jsx)(Pt,{className:`min-h-0 flex-1`,children:(0,N.jsx)(ze,{text:T.text,cwd:void 0,className:`mx-auto max-w-4xl px-6 py-5`})}):(0,N.jsx)(In,{name:e.name,text:T.text}):t===`pdf`||t===`html`?(0,N.jsx)(gn,{src:O,title:e.name,pdf:t===`pdf`,htmlRender:e.htmlRender===!0,threadRef:e.threadRef}):t===`audio`?(0,N.jsx)(sn,{src:O,name:e.name,onError:()=>te(`Unable to load audio.`)}):t===`video`?(0,N.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-black`,children:(0,N.jsx)(`video`,{controls:!0,playsInline:!0,src:O,"aria-label":e.name,className:`max-h-full max-w-full`,onError:()=>te(`Unable to load video.`)})}):t===`image`?(0,N.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,N.jsx)(`img`,{src:O,alt:e.name,className:`max-h-full max-w-full object-contain`,onError:()=>te(`Unable to load image.`)})}):(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-1 px-6 text-center`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium`,children:`No preview for this file`}),(0,N.jsxs)(`p`,{className:`max-w-sm text-xs leading-relaxed text-muted-foreground`,children:[`Save it to open in an app that supports `,e.name.split(`.`).at(-1)||`this format`,` `,`files.`]})]});return(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,N.jsxs)(`div`,{className:pe(Cn),"data-surface-subheader":!0,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center text-xs`,children:[(0,N.jsx)(`span`,{className:`shrink-0 px-0.5 text-muted-foreground`,children:e.origin??`Attachment`}),(0,N.jsx)(ge,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}),(0,N.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate px-0.5 font-medium text-foreground`,children:e.name}),e.sizeBytes>0?(0,N.jsx)(`span`,{className:`ml-2 shrink-0 text-muted-foreground`,children:Lt(e.sizeBytes)}):null]}),r?(0,N.jsx)(En,{label:Ln(r,x),pressed:x,onPress:()=>S(e=>!e),children:(0,N.jsx)(qe,{className:`size-3.5`,icon:x?Ze:r===`table`?et:Qe})}):null,ce?(0,N.jsx)(En,{label:oe?`Disable word wrap`:`Enable word wrap`,pressed:oe,onPress:()=>se({wordWrap:!oe}),children:(0,N.jsx)(a,{className:`size-3.5`})}):null,T?(0,N.jsx)(En,{label:c?`Copied`:T.truncated?`Copy preview`:`Copy contents`,onPress:()=>o(T.text,void 0),children:(0,N.jsx)(qe,{className:`size-3.5`,icon:c?Je:$e})}):null,O?(0,N.jsx)(En,{label:p?`Preparing file…`:`Save file`,disabled:p,onPress:le,children:(0,N.jsx)(y,{className:`size-3.5`})}):null,e.onRemove?(0,N.jsx)(En,{label:`Remove from draft`,onPress:e.onRemove,children:(0,N.jsx)(s,{className:`size-3.5`})}):null,e.onClose?(0,N.jsx)(En,{label:`Close`,onPress:e.onClose,children:(0,N.jsx)(_,{className:`size-3.5`})}):null]}),T?.truncated?(0,N.jsxs)(Dn,{children:[`Preview limited to the first 1 MB`,e.sizeBytes>0?` of a ${e.sizeBytes.toLocaleString()} byte file`:``,`. Save the file to read it in full.`]}):null,ue]})}function zn(e){let t=e.getData(`text/plain`),n=xe(e.getData(`web application/x-t3-context-fragment+json`))??_e(e.getData(`text/html`));if(n===null)return null;let r=new Set(he(t).map(e=>e.contextId));for(let e of n.records)e.kind===`preview-annotation`&&!(`payload`in e)&&r.has(e.contextId)&&e.screenshotContextId&&r.add(e.screenshotContextId);return{...n,records:n.records.filter(e=>r.has(e.contextId))}}function Bn(e,t){let n=e.getData(`text/plain`),r=t?zn(e):null,i=r&&r.records.length>0?t(r):null;return i&&i.size>0?g(n,e=>{let t=i.get(e.contextId);return t?be({...e,contextId:ie.make(t),kind:e.kind===`element`?`preview-annotation`:e.kind}):e.source}):n}var Vn=`Ask for changes, send follow-ups, or attach images`;function Hn(e){let t=e.match(/^[ \t]*/)?.[0]??``,n=e.slice(t.length),r=n.match(/^(\d+)([.)])((?:[ \t]+)|\s*$)/);if(r&&r[1]!==void 0&&r[2]!==void 0)return{marker:{kind:`ordered`,indent:t,numberText:r[1],delimiter:r[2]===`)`?`)`:`.`,space:r[3]??``},markerEnd:t.length+r[0].length};let i=n.match(/^-\s\[[ xX]\]((?:[ \t]+)|\s*$)/);if(i)return{marker:{kind:`task`,indent:t,space:i[1]??``},markerEnd:t.length+i[0].length};let a=n.match(/^([-*+])((?:[ \t]+)|\s*$)/);return a&&a[1]!==void 0?{marker:{kind:`bullet`,indent:t,bullet:a[1],space:a[2]??``},markerEnd:t.length+a[0].length}:null}function Un(e){let t=e.slice(0,-1),n=e.slice(-1),r=Number.parseInt(t,10);return`${Number.isSafeInteger(r)?String(r+1).padStart(t.length,`0`):t}${n}`}function Wn(e){return e.kind===`ordered`?`${e.indent}${Un(`${e.numberText}${e.delimiter}`)} `:e.kind===`task`?`${e.indent}- [ ] `:`${e.indent}${e.bullet} `}function Gn(e){return e.type===`text`?e.text:e.source}function Kn(e,t){let n=0;for(let r of Yt(e)){let e=n+Gn(r).length;if(r.type!==`text`&&t>n&&t<e)return!0;n=e}return!1}function qn(e,t){let n=e.lastIndexOf(`
|
|
48
|
+
`;function En(e){let t=(0,M.c)(11),n=e.pressed,r;t[0]!==n||t[1]!==e.children||t[2]!==e.disabled||t[3]!==e.label||t[4]!==e.onPress?(r=(0,N.jsx)(Ke,{render:n===void 0?(0,N.jsx)(de,{type:`button`,className:`shrink-0`,disabled:e.disabled??!1,onClick:e.onPress,"aria-label":e.label,variant:`ghost`,size:`icon-sm`,children:e.children}):(0,N.jsx)(Et,{className:`shrink-0`,pressed:n,disabled:e.disabled??!1,onPressedChange:e.onPress,"aria-label":e.label,variant:`ghost`,size:`sm`,children:e.children})}),t[0]=n,t[1]=e.children,t[2]=e.disabled,t[3]=e.label,t[4]=e.onPress,t[5]=r):r=t[5];let i;t[6]===e.label?i=t[7]:(i=(0,N.jsx)(Ye,{children:e.label}),t[6]=e.label,t[7]=i);let a;return t[8]!==r||t[9]!==i?(a=(0,N.jsxs)(Xe,{children:[r,i]}),t[8]=r,t[9]=i,t[10]=a):a=t[10],a}function Dn(e){let t=(0,M.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,N.jsx)(`div`,{role:`status`,className:`shrink-0 border-b border-warning/20 bg-warning-surface px-3 py-1.5 text-2xs text-warning-foreground`,children:e.children}),t[0]=e.children,t[1]=n),n}function On(e){let t=(0,M.c)(5),n;t[0]===e.className?n=t[1]:(n=pe(`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,e.className),t[0]=e.className,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,N.jsx)(He,{size:`lg`}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,N.jsx)(`div`,{role:`status`,"aria-label":`Loading file`,className:n,children:r}),t[3]=n,t[4]=i),i}function kn(e){let t=(0,M.c)(7),n;t[0]===e.message?n=t[1]:(n=(0,N.jsx)(`p`,{className:`text-destructive`,children:e.message}),t[0]=e.message,t[1]=n);let r;t[2]===e.onRetry?r=t[3]:(r=e.onRetry?(0,N.jsx)(`button`,{type:`button`,onClick:e.onRetry,className:`rounded-md border border-input px-2.5 py-1 text-xs text-foreground hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:`Try again`}):null,t[2]=e.onRetry,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,N.jsxs)(`div`,{role:`alert`,className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-6 text-center text-xs leading-relaxed`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function An(e){let t=(0,M.c)(29),n;t[0]!==e.delimiter||t[1]!==e.text?(n=an(e.text,e.delimiter),t[0]=e.delimiter,t[1]=e.text,t[2]=n):n=t[2];let r=n,i,a,o,s,c,l,u;if(t[3]!==e.name||t[4]!==r.rows||t[5]!==r.truncated){let[n,...d]=r.rows;c=`flex min-h-0 flex-1 flex-col`,t[13]===r.truncated?l=t[14]:(l=r.truncated?(0,N.jsx)(Dn,{children:`Table limited to the first 100 rows and 30 columns. Switch to source for the rest.`}):null,t[13]=r.truncated,t[14]=l),s=`min-h-0 flex-1 overflow-auto`,i=`min-w-full border-separate border-spacing-0 text-xs`,a=e.name,t[15]===n?o=t[16]:(o=n?(0,N.jsx)(`thead`,{className:`sticky top-0 z-10`,children:(0,N.jsx)(`tr`,{children:n.map(Nn)})}):null,t[15]=n,t[16]=o),u=(0,N.jsx)(`tbody`,{children:d.map(jn)}),t[3]=e.name,t[4]=r.rows,t[5]=r.truncated,t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=u}else i=t[6],a=t[7],o=t[8],s=t[9],c=t[10],l=t[11],u=t[12];let d;t[17]!==i||t[18]!==a||t[19]!==o||t[20]!==u?(d=(0,N.jsxs)(`table`,{className:i,"aria-label":a,children:[o,u]}),t[17]=i,t[18]=a,t[19]=o,t[20]=u,t[21]=d):d=t[21];let f;t[22]!==s||t[23]!==d?(f=(0,N.jsx)(`div`,{className:s,children:d}),t[22]=s,t[23]=d,t[24]=f):f=t[24];let p;return t[25]!==c||t[26]!==l||t[27]!==f?(p=(0,N.jsxs)(`div`,{className:c,children:[l,f]}),t[25]=c,t[26]=l,t[27]=f,t[28]=p):p=t[28],p}function jn(e,t){return(0,N.jsx)(`tr`,{className:`even:bg-muted/30`,children:e.map(Mn)},t)}function Mn(e,t){return(0,N.jsx)(`td`,{className:`max-w-80 border-b border-border/60 px-3 py-1.5 align-top whitespace-pre-wrap break-words tabular-nums`,children:e},t)}function Nn(e,t){return(0,N.jsx)(`th`,{scope:`col`,className:`max-w-80 border-b border-border bg-muted/60 px-3 py-1.5 text-left align-bottom font-medium whitespace-pre-wrap break-words backdrop-blur`,children:e},t)}var Pn=(0,j.lazy)(()=>t(()=>import(`./ReadOnlySourcePreview-BNe8pyVf.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329]))),Fn=3e5;function In(e){let t=(0,M.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,N.jsx)(On,{className:`p-4`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,N.jsx)(j.Suspense,{fallback:n,children:(0,N.jsx)(Pn,{...e})}),t[1]=e,t[2]=r),r}function Ln(e,t){return e===`markdown`?t?`Show markdown source`:`Show rendered markdown`:e===`table`?t?`Show source`:`Show table`:t?`Show HTML source`:`Show rendered page`}function Rn(e){let t=Ce(e),n=rn(e),r=t===`markdown`?`markdown`:t===`html`?`html`:n?`table`:null,i=e.asset?.attachmentId,{copyToClipboard:o,isCopied:c}=Ge({target:e.name}),l=(0,j.useMemo)(()=>i?{_tag:`attachment`,attachmentId:i,fileName:e.name,mimeType:e.mimeType,disposition:`inline`}:null,[i,e.name,e.mimeType]),u=Ft(e.file?null:e.asset?.environmentId??null,e.file?null:l),d=(0,j.useMemo)(()=>l?{...l,disposition:`attachment`}:null,[l]),f=Ft(e.asset?.environmentId??null,d),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null),[v,b]=(0,j.useState)(null),[x,S]=(0,j.useState)(!0),[C,w]=(0,j.useState)(0),[T,E]=(0,j.useState)(null),[ee,te]=(0,j.useState)(null),[ne,D]=(0,j.useState)(null),re=(0,j.useRef)(0);(0,j.useEffect)(()=>{if(!e.file)return;let t=URL.createObjectURL(e.file);return g(t),()=>URL.revokeObjectURL(t)},[e.file]),(0,j.useEffect)(()=>{if(e.file)return;let t=!1;return b(null),te(null),u().then(e=>{if(!t){if(!e)throw Error(`Reconnect to the environment and try again.`);re.current=Date.now(),b(e)}}).catch(e=>{t||te(e instanceof Error?e.message:`The attachment is unavailable.`)}),()=>{t=!0}},[e.file,u,C]);let O=e.file?h:v,ie=t===`text`||t===`markdown`||t===`html`&&!x;(0,j.useEffect)(()=>{if(!ie||!O)return;let t=new AbortController;E(null),D(null);let n=e.file;return(async()=>{if(!n&&Date.now()-re.current>Fn){let e=await u();if(t.signal.aborted)return;if(!e)throw Error(`Reconnect to the environment and try again.`);if(re.current=Date.now(),e!==O){b(e);return}}let r=await on(n?{ok:!0,body:n.stream()}:await fetch(O,{signal:t.signal,...e.sizeBytes>0?{headers:{Range:`bytes=0-${we}`}}:{},cache:C===0?`default`:`reload`}),t.signal);t.signal.aborted||E(r)})().catch(e=>{t.signal.aborted||D(e instanceof Error?e.message:`Could not load this file.`)}),()=>t.abort()},[O,ie,C,e.sizeBytes,e.file,u]);let ae=ee??(ie?ne:null),oe=at(e=>e.wordWrap),se=ot(),ce=ae===null&&ie&&T!==null&&!(n&&x)&&!(t===`markdown`&&x),le=()=>{m(!0),(async()=>{try{let t=e.file;if(!t){let e=await f();if(!e)throw Error(`Reconnect to the environment and try again.`);let n=await fetch(e);if(!n.ok)throw Error(`The file could not be loaded. Try again.`);t=await n.blob()}let n=URL.createObjectURL(t);try{let t=document.createElement(`a`);t.href=n,t.download=e.name,t.click()}finally{setTimeout(()=>URL.revokeObjectURL(n),3e4)}}catch(e){We.add({type:`error`,title:`Could not save file`,description:e instanceof Error?e.message:`Please try again.`})}finally{m(!1)}})()},ue=ae?(0,N.jsx)(kn,{message:ae,onRetry:()=>{te(null),w(e=>e+1)}}):!O||ie&&!T?(0,N.jsx)(On,{}):ie&&T?n&&x?(0,N.jsx)(An,{name:e.name,text:T.text,delimiter:n}):t===`markdown`&&x?(0,N.jsx)(Pt,{className:`min-h-0 flex-1`,children:(0,N.jsx)(ze,{text:T.text,cwd:void 0,className:`mx-auto max-w-4xl px-6 py-5`})}):(0,N.jsx)(In,{name:e.name,text:T.text}):t===`pdf`||t===`html`?(0,N.jsx)(gn,{src:O,title:e.name,pdf:t===`pdf`,htmlRender:e.htmlRender===!0,threadRef:e.threadRef}):t===`audio`?(0,N.jsx)(sn,{src:O,name:e.name,onError:()=>te(`Unable to load audio.`)}):t===`video`?(0,N.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center bg-black`,children:(0,N.jsx)(`video`,{controls:!0,playsInline:!0,src:O,"aria-label":e.name,className:`max-h-full max-w-full`,onError:()=>te(`Unable to load video.`)})}):t===`image`?(0,N.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,N.jsx)(`img`,{src:O,alt:e.name,className:`max-h-full max-w-full object-contain`,onError:()=>te(`Unable to load image.`)})}):(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-1 px-6 text-center`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium`,children:`No preview for this file`}),(0,N.jsxs)(`p`,{className:`max-w-sm text-xs leading-relaxed text-muted-foreground`,children:[`Save it to open in an app that supports `,e.name.split(`.`).at(-1)||`this format`,` `,`files.`]})]});return(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,N.jsxs)(`div`,{className:pe(Cn),"data-surface-subheader":!0,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center text-xs`,children:[(0,N.jsx)(`span`,{className:`shrink-0 px-0.5 text-muted-foreground`,children:e.origin??`Attachment`}),(0,N.jsx)(ge,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}),(0,N.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate px-0.5 font-medium text-foreground`,children:e.name}),e.sizeBytes>0?(0,N.jsx)(`span`,{className:`ml-2 shrink-0 text-muted-foreground`,children:Lt(e.sizeBytes)}):null]}),r?(0,N.jsx)(En,{label:Ln(r,x),pressed:x,onPress:()=>S(e=>!e),children:(0,N.jsx)(qe,{className:`size-3.5`,icon:x?Ze:r===`table`?et:Qe})}):null,ce?(0,N.jsx)(En,{label:oe?`Disable word wrap`:`Enable word wrap`,pressed:oe,onPress:()=>se({wordWrap:!oe}),children:(0,N.jsx)(a,{className:`size-3.5`})}):null,T?(0,N.jsx)(En,{label:c?`Copied`:T.truncated?`Copy preview`:`Copy contents`,onPress:()=>o(T.text,void 0),children:(0,N.jsx)(qe,{className:`size-3.5`,icon:c?Je:$e})}):null,O?(0,N.jsx)(En,{label:p?`Preparing file…`:`Save file`,disabled:p,onPress:le,children:(0,N.jsx)(y,{className:`size-3.5`})}):null,e.onRemove?(0,N.jsx)(En,{label:`Remove from draft`,onPress:e.onRemove,children:(0,N.jsx)(s,{className:`size-3.5`})}):null,e.onClose?(0,N.jsx)(En,{label:`Close`,onPress:e.onClose,children:(0,N.jsx)(_,{className:`size-3.5`})}):null]}),T?.truncated?(0,N.jsxs)(Dn,{children:[`Preview limited to the first 1 MB`,e.sizeBytes>0?` of a ${e.sizeBytes.toLocaleString()} byte file`:``,`. Save the file to read it in full.`]}):null,ue]})}function zn(e){let t=e.getData(`text/plain`),n=xe(e.getData(`web application/x-t3-context-fragment+json`))??_e(e.getData(`text/html`));if(n===null)return null;let r=new Set(he(t).map(e=>e.contextId));for(let e of n.records)e.kind===`preview-annotation`&&!(`payload`in e)&&r.has(e.contextId)&&e.screenshotContextId&&r.add(e.screenshotContextId);return{...n,records:n.records.filter(e=>r.has(e.contextId))}}function Bn(e,t){let n=e.getData(`text/plain`),r=t?zn(e):null,i=r&&r.records.length>0?t(r):null;return i&&i.size>0?g(n,e=>{let t=i.get(e.contextId);return t?be({...e,contextId:ie.make(t),kind:e.kind===`element`?`preview-annotation`:e.kind}):e.source}):n}var Vn=`Ask for changes, send follow-ups, or attach images`;function Hn(e){let t=e.match(/^[ \t]*/)?.[0]??``,n=e.slice(t.length),r=n.match(/^(\d+)([.)])((?:[ \t]+)|\s*$)/);if(r&&r[1]!==void 0&&r[2]!==void 0)return{marker:{kind:`ordered`,indent:t,numberText:r[1],delimiter:r[2]===`)`?`)`:`.`,space:r[3]??``},markerEnd:t.length+r[0].length};let i=n.match(/^-\s\[[ xX]\]((?:[ \t]+)|\s*$)/);if(i)return{marker:{kind:`task`,indent:t,space:i[1]??``},markerEnd:t.length+i[0].length};let a=n.match(/^([-*+])((?:[ \t]+)|\s*$)/);return a&&a[1]!==void 0?{marker:{kind:`bullet`,indent:t,bullet:a[1],space:a[2]??``},markerEnd:t.length+a[0].length}:null}function Un(e){let t=e.slice(0,-1),n=e.slice(-1),r=Number.parseInt(t,10);return`${Number.isSafeInteger(r)?String(r+1).padStart(t.length,`0`):t}${n}`}function Wn(e){return e.kind===`ordered`?`${e.indent}${Un(`${e.numberText}${e.delimiter}`)} `:e.kind===`task`?`${e.indent}- [ ] `:`${e.indent}${e.bullet} `}function Gn(e){return e.type===`text`?e.text:e.source}function Kn(e,t){let n=0;for(let r of Yt(e)){let e=n+Gn(r).length;if(r.type!==`text`&&t>n&&t<e)return!0;n=e}return!1}function qn(e,t){let n=e.lastIndexOf(`
|
|
49
49
|
`,t-1)+1,r=e.indexOf(`
|
|
50
50
|
`,t),i=r===-1?e.length:r;return{start:n,end:i,text:e.slice(n,i)}}function Jn(e,t){if(!Number.isInteger(t)||t<0||t>e.length)return null;let n=qn(e,t),r=Hn(n.text);if(!r)return null;let i=n.start+r.markerEnd;return t<i||Kn(e,t)?null:e.slice(i,n.end).trim()===``?{start:n.start,end:Math.max(t,i),replacement:``}:{start:t,end:t,replacement:`\n${Wn(r.marker)}`}}function Yn(e,t,n){if(!Number.isInteger(t)||t!==n||t<0||t>e.length)return null;let r=qn(e,t);return!Hn(r.text)||Kn(e,t)?null:{start:r.start,end:r.start,replacement:` `}}function Xn(e){let t=0,n=0;for(let r of e.imageIds){let i=e.uploadsByImageId[r];i?.status===`failed`&&i.environmentId===e.environmentId?n+=1:(i?.status!==`ready`||i.environmentId!==e.environmentId)&&(t+=1)}return n>0?n===1?`Retry or remove the failed attachment`:`Retry or remove the failed attachments`:t>0?t===1?`Attachment still uploading`:`Attachments still uploading`:null}function Zn(e){return`${Math.floor(Math.max(0,Math.min(1,Number.isFinite(e)?e:0))*100)}%`}var Qn=Object.defineProperty,$n=(e,t)=>{let n={};for(var r in e)Qn(n,r,{get:e[r],enumerable:!0});return t||Qn(n,Symbol.toStringTag,{value:`Module`}),n};function er(e){this.content=e}er.prototype={constructor:er,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new er(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new er(n)},addToStart:function(e,t){return new er([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new er(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new er(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=er.from(e),e.size?new er(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=er.from(e),e.size?new er(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=er.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},er.from=function(e){if(e instanceof er)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new er(t)};function tr(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&ir(e.charCodeAt(r-1))&&rr(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=tr(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function nr(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&ir(e.charCodeAt(i-1))&&rr(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=nr(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function rr(e){return e>=56320&&e<57344}function ir(e){return e>=55296&&e<56320}var P=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return tr(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return nr(this,e,t,n)}findIndex(e){if(e==0)return or(0,e);if(e==this.size)return or(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?or(t+1,i):or(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};P.empty=new P([],0);var ar={index:0,offset:0};function or(e,t){return ar.index=e,ar.offset=t,ar}function sr(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!sr(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!sr(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var F=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&sr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};F.none=[];var cr=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=ur(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(lr(this.content,t+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(P.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(P.empty,0,0);function lr(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(lr(a.content,t-i-1,n-i-1)))}function ur(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=ur(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function dr(e,t,n){if(n.openStart>e.depth)throw new cr(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new cr(`Inconsistent open depths`);return fr(e,t,n,0)}function fr(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=fr(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return _r(a,yr(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return _r(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=br(n,e);return _r(a,vr(e,i,o,t,r))}}function pr(e,t){if(!t.type.compatibleContent(e.type))throw new cr(`Cannot join `+t.type.name+` onto `+e.type.name)}function mr(e,t,n){let r=e.node(n);return pr(r,t.node(n)),r}function hr(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function gr(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(hr(e.nodeAfter,r),a++));for(let e=a;e<o;e++)hr(i.child(e),r);t&&t.depth==n&&t.textOffset&&hr(t.nodeBefore,r)}function _r(e,t){if(!e.type.validContent(t))throw new cr(`Invalid content for node `+e.type.name);return e.copy(t)}function vr(e,t,n,r,i){let a=e.depth>i&&mr(e,t,i+1),o=r.depth>i&&mr(n,r,i+1),s=[];return gr(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(pr(a,o),hr(_r(a,vr(e,t,n,r,i+1)),s)):(a&&hr(_r(a,yr(e,t,i+1)),s),gr(t,n,i,s),o&&hr(_r(o,yr(n,r,i+1)),s)),gr(r,null,i,s),new P(s)}function yr(e,t,n){let r=[];return gr(null,e,n,r),e.depth>n&&hr(_r(mr(e,t,n+1),yr(e,t,n+1)),r),gr(t,null,n,r),new P(r)}function br(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(P.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var xr=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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 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 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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return F.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Tr(this,e,n);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 t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=wr.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else wr.set(t,r=new Sr);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Cr,i}},Sr=class{constructor(){this.elts=[],this.i=0}},Cr=12,wr=new WeakMap,Tr=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},Er=Object.create(null),Dr=class e{constructor(e,t,n,r=F.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||P.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,t,n,r=0){this.content.nodesBetween(e,t,n,r,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,t,n,r){return this.content.textBetween(e,t,n,r)}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,t,n){return this.type==e&&sr(this.attrs,t||e.defaultAttrs||Er)&&F.sameSet(this.marks,n||F.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return I.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new I(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return dr(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return xr.resolveCached(this,e)}resolveNoCache(e){return xr.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),kr(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=P.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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=F.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!F.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t 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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=P.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Dr.prototype.text=void 0;var Or=class e extends Dr{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):kr(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function kr(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Ar=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new jr(t,n);if(r.next==null)return e.empty;let i=Mr(r);r.next&&r.err(`Unexpected trailing text`);let a=Hr(zr(i));return Ur(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return P.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
51
51
|
`)}};Ar.empty=new Ar(!0);var jr=class{constructor(e,t){this.string=e,this.nodeTypes=t,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 SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Mr(e){let t=[];do t.push(Nr(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Nr(e){let t=[];do t.push(Pr(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Pr(e){let t=Rr(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Ir(e,t);else break;return t}function Fr(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Ir(e,t){let n=Fr(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Fr(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Lr(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Rr(e){if(e.eat(`(`)){let t=Mr(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Lr(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function zr(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Br(e,t){return t-e}function Vr(e,t){let n=[];return r(t),n.sort(Br);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Hr(e){let t=Object.create(null);return n(Vr(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Vr(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Ar(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Br);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Ur(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Wr(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Gr(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Kr(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function qr(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Xr(e,r,t[r]);return n}var Jr=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=qr(e,n.attrs),this.defaultAttrs=Wr(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ar.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:Gr(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Dr(this,this.computeAttrs(e),P.from(t),F.setFrom(n))}createChecked(e=null,t,n){return t=P.from(t),this.checkContent(t),new Dr(this,this.computeAttrs(e),t,F.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=P.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(P.empty,!0);return i?new Dr(this,e,t.append(i),F.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Kr(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:F.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Yr(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Xr=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Yr(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Zr=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qr(e,r.attrs),this.excluded=null;let i=Wr(this.attrs);this.instance=i?new F(this,i):null}create(e=null){return!e&&this.instance?this.instance:new F(this,Gr(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Kr(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Qr=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=er.from(e.nodes),t.marks=er.from(e.marks||{}),this.nodes=Jr.compile(this.spec.nodes,this),this.marks=Zr.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Ar.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?$r(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:$r(this,n.split(` `))}this.nodeFromJSON=e=>Dr.fromJSON(this,e),this.markFromJSON=e=>F.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Jr))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Or(n,n.defaultAttrs,e,F.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function $r(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function ei(e){return e.tag!=null}function ti(e){return e.style!=null}var ni=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(ei(e))this.tags.push(e);else if(ti(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new di(this,t,!1);return n.addAll(e,F.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new di(this,t,!0);return n.addAll(e,F.none,t.from,t.to),I.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(pi(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=mi(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=mi(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},ri={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},ii={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ai={ol:!0,ul:!0},oi=1,si=2,ci=4;function li(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?oi:0)|(t===`full`?si:0)}var ui=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=F.none,this.match=i||(a&ci?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(P.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&oi)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=P.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ri.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},di=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=li(null,t.preserveWhitespace,0)|(n?ci:0);i=r?new ui(r.type,r.attrs,F.none,!0,t.topMatch||r.type.contentMatch,a):n?new ui(null,null,F.none,!0,null,a):new ui(e.schema.topNodeType,null,F.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&si?`full`:this.localPreserveWS||(r.options&oi)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
@@ -201,4 +201,4 @@ img.ProseMirror-separator {
|
|
|
201
201
|
`,o)?2:1);for(let e of n){let t=e.content.length;e.color&&e.content.trim()&&a.push({from:o,to:o+t,color:e.color}),o+=t}}return a}function lT(e,t,n){let r=[];for(let{node:i,pos:a}of oT(e)){if(!iT(i.textContent))continue;let e=t.get(aT(i,n));if(!e||i.content.size!==i.textContent.length)continue;let o=a+1;for(let t of e.decorations)r.push(Au.inline(o+t.from,o+t.to,{style:`color:${t.color}`}))}return U.create(e.doc,r)}function uT(e,t){return t!==null&&t.start!==t.end&&(t.start!==e.start||t.end!==e.end)}var dT=(0,j.createContext)({openComment:null,onOpenChange:()=>{},onDraftChange:()=>{},onSubmitAndSend:()=>{}}),fT=(0,j.createContext)([]),pT={"(":`)`,"[":`]`,"{":`}`,"'":`'`,'"':`"`,"“":`”`,"`":"`","<":`>`,"«":`»`,"*":`*`,_:`_`};function mT(){return document.documentElement.classList.contains(`dark`)?`dark`:`light`}var hT=`relative inline-flex select-none items-center align-middle leading-none data-[composer-chip-selected]:after:pointer-events-none data-[composer-chip-selected]:after:absolute data-[composer-chip-selected]:after:inset-0 data-[composer-chip-selected]:after:rounded-sm data-[composer-chip-selected]:after:bg-[Highlight] data-[composer-chip-selected]:after:opacity-30 data-[composer-chip-selected]:after:content-['']`,gT=Fh.create({name:`composer-mention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},source:{default:``}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-composer-mention":``,...e}]},addNodeView(){return h_(_T)}});function _T(e){let t=(0,M.c)(25),{node:n}=e,r=(0,j.use)(Ow),i=n.attrs.path??``,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,N.jsx)(`button`,{type:`button`}),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==i?(o=()=>r.openMention(i),t[1]=r,t[2]=i,t[3]=o):o=t[3];let s=`Preview ${i}`,c=r.environmentId,l=r.cwd,u;t[4]===i?u=t[5]:(u=wt(i),t[4]=i,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=mT(),t[6]=d):d=t[6];let f;t[7]!==r.cwd||t[8]!==r.environmentId||t[9]!==i||t[10]!==u?(f=(0,N.jsx)(Ve,{path:i,environmentId:c,cwd:l,label:u,theme:d}),t[7]=r.cwd,t[8]=r.environmentId,t[9]=i,t[10]=u,t[11]=f):f=t[11];let p;t[12]!==o||t[13]!==s||t[14]!==f?(p=(0,N.jsx)(A,{kind:`mention`,render:a,onClick:o,"aria-label":s,contentEditable:!1,spellCheck:!1,"data-composer-mention-chip":`true`,children:f}),t[12]=o,t[13]=s,t[14]=f,t[15]=p):p=t[15];let m=p,h;t[16]===m?h=t[17]:(h=(0,N.jsx)(Ke,{render:m}),t[16]=m,t[17]=h);let g;t[18]!==r.cwd||t[19]!==r.environmentId||t[20]!==i?(g=(0,N.jsx)(Ye,{side:`top`,children:(0,N.jsx)(Re,{path:i,environmentId:r.environmentId,cwd:r.cwd})}),t[18]=r.cwd,t[19]=r.environmentId,t[20]=i,t[21]=g):g=t[21];let _;return t[22]!==h||t[23]!==g?(_=(0,N.jsx)(t_,{as:`span`,className:hT,children:(0,N.jsxs)(Xe,{children:[h,g]})}),t[22]=h,t[23]=g,t[24]=_):_=t[24],_}var vT=Fh.create({name:`composer-skill`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{skillName:{default:``},skillLabel:{default:``},skillDescription:{default:null}}},parseHTML(){return[{tag:`span[data-composer-skill]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-composer-skill":``,...e}]},addNodeView(){return h_(yT)}});function yT(e){let t=(0,M.c)(21),{node:n}=e,r=(0,j.use)(Ow),i=(0,j.use)(fT),a=n.attrs.skillName??``,o=n.attrs.skillLabel||a,s=n.attrs.skillDescription??null,c;if(t[0]!==a||t[1]!==i){let e;t[3]===a?e=t[4]:(e=e=>e.name===a,t[3]=a,t[4]=e),c=i.find(e),t[0]=a,t[1]=i,t[2]=c}else c=t[2];let l=c,u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,N.jsx)(Fe,{}),t[5]=u):u=t[5];let d=`Skill ${o}`,f;t[6]===o?f=t[7]:(f=(0,N.jsx)(`p`,{className:`font-medium`,children:o}),t[6]=o,t[7]=f);let p=l?.description??s??`No description is available for this skill.`,m;t[8]===p?m=t[9]:(m=(0,N.jsx)(`p`,{children:p}),t[8]=p,t[9]=m);let h;t[10]!==r||t[11]!==l?(h=l?.path?(0,N.jsx)(de,{variant:`outline`,size:`sm`,onClick:()=>r.openMention(l.path),children:`View instructions`}):null,t[10]=r,t[11]=l,t[12]=h):h=t[12];let g;t[13]!==f||t[14]!==m||t[15]!==h?(g=(0,N.jsxs)(`div`,{className:`space-y-3 p-2 text-sm`,children:[f,m,h]}),t[13]=f,t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==o||t[18]!==d||t[19]!==g?(_=(0,N.jsx)(t_,{as:`span`,className:hT,children:(0,N.jsx)(ke,{kind:`skill`,icon:u,label:o,accessibleLabel:d,children:g})}),t[17]=o,t[18]=d,t[19]=g,t[20]=_):_=t[20],_}var bT=Fh.create({name:`composer-citation`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{citation:{default:null},source:{default:``},citeKey:{default:``}}},parseHTML(){return[{tag:`span[data-composer-citation]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-composer-citation":``,...e}]},addNodeView(){return h_(xT)}});function xT(e){let t=(0,M.c)(47),{node:n,editor:r,getPos:i}=e,a=(0,j.use)(dT),o=n.attrs.citation,s=n.attrs.citeKey,c=a.openComment?.key===s?a.openComment:null,l;t[0]===i?l=t[1]:(l=()=>{let e=typeof i==`function`?i():null;return typeof e==`number`?e:null},t[0]=i,t[1]=l);let u=l,d;t[2]!==r.isEditable||t[3]!==r.state||t[4]!==r.view||t[5]!==u?(d=e=>{if(!r.isEditable)return!1;let t=u();if(t===null)return!1;let n=r.state.doc.nodeAt(t);if(!n||n.type.name!==`composer-citation`)return!1;let i=n.attrs.citation,a=zt(i,e),o=r.state.tr.setNodeMarkup(t,void 0,{...n.attrs,citation:a,source:Vt(a)});return r.view.dispatch(o),!0},t[2]=r.isEditable,t[3]=r.state,t[4]=r.view,t[5]=u,t[6]=d):d=t[6];let f=d,p=c?.removeOnCancel,m;t[7]!==r||t[8]!==u||t[9]!==p?(m=()=>{if(!r.isEditable||!p)return;let e=u();if(e===null)return;let{doc:t}=r.state,n=t.nodeAt(e);if(!n)return;let i=e+n.nodeSize,a=p.before&&t.textBetween(e-1,e)===` `?e-1:e,o=p.after&&t.textBetween(i,i+1)===` `?i+1:i;r.chain().focus().deleteRange({from:a,to:o}).run()},t[7]=r,t[8]=u,t[9]=p,t[10]=m):m=t[10];let h=m,g;t[11]!==r.commands||t[12]!==r.isEditable||t[13]!==r.state||t[14]!==u?(g=()=>{if(!r.isEditable)return;let e=u();if(e===null)return;let t=r.state.doc.nodeAt(e);t&&t.type.name===`composer-citation`&&r.commands.focus(e+t.nodeSize)},t[11]=r.commands,t[12]=r.isEditable,t[13]=r.state,t[14]=u,t[15]=g):g=t[15];let _=g,v;t[16]!==r.isEditable||t[17]!==_?(v=e=>{!r.isEditable||e.key!==`Tab`||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey||!(e.target instanceof HTMLElement)||e.target.dataset.citationCommentTrigger===void 0||(e.preventDefault(),_())},t[16]=r.isEditable,t[17]=_,t[18]=v):v=t[18];let y=c!==null,b=c?.sourceAnchor,x;t[19]!==s||t[20]!==a||t[21]!==r.isEditable?(x=e=>{(!e||r.isEditable)&&a.onOpenChange(s,e)},t[19]=s,t[20]=a,t[21]=r.isEditable,t[22]=x):x=t[22];let S;t[23]!==h||t[24]!==p?(S=p?{onCancel:h}:{},t[23]=h,t[24]=p,t[25]=S):S=t[25];let C;t[26]!==s||t[27]!==a?(C=e=>a.onDraftChange(s,e),t[26]=s,t[27]=a,t[28]=C):C=t[28];let w;t[29]!==a||t[30]!==f?(w=e=>f(e)?(a.onSubmitAndSend(),!0):!1,t[29]=a,t[30]=f,t[31]=w):w=t[31];let T;t[32]!==_||t[33]!==f||t[34]!==C||t[35]!==w||t[36]!==y||t[37]!==b||t[38]!==x||t[39]!==S?(T={open:y,sourceAnchor:b,onOpenChange:x,...S,onSave:f,onDraftChange:C,onSaveAndSend:w,onRestoreFocus:_},t[32]=_,t[33]=f,t[34]=C,t[35]=w,t[36]=y,t[37]=b,t[38]=x,t[39]=S,t[40]=T):T=t[40];let E;t[41]!==o||t[42]!==T?(E=(0,N.jsx)(De,{citation:o,composer:!0,commentEditor:T}),t[41]=o,t[42]=T,t[43]=E):E=t[43];let ee;return t[44]!==E||t[45]!==v?(ee=(0,N.jsx)(t_,{as:`span`,className:`inline-flex min-w-0 max-w-full select-none`,contentEditable:!1,spellCheck:!1,"data-composer-citation-chip":`true`,onKeyDown:v,children:E}),t[44]=E,t[45]=v,t[46]=ee):ee=t[46],ee}var ST=Fh.create({name:`composer-context-reference`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{kind:{default:``},contextId:{default:``},label:{default:``},source:{default:``}}},parseHTML(){return[{tag:`span[data-composer-context-reference]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-composer-context-reference":``,...e}]},addNodeView(){return h_(CT)}});function CT(e){let t=(0,M.c)(4),{node:n}=e,r=n.attrs.kind??``,i=n.attrs.contextId??``,a=n.attrs.label??``,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,N.jsx)(t_,{as:`span`,className:hT,children:(0,N.jsx)(Ww,{kind:r,contextId:i,label:a})}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function wT(e){let t=[],n=LC(e),r=null,i=0;for(let e of n.runs)if(e.nodeName!==`codeBlock`&&(e.openLen>0&&(r??={from:e.pmPos,to:e.pmPos,markers:[]},r.markers.push({at:e.pmPos,side:-1,text:n.value.slice(e.mdStart,e.mdStart+e.openLen)})),r!==null)){if(r.to=e.pmPos+e.docLen,e.closeLen>0){let t=e.mdStart+e.mdLen;r.markers.push({at:r.to,side:-2,text:n.value.slice(t-e.closeLen,t)})}i+=e.openLen-e.closeLen,i===0&&(t.push(r),r=null)}return t}function TT(e,t){return new nh({find:e,handler:({state:e,range:n,match:r,chain:i})=>{let a=r.groups?.marker??`-`,o=r.groups?.space??` `,s=r.groups?.carried??``,c=e.doc.resolve(n.from);if(c.parent.type.name!==`paragraph`||c.depth!==1)return null;let l=i().deleteRange(n).wrapInList(t,t===`orderedList`?{start:Number.parseInt(a,10)||1}:{}).updateAttributes(`listItem`,{marker:a,space:o});(s?l.insertContent(s):l).run()}})}var ET=new nh({find:/^\[([ xX])\] $/,handler:({state:e,range:t,match:n,chain:r})=>{let i=e.doc.resolve(t.from),a=i.node(-1);if(i.parent.type.name!==`paragraph`||a?.type.name!==`listItem`||![`-`,`*`,`+`].includes(a.attrs.marker??``))return null;let o=(n[1]??` `).toLowerCase()===`x`;r().command(({tr:e})=>(OC(e,t.from,t.to,o),!0)).run()}});function DT(e){let t=Ph({find:/^- \[([ xX])\] $/,type:e,getAttributes:e=>({checked:e[1]?.toLowerCase()===`x`})});return new nh({find:t.find,handler:e=>e.state.doc.resolve(e.range.from).depth===1?t.handler(e):null})}function OT(e,t){for(let n=e.depth;n>0;--n)if(e.node(n).type.name===t)return!0;return!1}var kT=new nh({find:/^>(\s)$/,handler:({state:e,range:t,match:n,chain:r})=>{let i=e.doc.resolve(t.from);if(i.parent.type.name!==`paragraph`||i.depth!==1)return null;r().deleteRange(t).wrapIn(`blockquote`,{prefix:`>${n[1]??` `}`}).run()}}),AT=new nh({find:/^(---|\*\*\*|___)\s?$/,handler:({state:e,range:t,match:n,chain:r})=>{let i=n[0]??`---`;if(!i.startsWith(`---`)&&!/\s$/.test(i))return null;let a=e.doc.resolve(t.from);if(a.parent.type.name!==`paragraph`||a.depth!==1)return null;r().deleteRange(t).setHorizontalRule().command(({tr:e})=>{let t=e.selection.$from,n=t.index(0)-1;if(n<0)return!0;let r=t.posAtIndex(n,0),a=e.doc.nodeAt(r);return a?.type.name===`horizontalRule`&&e.setNodeMarkup(r,void 0,{...a.attrs,source:i}),!0}).run()}}),jT=new nh({find:/^(#{1,6})(\s)$/,handler:({state:e,range:t,match:n,chain:r})=>{let i=e.doc.resolve(t.from);if(i.parent.type.name!==`paragraph`||i.depth!==1)return null;r().deleteRange(t).setNode(`heading`,{level:n[1]?.length??1,space:n[2]??` `}).run()}});function MT(e){return e.state.selection.$from.parent.type.spec.code===!0}var NT=new V(`composer-rich-markers`),PT=new B({key:NT,state:{init:(e,t)=>FT(t),apply:(e,t,n,r)=>e.docChanged||e.selectionSet||e.storedMarksSet?FT(r):t},props:{decorations(e){return NT.getState(e)}}});function FT(e){let{doc:t,selection:n}=e,r=KC(e)?3:0,i=[];n.empty||t.nodesBetween(n.from,n.to,(e,t)=>!e.type.name.startsWith(`composer-`)||(i.push(Au.node(t,t+e.nodeSize,{class:`composer-chip-range-selected`})),!1));for(let e of wT(t))if(n.empty?n.from>=e.from&&n.from<=e.to:n.from<e.to&&n.to>e.from)for(let{at:t,side:a,text:o}of e.markers){let e=n.empty&&t===n.from?a+r:a,s=document.createElement(`span`);s.className=`composer-rich-marker`,s.textContent=o,s.setAttribute(`aria-hidden`,`true`),i.push(Au.widget(t,s,{side:e,key:`marker-${t}-${e}-${s.textContent}`}))}return U.create(t,i)}var IT=J.create({name:`composer-rich-markers`,addProseMirrorPlugins(){return[PT]}});function LT(e){let t=(0,M.c)(3),n=e.literalText?`literal`:e.richTextEnabled?`rich`:`plain`,r;return t[0]!==e||t[1]!==n?(r=(0,N.jsx)(zT,{...e},n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}var RT=J.create({name:`composer-undo-grouping`,addStorage(){return{previous:null}},dispatchTransaction({transaction:e,next:t}){this.storage.previous=sw(e,this.storage.previous),t(e)}});function zT(e){let{value:t,cursor:n,richTextEnabled:r,literalText:i=!1,contextRecords:a,buildContextClipboardFragment:o,importContextFragment:s,skills:c,disabled:u,placeholder:d,ariaLabel:f,suggestionListId:p,activeSuggestionId:m,isPathQueryActive:h,containerClassName:g,className:_,placeholderClassName:v,onChange:y,onVisibleSelectionChange:b,onCommandKeyDown:x,onPageScrollKeyDown:S,onPageScrollKeyUp:C,onPageScrollRelease:w,onCitationSubmitAndSend:T,onCitationDraftSave:ee,onPaste:te,editorRef:ne}=e,D=!i&&(r??!1),re=(0,j.useCallback)((e,t)=>i?Math.max(0,Math.min(e.length,Number.isFinite(t)?Math.floor(t):e.length)):Wt(e,t),[i]),O=(0,j.useCallback)((e,t)=>i?t:Gt(e,t),[i]),ie=(0,j.useRef)(y),se=(0,j.useRef)(b),ce=(0,j.useRef)(x),le=(0,j.useRef)(h),ue=(0,j.useRef)(o),de=(0,j.useRef)(s),fe=(0,j.useRef)(c),me=(0,j.useRef)(t),he=(0,j.useRef)(null);(0,j.useEffect)(()=>{ie.current=y},[y]),(0,j.useEffect)(()=>{se.current=b},[b]),(0,j.useEffect)(()=>{ce.current=x},[x]),(0,j.useEffect)(()=>{le.current=h},[h]),(0,j.useEffect)(()=>{ue.current=o},[o]),(0,j.useEffect)(()=>{de.current=s},[s]),(0,j.useEffect)(()=>{fe.current=c},[c]),(0,j.useLayoutEffect)(()=>{me.current=t},[t]);let ge=(0,j.useCallback)(e=>{let t=e.startsWith(`$`)?e.slice(1):e,n=fe.current.find(e=>e.name===t);if(!n)return{label:Ne({name:t}),description:null};let r=n.shortDescription?.trim();return{label:Ne(n),description:r||n.description?.trim()||null}},[]),_e=re(t,n),ve=O(t,_e),k=(0,j.useRef)({value:t,cursor:_e,expandedCursor:ve,contextIds:i?[]:oe(t)}),ye=(0,j.useRef)({start:ve,end:ve}),be=(0,j.useRef)(!1),xe=(0,j.useRef)(!1),Se=(0,j.useRef)(null),[Ce,we]=(0,j.useState)(null),Te=(0,j.useRef)(null),[Ee,De]=(0,j.useState)(t.length===0),Oe=(0,j.useMemo)(()=>({openComment:Ce,onOpenChange:(e,t)=>{!t&&Te.current?.key===e&&(Te.current=null),we(n=>t?n?.key===e?n:{key:e}:n?.key===e?null:n)},onDraftChange:(e,t)=>{Te.current={key:e,comment:t}},onSubmitAndSend:T??(()=>{})}),[T,Ce]),ke=(0,j.useCallback)(e=>{let t=LC(e.state.doc),n=i?[]:t.contextIds,{from:r,to:a}=e.state.selection,o=WC(t,r),s=WC(t,a),c=t.value,l=re(t.value,BC(t,o)),u=Math.max(0,Math.min(t.value.length,VC(t,o))),d={start:Math.min(u,VC(t,s)),end:Math.max(u,VC(t,s))},f=ye.current;ye.current=d,De(c.length===0);let p=k.current,m=!(p.value===c&&p.cursor===l&&p.expandedCursor===u&&p.contextIds.length===n.length&&p.contextIds.every((e,t)=>e===n[t]));if(be.current)return;if(!m){uT(f,d)&&se.current?.();return}if(p.value===c&&c!==me.current)return;k.current={value:c,cursor:l,expandedCursor:u,contextIds:n};let h=e.state.selection.$from.parent.type.spec.code===!0,g=i||h||qt(c,l,`left`)||qt(c,l,`right`);ie.current(c,l,u,g,n)},[re,i]),Ae=(0,j.useMemo)(()=>({class:pe(`composer-tiptap -m-1 block max-h-52 min-h-19.5 overflow-y-auto p-1 whitespace-pre-wrap wrap-break-word bg-transparent leading-relaxed text-foreground focus:outline-none`,_),"data-testid":`composer-editor`,"data-composer-rich-text":D?`true`:`false`,role:`textbox`,"aria-multiline":`true`,...f?{"aria-label":f}:{},...u?{"aria-readonly":`true`}:{},...!u&&p?{"aria-autocomplete":`list`,"aria-haspopup":`listbox`,...m?{"aria-controls":p,"aria-activedescendant":m}:{}}:{},"aria-placeholder":d}),[m,f,_,u,d,D,p]),A=Xg({extensions:[VS.configure({blockquote:!1,bulletList:!1,codeBlock:!1,heading:!1,horizontalRule:!1,listItem:!1,link:!1,orderedList:!1,underline:!1,dropcursor:!1,gapcursor:!1,trailingNode:!1,code:!1,listKeymap:!1,undoRedo:{newGroupDelay:iw},...D?{}:{bold:!1,italic:!1,strike:!1}}),RT,gT,vT,bT,ST,IT,...D?[JS,eC.extend({addNodeView(){return h_(tT,{stopEvent:({event:e})=>e.target instanceof Element&&e.target.closest(`.chat-markdown-codeblock-header`)!==null})},addInputRules(){return[]}}),sT({resolveTheme:()=>pt(document.documentElement.classList.contains(`dark`)?`dark`:`light`)}),...cC.map(e=>e.name===`blockquote`?e.extend({addInputRules(){return[kT]}}):e.name===`horizontalRule`?e.extend({addInputRules(){return[AT]}}):e.name===`heading`?e.extend({addInputRules(){return[jT]}}):e),...iC.map(e=>e.name===`listItem`?e:e.extend({addInputRules(){return this.name===`bulletList`?[TT(/^(?<marker>[*+])(?<space>\s)$/,`bulletList`),TT(/^(?<marker>-)(?<space>[ \t]+)(?<carried>[^\s[])$/,`bulletList`)]:[TT(/^(?<marker>\d+[.)])(?<space>\s)$/,`orderedList`)]}})),ZS,$S.extend({addInputRules(){return[DT(this.type),ET]}})]:[]],content:yC(t,e=>{let t=e.startsWith(`$`)?e.slice(1):e,n=c.find(e=>e.name===t);if(!n)return{label:Ne({name:t}),description:null};let r=n.shortDescription?.trim();return{label:Ne(n),description:r||n.description?.trim()||null}},{styling:D,literalText:i}),editable:!u,editorProps:{attributes:Ae,handleKeyDown:(e,t)=>{if(l(navigator.platform)&&(t.key===`Home`||t.key===`End`)&&!t.altKey&&!t.metaKey&&!t.ctrlKey&&!t.isComposing){let n=window.getSelection();if(n?.anchorNode&&e.dom.contains(n.anchorNode)&&typeof n.modify==`function`)return t.preventDefault(),t.stopPropagation(),n.modify(t.shiftKey?`extend`:`move`,t.key===`Home`?`backward`:`forward`,`lineboundary`),n.anchorNode&&n.focusNode&&e.dispatch(e.state.tr.setSelection(R.create(e.state.doc,e.posAtDOM(n.anchorNode,n.anchorOffset),e.posAtDOM(n.focusNode,n.focusOffset))).scrollIntoView()),!0}if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key)&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey&&!t.isComposing&&e.state.selection.empty){let{$from:n}=e.state.selection,r=t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:1,i=t.key===`ArrowLeft`||t.key===`ArrowRight`,a=n.pos===(r===-1?R.atStart(e.state.doc).from:R.atEnd(e.state.doc).to),o=i||a?qC(e.state,r):null;if(o)return t.preventDefault(),t.stopPropagation(),e.dispatch(o),!0;let s=r===-1?n.nodeBefore:n.nodeAfter;if(i&&s?.type.name.startsWith(`composer-`))return t.preventDefault(),t.stopPropagation(),e.dispatch(e.state.tr.setSelection(R.create(e.state.doc,n.pos+r*s.nodeSize)).scrollIntoView()),!0}if(t.key===`Tab`&&t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey&&e.state.selection.empty){let{$from:n}=e.state.selection,r=n.nodeBefore;if(r?.type.name===`composer-citation`){let i=e.nodeDOM(n.pos-r.nodeSize),a=i instanceof HTMLElement?i.querySelector(`[data-citation-comment-trigger]`):null;if(a)return t.preventDefault(),t.stopPropagation(),a.focus(),!0}}if(t.key===`Enter`&&(t.isComposing||t.keyCode===229))return t.stopPropagation(),!0;if(t.key===`Enter`&&t.target instanceof HTMLInputElement)return t.preventDefault(),!0;if(t.key===`Tab`&&!t.metaKey&&!t.ctrlKey&&ZC(e.state))return t.preventDefault(),t.stopPropagation(),nw(e.state,t.shiftKey?`out`:`in`,t=>e.dispatch(t));if(t.key===`Enter`&&D&&!t.metaKey&&!t.ctrlKey&&!t.isComposing){if(ZC(e.state)){t.preventDefault(),t.stopPropagation();let n=t=>e.dispatch(t.scrollIntoView());return tw(e.state,n)||ew(e)||$C(e.state,n)||So(e.state,n)}if(rw(e.state,t=>e.dispatch(t)))return t.preventDefault(),t.stopPropagation(),!0}let n=ce.current;if(t.key===`Enter`){let r=he.current,i=D&&(r?.isActive(`taskItem`)??!1),a=D&&(r?.isActive(`listItem`)??!1);return n?.(`Enter`,t,i||a)??!1?(t.preventDefault(),t.stopPropagation(),!0):(t.preventDefault(),(i||a)&&r&&DC(r)||D&&r&&OT(e.state.selection.$from,`blockquote`)&&e.state.selection.$from.parent.content.size===0&&r.commands.lift(`blockquote`)?!0:ko(e.state,t=>{e.dispatch(t.scrollIntoView())}))}if(!n)return!1;let r=n(t.key,t);return r&&(t.preventDefault(),t.stopPropagation()),r},handleTextInput:(e,t,n,r)=>{if(i||r.length!==1)return!1;let a=pT[r];if(!a||t===n)return!1;let o=!1;if(e.state.doc.nodesBetween(t,n,e=>e.isAtom&&e.isInline&&!e.isText||e.isText&&e.marks.length>0?(o=!0,!1):!0),o)return!1;let s=LC(e.state.doc),c=VC(s,WC(s,t)),l=VC(s,WC(s,n));if(Kt(s.value,c,l))return!1;let u=e.state.tr.insertText(a,n).insertText(r,t);return u.setSelection(R.create(u.doc,t+r.length,n+r.length)),e.dispatch(u),!0},handlePaste:(e,t)=>{let n=t.clipboardData;if(!n||n.files.length>0)return!1;let r=n.getData(`text/plain`);if(!r)return!1;if(t.preventDefault(),MT(e)){let{from:t,to:n}=e.state.selection;return e.dispatch(aw(e.state.tr.insertText(r,t,n),`paste`).scrollIntoView()),!0}let a=de.current,o=!i&&a?Bn(n,a):r,s=i?[]:Xt(`${o}\n`),c=s.at(-1);if((c?.type===`mention`||c?.type===`skill`)&&c.end===o.length&&(o+=` `),(s[0]?.type===`mention`||s[0]?.type===`skill`)&&s[0].start===0){let t=LC(e.state.doc),n=VC(t,WC(t,e.state.selection.from));n>0&&!/\s/.test(t.value[n-1])&&(o=` ${o}`)}let{$from:l}=e.state.selection,u=l.parent.textBetween(0,l.parentOffset,void 0,``),d=i?0:$t(u,o,le.current?.()),f=he.current;if(f){let t=e.state.selection.$from,n=[`listItem`,`taskItem`,`blockquote`].some(e=>OT(t,e));BT(o,ge,{styling:D,blocks:!n,literalText:i,literalLength:d},e=>{f.chain().command(({tr:e})=>(aw(e,`paste`),!0)).insertContent(e).command(({tr:e})=>{let{selection:t}=e;return!(t instanceof z)||!t.node.isBlock||(e.doc.resolve(t.to).nodeAfter?.isTextblock||e.insert(t.to,e.doc.type.schema.nodes.paragraph.create()),e.setSelection(R.create(e.doc,t.to+1)),!0)}).run()}),VT(f)}return!0}},onUpdate:({editor:e})=>{ke(e)},onSelectionUpdate:({editor:e})=>{ke(e)}},[]);(0,j.useEffect)(()=>{A?.setEditable(!u)},[u,A]),(0,j.useEffect)(()=>{he.current=A},[A]),(0,j.useLayoutEffect)(()=>{A?.isInitialized&&A.view.setProps({attributes:Ae})},[A,Ae]);let je=(0,j.useCallback)(()=>{let e=k.current;if(!A)return e;let t=LC(A.state.doc),{from:n,to:r}=A.state.selection,a=WC(t,n),o={value:t.value,cursor:re(t.value,BC(t,a)),expandedCursor:Math.max(0,Math.min(t.value.length,VC(t,a))),contextIds:i?[]:t.contextIds},s=WC(t,r);return ye.current={start:Math.min(o.expandedCursor,VC(t,s)),end:Math.max(o.expandedCursor,VC(t,s))},k.current=o,o},[re,A,i]),Me=(0,j.useEffectEvent)((e,t)=>{let n=Te.current;if(Te.current=null,!n||!ee)return;let[r]=$f(e.state.doc,e=>e.type.name===`composer-citation`&&e.attrs.citeKey===n.key);if(!r)return;let{node:i,pos:a}=r,o=i.attrs.citation,s=Pe({reason:`none`,draft:n.comment,savedComment:o.comment});if(s.kind!==`commit`)return;let c=zt(o,s.comment);e.view.dispatch(e.state.tr.setNodeMarkup(a,void 0,{...i.attrs,citation:c,source:Vt(c)}).setMeta(`addToHistory`,!1)),ee(t,LC(e.state.doc).value)});(0,j.useLayoutEffect)(()=>{if(!A)return;let e=!xe.current;xe.current=!0;let r=re(t,n),a=k.current;if(!e&&a.value===t&&a.cursor===r)return;let o=O(t,r);k.current={value:t,cursor:r,expandedCursor:o,contextIds:oe(t)},ye.current={start:o,end:o},De(t.length===0);let s=A.view.dom,c=!!(s&&document.activeElement===s);if(!e&&a.value===t&&!c)return;be.current=!0;let l=Se.current?.value===t?Se.current:null;a.value!==t&&(Me(A,a.value),A.commands.setContent(yC(t,ge,{styling:D,literalText:i}),{emitUpdate:!1}));let u=LC(A.state.doc),d=HC(u,r);if(A.commands.setTextSelection(UC(u,d)),c&&VT(A),l){Se.current=null;let e=u.runs.find(e=>e.kind===`token`&&e.nodeName===`composer-citation`&&e.mdStart===l.citationStart);if(e){let t=A.state.doc.nodeAt(e.pmPos)?.attrs?.citeKey;t&&we({key:t,sourceAnchor:l.sourceAnchor,removeOnCancel:l.insertedSpaces})}}queueMicrotask(()=>{be.current=!1})},[re,n,A,O,i,D,ge,t]);let Fe=(0,j.useCallback)(e=>{if(!A||(A.view.focus(),k.current.value!==me.current))return;let t=re(k.current.value,e),n=LC(A.state.doc),r=HC(n,t);A.commands.setTextSelection(UC(n,r)),VT(A),t!==k.current.cursor&&(k.current={value:k.current.value,cursor:t,expandedCursor:O(k.current.value,t),contextIds:k.current.contextIds},ye.current={start:k.current.expandedCursor,end:k.current.expandedCursor},ie.current(k.current.value,t,k.current.expandedCursor,i,k.current.contextIds))},[re,A,O,i]);(0,j.useImperativeHandle)(ne,()=>({focus:()=>{Fe(k.current.cursor)},focusAt:Fe,focusAtEnd:()=>{Fe(i?k.current.value.length:Zt(k.current.value,k.current.value.length))},readSelectionRange:()=>(je(),ye.current),requestCitationComment:e=>{if(Se.current=e,!A)return;let t=LC(A.state.doc);if(t.value!==e.value)return;let n=t.runs.find(t=>t.kind===`token`&&t.nodeName===`composer-citation`&&t.mdStart===e.citationStart);if(!n)return;let r=A.state.doc.nodeAt(n.pmPos)?.attrs?.citeKey;r&&(Se.current=null,we({key:r,sourceAnchor:e.sourceAnchor,removeOnCancel:e.insertedSpaces}))},readSnapshot:je,isCaretOnVisualEdge:e=>{let t=je();if(t.value.length===0)return!0;let n=t.value.slice(0,t.expandedCursor),r=t.value.slice(t.expandedCursor);if(e===`start`?n.includes(`
|
|
202
202
|
`):r.includes(`
|
|
203
203
|
`))return!1;let i=A?.view.dom,a=window.getSelection();if(!i||!a||!a.isCollapsed||a.rangeCount===0||!a.anchorNode||!i.contains(a.anchorNode))return!1;let o=HT(a.getRangeAt(0),e);if(!o)return!1;let s=((e===`start`?i.firstElementChild:i.lastElementChild)??i).getBoundingClientRect(),c=o.height/2;return e===`start`?o.top-s.top<c:s.bottom-o.bottom<c}}),[A,Fe,i,je]);let Ie=(0,j.useCallback)((e,t)=>{let n=ue.current;if(!A||t&&!A.isEditable)return;let r=e.clipboardData,{from:a,to:o}=A.state.selection;if(a===o)return;let s=IC(A.state.doc,a,o),c=i?[]:Array.from(new Set(oe(s))),l=c.length>0?n?.(c):null;e.preventDefault(),r.setData(`text/plain`,s),l&&(r.setData(ae,l),r.setData(`text/html`,E(s,l))),t&&A.chain().focus().command(({tr:e})=>(aw(e,`cut`),!0)).deleteSelection().run()},[A,i]);return(0,N.jsx)(fT,{value:c,children:(0,N.jsx)(jw,{value:a,children:(0,N.jsx)(dT,{value:Oe,children:(0,N.jsxs)(`div`,{className:pe(`relative flow-root font-(family-name:--font-composer,var(--font-sans)) text-(length:--font-size-prompt,var(--text-sm)) max-sm:pointer-coarse:text-(length:--font-size-prompt-touch)`,g),children:[(0,N.jsx)(Ug,{editor:A,onKeyDown:e=>{if((e.key===`Control`||e.key===`Meta`||e.key===`Alt`||e.key===`Shift`)&&w?.(),e.key!==`PageUp`&&e.key!==`PageDown`)return;let t=e.currentTarget.querySelector(`[data-testid="composer-editor"]`);if(!t)return;let n=fw({altKey:e.altKey,clientHeight:t.clientHeight,ctrlKey:e.ctrlKey,defaultPrevented:e.defaultPrevented,isComposing:e.nativeEvent.isComposing,key:e.key,keyCode:e.keyCode,metaKey:e.metaKey,scrollHeight:t.scrollHeight,scrollTop:t.scrollTop,shiftKey:e.shiftKey});if(!n){w?.();return}S&&(e.preventDefault(),S(n))},onKeyUp:e=>C?.(e.key),onBlur:w,onPasteCapture:te,onCopyCapture:e=>Ie(e,!1),onCutCapture:e=>Ie(e,!0)}),Ee&&a.size===0&&d?(0,N.jsx)(`div`,{className:pe(`pointer-events-none absolute inset-0 leading-relaxed text-placeholder/75`,v),children:d}):null]})})})})}function BT(e,t,n,r){let i=vC(e,t,n);if(i.length===1&&i[0]?.type===`paragraph`){let e=i[0]?.content??[];if(e.length===0)return;r(e);return}r(i)}function VT(e){e.view.dispatch(e.state.tr.scrollIntoView())}function HT(e,t){let n=Array.from(e.getClientRects()).filter(e=>e.height>0),r=t===`start`?n.at(-1):n[0];if(r)return r;let i=e.startContainer;if(i.nodeType===3){let n=i;if(n.data.length===0)return null;let r=Math.max(0,Math.min(t===`start`?e.startOffset:e.startOffset-1,n.data.length-1)),a=document.createRange();a.setStart(n,r),a.setEnd(n,r+1);let o=Array.from(a.getClientRects()).find(e=>e.height>0);if(o)return o;let s=a.getBoundingClientRect();return s.height>0?s:null}if(!(i instanceof HTMLElement))return null;let a=i.childNodes[Math.max(0,e.startOffset-1)]??i.childNodes[e.startOffset];if(a instanceof HTMLElement){let e=a.getBoundingClientRect();if(e.height>0)return e}else if(a instanceof Text&&a.data.length>0){let t=a===i.childNodes[e.startOffset-1]?a.data.length-1:0,n=document.createRange();n.setStart(a,t),n.setEnd(a,t+1);let r=Array.from(n.getClientRects()).find(e=>e.height>0);if(r)return r}let o=i.getBoundingClientRect();return o.height>0?o:null}function UT(e){let t=(0,M.c)(2),n;return t[0]===e?n=t[1]:(n=(0,N.jsx)(LT,{...e}),t[0]=e,t[1]=n),n}export{sn as A,En as C,_n as D,gn as E,hn as O,Cn as S,On as T,Rn as _,Aw as a,wn as b,bw as c,Zn as d,Jn as f,zn as g,Bn as h,Mw as i,rn as j,ln as k,yw as l,Vn as m,Ow as n,Dw as o,Yn as p,kw as r,Sw as s,UT as t,Xn as u,In as v,kn as w,Tn as x,An as y};
|
|
204
|
-
//# sourceMappingURL=ComposerPromptEditor-
|
|
204
|
+
//# sourceMappingURL=ComposerPromptEditor-BkRvKIiZ.js.map
|