@p4code/cli 0.8.11 → 0.8.13
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-DY9l0jFs.mjs → binCli-B9aQxlIK.mjs} +1865 -1492
- package/dist/client/.vite/manifest.json +2144 -2145
- package/dist/client/assets/AlertDialogRoot-DvQNG7Nt.js +2 -0
- package/dist/client/assets/{AnimatedHeight-D-OJUoBJ.js → AnimatedHeight-CH-N3JTc.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-B_P0_qZ6.js → AuthSurfaceShell-CJdXkxyH.js} +2 -2
- package/dist/client/assets/{CSPContext-D8hlJ4eS.js → CSPContext-4VAD2_gc.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-fMcoYEDa.js → ChatGptUsageButton-7u9uPgbK.js} +2 -2
- package/dist/client/assets/ChatMarkdown-C22JFyYa.js +65 -0
- package/dist/client/assets/CheckboxIndicator-ClY0P0ol.js +2 -0
- package/dist/client/assets/CodexSetupSection.logic-CEAT7YdZ.js +2 -0
- package/dist/client/assets/{CollapsiblePanel-kfl4yLKn.js → CollapsiblePanel-Cubscn-a.js} +2 -2
- package/dist/client/assets/ComboboxClear-qTthzuJh.js +2 -0
- package/dist/client/assets/{CommandBlock-BI3ZCXsB.js → CommandBlock-CWt29kmi.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-BkRvKIiZ.js → ComposerPromptEditor-Bt_L4smq.js} +44 -44
- package/dist/client/assets/{CompositeRoot-B9Xvst63.js → CompositeRoot-DUqf78yV.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-DtKQQSMi.js → ConnectionStatusDot-cdpNRZhA.js} +2 -2
- package/dist/client/assets/{DevicePanel-B_jOvmeL.js → DevicePanel-CZm-f5TC.js} +2 -2
- package/dist/client/assets/{DeviceSetup-BXjqCO_9.js → DeviceSetup-BdrkGme6.js} +2 -2
- package/dist/client/assets/{DialogTitle-BzKEBo4W.js → DialogTitle-CQU6s1Wy.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-D_1Iw0oL.js → DiffCommentAnnotation-B-XoYYxb.js} +2 -2
- package/dist/client/assets/{DiffFileTree-D6386u9x.js → DiffFileTree-CwTkSU3R.js} +2 -2
- package/dist/client/assets/DiffPanel-BCI9XXpF.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-Cw5WeG1t.js → DiffWorkerPoolProvider-OPZsOibX.js} +3 -3
- package/dist/client/assets/{EmbeddedDesign-Drkomo9K.js → EmbeddedDesign-DwRAPHYl.js} +4 -4
- package/dist/client/assets/{EnvironmentMachineIcon-COX4G5YJ.js → EnvironmentMachineIcon-DCdlTSYU.js} +2 -2
- package/dist/client/assets/{ExpandableText-BHihVj6x.js → ExpandableText-BtdwzlFy.js} +3 -3
- package/dist/client/assets/{FieldControl-CIaYJhnp.js → FieldControl-BI2gK4Z0.js} +2 -2
- package/dist/client/assets/{FileDiff-FK4mtyx3.js → FileDiff-BkJG5QAe.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-ncsuf7iX.js → FilePreviewPanel-CURtQAD1.js} +4 -4
- package/dist/client/assets/{FoldedSettingsSection-CRlh3-BO.js → FoldedSettingsSection-B9B8i8Gg.js} +2 -2
- package/dist/client/assets/{FormContext-DTtr4Y3v.js → FormContext-Bgwez2tv.js} +2 -2
- package/dist/client/assets/{Icons-BFyKltvl.js → Icons-B5JVkp3z.js} +2 -2
- package/dist/client/assets/Input-BQRZG5rU.js +2 -0
- package/dist/client/assets/{KeybindingsSettings.logic-_oQM9Dzv.js → KeybindingsSettings.logic-6lVDnd1N.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-8d3l2unf.js → NoProjectsHero-CkhVaJk9.js} +2 -2
- package/dist/client/assets/PanelLayoutControls-CxuV0JO3.js +216 -0
- package/dist/client/assets/{PierreEntryIcon-DtlkLdir.js → PierreEntryIcon-CPG-jnaN.js} +2 -2
- package/dist/client/assets/PopoverHandle-CBT8hFut.js +2 -0
- package/dist/client/assets/PreviewPanel-Doh1peEu.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-DfhAk0_Y.js +2 -0
- package/dist/client/assets/{ProjectFavicon-YdOZ4g5-.js → ProjectFavicon-DUW6Bo66.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-C23nnU1a.js → ProjectIconPickerDialog-C613hnVY.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-BMGWdmjv.js → ProjectMonogram-B9iJhcVp.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-YztsMr2F.js → ProviderAuthTerminal-eq346NX_.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-S_tiGeLH.js → ProviderModelPicker-DPb-88ui.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-C3nbCFfS.js → ProviderSettingsForm-DTYqzs8W.js} +2 -2
- package/dist/client/assets/PullRequestCodeTab-BBz0FfLD.js +6 -0
- package/dist/client/assets/{ReadOnlySourcePreview-BNe8pyVf.js → ReadOnlySourcePreview-CkeeLVAm.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-DEgVmtJL.js → RenderErrorBoundary-mfAvIiFU.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-CISo4C7r.js → ScheduledTasksSettings-BMUE9M9Z.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-eWB5GlaA.js → ScopedSwitch-BKOdsllO.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-SeZ1sx-t.js → ScrollAreaCorner-CoeXGFSL.js} +2 -2
- package/dist/client/assets/{SecretInput-D0DyMDSw.js → SecretInput-CROqj1gF.js} +2 -2
- package/dist/client/assets/SelectScrollUpArrow-SDOpV3nj.js +2 -0
- package/dist/client/assets/{SettingsPanels-DA7lXl0N.js → SettingsPanels-BHhMJaVc.js} +6 -6
- package/dist/client/assets/{SettingsPanels.logic-lCZaJhKM.js → SettingsPanels.logic-BwmY39Sq.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-BAtVWG0d.js → SettingsScopeNotice-DAPsshab.js} +2 -2
- package/dist/client/assets/{T3ConnectAccountPages-nabxuL18.js → T3ConnectAccountPages-CDuVbE2z.js} +2 -2
- package/dist/client/assets/{T3ConnectSidebarSignIn-CSVR5Zot.js → T3ConnectSidebarSignIn-BSQHp-Xq.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BMtL4rIt.js → ThemeEditorPanel-BiuI7Uiy.js} +3 -3
- package/dist/client/assets/ThreadTerminalDrawer-B8n6TAqv.js +5 -0
- package/dist/client/assets/TooltipViewport-BKD6QABG.js +2 -0
- package/dist/client/assets/{Virtualizer-Bi8p4Z6E.js → Virtualizer-CTnacEby.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-B0Ap9wKu.js → WorkspaceBreadcrumb-BmVcurpi.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-COKQZB3N.js → WorkspacePageContainer-BSjVd7h4.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-BDzzcsWQ.js → WorkspacePageHeader-BLYOcS9Z.js} +2 -2
- package/dist/client/assets/_chat-z348gvgF.js +45 -0
- package/dist/client/assets/{_chat.index-k4jctzPr.js → _chat.index-CBbUzaK7.js} +2 -2
- package/dist/client/assets/{_chat.new-BlFtqZqt.js → _chat.new-7TTfcDf1.js} +2 -2
- package/dist/client/assets/_chat.pull-requests-BE7Q2lUu.js +2 -0
- package/dist/client/assets/{abnfDiagram-VCTEODGH-BVKlsgtX.js → abnfDiagram-VCTEODGH-HaXM7twL.js} +2 -2
- package/dist/client/assets/{alert-B2wk0CaO.js → alert-5swcxUBm.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-CiMEl2LX.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-zBJWGViu.js → architectureDiagram-5GKGNRK7-BhWXFsXS.js} +2 -2
- package/dist/client/assets/assets-DXnV2oRj.js +2 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-BdiAAtHi.js → blockDiagram-I7D4REHJ-D213N9iF.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-CqGVWa5a.js → browserHistoryStore-DURO3U2L.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-CINrbcxi.js → browserLinkTarget-DcGx3A8F.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-CqnmSo8f.js → c4Diagram-7LVT6UL2-58POuQV-.js} +2 -2
- package/dist/client/assets/channel-CDbYAV2D.js +2 -0
- package/dist/client/assets/{checkbox-DU_a7ZnJ.js → checkbox-1tz9neVf.js} +2 -2
- package/dist/client/assets/{chunk-4HAMMTFA-BpyojyCk.js → chunk-4HAMMTFA-Bcwcw8Wz.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-LBmwoUvq.js → chunk-75Z2AOVW-BaYdZ0Fq.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-zhv2Vnfx.js → chunk-DU6HZSFF-B6TRgw4-.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-K5uPeDhv.js → chunk-F27PBJKO-B5arSwg6.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-CAAu3Cn5.js → chunk-GMAD6QVW-XeNCd3gb.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-Br_UAx49.js → chunk-GVQU2GXP-CWVbbWh7.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-Kqfxrrdn.js → chunk-IMKFNOWR-Cb-yxIAE.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-D1cWO7rm.js → chunk-L3NEJ4N5-Di7nZhzu.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-BiMJbcHf.js → chunk-OSK3NFVY-DcqBXKUK.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-BuGzzo3g.js → chunk-P2QGCYS3-DJ1kMiTY.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-C_w0mNLk.js → chunk-POPQ4Y6H-Ba9RYr-b.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-CJFd7LKC.js → chunk-PWAF6VOD-D4Ch07S8.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-Beev3ZeU.js → chunk-SHT3W25Y-BafMUZgc.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-BqpBEmtK.js → chunk-SVP7TREG-CsEVe0s3.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-B0vIU1Au.js → chunk-TICWLB2K-D3tgdZlp.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-Cdtwlmxc.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cdtwlmxc.js +2 -0
- package/dist/client/assets/{color-picker-CYOS1hwQ.js → color-picker-N6f_Hu7P.js} +2 -2
- package/dist/client/assets/{combobox-CZradSHe.js → combobox-B07cVaQY.js} +2 -2
- package/dist/client/assets/{command-BB0IyhBc.js → command-B70eQIps.js} +2 -2
- package/dist/client/assets/{connect-DGwXUKTk.js → connect-Vt7wlrih.js} +2 -2
- package/dist/client/assets/{connect-agent-DFwOzcLG.js → connect-agent-CX70rAkF.js} +2 -2
- package/dist/client/assets/{cynefin-OW5HDTMX-BjcFswd0.js → cynefin-OW5HDTMX-CU8HnD4F.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BDWLg5Tt.js → cynefinDiagram-5FMLGOSQ-Cvc6_oYZ.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-DZpVjkDw.js → dagre-GXQ25YYZ-Bx5buWLS.js} +2 -2
- package/dist/client/assets/device-BgvBRE7C.js +2 -0
- package/dist/client/assets/{diagram-S7CK7UJ4-BpVs-kYJ.js → diagram-S7CK7UJ4-CPZrAy0P.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-EN7yKI08.js → diagram-UQ7AKVKN-kBtSnHpL.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-B2oljv94.js → diagram-VSXAHHWV-DQP2q1tS.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-BIl0lJ6d.js → diagram-VX7I27RA-DRUN0yEk.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-B8uoK-O5.js → diagram-Z3DM3KII-D4WMsQZZ.js} +2 -2
- package/dist/client/assets/{dialog-x5a5g_fa.js → dialog-DmneyTGi.js} +2 -2
- package/dist/client/assets/{diffRendering-DeZLcalP.js → diffRendering-iR2meoVj.js} +2 -2
- package/dist/client/assets/{discovery-list-Bn1UyUNL.js → discovery-list-ZGkddsst.js} +2 -2
- package/dist/client/assets/{dist-Bd1WIVAz.js → dist-vr51zfzA.js} +3 -3
- package/dist/client/assets/{draft-input-CwXvLRjL.js → draft-input-DHZ1J7B_.js} +2 -2
- package/dist/client/assets/{duoViewer-BZ7rNqkx.js → duoViewer-DTVry3xd.js} +2 -2
- package/dist/client/assets/{dynamic-BMz3CcWG.js → dynamic-CuoX2JEO.js} +2 -2
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-BQcQotuk.js → ebnfDiagram-PWID7BFC-BNUtunQw.js} +2 -2
- package/dist/client/assets/{embeddedScripts-Cek5ppgQ.js → embeddedScripts-BMvBWRz_.js} +2 -2
- package/dist/client/assets/{empty-C-FrtXzi.js → empty-hFNkAHps.js} +2 -2
- package/dist/client/assets/entities-7B8nzlQw.js +2 -0
- package/dist/client/assets/{environments-Dm2_6Uan.js → environments-DYIXXf7q.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-Y5XhNz9b.js → erDiagram-RLTQ6QDP-DHjjowZq.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-DNKqiuCf.js +1 -0
- package/dist/client/assets/{fileLinks-1xYacDKI.js → fileLinks-BYi-XNUG.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-B24BhRqA.js → fileTreeExpansion-DIOxQqDo.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-CbOoDtR7.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DqWb0OUJ.js → ganttDiagram-EL5Y4UJY-DEPOqoj0.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-CCYVAWRm.js → getDiffFileInput-DMj15wpy.js} +2 -2
- package/dist/client/assets/{gitGraph-4MIJSDKK-5lcY1dZk.js → gitGraph-4MIJSDKK-BGKW_zhb.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BJKz_rGI.js → gitGraphDiagram-WWUBYQGX-7UhsI5zi.js} +2 -2
- package/dist/client/assets/{guideRunStore-BhlldU3q.js → guideRunStore-BEkwZ9H7.js} +2 -2
- package/dist/client/assets/{htmlRender-Egw4Y-80.js → htmlRender-BxVc1PlI.js} +2 -2
- package/dist/client/assets/{index-Dc7GC03y.js → index-C_MVyH59.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-BWnMlmF7.js → info-A6RAGUB7-jvyzx_4e.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-DKW68xDy.js → infoDiagram-27XIBGKW-lTTpu3as.js} +2 -2
- package/dist/client/assets/{input-DhWmPSxf.js → input-RqvQJ9gh.js} +2 -2
- package/dist/client/assets/{input-group-D4qHaxH8.js → input-group-BFtrsedw.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-dRMCvDN0.js → ishikawaDiagram-5VMMS53U-DlrQNGG9.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-CAxCpgF5.js → journeyDiagram-3NMN7TZE-Buy9e-fU.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-BaSkJW47.js → kanban-definition-UXKFOSKX-1KgAXH0g.js} +2 -2
- package/dist/client/assets/{kbd-I5TavBvc.js → kbd-BnsXAHsc.js} +2 -2
- package/dist/client/assets/{keybindings-B3kvDAJC.js → keybindings-BtHOXkP-.js} +2 -2
- package/dist/client/assets/{lazyRouteComponent-ZmKiS4iU.js → lazyRouteComponent-T0YE6Rn9.js} +2 -2
- package/dist/client/assets/{line-B59oA22i.js → line-DUV1hs6X.js} +2 -2
- package/dist/client/assets/{link-DQB3a7WC.js → link-gKYnbTYT.js} +2 -2
- package/dist/client/assets/{linkedPrompt-Cqfqh2Aq.js → linkedPrompt-Da8rJho3.js} +2 -2
- package/dist/client/assets/main-Bh6Hj0_-.js +30 -0
- package/dist/client/assets/{main-Ch-SjebX.css → main-CoSpTpWL.css} +1 -1
- package/dist/client/assets/{mediaReference-DRC-8GdL.js → mediaReference-CLlAiRVc.js} +2 -2
- package/dist/client/assets/{mediaSource-DWSwwPfV.js → mediaSource-BTCWn94E.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-DcamukpZ.js → mermaid-parser.core-CsBuWV4-.js} +4 -4
- package/dist/client/assets/{mermaid.core-C6GXL70P.js → mermaid.core-BcICv5EB.js} +5 -5
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-CEVz3xGI.js → mindmap-definition-YA3MSWOX-BqCqe4io.js} +2 -2
- package/dist/client/assets/number-field-DIYUxout.js +2 -0
- package/dist/client/assets/{observeResize-Cpph8C0G.js → observeResize-D9ECzP-D.js} +2 -2
- package/dist/client/assets/{onboarding-CLIRA2Sa.js → onboarding-COQ6KgRG.js} +2 -2
- package/dist/client/assets/{openFileInPreview-uS9Qgrru.js → openFileInPreview-BhRAqg63.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-CIYnqKbl.js → p4ProjectFile-z5Hlq99W.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-B9XAEihD.js → packet-AYTQ26CC-BYCaPqFA.js} +1 -1
- package/dist/client/assets/{pair-DTfs9_4K.js → pair-BDKjGij-.js} +2 -2
- package/dist/client/assets/{pegDiagram-XKGWAZYB-tcLsMhrs.js → pegDiagram-XKGWAZYB-CqCw5Z-L.js} +2 -2
- package/dist/client/assets/{phoneViewer-wYjPQP4U.js → phoneViewer-DLSM0QXE.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-B3ig0TFp.js → pie-WAS4IAKB-BfOlqQx1.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-uaJgfQOp.js → pieDiagram-E7YTZNPT-DZpCrUQF.js} +2 -2
- package/dist/client/assets/{pierre-icons-Dav7jMBk.js → pierre-icons-BG7vd34x.js} +2 -2
- package/dist/client/assets/{popover-Bc0WvoPP.js → popover-DE9WCm99.js} +2 -2
- package/dist/client/assets/{preview-IWIgXHdy.js → preview-Cl-7ojv-.js} +2 -2
- package/dist/client/assets/{preview-C4lGbDhm.js → preview-bd-MGMMz.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-CTOOyQLc.js → previewMiniPlayerStore-Bz1T9oVV.js} +2 -2
- package/dist/client/assets/primary-BwHoAoya.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-DtOYGRkF.js +2 -0
- package/dist/client/assets/projectFilesQueryState-BP_JvI7-.js +2 -0
- package/dist/client/assets/projectScriptEditor-BGLshibY.js +2 -0
- package/dist/client/assets/{providerSkills-C7CtJefh.js → providerSkills-DxYtwoxJ.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-DGX-Sd8d.js → pullRequestDetail.logic-C_aVDAY_.js} +4 -4
- package/dist/client/assets/{pullRequestIcons-BaQbmCBu.js → pullRequestIcons-D5Yo5Zsn.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-wpVYihKr.js → pullRequestReviewStore-DaEzt1m1.js} +2 -2
- package/dist/client/assets/{pullRequests-BbD7hNlR.js → pullRequests-D0no1PZS.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-BOFUpnyi.js → quadrantDiagram-AXDQQJYC-BTtuOXlL.js} +2 -2
- package/dist/client/assets/queries-DkmaXOL-.js +2 -0
- package/dist/client/assets/query-Bd5_Y_Vy.js +2 -0
- package/dist/client/assets/{radar-RG4KPBEZ--djmIj49.js → radar-RG4KPBEZ-BiJgnIUY.js} +1 -1
- package/dist/client/assets/radio-group-CBunNtTU.js +2 -0
- package/dist/client/assets/{railroad-74A4TZTK-DMMw049f.js → railroad-74A4TZTK-C0CA0mcr.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BtC_0p6z.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-IeTBC6cs.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-DLoLKYq3.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-Df9rhhFk.js → railroadDiagram-O6MQD6OU-WczOSoF4.js} +2 -2
- package/dist/client/assets/{renderScheduler-b0pOdWwc.js → renderScheduler-BLjFSKnt.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-BtGYMd7U.js → requirementDiagram-BXWQKSXE-B3qCIQP5.js} +2 -2
- package/dist/client/assets/{rightPanelStore-37-59X44.js → rightPanelStore-6-YhsfkE.js} +2 -2
- package/dist/client/assets/runtime-Bni_zt6P.js +2 -0
- package/dist/client/assets/runtime-D8mKjOP-.js +6 -0
- package/dist/client/assets/{runtimeModeConfig-DF8wod3s.js → runtimeModeConfig-C3q8YqVA.js} +2 -2
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-D7_y-s_u.js → sankeyDiagram-P5KCCOFB-e2-j7ERe.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-CvvQA-b7.js → scheduledTasksSettings.logic-BNC897-_.js} +3 -3
- package/dist/client/assets/{scroll-area-BDT5qfX2.js → scroll-area-Davaj52_.js} +2 -2
- package/dist/client/assets/{select-BQxcmO_1.js → select-B47XfaxQ.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-AuXrX-b5.js → sequenceDiagram-WJ2MYXX4-DG7-8UJk.js} +2 -2
- package/dist/client/assets/server-CaLEm3Wt.js +2 -0
- package/dist/client/assets/{session-Bc1P10r_.js → session-2CRBJwS7.js} +2 -2
- package/dist/client/assets/{session-logic-BNtU33qU.js → session-logic-BLOBsHEA.js} +4 -4
- package/dist/client/assets/{settings-CZSrxmjf.js → settings-BIwaDm1N.js} +2 -2
- package/dist/client/assets/settings.appearance-ToUM8fHh.js +2 -0
- package/dist/client/assets/settings.archived-Cq_qclay.js +2 -0
- package/dist/client/assets/{settings.computer-use-BAzpb53_.js → settings.computer-use-BEghs16L.js} +2 -2
- package/dist/client/assets/settings.connections-C_LVk0gJ.js +2 -0
- package/dist/client/assets/{settings.data-controls-DIkcwUy1.js → settings.data-controls-BaTil8NB.js} +2 -2
- package/dist/client/assets/{settings.decisions-BN9ozN_A.js → settings.decisions-JTbMt08J.js} +2 -2
- package/dist/client/assets/settings.diagnostics-ByG62ZGs.js +2 -0
- package/dist/client/assets/settings.general-BT78z_Cn.js +2 -0
- package/dist/client/assets/{settings.integrations-CT3opViE.js → settings.integrations-C3jj2T1d.js} +2 -2
- package/dist/client/assets/{settings.keybindings-BBTkicWk.js → settings.keybindings-CeqZWQEi.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-C_hoYTwe.js → settings.open-source-licenses-BAFwkfI8.js} +2 -2
- package/dist/client/assets/settings.plugins-D5l1ZPSB.js +5 -0
- package/dist/client/assets/settings.projects-Cqx1zAvs.js +4 -0
- package/dist/client/assets/settings.providers-CS55UrI1.js +3 -0
- package/dist/client/assets/settings.scheduled-tasks-CFJTEOb1.js +2 -0
- package/dist/client/assets/{settings.snap-shot-D-zJVnjT.js → settings.snap-shot-E3AITJyC.js} +2 -2
- package/dist/client/assets/{settings.source-control-DIU1xRUy.js → settings.source-control-CWWy9E3b.js} +2 -2
- package/dist/client/assets/{settings.storage-DRxTKEjG.js → settings.storage-BnUI1rFT.js} +2 -2
- package/dist/client/assets/{settingsLayout-Cbpy7Mfz.js → settingsLayout-DHc6oKfL.js} +3 -3
- package/dist/client/assets/{sidebar-D5nBG54l.js → sidebar-BkujXU9U.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DXnDcqLY.js → sidebarProjectGrouping-DD4nu9RX.js} +2 -2
- package/dist/client/assets/{skeleton-oZHFXSZp.js → skeleton-C6_D5JUu.js} +2 -2
- package/dist/client/assets/{sortable.esm-Boen_E7K.js → sortable.esm-BAEGChD3.js} +2 -2
- package/dist/client/assets/{sourceControl-DE9QO1yg.js → sourceControl-BAghu6LN.js} +2 -2
- package/dist/client/assets/{spinner-Bnjv_L8F.js → spinner-CpLstN6u.js} +2 -2
- package/dist/client/assets/{standalone-page-Davc_MrS.js → standalone-page-7vaVYOp-.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-EwB2WAAm.js → stateDiagram-D77RDMKH-CpZF58eW.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DewOo-MV.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-RngRFsjR.js → swimlanes-42K2YHIH-D1b49puG.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-d9EGwk-5.js +9 -0
- package/dist/client/assets/{terminal-links-BT70vIBN.js → terminal-links-CjmSI9gV.js} +2 -2
- package/dist/client/assets/{terminalSessions-Cj-MqjH8.js → terminalSessions-Q2t1JYPS.js} +2 -2
- package/dist/client/assets/{textarea-B8WPFAr0.js → textarea-DKdxwZZC.js} +2 -2
- package/dist/client/assets/{themePalette-CdoksNDx.js → themePalette-7p_LOU3J.js} +3 -3
- package/dist/client/assets/{threadSort-DD61dseb.js → threadSort-C5oCCRfj.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-BfIggpP3.js → timeline-definition-24CTP7MA-89AJY6KO.js} +2 -2
- package/dist/client/assets/toast-DhMYg_gN.js +2 -0
- package/dist/client/assets/{toggle-DLuCM2ny.js → toggle-BshAsXT6.js} +2 -2
- package/dist/client/assets/{toggle-group-RZD18_sD.js → toggle-group-ZNzhUvHt.js} +2 -2
- package/dist/client/assets/tooltip-Cq9yz15d.js +2 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-BjKaOr9u.js → treeView-Q6P3EWNA-CqNF2YcW.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-ffFPsmk1.js → treemap-WGGIJYW6-LJa3ZEYA.js} +1 -1
- package/dist/client/assets/usage-CJVyABbK.js +2 -0
- package/dist/client/assets/{usageAccess-CGcVLBtI.js → usageAccess-CieOJbVm.js} +2 -2
- package/dist/client/assets/{usageFormat-B-HlJYM5.js → usageFormat-BEGhDYfU.js} +2 -2
- package/dist/client/assets/{usageShortcuts-CUsmDt-0.js → usageShortcuts-DxuByyhD.js} +2 -2
- package/dist/client/assets/{use-atom-command-Dz_yqN35.js → use-atom-command-x4GQBtio.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-DZIzyiAY.js → useAriaLabelledBy-u5efXUxw.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-DjevdE0U.js → useHandleNewThread-CReGBX6y.js} +2 -2
- package/dist/client/assets/{useLocation-UcmQE5FC.js → useLocation-B3ir4ben.js} +2 -2
- package/dist/client/assets/useNavigate-DRqH9NhA.js +2 -0
- package/dist/client/assets/{useNavigateBack-B0y76gBs.js → useNavigateBack-XQd0WINI.js} +2 -2
- package/dist/client/assets/{useParams-DdYFF9g9.js → useParams-Cil-ZIwd.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-C01enB4u.js → usePermissionStatus-C4aMrLLP.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-BKpChcp1.js → usePullRequestActions-BL4mjngC.js} +3 -3
- package/dist/client/assets/{useRegisterFieldControl-Bmw-33lq.js → useRegisterFieldControl-75QESVfk.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-mUid6EfJ.js → useScopedModelAvailability-CBOIiaXC.js} +2 -2
- package/dist/client/assets/useSettings-Dx076NWT.js +3 -0
- package/dist/client/assets/{useT3ConnectAuthPrompt-C7Dm8xCm.js → useT3ConnectAuthPrompt-1zTdZLsH.js} +2 -2
- package/dist/client/assets/utils-BEVyjoxo.js +37 -0
- package/dist/client/assets/vcsRefInvalidation-46AnO9mr.js +2 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-Bw5_1h9Y.js → vennDiagram-4TSXK5OY-CvvE7gMp.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-BzzHb86M.js → wardley-WFR3VGLG-Ca8Qzkpo.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-RCSx0hV5.js → wardleyDiagram-VM6X3IG4-BBSNgSMI.js} +2 -2
- package/dist/client/assets/{welcome-RXSMyzlx.js → welcome-B3wsq5wK.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CcISZM46.js → xychartDiagram-S5SC5T6Z-D8OhWe48.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-C4obs87z.mjs → renderer-C4CdFj__.mjs} +2 -2
- package/dist/{runtime-2Dbe0RYi.mjs → runtime-CCVFqL3Y.mjs} +78 -4
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-Bb5-VhZe.js +0 -2
- package/dist/client/assets/ChatMarkdown-B7b91JUl.js +0 -65
- package/dist/client/assets/CheckboxIndicator-BzFOZwIv.js +0 -2
- package/dist/client/assets/CodexSetupSection.logic-CeUTTu-x.js +0 -2
- package/dist/client/assets/ComboboxClear-Di7TLMMS.js +0 -2
- package/dist/client/assets/DiffPanel-D6VVj6BF.js +0 -2
- package/dist/client/assets/Input-DoZ73vNO.js +0 -2
- package/dist/client/assets/PanelLayoutControls-3fTyX_SN.js +0 -216
- package/dist/client/assets/PopoverHandle-D2swQJBt.js +0 -2
- package/dist/client/assets/PreviewPanel-Ca3_DPh_.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-B--7QlKN.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-BdP3_tNe.js +0 -6
- package/dist/client/assets/SelectScrollUpArrow-CAd5YEsi.js +0 -2
- package/dist/client/assets/ThreadTerminalDrawer-CLfVfvoq.js +0 -5
- package/dist/client/assets/TooltipViewport-Wc_QpRGI.js +0 -2
- package/dist/client/assets/_chat-D-Gcj0-9.js +0 -45
- package/dist/client/assets/_chat.pull-requests-DrLHGpqx.js +0 -2
- package/dist/client/assets/architecture-7GRP2DOG-BNBr3Sao.js +0 -1
- package/dist/client/assets/assets-BhchpDuq.js +0 -2
- package/dist/client/assets/channel-CfHDq-fp.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-Cm99q1tS.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cm99q1tS.js +0 -2
- package/dist/client/assets/device-BEgZIK7u.js +0 -2
- package/dist/client/assets/entities-DPIZFvN7.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-B7plRWX7.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-BEpQPBfI.js +0 -1
- package/dist/client/assets/main-CxOeqlhD.js +0 -30
- package/dist/client/assets/number-field-N4gbrhyd.js +0 -2
- package/dist/client/assets/primary-CRkgnOCY.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-B_VNTJYL.js +0 -2
- package/dist/client/assets/projectFilesQueryState-U08pztRu.js +0 -2
- package/dist/client/assets/projectScriptEditor-D8mxKLOb.js +0 -2
- package/dist/client/assets/queries-BVPZtaQA.js +0 -2
- package/dist/client/assets/query-CpOQgkic.js +0 -2
- package/dist/client/assets/radio-group-CfHe3q1m.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BJdCwb3O.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-a9vhoAEG.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-Cyo-vXW_.js +0 -1
- package/dist/client/assets/runtime-Bc4kgQim.js +0 -2
- package/dist/client/assets/runtime-DZfpb67Q.js +0 -6
- package/dist/client/assets/server-LJ0-FVGH.js +0 -2
- package/dist/client/assets/settings.appearance-B_LipS5_.js +0 -2
- package/dist/client/assets/settings.archived-B_h3CK_T.js +0 -2
- package/dist/client/assets/settings.connections-Bv37N8Tm.js +0 -2
- package/dist/client/assets/settings.diagnostics-DuoGRNGf.js +0 -2
- package/dist/client/assets/settings.general-B-Bt2-nG.js +0 -2
- package/dist/client/assets/settings.plugins-DafKnC5Q.js +0 -5
- package/dist/client/assets/settings.projects-r2ZcxKud.js +0 -4
- package/dist/client/assets/settings.providers-jbZijXPV.js +0 -3
- package/dist/client/assets/settings.scheduled-tasks-C0d4wkYE.js +0 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CcnJHQ4a.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CrkPrysy.js +0 -9
- package/dist/client/assets/toast-DYfY2t_z.js +0 -2
- package/dist/client/assets/tooltip-924Ikq0L.js +0 -2
- package/dist/client/assets/usage-CRK5JZJm.js +0 -2
- package/dist/client/assets/useNavigate-Dvl9uiuL.js +0 -2
- package/dist/client/assets/useSettings-DCI8Hv09.js +0 -3
- package/dist/client/assets/utils-CRwA5SKO.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-3pHpDJC2.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,Aw as r,Bm as i,Cf as a,Cs as o,D as s,Es as c,Gn as l,Go as u,Ku as d,NE as f,Qn as p,Ts as m,Yn as h,Zn as g,ff as _,j as v,lE as y,m_ as b,or as x,qn as S,sr as C,t as w,tr as T,un as E,vd as D,xy as O,y_ as k}from"./utils-BEVyjoxo.js";import{L as A,R as ee,W as te}from"./runtime-D8mKjOP-.js";import{s as ne}from"./vcsRefInvalidation-46AnO9mr.js";import{W as re}from"./entities-7B8nzlQw.js";import{En as ie,d as ae,f as oe,gn as se,u as ce,yn as j}from"./runtime-Bni_zt6P.js";import{$ as M,et as N,n as le,ot as ue}from"./ChatMarkdown-C22JFyYa.js";import{t as P}from"./spinner-CpLstN6u.js";import{i as de,m as F}from"./toast-DhMYg_gN.js";import{a as I,c as fe,m as pe,n as L,p as me,t as R,v as he,x as ge,z as _e}from"./tooltip-Cq9yz15d.js";import{n as ve,s as ye}from"./environments-DYIXXf7q.js";import{i as be,n as xe}from"./session-2CRBJwS7.js";import{t as Se}from"./use-atom-command-x4GQBtio.js";import{a as Ce}from"./fileLinks-BYi-XNUG.js";import{u as we}from"./providerSkills-DxYtwoxJ.js";import{I as Te,R as Ee,s as De,v as Oe}from"./useSettings-Dx076NWT.js";import{n as ke}from"./toastHelpers-Dsph6LwL.js";import{o as Ae}from"./queries-DkmaXOL-.js";import{H as z,V as je,l as Me,ot as Ne,st as B}from"./diffRendering-iR2meoVj.js";import{A as Pe,B as Fe,G as Ie,K as V,T as Le,a as Re,j as H,l as ze,t as Be}from"./Virtualizer-CTnacEby.js";import{B as Ve,G as He,H as Ue,J as We,K as Ge,Q as Ke,U as qe,V as Je,W as Ye,q as Xe}from"./getDiffFileInput-DMj15wpy.js";import{c as Ze,i as Qe,n as $e,o as et,s as tt,t as nt}from"./DiffWorkerPoolProvider-OPZsOibX.js";import{n as rt}from"./cloneFileDiffMetadata-zVRGqYgv.js";import{S as it,_ as U,b as at,c as ot,d as st,f as ct,g as lt,h as W,i as ut,l as dt,m as G,o as ft,p as pt,r as K,s as q,t as mt,u as ht,v as gt,x as _t,y as vt}from"./DiffCommentAnnotation-B-XoYYxb.js";import{t as yt}from"./mediaReference-CLlAiRVc.js";import{i as bt,n as xt,r as St,t as Ct}from"./fileCommentAnnotations-BgdL_7u9.js";import{r as wt,t as Tt}from"./ReadOnlySourcePreview-CkeeLVAm.js";import{a as Et,c as Dt,i as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./fileTreeExpansion-DIOxQqDo.js";import{t as Pt}from"./pierre-icons-BG7vd34x.js";import{t as Ft}from"./scroll-area-Davaj52_.js";import{A as It,C as Lt,E as Rt,O as zt,S as Bt,T as Vt,_ as Ht,b as Ut,j as Wt,w as Gt,x as Kt,y as qt}from"./ComposerPromptEditor-Bt_L4smq.js";import{t as Jt}from"./assets-DXnV2oRj.js";import{i as Yt,l as Xt,o as Zt,r as Qt,s as $t}from"./openFileInPreview-BhRAqg63.js";import{w as en}from"./browserHistoryStore-DURO3U2L.js";import{t as tn}from"./preview-bd-MGMMz.js";import{t as nn}from"./PierreEntryIcon-CPG-jnaN.js";import{r as rn,t as an}from"./input-group-BFtrsedw.js";import{f as on,i as sn,l as cn,n as ln,o as un,t as dn,u as fn}from"./projectFilesQueryState-BP_JvI7-.js";import{Ha as pn,Ra as mn,qa as hn}from"./main-Bh6Hj0_-.js";import{O as gn,g as _n,h as vn,m as yn,p as bn}from"./_chat-z348gvgF.js";var xn={compositeOverBg:Ve,contrastRatio:Je,deriveMutedFg:Ue,hoverWouldEraseText:qe,isDarkSurface:Ye,isFullyTransparent:He,pickReadableForeground:Ge,relativeLuminance:Xe,surfacesMatch:We},J=e(t(),1);function Sn(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&Et(e.matchingPaths,t.matchingPaths)}function Cn(e){let t=At(e,e=>({isOpen:e.isSearchOpen(),matchingPaths:e.getSearchMatchingPaths(),value:e.getSearchValue()}),Sn);return(0,J.useMemo)(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:t=>{e.openSearch(t)},setValue:t=>{e.setSearch(t)}}),[e,t])}var wn=100,Tn=`insert`,En=`backspace`,Dn=`delete`,On=class e{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??wn)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}getState(){return{undoStack:this.#e.map(An),redoStack:this.#t.map(An),maxEntries:this.#n,canCoalesce:this.#r}}getLiveState(){return Object.defineProperties({},{undoStack:{enumerable:!0,get:()=>this.#e},redoStack:{enumerable:!0,get:()=>this.#t},maxEntries:{enumerable:!0,get:()=>this.#n},canCoalesce:{enumerable:!0,get:()=>this.#r}})}static fromState(t){let n=new e({maxEntries:t.maxEntries});return n.#e=t.undoStack,n.#t=t.redoStack,n.#r=t.canCoalesce,n}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function kn(e){return{...e,forwardEdits:e.forwardEdits.map(e=>({...e})),inverseEdits:e.inverseEdits.map(e=>({...e})),selectionsBefore:e.selectionsBefore?.map(jn),selectionsAfter:e.selectionsAfter?.map(jn),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:e.lineAnnotationsAfter?.slice()}}function An(e){return{...kn(e),lineAnnotationsBefore:e.lineAnnotationsBefore?.map(e=>({...e})),lineAnnotationsAfter:e.lineAnnotationsAfter?.map(e=>({...e}))}}function jn(e){return{...e,start:{...e.start},end:{...e.end}}}function Mn(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?En:n?Dn:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function Nn(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=In(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
|
|
2
2
|
`)&&!a.text.includes(`
|
|
3
3
|
`),u=o.start===o.end&&o.text.length>0&&!o.text.includes(`
|
|
4
4
|
`)&&s.text.length===0;if(l&&u){if(o.start!==a.end||(n??=Tn,n!==Tn||e.coalescingMode!==void 0&&e.coalescingMode!==Tn||t.coalescingMode!==void 0&&t.coalescingMode!==Tn))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){let r;if(c===i.end)r=Dn;else if(c+(o.end-o.start)!==i.start)return!1;else r=En;if(n??=r,n!==r||e.coalescingMode!==void 0&&e.coalescingMode!==r||t.coalescingMode!==void 0&&t.coalescingMode!==r)return!1;continue}return!1}return n!==void 0}function Pn(e,t){let n=[],r=[],i;for(let a=0;a<e.forwardEdits.length;a++){let o=e.forwardEdits[a],s=e.inverseEdits[a],c=t.forwardEdits[a],l=t.inverseEdits[a],u=In(c.start,e.forwardEdits);if(o.text.length>0){i??=Tn,n.push({start:o.start,end:o.end,text:o.text+c.text}),r.push(s.text);continue}if(u===o.end){i??=Dn,n.push({start:o.start,end:u+(c.end-c.start),text:``}),r.push(s.text+l.text);continue}i??=En,n.push({start:Math.min(o.start,u),end:o.end,text:``}),r.push(l.text+s.text)}return{forwardEdits:n,inverseEdits:Fn(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice(),coalescingMode:i}}function Fn(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function In(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;if(!(n<e.start)){if(n>=e.start+r){n-=i;continue}n=e.start+Math.min(n-e.start,t)}}return n}var Ln=new WeakMap;function Rn(e){return Ln.get(e)}function zn(e,t){Ln.set(e,t)}var Bn=class e{#e;#t;#n;#r;#i;#a;constructor(e,t,n=`text`,r=0,i=new On,a){if(this.#e=new URL(e,`file://`).toString(),this.#t=n,this.#n=r,this.#r=new gt(t),this.#i=i,a!=null)this.#a=a;else{let e=this.#r.getLineText(0,!0);this.#a=e.endsWith(`\r
|
|
@@ -28,7 +28,7 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19
|
|
|
28
28
|
`}),this.#y=W(`style`,{dataset:`editorCss`,textContent:K}),this.#b=W(`style`,{dataset:`editorThemeCss`}),this.#x=ft(),this.#E=W(`div`,{dataset:`editorOverlay`});let e=e=>{let t=e.composedPath()[0];return t instanceof Node&&this.#w?.contains(t)===!0},t=()=>{this.#Z!=null&&(this.#Z=void 0,this.#X=!1,this.#J=!1)},n=e=>{if(e.pointerType!==`mouse`)return;let t=this.#$;this.#Ke(),t&&this.#ut(),this.#e.enabledSelectionAction===!0&&this.#se!==void 0&&this.#se.length>0&&!Y(this.#se.at(-1))&&this.#Wt(this.#se)};this.#s=[q(document,`focusin`,n=>{e(n)||t()},{passive:!0}),q(document,`pointerdown`,n=>{e(n)||queueMicrotask(t)},{capture:!0,passive:!0}),q(document,`selectionchange`,()=>{let e=this.#S?.shadowRoot;if(this.#J||this.#Y||e==null||!this.#X||this.#se!==void 0&&this.#se.length>1&&!this.#ee)return;let t=document.getSelection();if(t==null)return;let n;if(n=typeof t.getComposedRanges==`function`?t.getComposedRanges({shadowRoots:[e]})?.[0]:Wa(e),n===void 0||!this.#Cn(n))return;let r=pr(n,0);if(r!==void 0){if(this.#ee&&this.#ne&&this.#se!==void 0&&this.#se.length>0){let e=this.#se.at(-1);this.#Wt([Br(e,r)]);return}if(this.#re!==void 0)r.direction=zr(this.#re,r).direction;else if(this.#ee)this.#re=r;else if(this.#se!==void 0&&this.#se.length===1){let e=this.#se[0];Z(e.start,r.start)===0&&Z(e.end,r.end)===0&&(r.direction=e.direction)}this.#te!==void 0&&(this.#te.focusLine=X(r).line,this.#kt())||(this.#ae===void 0?this.#Wt([r]):this.#Wt([...this.#ae.filter(e=>!Fr(e,r)),r]))}},{passive:!0}),q(document,`pointerup`,n,{passive:!0}),q(document,`pointercancel`,n,{passive:!0}),q(document,`keydown`,e=>{e.key===`Shift`?this.#re=this.#se?.at(-1):e.key===`Alt`&&!e.repeat&&this.#X&&this.#e.editPrediction?.mode===`subtle`&&(this.#ye=!this.#ye,this.#Wt(this.#se??[]))},{passive:!0}),q(document,`keyup`,e=>{e.key===`Shift`&&(this.#re=void 0)},{passive:!0})]}#Ke(){this.#c?.forEach(e=>e()),this.#c=void 0,this.#J=!1,this.#$=!1,this.#ee=!1,this.#te=void 0,this.#ne=!1,this.#re=void 0,this.#ae=void 0}#qe(e){this.#c?.forEach(e=>e()),this.#c=e}#Je(){return this.#M?.options.enableLineSelection===!0}#Ye(){this.#Y=this.#se!==void 0}#Xe(e,t){let{onFocus:n,onBlur:r}=this.#e,i=t=>{let n=t.composedPath()[0];return n!==void 0&&(n===e||e.contains(n))};this.#o?.forEach(e=>e()),this.#o=[q(e,`focus`,()=>{this.#X=!0,n?.(),!this.#ee&&!this.#J&&this.#se!==void 0&&this.#se.length>0&&this.#ht(this.#se.at(-1))},{passive:!0}),q(e,`blur`,()=>{this.#Z?.target===e&&(this.#Z=void 0,this.#J=!1),this.#X=!1,r?.()},{passive:!0}),q(e,`pointerdown`,t=>{if(this.#q=!0,this.#Y=!1,t.pointerType!==`mouse`)return;if(this.#te=void 0,this.#bt(t)){this.#Et(!0),this.#se!==void 0&&this.#Wt([]);return}this.#Et(!1),this.#U?.removePopover();let n=[];if(Le()&&this.#R!==void 0&&this.#R.length>0){let t=[...e.querySelectorAll(`[data-line-annotation]`)].map(e=>[q(e,`mouseenter`,()=>{this.#J=!0}),q(e,`mouseleave`,()=>{this.#J=!1})]).flat();n.push(...t)}this.#ee=!0;let r=t.button===0&&t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey;if(this.#re=void 0,r?(this.#te={pointerId:t.pointerId,startClientX:t.clientX,clientX:t.clientX,startScrollLeft:e.parentElement?.scrollLeft??0},this.#ae=void 0,this.#se=void 0,this.#Wt([]),n.push(q(document,`pointermove`,e=>{let t=this.#te;t!==void 0&&e.pointerType===`mouse`&&e.pointerId===t.pointerId&&(t.clientX=e.clientX,this.#kt())},{capture:!0,passive:!0}))):t.button===0&&it(t)&&(this.#ae=this.#se?.map(e=>({...e}))),this.#qe(n),t.shiftKey){let e=this.#se?.at(-1);if(e!==void 0){let t=e.direction===-1?e.end:e.start;this.#ht({start:t,end:t,direction:0})}this.#ne=!0}},{passive:!0}),q(e,`keydown`,e=>{if(!i(e)||(this.#q=!0,this.#Y=!1,e.isComposing||e.keyCode===229))return;if(e.key===`Tab`&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.isComposing&&!this.#Q&&(!e.altKey||this.#e.editPrediction?.mode===`subtle`)&&this.#xe?.rendered===!0){this.#Ht(),e.preventDefault();return}if(e.key===`Escape`&&this.#xe!==void 0){this.#Rt(!0),e.preventDefault();return}let t=vt(e,this.#e.keymap);if(t!==void 0){e.preventDefault(),t===`simplifySelection`&&(this.#G?.close(),this.#G=void 0,this.#pe=!1,this.#K?.cleanup(),this.#K=void 0),this.#et(t);return}let n=_t(e),r=this.#n?.document;if(this.#se!==void 0&&this.#se.length>0&&n!==void 0&&r!==void 0){let t={getSoftLineOffsets:this.#Le?e=>this.#Sn(e):void 0,resolveRenderableLine:this.#Ne};e.shiftKey?this.#Wt(xr(r,this.#se,n,t)):this.#Wt(hr(r,this.#se,n,t)),this.#gt(),e.preventDefault();return}if((e.key.length===1?e.key.toLowerCase():e.key)===`v`&&it(e)){if(e.repeat&&this.#Ie){e.preventDefault();return}if(this.#e.clipboard!==void 0){e.preventDefault(),V(this.#Ze);return}}if(this.#G!==void 0){let t=at(e);if(t!==void 0){e.preventDefault(),this.#G.navigate(t===`previous`);return}}}),q(e,`copy`,e=>{i(e)&&(e.preventDefault(),this.#wt()?e.clipboardData?.setData(`text`,this.#Tt()):this.#nn(e.clipboardData,this.#en(),this.#tn()))}),q(e,`cut`,e=>{if(i(e)){if(e.preventDefault(),this.#wt())e.clipboardData?.setData(`text`,this.#Tt());else{let t=this.#tn();this.#nn(e.clipboardData,this.#rn(),t)}}}),q(e,`paste`,e=>{if(!i(e))return;e.preventDefault();let t=e.clipboardData,n=this.#n?.document;if(t===null||n===void 0)return;let r=t.getData(`text`),a=this.#se?.length??0;if(a>1){let e=t.getData(eo);if(e!==void 0)try{let t=JSON.parse(e);Array.isArray(t)&&t.length===a&&(r=t)}catch{}}this.#an(Array.isArray(r)?r.map(e=>n.normalizeEol(e)):n.normalizeEol(r),void 0,!0,`document`)}),q(e,`beforeinput`,e=>{if(i(e)){if(e.inputType===`insertCompositionText`){this.#Rt(!0);return}e.preventDefault(),this.#lt(e.inputType,e.data)}}),q(e,`drop`,e=>{i(e)&&e.preventDefault()}),q(e,`compositionstart`,e=>{i(e)&&(this.#Rt(!0),this.#Q=!0,this.#J=!0)},{passive:!0}),q(e,`compositionend`,e=>{if(!i(e))return;this.#J=!1;let t=this.#Q;this.#Q=!1,(e.data!==``||!t)&&this.#lt(`insertText`,e.data)},{passive:!0})];let a=this.#S?.shadowRoot?.querySelector(`[data-deletions]`);if(a!=null&&this.#o.push(q(a,`pointerdown`,e=>{let t=e.composedPath();if(Fe(t)){this.#Ye();return}let n=t[0],r=n instanceof HTMLElement?n.closest(`[data-column-number]`):null;if(r instanceof HTMLElement){if(this.#Je()){this.#Ye();return}if(this.#Ct(r,a,e.pointerType===`mouse`))return}this.#Et(!0),this.#se!==void 0&&this.#Wt([])},{passive:!0})),t!==void 0){let e=(e,t=!1)=>{let n=e;return n?.dataset.lineNumberContent===void 0?t&&n?.tagName===`SPAN`&&(n=n.closest(`[data-line]`)):n=n.parentElement??void 0,n},n=e=>{if(e===void 0)return;let t=e.dataset.lineType,n=G(e)??G(e,`columnNumber`);if(n!==void 0&&t!==void 0&&Pr(t))return n-1};this.#o.push(q(t,`pointerdown`,t=>{let r=t.composedPath();if(Fe(r)){this.#Ye();return}let i=e(r[0]);if(i!==void 0&&this.#Je()){this.#Ye();return}if(i?.dataset.lineType===`change-deletion`){let e=i.closest(`[data-code]`);e!=null&&this.#Ct(i,e,t.pointerType===`mouse`);return}if(t.pointerType!==`mouse`)return;let a=this.#n?.document,o=n(i);if(o===void 0||a===void 0)return;this.#q=!0,this.#U?.removePopover();let s=this.#yt(o,o,a);this.#$=!0,this.#re=s,this.#Wt([s]),this.#ht(s),this.#ut(),this.#qe([q(document,`mousemove`,t=>{if(!this.#$)return;let r=this.#n?.document,i=n(e(t.composedPath()[0],!0));if(i===void 0||r===void 0)return;let a=this.#re?.start.line??i,o=this.#yt(a,i,r);this.#re??=o,this.#Wt([o]),this.#ut(o.direction===-1?o.start:o.end)},{passive:!0})])},{passive:!0}))}this.#U?.listenHover(e),this.#j?.disconnect(),this.#j=new ResizeObserver(this.#ot),this.#j.observe(e),this.#j.observe(e.parentElement),this.#Qe(e)}#Ze=async()=>{let e=this.#e.clipboard;if(e!==void 0){let t=await e.readText(),n=this.#se?.length??0;if(n>1){let r=await e.readText(eo);try{let e=JSON.parse(r);Array.isArray(e)&&e.length===n&&(t=e)}catch{}}let r=this.#n?.document;r!=null&&this.#an(Array.isArray(t)?t.map(e=>r.normalizeEol(e)):r.normalizeEol(t),void 0,!0,`document`)}};#Qe(e){this.#Ie&&this.#Fe===`split`&&this.#Le&&(this.#d={top:e.offsetTop-this.#r.paddingTop,left:e.offsetLeft-this.#_n()},this.#e.__debug===!0&&console.log(`[diffs/editor] content offset:`,this.#d))}get#$e(){if(this.#Ie&&this.#Fe===`split`&&this.#Le)return this.#d}#et(e){let t=this.#n?.document;if(t!=null)switch(e){case`openSearchPanel`:this.#Qt(`find`);break;case`openSearchReplacePanel`:this.#Qt(`replace`);break;case`findNextMatch`:{let e=this.#se;if(e===void 0)break;if(e.some(Y)){let n=e.map(e=>Y(e)?ii(t,e):e);this.#Wt(n),this.focus()}else{let n=Gr(t,e);if(n!==void 0){this.#Wt(n);let e=n.at(-1);e!==void 0&&this.#Pe(X(e).line),this.#gt()}}break}case`moveLineUp`:case`moveLineDown`:this.#at(e===`moveLineUp`?-1:1);break;case`copyLineUp`:case`copyLineDown`:this.#rt(e===`copyLineUp`?-1:1);break;case`simplifySelection`:{let e=this.#se,t=e?.at(-1);if(e===void 0||t===void 0)break;if(e.length>1)this.#Wt([t]),this.#ut(X(t));else if(!Y(t)){let e=X(t);this.#Wt([{start:e,end:e,direction:0}]),this.#ut(e)}break}case`insertBlankLine`:this.#it();break;case`deleteHardLineForward`:this.#ln();break;case`toggleComment`:case`toggleBlockComment`:{let n=this.#se;if(n===void 0)break;let{lineComment:r,blockComment:i}=ca(t.languageId,this.#e.languageCommentConfig);if(e===`toggleComment`&&r!==null){this.#nt(la(t,n,r));break}let a=e===`toggleComment`,o=pa(t,n,i,a);o!==void 0&&this.#nt(o.edits,a?void 0:e=>o.nextSelectionOffsets.map(([t,n,r])=>({start:e.positionAt(t),end:e.positionAt(n),direction:r})));break}case`indent`:case`outdent`:case`indentLess`:case`indentMore`:if(this.#se!==void 0){let n=[],r=[],i=new Set,a=[];for(let o of this.#se){let s=o.start.line,c=e===`outdent`||e===`indentLess`,l=e===`indentLess`||e===`indentMore`;if(s!==o.end.line||c||l){let e=mr(t,o,this.#r.tabSize,c);for(let t of e[0]){let e=t.range.start.line;i.has(e)||(i.add(e),n.push(t))}r.push(e[1])}else{let e=t.charAt({line:s,character:0})===` `?` `:` `.repeat(this.#r.tabSize);n.push({range:o,newText:e}),a.push({line:s,startCharacter:o.start.character,addedLength:e.length-(o.end.character-o.start.character),selectionIndex:r.length});let i={line:o.start.line,character:o.start.character+e.length};r.push({start:i,end:i,direction:0})}}for(let e of a){let t=0;for(let n of a)n.line===e.line&&n.startCharacter<e.startCharacter&&(t+=n.addedLength);if(t!==0){let n=r[e.selectionIndex],i={line:e.line,character:n.start.character+t};r[e.selectionIndex]={start:i,end:i,direction:0}}}let o=t.applyEdits(n,!0,this.#se,r);o!==void 0&&this.#dn(o,r)}break;case`selectAll`:{let e=Kr(t);this.#Wt([e]),this.focus();let n=this.#mn(),r=n[0]?.[0],i=n.at(-1)?.[1];r!==void 0&&i!==void 0&&(this.#Y=!0,this.#ht({start:{line:r,character:0},end:{line:i,character:t.getLineLength(i)},direction:1}));break}case`moveCursorToDocStart`:case`moveCursorToDocEnd`:{let n=qr(t,e===`moveCursorToDocEnd`,this.#Ie);this.#Wt([n]),this.#Pe(X(n).line),this.#gt()}break;case`expandSelectionDocStart`:case`expandSelectionDocEnd`:{let n=e===`expandSelectionDocEnd`,r=this.#se;if(r!==void 0){let e=qr(t,n,this.#Ie);this.#Wt(Vr(r,e)),this.#Pe(X(e).line),this.#gt()}}break;case`undo`:case`redo`:this.#tt(e)}}#tt(e){let t=this.#n?.document;if(t==null||e===`undo`&&!t.canUndo||e===`redo`&&!t.canRedo)return;let n=this.#se,r=n?.map(e=>[t.offsetAt(e.start),t.offsetAt(e.end)]),i=e===`undo`?t.undo():t.redo();if(i===void 0)return;let[a,o,s,c]=i,l=o??(n!==void 0&&r!==void 0&&c!==void 0?Rr(t,n,r,c):void 0),u=s??(this.#R==null?void 0:Qn(a,this.#R));this.#dn(a,l,u)}#nt(e,t){let n=this.#n?.document,r=this.#se;if(n===void 0||r===void 0)return;let i=t===void 0,a=i?r.map(e=>[n.offsetAt(e.start),n.offsetAt(e.end)]):void 0,o=i?e.map(e=>{let t=n.offsetAt(e.range.start),r=n.offsetAt(e.range.end);return{start:Math.min(t,r),end:Math.max(t,r),text:e.newText}}).sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n}):void 0,s=n.applyEdits(e,!0,r,void 0,!0);if(s===void 0)return;let c=i?Rr(n,r,a,o):t(n);n.setLastUndoSelectionsAfter(c),this.#dn(s,c,this.#pn(s))}#rt(e){let t=this.#n?.document,n=this.#se;if(t===void 0||n===void 0)return;let r=Ur(n);if(r.length===0)return;let i=[],a=0,o=[];for(let n of r){i.push(a);let r=n.endLine-n.startLine+1;a+=r;let s=t.getText({start:{line:n.startLine,character:0},end:{line:n.endLine,character:t.getLineLength(n.endLine)}});if(e>0){let e={line:n.startLine,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else if(n.endLine<t.lineCount-1){let e={line:n.endLine+1,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else{let e={line:n.endLine,character:t.getLineLength(n.endLine)};o.push({range:{start:e,end:e},newText:t.eol+s})}}let s=n.map(t=>{let n=t.start.line,a=0,o=r.length-1;for(;a<=o;){let e=a+o>>>1,t=r[e];if(n<t.startLine)o=e-1;else if(n>t.endLine)a=e+1;else{a=e;break}}let s=Math.max(0,a<=o?a:o),c=r[s],l=i[s]+(e>0?c.endLine-c.startLine+1:0);return{start:{...t.start,line:t.start.line+l},end:{...t.end,line:t.end.line+l},direction:t.direction}});this.#nt(o,()=>s)}#it(){let e=this.#n?.document,t=this.#se;if(e===void 0||t===void 0)return;let n=t.map(e=>X(e).line),r=Array.from(new Set(n)).sort((e,t)=>e-t),i=new Map,a=new Map,o=[];for(let t=0;t<r.length;t++){let n=r[t],s=e.getLineText(n),c=/^\s*/.exec(s)?.[0]??``;i.set(n,t),a.set(n,c);let l={line:n,character:e.getLineLength(n)};o.push({range:{start:l,end:l},newText:e.eol+c})}let s=t.map((e,t)=>{let r=n[t],o={line:r+1+i.get(r),character:a.get(r).length};return{start:o,end:o,direction:0}});this.#nt(o,()=>s)}#at(e){let t=this.#n?.document,n=this.#se;if(t===void 0||n===void 0)return;let r=Ur(n);if(r.length===0||e<0&&r[0].startLine===0||e>0&&r.at(-1).endLine>=t.lineCount-1)return;let i=t.lineCount,a=e=>e<i-1?{line:e+1,character:0}:{line:e,character:t.getLineLength(e)},o=(e,n)=>{let r=e.map(e=>t.getLineText(e)).join(t.eol);return n?r+t.eol:r},s=[];if(e<0)for(let e of r){let t=e.startLine-1,n=[];for(let t=e.startLine;t<=e.endLine;t++)n.push(t);s.push({range:{start:{line:t,character:0},end:a(e.endLine)},newText:o([...n,t],e.endLine<i-1)})}else for(let e=r.length-1;e>=0;e--){let t=r[e],n=t.endLine+1,c=[];for(let e=t.startLine;e<=t.endLine;e++)c.push(e);s.push({range:{start:{line:t.startLine,character:0},end:a(n)},newText:o([n,...c],n<i-1)})}let c=r.at(-1),l=e>0&&c.endLine===i-2?t.getLineLength(c.endLine):t.getLineLength(i-1),u=n.map(n=>Wr(n,e,i,e=>e===i-1?l:t.getLineLength(e))),d=t.applyEdits(s,!0,n,u,!0);d!==void 0&&this.#dn(d,u)}#ot=()=>{let e=this.#R?.length??0,t=this.#f,n=this.#p;this.#f=void 0,this.#p=void 0;let r=this.#_n()!==t,i=this.#vn()!==n;(r||i)&&(this.#g.clear(),this.#_=void 0,this.#r.clearTextWidthCache(),i&&(this.#h.clear(),(this.#Le||e>0)&&this.#m.clear()),(this.#se!==void 0||this.#ce!==void 0||this.#U!==void 0)&&(this.#Wt(this.#se??[]),this.#se!==void 0&&this.#X&&this.focus()),this.#U?.removePopover(),this.#Qe(this.#w),this.#Gt())};#st(){if(this.#me)return;let e=document.fonts;e!==void 0&&(this.#me=!0,e.ready.then(()=>{this.#w!==void 0&&this.#r.remeasureCharacterWidth()&&(this.#f=void 0,this.#p=void 0,this.#ze(),this.#h.clear(),(this.#se!==void 0||this.#ce!==void 0||this.#U!==void 0)&&this.#Wt(this.#se??[]),this.#Gt(),this.#U?.removePopover())}))}#ct(e,t,n=this.#V,r){let i=this.#i,a=this.#M,o=this.#N,s=this.#n?.document,c=this.#C,l=this.#w;if(i==null||a==null||o==null||s==null||l==null)return;i.stopBackgroundTokenize();let u=performance.now(),d=i.tokenize(e,n,!this.#Ie&&this.#je!=null),f=performance.now();if(d.size>0){let e=l.children,t=new Set;for(let e of d.keys())this.#Me(e)&&t.add(e);for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0){let e=G(r),n=r.dataset.lineType;if(e===void 0||n===`change-deletion`)continue;let i=e-1;if(t.has(i)){let e=d.get(i);if(r.replaceChildren(...Ha(e)),t.delete(i),t.size===0)break}}}if(t.size>0){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t],i=G(r);if(i!==void 0&&r.dataset.lineType!==`change-deletion`){n=i;break}}for(let e of t){if(e<n)continue;let t=d.get(e),r=String(e+1);W(`div`,{dataset:{line:r,lineType:`context`,lineIndex:e.toString()},children:Ha(t)},l),c!==void 0&&W(`div`,{dataset:{lineType:`context`,columnNumber:r,lineIndex:e.toString()},children:[W(`span`,{dataset:{lineNumberContent:``},textContent:r})]},c)}}}if(e.lineDelta<0)for(let t of[l.children,c?.children??[]])for(let n=t.length-1;n>=0;n--){let r=t[n],i=G(r)??G(r,`columnNumber`),a=r.dataset.lineType;if(i!==void 0&&a!==`change-deletion`){if(i-1<e.lineCount)break;r.remove()}}let p=e.lineDelta!==0;if(p){let e=l.children.length;for(let t of l.children){let{bufferSize:n}=t.dataset;n!==void 0&&(e+=parseInt(n)-1)}l.style.gridRow=`span `+e,c!==void 0&&(c.style.gridRow=`span `+e)}a.updateRenderCache(d,i.themeType,{shouldRefreshDiffsView:this.#Ie&&!p,lineCountChangeInFlight:p,changedDocumentLines:this.#Ie&&!p?ia(s,e):void 0,documentLineCount:s.lineCount}),p&&o(s,t,r,String(e.previousLineCount).length===String(e.lineCount).length?e.startLine:0),(p||this.#Ie&&this.#Fe===`unified`)&&this.#ze(),t!=null&&(this.#R=t,(!this.#Ie||!p)&&ir(t,l,c,a.getAnnotationSlotName)),this.#Gt(),this.#e.__debug===!0&&console.log(`[diffs/editor] re-render in: ${U(performance.now()-f)}ms,`,`tokenize in: ${U(f-u)}ms (${d.size} dirty lines)`)}#lt(e,t){switch(e){case`insertText`:{let e=t??``,n=this.#n?.document,r=this.#se,i=n!==void 0&&r!==void 0?Dr(n,r,e,this.#e.autoSurround):void 0;this.#an(i??e);break}case`insertCompositionText`:break;case`insertLineBreak`:case`insertParagraph`:this.#an(this.#n?.document?.eol??`
|
|
29
29
|
`);break;case`deleteContentBackward`:this.#on();break;case`deleteContentForward`:this.#on(!0);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:this.#sn();break;case`deleteWordBackward`:this.#cn();break;case`insertTranspose`:this.#un();break;default:console.warn(`[diffs] Unknown input type: ${e}`,t)}}#ut(e,t=!0,n){this.#X=!0,e===void 0?n?.()===!1?this.#X=!1:this.#w?.focus({preventScroll:t}):(this.#J=!0,this.#ht({start:e,end:e,direction:0}),V(()=>{if(n?.()===!1||!this.#X){this.#J=!1;return}this.#w?.focus({preventScroll:t}),V(()=>{this.#J=!1})}))}#dt(e){let t=this.#Z;if(t==null)return;if(this.#pe){this.#Z=void 0,this.#X=!1,this.#J=!1;return}let n=this.#w;if(n==null||!this.#ft(n)){this.#Z=void 0,this.#X=!1;return}let r=()=>{if(this.#Z!==t)return!1;let e=this.#ft(n);return this.#Z=void 0,e};if(e!=null){this.#ut(e,!0,r);return}let i=this.#se?.at(-1);if(i==null){this.#ut(void 0,!0,r);return}let a=i.direction===-1?i.end:i.start;this.#ut(a,!0,r)}#ft(e){let t=this.#S,n=t?.shadowRoot;if(t==null||n==null||this.#w!==e||!n.contains(e))return!1;let{activeElement:r}=n;if(r===e||r!=null&&e.contains(r))return!0;if(r!=null)return!1;let{ownerDocument:i}=t,{activeElement:a}=i;return a==null||a===i.body||a===i.documentElement||a===t}#pt(e=0){let t=this.#w,n=this.#S;if(this.#n?.document==null||t==null||n==null)return;let r=this.#Ue();if(r===void 0)return;let i,a;if(r instanceof HTMLElement){let e=r.getBoundingClientRect();i=e.top,a=e.bottom}else i=0,a=r.defaultView?.innerHeight??0;let o=n.shadowRoot?.querySelector(`[data-diffs-header][data-sticky]`);if(o!=null&&(i=Math.max(i,o.getBoundingClientRect().bottom)),Number.isFinite(e)&&(i+=Math.max(0,e)),!(a<=i))for(let e of t.children){let t=e,n=G(t),r=t.dataset.lineType;if(n==null||r==null||!Pr(r))continue;let o=t.getBoundingClientRect();if(!(o.bottom<=o.top)&&o.top>=i&&o.top<a)return n}}#mt(e,t){let n={start:e,end:e,direction:0};this.#q=!1,this.#Wt([n]),this.#Pe(e.line),t?this.#ut(e,!0):this.#gt()}#ht(e){let t=window.getSelection();if(t===null)return;let{start:n,end:r,direction:i}=e;Z(n,r)>0&&([n,r]=[r,n]);let a=this.#gn(n.line),o=this.#gn(r.line);if(a===void 0||o===void 0)return;let[s,c]=ri(a,n.character),[l,u]=ri(o,r.character);i===-1&&([s,c,l,u]=[l,u,s,c]);try{t.setBaseAndExtent(s,ot(s,c),l,ot(l,u))}catch(e){console.error(`[diffs/editor] failed to update window selection:`,e)}}#gt(e=!1,t=`nearest`){let n=this.#se?.at(-1);if(n===void 0)return;let r=this.#A;if(r!==void 0){if(r.scrollIntoView({block:t,inline:`nearest`}),!e){let e=n.direction===-1?n.end:n.start;this.#Z===void 0?this.#ut(e):this.#dt(e)}}else{let t=X(n);this.#vt(t.line,t.character,e)}}#_t(){let e=this.#G===void 0?0:48,t=this.#_n()+this.#r.ch;return`${e}px ${this.#r.ch}px 0 ${t}px`}#vt(e,t=0,n=!1){this.__postponeBgTokenizeToNextFrame();let r=W(`div`,{style:{position:`absolute`,left:`0`,width:`2px`,height:this.#r.lineHeight+`px`,scrollMargin:this.#_t()}});if(this.#gn(e)!==void 0){let[i,a]=this.#bn(e,t),o=this.#yn(e)+a*this.#r.lineHeight;if(r.style.top=o+`px`,r.style.left=i+`px`,this.#E?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),!n){let n={line:e,character:t};this.#Z===void 0?this.#ut(n):this.#dt(n)}this.#le=void 0,this.#ue=void 0,this.#de=!1,this.#fe=!1}else{let i=this.#je?.getLinePosition?.(e+1);if(i!==void 0)r.style.top=i.top+`px`,this.#S?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),i.height>0&&this.#Me(e)?(this.#le=e,this.#ue=t,this.#fe=n):(this.#le=void 0,this.#ue=void 0,this.#fe=!1);else{let i=0;if(this.#le===e&&this.#w!==void 0)for(let t=this.#w.childElementCount-1;t>=0;t--){let n=this.#w.children[t],r=n.dataset.lineType,a=G(n);if(r!==void 0&&Pr(r)&&a!==void 0){i=(e-(a-1))*this.#r.lineHeight;break}}let a=((this.#R??[]).filter(t=>t.lineNumber<e).length+e)*this.#r.lineHeight+i;r.style.top=a+`px`,this.#S?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),this.#le===e&&(i===0||this.#de)||!this.#Me(e)?(this.#le=void 0,this.#ue=void 0,this.#de=!1,this.#fe=!1):(this.#le=e,this.#ue=t,this.#de=i!==0,this.#fe=n)}}r.remove()}#yt(e,t,n){let r=e=>({line:e,character:0}),i=e=>({line:e,character:n.getLineText(e).length});return t<e?{start:r(t),end:i(e),direction:-1}:{start:r(e),end:i(t),direction:1}}#bt(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&t.closest(`[data-line]`)?.getAttribute(`data-line-type`)===`change-deletion`}#xt(e,t,n){let r=[...n.querySelectorAll(`[data-content] > [data-line]`)],i=r.indexOf(e),a=r.indexOf(t),[o,s]=a<i?[t,e]:[e,t],c=window.getSelection();if(c!==null){let e=document.createRange();e.setStart(o,0),e.setEnd(s,s.childNodes.length),c.removeAllRanges(),c.addRange(e)}this.#Et(!0),this.#Wt([]),this.#Dt(G(t)??null,!0,`deletions`);let l=Math.min(i,a),u=Math.max(i,a);this.#ie=l<0?``:r.slice(l,u+1).filter(e=>e.getAttribute(`data-line-type`)===`change-deletion`).map(e=>e.textContent??``).join(`
|
|
30
30
|
`)}#St(e,t){let n=e.parentElement;if(n==null||t==null)return;let r=[...n.children].indexOf(e),i=t.children[r];return i instanceof HTMLElement?i:void 0}#Ct(e,t,n){let r=t.querySelector(`[data-content]`),i=this.#St(e,r);return i!==void 0&&(this.#xt(i,i,t),n&&this.#qe([q(document,`mousemove`,e=>{let n=e.composedPath()[0],a=n instanceof HTMLElement?n.closest(`[data-column-number]`):null;if(a instanceof HTMLElement&&t.contains(a)){let e=this.#St(a,r);e!==void 0&&this.#xt(i,e,t)}},{passive:!0})]),!0)}#wt(){return this.#S?.shadowRoot?.querySelector(`pre`)?.hasAttribute(`data-deleted-text-selection`)??!1}#Tt(){return this.#ie===``?window.getSelection()?.toString()??``:this.#ie}#Et(e){let t=this.#S?.shadowRoot?.querySelector(`pre`);t!=null&&(e?(t.setAttribute(`data-deleted-text-selection`,``),this.#Dt(null),this.#ie=``):(t.removeAttribute(`data-deleted-text-selection`),this.#ie=``))}#Dt(e,t=!1,n=`additions`){try{this.#M?.setEditorActiveLine(e,{lineNumberOnly:t,side:n})}catch{}}#Ot(){this.#he===void 0&&(this.#he=requestAnimationFrame(()=>{this.#he=void 0,(this.#se!==void 0||this.#ce!==void 0||this.#U!==void 0)&&this.#Wt(this.#se??[])}))}#kt(){let e=this.#te,t=this.#re,n=this.#n?.document;if(e===void 0||e.focusLine===void 0||t===void 0||n===void 0)return!1;let r=t.direction===-1?t.end:t.start,i=this.#w?.parentElement?.scrollLeft??0,a=(e.clientX-e.startClientX+i-e.startScrollLeft)/this.#r.ch,o=a<0?-Math.round(-a):Math.round(a),s=Math.max(0,r.character+o),c={line:e.focusLine,character:s};if(e.renderedGoal!==void 0&&Z(e.renderedGoal,c)===0)return!0;e.renderedGoal=c;let l=[],u=c.line<r.line?-1:1;for(let e=r.line;;e+=u){if(this.#Me(e)){let t=n.getLineText(e),i=Math.min(r.character,t.length),a=Math.min(s,t.length),o=_r(t,i),c=a===i?o:_r(t,a);l.push({start:{line:e,character:Math.min(o,c)},end:{line:e,character:Math.max(o,c)},direction:o===c?0:o<c?1:-1})}if(e===c.line)break}return this.#Wt(l),!0}#At(){for(let[e,t]of this.#D??[])e.startsWith(`editPrediction`)&&(t.remove(),this.#D?.delete(e))}#jt(e,t,n){let r=t[n],i=n,a=r.range.end.line;for(;i+1<t.length&&t[i+1].range.start.line<=a;)i++,a=Math.max(a,t[i].range.end.line);if(i===n&&(r.newText.length===0||Z(r.range.start,r.range.end)===0))return{edit:r,endIndex:i};let o=r.range.start,s={line:a,character:e.getLineLength(a)},c=[],l=e.offsetAt(o);for(let r=n;r<=i;r++){let n=t[r],i=e.offsetAt(n.range.start),a=e.offsetAt(n.range.end);c.push(e.getTextSlice(l,i),n.newText),l=a}return c.push(e.getTextSlice(l,e.offsetAt(s))),{edit:{range:{start:o,end:s},newText:c.join(``)},endIndex:i}}#Mt(){let e=this.#xe,t=this.#n?.document;if(e==null||t==null||e.document!==t||e.version!==t.version||this.#e.editPrediction?.mode===`subtle`&&!this.#ye)return;let{edits:n}=e.response,r=[],i=n.length>0;for(let e=0;e<n.length;){let{edit:a,endIndex:o}=this.#jt(t,n,e);for(let e=a.range.start.line;i&&e<=a.range.end.line;e++)i=this.#wn(e);r.push({edit:a,startIndex:e,endIndex:o}),e=o+1}return{groups:r,allVisible:i}}#Nt(e,t,n,r,i){this.#Le?(e.dataset.wrap=``,e.style.width=`calc(100cqw - ${r}px)`):(delete e.dataset.wrap,e.style.width=`max-content`);let a=t.split(/\r\n|\r|\n/);for(let t=0;t<a.length;t++){let o=a[t],s=t===a.length-1?i:void 0,c=o.length===0&&s===void 0,l=W(`span`,{dataset:c?[`editPredictionLine`,`empty`]:`editPredictionLine`,textContent:c?``:o},e);s!==void 0&&W(`span`,{dataset:`editPredictionSuffix`},l).append(s),t===0&&n!==r&&(l.style.textIndent=`${n-r}px`)}}#Pt(e){let t=this.#xe,n=this.#n?.document;if(t==null||n==null)return;let{edit:r,startIndex:i,endIndex:a}=e,{start:o,end:s}=r.range;if(!(Z(o,s)===0&&o.character<n.getLineLength(o.line))||t.response.edits[i-1]?.range.end.line===o.line||t.response.edits[a+1]?.range.start.line===o.line)return;let c=this.#gn(o.line);if(c===void 0)return document.createTextNode(n.getLineText(o.line).slice(o.character));let[l,u]=ri(c,o.character),d=document.createRange();d.selectNodeContents(c),d.setStart(l,ot(l,u));let f=d.cloneContents();return f.firstChild?.textContent===``&&f.firstChild.remove(),f}#Ft(e){let{edit:t}=e,{start:n}=t.range,[r,i]=this.#bn(n.line,n.character),a=1,o=t.newText.split(/\r\n|\r|\n/).length,s=this.#E;if(this.#Le&&s!=null){a=Math.max(1,this.#Sn(n.line).length-1);let i=W(`span`,{dataset:`editPrediction`,style:{visibility:`hidden`}},s);this.#Nt(i,t.newText,r,this.#bn(n.line,0)[0],this.#Pt(e));let{width:c,height:l}=i.getBoundingClientRect();i.remove();let{lineHeight:u}=this.#r;c>0&&l>0&&u>0&&(o=Math.round(l/u))}return Math.max(0,o-(a-i))}#It(e=!0){let t=new Map,n=new Map,r=this.#we,i=!1,a=this.#w,o=this.#Mt();if(a!=null&&o!=null&&o.allVisible){for(let e of o.groups){let{edit:t}=e;if(t.newText.length===0)continue;let r=this.#Ft(e);r>(n.get(t.range.start.line)??0)&&n.set(t.range.start.line,r)}if(n.size>0){let e,o=this.#V?.startingLine??0;for(let[s,c]of n){i||=r.get(s)!==c;let n=this.#gn(s);if(n===void 0)continue;let l=s-o;if(a.children[l]!==n){if(e===void 0){e=new Map;for(let t=0;t<a.children.length;t++)e.set(a.children[t],t)}l=e.get(n)??-1}if(l<0)continue;t.set(n,c);let u=this.#C?.children[l];u instanceof HTMLElement&&t.set(u,c);let d=this.#Lt(l);d!=null&&(t.set(d.content,(t.get(d.content)??0)+c),t.set(d.gutter,(t.get(d.gutter)??0)+c))}}}let s=!1;for(let[e,n]of this.#Ce)t.get(e)!==n&&(delete e.dataset.editPredictionSpacer,e.style.removeProperty(`--diffs-edit-prediction-spacer-height`),s=!0);for(let[e,n]of t)this.#Ce.get(e)!==n&&(e.dataset.editPredictionSpacer=``,e.style.setProperty(`--diffs-edit-prediction-spacer-height`,`${n}lh`),s=!0);this.#Ce=t,(i||n.size!==r.size)&&(this.#we=n,e&&this.#je?.syncGhostTextRows()),s&&this.#ze()}#Lt(e){let t=this.#T,n=this.#w;if(t==null||n==null||!this.#Ie||this.#Fe!==`split`||this.#Le)return;let r=0;for(let t=0;t<e;t++)r+=ro(n.children[t]);let{content:i,gutter:a}=t,o=0;for(let e=0;e<i.children.length;e++){let t=i.children[e];if(o+=ro(t),o>r){let n=a.children[e];if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))throw Error(`Editor: deletions column rows and gutter cells are out of step`);return{content:t,gutter:n}}}}#Rt(e,t=!0){this.#ge!==void 0&&(clearTimeout(this.#ge),this.#ge=void 0),this.#_e?.abort(),this.#_e=void 0,this.#ve++,this.#ye=!1,this.#be=!1,this.#xe=void 0,this.#It(t),e&&this.#At()}#zt(e){let t=this.#e.editPrediction;if(t===void 0)return!1;let n=e.replaceAll(`\\`,`/`);return(t.include===void 0||t.include.some(e=>ra(n,e)))&&t.exclude?.some(e=>ra(n,e))!==!0}#Bt(){this.#Rt(!0);let e=this.#se?.[0];if(this.#e.editPrediction===void 0||this.#n?.document===void 0||this.#n?.fileInfo===void 0||this.#se?.length!==1||e===void 0||!Y(e))return;let t=this.#n?.document,n=t.offsetAt(X(e));this.#ge=setTimeout(()=>{this.#ge=void 0;let e=this.#e.editPrediction,r=this.#se?.[0],i=this.#n?.fileInfo?.name;if(e===void 0||i===void 0||this.#n?.document!==t||this.#se?.length!==1||r===void 0||!Y(r)||t.offsetAt(X(r))!==n||!this.#zt(i))return;let a=e=>this.#hn(e)&&this.#Me(e);if(!a(X(r).line)){this.#be=!0;return}let o=na(i,t,n,this.#Se,a);if(o===void 0)return;let s=t.offsetAt({line:o.excerptStartLine,character:0}),c=s+o.editableRange.start,l=s+o.editableRange.end,u=new AbortController,d=++this.#ve;this.#_e=u;let f;try{f=e.provider.predict(o,{signal:u.signal})}catch{this.#_e=void 0;return}Promise.resolve(f).then(e=>{let r=this.#se?.[0];if(u.signal.aborted||d!==this.#ve||this.#_e!==u||this.#n?.document!==t||t.version!==o.version||this.#se?.length!==1||r===void 0||!Y(r)||t.offsetAt(X(r))!==n||e==null||!Array.isArray(e.edits)||e.edits.length===0||e.edits.length>Xa||e.newCursor==null)return;let i=[],a=0;for(let n of e.edits){if(n==null||typeof n.newText!=`string`||!io(t,n.range?.start)||!io(t,n.range?.end)||Z(n.range.start,n.range.end)>0||(a+=Qa.encode(n.newText).byteLength,a>Za))return;let e=t.offsetAt(n.range.start),r=t.offsetAt(n.range.end),o=t.resolveEdits([n])[0];if(o.start!==e||o.end!==r)return;i.push(o)}i.sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n});for(let e=0;e<i.length;e++){let t=i[e];if(t.start<c||t.end>l||e>0&&i[e-1].end>t.start)return}let s=i.filter(e=>e.text!==t.getTextSlice(e.start,e.end));if(s.length===0)return;let f=t.positionAt(s[0].start),p=t.positionAt(s.at(-1).end),m=t.offsetAt({line:f.line,character:0}),h=t.offsetAt({line:p.line,character:t.getLineLength(p.line)}),g=[],_=m;for(let e of s)g.push(t.getTextSlice(_,e.start),e.text),_=e.end;g.push(t.getTextSlice(_,h));let v=g.join(``).split(/\r\n|\r|\n/),y=f.line+v.length-1,b=v.length-(p.line-f.line+1),x=e.newCursor;if(!(!Number.isInteger(x.line)||!Number.isInteger(x.character)||x.line<0||x.character<0)){if(x.line>=f.line&&x.line<=y){let e=v[x.line-f.line];if(x.character>e.length||ao(e,x.character))return}else{let e=x.line<f.line?x.line:x.line-b;if(e<0||e>=t.lineCount||x.character>t.getLineLength(e))return;let n=t.offsetAt({line:e,character:x.character});if(ao(t.charAt(n-1)+t.charAt(n),1))return}this.#xe={document:t,version:o.version,cursorOffset:n,rendered:!1,response:{edits:s.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),newCursor:{...x}}},this.#Wt(this.#se)}}).catch(()=>{}).finally(()=>{this.#_e===u&&(this.#_e=void 0)})},Ya)}#Vt(e,t){let n=this.#n?.document,r=this.#n?.fileInfo?.name,i=Rn(e);n!==void 0&&r!==void 0&&i!==void 0&&this.#zt(r)&&(this.#Se=ea(this.#Se,r,n,i,t))}#Ht(){let e=this.#xe,t=this.#n?.document,n=this.#se?.[0];if(e===void 0||!e.rendered||t===void 0||e.document!==t||e.version!==t.version||this.#se?.length!==1||n===void 0||!Y(n)||t.offsetAt(X(n))!==e.cursorOffset)return;let{edits:r,newCursor:i}=e.response;this.#Rt(!0);let a=t.applyEdits(r.map(e=>({range:{start:{...e.range.start},end:{...e.range.end}},newText:e.newText})),!0,this.#se,void 0,!0);if(a===void 0){this.#Bt();return}let o=t.normalizePosition(i),s=[{start:o,end:o,direction:0}];t.setLastUndoSelectionsAfter(s),this.#dn(a,s,this.#pn(a),{editSource:`prediction`})}#Ut(e){let t=this.#xe,n=this.#n?.document;t!==void 0&&(t.rendered=!1);let r=this.#Mt();if(t!=null&&n!=null&&r!=null&&r.allVisible){for(let t of r.groups){let{edit:r,endIndex:i}=t,{start:a,end:o}=r.range,s=r.newText.length===0,c=Z(a,o)!==0,l=n.getLineLength(a.line),u=!c&&a.character<l;if(c?this.#Kt(e,s?`editPredictionDeletion`:`editPredictionReplacement`,{start:a,end:o}):u&&this.#Kt(e,`editPredictionInsertion`,{start:a,end:{line:a.line,character:l}}),s)continue;let[d,f]=this.#bn(a.line,a.character),p=this.#bn(a.line,0)[0],m=this.#yn(a.line)+f*this.#r.lineHeight,h=`editPrediction-${i}`,g=this.#D?.get(h);if(g===void 0?g=W(`span`,{ariaHidden:`true`,contentEditable:`false`,dataset:`editPrediction`},e.fragment):(this.#D?.delete(h),g.replaceChildren()),c){g.dataset.replacement=``;let e=this.#gn(a.line);e!==void 0&&g.style.setProperty(`--diffs-edit-prediction-bg`,getComputedStyle(e).getPropertyValue(`--diffs-line-bg`))}else delete g.dataset.replacement,g.style.removeProperty(`--diffs-edit-prediction-bg`);this.#Nt(g,r.newText,d,p,this.#Pt(t)),g.style.transform=`translateX(${p}px) translateY(${m}px)`,e.elements.set(h,g)}t.rendered=!0}}#Wt(e){this.__postponeBgTokenizeToNextFrame();let t=this.#se,n=t?.length!==e.length;if(!n&&t!==void 0)for(let r=0;r<e.length;r++){let i=t[r],a=e[r];if(i.direction!==a.direction||Z(i.start,a.start)!==0||Z(i.end,a.end)!==0){n=!0;break}}if(n&&this.#Rt(!0),this.#It(),this.#A=void 0,this.#Dt(null),e.length===0&&this.#ce===void 0&&this.#U===void 0){this.#se=void 0,this.#D?.forEach(e=>e.remove()),this.#D?.clear(),this.#K?.cleanup(),this.#K=void 0,n&&this.#Bt();return}let r=document.createDocumentFragment(),i={fragment:r,elements:new Map};if(e.length>0){let t=Hr(e),n=t.at(-1);this.#se=t;let r=t.some(e=>!Y(e)),a=X(n).line+1;this.#Dt(a,r);for(let e of t)Y(e)||this.#Kt(i,`selection`,e),this.#Xt(i,e,e===n);let o=this.#e.matchBrackets!==!1&&this.#n?.document!=null&&this.#i!==void 0&&Y(n)?va(this.#n?.document,this.#i,n.start):void 0;if(o!==void 0)for(let e of o)this.#Kt(i,`bracketMatch`,e)}let a=this.#n?.document;if(this.#ce!==void 0&&a!==void 0){let e=this.#ce,t=this.#V,n=t!=null&&Number.isFinite(t.totalLines)||this.#Ie&&this.#Ae?.options.expandUnchanged!==!0?this.#mn():void 0,r=this.#se?.at(-1),o=r===void 0?-1:a.offsetAt(r.start),s=r===void 0?-1:a.offsetAt(r.end),c=0,l=n?.length??1;for(let t=0;t<l;t++){let r=1/0,l=n?.[t];if(l!==void 0){let[t,n]=l,i=a.offsetAt({line:t,character:0}),o=n+1;r=o<a.lineCount?a.offsetAt({line:o,character:0}):a.offsetAt({line:o-1,character:a.getLineLength(o-1)});let s=c,u=e.length;for(;s<u;){let t=s+Math.floor((u-s)/2);e[t][1]<=i?s=t+1:u=t}c=s}for(;c<e.length;c++){let[t,n]=e[c];if(t>=r)break;let l={start:a.positionAt(t),end:a.positionAt(n)},u=o===t&&s===n;this.#Kt(i,`match`,l,u?`focus`:void 0)}}}if(this.#U!==void 0&&a!==void 0)for(let e of this.#U.markers)this.#Kt(i,`marker`,e,Ni(e.severity));this.#Ut(i),this.#E?.appendChild(r),this.#D?.forEach(e=>e.remove()),this.#D?.clear(),this.#D=i.elements,this.#Zt(),n&&this.#Bt()}#Gt(){let e=this.#W,t=this.#e.renderCaret,n=this.#E;if(this.#k?.forEach(e=>e.remove()),this.#k=void 0,e===void 0||t===void 0||n===void 0){this.#O?.forEach(e=>e.remove()),this.#O=void 0;return}let r=this.#O??=new Map;for(let[e,t]of r)this.#wn(e.caret.focus.line)||(t.remove(),r.delete(e));let i=document.createDocumentFragment(),a=[];for(let n of e){let{caret:e}=n,{line:o,character:s}=e.focus;if(n.anchorOffset!==n.focusOffset){let t={fragment:i,elements:new Map};this.#Kt(t,`caretHighlight`,n.anchorOffset<n.focusOffset?{start:e.anchor,end:e.focus}:{start:e.focus,end:e.anchor},void 0,e.focus);for(let n of t.elements.values())n.style.setProperty(`--diffs-caret-highlight-bg`,`color-mix(in srgb, ${e.metadata.color} 32%, transparent)`),a.push(n)}if(!this.#wn(o))continue;let c=r.get(n);c===void 0&&(c=W(`div`,{dataset:`remoteCaret`,children:[t(e)]},i),r.set(n,c));let[l,u]=this.#bn(o,s),d=this.#yn(o)+u*this.#r.lineHeight;c.style.transform=`translateX(${l}px) translateY(${d}px)`}this.#k=a,n.appendChild(i)}#Kt(e,t,n,r,i){if(this.#n?.document==null)return;let{start:a,end:o}=n,s=a.line,c=o.line+1;if(this.#V!==void 0){let{startingLine:e,totalLines:t}=this.#V;s=Math.max(s,e),c=Math.min(c,e+t)}for(let n=s;n<c;n++){if(!this.#wn(n))continue;let s=n===o.line,c=n===a.line?a.character:0,l=s?o.character:this.#n?.document.getLineLength(n);if(c===l&&(t===`editPredictionDeletion`||t===`editPredictionReplacement`)){if(s&&n!==a.line)continue;let[i,o]=this.#bn(n,c);this.#Yt(e,t,n,o,i,this.#r.ch,r);continue}if(this.#Le){let a=this.#vn(),o=this.#n?.document.getLineText(n);if(2*this.#r.ch+this.#r.measureTextWidth(o)>a){this.#qt(e,n,o,c,l,s,t,r,i);continue}}let u=0,d=0,f=0;u=c===0?this.#_n()+this.#r.ch+(this.#$e?.left??0):this.#bn(n,c)[0],!s&&t===`selection`&&(f=this.#r.ch),d=c===l?f:this.#bn(n,l)[0]-u+f,this.#Yt(e,t,n,0,u,d,r,{start:i?.line===a.line&&i.character===a.character&&n===a.line,end:i?.line===o.line&&i.character===o.character&&n===o.line})}}#qt(e,t,n,r,i,a,o,s,c){let l=this.#Sn(t),u=l.length-1,d=this.#_n()+this.#r.ch+(this.#$e?.left??0);for(let f=0;f<u;f++){let p=l[f],m=l[f+1],h=Math.max(r,p),g=Math.min(i,m);if(h>g)continue;let _=this.#Jt(n,p,h),v=d+_,y=0;!a&&f===u-1&&o===`selection`&&(y=this.#r.ch);let b=h===g?y:this.#Jt(n,p,g)-_+y;this.#Yt(e,o,t,f,v,b,s,{start:c?.line===t&&c.character===r&&h===r,end:c?.line===t&&c.character===i&&g===i})}}#Jt(e,t,n){if(n<=t)return 0;let r=e.slice(t,n),i=La(r,this.#r.tabSize);return i===-1?this.#r.measureTextWidth(r):i*this.#r.ch}#Yt(e,t,n,r,i,a,o,s){if(a===0)return;let{ch:c,lineHeight:l}=this.#r,u=this.#yn(n)+r*l,d=`${t}-${n}/${r}-${i}-${a} ${o??``}`,f=this.#D,p=(this.#e.roundedSelection??!0)&&(t===`selection`||t===`caretHighlight`),m=(n,r,i,a)=>{let o=this.#yn(n)+r*l,s=this.#gn(n),u=`initial`;s!==void 0&&(s.dataset.lineType===`change-addition`||s.dataset.selectedLine!==void 0)&&(u=getComputedStyle(s).getPropertyValue(`--diffs-line-bg`));let d=`width:${c}px;transform:translateX(${i}px) translateY(${o}px);--diffs-selection-corner-bg:${u}`,p={selectionCorner:``,[a]:``},m=`${t}-block-${n}/${r}-${i}-1ch`,h=m+`-`+a;if(a===`rbl`){let t=m+`-rtl`,n=e.elements.get(t);n!==void 0&&(n.remove(),e.elements.delete(t),h+=`-rtl`,p.rtl=``)}let g=e.elements.get(h);g===void 0&&(f?.has(h)===!0?(g=f.get(h),g.style.cssText=d,f.delete(h)):g=W(`div`,{dataset:t===`caretHighlight`?`caretHighlightRange`:`selectionRange`,style:{cssText:d},children:[W(`div`,{dataset:p})]},e.fragment),e.elements.set(h,g))},h=t=>{let o=i+a,l=t.dataset,u=e.previousSelectionRange;if((u===void 0||u.line!==n||u.wrapLine!==r)&&(e.previousSelectionRange={element:t,line:n,wrapLine:r,left:i,width:a}),u===void 0||o<=u.left)[`rtl`,`rtr`,`rbl`,`rbr`].forEach(e=>{l[e]=``});else{let e=u.line,t=u.wrapLine,a=u.left,s=u.element.dataset,d=a+u.width;a>i&&m(e,t,a-c,`rbr`),delete s.rbl,delete l.rtl,delete l.rtr,o>=d&&delete s.rbr,o>d&&(m(e,t,d,`rbl`),l.rtr=``),o<d&&m(n,r,o,`rtl`),i<a&&(l.rtl=``),l.rbl=``,l.rbr=``}s?.start===!0&&(delete l.rtl,delete l.rbl),s?.end===!0&&(delete l.rtr,delete l.rbr)},g=e.elements.get(d);if(g!==void 0){p&&h(g);return}if(f?.has(d)===!0?(g=f.get(d),f.delete(d)):g=W(`div`,{dataset:o?[t+`Range`,o]:t+`Range`},e.fragment),g.style.width=`${a}px`,g.style.transform=`translateX(${i}px) translateY(${u}px)`,t===`editPredictionInsertion`||t===`editPredictionReplacement`){let e=this.#gn(n);e!==void 0&&g.style.setProperty(`--diffs-edit-prediction-bg`,getComputedStyle(e).getPropertyValue(`--diffs-line-bg`))}else g.style.removeProperty(`--diffs-edit-prediction-bg`);p&&h(g),e.elements.set(d,g)}#Xt(e,t,n){let{line:r,character:i}=X(t);if(!this.#wn(r))return;let[a,o]=this.#bn(r,i),s=`caret-`+r+`/`+o+`:`+i;if(e.elements.has(s))return;let c=a-1,l=this.#yn(r)+o*this.#r.lineHeight,u=W(`div`,{dataset:`caret`,style:{transform:`translateX(${c}px) translateY(${l}px)`}},e.fragment);e.elements.set(s,u),n&&(u.style.scrollMargin=this.#_t(),this.#A=u)}#Zt(){let e=this.#se?.at(-1),t=this.#E,n=this.#n?.document,r=this.#e.renderSelectionAction,i=()=>{this.#K?.cleanup(),this.#K=void 0};if(this.#e.enabledSelectionAction!==!0||r===void 0||e===void 0||Y(e)||this.#ee||t===void 0||n===void 0){i();return}let a=X(e);if(!this.#wn(a.line)){i();return}if(this.#K===void 0){if(!this.#q)return;let a=()=>this.#se?.at(-1)??e,o=r({textDocument:n,get selection(){return a()},applyEdits:e=>this.applyEdits(e),getSelectionText:()=>this.#n?.document?.getText(a())??``,replaceSelectionText:e=>{this.#an(e,[a()])},close:()=>{i(),this.#gt()}});this.#K=new Aa(o,t,()=>this.#Zt()),this.#Re().resetPlacement($a)}let o=this.#r.lineHeight,s=e.direction===-1,c={placeAbove:s,anchor:a},l=s?{placeAbove:!1,anchor:e.end}:{placeAbove:!0,anchor:e.start},u=this.#K.height,d=e=>{let[t,n]=this.#bn(e.anchor.line,e.anchor.character),r=this.#yn(e.anchor.line)+n*o,i=e.placeAbove?r:r+o,a=e.placeAbove?i-u:i;return{top:a,bottom:a+u,left:t,anchorTop:i,rowTop:r}},f=d(c),p=n.lineCount,m=s?a.line<3:a.line>=p-3,h=this.#wn(l.anchor.line)?d(l):void 0,g=this.#Re(),_=g.getPlacementBounds(),v=h!==void 0&&g.choosePlacement({preferred:f,fallback:h,viewport:_,popoverHeight:u,atDocumentEdge:m,placementKey:$a})===`fallback`;h===void 0&&g.setPlacement(`preferred`,$a);let{placeAbove:y}=v?l:c,{left:b,anchorTop:x}=v&&h!==void 0?h:f,S=s?f.rowTop:h?.rowTop??-1/0,C=(s?h?.rowTop??1/0:f.rowTop)+(e.end.line>e.start.line&&e.end.character===0?0:o),w=_===void 0||C>_.top&&S<_.bottom;this.#K.reposition(b,x,this.#_n(),y,w,_)}#Qt(e){if(this.#G!==void 0){this.#G.setMode(e);return}this.#$t(e)}#$t(e){this.#G?.cleanup();let t=this.#n?.document,n=this.#S?.shadowRoot?.querySelector(`pre`),r=this.#se;if(t===void 0||n==null)return;let i=``,a;if(r!==void 0&&r.length>0){let e=r.at(-1);if(Y(e)){e=ii(t,e),this.#Wt([...r.slice(0,-1),e]);let n=t.getText(e);n!==``&&!n.includes(`
|
|
31
|
-
`)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=Ir(t,e,n);this.#Wt([i]),this.#Pe(X(i).line),this.#gt(!0),this.#pe=r},s=new ut({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#se);n!==void 0&&this.#dn(n,void 0,this.#pn(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#ce=void 0,this.#Wt(this.#se??[]);return}if(this.#ce=e,n?.syncSelection===!1){this.#Wt(this.#se??[]);let n=this.#se?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#se?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#Wt(this.#se??[]):o(a,!0),a},onClose:()=>{this.#G=void 0,this.#pe=!1,this.#ce=void 0,this.#Wt(this.#se??[])}});this.#G=s,this.#pe=!1}#en(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?``:Zr(e,t)}#tn(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?[]:Xr(e,t)}#nn(e,t,n){e!==null&&(e.setData(`text`,t),n.length>1&&e.setData(eo,JSON.stringify(n)))}#rn(){let e=this.#n?.document,t=this.#se;if(e===void 0||t===void 0||t.length===0)return``;if(t.some(e=>Y(e))){let n=ni(e,t);return this.#in(n.edits,n.nextSelectionOffsets),n.text}let n=Zr(e,t);return this.#an(``,void 0,!0),n}#in(e,t){let n=this.#n?.document,r=this.#se;if(n===void 0||r===void 0||e.length===0)return;let i=n.applyResolvedEdits(e,!0,r,void 0,!0);if(i===void 0)return;let a=t.map(e=>{let t=n.positionAt(e);return{start:t,end:t,direction:0}});n.setLastUndoSelectionsAfter(a),this.#dn(i,a,this.#pn(i))}#an(e,t=this.#se,n=!1,r=`selection`){if(t===void 0)return;let i=this.#n?.document,a=t.at(-1);if(i===void 0||a===void 0)return;let{nextSelections:o,change:s}=Array.isArray(e)&&e.length===t.length?Tr(i,t,e,this.#R,n,r):Sr(i,t,{start:i.offsetAt(a.start),end:i.offsetAt(a.end),text:Array.isArray(e)?e.join(i.eol):e},this.#R,void 0,n);s!==void 0&&this.#dn(s,o,this.#pn(s))}#on(e=!1){let t=this.#se,n=this.#n?.document;if(t===void 0||n===void 0)return;let{nextSelections:r,change:i}=Nr(n,t,e,this.#R,this.#r.tabSize);i!==void 0&&this.#dn(i,r,this.#pn(i))}#sn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Ar(t,e,this.#Le?(e,t)=>{let n=this.#Sn(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#cn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=jr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#ln(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=kr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#un(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Or(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#dn(e,t,n,r){this.#xe!=null&&this.#Rt(!0);let i=this.#n?.document;if(i!==void 0&&this.#W!==void 0)for(let t of this.#W)t.anchorOffset=Lr(t.anchorOffset,e.changes),t.focusOffset=Lr(t.focusOffset,e.changes),t.caret.anchor=i.positionAt(t.anchorOffset),t.caret.focus=i.positionAt(t.focusOffset);if(e.lineDelta!==0||this.#Le)for(let t of this.#m.keys())t>=e.startLine&&this.#m.delete(t);if(this.#h.size>0){if(e.lineDelta===0&&(e.changedLineRanges.length===1||e.changedLineChanges?.every(([,,e])=>e===0)===!0))for(let[t,n]of e.changedLineRanges)for(let e=t;e<=n;e++)this.#h.delete(e);else for(let t of this.#h.keys())t>=e.startLine&&this.#h.delete(t)}this.#_=void 0;let a=this.#V,o;if(a!==void 0&&t!==void 0&&t.length>0){let n=t.at(-1),r=a.startingLine+a.totalLines;if(n.end.line>=r){let t=n.end.line-a.startingLine+1,i=this.#H===void 0||this.#H===1/0?1/0:this.#H*qa;e.startLine<=r&&t<=i&&this.#Me(n.end.line)?(n.end.line>r&&(o=!0),a={...a,totalLines:t},this.#V=a):o=!0}}if(this.#I&&this.#i!=null&&this.#w!=null?this.#ct(e,n,a,o):i!=null&&(this.#P?.(i,n),n!=null&&(this.#R=n)),t!=null&&this.#Wt(t),this.#M?.__acknowledgeDocumentUpdate(),this.#De(),this.#Vt(e,r?.editSource??`user`),this.#Bt(),this.#fn(e.changes,n??this.#R),r?.skipSearchRefresh!==!0&&this.#G!==void 0&&this.#ce!==void 0&&this.#G.updateMatches({syncSelection:!1}),t!=null&&r?.skipFocus!==!0){let e=t.at(-1);if(e!==void 0&&this.#Pe(X(e).line),this.#A!==void 0)requestAnimationFrame(()=>{this.#A?.scrollIntoView({block:`nearest`,inline:`nearest`})});else if(t.length>0){let e=X(t.at(-1));this.#vt(e.line,e.character)}this.focus({preventScroll:!0})}}#fn(e,t){let n=this.getFile(),r=this.#F;n!=null&&r!=null&&r(e,n,t)}#pn(e){if(this.#R!=null){let t=Qn(e,this.#R);if(t!=null)return this.#n?.document?.setLastUndoLineAnnotations(this.#R,t),t}}#mn(){let e=this.#w;if(e===void 0)return[];let t=[];for(let n of e.children){let e=n,r=e.dataset.lineType,i=G(e);if(i===void 0||r===void 0||!Pr(r))continue;let a=i-1,o=t.at(-1);o!==void 0&&a<=o[1]+1?o[1]=Math.max(o[1],a):t.push([a,a])}return t}#hn(e){let t=this.#V;return t==null||e>=t.startingLine&&e<t.startingLine+t.totalLines}#gn(e){let t=this.#g.get(e);if(t!==void 0)return t??void 0;let n=this.#V;if(!this.#hn(e))return;let r=this.#w;if(r!==void 0){if(n!==void 0){let{startingLine:i}=n,{children:a}=r;for(let n=e-i;n<=a.length;n++){let r=a[n];if(r===void 0)break;let i=G(r),o=r.dataset.lineType;if(i!==void 0&&i===e+1&&o!==void 0&&Pr(o)){t=r;break}}}return t??=r.querySelector(`[data-line="${e+1}"]`+(this.#Fe===`unified`?`:not([data-line-type="change-deletion"])`:``)),t!==void 0&&this.#g.set(e,t),t??void 0}}#_n(){if(this.#C===void 0)return 0;if(this.#f===void 0){let e=this.#w?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);this.#f=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseInt(e.slice(0,-2),10):this.#C.offsetWidth}return this.#f}#vn(){if(this.#w===void 0)return 0;if(this.#p===void 0){let e=this.#w.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);this.#p=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseFloat(e.slice(0,-2)):this.#w.offsetWidth}return this.#p}#yn(e){let t=this.#m.get(e);if(t!==void 0)return t;let n=this.#gn(e);if(n===void 0)return-1;let r=n.offsetTop+this.#r.paddingTop;return r+=this.#$e?.top??0,this.#m.set(e,r),r}#bn(e,t){if(this.#_!==void 0&&this.#_[0]===e&&this.#_[1]===t)return[this.#_[2],this.#_[3]];let n=this.#n?.document?.getLineText(e),r=this.#_n()+this.#r.ch;if(n===void 0||n.length===0||t<=0)return[r+(this.#$e?.left??0),0];let i=Fa(n,Math.min(t,n.length)),a=n.slice(0,i),o=La(a,this.#r.tabSize),s=0,c=0;if(s=o===-1?r+this.#r.measureTextWidth(a):r+o*this.#r.ch,this.#Le){let t=this.#vn();if(2*this.#r.ch+this.#r.measureTextWidth(n)>t){let t=this.#xn(e);if(t==null)return[s+(this.#$e?.left??0),0];for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=La(t,this.#r.tabSize);s=o===-1?r+this.#r.measureTextWidth(t):r+o*this.#r.ch;break}}}s+=this.#$e?.left??0}return this.#_===void 0?this.#_=[e,t,s,c]:(this.#_[0]=e,this.#_[1]=t,this.#_[2]=s,this.#_[3]=c),[s,c]}#xn(e){let t=this.#h.get(e);if(t!==void 0)return t;this.#h.size>=Ja&&this.#h.clear();let n=this.#n?.document?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#h.set(e,t),t}let r=this.#w;if(r==null||!r.isConnected)return;let i=W(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#r.tabSize.toString()},textContent:n},r),a=i.firstChild,o=document.createRange(),s=[];try{let t=i.getBoundingClientRect();if(t.width===0)return;let r=Ia(n),c=t.left+this.#r.ch,l=r===void 0?n.length:r.length-1,u=e=>r===void 0?e:r[e],d=e=>{o.setStart(a,u(e)),o.setEnd(a,u(e+1));let t=o.getClientRects();return t.item(t.length-1)??o.getBoundingClientRect()};s.push(0);let f=d(0).top,p=1;for(;p<l;){let e=p,t=l;for(;e<t;){let n=e+t>>1;d(n).top>f?t=n:e=n+1}if(e>=l)break;let{left:n,top:r}=d(e),i=Le()&&n-c>this.#r.ch/2;s.push(u(i?e-1:e)),f=r,p=e+1}let m=new Uint32Array(s.length+1);for(let e=0;e<s.length;e++)m[e]=s[e];return m[s.length]=n.length,this.#h.set(e,m),m}finally{i.remove()}}#Sn(e){let t=this.#xn(e);if(t!==void 0)return t;let n=this.#n?.document?.getLineText(e)?.length??0;return Uint32Array.of(0,n)}#Cn({startContainer:e,endContainer:t}){let n=this.#w;return n!==void 0&&n.contains(e)&&n.contains(t)}#wn(e){let t=this.#n?.document?.lineCount??0;return e<0||e>=t?!1:this.#gn(e)!==void 0}};function no({type:e,editStateKey:t,owner:n,initialState:r,previousSession:i}){if(r!=null&&r.type!==e)throw TypeError(`Editor: initialState: a ${r.type} state cannot initialize a ${e} editor`);let a=r;return t==null?a??i??(e===`file`?{type:`file`}:{type:`file-diff`}):Jn.activate(e,t,n,a)}function ro(e){return e instanceof HTMLElement?Number(e.dataset.bufferSize??1):1}function io(e,t){return t!==void 0&&Number.isInteger(t.line)&&Number.isInteger(t.character)&&t.line>=0&&t.line<e.lineCount&&t.character>=0&&t.character<=e.getLineLength(t.line)}function ao(e,t){let n=e.charCodeAt(t-1),r=e.charCodeAt(t);return t>0&&t<e.length&&n>=55296&&n<=56319&&r>=56320&&r<=57343}var Q=d(),oo=e=>{if(typeof e!=`object`||!e)return null;let t=e;return typeof t.getAttribute==`function`?t.getAttribute(`data-item-path`):null};function so(e){let t=[],n=[];return{isDragInProgress:()=>n.length>0,handleSelectionChange(e){t=e},handleDragStart(e){if(e.dataTransfer===null)return;let r=null;for(let t of e.composedPath())if(r=oo(t),r!==null)break;if(r===null)return;let i=t.includes(r)?t:[r],a=i.map(e=>yn(e)).filter(e=>e!==null);a.length!==0&&(n=i,e.dataTransfer.setData(bn,a.join(` `)))},handleDragEnd(){if(n.length!==0){for(let t of n)e.deselect(t);n=[]}}}}function co(e){return e.split(`/`).filter(Boolean).length}function lo(e,t){let n=new Set(e),r=new Set(t),i=[],a=[],o=e.filter(e=>!r.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of o){if(i.some(t=>e.startsWith(t)))continue;let t=e.endsWith(`/`);a.push({type:`remove`,path:e,...t?{recursive:!0}:{}}),t&&i.push(e)}let s=t.filter(e=>!n.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of s)a.push({type:`add`,path:e});return a}function uo(e,t){let[n,r]=(0,J.useState)(new Map),[i,a]=(0,J.useState)(new Map),[o,s]=(0,J.useState)(0),[c,u]=(0,J.useState)(new Set),d=(0,J.useRef)(new Map),f=(0,J.useRef)(new Set),p=(0,J.useRef)(new Set),m=(0,J.useRef)(!0),h=(0,J.useRef)(0),g=(0,J.useRef)([]),_=(0,J.useCallback)(function n(i,o=!1){let c=d.current.get(i);if(c)return o?c.then(()=>n(i,!0)):c;if(!o&&f.current.has(i))return Promise.resolve();f.current.add(i),p.current.add(i);let _=re.listEntries({environmentId:e,input:{cwd:t,directoryPath:i}});s(e=>e+1),o||u(e=>new Set(e).add(i));let v=(async()=>{h.current>=4?await new Promise(e=>g.current.push(e)):h.current++;try{return m.current?await A(l,_,{refresh:!0,reportFailure:!1,reportDefect:!1}):void 0}finally{let e=g.current.shift();e?e():h.current--}})().then(e=>{if(m.current&&e){if(e._tag===`Success`)r(t=>new Map(t).set(i,e.value.entries.filter(e=>e.path.slice(0,Math.max(0,e.path.lastIndexOf(`/`)))===i))),a(e=>{let t=new Map(e);return t.delete(i),t});else{f.current.delete(i);let t=b(e.cause);a(e=>new Map(e).set(i,t instanceof Error?t.message:`Unable to load folder.`))}}}).finally(()=>{d.current.delete(i),m.current&&(s(e=>e-1),o||u(e=>{let t=new Set(e);return t.delete(i),t}))});return d.current.set(i,v),v},[t,e]);(0,J.useEffect)(()=>(m.current=!0,_(``),()=>{m.current=!1}),[_]);let v=(0,J.useMemo)(()=>{let e=[],t=r=>{for(let i of n.get(r)??[])e.push(i),i.kind===`directory`&&t(i.path)};return t(``),e},[n]),y=(0,J.useMemo)(()=>new Set([``,...v.filter(e=>e.kind===`directory`).map(e=>e.path)]),[v]);return{entries:v,load:_,refresh:(0,J.useCallback)(()=>{let e=[...p.current].filter(e=>y.has(e)),t=0,n=async()=>{for(;t<e.length&&m.current;){let n=e[t++];n!==void 0&&await _(n,!0)}};for(let t=0;t<Math.min(4,e.length);t++)n()},[_,y]),isPending:o>0,loadingDirectories:c,ready:n.has(``),error:[...i].find(([e])=>y.has(e))?.[1]??null}}var $=e(_(),1);function fo(e){return e.kind===`directory`?`${e.path}/`:e.path}function po(e){let t=(0,Q.c)(12),n;t[0]===e.onRefresh?n=t[1]:(n=(0,$.jsx)(w,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Refresh workspace files`,onClick:e.onRefresh}),t[0]=e.onRefresh,t[1]=n);let r;t[2]===e.isPending?r=t[3]:(r=(0,$.jsx)(hn,{refreshing:e.isPending}),t[2]=e.isPending,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,$.jsx)(I,{render:n,children:r}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a=e.isPending?`Refreshing…`:`Refresh files`,o;t[7]===a?o=t[8]:(o=(0,$.jsx)(L,{children:a}),t[7]=a,t[8]=o);let s;return t[9]!==i||t[10]!==o?(s=(0,$.jsxs)(R,{children:[i,o]}),t[9]=i,t[10]=o,t[11]=s):s=t[11],s}function mo(e){let t=(0,Q.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):(n=t=>e.onValueChange(t.target.value),r=t=>{t.key===`Escape`&&(e.onClose(),t.currentTarget.blur())},t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==e.ariaLabel||t[4]!==e.name||t[5]!==e.value||t[6]!==n||t[7]!==r?(i=(0,$.jsx)(an,{variant:`ghost`,className:`h-7 min-w-0 flex-1`,children:(0,$.jsx)(rn,{type:`search`,name:e.name,size:`sm`,value:e.value,"aria-label":e.ariaLabel,placeholder:`Search files`,spellCheck:!1,onChange:n,onKeyDown:r})}),t[3]=e.ariaLabel,t[4]=e.name,t[5]=e.value,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function ho({environmentId:e,cwd:t,projectName:n,selectedPath:r,selectedPathRevealId:i,onOpenFile:a,onRefreshSelectedFile:o,workspaceMutationId:s}){let{resolvedTheme:c}=Te(),l=D(),u=we(e),{entries:d,load:f,refresh:p,ready:m,error:h,isPending:g,loadingDirectories:_}=uo(e,t),[v,y]=(0,J.useState)(``),[b,x]=(0,J.useState)(!1),S=Ae({environmentId:e,cwd:t,query:v.slice(0,256)},200),C=(0,J.useMemo)(()=>{let e=new Map(d.map(e=>[e.path,e]));if(v.trim()&&!S.isPending)for(let t of S.entries){e.has(t.path)||e.set(t.path,t);let n=t.path.split(`/`);for(let t=1;t<n.length;t++){let r=n.slice(0,t).join(`/`);e.has(r)||e.set(r,{path:r,kind:`directory`})}}return[...e.values()]},[d,S.entries,S.isPending,v]),T=(0,J.useMemo)(()=>new Map(C.map(e=>[e.path,e.kind])),[C]),E=(0,J.useRef)(T),O=(0,J.useMemo)(()=>C.map(fo),[C]),k=(0,J.useMemo)(()=>C.filter(e=>e.kind===`directory`).map(fo),[C]),A=(0,J.useRef)(null),ee=(0,J.useRef)(!1),te=(0,J.useRef)(null),ne=(0,J.useRef)(null),re=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=e=>{re.current={x:e.clientX,y:e.clientY,at:e.timeStamp}};return document.addEventListener(`contextmenu`,e,!0),()=>document.removeEventListener(`contextmenu`,e,!0)},[]);let ie=async(n,r)=>{let i=Ee();if(!i){r.close();return}let a=n.path.replace(/\/$/,``),o=vn(a),s=re.current,c=s!==null&&performance.now()-s.at<1e3,d=r.anchorElement.getBoundingClientRect(),f=c?{x:s.x,y:s.y}:{x:d.left,y:d.bottom},p={environmentId:e,filePath:a,workspaceRoot:t},m=u.buildItems(p);try{let e=await i.contextMenu.show([...m,{id:`copy-mention`,label:`Copy mention`},{id:`add-to-chat`,label:`Add to chat`}],f);if(e===null)return;if(m.some(t=>t.id===e)||e.startsWith(`editor:`)){await u.activate(e,p);return}if(e===`copy-mention`){try{await F(o),de.add({type:`success`,title:`Mention copied`,description:a})}catch(e){de.add({type:`error`,title:`Failed to copy mention`,description:e instanceof Error?e.message:`An error occurred.`})}return}if(e===`add-to-chat`){let e=l?.current;if(!e){de.add({type:`error`,title:`Unable to add to chat`,description:`Open a chat for this project and try again.`});return}e.insertTextAtEnd(`${o} `,{ensureLeadingBoundary:!0})||de.add({type:`error`,title:`Unable to add to chat`,description:`The chat isn't ready to accept input right now.`})}}finally{r.close()}},ae=(0,J.useRef)(ie);(0,J.useEffect)(()=>{ae.current=ie});let oe=(0,J.useRef)(_),se=(0,J.useRef)(null),ce=(0,J.useMemo)(()=>so({deselect:e=>se.current?.getItem(e)?.deselect()}),[]),{model:j}=Mt({composition:{contextMenu:{triggerMode:`right-click`,onOpen:(e,t)=>{ae.current(e,t)}}},dragAndDrop:{canDrop:()=>!1},density:`compact`,fileTreeSearchMode:`hide-non-matches`,flattenEmptyDirectories:!0,initialExpansion:`closed`,icons:Pt,onSelectionChange:e=>{if(ce.handleSelectionChange(e),ee.current||ce.isDragInProgress())return;let t=e.at(-1)?.replace(/\/$/,``);t&&E.current.get(t)===`file`&&(te.current=t,a(t))},paths:[],renderRowDecoration:({item:e,row:t})=>t.kind===`directory`&&t.isExpanded&&oe.current.has(e.path.replace(/\/$/,``))?{icon:`t3-tree-icon-loading`,title:`Loading…`}:null,search:!1,onSearchChange:e=>y(e??``),unsafeCSS:jt});(0,J.useEffect)(()=>{oe.current!==_&&(oe.current=_,j.setComposition(j.getComposition()))},[_,j]);let M=Cn(j),N=At(j,e=>Nt(e,k)),le=()=>{let e=!(b||N);x(e),kt(j,k,e)},ue=()=>{y(``),M.close()},P=(0,J.useRef)(new Set);(0,J.useEffect)(()=>{let e=new Set(k);for(let t of P.current)e.has(t)||P.current.delete(t);let t=()=>{if(!j.isSearchOpen())for(let e of k){let t=j.getItem(e);t?.isDirectory()&&`isExpanded`in t&&t.isExpanded()?P.current.has(e)||(P.current.add(e),f(e.replace(/\/$/,``))):(t?.isDirectory()&&P.current.has(e)&&x(!1),P.current.delete(e))}};return t(),j.subscribe(t)},[k,f,j]),(0,J.useEffect)(()=>{j.setGitStatus(C.filter(e=>e.ignored).map(e=>({path:fo(e),status:`ignored`})))},[C,j]),(0,J.useEffect)(()=>{if(!r)return;let e=new AbortController;return(async()=>{let t=r.split(`/`);for(let n=0;n<t.length&&!e.signal.aborted;n++)await f(t.slice(0,n).join(`/`))})(),()=>{e.abort()}},[f,r]);let I=e=>{if(y(e),e.trim().length===0){M.close();return}M.setValue(e)},L=()=>{p(),v.trim()&&S.refresh(),o?.()};gn({mutationId:s,refresh:()=>{p(),v.trim()&&S.refresh()},resourceKey:`files:${e}:${t}`}),(0,J.useEffect)(()=>{if(!m||A.current===O)return;E.current=T;let e=A.current;if(A.current=O,e===null){j.resetPaths(O);return}let t=lo(e,O);t.length>0&&j.batch(t)},[m,T,j,O]),(0,J.useEffect)(()=>{b&&!v.trim()&&kt(j,k,!0)},[k,b,j,v]),(0,J.useEffect)(()=>{if(!r){ne.current=null;return}let e=T.get(r);if(e===void 0){ne.current=null;return}let t={path:r,revealId:i},n=ne.current;if(n?.path===t.path&&n.revealId===t.revealId)return;let a=e===`directory`?`${r}/`:r,o=j.getItem(a);if(!o)return;if(j.getSelectedPaths().some(e=>e.replace(/\/$/,``)===r)&&te.current===r){te.current=null,ne.current=t;return}te.current=null,ne.current=t,ee.current=!0,y(``),j.closeSearch();for(let e of j.getSelectedPaths())j.getItem(e)?.deselect();let s=r.split(`/`),c=``;for(let e of s.slice(0,-1)){c=c?`${c}/${e}`:e;let t=j.getItem(`${c}/`)??j.getItem(c);t&&`expand`in t&&t.expand()}`expand`in o&&o.expand(),o.select(),j.scrollToPath(a,{focus:!0,offset:`center`}),queueMicrotask(()=>{ee.current=!1})},[T,j,r,i]);let R=(0,J.useRef)(null);return(0,J.useEffect)(()=>{se.current=j},[j]),(0,J.useEffect)(()=>{let e=R.current;if(e===null)return;let t=e=>ce.handleDragStart(e),n=()=>ce.handleDragEnd();return e.addEventListener(`dragstart`,t,!0),e.addEventListener(`dragend`,n),()=>{e.removeEventListener(`dragstart`,t,!0),e.removeEventListener(`dragend`,n)}},[ce]),(0,$.jsxs)(`div`,{ref:R,className:`flex min-h-0 flex-1 flex-col bg-background`,"data-file-browser-panel":`${e}:${t}`,children:[(0,$.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-1 in-data-[preview-panel-mode=inline]:h-9 in-data-[preview-panel-mode=inline]:min-h-9 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[(0,$.jsx)(po,{isPending:g,onRefresh:L}),(0,$.jsx)(mo,{name:`project-files-search`,ariaLabel:`Search ${n} files`,value:M.value,onValueChange:I,onClose:ue}),k.length>0?(0,$.jsx)(w,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":b||N?`Collapse all folders`:`Expand all folders`,onClick:le,children:(0,$.jsx)(fe,{className:`size-3.5`,icon:N?me:pe})}):null]}),h||S.error?(0,$.jsxs)(`button`,{type:`button`,onClick:L,className:`p-4 text-left text-xs leading-relaxed text-destructive`,children:[h??S.error,` Click to retry.`]}):null,v.trim()&&S.truncated&&!S.isPending?(0,$.jsx)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,children:`More matches available. Refine your search.`}):null,(!m||S.isPending)&&(0,$.jsx)(`div`,{role:`status`,className:`px-3 py-1 text-xs text-muted-foreground`,children:`Loading files…`}),(0,$.jsx)(Dt,{model:j,"aria-label":`${n} files`,className:`min-h-0 flex-1 overflow-hidden`,style:Ot(c)})]})}function go(e,t){let n=se(t),r=j(t)?`\\`:`/`,i=t.split(/[\\/]/).filter(Boolean),a=t.startsWith(`\\\\`)?`\\\\`:n&&r===`/`?`/`:``;return[...n?[]:[{label:e,path:``,kind:`project`}],...i.map((e,t)=>({label:e,path:a+i.slice(0,t+1).join(r),kind:t===i.length-1?`file`:`directory`}))]}function _o(e,t){let n,r=t?`${t}/`:``;return e.flatMap(e=>{if(!e.path.startsWith(r))return[];let t=e.path.slice(r.length);return!t||t.includes(`/`)?[]:[{...e,label:t}]}).toSorted((e,t)=>e.kind===t.kind?(n??=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),n.compare(e.label,t.label)):e.kind===`directory`?-1:1)}function vo(e){if(!e)return null;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function yo(e,t){return e.slice(e.lastIndexOf(`/`)+1)||t}function bo(e){let t=(0,Q.c)(12),n=e.current?`font-medium text-foreground`:`text-muted-foreground`,r;t[0]===n?r=t[1]:(r=T(`block max-w-40 truncate rounded-sm px-0.5`,n),t[0]=n,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:r}),t[2]=r,t[3]=i);let a;t[4]!==e.label||t[5]!==i?(a=(0,$.jsx)(I,{render:i,children:e.label}),t[4]=e.label,t[5]=i,t[6]=a):a=t[6];let o;t[7]===e.pathLabel?o=t[8]:(o=(0,$.jsx)(L,{side:`top`,children:e.pathLabel}),t[7]=e.pathLabel,t[8]=o);let s;return t[9]!==a||t[10]!==o?(s=(0,$.jsxs)(R,{children:[a,o]}),t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function xo(e){let t=(0,Q.c)(44),r=fn(e.environmentId,e.cwd,e.directoryPath),i=`files:${e.environmentId}:${e.cwd}`,a;t[0]!==r.refresh||t[1]!==e.workspaceMutationId||t[2]!==i?(a={mutationId:e.workspaceMutationId,refresh:r.refresh,resourceKey:i},t[0]=r.refresh,t[1]=e.workspaceMutationId,t[2]=i,t[3]=a):a=t[3],gn(a);let{resolvedTheme:o}=Te(),s;t[4]===r.data?.entries?s=t[5]:(s=r.data?.entries??[],t[4]=r.data?.entries,t[5]=s);let c=s,l=r.data?.truncated??!1,d;t[6]!==c||t[7]!==e.directoryPath?(d=_o(c,e.directoryPath),t[6]=c,t[7]=e.directoryPath,t[8]=d):d=t[8];let p=d,g=r.data!==null,_,v,y,b,x;if(t[9]!==e){let n=vo(e.directoryPath),r=e.directoryPath!==e.rootPath&&n!==null&&(e.rootPath===``||n===e.rootPath||n.startsWith(`${e.rootPath}/`));_=h,v=`start`,y=`bottom`,b=t=>{t.key===`ArrowLeft`&&r&&n!==null&&(t.preventDefault(),t.stopPropagation(),e.onDirectoryChange(n))},x=r&&n!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(m,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(n),children:[(0,$.jsx)(u,{}),(0,$.jsxs)(`span`,{className:`truncate`,children:[`Back to `,yo(n,e.projectName)]})]}),(0,$.jsx)(E,{})]}):null,t[9]=e,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x}else _=t[10],v=t[11],y=t[12],b=t[13],x=t[14];let S;t[15]!==p||t[16]!==g||t[17]!==r.data||t[18]!==r.error||t[19]!==r.isPending||t[20]!==r.refresh||t[21]!==l||t[22]!==e||t[23]!==o?(S=r.isPending&&r.data===null?(0,$.jsxs)(m,{disabled:!0,children:[(0,$.jsx)(P,{}),`Loading folder…`]}):r.error&&r.data===null?(0,$.jsxs)(m,{closeOnClick:!1,onClick:r.refresh,children:[(0,$.jsx)(hn,{refreshing:r.isPending}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Retry loading folder`})]}):!g&&!l?(0,$.jsx)(m,{disabled:!0,children:`This folder is no longer available.`}):p.length===0?(0,$.jsx)(m,{disabled:!0,children:l?`No entries from this folder are available in the partial workspace index.`:`This folder is empty.`}):(0,$.jsx)(f,{value:e.currentFilePath,onValueChange:t=>{e.onOpenChange(!1),e.onOpenFile(t)},children:p.map(t=>{let r=t.kind===`file`&&t.path===e.currentFilePath,i=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(nn,{pathValue:t.path,kind:t.kind,theme:o}),(0,$.jsxs)(R,{children:[(0,$.jsx)(I,{render:(0,$.jsx)(`span`,{className:T(`min-w-0 flex-1 truncate`,t.ignored&&`text-muted-foreground`)}),children:t.label}),(0,$.jsx)(L,{side:`right`,children:t.path})]})]});return t.kind===`directory`?(0,$.jsxs)(m,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(t.path),children:[i,(0,$.jsx)(k,{})]},t.path):(0,$.jsx)(n,{value:t.path,closeOnClick:!0,"aria-current":r?`page`:void 0,children:(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:i})},t.path)})}),t[15]=p,t[16]=g,t[17]=r.data,t[18]=r.error,t[19]=r.isPending,t[20]=r.refresh,t[21]=l,t[22]=e,t[23]=o,t[24]=S):S=t[24];let w;t[25]!==e.directoryPath||t[26]!==S?(w=(0,$.jsx)(C,{children:S},e.directoryPath),t[25]=e.directoryPath,t[26]=S,t[27]=w):w=t[27];let D;t[28]!==r.data||t[29]!==r.error||t[30]!==r.isPending||t[31]!==r.refresh?(D=r.error&&r.data!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(E,{}),(0,$.jsxs)(m,{closeOnClick:!1,onClick:r.refresh,children:[(0,$.jsx)(hn,{refreshing:r.isPending}),`Refresh failed — retry`]})]}):null,t[28]=r.data,t[29]=r.error,t[30]=r.isPending,t[31]=r.refresh,t[32]=D):D=t[32];let O;t[33]===l?O=t[34]:(O=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(E,{}),(0,$.jsx)(m,{disabled:!0,children:`Some workspace entries are not shown.`})]}):null,t[33]=l,t[34]=O);let A;return t[35]!==_||t[36]!==D||t[37]!==O||t[38]!==v||t[39]!==y||t[40]!==b||t[41]!==x||t[42]!==w?(A=(0,$.jsxs)(_,{align:v,side:y,onKeyDown:b,children:[x,w,D,O]}),t[35]=_,t[36]=D,t[37]=O,t[38]=v,t[39]=y,t[40]=b,t[41]=x,t[42]=w,t[43]=A):A=t[43],A}function So(e){let t=(0,Q.c)(35),[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(e.crumb.path),o;t[0]===e.crumb.path?o=t[1]:(o=()=>{r(!1),a(e.crumb.path)},t[0]=e.crumb.path,t[1]=o);let s;t[2]!==e.crumb.path||t[3]!==e.relativePath?(s=[e.crumb.path,e.relativePath],t[2]=e.crumb.path,t[3]=e.relativePath,t[4]=s):s=t[4],(0,J.useEffect)(o,s);let l;t[5]===e.crumb.path?l=t[6]:(l=t=>{r(t),t&&a(e.crumb.path)},t[5]=e.crumb.path,t[6]=l);let u=l,d=`Browse ${e.crumb.label}`,f;t[7]===d?f=t[8]:(f=(0,$.jsx)(x,{render:(0,$.jsx)(`button`,{type:`button`,"aria-label":d,className:`relative block max-w-40 cursor-pointer rounded-sm px-0.5 text-left text-muted-foreground outline-none pointer-coarse:after:-inset-y-3 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-popup-open:bg-accent data-popup-open:text-foreground`})}),t[7]=d,t[8]=f);let p;t[9]===e.crumb.label?p=t[10]:(p=(0,$.jsx)(`span`,{className:`block truncate`,children:e.crumb.label}),t[9]=e.crumb.label,t[10]=p);let m;t[11]!==f||t[12]!==p?(m=(0,$.jsx)(I,{render:f,children:p}),t[11]=f,t[12]=p,t[13]=m):m=t[13];let h=e.crumb.path||e.projectName,g;t[14]===h?g=t[15]:(g=(0,$.jsx)(L,{side:`top`,children:h}),t[14]=h,t[15]=g);let _;t[16]!==m||t[17]!==g?(_=(0,$.jsxs)(R,{children:[m,g]}),t[16]=m,t[17]=g,t[18]=_):_=t[18];let v;t[19]!==i||t[20]!==u||t[21]!==n||t[22]!==e.crumb.path||t[23]!==e.cwd||t[24]!==e.environmentId||t[25]!==e.onOpenFile||t[26]!==e.projectName||t[27]!==e.relativePath||t[28]!==e.workspaceMutationId?(v=n?(0,$.jsx)(xo,{cwd:e.cwd,currentFilePath:e.relativePath,directoryPath:i,environmentId:e.environmentId,onDirectoryChange:a,onOpenChange:u,onOpenFile:e.onOpenFile,projectName:e.projectName,rootPath:e.crumb.path,workspaceMutationId:e.workspaceMutationId}):null,t[19]=i,t[20]=u,t[21]=n,t[22]=e.crumb.path,t[23]=e.cwd,t[24]=e.environmentId,t[25]=e.onOpenFile,t[26]=e.projectName,t[27]=e.relativePath,t[28]=e.workspaceMutationId,t[29]=v):v=t[29];let y;return t[30]!==u||t[31]!==n||t[32]!==v||t[33]!==_?(y=(0,$.jsxs)(c,{open:n,onOpenChange:u,children:[_,v]}),t[30]=u,t[31]=n,t[32]=v,t[33]=_,t[34]=y):y=t[34],y}function Co(e){let t=(0,Q.c)(12),n;t[0]===e.relativePath?n=t[1]:(n=se(e.relativePath),t[0]=e.relativePath,t[1]=n);let r=n,i;t[2]!==e.projectName||t[3]!==e.relativePath?(i=go(e.projectName,e.relativePath),t[2]=e.projectName,t[3]=e.relativePath,t[4]=i):i=t[4];let a=i,o;if(t[5]!==a||t[6]!==r||t[7]!==e){let n;t[9]!==r||t[10]!==e?(n=(t,n)=>(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center`,"data-current-file-crumb":t.kind===`file`,children:[n>0?(0,$.jsx)(k,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}):null,t.kind===`file`?(0,$.jsx)(`span`,{"aria-current":`page`,children:(0,$.jsx)(bo,{current:!0,label:t.label,pathLabel:t.path})}):r?(0,$.jsx)(bo,{label:t.label,pathLabel:t.path}):(0,$.jsx)(So,{...e,crumb:t})]},t.path||`project`),t[9]=r,t[10]=e,t[11]=n):n=t[11],o=a.map(n),t[5]=a,t[6]=r,t[7]=e,t[8]=o}else o=t[8];return o}function wo(e){let t=(0,Q.c)(14),n;t[0]===e.relativePath?n=t[1]:(n=e.relativePath.lastIndexOf(`/`),t[0]=e.relativePath,t[1]=n);let r;t[2]===e.relativePath?r=t[3]:(r=e.relativePath.lastIndexOf(`\\`),t[2]=e.relativePath,t[3]=r);let i=Math.max(n,r),a;t[4]!==i||t[5]!==e.cwd||t[6]!==e.relativePath?(a=i>=0?Ce(e.relativePath.slice(0,i),e.cwd):e.cwd,t[4]=i,t[5]=e.cwd,t[6]=e.relativePath,t[7]=a):a=t[7];let o=a,s;return t[8]!==o||t[9]!==e.cwd||t[10]!==e.onTaskListChange||t[11]!==e.text||t[12]!==e.threadRef?(s=(0,$.jsx)(le,{text:e.text,cwd:e.cwd,imageBaseDir:o,threadRef:e.threadRef,className:`mx-auto max-w-4xl px-6 py-5`,onTaskListChange:e.onTaskListChange}),t[8]=o,t[9]=e.cwd,t[10]=e.onTaskListChange,t[11]=e.text,t[12]=e.threadRef,t[13]=s):s=t[13],s}function To({root:e,editor:t,onDismiss:n}){n(),t.setSelections([]);let r=e.querySelector(`diffs-container`)?.shadowRoot?.activeElement;r instanceof HTMLElement&&r.blur()}function Eo(e){return e.querySelector(`diffs-container`)?.shadowRoot?.activeElement?.hasAttribute(`data-content`)===!0}function Do({root:e,editor:t,isBlocked:n,onDismiss:r}){let i=i=>{n()||i.composedPath().includes(e)||To({root:e,editor:t,onDismiss:r})},a=i=>{i.key===`Escape`&&!n()&&Eo(e)&&(i.preventDefault(),i.stopImmediatePropagation(),To({root:e,editor:t,onDismiss:r}))};return document.addEventListener(`pointerdown`,i,!0),document.addEventListener(`keydown`,a,!0),()=>{document.removeEventListener(`pointerdown`,i,!0),document.removeEventListener(`keydown`,a,!0)}}function Oo(e){let t=e.renderedLine===void 0?e.fileTop+e.estimatedLine.top:e.scrollTop+e.renderedLine.top-e.viewportTop,n=e.renderedLine?.height??e.estimatedLine.height,r=Math.max(0,t-Math.max(0,(e.viewportHeight-n)/2));return Math.min(r,Math.max(0,e.scrollHeight-e.viewportHeight))}function ko(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function Ao(e,t,n){return`${e}:${t}:${ko(n)}`}function jo(e,t){return e===null||e===`.`||ie(e,t)===`.`?null:e}var Mo=e=>/\.(?:md|mdx)$/i.test(e);function No(e){switch(e.failure){case`path_not_file`:return`The path is a directory or special file, not a regular file.`;case`binary_file`:return`The file is binary and cannot be displayed as text.`;case`workspace_path_outside_root`:return`The requested path is outside the workspace.`;case`resolved_path_outside_root`:return`The path resolves to a location outside the workspace.`;case`operation_failed`:return e.operation===`realpath-workspace-root`?`The workspace folder could not be accessed.`:`The file could not be accessed or read. It may be missing or inaccessible.`;default:return e.message}}function Po(e){return e.attachmentOpen||e.relativePath&&se(e.relativePath)?!1:e.explorerOpen||e.relativePath===null}function Fo(e,t,n){return t<0||e[t]!==`[`||!/[ xX]/.test(e[t+1]??``)||e[t+2]!==`]`?e:`${e.slice(0,t+1)}${n?`x`:` `}${e.slice(t+2)}`}function Io(e){return e.draft?{_tag:`draft-workspace-file`,cwd:e.workspaceRoot,path:e.absolutePath}:{_tag:e.kind,threadId:e.threadRef.threadId,path:e.absolutePath}}var Lo=class{options;timer=null;latestContents=``;latestRevision=0;confirmedRevision=0;lastChangeAt=0;saving=!1;disposed=!1;constructor(e){this.options=e}change(e){this.disposed||(this.latestContents=e,this.latestRevision+=1,this.lastChangeAt=Date.now(),this.options.onPendingChange(!0),this.schedule(this.options.debounceMs))}dispose(){this.disposed=!0,this.clearTimer(),this.latestRevision>0&&this.persistLatest()}schedule(e){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.persistLatest()},e)}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}async persistLatest(){if(this.saving||this.latestRevision===this.confirmedRevision||this.options.canPersist?.()===!1)return;this.saving=!0;let e=this.latestContents,t=this.latestRevision,n=(await this.options.persist(e))._tag===`Success`,r=!1;if(n&&(this.confirmedRevision=t,r=this.options.onConfirmed(e)!==!1),this.saving=!1,t===this.latestRevision){r&&this.options.onPendingChange(!1);return}let i=Math.max(0,this.options.debounceMs-(Date.now()-this.lastChangeAt));this.disposed?this.persistLatest():this.schedule(i)}},Ro=500;function zo(e){let t=(0,Q.c)(17),{environmentId:n,cwd:r,relativePath:i,onPendingChange:a}=e,o=be(n,S),s=Se(re.writeFile),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.createRef)(),t[0]=c):c=t[0];let l=c,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>l.current?.change(e),t[1]=u):u=t[1];let d;t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==i||t[6]!==s?(d={change:u,setup:()=>{let e=new Lo({debounceMs:Ro,canPersist:()=>xe(n,S),onPendingChange:e=>a(i,e),persist:e=>s({environmentId:n,input:{cwd:r,relativePath:i,contents:e}}),onConfirmed:e=>dn(n,r,i,e)});return l.current=e,()=>{l.current=null,e.dispose()}}},t[2]=r,t[3]=n,t[4]=a,t[5]=i,t[6]=s,t[7]=d):d=t[7];let f=d,p;t[8]===f?p=t[9]:(p=[f],t[8]=f,t[9]=p),(0,J.useEffect)(f.setup,p);let m,h;return t[10]!==o||t[11]!==r||t[12]!==n||t[13]!==i||t[14]!==f?(m=()=>{if(!o)return;let e=!1;return queueMicrotask(()=>{if(e)return;let t=un(n,r,i);t&&f.change(t.contents)}),()=>{e=!0}},h=[o,r,n,i,f],t[10]=o,t[11]=r,t[12]=n,t[13]=i,t[14]=f,t[15]=m,t[16]=h):(m=t[15],h=t[16]),(0,J.useEffect)(m,h),f}var Bo=`t3code.fileExplorerOpen`,Vo=`t3code.renderMarkdown`,Ho=`t3code.renderBrowserFile`,Uo=`t3code.renderTable`;function Wo(e){let t=(0,Q.c)(28),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`workspace-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=$t(e.environmentId,r),[a,o]=(0,J.useState)(null),s;t[5]!==i._tag||t[6]!==i.url||t[7]!==e.workspaceMutationId?(s=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[5]=i._tag,t[6]=i.url,t[7]=e.workspaceMutationId,t[8]=s):s=t[8];let c=s,l=i._tag===`Success`?`${i.url}${c}`:null,u=e.alt,d;t[9]!==e.absolutePath||t[10]!==e.workspaceRoot?(d=yt(e.absolutePath,e.workspaceRoot),t[9]=e.absolutePath,t[10]=e.workspaceRoot,t[11]=d):d=t[11];let f;t[12]!==e.environmentId||t[13]!==r?(f={environmentId:e.environmentId,resource:r},t[12]=e.environmentId,t[13]=r,t[14]=f):f=t[14];let p;t[15]!==l||t[16]!==e.alt||t[17]!==d||t[18]!==f?(p={kind:`image`,name:u,src:l,reference:d,asset:f},t[15]=l,t[16]=e.alt,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m=p;if(i._tag===`Failure`||l!==null&&a===l){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load workspace image.`}),t[20]=e):e=t[20];let n;return t[21]===m?n=t[22]:(n=(0,$.jsx)(N,{source:m,children:e}),t[21]=m,t[22]=n),n}let h;return t[23]!==m||t[24]!==i._tag||t[25]!==l||t[26]!==e.alt?(h=i._tag===`Success`&&l!==null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,$.jsx)(N,{source:m,children:(0,$.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:l,alt:e.alt,onError:()=>o(l)})})}):(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(P,{size:`lg`})}),t[23]=m,t[24]=i._tag,t[25]=l,t[26]=e.alt,t[27]=h):h=t[27],h}function Go(e){let t=(0,Q.c)(18),n=yt(e.absolutePath,e.workspaceRoot).relativePath===void 0?`media-file`:`workspace-file`,r;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot||t[4]!==n?(r=Io({kind:n,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n,t[5]=r):r=t[5];let i=r,a=$t(e.environmentId,i),o;t[6]!==a._tag||t[7]!==a.url||t[8]!==e.workspaceMutationId?(o=e.workspaceMutationId===null?``:`${a._tag===`Success`&&a.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[6]=a._tag,t[7]=a.url,t[8]=e.workspaceMutationId,t[9]=o):o=t[9];let s=o;if(a._tag===`Failure`){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load file preview.`}),t[10]=e):e=t[10],e}if(a._tag!==`Success`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(P,{size:`lg`})}),t[11]=e):e=t[11],e}let c=`${a.url}${s}`,l=e.title,u;t[12]===e.absolutePath?u=t[13]:(u=zt(e.absolutePath),t[12]=e.absolutePath,t[13]=u);let d;return t[14]!==e.title||t[15]!==c||t[16]!==u?(d=(0,$.jsx)(Rt,{src:c,title:l,pdf:u}),t[14]=e.title,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function Ko(e){let t=(0,Q.c)(36),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=$t(e.environmentId,r),a=Zt(e.environmentId,r),o=e.workspaceMutationId,s;t[5]!==e.environmentId||t[6]!==r?(s=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=s):s=t[7];let c;t[8]===a?c=t[9]:(c=()=>{a().catch(qo)},t[8]=a,t[9]=c);let l;t[10]!==e.workspaceMutationId||t[11]!==s||t[12]!==c?(l={mutationId:o,resourceKey:s,refresh:c},t[10]=e.workspaceMutationId,t[11]=s,t[12]=c,t[13]=l):l=t[13],gn(l);let u;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(u=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=u):u=t[17];let d=u,f=i._tag===`Success`?`${i.url}${d}`:null,p=i._tag===`Failure`,m=e.name,h=e.workspaceMutationId,g=e.name,_;t[18]!==e.absolutePath||t[19]!==e.workspaceRoot?(_=yt(e.absolutePath,e.workspaceRoot),t[18]=e.absolutePath,t[19]=e.workspaceRoot,t[20]=_):_=t[20];let v;t[21]!==e.environmentId||t[22]!==r?(v={environmentId:e.environmentId,resource:r},t[21]=e.environmentId,t[22]=r,t[23]=v):v=t[23];let y;t[24]!==f||t[25]!==e.name||t[26]!==_||t[27]!==v?(y={kind:`video`,name:g,src:f,reference:_,asset:v},t[24]=f,t[25]=e.name,t[26]=_,t[27]=v,t[28]=y):y=t[28];let b;return t[29]!==f||t[30]!==e.name||t[31]!==e.workspaceMutationId||t[32]!==a||t[33]!==y||t[34]!==p?(b=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4`,children:(0,$.jsx)(M,{src:f,sourceFailed:p,label:m,revision:h,preload:`metadata`,className:`flex h-full min-h-0 w-full max-w-5xl items-center justify-center`,onRetry:a,actionsSource:y})}),t[29]=f,t[30]=e.name,t[31]=e.workspaceMutationId,t[32]=a,t[33]=y,t[34]=p,t[35]=b):b=t[35],b}function qo(){}function Jo(e){let t=(0,Q.c)(27),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=$t(e.environmentId,r),a=Zt(e.environmentId,r),[o,s]=(0,J.useState)(null),c=e.workspaceMutationId,l;t[5]!==e.environmentId||t[6]!==r?(l=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=()=>{a().catch(Xo)},t[8]=a,t[9]=u);let d;t[10]!==e.workspaceMutationId||t[11]!==l||t[12]!==u?(d={mutationId:c,resourceKey:l,refresh:u},t[10]=e.workspaceMutationId,t[11]=l,t[12]=u,t[13]=d):d=t[13],gn(d);let f;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(f=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=f):f=t[17];let p=f,m=i._tag===`Success`?`${i.url}${p}`:null;if(i._tag===`Failure`||m!==null&&o===m){let e;return t[18]===a?e=t[19]:(e=(0,$.jsx)(Gt,{message:`Unable to load audio.`,onRetry:()=>{s(null),a().catch(Yo)}}),t[18]=a,t[19]=e),e}if(m===null){let e;return t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Vt,{}),t[20]=e):e=t[20],e}let h;t[21]===m?h=t[22]:(h=()=>s(m),t[21]=m,t[22]=h);let g;return t[23]!==e.name||t[24]!==h||t[25]!==m?(g=(0,$.jsx)(It,{src:m,name:e.name,onError:h}),t[23]=e.name,t[24]=h,t[25]=m,t[26]=g):g=t[26],g}function Yo(){}function Xo(){}function Zo(e,t){let n=1;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);r===10?n+=1:r===13&&(n+=1,e.charCodeAt(t+1)===10&&(t+=1))}return Math.min(Math.max(1,t),n)}function Qo(e,t){let n=e.shadowRoot??e;for(let e of n.querySelectorAll(`[${Ut}]`))e.removeAttribute(Ut);t!==null&&(n.querySelector(`[data-line="${t}"]`)?.setAttribute(Ut,``),n.querySelector(`[data-column-number="${t}"]`)?.setAttribute(Ut,``))}var $o=30,es=20,ts=2;function ns(e,t,n){let r=(0,Q.c)(5),[i]=(0,J.useState)(rs),a;return r[0]!==e||r[1]!==t||r[2]!==n||r[3]!==i?(a=(r,a,o)=>{if(e===null)return;let s=i.get(e),c=s??{frameId:null,cancelGuard:null,handledRequestId:null,latestRequestId:null};s||i.set(e,c);let l=()=>{c.frameId!==null&&(cancelAnimationFrame(c.frameId),c.frameId=null),c.cancelGuard?.()};if(o===`unmount`){l();return}let u=a.file?.contents;if(Qo(r,t===null||u===void 0?null:Zo(u,t)),!(a instanceof Qe))return;if(c.latestRequestId!==n&&(l(),c.latestRequestId=n,c.handledRequestId=null),t===null){r.style.minHeight=``;return}let d=r.closest(`.file-preview-virtualizer`);if(!d||(r.style.minHeight=`${Math.ceil(Math.max(a.height,d.clientHeight))}px`,c.handledRequestId===n||c.frameId!==null))return;let f=e=>{let t=a.getLinePosition(e);if(!t)return null;let n=d.getBoundingClientRect(),i=d.scrollTop+r.getBoundingClientRect().top-n.top,o=(r.shadowRoot??r).querySelector(`[data-line="${e}"]`)?.getBoundingClientRect();return Oo({scrollTop:d.scrollTop,scrollHeight:d.scrollHeight,viewportTop:n.top,viewportHeight:d.clientHeight,fileTop:i,estimatedLine:t,...o&&o.height>0?{renderedLine:{top:o.top,height:o.height}}:{}})},p=e=>{let t=es,n=null,r=()=>{n!==null&&(cancelAnimationFrame(n),n=null),d.removeEventListener(`wheel`,r),d.removeEventListener(`touchstart`,r),d.removeEventListener(`pointerdown`,r,!0),window.removeEventListener(`keydown`,r,!0),c.cancelGuard===r&&(c.cancelGuard=null)};d.addEventListener(`wheel`,r,{passive:!0}),d.addEventListener(`touchstart`,r,{passive:!0}),d.addEventListener(`pointerdown`,r,{passive:!0,capture:!0}),window.addEventListener(`keydown`,r,!0);let i=()=>{if(n=null,--t,t<=0||!d.isConnected){r();return}let a=f(e);a!==null&&Math.abs(d.scrollTop-a)>ts&&(d.scrollTop=a),n=requestAnimationFrame(i)};n=requestAnimationFrame(i),c.cancelGuard=r},m=e=>{c.frameId=requestAnimationFrame(()=>{if(c.frameId=null,c.latestRequestId!==n||!r.isConnected)return;let i=a.file?.contents,o=i===void 0?null:Zo(i,t),s=o===null?null:f(o);if(o===null||s===null){e<$o&&m(e+1);return}Qo(r,o),d.scrollTop=s,c.handledRequestId=n,p(o)})};m(0)},r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a):a=r[4],a}function rs(){return new Map}var is=(e,t,n)=>new to(e,t,n);function as(e,t,n,r){return{name:n,contents:r,cacheKey:`editor:${e}:${Ao(t,n,r)}`}}function os(e,t){if(e?.isWorkingPool()!==!0||(t.lang??pn(t.name))===`text`)return!1;let n=1;for(let e=t.contents.indexOf(`
|
|
31
|
+
`)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=Ir(t,e,n);this.#Wt([i]),this.#Pe(X(i).line),this.#gt(!0),this.#pe=r},s=new ut({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#se);n!==void 0&&this.#dn(n,void 0,this.#pn(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#ce=void 0,this.#Wt(this.#se??[]);return}if(this.#ce=e,n?.syncSelection===!1){this.#Wt(this.#se??[]);let n=this.#se?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#se?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#Wt(this.#se??[]):o(a,!0),a},onClose:()=>{this.#G=void 0,this.#pe=!1,this.#ce=void 0,this.#Wt(this.#se??[])}});this.#G=s,this.#pe=!1}#en(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?``:Zr(e,t)}#tn(){let e=this.#n?.document,t=this.#se;return e===void 0||t===void 0?[]:Xr(e,t)}#nn(e,t,n){e!==null&&(e.setData(`text`,t),n.length>1&&e.setData(eo,JSON.stringify(n)))}#rn(){let e=this.#n?.document,t=this.#se;if(e===void 0||t===void 0||t.length===0)return``;if(t.some(e=>Y(e))){let n=ni(e,t);return this.#in(n.edits,n.nextSelectionOffsets),n.text}let n=Zr(e,t);return this.#an(``,void 0,!0),n}#in(e,t){let n=this.#n?.document,r=this.#se;if(n===void 0||r===void 0||e.length===0)return;let i=n.applyResolvedEdits(e,!0,r,void 0,!0);if(i===void 0)return;let a=t.map(e=>{let t=n.positionAt(e);return{start:t,end:t,direction:0}});n.setLastUndoSelectionsAfter(a),this.#dn(i,a,this.#pn(i))}#an(e,t=this.#se,n=!1,r=`selection`){if(t===void 0)return;let i=this.#n?.document,a=t.at(-1);if(i===void 0||a===void 0)return;let{nextSelections:o,change:s}=Array.isArray(e)&&e.length===t.length?Tr(i,t,e,this.#R,n,r):Sr(i,t,{start:i.offsetAt(a.start),end:i.offsetAt(a.end),text:Array.isArray(e)?e.join(i.eol):e},this.#R,void 0,n);s!==void 0&&this.#dn(s,o,this.#pn(s))}#on(e=!1){let t=this.#se,n=this.#n?.document;if(t===void 0||n===void 0)return;let{nextSelections:r,change:i}=Nr(n,t,e,this.#R,this.#r.tabSize);i!==void 0&&this.#dn(i,r,this.#pn(i))}#sn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Ar(t,e,this.#Le?(e,t)=>{let n=this.#Sn(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#cn(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=jr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#ln(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=kr(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#un(){let e=this.#se,t=this.#n?.document;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Or(t,e,this.#R);r!==void 0&&this.#dn(r,n,this.#pn(r))}#dn(e,t,n,r){this.#xe!=null&&this.#Rt(!0);let i=this.#n?.document;if(i!==void 0&&this.#W!==void 0)for(let t of this.#W)t.anchorOffset=Lr(t.anchorOffset,e.changes),t.focusOffset=Lr(t.focusOffset,e.changes),t.caret.anchor=i.positionAt(t.anchorOffset),t.caret.focus=i.positionAt(t.focusOffset);if(e.lineDelta!==0||this.#Le)for(let t of this.#m.keys())t>=e.startLine&&this.#m.delete(t);if(this.#h.size>0){if(e.lineDelta===0&&(e.changedLineRanges.length===1||e.changedLineChanges?.every(([,,e])=>e===0)===!0))for(let[t,n]of e.changedLineRanges)for(let e=t;e<=n;e++)this.#h.delete(e);else for(let t of this.#h.keys())t>=e.startLine&&this.#h.delete(t)}this.#_=void 0;let a=this.#V,o;if(a!==void 0&&t!==void 0&&t.length>0){let n=t.at(-1),r=a.startingLine+a.totalLines;if(n.end.line>=r){let t=n.end.line-a.startingLine+1,i=this.#H===void 0||this.#H===1/0?1/0:this.#H*qa;e.startLine<=r&&t<=i&&this.#Me(n.end.line)?(n.end.line>r&&(o=!0),a={...a,totalLines:t},this.#V=a):o=!0}}if(this.#I&&this.#i!=null&&this.#w!=null?this.#ct(e,n,a,o):i!=null&&(this.#P?.(i,n),n!=null&&(this.#R=n)),t!=null&&this.#Wt(t),this.#M?.__acknowledgeDocumentUpdate(),this.#De(),this.#Vt(e,r?.editSource??`user`),this.#Bt(),this.#fn(e.changes,n??this.#R),r?.skipSearchRefresh!==!0&&this.#G!==void 0&&this.#ce!==void 0&&this.#G.updateMatches({syncSelection:!1}),t!=null&&r?.skipFocus!==!0){let e=t.at(-1);if(e!==void 0&&this.#Pe(X(e).line),this.#A!==void 0)requestAnimationFrame(()=>{this.#A?.scrollIntoView({block:`nearest`,inline:`nearest`})});else if(t.length>0){let e=X(t.at(-1));this.#vt(e.line,e.character)}this.focus({preventScroll:!0})}}#fn(e,t){let n=this.getFile(),r=this.#F;n!=null&&r!=null&&r(e,n,t)}#pn(e){if(this.#R!=null){let t=Qn(e,this.#R);if(t!=null)return this.#n?.document?.setLastUndoLineAnnotations(this.#R,t),t}}#mn(){let e=this.#w;if(e===void 0)return[];let t=[];for(let n of e.children){let e=n,r=e.dataset.lineType,i=G(e);if(i===void 0||r===void 0||!Pr(r))continue;let a=i-1,o=t.at(-1);o!==void 0&&a<=o[1]+1?o[1]=Math.max(o[1],a):t.push([a,a])}return t}#hn(e){let t=this.#V;return t==null||e>=t.startingLine&&e<t.startingLine+t.totalLines}#gn(e){let t=this.#g.get(e);if(t!==void 0)return t??void 0;let n=this.#V;if(!this.#hn(e))return;let r=this.#w;if(r!==void 0){if(n!==void 0){let{startingLine:i}=n,{children:a}=r;for(let n=e-i;n<=a.length;n++){let r=a[n];if(r===void 0)break;let i=G(r),o=r.dataset.lineType;if(i!==void 0&&i===e+1&&o!==void 0&&Pr(o)){t=r;break}}}return t??=r.querySelector(`[data-line="${e+1}"]`+(this.#Fe===`unified`?`:not([data-line-type="change-deletion"])`:``)),t!==void 0&&this.#g.set(e,t),t??void 0}}#_n(){if(this.#C===void 0)return 0;if(this.#f===void 0){let e=this.#w?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);this.#f=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseInt(e.slice(0,-2),10):this.#C.offsetWidth}return this.#f}#vn(){if(this.#w===void 0)return 0;if(this.#p===void 0){let e=this.#w.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);this.#p=e!==void 0&&e.length>2&&e.endsWith(`px`)?parseFloat(e.slice(0,-2)):this.#w.offsetWidth}return this.#p}#yn(e){let t=this.#m.get(e);if(t!==void 0)return t;let n=this.#gn(e);if(n===void 0)return-1;let r=n.offsetTop+this.#r.paddingTop;return r+=this.#$e?.top??0,this.#m.set(e,r),r}#bn(e,t){if(this.#_!==void 0&&this.#_[0]===e&&this.#_[1]===t)return[this.#_[2],this.#_[3]];let n=this.#n?.document?.getLineText(e),r=this.#_n()+this.#r.ch;if(n===void 0||n.length===0||t<=0)return[r+(this.#$e?.left??0),0];let i=Fa(n,Math.min(t,n.length)),a=n.slice(0,i),o=La(a,this.#r.tabSize),s=0,c=0;if(s=o===-1?r+this.#r.measureTextWidth(a):r+o*this.#r.ch,this.#Le){let t=this.#vn();if(2*this.#r.ch+this.#r.measureTextWidth(n)>t){let t=this.#xn(e);if(t==null)return[s+(this.#$e?.left??0),0];for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=La(t,this.#r.tabSize);s=o===-1?r+this.#r.measureTextWidth(t):r+o*this.#r.ch;break}}}s+=this.#$e?.left??0}return this.#_===void 0?this.#_=[e,t,s,c]:(this.#_[0]=e,this.#_[1]=t,this.#_[2]=s,this.#_[3]=c),[s,c]}#xn(e){let t=this.#h.get(e);if(t!==void 0)return t;this.#h.size>=Ja&&this.#h.clear();let n=this.#n?.document?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#h.set(e,t),t}let r=this.#w;if(r==null||!r.isConnected)return;let i=W(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#r.tabSize.toString()},textContent:n},r),a=i.firstChild,o=document.createRange(),s=[];try{let t=i.getBoundingClientRect();if(t.width===0)return;let r=Ia(n),c=t.left+this.#r.ch,l=r===void 0?n.length:r.length-1,u=e=>r===void 0?e:r[e],d=e=>{o.setStart(a,u(e)),o.setEnd(a,u(e+1));let t=o.getClientRects();return t.item(t.length-1)??o.getBoundingClientRect()};s.push(0);let f=d(0).top,p=1;for(;p<l;){let e=p,t=l;for(;e<t;){let n=e+t>>1;d(n).top>f?t=n:e=n+1}if(e>=l)break;let{left:n,top:r}=d(e),i=Le()&&n-c>this.#r.ch/2;s.push(u(i?e-1:e)),f=r,p=e+1}let m=new Uint32Array(s.length+1);for(let e=0;e<s.length;e++)m[e]=s[e];return m[s.length]=n.length,this.#h.set(e,m),m}finally{i.remove()}}#Sn(e){let t=this.#xn(e);if(t!==void 0)return t;let n=this.#n?.document?.getLineText(e)?.length??0;return Uint32Array.of(0,n)}#Cn({startContainer:e,endContainer:t}){let n=this.#w;return n!==void 0&&n.contains(e)&&n.contains(t)}#wn(e){let t=this.#n?.document?.lineCount??0;return e<0||e>=t?!1:this.#gn(e)!==void 0}};function no({type:e,editStateKey:t,owner:n,initialState:r,previousSession:i}){if(r!=null&&r.type!==e)throw TypeError(`Editor: initialState: a ${r.type} state cannot initialize a ${e} editor`);let a=r;return t==null?a??i??(e===`file`?{type:`file`}:{type:`file-diff`}):Jn.activate(e,t,n,a)}function ro(e){return e instanceof HTMLElement?Number(e.dataset.bufferSize??1):1}function io(e,t){return t!==void 0&&Number.isInteger(t.line)&&Number.isInteger(t.character)&&t.line>=0&&t.line<e.lineCount&&t.character>=0&&t.character<=e.getLineLength(t.line)}function ao(e,t){let n=e.charCodeAt(t-1),r=e.charCodeAt(t);return t>0&&t<e.length&&n>=55296&&n<=56319&&r>=56320&&r<=57343}var Q=f(),oo=e=>{if(typeof e!=`object`||!e)return null;let t=e;return typeof t.getAttribute==`function`?t.getAttribute(`data-item-path`):null};function so(e){let t=[],n=[];return{isDragInProgress:()=>n.length>0,handleSelectionChange(e){t=e},handleDragStart(e){if(e.dataTransfer===null)return;let r=null;for(let t of e.composedPath())if(r=oo(t),r!==null)break;if(r===null)return;let i=t.includes(r)?t:[r],a=i.map(e=>yn(e)).filter(e=>e!==null);a.length!==0&&(n=i,e.dataTransfer.setData(bn,a.join(` `)))},handleDragEnd(){if(n.length!==0){for(let t of n)e.deselect(t);n=[]}}}}function co(e){return e.split(`/`).filter(Boolean).length}function lo(e,t){let n=new Set(e),r=new Set(t),i=[],a=[],o=e.filter(e=>!r.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of o){if(i.some(t=>e.startsWith(t)))continue;let t=e.endsWith(`/`);a.push({type:`remove`,path:e,...t?{recursive:!0}:{}}),t&&i.push(e)}let s=t.filter(e=>!n.has(e)).toSorted((e,t)=>co(e)-co(t));for(let e of s)a.push({type:`add`,path:e});return a}function uo(e,t){let[n,i]=(0,J.useState)(new Map),[a,o]=(0,J.useState)(new Map),[s,c]=(0,J.useState)(0),[l,d]=(0,J.useState)(new Set),f=(0,J.useRef)(new Map),p=(0,J.useRef)(new Set),m=(0,J.useRef)(new Set),h=(0,J.useRef)(!0),g=(0,J.useRef)(0),_=(0,J.useRef)([]),v=(0,J.useCallback)(function n(a,s=!1){let l=f.current.get(a);if(l)return s?l.then(()=>n(a,!0)):l;if(!s&&p.current.has(a))return Promise.resolve();p.current.add(a),m.current.add(a);let v=re.listEntries({environmentId:e,input:{cwd:t,directoryPath:a}});c(e=>e+1),s||d(e=>new Set(e).add(a));let y=(async()=>{g.current>=4?await new Promise(e=>_.current.push(e)):g.current++;try{return h.current?await A(u,v,{refresh:!0,reportFailure:!1,reportDefect:!1}):void 0}finally{let e=_.current.shift();e?e():g.current--}})().then(e=>{if(h.current&&e){if(e._tag===`Success`)i(t=>new Map(t).set(a,e.value.entries.filter(e=>e.path.slice(0,Math.max(0,e.path.lastIndexOf(`/`)))===a))),o(e=>{let t=new Map(e);return t.delete(a),t});else{p.current.delete(a);let t=r(e.cause);o(e=>new Map(e).set(a,t instanceof Error?t.message:`Unable to load folder.`))}}}).finally(()=>{f.current.delete(a),h.current&&(c(e=>e-1),s||d(e=>{let t=new Set(e);return t.delete(a),t}))});return f.current.set(a,y),y},[t,e]);(0,J.useEffect)(()=>(h.current=!0,v(``),()=>{h.current=!1}),[v]);let y=(0,J.useMemo)(()=>{let e=[],t=r=>{for(let i of n.get(r)??[])e.push(i),i.kind===`directory`&&t(i.path)};return t(``),e},[n]),b=(0,J.useMemo)(()=>new Set([``,...y.filter(e=>e.kind===`directory`).map(e=>e.path)]),[y]);return{entries:y,load:v,refresh:(0,J.useCallback)(()=>{let e=[...m.current].filter(e=>b.has(e)),t=0,n=async()=>{for(;t<e.length&&h.current;){let n=e[t++];n!==void 0&&await v(n,!0)}};for(let t=0;t<Math.min(4,e.length);t++)n()},[v,b]),isPending:s>0,loadingDirectories:l,ready:n.has(``),error:[...a].find(([e])=>b.has(e))?.[1]??null}}var $=e(y(),1);function fo(e){return e.kind===`directory`?`${e.path}/`:e.path}function po(e){let t=(0,Q.c)(12),n;t[0]===e.onRefresh?n=t[1]:(n=(0,$.jsx)(C,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Refresh workspace files`,onClick:e.onRefresh}),t[0]=e.onRefresh,t[1]=n);let r;t[2]===e.isPending?r=t[3]:(r=(0,$.jsx)(hn,{refreshing:e.isPending}),t[2]=e.isPending,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,$.jsx)(I,{render:n,children:r}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a=e.isPending?`Refreshing…`:`Refresh files`,o;t[7]===a?o=t[8]:(o=(0,$.jsx)(L,{children:a}),t[7]=a,t[8]=o);let s;return t[9]!==i||t[10]!==o?(s=(0,$.jsxs)(R,{children:[i,o]}),t[9]=i,t[10]=o,t[11]=s):s=t[11],s}function mo(e){let t=(0,Q.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):(n=t=>e.onValueChange(t.target.value),r=t=>{t.key===`Escape`&&(e.onClose(),t.currentTarget.blur())},t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==e.ariaLabel||t[4]!==e.name||t[5]!==e.value||t[6]!==n||t[7]!==r?(i=(0,$.jsx)(an,{variant:`ghost`,className:`h-7 min-w-0 flex-1`,children:(0,$.jsx)(rn,{type:`search`,name:e.name,size:`sm`,value:e.value,"aria-label":e.ariaLabel,placeholder:`Search files`,spellCheck:!1,onChange:n,onKeyDown:r})}),t[3]=e.ariaLabel,t[4]=e.name,t[5]=e.value,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function ho({environmentId:e,cwd:t,projectName:n,selectedPath:r,selectedPathRevealId:i,onOpenFile:a,onRefreshSelectedFile:o,workspaceMutationId:s}){let{resolvedTheme:c}=Te(),l=E(),u=we(e),{entries:d,load:f,refresh:p,ready:m,error:h,isPending:g,loadingDirectories:_}=uo(e,t),[v,y]=(0,J.useState)(``),[b,x]=(0,J.useState)(!1),S=Ae({environmentId:e,cwd:t,query:v.slice(0,256)},200),w=(0,J.useMemo)(()=>{let e=new Map(d.map(e=>[e.path,e]));if(v.trim()&&!S.isPending)for(let t of S.entries){e.has(t.path)||e.set(t.path,t);let n=t.path.split(`/`);for(let t=1;t<n.length;t++){let r=n.slice(0,t).join(`/`);e.has(r)||e.set(r,{path:r,kind:`directory`})}}return[...e.values()]},[d,S.entries,S.isPending,v]),T=(0,J.useMemo)(()=>new Map(w.map(e=>[e.path,e.kind])),[w]),D=(0,J.useRef)(T),O=(0,J.useMemo)(()=>w.map(fo),[w]),k=(0,J.useMemo)(()=>w.filter(e=>e.kind===`directory`).map(fo),[w]),A=(0,J.useRef)(null),ee=(0,J.useRef)(!1),te=(0,J.useRef)(null),ne=(0,J.useRef)(null),re=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=e=>{re.current={x:e.clientX,y:e.clientY,at:e.timeStamp}};return document.addEventListener(`contextmenu`,e,!0),()=>document.removeEventListener(`contextmenu`,e,!0)},[]);let ie=async(n,r)=>{let i=Ee();if(!i){r.close();return}let a=n.path.replace(/\/$/,``),o=vn(a),s=re.current,c=s!==null&&performance.now()-s.at<1e3,d=r.anchorElement.getBoundingClientRect(),f=c?{x:s.x,y:s.y}:{x:d.left,y:d.bottom},p={environmentId:e,filePath:a,workspaceRoot:t},m=u.buildItems(p);try{let e=await i.contextMenu.show([...m,{id:`copy-mention`,label:`Copy mention`},{id:`add-to-chat`,label:`Add to chat`}],f);if(e===null)return;if(m.some(t=>t.id===e)||e.startsWith(`editor:`)){await u.activate(e,p);return}if(e===`copy-mention`){try{await F(o),de.add({type:`success`,title:`Mention copied`,description:a})}catch(e){de.add({type:`error`,title:`Failed to copy mention`,description:e instanceof Error?e.message:`An error occurred.`})}return}if(e===`add-to-chat`){let e=l?.current;if(!e){de.add({type:`error`,title:`Unable to add to chat`,description:`Open a chat for this project and try again.`});return}e.insertTextAtEnd(`${o} `,{ensureLeadingBoundary:!0})||de.add({type:`error`,title:`Unable to add to chat`,description:`The chat isn't ready to accept input right now.`})}}finally{r.close()}},ae=(0,J.useRef)(ie);(0,J.useEffect)(()=>{ae.current=ie});let oe=(0,J.useRef)(_),se=(0,J.useRef)(null),ce=(0,J.useMemo)(()=>so({deselect:e=>se.current?.getItem(e)?.deselect()}),[]),{model:j}=Mt({composition:{contextMenu:{triggerMode:`right-click`,onOpen:(e,t)=>{ae.current(e,t)}}},dragAndDrop:{canDrop:()=>!1},density:`compact`,fileTreeSearchMode:`hide-non-matches`,flattenEmptyDirectories:!0,initialExpansion:`closed`,icons:Pt,onSelectionChange:e=>{if(ce.handleSelectionChange(e),ee.current||ce.isDragInProgress())return;let t=e.at(-1)?.replace(/\/$/,``);t&&D.current.get(t)===`file`&&(te.current=t,a(t))},paths:[],renderRowDecoration:({item:e,row:t})=>t.kind===`directory`&&t.isExpanded&&oe.current.has(e.path.replace(/\/$/,``))?{icon:`t3-tree-icon-loading`,title:`Loading…`}:null,search:!1,onSearchChange:e=>y(e??``),unsafeCSS:jt});(0,J.useEffect)(()=>{oe.current!==_&&(oe.current=_,j.setComposition(j.getComposition()))},[_,j]);let M=Cn(j),N=At(j,e=>Nt(e,k)),le=()=>{let e=!(b||N);x(e),kt(j,k,e)},ue=()=>{y(``),M.close()},P=(0,J.useRef)(new Set);(0,J.useEffect)(()=>{let e=new Set(k);for(let t of P.current)e.has(t)||P.current.delete(t);let t=()=>{if(!j.isSearchOpen())for(let e of k){let t=j.getItem(e);t?.isDirectory()&&`isExpanded`in t&&t.isExpanded()?P.current.has(e)||(P.current.add(e),f(e.replace(/\/$/,``))):(t?.isDirectory()&&P.current.has(e)&&x(!1),P.current.delete(e))}};return t(),j.subscribe(t)},[k,f,j]),(0,J.useEffect)(()=>{j.setGitStatus(w.filter(e=>e.ignored).map(e=>({path:fo(e),status:`ignored`})))},[w,j]),(0,J.useEffect)(()=>{if(!r)return;let e=new AbortController;return(async()=>{let t=r.split(`/`);for(let n=0;n<t.length&&!e.signal.aborted;n++)await f(t.slice(0,n).join(`/`))})(),()=>{e.abort()}},[f,r]);let I=e=>{if(y(e),e.trim().length===0){M.close();return}M.setValue(e)},L=()=>{p(),v.trim()&&S.refresh(),o?.()};gn({mutationId:s,refresh:()=>{p(),v.trim()&&S.refresh()},resourceKey:`files:${e}:${t}`}),(0,J.useEffect)(()=>{if(!m||A.current===O)return;D.current=T;let e=A.current;if(A.current=O,e===null){j.resetPaths(O);return}let t=lo(e,O);t.length>0&&j.batch(t)},[m,T,j,O]),(0,J.useEffect)(()=>{b&&!v.trim()&&kt(j,k,!0)},[k,b,j,v]),(0,J.useEffect)(()=>{if(!r){ne.current=null;return}let e=T.get(r);if(e===void 0){ne.current=null;return}let t={path:r,revealId:i},n=ne.current;if(n?.path===t.path&&n.revealId===t.revealId)return;let a=e===`directory`?`${r}/`:r,o=j.getItem(a);if(!o)return;if(j.getSelectedPaths().some(e=>e.replace(/\/$/,``)===r)&&te.current===r){te.current=null,ne.current=t;return}te.current=null,ne.current=t,ee.current=!0,y(``),j.closeSearch();for(let e of j.getSelectedPaths())j.getItem(e)?.deselect();let s=r.split(`/`),c=``;for(let e of s.slice(0,-1)){c=c?`${c}/${e}`:e;let t=j.getItem(`${c}/`)??j.getItem(c);t&&`expand`in t&&t.expand()}`expand`in o&&o.expand(),o.select(),j.scrollToPath(a,{focus:!0,offset:`center`}),queueMicrotask(()=>{ee.current=!1})},[T,j,r,i]);let R=(0,J.useRef)(null);return(0,J.useEffect)(()=>{se.current=j},[j]),(0,J.useEffect)(()=>{let e=R.current;if(e===null)return;let t=e=>ce.handleDragStart(e),n=()=>ce.handleDragEnd();return e.addEventListener(`dragstart`,t,!0),e.addEventListener(`dragend`,n),()=>{e.removeEventListener(`dragstart`,t,!0),e.removeEventListener(`dragend`,n)}},[ce]),(0,$.jsxs)(`div`,{ref:R,className:`flex min-h-0 flex-1 flex-col bg-background`,"data-file-browser-panel":`${e}:${t}`,children:[(0,$.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-1 in-data-[preview-panel-mode=inline]:h-9 in-data-[preview-panel-mode=inline]:min-h-9 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[(0,$.jsx)(po,{isPending:g,onRefresh:L}),(0,$.jsx)(mo,{name:`project-files-search`,ariaLabel:`Search ${n} files`,value:M.value,onValueChange:I,onClose:ue}),k.length>0?(0,$.jsx)(C,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":b||N?`Collapse all folders`:`Expand all folders`,onClick:le,children:(0,$.jsx)(fe,{className:`size-3.5`,icon:N?me:pe})}):null]}),h||S.error?(0,$.jsxs)(`button`,{type:`button`,onClick:L,className:`p-4 text-left text-xs leading-relaxed text-destructive`,children:[h??S.error,` Click to retry.`]}):null,v.trim()&&S.truncated&&!S.isPending?(0,$.jsx)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,children:`More matches available. Refine your search.`}):null,(!m||S.isPending)&&(0,$.jsx)(`div`,{role:`status`,className:`px-3 py-1 text-xs text-muted-foreground`,children:`Loading files…`}),(0,$.jsx)(Dt,{model:j,"aria-label":`${n} files`,className:`min-h-0 flex-1 overflow-hidden`,style:Ot(c)})]})}function go(e,t){let n=se(t),r=j(t)?`\\`:`/`,i=t.split(/[\\/]/).filter(Boolean),a=t.startsWith(`\\\\`)?`\\\\`:n&&r===`/`?`/`:``;return[...n?[]:[{label:e,path:``,kind:`project`}],...i.map((e,t)=>({label:e,path:a+i.slice(0,t+1).join(r),kind:t===i.length-1?`file`:`directory`}))]}function _o(e,t){let n,r=t?`${t}/`:``;return e.flatMap(e=>{if(!e.path.startsWith(r))return[];let t=e.path.slice(r.length);return!t||t.includes(`/`)?[]:[{...e,label:t}]}).toSorted((e,t)=>e.kind===t.kind?(n??=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),n.compare(e.label,t.label)):e.kind===`directory`?-1:1)}function vo(e){if(!e)return null;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function yo(e,t){return e.slice(e.lastIndexOf(`/`)+1)||t}function bo(e){let t=(0,Q.c)(12),n=e.current?`font-medium text-foreground`:`text-muted-foreground`,r;t[0]===n?r=t[1]:(r=w(`block max-w-40 truncate rounded-sm px-0.5`,n),t[0]=n,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{className:r}),t[2]=r,t[3]=i);let a;t[4]!==e.label||t[5]!==i?(a=(0,$.jsx)(I,{render:i,children:e.label}),t[4]=e.label,t[5]=i,t[6]=a):a=t[6];let o;t[7]===e.pathLabel?o=t[8]:(o=(0,$.jsx)(L,{side:`top`,children:e.pathLabel}),t[7]=e.pathLabel,t[8]=o);let s;return t[9]!==a||t[10]!==o?(s=(0,$.jsxs)(R,{children:[a,o]}),t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function xo(e){let t=(0,Q.c)(44),r=fn(e.environmentId,e.cwd,e.directoryPath),i=`files:${e.environmentId}:${e.cwd}`,a;t[0]!==r.refresh||t[1]!==e.workspaceMutationId||t[2]!==i?(a={mutationId:e.workspaceMutationId,refresh:r.refresh,resourceKey:i},t[0]=r.refresh,t[1]=e.workspaceMutationId,t[2]=i,t[3]=a):a=t[3],gn(a);let{resolvedTheme:o}=Te(),s;t[4]===r.data?.entries?s=t[5]:(s=r.data?.entries??[],t[4]=r.data?.entries,t[5]=s);let c=s,l=r.data?.truncated??!1,u;t[6]!==c||t[7]!==e.directoryPath?(u=_o(c,e.directoryPath),t[6]=c,t[7]=e.directoryPath,t[8]=u):u=t[8];let f=u,m=r.data!==null,_,v,y,b,x;if(t[9]!==e){let n=vo(e.directoryPath),r=e.directoryPath!==e.rootPath&&n!==null&&(e.rootPath===``||n===e.rootPath||n.startsWith(`${e.rootPath}/`));_=g,v=`start`,y=`bottom`,b=t=>{t.key===`ArrowLeft`&&r&&n!==null&&(t.preventDefault(),t.stopPropagation(),e.onDirectoryChange(n))},x=r&&n!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(h,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(n),children:[(0,$.jsx)(d,{}),(0,$.jsxs)(`span`,{className:`truncate`,children:[`Back to `,yo(n,e.projectName)]})]}),(0,$.jsx)(T,{})]}):null,t[9]=e,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x}else _=t[10],v=t[11],y=t[12],b=t[13],x=t[14];let C;t[15]!==f||t[16]!==m||t[17]!==r.data||t[18]!==r.error||t[19]!==r.isPending||t[20]!==r.refresh||t[21]!==l||t[22]!==e||t[23]!==o?(C=r.isPending&&r.data===null?(0,$.jsxs)(h,{disabled:!0,children:[(0,$.jsx)(P,{}),`Loading folder…`]}):r.error&&r.data===null?(0,$.jsxs)(h,{closeOnClick:!1,onClick:r.refresh,children:[(0,$.jsx)(hn,{refreshing:r.isPending}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Retry loading folder`})]}):!m&&!l?(0,$.jsx)(h,{disabled:!0,children:`This folder is no longer available.`}):f.length===0?(0,$.jsx)(h,{disabled:!0,children:l?`No entries from this folder are available in the partial workspace index.`:`This folder is empty.`}):(0,$.jsx)(p,{value:e.currentFilePath,onValueChange:t=>{e.onOpenChange(!1),e.onOpenFile(t)},children:f.map(t=>{let r=t.kind===`file`&&t.path===e.currentFilePath,i=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(nn,{pathValue:t.path,kind:t.kind,theme:o}),(0,$.jsxs)(R,{children:[(0,$.jsx)(I,{render:(0,$.jsx)(`span`,{className:w(`min-w-0 flex-1 truncate`,t.ignored&&`text-muted-foreground`)}),children:t.label}),(0,$.jsx)(L,{side:`right`,children:t.path})]})]});return t.kind===`directory`?(0,$.jsxs)(h,{closeOnClick:!1,onClick:()=>e.onDirectoryChange(t.path),children:[i,(0,$.jsx)(D,{})]},t.path):(0,$.jsx)(n,{value:t.path,closeOnClick:!0,"aria-current":r?`page`:void 0,children:(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:i})},t.path)})}),t[15]=f,t[16]=m,t[17]=r.data,t[18]=r.error,t[19]=r.isPending,t[20]=r.refresh,t[21]=l,t[22]=e,t[23]=o,t[24]=C):C=t[24];let E;t[25]!==e.directoryPath||t[26]!==C?(E=(0,$.jsx)(S,{children:C},e.directoryPath),t[25]=e.directoryPath,t[26]=C,t[27]=E):E=t[27];let O;t[28]!==r.data||t[29]!==r.error||t[30]!==r.isPending||t[31]!==r.refresh?(O=r.error&&r.data!==null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{}),(0,$.jsxs)(h,{closeOnClick:!1,onClick:r.refresh,children:[(0,$.jsx)(hn,{refreshing:r.isPending}),`Refresh failed — retry`]})]}):null,t[28]=r.data,t[29]=r.error,t[30]=r.isPending,t[31]=r.refresh,t[32]=O):O=t[32];let k;t[33]===l?k=t[34]:(k=l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{}),(0,$.jsx)(h,{disabled:!0,children:`Some workspace entries are not shown.`})]}):null,t[33]=l,t[34]=k);let A;return t[35]!==_||t[36]!==O||t[37]!==k||t[38]!==v||t[39]!==y||t[40]!==b||t[41]!==x||t[42]!==E?(A=(0,$.jsxs)(_,{align:v,side:y,onKeyDown:b,children:[x,E,O,k]}),t[35]=_,t[36]=O,t[37]=k,t[38]=v,t[39]=y,t[40]=b,t[41]=x,t[42]=E,t[43]=A):A=t[43],A}function So(e){let t=(0,Q.c)(35),[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(e.crumb.path),o;t[0]===e.crumb.path?o=t[1]:(o=()=>{r(!1),a(e.crumb.path)},t[0]=e.crumb.path,t[1]=o);let s;t[2]!==e.crumb.path||t[3]!==e.relativePath?(s=[e.crumb.path,e.relativePath],t[2]=e.crumb.path,t[3]=e.relativePath,t[4]=s):s=t[4],(0,J.useEffect)(o,s);let c;t[5]===e.crumb.path?c=t[6]:(c=t=>{r(t),t&&a(e.crumb.path)},t[5]=e.crumb.path,t[6]=c);let u=c,d=`Browse ${e.crumb.label}`,f;t[7]===d?f=t[8]:(f=(0,$.jsx)(x,{render:(0,$.jsx)(`button`,{type:`button`,"aria-label":d,className:`relative block max-w-40 cursor-pointer rounded-sm px-0.5 text-left text-muted-foreground outline-none pointer-coarse:after:-inset-y-3 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-popup-open:bg-accent data-popup-open:text-foreground`})}),t[7]=d,t[8]=f);let p;t[9]===e.crumb.label?p=t[10]:(p=(0,$.jsx)(`span`,{className:`block truncate`,children:e.crumb.label}),t[9]=e.crumb.label,t[10]=p);let m;t[11]!==f||t[12]!==p?(m=(0,$.jsx)(I,{render:f,children:p}),t[11]=f,t[12]=p,t[13]=m):m=t[13];let h=e.crumb.path||e.projectName,g;t[14]===h?g=t[15]:(g=(0,$.jsx)(L,{side:`top`,children:h}),t[14]=h,t[15]=g);let _;t[16]!==m||t[17]!==g?(_=(0,$.jsxs)(R,{children:[m,g]}),t[16]=m,t[17]=g,t[18]=_):_=t[18];let v;t[19]!==i||t[20]!==u||t[21]!==n||t[22]!==e.crumb.path||t[23]!==e.cwd||t[24]!==e.environmentId||t[25]!==e.onOpenFile||t[26]!==e.projectName||t[27]!==e.relativePath||t[28]!==e.workspaceMutationId?(v=n?(0,$.jsx)(xo,{cwd:e.cwd,currentFilePath:e.relativePath,directoryPath:i,environmentId:e.environmentId,onDirectoryChange:a,onOpenChange:u,onOpenFile:e.onOpenFile,projectName:e.projectName,rootPath:e.crumb.path,workspaceMutationId:e.workspaceMutationId}):null,t[19]=i,t[20]=u,t[21]=n,t[22]=e.crumb.path,t[23]=e.cwd,t[24]=e.environmentId,t[25]=e.onOpenFile,t[26]=e.projectName,t[27]=e.relativePath,t[28]=e.workspaceMutationId,t[29]=v):v=t[29];let y;return t[30]!==u||t[31]!==n||t[32]!==v||t[33]!==_?(y=(0,$.jsxs)(l,{open:n,onOpenChange:u,children:[_,v]}),t[30]=u,t[31]=n,t[32]=v,t[33]=_,t[34]=y):y=t[34],y}function Co(e){let t=(0,Q.c)(12),n;t[0]===e.relativePath?n=t[1]:(n=se(e.relativePath),t[0]=e.relativePath,t[1]=n);let r=n,i;t[2]!==e.projectName||t[3]!==e.relativePath?(i=go(e.projectName,e.relativePath),t[2]=e.projectName,t[3]=e.relativePath,t[4]=i):i=t[4];let a=i,o;if(t[5]!==a||t[6]!==r||t[7]!==e){let n;t[9]!==r||t[10]!==e?(n=(t,n)=>(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center`,"data-current-file-crumb":t.kind===`file`,children:[n>0?(0,$.jsx)(D,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}):null,t.kind===`file`?(0,$.jsx)(`span`,{"aria-current":`page`,children:(0,$.jsx)(bo,{current:!0,label:t.label,pathLabel:t.path})}):r?(0,$.jsx)(bo,{label:t.label,pathLabel:t.path}):(0,$.jsx)(So,{...e,crumb:t})]},t.path||`project`),t[9]=r,t[10]=e,t[11]=n):n=t[11],o=a.map(n),t[5]=a,t[6]=r,t[7]=e,t[8]=o}else o=t[8];return o}function wo(e){let t=(0,Q.c)(14),n;t[0]===e.relativePath?n=t[1]:(n=e.relativePath.lastIndexOf(`/`),t[0]=e.relativePath,t[1]=n);let r;t[2]===e.relativePath?r=t[3]:(r=e.relativePath.lastIndexOf(`\\`),t[2]=e.relativePath,t[3]=r);let i=Math.max(n,r),a;t[4]!==i||t[5]!==e.cwd||t[6]!==e.relativePath?(a=i>=0?Ce(e.relativePath.slice(0,i),e.cwd):e.cwd,t[4]=i,t[5]=e.cwd,t[6]=e.relativePath,t[7]=a):a=t[7];let o=a,s;return t[8]!==o||t[9]!==e.cwd||t[10]!==e.onTaskListChange||t[11]!==e.text||t[12]!==e.threadRef?(s=(0,$.jsx)(le,{text:e.text,cwd:e.cwd,imageBaseDir:o,threadRef:e.threadRef,className:`mx-auto max-w-4xl px-6 py-5`,onTaskListChange:e.onTaskListChange}),t[8]=o,t[9]=e.cwd,t[10]=e.onTaskListChange,t[11]=e.text,t[12]=e.threadRef,t[13]=s):s=t[13],s}function To({root:e,editor:t,onDismiss:n}){n(),t.setSelections([]);let r=e.querySelector(`diffs-container`)?.shadowRoot?.activeElement;r instanceof HTMLElement&&r.blur()}function Eo(e){return e.querySelector(`diffs-container`)?.shadowRoot?.activeElement?.hasAttribute(`data-content`)===!0}function Do({root:e,editor:t,isBlocked:n,onDismiss:r}){let i=i=>{n()||i.composedPath().includes(e)||To({root:e,editor:t,onDismiss:r})},a=i=>{i.key===`Escape`&&!n()&&Eo(e)&&(i.preventDefault(),i.stopImmediatePropagation(),To({root:e,editor:t,onDismiss:r}))};return document.addEventListener(`pointerdown`,i,!0),document.addEventListener(`keydown`,a,!0),()=>{document.removeEventListener(`pointerdown`,i,!0),document.removeEventListener(`keydown`,a,!0)}}function Oo(e){let t=e.renderedLine===void 0?e.fileTop+e.estimatedLine.top:e.scrollTop+e.renderedLine.top-e.viewportTop,n=e.renderedLine?.height??e.estimatedLine.height,r=Math.max(0,t-Math.max(0,(e.viewportHeight-n)/2));return Math.min(r,Math.max(0,e.scrollHeight-e.viewportHeight))}function ko(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function Ao(e,t,n){return`${e}:${t}:${ko(n)}`}function jo(e,t){return e===null||e===`.`||ie(e,t)===`.`?null:e}var Mo=e=>/\.(?:md|mdx)$/i.test(e);function No(e){switch(e.failure){case`path_not_file`:return`The path is a directory or special file, not a regular file.`;case`binary_file`:return`The file is binary and cannot be displayed as text.`;case`workspace_path_outside_root`:return`The requested path is outside the workspace.`;case`resolved_path_outside_root`:return`The path resolves to a location outside the workspace.`;case`operation_failed`:return e.operation===`realpath-workspace-root`?`The workspace folder could not be accessed.`:`The file could not be accessed or read. It may be missing or inaccessible.`;default:return e.message}}function Po(e){return e.attachmentOpen||e.relativePath&&se(e.relativePath)?!1:e.explorerOpen||e.relativePath===null}function Fo(e,t,n){return t<0||e[t]!==`[`||!/[ xX]/.test(e[t+1]??``)||e[t+2]!==`]`?e:`${e.slice(0,t+1)}${n?`x`:` `}${e.slice(t+2)}`}function Io(e){return e.draft?{_tag:`draft-workspace-file`,cwd:e.workspaceRoot,path:e.absolutePath}:{_tag:e.kind,threadId:e.threadRef.threadId,path:e.absolutePath}}var Lo=class{options;timer=null;latestContents=``;latestRevision=0;confirmedRevision=0;lastChangeAt=0;saving=!1;disposed=!1;constructor(e){this.options=e}change(e){this.disposed||(this.latestContents=e,this.latestRevision+=1,this.lastChangeAt=Date.now(),this.options.onPendingChange(!0),this.schedule(this.options.debounceMs))}dispose(){this.disposed=!0,this.clearTimer(),this.latestRevision>0&&this.persistLatest()}schedule(e){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.persistLatest()},e)}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}async persistLatest(){if(this.saving||this.latestRevision===this.confirmedRevision||this.options.canPersist?.()===!1)return;this.saving=!0;let e=this.latestContents,t=this.latestRevision,n=(await this.options.persist(e))._tag===`Success`,r=!1;if(n&&(this.confirmedRevision=t,r=this.options.onConfirmed(e)!==!1),this.saving=!1,t===this.latestRevision){r&&this.options.onPendingChange(!1);return}let i=Math.max(0,this.options.debounceMs-(Date.now()-this.lastChangeAt));this.disposed?this.persistLatest():this.schedule(i)}},Ro=500;function zo(e){let t=(0,Q.c)(17),{environmentId:n,cwd:r,relativePath:i,onPendingChange:a}=e,o=be(n,b),s=Se(re.writeFile),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.createRef)(),t[0]=c):c=t[0];let l=c,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>l.current?.change(e),t[1]=u):u=t[1];let d;t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==i||t[6]!==s?(d={change:u,setup:()=>{let e=new Lo({debounceMs:Ro,canPersist:()=>xe(n,b),onPendingChange:e=>a(i,e),persist:e=>s({environmentId:n,input:{cwd:r,relativePath:i,contents:e}}),onConfirmed:e=>dn(n,r,i,e)});return l.current=e,()=>{l.current=null,e.dispose()}}},t[2]=r,t[3]=n,t[4]=a,t[5]=i,t[6]=s,t[7]=d):d=t[7];let f=d,p;t[8]===f?p=t[9]:(p=[f],t[8]=f,t[9]=p),(0,J.useEffect)(f.setup,p);let m,h;return t[10]!==o||t[11]!==r||t[12]!==n||t[13]!==i||t[14]!==f?(m=()=>{if(!o)return;let e=!1;return queueMicrotask(()=>{if(e)return;let t=un(n,r,i);t&&f.change(t.contents)}),()=>{e=!0}},h=[o,r,n,i,f],t[10]=o,t[11]=r,t[12]=n,t[13]=i,t[14]=f,t[15]=m,t[16]=h):(m=t[15],h=t[16]),(0,J.useEffect)(m,h),f}var Bo=`t3code.fileExplorerOpen`,Vo=`t3code.renderMarkdown`,Ho=`t3code.renderBrowserFile`,Uo=`t3code.renderTable`;function Wo(e){let t=(0,Q.c)(28),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`workspace-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=$t(e.environmentId,r),[a,o]=(0,J.useState)(null),s;t[5]!==i._tag||t[6]!==i.url||t[7]!==e.workspaceMutationId?(s=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[5]=i._tag,t[6]=i.url,t[7]=e.workspaceMutationId,t[8]=s):s=t[8];let c=s,l=i._tag===`Success`?`${i.url}${c}`:null,u=e.alt,d;t[9]!==e.absolutePath||t[10]!==e.workspaceRoot?(d=yt(e.absolutePath,e.workspaceRoot),t[9]=e.absolutePath,t[10]=e.workspaceRoot,t[11]=d):d=t[11];let f;t[12]!==e.environmentId||t[13]!==r?(f={environmentId:e.environmentId,resource:r},t[12]=e.environmentId,t[13]=r,t[14]=f):f=t[14];let p;t[15]!==l||t[16]!==e.alt||t[17]!==d||t[18]!==f?(p={kind:`image`,name:u,src:l,reference:d,asset:f},t[15]=l,t[16]=e.alt,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m=p;if(i._tag===`Failure`||l!==null&&a===l){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load workspace image.`}),t[20]=e):e=t[20];let n;return t[21]===m?n=t[22]:(n=(0,$.jsx)(N,{source:m,children:e}),t[21]=m,t[22]=n),n}let h;return t[23]!==m||t[24]!==i._tag||t[25]!==l||t[26]!==e.alt?(h=i._tag===`Success`&&l!==null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,$.jsx)(N,{source:m,children:(0,$.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:l,alt:e.alt,onError:()=>o(l)})})}):(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(P,{size:`lg`})}),t[23]=m,t[24]=i._tag,t[25]=l,t[26]=e.alt,t[27]=h):h=t[27],h}function Go(e){let t=(0,Q.c)(18),n=yt(e.absolutePath,e.workspaceRoot).relativePath===void 0?`media-file`:`workspace-file`,r;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot||t[4]!==n?(r=Io({kind:n,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n,t[5]=r):r=t[5];let i=r,a=$t(e.environmentId,i),o;t[6]!==a._tag||t[7]!==a.url||t[8]!==e.workspaceMutationId?(o=e.workspaceMutationId===null?``:`${a._tag===`Success`&&a.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[6]=a._tag,t[7]=a.url,t[8]=e.workspaceMutationId,t[9]=o):o=t[9];let s=o;if(a._tag===`Failure`){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load file preview.`}),t[10]=e):e=t[10],e}if(a._tag!==`Success`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(P,{size:`lg`})}),t[11]=e):e=t[11],e}let c=`${a.url}${s}`,l=e.title,u;t[12]===e.absolutePath?u=t[13]:(u=zt(e.absolutePath),t[12]=e.absolutePath,t[13]=u);let d;return t[14]!==e.title||t[15]!==c||t[16]!==u?(d=(0,$.jsx)(Rt,{src:c,title:l,pdf:u}),t[14]=e.title,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function Ko(e){let t=(0,Q.c)(36),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=$t(e.environmentId,r),a=Zt(e.environmentId,r),o=e.workspaceMutationId,s;t[5]!==e.environmentId||t[6]!==r?(s=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=s):s=t[7];let c;t[8]===a?c=t[9]:(c=()=>{a().catch(qo)},t[8]=a,t[9]=c);let l;t[10]!==e.workspaceMutationId||t[11]!==s||t[12]!==c?(l={mutationId:o,resourceKey:s,refresh:c},t[10]=e.workspaceMutationId,t[11]=s,t[12]=c,t[13]=l):l=t[13],gn(l);let u;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(u=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=u):u=t[17];let d=u,f=i._tag===`Success`?`${i.url}${d}`:null,p=i._tag===`Failure`,m=e.name,h=e.workspaceMutationId,g=e.name,_;t[18]!==e.absolutePath||t[19]!==e.workspaceRoot?(_=yt(e.absolutePath,e.workspaceRoot),t[18]=e.absolutePath,t[19]=e.workspaceRoot,t[20]=_):_=t[20];let v;t[21]!==e.environmentId||t[22]!==r?(v={environmentId:e.environmentId,resource:r},t[21]=e.environmentId,t[22]=r,t[23]=v):v=t[23];let y;t[24]!==f||t[25]!==e.name||t[26]!==_||t[27]!==v?(y={kind:`video`,name:g,src:f,reference:_,asset:v},t[24]=f,t[25]=e.name,t[26]=_,t[27]=v,t[28]=y):y=t[28];let b;return t[29]!==f||t[30]!==e.name||t[31]!==e.workspaceMutationId||t[32]!==a||t[33]!==y||t[34]!==p?(b=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4`,children:(0,$.jsx)(M,{src:f,sourceFailed:p,label:m,revision:h,preload:`metadata`,className:`flex h-full min-h-0 w-full max-w-5xl items-center justify-center`,onRetry:a,actionsSource:y})}),t[29]=f,t[30]=e.name,t[31]=e.workspaceMutationId,t[32]=a,t[33]=y,t[34]=p,t[35]=b):b=t[35],b}function qo(){}function Jo(e){let t=(0,Q.c)(27),n;t[0]!==e.absolutePath||t[1]!==e.draft||t[2]!==e.threadRef||t[3]!==e.workspaceRoot?(n=Io({kind:`media-file`,threadRef:e.threadRef,draft:e.draft,workspaceRoot:e.workspaceRoot,absolutePath:e.absolutePath}),t[0]=e.absolutePath,t[1]=e.draft,t[2]=e.threadRef,t[3]=e.workspaceRoot,t[4]=n):n=t[4];let r=n,i=$t(e.environmentId,r),a=Zt(e.environmentId,r),[o,s]=(0,J.useState)(null),c=e.workspaceMutationId,l;t[5]!==e.environmentId||t[6]!==r?(l=JSON.stringify([e.environmentId,r]),t[5]=e.environmentId,t[6]=r,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=()=>{a().catch(Xo)},t[8]=a,t[9]=u);let d;t[10]!==e.workspaceMutationId||t[11]!==l||t[12]!==u?(d={mutationId:c,resourceKey:l,refresh:u},t[10]=e.workspaceMutationId,t[11]=l,t[12]=u,t[13]=d):d=t[13],gn(d);let f;t[14]!==i._tag||t[15]!==i.url||t[16]!==e.workspaceMutationId?(f=e.workspaceMutationId===null?``:`${i._tag===`Success`&&i.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[14]=i._tag,t[15]=i.url,t[16]=e.workspaceMutationId,t[17]=f):f=t[17];let p=f,m=i._tag===`Success`?`${i.url}${p}`:null;if(i._tag===`Failure`||m!==null&&o===m){let e;return t[18]===a?e=t[19]:(e=(0,$.jsx)(Gt,{message:`Unable to load audio.`,onRetry:()=>{s(null),a().catch(Yo)}}),t[18]=a,t[19]=e),e}if(m===null){let e;return t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Vt,{}),t[20]=e):e=t[20],e}let h;t[21]===m?h=t[22]:(h=()=>s(m),t[21]=m,t[22]=h);let g;return t[23]!==e.name||t[24]!==h||t[25]!==m?(g=(0,$.jsx)(It,{src:m,name:e.name,onError:h}),t[23]=e.name,t[24]=h,t[25]=m,t[26]=g):g=t[26],g}function Yo(){}function Xo(){}function Zo(e,t){let n=1;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);r===10?n+=1:r===13&&(n+=1,e.charCodeAt(t+1)===10&&(t+=1))}return Math.min(Math.max(1,t),n)}function Qo(e,t){let n=e.shadowRoot??e;for(let e of n.querySelectorAll(`[${Ut}]`))e.removeAttribute(Ut);t!==null&&(n.querySelector(`[data-line="${t}"]`)?.setAttribute(Ut,``),n.querySelector(`[data-column-number="${t}"]`)?.setAttribute(Ut,``))}var $o=30,es=20,ts=2;function ns(e,t,n){let r=(0,Q.c)(5),[i]=(0,J.useState)(rs),a;return r[0]!==e||r[1]!==t||r[2]!==n||r[3]!==i?(a=(r,a,o)=>{if(e===null)return;let s=i.get(e),c=s??{frameId:null,cancelGuard:null,handledRequestId:null,latestRequestId:null};s||i.set(e,c);let l=()=>{c.frameId!==null&&(cancelAnimationFrame(c.frameId),c.frameId=null),c.cancelGuard?.()};if(o===`unmount`){l();return}let u=a.file?.contents;if(Qo(r,t===null||u===void 0?null:Zo(u,t)),!(a instanceof Qe))return;if(c.latestRequestId!==n&&(l(),c.latestRequestId=n,c.handledRequestId=null),t===null){r.style.minHeight=``;return}let d=r.closest(`.file-preview-virtualizer`);if(!d||(r.style.minHeight=`${Math.ceil(Math.max(a.height,d.clientHeight))}px`,c.handledRequestId===n||c.frameId!==null))return;let f=e=>{let t=a.getLinePosition(e);if(!t)return null;let n=d.getBoundingClientRect(),i=d.scrollTop+r.getBoundingClientRect().top-n.top,o=(r.shadowRoot??r).querySelector(`[data-line="${e}"]`)?.getBoundingClientRect();return Oo({scrollTop:d.scrollTop,scrollHeight:d.scrollHeight,viewportTop:n.top,viewportHeight:d.clientHeight,fileTop:i,estimatedLine:t,...o&&o.height>0?{renderedLine:{top:o.top,height:o.height}}:{}})},p=e=>{let t=es,n=null,r=()=>{n!==null&&(cancelAnimationFrame(n),n=null),d.removeEventListener(`wheel`,r),d.removeEventListener(`touchstart`,r),d.removeEventListener(`pointerdown`,r,!0),window.removeEventListener(`keydown`,r,!0),c.cancelGuard===r&&(c.cancelGuard=null)};d.addEventListener(`wheel`,r,{passive:!0}),d.addEventListener(`touchstart`,r,{passive:!0}),d.addEventListener(`pointerdown`,r,{passive:!0,capture:!0}),window.addEventListener(`keydown`,r,!0);let i=()=>{if(n=null,--t,t<=0||!d.isConnected){r();return}let a=f(e);a!==null&&Math.abs(d.scrollTop-a)>ts&&(d.scrollTop=a),n=requestAnimationFrame(i)};n=requestAnimationFrame(i),c.cancelGuard=r},m=e=>{c.frameId=requestAnimationFrame(()=>{if(c.frameId=null,c.latestRequestId!==n||!r.isConnected)return;let i=a.file?.contents,o=i===void 0?null:Zo(i,t),s=o===null?null:f(o);if(o===null||s===null){e<$o&&m(e+1);return}Qo(r,o),d.scrollTop=s,c.handledRequestId=n,p(o)})};m(0)},r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a):a=r[4],a}function rs(){return new Map}var is=(e,t,n)=>new to(e,t,n);function as(e,t,n,r){return{name:n,contents:r,cacheKey:`editor:${e}:${Ao(t,n,r)}`}}function os(e,t){if(e?.isWorkingPool()!==!0||(t.lang??pn(t.name))===`text`)return!1;let n=1;for(let e=t.contents.indexOf(`
|
|
32
32
|
`);e!==-1;e=t.contents.indexOf(`
|
|
33
|
-
`,e+1))n+=1;return n<=B}function ss(e){let t=(0,Q.c)(15),n=Re(),[r,i]=(0,J.useState)(null),a;t[0]!==e||t[1]!==n?(a=os(n,e),t[0]=e,t[1]=n,t[2]=a):a=t[2];let o=!a||r===e,s,c;t[3]!==e||t[4]!==o||t[5]!==n?(s=()=>{o||n===void 0||n.primeFileHighlightCache(e).catch(()=>i(e))},c=[e,o,n],t[3]=e,t[4]=o,t[5]=n,t[6]=s,t[7]=c):(s=t[6],c=t[7]),(0,J.useEffect)(s,c);let l;t[8]!==e||t[9]!==o||t[10]!==n?(l=(t,r)=>{o||r===`unmount`||t?.cacheKey!==e.cacheKey||n?.getFileResultCache(e)!==void 0&&i(e)},t[8]=e,t[9]=o,t[10]=n,t[11]=l):l=t[11];let u=l,d;return t[12]!==u||t[13]!==o?(d={ready:o,onPostRender:u},t[12]=u,t[13]=o,t[14]=d):d=t[14],d}function cs(e){let t=(0,Q.c)(68),{environmentId:n,cwd:r,relativePath:i,composerDraftTarget:a,contents:s,resolvedTheme:c,revealRequestId:l,wordWrap:u,onPostRender:d,onPendingChange:f}=e,p=o(hs),m=o(ms),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[0]=h):h=t[0];let[g,_]=(0,J.useState)(h),[v,b]=(0,J.useState)(null),x=v?.revealRequestId===l?v.range:null,S;t[1]===l?S=t[2]:(S=e=>{b({revealRequestId:l,range:e})},t[1]=l,t[2]=S);let C=S,w=(0,J.useRef)(null),T=(0,J.useRef)(null),E;t[3]!==r||t[4]!==n||t[5]!==f||t[6]!==i?(E={environmentId:n,cwd:r,relativePath:i,onPendingChange:f},t[3]=r,t[4]=n,t[5]=f,t[6]=i,t[7]=E):E=t[7];let D=zo(E),O;t[8]!==s||t[9]!==r||t[10]!==n||t[11]!==i?(O=()=>as(n,r,i,s),t[8]=s,t[9]=r,t[10]=n,t[11]=i,t[12]=O):O=t[12];let[k,A]=(0,J.useState)(O),[ee,te]=(0,J.useState)(null);s!==(ee??k.contents)&&(A(as(n,r,i,s)),te(null));let{ready:ne,onPostRender:re}=ss(k),ie=(0,J.useRef)(null),ae;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ae={onAttach:e=>{ie.current=e},onComplete:()=>{ie.current=null}},t[13]=ae):ae=t[13];let oe=ae,se;t[14]!==p||t[15]!==a||t[16]!==r||t[17]!==n||t[18]!==i||t[19]!==D?(se=e=>{let{file:t,lineAnnotations:o}=e;if(t.contents===sn(n,r,i)||(te(t.contents),cn(n,r,i,t.contents),D.change(t.contents),!o))return;let s=bt(o);_(e=>e===o?e:s);for(let e of s)for(let n of e.metadata.entries)n.kind===`comment`&&p(a,y({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:n.text,contents:t.contents}))},t[14]=p,t[15]=a,t[16]=r,t[17]=n,t[18]=i,t[19]=D,t[20]=se):se=t[20];let ce=se,j;t[21]!==a||t[22]!==m||t[23]!==C?(j=e=>{C(null),m(a,e),_(t=>t.flatMap(t=>{let n=t.metadata.entries.filter(t=>t.id!==e);return n.length>0?[{...t,metadata:{entries:n}}]:[]}))},t[21]=a,t[22]=m,t[23]=C,t[24]=j):j=t[24];let M=j,N;t[25]!==p||t[26]!==a||t[27]!==s||t[28]!==g||t[29]!==i||t[30]!==C?(N=(e,t)=>{C(null);let n=g.flatMap(ps).find(t=>t.id===e);n&&p(a,y({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:t,contents:s})),_(n=>n.map(n=>({...n,metadata:{entries:n.metadata.entries.map(n=>n.id===e?{...n,kind:`comment`,text:t}:n)}})))},t[25]=p,t[26]=a,t[27]=s,t[28]=g,t[29]=i,t[30]=C,t[31]=N):N=t[31];let le=N,ue;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{ie.current?.setSelections([]),ie.current?.blur();let{startLine:t,endLine:n}=St(e),r={id:xt(),kind:`draft`,startLine:t,endLine:n,text:``};_(e=>{let t=e.flatMap(ds),i=t.findIndex(e=>e.lineNumber===n);return i<0?[...t,{lineNumber:n,metadata:{entries:[r]}}]:t.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,r]}}:e)})},t[32]=ue):ue=t[32];let P=ue,de;t[33]===g?de=t[34]:(de=g.some(ls),t[33]=g,t[34]=de);let F=de,I,fe;t[35]!==F||t[36]!==C?(I=()=>{let e=w.current;if(e)return Do({root:e,editor:{setSelections:e=>ie.current?.setSelections(e)},isBlocked:()=>F,onDismiss:()=>C(null)})},fe=[F,C],t[35]=F,t[36]=C,t[37]=I,t[38]=fe):(I=t[37],fe=t[38]),(0,J.useEffect)(I,fe);let pe;t[39]===C?pe=t[40]:(pe=e=>{C(e),e&&P(e)},t[39]=C,t[40]=pe);let L=pe,me;t[41]!==re||t[42]!==d||t[43]!==x?(me=(e,t,n)=>{d(e,t,n),re(t.file,n),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),n!==`unmount`&&(T.current=requestAnimationFrame(()=>{T.current=null,e.isConnected&&t.setSelectedLines(x,{notify:!1})}))},t[41]=re,t[42]=d,t[43]=x,t[44]=me):me=t[44];let R=me,he;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(he={overscrollSize:600,intersectionObserverMargin:1200},t[45]=he):he=t[45];let ge=!F,_e=!F,ve=u?`wrap`:`scroll`,ye;t[46]===c?ye=t[47]:(ye=Me(c),t[46]=c,t[47]=ye);let be;t[48]!==L||t[49]!==R||t[50]!==c||t[51]!==C||t[52]!==ge||t[53]!==_e||t[54]!==ve||t[55]!==ye?(be={disableFileHeader:!0,enableGutterUtility:ge,enableLineSelection:_e,onGutterUtilityClick:C,onLineSelectionChange:C,onLineSelectionEnd:L,overflow:ve,theme:ye,preferredHighlighter:mn,themeType:c,unsafeCSS:Kt,onPostRender:R},t[48]=L,t[49]=R,t[50]=c,t[51]=C,t[52]=ge,t[53]=_e,t[54]=ve,t[55]=ye,t[56]=be):be=t[56];let xe;t[57]!==M||t[58]!==le?(xe=e=>(0,$.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,$.jsx)(mt,{kind:e.kind,rangeLabel:Ct(e.startLine,e.endLine),text:e.text,onCancel:()=>M(e.id),onComment:t=>le(e.id,t),onDelete:()=>M(e.id)},e.id))}),t[57]=M,t[58]=le,t[59]=xe):xe=t[59];let Se;return t[60]!==ne||t[61]!==k||t[62]!==ce||t[63]!==g||t[64]!==x||t[65]!==be||t[66]!==xe?(Se=(0,$.jsx)(ze,{createEditor:is,children:(0,$.jsx)(`div`,{ref:w,className:`flex min-h-0 flex-1`,children:(0,$.jsx)(Be,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:he,children:(0,$.jsx)(wt,{file:k,edit:ne,editorOptions:oe,onEditChange:ce,options:be,selectedLines:x,lineAnnotations:g,renderAnnotation:xe,className:`min-h-full`})})})}),t[60]=ne,t[61]=k,t[62]=ce,t[63]=g,t[64]=x,t[65]=be,t[66]=xe,t[67]=Se):Se=t[67],Se}function ls(e){return e.metadata.entries.some(us)}function us(e){return e.kind===`draft`}function ds(e){let t=e.metadata.entries.filter(fs);return t.length>0?[{...e,metadata:{entries:t}}]:[]}function fs(e){return e.kind!==`draft`}function ps(e){return e.metadata.entries}function ms(e){return e.removeReviewComment}function hs(e){return e.addReviewComment}function gs(e){let t=(0,Q.c)(18),{environmentId:n,cwd:r,relativePath:i,contents:a,threadRef:o,readOnly:s,onPendingChange:c}=e,l;t[0]!==r||t[1]!==n||t[2]!==c||t[3]!==i?(l={environmentId:n,cwd:r,relativePath:i,onPendingChange:c},t[0]=r,t[1]=n,t[2]=c,t[3]=i,t[4]=l):l=t[4];let u=zo(l),d;t[5]!==a||t[6]!==r||t[7]!==n||t[8]!==s||t[9]!==i||t[10]!==u?(d=s?void 0:e=>{let{markerOffset:t,checked:o}=e,s=ln(n,r,i)?.contents??a,c=Fo(s,t,o);c!==s&&(cn(n,r,i,c),u.change(c))},t[5]=a,t[6]=r,t[7]=n,t[8]=s,t[9]=i,t[10]=u,t[11]=d):d=t[11];let f;return t[12]!==a||t[13]!==r||t[14]!==i||t[15]!==d||t[16]!==o?(f=(0,$.jsx)(Ft,{className:`min-h-0 flex-1`,children:(0,$.jsx)(wo,{text:a,cwd:r,relativePath:i,threadRef:o,onTaskListChange:d})}),t[12]=a,t[13]=r,t[14]=i,t[15]=d,t[16]=o,t[17]=f):f=t[17],f}function _s(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 vs(){try{return a(Bo,g)??!0}catch(e){return console.error(e),!0}}function ys(e){let t=(0,Q.c)(156),{environmentId:n,cwd:a,projectName:o,relativePath:c,attachment:l,threadRef:u,composerDraftTarget:d,keybindings:f,availableEditors:p,revealLine:m,revealRequestId:h,onOpenFile:_,onPendingChange:y,selectedFilePending:b,workspaceMutationId:x}=e,C;t[0]!==l||t[1]!==a||t[2]!==c?(C=l===void 0?jo(c,a):c,t[0]=l,t[1]=a,t[2]=c,t[3]=C):C=t[3];let w=C,E=typeof d==`string`,{resolvedTheme:D}=Te(),k=De(xs),A=be(n,O),re=ye(),ie=ue(n),j=ve(n),M=en(n),N;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(N={reportFailure:!1},t[4]=N):N=t[4];let le=Xt(Jt.createUrl,N),F;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(F={reportFailure:!1},t[5]=F):F=t[5];let I=Se(tn.open,F),pe;t[6]===w?pe=t[7]:(pe=w!==null&&oe(w),t[6]=w,t[7]=pe);let L=pe,me;t[8]!==L||t[9]!==w?(me=w!==null&&!L&&ce(w),t[8]=L,t[9]=w,t[10]=me):me=t[10];let R=me,xe;t[11]!==L||t[12]!==w?(xe=w!==null&&!L&&ae(w),t[11]=L,t[12]=w,t[13]=xe):xe=t[13];let we=xe,Ee=we||L||R,Ae;t[14]===w?Ae=t[15]:(Ae=w!==null&&zt(w),t[14]=w,t[15]=Ae);let z=Ae,je;t[16]!==z||t[17]!==w?(je=w!==null&&!z&&Qt(w),t[16]=z,t[17]=w,t[18]=je):je=t[18];let Me=je,Ne;t[19]!==l||t[20]!==w?(Ne=l!==void 0||w!==null&&se(w),t[19]=l,t[20]=w,t[21]=Ne):Ne=t[21];let B=Ne,Pe=ne(n),{canReadFiles:Fe}=Pe,Ie=be(n,S),V=on(n,a,w,l===void 0&&w!==null),Le=V.readError?.resolvedPath??V.readError?.operationPath,Re=V.isNotFile&&!B,H=Re?null:w,[ze,Be]=(0,J.useState)(vs),Ve=l!==void 0,He;t[22]!==ze||t[23]!==H||t[24]!==Ve?(He=Po({relativePath:H,explorerOpen:ze,attachmentOpen:Ve}),t[22]=ze,t[23]=H,t[24]=Ve,t[25]=He):He=t[25];let Ue=He,[We,Ge]=s(Vo,!1,g),[Ke,qe]=s(Ho,!0,g),[Je,Ye]=s(Uo,!0,g),[Xe,Ze]=(0,J.useState)(null),Qe=(0,J.useRef)(null),$e;t[26]===H?$e=t[27]:($e=H?Mo(H):!1,t[26]=H,t[27]=$e);let et=$e,tt;t[28]!==l||t[29]!==H?(tt=H&&l===void 0?Wt({name:H}):null,t[28]=l,t[29]=H,t[30]=tt):tt=t[30];let rt=tt,it=m===null||Xe?.path===w&&Xe.requestId===h,U=et&&We&&it,at=z||Me&&Ke&&it,ot=rt!==null&&Je&&it,st=et?`markdown`:rt?`table`:Me?`html`:null,ct=H!==null&&l===void 0&&st!==null,lt=Oe(),W=H!==null&&V.data!==null&&!(et&&U)&&!(rt&&ot)&&!at,ut=et?U:rt?ot:at,dt=et?Ge:rt?Ye:qe,G;t[31]!==l||t[32]!==A||t[33]!==L||t[34]!==M||t[35]!==H?(G=A&&H!==null&&l===void 0&&!L&&M&&Qt(H),t[31]=l,t[32]=A,t[33]=L,t[34]=M,t[35]=H,t[36]=G):G=t[36];let ft=G,pt;t[37]!==l||t[38]!==a||t[39]!==w?(pt=w&&l===void 0?Ce(w,a):null,t[37]=l,t[38]=a,t[39]=w,t[40]=pt):pt=t[40];let K=pt,q=ns(w,m,h),mt=l===void 0&&w!==null&&(Re||!Ee&&!z)&&!b,ht=`file:${n}:${a}:${w??``}`,gt;t[41]!==V.refresh||t[42]!==mt||t[43]!==ht||t[44]!==x?(gt={enabled:mt,mutationId:x,refresh:V.refresh,resourceKey:ht},t[41]=V.refresh,t[42]=mt,t[43]=ht,t[44]=x,t[45]=gt):gt=t[45],gn(gt);let _t;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(_t=()=>{(Qe.current?.querySelector(`[data-current-file-crumb='true']`))?.scrollIntoView({block:`nearest`,inline:`end`})},t[46]=_t):_t=t[46];let vt;t[47]===w?vt=t[48]:(vt=[w],t[47]=w,t[48]=vt),(0,J.useEffect)(_t,vt);let yt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>{Be(bs)},t[49]=yt):yt=t[49];let bt=yt,xt;t[50]!==K||t[51]!==A||t[52]!==Fe||t[53]!==le||t[54]!==a||t[55]!==j||t[56]!==I||t[57]!==u?(xt=()=>{Fe&&A&&K&&j&&(async()=>{let e=await Yt({threadRef:u,filePath:K,workspaceRoot:a,httpBaseUrl:j,createAssetUrl:le,openPreview:I});if(e._tag===`Success`||ee(e))return;let t=te(e);de.add(ke({type:`error`,title:`Unable to open file in browser`,description:t instanceof Error?t.message:`An error occurred.`}))})()},t[50]=K,t[51]=A,t[52]=Fe,t[53]=le,t[54]=a,t[55]=j,t[56]=I,t[57]=u,t[58]=xt):xt=t[58];let St=xt;if(l===void 0&&!Fe){if(Pe.isPending){let e;return t[59]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(P,{className:`size-4`}),`Checking file access...`]}),t[59]=e):e=t[59],e}let e=Pe.error??`This connection cannot read host files.`,n;return t[60]===e?n=t[61]:(n=(0,$.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:e}),t[60]=e,t[61]=n),n}let Ct;t[62]!==K||t[63]!==l||t[64]!==p||t[65]!==ft||t[66]!==ct||t[67]!==a||t[68]!==n||t[69]!==ze||t[70]!==St||t[71]!==B||t[72]!==f||t[73]!==_||t[74]!==H||t[75]!==re||t[76]!==o||t[77]!==w||t[78]!==ie||t[79]!==ut||t[80]!==st||t[81]!==h||t[82]!==dt||t[83]!==W||t[84]!==lt||t[85]!==k||t[86]!==x?(Ct=w&&l===void 0?(0,$.jsxs)(`div`,{className:Bt,"data-surface-subheader":!0,children:[(0,$.jsx)(Ft,{radius:`none`,ref:Qe,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-file-breadcrumbs":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center text-xs`,children:(0,$.jsx)(Co,{cwd:a,environmentId:n,onOpenFile:_,projectName:o,relativePath:w,workspaceMutationId:x})})}),K&&(n===re||ie.mode!==`local-exec`)?(0,$.jsx)(_n,{environmentId:n,keybindings:f,availableEditors:p,openInCwd:K,compact:!0}):null,ct&&st?(0,$.jsx)(Lt,{label:_s(st,ut),pressed:ut,onPress:()=>{let e=!ut;dt(e),Ze(e&&w!==null?{path:w,requestId:h}:null)},children:(0,$.jsx)(fe,{className:`size-3.5`,icon:ut?he:st===`table`?_e:ge})}):null,W?(0,$.jsx)(Lt,{label:k?`Disable word wrap`:`Enable word wrap`,pressed:k,onPress:()=>lt({wordWrap:!k}),children:(0,$.jsx)(r,{className:`size-3.5`})}):null,ft?(0,$.jsx)(Lt,{label:`Open file in preview browser`,onPress:St,children:(0,$.jsx)(i,{className:`size-3.5`})}):null,!B&&H!==null?(0,$.jsx)(Lt,{label:ze?`Hide file explorer`:`Show file explorer`,pressed:ze,onPress:bt,children:(0,$.jsx)(v,{className:`size-3.5`})}):null]}):null,t[62]=K,t[63]=l,t[64]=p,t[65]=ft,t[66]=ct,t[67]=a,t[68]=n,t[69]=ze,t[70]=St,t[71]=B,t[72]=f,t[73]=_,t[74]=H,t[75]=re,t[76]=o,t[77]=w,t[78]=ie,t[79]=ut,t[80]=st,t[81]=h,t[82]=dt,t[83]=W,t[84]=lt,t[85]=k,t[86]=x,t[87]=Ct):Ct=t[87];let wt;t[88]!==l||t[89]!==Ie||t[90]!==Pe.isPending||t[91]!==B||t[92]!==w?(wt=w&&!l&&!B&&!Ie&&!Pe.isPending?(0,$.jsx)(`div`,{className:`shrink-0 border-b px-3 py-1.5 text-2xs text-muted-foreground`,children:`Read-only connection. Unsaved edits are kept until write access returns.`}):null,t[88]=l,t[89]=Ie,t[90]=Pe.isPending,t[91]=B,t[92]=w,t[93]=wt):wt=t[93];let Et;t[94]!==l||t[95]!==V.data||t[96]!==Ee||t[97]!==H||t[98]!==at?(Et=H&&l===void 0&&!Ee&&!at&&V.data?.truncated?(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-warning/20 bg-warning-surface px-3 py-1.5 text-2xs text-warning-foreground`,children:[`Preview limited to the first 1 MB of a `,V.data.byteLength.toLocaleString(),` byte file.`]}):null,t[94]=l,t[95]=V.data,t[96]=Ee,t[97]=H,t[98]=at,t[99]=Et):Et=t[99];let Dt=H?`flex`:`hidden`,Ot;t[100]===Dt?Ot=t[101]:(Ot=T(`min-w-0 flex-1 flex-col overflow-hidden`,Dt),t[100]=Dt,t[101]=Ot);let kt;t[102]!==K||t[103]!==l||t[104]!==Le||t[105]!==Ie||t[106]!==d||t[107]!==a||t[108]!==E||t[109]!==n||t[110]!==V.data||t[111]!==V.error||t[112]!==V.readError||t[113]!==R||t[114]!==Re||t[115]!==B||t[116]!==we||t[117]!==et||t[118]!==L||t[119]!==q||t[120]!==y||t[121]!==w||t[122]!==at||t[123]!==U||t[124]!==ot||t[125]!==D||t[126]!==h||t[127]!==rt||t[128]!==u||t[129]!==k||t[130]!==x?(kt=Re?null:w&&l?(0,$.jsx)(Ht,{name:l.name,mimeType:l.mimeType,sizeBytes:l.sizeBytes,asset:{environmentId:n,attachmentId:l.id},htmlRender:l.htmlRender===!0,threadRef:u},`${n}:${l.id}`):w&&L&&K?(0,$.jsx)(Ko,{environmentId:n,threadRef:u,draft:E,absolutePath:K,workspaceRoot:a,name:w,workspaceMutationId:x},`${n}:${u.threadId}:${K}`):w&&R&&K?(0,$.jsx)(Jo,{environmentId:n,threadRef:u,draft:E,absolutePath:K,workspaceRoot:a,name:w,workspaceMutationId:x},`${n}:${u.threadId}:${K}`):w&&we&&K?(0,$.jsx)(Wo,{environmentId:n,threadRef:u,draft:E,absolutePath:K,workspaceRoot:a,alt:w,workspaceMutationId:x},K):w&&at&&K?(0,$.jsx)(Go,{environmentId:n,threadRef:u,draft:E,absolutePath:K,workspaceRoot:a,title:w,workspaceMutationId:x},K):w&&V.error&&V.data===null?(0,$.jsx)(`div`,{role:`alert`,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-auto`,children:(0,$.jsxs)(`div`,{className:`my-auto flex shrink-0 flex-col gap-3 px-6 py-6 text-center text-xs leading-relaxed`,children:[(0,$.jsx)(`p`,{className:`text-destructive`,children:V.readError?No(V.readError):V.error}),Le?(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Attempted path`,(0,$.jsx)(`code`,{className:`block break-all font-mono text-foreground select-all`,children:Le})]}):null,B?null:(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Workspace folder:`,` `,(0,$.jsx)(`code`,{className:`break-all font-mono select-all`,children:V.readError?.cwd??a}),`. Check the link's path or locate the file in Files.`]})]})}):w&&V.data===null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(P,{size:`lg`})}):w&&V.data?et&&U?(0,$.jsx)(gs,{environmentId:n,cwd:a,relativePath:w,threadRef:u,contents:V.data.contents,readOnly:B||!Ie,onPendingChange:y},w):rt&&ot?(0,$.jsx)(qt,{name:w,text:V.data.contents,delimiter:rt},w):V.data.truncated||B||!Ie?(0,$.jsx)(Tt,{name:w,text:V.data.contents,cacheKey:Ao(a,w,V.data.contents),onPostRender:q}):(0,$.jsx)(nt,{children:(0,$.jsx)(cs,{environmentId:n,cwd:a,relativePath:w,composerDraftTarget:d,contents:V.data.contents,resolvedTheme:D,revealRequestId:h,wordWrap:k,onPostRender:q,onPendingChange:y},`${w}:${D}`)}):null,t[102]=K,t[103]=l,t[104]=Le,t[105]=Ie,t[106]=d,t[107]=a,t[108]=E,t[109]=n,t[110]=V.data,t[111]=V.error,t[112]=V.readError,t[113]=R,t[114]=Re,t[115]=B,t[116]=we,t[117]=et,t[118]=L,t[119]=q,t[120]=y,t[121]=w,t[122]=at,t[123]=U,t[124]=ot,t[125]=D,t[126]=h,t[127]=rt,t[128]=u,t[129]=k,t[130]=x,t[131]=kt):kt=t[131];let At;t[132]!==Ot||t[133]!==kt?(At=(0,$.jsx)(`div`,{className:Ot,children:kt}),t[132]=Ot,t[133]=kt,t[134]=At):At=t[134];let jt;t[135]!==a||t[136]!==n||t[137]!==V.refresh||t[138]!==Ee||t[139]!==z||t[140]!==_||t[141]!==H||t[142]!==o||t[143]!==w||t[144]!==h||t[145]!==Ue||t[146]!==x?(jt=Ue?(0,$.jsx)(`aside`,{className:T(`flex min-h-0 shrink-0 bg-background`,H?`w-[min(22rem,46%)] min-w-64 border-l border-border/60`:`min-w-0 flex-1`),children:(0,$.jsx)(ho,{environmentId:n,cwd:a,projectName:o,selectedPath:w,selectedPathRevealId:h,onOpenFile:_,workspaceMutationId:x,...H&&!Ee&&!z?{onRefreshSelectedFile:V.refresh}:{}},`${n}:${a}`)}):null,t[135]=a,t[136]=n,t[137]=V.refresh,t[138]=Ee,t[139]=z,t[140]=_,t[141]=H,t[142]=o,t[143]=w,t[144]=h,t[145]=Ue,t[146]=x,t[147]=jt):jt=t[147];let Mt;t[148]!==At||t[149]!==jt?(Mt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[At,jt]}),t[148]=At,t[149]=jt,t[150]=Mt):Mt=t[150];let Nt;return t[151]!==Ct||t[152]!==wt||t[153]!==Et||t[154]!==Mt?(Nt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[Ct,wt,Et,Mt]}),t[151]=Ct,t[152]=wt,t[153]=Et,t[154]=Mt,t[155]=Nt):Nt=t[155],Nt}function bs(e){let t=!e;try{p(Bo,t,g)}catch(e){console.error(e)}return t}function xs(e){return e.wordWrap}export{ys as default};
|
|
34
|
-
//# sourceMappingURL=FilePreviewPanel-
|
|
33
|
+
`,e+1))n+=1;return n<=B}function ss(e){let t=(0,Q.c)(15),n=Re(),[r,i]=(0,J.useState)(null),a;t[0]!==e||t[1]!==n?(a=os(n,e),t[0]=e,t[1]=n,t[2]=a):a=t[2];let o=!a||r===e,s,c;t[3]!==e||t[4]!==o||t[5]!==n?(s=()=>{o||n===void 0||n.primeFileHighlightCache(e).catch(()=>i(e))},c=[e,o,n],t[3]=e,t[4]=o,t[5]=n,t[6]=s,t[7]=c):(s=t[6],c=t[7]),(0,J.useEffect)(s,c);let l;t[8]!==e||t[9]!==o||t[10]!==n?(l=(t,r)=>{o||r===`unmount`||t?.cacheKey!==e.cacheKey||n?.getFileResultCache(e)!==void 0&&i(e)},t[8]=e,t[9]=o,t[10]=n,t[11]=l):l=t[11];let u=l,d;return t[12]!==u||t[13]!==o?(d={ready:o,onPostRender:u},t[12]=u,t[13]=o,t[14]=d):d=t[14],d}function cs(e){let t=(0,Q.c)(68),{environmentId:n,cwd:r,relativePath:i,composerDraftTarget:a,contents:o,resolvedTheme:c,revealRequestId:l,wordWrap:u,onPostRender:d,onPendingChange:f}=e,p=s(hs),m=s(ms),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[0]=h):h=t[0];let[g,_]=(0,J.useState)(h),[y,b]=(0,J.useState)(null),x=y?.revealRequestId===l?y.range:null,S;t[1]===l?S=t[2]:(S=e=>{b({revealRequestId:l,range:e})},t[1]=l,t[2]=S);let C=S,w=(0,J.useRef)(null),T=(0,J.useRef)(null),E;t[3]!==r||t[4]!==n||t[5]!==f||t[6]!==i?(E={environmentId:n,cwd:r,relativePath:i,onPendingChange:f},t[3]=r,t[4]=n,t[5]=f,t[6]=i,t[7]=E):E=t[7];let D=zo(E),O;t[8]!==o||t[9]!==r||t[10]!==n||t[11]!==i?(O=()=>as(n,r,i,o),t[8]=o,t[9]=r,t[10]=n,t[11]=i,t[12]=O):O=t[12];let[k,A]=(0,J.useState)(O),[ee,te]=(0,J.useState)(null);o!==(ee??k.contents)&&(A(as(n,r,i,o)),te(null));let{ready:ne,onPostRender:re}=ss(k),ie=(0,J.useRef)(null),ae;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ae={onAttach:e=>{ie.current=e},onComplete:()=>{ie.current=null}},t[13]=ae):ae=t[13];let oe=ae,se;t[14]!==p||t[15]!==a||t[16]!==r||t[17]!==n||t[18]!==i||t[19]!==D?(se=e=>{let{file:t,lineAnnotations:o}=e;if(t.contents===sn(n,r,i)||(te(t.contents),cn(n,r,i,t.contents),D.change(t.contents),!o))return;let s=bt(o);_(e=>e===o?e:s);for(let e of s)for(let n of e.metadata.entries)n.kind===`comment`&&p(a,v({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:n.text,contents:t.contents}))},t[14]=p,t[15]=a,t[16]=r,t[17]=n,t[18]=i,t[19]=D,t[20]=se):se=t[20];let ce=se,j;t[21]!==a||t[22]!==m||t[23]!==C?(j=e=>{C(null),m(a,e),_(t=>t.flatMap(t=>{let n=t.metadata.entries.filter(t=>t.id!==e);return n.length>0?[{...t,metadata:{entries:n}}]:[]}))},t[21]=a,t[22]=m,t[23]=C,t[24]=j):j=t[24];let M=j,N;t[25]!==p||t[26]!==a||t[27]!==o||t[28]!==g||t[29]!==i||t[30]!==C?(N=(e,t)=>{C(null);let n=g.flatMap(ps).find(t=>t.id===e);n&&p(a,v({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:t,contents:o})),_(n=>n.map(n=>({...n,metadata:{entries:n.metadata.entries.map(n=>n.id===e?{...n,kind:`comment`,text:t}:n)}})))},t[25]=p,t[26]=a,t[27]=o,t[28]=g,t[29]=i,t[30]=C,t[31]=N):N=t[31];let le=N,ue;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>{ie.current?.setSelections([]),ie.current?.blur();let{startLine:t,endLine:n}=St(e),r={id:xt(),kind:`draft`,startLine:t,endLine:n,text:``};_(e=>{let t=e.flatMap(ds),i=t.findIndex(e=>e.lineNumber===n);return i<0?[...t,{lineNumber:n,metadata:{entries:[r]}}]:t.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,r]}}:e)})},t[32]=ue):ue=t[32];let P=ue,de;t[33]===g?de=t[34]:(de=g.some(ls),t[33]=g,t[34]=de);let F=de,I,fe;t[35]!==F||t[36]!==C?(I=()=>{let e=w.current;if(e)return Do({root:e,editor:{setSelections:e=>ie.current?.setSelections(e)},isBlocked:()=>F,onDismiss:()=>C(null)})},fe=[F,C],t[35]=F,t[36]=C,t[37]=I,t[38]=fe):(I=t[37],fe=t[38]),(0,J.useEffect)(I,fe);let pe;t[39]===C?pe=t[40]:(pe=e=>{C(e),e&&P(e)},t[39]=C,t[40]=pe);let L=pe,me;t[41]!==re||t[42]!==d||t[43]!==x?(me=(e,t,n)=>{d(e,t,n),re(t.file,n),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),n!==`unmount`&&(T.current=requestAnimationFrame(()=>{T.current=null,e.isConnected&&t.setSelectedLines(x,{notify:!1})}))},t[41]=re,t[42]=d,t[43]=x,t[44]=me):me=t[44];let R=me,he;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(he={overscrollSize:600,intersectionObserverMargin:1200},t[45]=he):he=t[45];let ge=!F,_e=!F,ve=u?`wrap`:`scroll`,ye;t[46]===c?ye=t[47]:(ye=Me(c),t[46]=c,t[47]=ye);let be;t[48]!==L||t[49]!==R||t[50]!==c||t[51]!==C||t[52]!==ge||t[53]!==_e||t[54]!==ve||t[55]!==ye?(be={disableFileHeader:!0,enableGutterUtility:ge,enableLineSelection:_e,onGutterUtilityClick:C,onLineSelectionChange:C,onLineSelectionEnd:L,overflow:ve,theme:ye,preferredHighlighter:mn,themeType:c,unsafeCSS:Kt,onPostRender:R},t[48]=L,t[49]=R,t[50]=c,t[51]=C,t[52]=ge,t[53]=_e,t[54]=ve,t[55]=ye,t[56]=be):be=t[56];let xe;t[57]!==M||t[58]!==le?(xe=e=>(0,$.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,$.jsx)(mt,{kind:e.kind,rangeLabel:Ct(e.startLine,e.endLine),text:e.text,onCancel:()=>M(e.id),onComment:t=>le(e.id,t),onDelete:()=>M(e.id)},e.id))}),t[57]=M,t[58]=le,t[59]=xe):xe=t[59];let Se;return t[60]!==ne||t[61]!==k||t[62]!==ce||t[63]!==g||t[64]!==x||t[65]!==be||t[66]!==xe?(Se=(0,$.jsx)(ze,{createEditor:is,children:(0,$.jsx)(`div`,{ref:w,className:`flex min-h-0 flex-1`,children:(0,$.jsx)(Be,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:he,children:(0,$.jsx)(wt,{file:k,edit:ne,editorOptions:oe,onEditChange:ce,options:be,selectedLines:x,lineAnnotations:g,renderAnnotation:xe,className:`min-h-full`})})})}),t[60]=ne,t[61]=k,t[62]=ce,t[63]=g,t[64]=x,t[65]=be,t[66]=xe,t[67]=Se):Se=t[67],Se}function ls(e){return e.metadata.entries.some(us)}function us(e){return e.kind===`draft`}function ds(e){let t=e.metadata.entries.filter(fs);return t.length>0?[{...e,metadata:{entries:t}}]:[]}function fs(e){return e.kind!==`draft`}function ps(e){return e.metadata.entries}function ms(e){return e.removeReviewComment}function hs(e){return e.addReviewComment}function gs(e){let t=(0,Q.c)(18),{environmentId:n,cwd:r,relativePath:i,contents:a,threadRef:o,readOnly:s,onPendingChange:c}=e,l;t[0]!==r||t[1]!==n||t[2]!==c||t[3]!==i?(l={environmentId:n,cwd:r,relativePath:i,onPendingChange:c},t[0]=r,t[1]=n,t[2]=c,t[3]=i,t[4]=l):l=t[4];let u=zo(l),d;t[5]!==a||t[6]!==r||t[7]!==n||t[8]!==s||t[9]!==i||t[10]!==u?(d=s?void 0:e=>{let{markerOffset:t,checked:o}=e,s=ln(n,r,i)?.contents??a,c=Fo(s,t,o);c!==s&&(cn(n,r,i,c),u.change(c))},t[5]=a,t[6]=r,t[7]=n,t[8]=s,t[9]=i,t[10]=u,t[11]=d):d=t[11];let f;return t[12]!==a||t[13]!==r||t[14]!==i||t[15]!==d||t[16]!==o?(f=(0,$.jsx)(Ft,{className:`min-h-0 flex-1`,children:(0,$.jsx)(wo,{text:a,cwd:r,relativePath:i,threadRef:o,onTaskListChange:d})}),t[12]=a,t[13]=r,t[14]=i,t[15]=d,t[16]=o,t[17]=f):f=t[17],f}function _s(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 vs(){try{return o(Bo,O)??!0}catch(e){return console.error(e),!0}}function ys(e){let t=(0,Q.c)(156),{environmentId:n,cwd:r,projectName:o,relativePath:s,attachment:l,threadRef:u,composerDraftTarget:d,keybindings:f,availableEditors:p,revealLine:m,revealRequestId:h,onOpenFile:g,onPendingChange:v,selectedFilePending:y,workspaceMutationId:x}=e,S;t[0]!==l||t[1]!==r||t[2]!==s?(S=l===void 0?jo(s,r):s,t[0]=l,t[1]=r,t[2]=s,t[3]=S):S=t[3];let C=S,T=typeof d==`string`,{resolvedTheme:E}=Te(),D=De(xs),A=be(n,k),re=ye(),ie=ue(n),j=ve(n),M=en(n),N;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(N={reportFailure:!1},t[4]=N):N=t[4];let le=Xt(Jt.createUrl,N),F;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(F={reportFailure:!1},t[5]=F):F=t[5];let I=Se(tn.open,F),pe;t[6]===C?pe=t[7]:(pe=C!==null&&oe(C),t[6]=C,t[7]=pe);let L=pe,me;t[8]!==L||t[9]!==C?(me=C!==null&&!L&&ce(C),t[8]=L,t[9]=C,t[10]=me):me=t[10];let R=me,xe;t[11]!==L||t[12]!==C?(xe=C!==null&&!L&&ae(C),t[11]=L,t[12]=C,t[13]=xe):xe=t[13];let we=xe,Ee=we||L||R,Ae;t[14]===C?Ae=t[15]:(Ae=C!==null&&zt(C),t[14]=C,t[15]=Ae);let z=Ae,je;t[16]!==z||t[17]!==C?(je=C!==null&&!z&&Qt(C),t[16]=z,t[17]=C,t[18]=je):je=t[18];let Me=je,Ne;t[19]!==l||t[20]!==C?(Ne=l!==void 0||C!==null&&se(C),t[19]=l,t[20]=C,t[21]=Ne):Ne=t[21];let B=Ne,Pe=ne(n),{canReadFiles:Fe}=Pe,Ie=be(n,b),V=on(n,r,C,l===void 0&&C!==null),Le=V.readError?.resolvedPath??V.readError?.operationPath,Re=V.isNotFile&&!B,H=Re?null:C,[ze,Be]=(0,J.useState)(vs),Ve=l!==void 0,He;t[22]!==ze||t[23]!==H||t[24]!==Ve?(He=Po({relativePath:H,explorerOpen:ze,attachmentOpen:Ve}),t[22]=ze,t[23]=H,t[24]=Ve,t[25]=He):He=t[25];let Ue=He,[We,Ge]=c(Vo,!1,O),[Ke,qe]=c(Ho,!0,O),[Je,Ye]=c(Uo,!0,O),[Xe,Ze]=(0,J.useState)(null),Qe=(0,J.useRef)(null),$e;t[26]===H?$e=t[27]:($e=H?Mo(H):!1,t[26]=H,t[27]=$e);let et=$e,tt;t[28]!==l||t[29]!==H?(tt=H&&l===void 0?Wt({name:H}):null,t[28]=l,t[29]=H,t[30]=tt):tt=t[30];let rt=tt,it=m===null||Xe?.path===C&&Xe.requestId===h,U=et&&We&&it,at=z||Me&&Ke&&it,ot=rt!==null&&Je&&it,st=et?`markdown`:rt?`table`:Me?`html`:null,ct=H!==null&&l===void 0&&st!==null,lt=Oe(),W=H!==null&&V.data!==null&&!(et&&U)&&!(rt&&ot)&&!at,ut=et?U:rt?ot:at,dt=et?Ge:rt?Ye:qe,G;t[31]!==l||t[32]!==A||t[33]!==L||t[34]!==M||t[35]!==H?(G=A&&H!==null&&l===void 0&&!L&&M&&Qt(H),t[31]=l,t[32]=A,t[33]=L,t[34]=M,t[35]=H,t[36]=G):G=t[36];let ft=G,pt;t[37]!==l||t[38]!==r||t[39]!==C?(pt=C&&l===void 0?Ce(C,r):null,t[37]=l,t[38]=r,t[39]=C,t[40]=pt):pt=t[40];let K=pt,q=ns(C,m,h),mt=l===void 0&&C!==null&&(Re||!Ee&&!z)&&!y,ht=`file:${n}:${r}:${C??``}`,gt;t[41]!==V.refresh||t[42]!==mt||t[43]!==ht||t[44]!==x?(gt={enabled:mt,mutationId:x,refresh:V.refresh,resourceKey:ht},t[41]=V.refresh,t[42]=mt,t[43]=ht,t[44]=x,t[45]=gt):gt=t[45],gn(gt);let _t;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(_t=()=>{(Qe.current?.querySelector(`[data-current-file-crumb='true']`))?.scrollIntoView({block:`nearest`,inline:`end`})},t[46]=_t):_t=t[46];let vt;t[47]===C?vt=t[48]:(vt=[C],t[47]=C,t[48]=vt),(0,J.useEffect)(_t,vt);let yt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>{Be(bs)},t[49]=yt):yt=t[49];let bt=yt,xt;t[50]!==K||t[51]!==A||t[52]!==Fe||t[53]!==le||t[54]!==r||t[55]!==j||t[56]!==I||t[57]!==u?(xt=()=>{Fe&&A&&K&&j&&(async()=>{let e=await Yt({threadRef:u,filePath:K,workspaceRoot:r,httpBaseUrl:j,createAssetUrl:le,openPreview:I});if(e._tag===`Success`||ee(e))return;let t=te(e);de.add(ke({type:`error`,title:`Unable to open file in browser`,description:t instanceof Error?t.message:`An error occurred.`}))})()},t[50]=K,t[51]=A,t[52]=Fe,t[53]=le,t[54]=r,t[55]=j,t[56]=I,t[57]=u,t[58]=xt):xt=t[58];let St=xt;if(l===void 0&&!Fe){if(Pe.isPending){let e;return t[59]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(P,{className:`size-4`}),`Checking file access...`]}),t[59]=e):e=t[59],e}let e=Pe.error??`This connection cannot read host files.`,n;return t[60]===e?n=t[61]:(n=(0,$.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:e}),t[60]=e,t[61]=n),n}let Ct;t[62]!==K||t[63]!==l||t[64]!==p||t[65]!==ft||t[66]!==ct||t[67]!==r||t[68]!==n||t[69]!==ze||t[70]!==St||t[71]!==B||t[72]!==f||t[73]!==g||t[74]!==H||t[75]!==re||t[76]!==o||t[77]!==C||t[78]!==ie||t[79]!==ut||t[80]!==st||t[81]!==h||t[82]!==dt||t[83]!==W||t[84]!==lt||t[85]!==D||t[86]!==x?(Ct=C&&l===void 0?(0,$.jsxs)(`div`,{className:Bt,"data-surface-subheader":!0,children:[(0,$.jsx)(Ft,{radius:`none`,ref:Qe,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1`,"data-file-breadcrumbs":!0,children:(0,$.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center text-xs`,children:(0,$.jsx)(Co,{cwd:r,environmentId:n,onOpenFile:g,projectName:o,relativePath:C,workspaceMutationId:x})})}),K&&(n===re||ie.mode!==`local-exec`)?(0,$.jsx)(_n,{environmentId:n,keybindings:f,availableEditors:p,openInCwd:K,compact:!0}):null,ct&&st?(0,$.jsx)(Lt,{label:_s(st,ut),pressed:ut,onPress:()=>{let e=!ut;dt(e),Ze(e&&C!==null?{path:C,requestId:h}:null)},children:(0,$.jsx)(fe,{className:`size-3.5`,icon:ut?he:st===`table`?_e:ge})}):null,W?(0,$.jsx)(Lt,{label:D?`Disable word wrap`:`Enable word wrap`,pressed:D,onPress:()=>lt({wordWrap:!D}),children:(0,$.jsx)(i,{className:`size-3.5`})}):null,ft?(0,$.jsx)(Lt,{label:`Open file in preview browser`,onPress:St,children:(0,$.jsx)(a,{className:`size-3.5`})}):null,!B&&H!==null?(0,$.jsx)(Lt,{label:ze?`Hide file explorer`:`Show file explorer`,pressed:ze,onPress:bt,children:(0,$.jsx)(_,{className:`size-3.5`})}):null]}):null,t[62]=K,t[63]=l,t[64]=p,t[65]=ft,t[66]=ct,t[67]=r,t[68]=n,t[69]=ze,t[70]=St,t[71]=B,t[72]=f,t[73]=g,t[74]=H,t[75]=re,t[76]=o,t[77]=C,t[78]=ie,t[79]=ut,t[80]=st,t[81]=h,t[82]=dt,t[83]=W,t[84]=lt,t[85]=D,t[86]=x,t[87]=Ct):Ct=t[87];let wt;t[88]!==l||t[89]!==Ie||t[90]!==Pe.isPending||t[91]!==B||t[92]!==C?(wt=C&&!l&&!B&&!Ie&&!Pe.isPending?(0,$.jsx)(`div`,{className:`shrink-0 border-b px-3 py-1.5 text-2xs text-muted-foreground`,children:`Read-only connection. Unsaved edits are kept until write access returns.`}):null,t[88]=l,t[89]=Ie,t[90]=Pe.isPending,t[91]=B,t[92]=C,t[93]=wt):wt=t[93];let Et;t[94]!==l||t[95]!==V.data||t[96]!==Ee||t[97]!==H||t[98]!==at?(Et=H&&l===void 0&&!Ee&&!at&&V.data?.truncated?(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-warning/20 bg-warning-surface px-3 py-1.5 text-2xs text-warning-foreground`,children:[`Preview limited to the first 1 MB of a `,V.data.byteLength.toLocaleString(),` byte file.`]}):null,t[94]=l,t[95]=V.data,t[96]=Ee,t[97]=H,t[98]=at,t[99]=Et):Et=t[99];let Dt=H?`flex`:`hidden`,Ot;t[100]===Dt?Ot=t[101]:(Ot=w(`min-w-0 flex-1 flex-col overflow-hidden`,Dt),t[100]=Dt,t[101]=Ot);let kt;t[102]!==K||t[103]!==l||t[104]!==Le||t[105]!==Ie||t[106]!==d||t[107]!==r||t[108]!==T||t[109]!==n||t[110]!==V.data||t[111]!==V.error||t[112]!==V.readError||t[113]!==R||t[114]!==Re||t[115]!==B||t[116]!==we||t[117]!==et||t[118]!==L||t[119]!==q||t[120]!==v||t[121]!==C||t[122]!==at||t[123]!==U||t[124]!==ot||t[125]!==E||t[126]!==h||t[127]!==rt||t[128]!==u||t[129]!==D||t[130]!==x?(kt=Re?null:C&&l?(0,$.jsx)(Ht,{name:l.name,mimeType:l.mimeType,sizeBytes:l.sizeBytes,asset:{environmentId:n,attachmentId:l.id},htmlRender:l.htmlRender===!0,threadRef:u},`${n}:${l.id}`):C&&L&&K?(0,$.jsx)(Ko,{environmentId:n,threadRef:u,draft:T,absolutePath:K,workspaceRoot:r,name:C,workspaceMutationId:x},`${n}:${u.threadId}:${K}`):C&&R&&K?(0,$.jsx)(Jo,{environmentId:n,threadRef:u,draft:T,absolutePath:K,workspaceRoot:r,name:C,workspaceMutationId:x},`${n}:${u.threadId}:${K}`):C&&we&&K?(0,$.jsx)(Wo,{environmentId:n,threadRef:u,draft:T,absolutePath:K,workspaceRoot:r,alt:C,workspaceMutationId:x},K):C&&at&&K?(0,$.jsx)(Go,{environmentId:n,threadRef:u,draft:T,absolutePath:K,workspaceRoot:r,title:C,workspaceMutationId:x},K):C&&V.error&&V.data===null?(0,$.jsx)(`div`,{role:`alert`,className:`scrollbar-gutter-both flex min-h-0 flex-1 flex-col overflow-auto`,children:(0,$.jsxs)(`div`,{className:`my-auto flex shrink-0 flex-col gap-3 px-6 py-6 text-center text-xs leading-relaxed`,children:[(0,$.jsx)(`p`,{className:`text-destructive`,children:V.readError?No(V.readError):V.error}),Le?(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Attempted path`,(0,$.jsx)(`code`,{className:`block break-all font-mono text-foreground select-all`,children:Le})]}):null,B?null:(0,$.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Workspace folder:`,` `,(0,$.jsx)(`code`,{className:`break-all font-mono select-all`,children:V.readError?.cwd??r}),`. Check the link's path or locate the file in Files.`]})]})}):C&&V.data===null?(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(P,{size:`lg`})}):C&&V.data?et&&U?(0,$.jsx)(gs,{environmentId:n,cwd:r,relativePath:C,threadRef:u,contents:V.data.contents,readOnly:B||!Ie,onPendingChange:v},C):rt&&ot?(0,$.jsx)(qt,{name:C,text:V.data.contents,delimiter:rt},C):V.data.truncated||B||!Ie?(0,$.jsx)(Tt,{name:C,text:V.data.contents,cacheKey:Ao(r,C,V.data.contents),onPostRender:q}):(0,$.jsx)(nt,{children:(0,$.jsx)(cs,{environmentId:n,cwd:r,relativePath:C,composerDraftTarget:d,contents:V.data.contents,resolvedTheme:E,revealRequestId:h,wordWrap:D,onPostRender:q,onPendingChange:v},`${C}:${E}`)}):null,t[102]=K,t[103]=l,t[104]=Le,t[105]=Ie,t[106]=d,t[107]=r,t[108]=T,t[109]=n,t[110]=V.data,t[111]=V.error,t[112]=V.readError,t[113]=R,t[114]=Re,t[115]=B,t[116]=we,t[117]=et,t[118]=L,t[119]=q,t[120]=v,t[121]=C,t[122]=at,t[123]=U,t[124]=ot,t[125]=E,t[126]=h,t[127]=rt,t[128]=u,t[129]=D,t[130]=x,t[131]=kt):kt=t[131];let At;t[132]!==Ot||t[133]!==kt?(At=(0,$.jsx)(`div`,{className:Ot,children:kt}),t[132]=Ot,t[133]=kt,t[134]=At):At=t[134];let jt;t[135]!==r||t[136]!==n||t[137]!==V.refresh||t[138]!==Ee||t[139]!==z||t[140]!==g||t[141]!==H||t[142]!==o||t[143]!==C||t[144]!==h||t[145]!==Ue||t[146]!==x?(jt=Ue?(0,$.jsx)(`aside`,{className:w(`flex min-h-0 shrink-0 bg-background`,H?`w-[min(22rem,46%)] min-w-64 border-l border-border/60`:`min-w-0 flex-1`),children:(0,$.jsx)(ho,{environmentId:n,cwd:r,projectName:o,selectedPath:C,selectedPathRevealId:h,onOpenFile:g,workspaceMutationId:x,...H&&!Ee&&!z?{onRefreshSelectedFile:V.refresh}:{}},`${n}:${r}`)}):null,t[135]=r,t[136]=n,t[137]=V.refresh,t[138]=Ee,t[139]=z,t[140]=g,t[141]=H,t[142]=o,t[143]=C,t[144]=h,t[145]=Ue,t[146]=x,t[147]=jt):jt=t[147];let Mt;t[148]!==At||t[149]!==jt?(Mt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[At,jt]}),t[148]=At,t[149]=jt,t[150]=Mt):Mt=t[150];let Nt;return t[151]!==Ct||t[152]!==wt||t[153]!==Et||t[154]!==Mt?(Nt=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[Ct,wt,Et,Mt]}),t[151]=Ct,t[152]=wt,t[153]=Et,t[154]=Mt,t[155]=Nt):Nt=t[155],Nt}function bs(e){let t=!e;try{m(Bo,t,O)}catch(e){console.error(e)}return t}function xs(e){return e.wordWrap}export{ys as default};
|
|
34
|
+
//# sourceMappingURL=FilePreviewPanel-CURtQAD1.js.map
|
package/dist/client/assets/{FoldedSettingsSection-CRlh3-BO.js → FoldedSettingsSection-B9B8i8Gg.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{
|
|
2
|
-
//# sourceMappingURL=FoldedSettingsSection-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{NE as n,lE as r,t as i,vd as a}from"./utils-BEVyjoxo.js";import{U as o,d as s,f as c}from"./settingsLayout-DHc6oKfL.js";import{Fa as l,Ia as u,Pa as d}from"./main-Bh6Hj0_-.js";var f=n(),p=e(t(),1),m=e(r(),1);function h(e){let t=(0,f.c)(50),{id:n,title:r,summary:h,control:g,headerPlacement:_,children:v}=e,y=_===void 0?`inside`:_,[b,x]=(0,p.useState)(!1),S=c(),C=s(n),[w,T]=(0,p.useState)(null);if(S===n&&w!==n&&(T(n),b||x(!0)),y===`outside`){let e=b&&`rotate-90`,s;t[0]===e?s=t[1]:(s=i(`size-4 shrink-0 transition-transform duration-150 motion-reduce:transition-none`,e),t[0]=e,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,m.jsx)(a,{"aria-hidden":!0,className:s}),t[2]=s,t[3]=c);let f;t[4]!==c||t[5]!==r?(f=(0,m.jsx)(`h2`,{children:(0,m.jsxs)(u,{className:`flex min-h-7 items-center gap-2 rounded-md text-sm font-normal text-foreground/70 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[r,c]})}),t[4]=c,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==g||t[8]!==f?(p=(0,m.jsxs)(`div`,{"data-settings-scroll-target":!0,className:`flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4`,children:[f,g]}),t[7]=g,t[8]=f,t[9]=p):p=t[9];let h;t[10]===v?h=t[11]:(h=(0,m.jsx)(l,{children:(0,m.jsx)(o,{children:v})}),t[10]=v,t[11]=h);let _;t[12]!==p||t[13]!==h?(_=(0,m.jsxs)(`div`,{className:`space-y-2.5`,children:[p,h]}),t[12]=p,t[13]=h,t[14]=_):_=t[14];let y;t[15]!==b||t[16]!==_?(y=(0,m.jsx)(d,{open:b,onOpenChange:x,children:_}),t[15]=b,t[16]=_,t[17]=y):y=t[17];let S;return t[18]!==n||t[19]!==y||t[20]!==C?(S=(0,m.jsx)(`section`,{id:n,ref:C,tabIndex:-1,className:`outline-none`,children:y}),t[18]=n,t[19]=y,t[20]=C,t[21]=S):S=t[21],S}let E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,m.jsx)(o,{divided:!1}),t[22]=E):E=t[22];let D=b&&`rotate-90`,O;t[23]===D?O=t[24]:(O=i(`size-4 shrink-0 text-muted-foreground transition-transform duration-150 motion-reduce:transition-none`,D),t[23]=D,t[24]=O);let k;t[25]===O?k=t[26]:(k=(0,m.jsx)(a,{"aria-hidden":!0,className:O}),t[25]=O,t[26]=k);let A;t[27]===r?A=t[28]:(A=(0,m.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:r}),t[27]=r,t[28]=A);let j;t[29]===h?j=t[30]:(j=h?(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:h}):null,t[29]=h,t[30]=j);let M;t[31]!==k||t[32]!==A||t[33]!==j?(M=(0,m.jsxs)(u,{className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring rounded-md`,children:[k,A,j]}),t[31]=k,t[32]=A,t[33]=j,t[34]=M):M=t[34];let N;t[35]===g?N=t[36]:(N=g?(0,m.jsx)(`div`,{className:`flex shrink-0 items-center`,children:g}):null,t[35]=g,t[36]=N);let P;t[37]!==M||t[38]!==N?(P=(0,m.jsxs)(`div`,{className:`flex items-center gap-4 px-3 sm:px-4`,children:[M,N]}),t[37]=M,t[38]=N,t[39]=P):P=t[39];let F;t[40]===v?F=t[41]:(F=(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`border-t border-border/50 [&>*+*]:border-t [&>*+*]:border-border/50`,children:v})}),t[40]=v,t[41]=F);let I;t[42]!==b||t[43]!==P||t[44]!==F?(I=(0,m.jsxs)(d,{open:b,onOpenChange:x,render:E,children:[P,F]}),t[42]=b,t[43]=P,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==n||t[47]!==I||t[48]!==C?(L=(0,m.jsx)(`section`,{id:n,ref:C,tabIndex:-1,className:`outline-none`,children:I}),t[46]=n,t[47]=I,t[48]=C,t[49]=L):L=t[49],L}export{h as t};
|
|
2
|
+
//# sourceMappingURL=FoldedSettingsSection-B9B8i8Gg.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Co as n}from"./utils-
|
|
2
|
-
//# sourceMappingURL=FormContext-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Co as n}from"./utils-BEVyjoxo.js";var r=e(t()),i=r.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:n,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function a(){return r.useContext(i)}export{a as t};
|
|
2
|
+
//# sourceMappingURL=FormContext-Bgwez2tv.js.map
|