@openchamber/web 2.6.1 → 2.6.2-canary.20261104.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/assets/{AboutDialog-D-IujH5P.js → AboutDialog-BLUUIZML.js} +1 -1
  2. package/dist/assets/{AboutLogo-Bghz4cno.js → AboutLogo-DiHHd_5t.js} +1 -1
  3. package/dist/assets/{ArchiveView-SQdNDg7X.js → ArchiveView-CwhPe3Y_.js} +1 -1
  4. package/dist/assets/{ChangeRequestDiffUnavailable-uZ8LXZIU.js → ChangeRequestDiffUnavailable-3YgjMJtr.js} +1 -1
  5. package/dist/assets/{ChangedPathLabel-BZHIGJ_0.js → ChangedPathLabel-B6Ig547I.js} +1 -1
  6. package/dist/assets/{CommandPalette-DjCVXkJM.js → CommandPalette-BChv7Yci.js} +1 -1
  7. package/dist/assets/{DiffView-CIlNcbDh.js → DiffView-pFcLbagS.js} +1 -1
  8. package/dist/assets/{FilesView-VMk-uSwN.js → FilesView-Bod-r3C6.js} +1 -1
  9. package/dist/assets/{GitView-BIg-1tUn.js → GitView-C4xsLAUw.js} +1 -1
  10. package/dist/assets/{GuestSurfacePane-BUmmCfBg.js → GuestSurfacePane-BTyjXjRj.js} +1 -1
  11. package/dist/assets/{HelpDialog-DlCrl3jK.js → HelpDialog-jRlVnJ_e.js} +1 -1
  12. package/dist/assets/{IntegrationsCatalogView-tZTRIaCg.js → IntegrationsCatalogView-CjJ3sWIM.js} +1 -1
  13. package/dist/assets/{JsonTreeView-D5DVoS6l.js → JsonTreeView-C7EScp5B.js} +1 -1
  14. package/dist/assets/{MarkdownDiffPreview-DoMO0ER1.js → MarkdownDiffPreview-cPqaSgaj.js} +1 -1
  15. package/dist/assets/{MarkdownRendererImpl-D1KCox5d.js → MarkdownRendererImpl-BcJ1sqsU.js} +3 -3
  16. package/dist/assets/{MemoryDebugPanel-X5DD6Cjd.js → MemoryDebugPanel-D0N9KDmI.js} +1 -1
  17. package/dist/assets/{NoteEditor-_UWC0M0H.js → NoteEditor-DxvVLbA7.js} +1 -1
  18. package/dist/assets/{OnboardingScreen-DBSPDpEj.js → OnboardingScreen-CMeQdpeM.js} +1 -1
  19. package/dist/assets/{OpenCodeStatusDialog-e8gdYqEY.js → OpenCodeStatusDialog-BAv0K4eb.js} +1 -1
  20. package/dist/assets/{OverviewView-Cf5_Harr.js → OverviewView-DyDBexdg.js} +1 -1
  21. package/dist/assets/{PatchDiff-DIWEk4tG.js → PatchDiff-CvabHkAC.js} +1 -1
  22. package/dist/assets/{PlanView-CV7_x4Hj.js → PlanView-DPpR2O_F.js} +1 -1
  23. package/dist/assets/{ProjectActionsDialog-B90g1jby.js → ProjectActionsDialog-B96GmKCc.js} +1 -1
  24. package/dist/assets/{ReplyUiBlock-D2m0ZgRL.js → ReplyUiBlock-BuiEYmcz.js} +1 -1
  25. package/dist/assets/{ReviewCards-D--SZYNA.js → ReviewCards-B219SHVL.js} +1 -1
  26. package/dist/assets/{RunOverview-CGv4KD-i.js → RunOverview-6n10wBYl.js} +1 -1
  27. package/dist/assets/{ScheduledTasksDialog-XjiWbQnf.js → ScheduledTasksDialog-CTkrlYii.js} +1 -1
  28. package/dist/assets/{SettingsView-Cz-oULIY.js → SettingsView-CenZZQat.js} +1 -1
  29. package/dist/assets/{SettingsWindow-BHUNfQBn.js → SettingsWindow-HEw9_GIT.js} +1 -1
  30. package/dist/assets/{SidebarSectionsManager-C1YsRka1.js → SidebarSectionsManager-CEl8jV_W.js} +1 -1
  31. package/dist/assets/{SourceBoardView-Cc3LeYUo.js → SourceBoardView-CJZ3s1XD.js} +1 -1
  32. package/dist/assets/{SpaceAccessDialog-f_DzFvFs.js → SpaceAccessDialog-Ngob2qn9.js} +1 -1
  33. package/dist/assets/{SpaceApplyDialog-CddUu8PS.js → SpaceApplyDialog-BxjDC_0D.js} +1 -1
  34. package/dist/assets/{SpaceRow-DnnOnMYM.js → SpaceRow-CckOV1g8.js} +1 -1
  35. package/dist/assets/{SpaceSetupOutput-BzQQtLdO.js → SpaceSetupOutput-lGqiVX-3.js} +1 -1
  36. package/dist/assets/{SpacesView-BZhH9crf.js → SpacesView-CP5k-k3v.js} +1 -1
  37. package/dist/assets/{SubmoduleDiffSummary-D6Wu1QuT.js → SubmoduleDiffSummary-Cdi9S4gX.js} +1 -1
  38. package/dist/assets/{ToolOutputDialog-BkmKHRdh.js → ToolOutputDialog-08mv6_M5.js} +1 -1
  39. package/dist/assets/{ToolPartDiffPreview-BurYz6UW.js → ToolPartDiffPreview-DRL47sfe.js} +1 -1
  40. package/dist/assets/{UiBlock-Bwx-T68z.js → UiBlock-C47vwIuG.js} +1 -1
  41. package/dist/assets/{UsageStatsView-WPrhgORf.js → UsageStatsView-DCpTVWz3.js} +1 -1
  42. package/dist/assets/{WalkthroughView-BMD1xSij.js → WalkthroughView-DeaBPhAn.js} +1 -1
  43. package/dist/assets/{WorktreesView-BFut-2yK.js → WorktreesView-B1YD_EPW.js} +1 -1
  44. package/dist/assets/{appThemeRegistry-Dk6CF03D.js → appThemeRegistry-hfPZ6say.js} +1 -1
  45. package/dist/assets/{ar-CuYBgoCL.js → ar-BrwaPZTB.js} +1 -1
  46. package/dist/assets/{codeHighlight-BYbxdxkk.js → codeHighlight-CXtTq4co.js} +1 -1
  47. package/dist/assets/{computeVirtualFileMetrics-COD-bZRh.js → computeVirtualFileMetrics-vVCRMHlo.js} +2 -2
  48. package/dist/assets/{contextFileOpenGuard-D_Eh6QOM.js → contextFileOpenGuard-BrUXbAMg.js} +1 -1
  49. package/dist/assets/{date-time-KFcfG8FZ.js → date-time-t6mCSZMr.js} +1 -1
  50. package/dist/assets/{de-Jo819vpe.js → de-DM_yQ7AG.js} +1 -1
  51. package/dist/assets/{es-CV0MRSsN.js → es-DMJlwy06.js} +1 -1
  52. package/dist/assets/{fileContentPoller-dM2aYiRt.js → fileContentPoller-B_D2WQHm.js} +1 -1
  53. package/dist/assets/{flexokiTheme-BL4fG_5M.js → flexokiTheme-DJhpTHWO.js} +1 -1
  54. package/dist/assets/{fr-CdmUjdKh.js → fr-BKEy-Z_2.js} +1 -1
  55. package/dist/assets/{he-B0Jv5rnl.js → he-BnqH_lWh.js} +1 -1
  56. package/dist/assets/{highlights-Cz6HBqYD.js → highlights-hXz5ezHu.js} +1 -1
  57. package/dist/assets/{index-BaQtYnl3.js → index-D6cItOu7.js} +1 -1
  58. package/dist/assets/{initializeSharedPreferences-CiaDh0AM.js → initializeSharedPreferences-BKG_0s4E.js} +1 -1
  59. package/dist/assets/{install-T6u73Zz0.js → install-csQoiut9.js} +1 -1
  60. package/dist/assets/{isDiffPlainText-B8tZAZQ4.js → isDiffPlainText-OMACajs1.js} +1 -1
  61. package/dist/assets/{isFilePlainText-CgNXAeJu.js → isFilePlainText-Z9Wi1AQY.js} +1 -1
  62. package/dist/assets/{ja-BGc1V8I_.js → ja-lqTz_4gG.js} +1 -1
  63. package/dist/assets/{katex.min-BM3LOlr3.js → katex.min-B7gF3rmE.js} +4 -4
  64. package/dist/assets/{ko-CadSaTs-.js → ko-DXd5Gg_L.js} +1 -1
  65. package/dist/assets/{main-b_PAxB6R.js → main-D0VV0_-r.js} +4 -4
  66. package/dist/assets/{main-BX74Pq6m.js → main-DC2rz5Pv.js} +2 -2
  67. package/dist/assets/{miniChat-CzVxcGLZ.js → miniChat-C6te7Cha.js} +2 -2
  68. package/dist/assets/{mobile-DfBoGVRE.js → mobile-h7Y89upC.js} +2 -2
  69. package/dist/assets/{nl-Ds8N-7nU.js → nl-X6CZmwET.js} +1 -1
  70. package/dist/assets/{pageTitle-DcFkBvgW.js → pageTitle-CAd4Kwsy.js} +1 -1
  71. package/dist/assets/{parseDiffFromFile-DEaa1di6.js → parseDiffFromFile-BuLpViZg.js} +1 -1
  72. package/dist/assets/{pierreDiffTint-CS5FWjsh.js → pierreDiffTint-Bda-Leur.js} +1 -1
  73. package/dist/assets/{pl-BAAqSvOD.js → pl-CmAyO7EH.js} +1 -1
  74. package/dist/assets/{pt-BR-CxTCCQt5.js → pt-BR-QNheuCzR.js} +1 -1
  75. package/dist/assets/{relocateRestoredSession-C8x_kYRX.js → relocateRestoredSession-hOOmUC2p.js} +2 -2
  76. package/dist/assets/{renderElectronMiniChatApp-Bwgx8afa.js → renderElectronMiniChatApp-Dg-2lMCR.js} +2 -2
  77. package/dist/assets/{renderMarkdownForExport-DzVoMkQY.js → renderMarkdownForExport-Dy3HSiOK.js} +1 -1
  78. package/dist/assets/{renderMobileApp-0o5iW3gX.js → renderMobileApp-BhpguGxm.js} +3 -3
  79. package/dist/assets/{resolveLanguages-O4KbMEYv.js → resolveLanguages-BF-kRWyQ.js} +1 -1
  80. package/dist/assets/{runtimeEndpointReset-IJE1o-nk.js → runtimeEndpointReset-DUwSilpj.js} +8 -8
  81. package/dist/assets/{scheduledTasksApi-Bt4F6fco.js → scheduledTasksApi-jkEn2fUL.js} +1 -1
  82. package/dist/assets/{shiki-DfHQjW4b.js → shiki-D0FPzA_f.js} +1 -1
  83. package/dist/assets/{space-apply-BWMKP1l4.js → space-apply-De-hlG-f.js} +1 -1
  84. package/dist/assets/{space-close-B5_k2AhX.js → space-close-BQzjlZ-w.js} +1 -1
  85. package/dist/assets/{spaceNetwork-Bww_OVgL.js → spaceNetwork-CVVlgvhL.js} +1 -1
  86. package/dist/assets/{stream-tokenizer-B87hBGmH.js → stream-tokenizer-w3w2i3zK.js} +1 -1
  87. package/dist/assets/{textMateThemeFromAppTheme-BA68BaAw.js → textMateThemeFromAppTheme-B38k_gpV.js} +1 -1
  88. package/dist/assets/{tr-vj7L-0nl.js → tr-4WQrywE1.js} +1 -1
  89. package/dist/assets/{uk-DYlYVGgJ.js → uk-Dos-a0OZ.js} +1 -1
  90. package/dist/assets/{useAppFontEffects-UKWR--vP.js → useAppFontEffects-6HvTeJY2.js} +15 -15
  91. package/dist/assets/{useBranchPullRequestRequest-DJNOWuS3.js → useBranchPullRequestRequest-B8yYsqiw.js} +1 -1
  92. package/dist/assets/{useCallableModelProviders-BVbgbn_M.js → useCallableModelProviders-BLdr2CgV.js} +1 -1
  93. package/dist/assets/{useDiffFindSurface-zju_sQ6_.js → useDiffFindSurface-BVO1E6le.js} +1 -1
  94. package/dist/assets/{useGitCleanLine-DA-nRAvz.js → useGitCleanLine-DEZFq7uh.js} +1 -1
  95. package/dist/assets/{useInlineCommentController-DgJBL64V.js → useInlineCommentController-BiX7K5jy.js} +1 -1
  96. package/dist/assets/{useMarkdownLocalAssets-DFwvtvsy.js → useMarkdownLocalAssets-DM7b941V.js} +1 -1
  97. package/dist/assets/{useRootScrollLock-ywfMiLmM.js → useRootScrollLock-BrNPOsn7.js} +2 -2
  98. package/dist/assets/{useWalkthroughReview-DeioHUwn.js → useWalkthroughReview-kBvgTX6M.js} +1 -1
  99. package/dist/assets/{useWholeFileComment-3Adypnae.js → useWholeFileComment-DrynMs0_.js} +1 -1
  100. package/dist/assets/{useWorktreeArchiveActions-D57vyZ1C.js → useWorktreeArchiveActions-CewTlnGF.js} +1 -1
  101. package/dist/assets/{vendor-codemirror-language-data-CVww3XgZ.js → vendor-codemirror-language-data-BJfFTbvV.js} +2 -2
  102. package/dist/assets/{zh-CN-CNdkQtjY.js → zh-CN-C4Ip1vNN.js} +1 -1
  103. package/dist/assets/{zh-TW-njZbI3nO.js → zh-TW-BmwR7rb1.js} +1 -1
  104. package/dist/index.html +2 -2
  105. package/dist/mini-chat.html +2 -2
  106. package/dist/mobile.html +2 -2
  107. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import{R as i,f as ze,j as t}from"./vendor-react--VO_rL_p.js";import{u as pe,l as Ce,aR as wi,bN as vi,n as us,aT as ds,bO as sn,aI as je}from"./katex.min-BM3LOlr3.js";import{a as ji,u as ki,B as Ni,C as Si,P as Ri,R as Ci,h as Fi,e as Di,g as Ti,W as Ei,i as Vi,d as Li,b as Ai}from"./ChangeRequestDiffUnavailable-uZ8LXZIU.js";import{u as Be,bG as rn,bI as St,I as U,a3 as Ss,a4 as Rs,bL as Pi,a2 as Cs,B as Ke,Q as Me,aI as Mi,g7 as Bi,g8 as _i,bE as on,aK as Ii,aJ as Fe,bz as Oi,bF as zi,bB as Wi,aL as qi,bH as $i,bC as Gi,g9 as Ki,$ as Fs,bc as Ds,ga as Hi,g3 as Oe,aY as Ui,bJ as Ji,cO as Zt,cF as Ts,aa as Xi,ab as Qi,gb as Yi,ac as Zi,a5 as er,gc as tr,A as Bt,gd as an,K as nr,eE as ln,bi as sr,Y as ir,cH as rr,n as Vn,ge as or,gf as fs,gg as ar,gh as ms,gi as lr,gj as cr,cP as ps}from"./useAppFontEffects-UKWR--vP.js";import{u as ur,a as dr,i as fr,b as mr,c as pr,d as hr,e as gr,s as xr,f as yr,S as br}from"./SubmoduleDiffSummary-D6Wu1QuT.js";import{u as wr,ak as hs,w as gs,x as vr,y as jr,C as kr,al as Nr,am as Sr}from"./runtimeEndpointReset-IJE1o-nk.js";import{b as Rr,c as Cr,a as Cn,u as Fr,P as Dr}from"./useBranchPullRequestRequest-DJNOWuS3.js";import{v as Tr,t as Er,u as Vr}from"./contextFileOpenGuard-D_Eh6QOM.js";import{b as Lr}from"./ReviewCards-D--SZYNA.js";import{p as Es}from"./parseDiffFromFile-DEaa1di6.js";import{r as Pt,u as Ar,a as Pr,D as Mr}from"./useDiffFindSurface-zju_sQ6_.js";import{u as Br}from"./useWholeFileComment-3Adypnae.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-zustand-C9tWdk0j.js";import"./vendor-zod-Csf1sqWl.js";import"./vendor-opencode-client-CqFY51gT.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./vendor-streamdown-BbSYZ3NF.js";import"./vendor-markdown-BTUqNk6W.js";import"./vendor-mdast-util-from-markdown-CZHjOE75.js";import"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import"./vendor-micromark-util-decode-string-fHsnqYdj.js";import"./vendor-decode-named-character-reference-C3-224fz.js";import"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import"./vendor-micromark-AWM-NZXP.js";import"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import"./vendor-micromark-util-chunked-DrRIdSP-.js";import"./vendor-micromark-factory-space-PzSHLgmq.js";import"./vendor-micromark-util-character-CW3Cu1MS.js";import"./vendor-micromark-core-commonmark-kzTLNXAm.js";import"./vendor-micromark-util-classify-character-tcLuZZwM.js";import"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import"./vendor-micromark-util-subtokenize-BF1Jf29a.js";import"./vendor-micromark-factory-destination-Sj0xfi0V.js";import"./vendor-micromark-factory-label-amyP0HdC.js";import"./vendor-micromark-factory-title-khnLkZK6.js";import"./vendor-micromark-factory-whitespace-eIB00uTl.js";import"./vendor-micromark-util-html-tag-name-DbKNfynz.js";import"./vendor-unist-util-stringify-position-Ch_qCilz.js";import"./vendor-mdast-util-to-string-C_aolqmU.js";import"./vendor-unist-util-visit-DhPeCsfG.js";import"./vendor-unist-util-visit-parents-DlviEg7Z.js";import"./vendor-unist-util-is-BPZGFiMU.js";import"./vendor-hast-util-raw-DvvLJg15.js";import"./vendor-ungap-structured-clone--gfxRhYI.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-parse5-DwmzEj2o.js";import"./vendor-entities-wUUgTZDW.js";import"./vendor-web-namespaces-bsVAaBS1.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-unist-util-position-60F3QETU.js";import"./vendor-hast-util-from-parse5-Ba3T6RJI.js";import"./vendor-devlop-0Dp3JUBc.js";import"./vendor-property-information-Boo8Xpef.js";import"./vendor-hastscript-BrPNioaz.js";import"./vendor-comma-separated-tokens-CRUGqg4f.js";import"./vendor-space-separated-tokens-D7QSIrTI.js";import"./vendor-hast-util-parse-selector-TXfch5wI.js";import"./vendor-vfile-location-LfEFwJ2h.js";import"./vendor-hast-util-to-parse5-BoysVIPW.js";import"./vendor-hast-util-sanitize-2aGO5ay8.js";import"./vendor-micromark-extension-gfm-CsfPlnlB.js";import"./vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js";import"./vendor-micromark-extension-gfm-footnote-OFl1FCH2.js";import"./vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js";import"./vendor-micromark-extension-gfm-table-dgw4LfUw.js";import"./vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js";import"./vendor-mdast-util-gfm-CroMDYLM.js";import"./vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-mdast-util-find-and-replace-DB9iC-bx.js";import"./vendor-escape-string-regexp-BaJN9MlJ.js";import"./vendor-mdast-util-gfm-footnote-C-csI7OF.js";import"./vendor-mdast-util-gfm-strikethrough-BcskTdio.js";import"./vendor-mdast-util-gfm-table-DhPwQIyj.js";import"./vendor-markdown-table-DvhhVmnL.js";import"./vendor-mdast-util-to-markdown-Cl3qaiyc.js";import"./vendor-longest-streak-CtXnX3Xp.js";import"./vendor-mdast-util-phrasing-4oVbNLC3.js";import"./vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js";import"./vendor-mdast-util-to-hast-CWnLaQSO.js";import"./vendor-micromark-util-sanitize-uri-BbwQ7CLk.js";import"./vendor-trim-lines-D8znQY54.js";import"./vendor-micromark-extension-cjk-friendly-BzZDGrF5.js";import"./vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js";import"./vendor-get-east-asian-width-CPhS2cOv.js";import"./vendor-micromark-util-symbol-JJPacVTp.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js";import"./vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js";import"./vendor-hast-util-from-html-isomorphic-B0Kn01s9.js";import"./vendor-hast-util-from-dom-DeNf9aYW.js";import"./vendor-katex-DBqql0K7.js";import"./vendor-hast-util-to-text-0GXLnBvt.js";import"./vendor-hast-util-is-element-CuOmiqQi.js";import"./vendor-unist-util-find-after-CMaZmLxc.js";import"./vendor-micromark-extension-math-BRFoDziv.js";import"./vendor-mdast-util-math-wB-IJCL0.js";import"./vendor-remend-r8cP_t-e.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tailwind-merge-BKkUfl9q.js";import"./vendor-marked-DN3zOnEe.js";import"./vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js";import"./vendor-style-to-js-CI2G4dgu.js";import"./vendor-style-to-object-BAv4SQXc.js";import"./vendor-inline-style-parser-BlqBsVO4.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-estree-util-is-identifier-name-BgBfM8ME.js";import"./vendor-vfile-message-DqhD22jI.js";import"./vendor-unified-1CQKw2_w.js";import"./vendor-bail-FqpXQuLt.js";import"./vendor-extend-B94qxKr5.js";import"./vendor-is-plain-obj-C1gvLhAf.js";import"./vendor-trough-B_b8ryxu.js";import"./vendor-vfile-BCWrK60u.js";import"./vendor-html-url-attributes-D46m5wfe.js";import"./vendor-capacitor-core-B4EWRrHz.js";import"./computeVirtualFileMetrics-COD-bZRh.js";import"./themeResolver-DXizngAV.js";import"./vendor-pierre-theming-D_TRfu0q.js";import"./vendor-base-ui-zhBy6TEG.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-dom-WyXykhNi.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-floating-ui-react-dom-Cy8dRGoy.js";import"./vendor-use-sync-external-store-CfLJGVyr.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-dnd-kit-core-Br1Cs7RV.js";import"./vendor-dnd-kit-utilities-DZ9KbT5S.js";import"./vendor-dnd-kit-accessibility-CYclfhtC.js";import"./vendor-dnd-kit-sortable-DpfLEOLv.js";import"./vendor-tanstack-react-virtual-CqfECoM0.js";import"./vendor-tanstack-virtual-core-BdFnkr_2.js";import"./vendor-framer-motion-C_wK4GIM.js";import"./vendor-motion-dom-HXPOMxb7.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-codemirror-commands-CjjsURR-.js";import"./vendor-codemirror-state-Cd8udR5z.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-Ciie9ey-.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-codemirror-language-8HZTPOnt.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-lezer-highlight-CZEcqU6G.js";import"./vendor-codemirror-streamparser-CmlTsbN2.js";import"./vendor-codemirror-lang-javascript-DmqaSK_j.js";import"./vendor-lezer-javascript-CWSwshuO.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-BGedy2gC.js";import"./vendor-codemirror-lang-json-DVAYKmoO.js";import"./vendor-lezer-json-Cn1mncjr.js";import"./vendor-codemirror-lang-css-BLpgXfL2.js";import"./vendor-lezer-css-B2Hx_Nps.js";import"./vendor-codemirror-lang-html-S3jxr3Mo.js";import"./vendor-lezer-html-Cr8K5DGw.js";import"./vendor-codemirror-lang-markdown-D1jveRI5.js";import"./vendor-lezer-markdown-TQKzBB8i.js";import"./vendor-codemirror-language-data-CVww3XgZ.js";import"./vendor-codemirror-lang-python-B-5UC9Ui.js";import"./vendor-lezer-python-BUoImtUb.js";import"./vendor-sonner-Dw26OnzC.js";import"./vendor-cmdk-BtSpU-Io.js";import"./vendor-radix-ui-react-dialog-OIW6VLWw.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D4RvEbuR.js";import"./vendor-radix-ui-react-context-BbFoxCHu.js";import"./vendor-radix-ui-react-id-aGag8i_5.js";import"./vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js";import"./vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js";import"./vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js";import"./vendor-radix-ui-react-primitive-CrN9dRDb.js";import"./vendor-radix-ui-react-slot-BjbalUfz.js";import"./vendor-radix-ui-react-use-callback-ref-CcC_buIU.js";import"./vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js";import"./vendor-radix-ui-react-focus-scope-D1noLHmd.js";import"./vendor-radix-ui-react-portal-BlUEzfrF.js";import"./vendor-radix-ui-react-presence-BGqFfiW4.js";import"./vendor-radix-ui-react-focus-guards-CSS2IbZC.js";import"./vendor-react-remove-scroll-Der_cv-1.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-Clwl9llp.js";import"./vendor-react-style-singleton-D_xJlTqU.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-BdLl6ZIw.js";import"./vendor-use-callback-ref-CXJF1lEr.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-legendapp-list-wfKYGEOv.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./space-apply-BWMKP1l4.js";import"./isDiffPlainText-B8tZAZQ4.js";import"./getFiletypeFromFileName-BgI9McTw.js";import"./vendor-diff-C3JhlQdm.js";import"./pierreDiffTint-CS5FWjsh.js";import"./hastToHtml-BHV14OWE.js";import"./vendor-hast-util-to-html-Jw3IXh58.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./useInlineCommentController-DgJBL64V.js";import"./appThemeRegistry-Dk6CF03D.js";import"./textMateThemeFromAppTheme-BA68BaAw.js";import"./diffsHighlighter-BsxkaI3Q.js";const _r=i.memo(a=>{const e=ze.c(70),{scope:s,workingCount:o,stagedCount:x,turnCount:m,branchCount:v,commitCount:k,prCount:N,showCommitOption:y,showBranchOption:u,changeRequestTerm:j,onScopeChange:p}=a,{t:f}=Be(),[R,S]=i.useState(!1),w=s==="pr"?N:s==="staged"?x:s==="turn"?m:s==="branch"?v:s==="commit"?k:o;let C;e[0]!==j||e[1]!==s||e[2]!==f?(C=f(s==="pr"?rn("session.githubIntegration.tabs.pullRequests",j):s==="staged"?"diffView.scope.staged":s==="turn"?"diffView.scope.lastTurn":s==="branch"?"diffView.scope.branch":s==="commit"?"commitComparison.mode":"diffView.scope.changed"),e[0]=j,e[1]=s,e[2]=f,e[3]=C):C=e[3];const P=C;let g;e[4]!==f?(g=f("diffView.scope.selectorAria"),e[4]=f,e[5]=g):g=e[5];let K;e[6]!==w?(K=w!==null&&t.jsxs("span",{className:"diff-toolbar__scope-count",children:[": ",w]}),e[6]=w,e[7]=K):K=e[7];let V;e[8]!==P||e[9]!==K?(V=t.jsxs("span",{className:"whitespace-nowrap",children:[P,K]}),e[8]=P,e[9]=K,e[10]=V):V=e[10];let le;e[11]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx(U,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"}),e[11]=le):le=e[11];let ce;e[12]!==g||e[13]!==V?(ce=t.jsx(Ss,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex h-7 flex-shrink-0 items-center gap-1.5 rounded-md px-2 typography-ui-label font-semibold text-foreground outline-none hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-ring","aria-label":g,children:[V,le]})}),e[12]=g,e[13]=V,e[14]=ce):ce=e[14];let X;e[15]!==p?(X=te=>{(te==="working"||te==="staged"||te==="turn"||te==="branch"||te==="commit"||te==="pr")&&(p?.(te),S(!1))},e[15]=p,e[16]=X):X=e[16];let h;e[17]!==f?(h=f("diffView.scope.changed"),e[17]=f,e[18]=h):h=e[18];let q;e[19]!==h?(q=t.jsx("span",{children:h}),e[19]=h,e[20]=q):q=e[20];let $;e[21]!==o?($=t.jsx("span",{className:"typography-meta text-muted-foreground",children:o}),e[21]=o,e[22]=$):$=e[22];let he;e[23]!==$||e[24]!==q?(he=t.jsx(St,{value:"working",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[q,$]})}),e[23]=$,e[24]=q,e[25]=he):he=e[25];let A;e[26]!==f?(A=f("diffView.scope.staged"),e[26]=f,e[27]=A):A=e[27];let M;e[28]!==A?(M=t.jsx("span",{children:A}),e[28]=A,e[29]=M):M=e[29];let J;e[30]!==x?(J=t.jsx("span",{className:"typography-meta text-muted-foreground",children:x}),e[30]=x,e[31]=J):J=e[31];let D;e[32]!==M||e[33]!==J?(D=t.jsx(St,{value:"staged",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[M,J]})}),e[32]=M,e[33]=J,e[34]=D):D=e[34];let F;e[35]!==f?(F=f("diffView.scope.lastTurn"),e[35]=f,e[36]=F):F=e[36];let I;e[37]!==F?(I=t.jsx("span",{children:F}),e[37]=F,e[38]=I):I=e[38];const B=m??"…";let G;e[39]!==B?(G=t.jsx("span",{className:"typography-meta text-muted-foreground",children:B}),e[39]=B,e[40]=G):G=e[40];let re;e[41]!==I||e[42]!==G?(re=t.jsx(St,{value:"turn",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[I,G]})}),e[41]=I,e[42]=G,e[43]=re):re=e[43];let oe;e[44]!==v||e[45]!==u||e[46]!==f?(oe=u?t.jsx(St,{value:"branch",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:f("diffView.scope.branch")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:v??"…"})]})}):null,e[44]=v,e[45]=u,e[46]=f,e[47]=oe):oe=e[47];let ee;e[48]!==k||e[49]!==y||e[50]!==f?(ee=y&&t.jsx(St,{value:"commit",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:f("commitComparison.mode")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:k??"…"})]})}),e[48]=k,e[49]=y,e[50]=f,e[51]=ee):ee=e[51];let ge;e[52]!==j||e[53]!==N||e[54]!==y||e[55]!==f?(ge=y&&t.jsx(St,{value:"pr",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:f(rn("session.githubIntegration.tabs.pullRequests",j))}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:N??"…"})]})}),e[52]=j,e[53]=N,e[54]=y,e[55]=f,e[56]=ge):ge=e[56];let ae;e[57]!==s||e[58]!==he||e[59]!==D||e[60]!==re||e[61]!==oe||e[62]!==ee||e[63]!==ge||e[64]!==X?(ae=t.jsx(Rs,{align:"start",className:"w-40",children:t.jsxs(Pi,{value:s,onValueChange:X,children:[he,D,re,oe,ee,ge]})}),e[57]=s,e[58]=he,e[59]=D,e[60]=re,e[61]=oe,e[62]=ee,e[63]=ge,e[64]=X,e[65]=ae):ae=e[65];let H;return e[66]!==R||e[67]!==ae||e[68]!==ce?(H=t.jsxs(Cs,{open:R,onOpenChange:S,children:[ce,ae]}),e[66]=R,e[67]=ae,e[68]=ce,e[69]=H):H=e[69],H}),Ir=i.memo(function(e){const s=ze.c(13),{index:o,staged:x,busyHunk:m,disabled:v,onAction:k}=e,{t:N}=Be();let y;s[0]!==x?(y=x?["unstage"]:["discard","stage"],s[0]=x,s[1]=y):y=s[1];const u=y;let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={top:"var(--oc-hunk-action-offset, 0.25rem)"},s[2]=j):j=s[2];let p;s[3]!==u||s[4]!==m||s[5]!==v||s[6]!==o||s[7]!==k||s[8]!==N?(p=t.jsx("div",{className:"pointer-events-auto flex items-center gap-0.5 rounded-full border border-[var(--interactive-border)]/45 bg-[var(--surface-background)]/95 px-1 py-0.5 shadow-sm backdrop-blur-md",children:u.map(R=>{const S=N(R==="stage"?"diffView.hunk.stageTitle":R==="unstage"?"diffView.hunk.unstageTitle":"diffView.hunk.discardTitle",{index:o+1}),w=m?.index===o&&m.action===R;return t.jsx(Ke,{variant:"ghost",size:"xs",className:Me("rounded-full bg-transparent text-muted-foreground hover:bg-transparent hover:text-foreground",R==="discard"&&"text-[var(--status-error)] hover:text-[var(--status-error)]",R==="stage"&&"text-[var(--status-success)] hover:text-[var(--status-success)]"),disabled:v||m!==null,title:S,"aria-label":S,onPointerDown:Or,onClick:C=>{C.stopPropagation(),k(o,R)},children:t.jsx(U,{name:w?"loader-4":R==="stage"?"add":"arrow-go-back",className:Me(R==="stage"?"size-4":"size-3.5",w&&"animate-spin")})},R)})}),s[3]=u,s[4]=m,s[5]=v,s[6]=o,s[7]=k,s[8]=N,s[9]=p):p=s[9];let f;return s[10]!==o||s[11]!==p?(f=t.jsx("div",{className:"pointer-events-none absolute inset-e-3 z-20",style:j,"data-hunk-actions":o,children:p}),s[10]=o,s[11]=p,s[12]=f):f=s[12],f});function Or(a){return a.stopPropagation()}const zr=3,Vs=a=>{const e=ze.c(14),{path:s}=a,{t:o}=Be(),x=wr();let m,v;if(e[0]!==s||e[1]!==x?.state?.draft?.comments||e[2]!==x?.state?.threads||e[3]!==o){v=Symbol.for("react.early_return_sentinel");e:{let k;e[6]!==s?(k=w=>w.path===s&&!w.resolved,e[6]=s,e[7]=k):k=e[7];const N=(x?.state?.threads??[]).filter(k);let y;e[8]!==s?(y=w=>w.path===s,e[8]=s,e[9]=y):y=e[9];const u=(x?.state?.draft?.comments??[]).filter(y),j=N.length+u.length;if(j===0){v=null;break e}const p=new Map;for(const{author:w}of u)p.set(w?.login??"",w);for(const{comments:w}of N)p.set(w[0]?.author?.login??"",w[0]?.author??null);const f=j===1?"review.fileMark.one":"review.fileMark.other";let R;e[10]!==j||e[11]!==o||e[12]!==f?(R=o(f,{count:j}),e[10]=j,e[11]=o,e[12]=f,e[13]=R):R=e[13];const S=R;m=t.jsx("span",{className:"flex shrink-0 items-center -space-x-1 rtl:space-x-reverse",role:"img","aria-label":S,title:S,children:[...p.entries()].slice(0,zr).map(Wr)})}e[0]=s,e[1]=x?.state?.draft?.comments,e[2]=x?.state?.threads,e[3]=o,e[4]=m,e[5]=v}else m=e[4],v=e[5];return v!==Symbol.for("react.early_return_sentinel")?v:m};function Wr(a){const[e,s]=a;return t.jsx(Lr,{person:s},e)}const xs=(a,e)=>{if(e.length===0)return null;let s=null,o=null;for(const m of e)m.top<=a?(!s||m.top>s.top)&&(s=m):(!o||m.top<o.top)&&(o=m);const x=s??o;return x?{path:x.path,topOffset:x.top-a}:null},qr=(a,e,s,o)=>Math.min(Math.max(0,o),Math.max(0,a+s-e)),Ls=(a,e)=>{const s=[],o=(x,m)=>{const v=Array.from(x.children.values()).sort((N,y)=>N.name.localeCompare(y.name));for(const N of v){const{node:y,label:u}=Cr(N),j=!e.has(y.path);s.push({kind:"directory",key:`dir:${y.path}`,depth:m,path:y.path,label:u,fileCount:y.files.length,expanded:j}),j&&o(y,m+1)}const k=[...x.directFiles].sort((N,y)=>Cn(N.path).localeCompare(Cn(y.path)));for(const N of k)s.push({kind:"file",key:`file:${N.path}`,depth:m,name:Cn(N.path),file:N})};return o(Rr(a),0),s},ys=a=>{if(!a)return null;const e=a.split(`
1
+ import{R as i,f as ze,j as t}from"./vendor-react--VO_rL_p.js";import{u as pe,l as Ce,aR as wi,bN as vi,n as us,aT as ds,bO as sn,aI as je}from"./katex.min-B7gF3rmE.js";import{a as ji,u as ki,B as Ni,C as Si,P as Ri,R as Ci,h as Fi,e as Di,g as Ti,W as Ei,i as Vi,d as Li,b as Ai}from"./ChangeRequestDiffUnavailable-3YgjMJtr.js";import{u as Be,bG as rn,bI as St,I as U,a3 as Ss,a4 as Rs,bL as Pi,a2 as Cs,B as Ke,Q as Me,aI as Mi,g7 as Bi,g8 as _i,bE as on,aK as Ii,aJ as Fe,bz as Oi,bF as zi,bB as Wi,aL as qi,bH as $i,bC as Gi,g9 as Ki,$ as Fs,bc as Ds,ga as Hi,g3 as Oe,aY as Ui,bJ as Ji,cO as Zt,cF as Ts,aa as Xi,ab as Qi,gb as Yi,ac as Zi,a5 as er,gc as tr,A as Bt,gd as an,K as nr,eE as ln,bi as sr,Y as ir,cH as rr,n as Vn,ge as or,gf as fs,gg as ar,gh as ms,gi as lr,gj as cr,cP as ps}from"./useAppFontEffects-6HvTeJY2.js";import{u as ur,a as dr,i as fr,b as mr,c as pr,d as hr,e as gr,s as xr,f as yr,S as br}from"./SubmoduleDiffSummary-Cdi9S4gX.js";import{u as wr,ak as hs,w as gs,x as vr,y as jr,C as kr,al as Nr,am as Sr}from"./runtimeEndpointReset-DUwSilpj.js";import{b as Rr,c as Cr,a as Cn,u as Fr,P as Dr}from"./useBranchPullRequestRequest-B8yYsqiw.js";import{v as Tr,t as Er,u as Vr}from"./contextFileOpenGuard-BrUXbAMg.js";import{b as Lr}from"./ReviewCards-B219SHVL.js";import{p as Es}from"./parseDiffFromFile-BuLpViZg.js";import{r as Pt,u as Ar,a as Pr,D as Mr}from"./useDiffFindSurface-BVO1E6le.js";import{u as Br}from"./useWholeFileComment-DrynMs0_.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-zustand-C9tWdk0j.js";import"./vendor-zod-Csf1sqWl.js";import"./vendor-opencode-client-CqFY51gT.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./vendor-streamdown-BbSYZ3NF.js";import"./vendor-markdown-BTUqNk6W.js";import"./vendor-mdast-util-from-markdown-CZHjOE75.js";import"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import"./vendor-micromark-util-decode-string-fHsnqYdj.js";import"./vendor-decode-named-character-reference-C3-224fz.js";import"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import"./vendor-micromark-AWM-NZXP.js";import"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import"./vendor-micromark-util-chunked-DrRIdSP-.js";import"./vendor-micromark-factory-space-PzSHLgmq.js";import"./vendor-micromark-util-character-CW3Cu1MS.js";import"./vendor-micromark-core-commonmark-kzTLNXAm.js";import"./vendor-micromark-util-classify-character-tcLuZZwM.js";import"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import"./vendor-micromark-util-subtokenize-BF1Jf29a.js";import"./vendor-micromark-factory-destination-Sj0xfi0V.js";import"./vendor-micromark-factory-label-amyP0HdC.js";import"./vendor-micromark-factory-title-khnLkZK6.js";import"./vendor-micromark-factory-whitespace-eIB00uTl.js";import"./vendor-micromark-util-html-tag-name-DbKNfynz.js";import"./vendor-unist-util-stringify-position-Ch_qCilz.js";import"./vendor-mdast-util-to-string-C_aolqmU.js";import"./vendor-unist-util-visit-DhPeCsfG.js";import"./vendor-unist-util-visit-parents-DlviEg7Z.js";import"./vendor-unist-util-is-BPZGFiMU.js";import"./vendor-hast-util-raw-DvvLJg15.js";import"./vendor-ungap-structured-clone--gfxRhYI.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-parse5-DwmzEj2o.js";import"./vendor-entities-wUUgTZDW.js";import"./vendor-web-namespaces-bsVAaBS1.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-unist-util-position-60F3QETU.js";import"./vendor-hast-util-from-parse5-Ba3T6RJI.js";import"./vendor-devlop-0Dp3JUBc.js";import"./vendor-property-information-Boo8Xpef.js";import"./vendor-hastscript-BrPNioaz.js";import"./vendor-comma-separated-tokens-CRUGqg4f.js";import"./vendor-space-separated-tokens-D7QSIrTI.js";import"./vendor-hast-util-parse-selector-TXfch5wI.js";import"./vendor-vfile-location-LfEFwJ2h.js";import"./vendor-hast-util-to-parse5-BoysVIPW.js";import"./vendor-hast-util-sanitize-2aGO5ay8.js";import"./vendor-micromark-extension-gfm-CsfPlnlB.js";import"./vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js";import"./vendor-micromark-extension-gfm-footnote-OFl1FCH2.js";import"./vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js";import"./vendor-micromark-extension-gfm-table-dgw4LfUw.js";import"./vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js";import"./vendor-mdast-util-gfm-CroMDYLM.js";import"./vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-mdast-util-find-and-replace-DB9iC-bx.js";import"./vendor-escape-string-regexp-BaJN9MlJ.js";import"./vendor-mdast-util-gfm-footnote-C-csI7OF.js";import"./vendor-mdast-util-gfm-strikethrough-BcskTdio.js";import"./vendor-mdast-util-gfm-table-DhPwQIyj.js";import"./vendor-markdown-table-DvhhVmnL.js";import"./vendor-mdast-util-to-markdown-Cl3qaiyc.js";import"./vendor-longest-streak-CtXnX3Xp.js";import"./vendor-mdast-util-phrasing-4oVbNLC3.js";import"./vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js";import"./vendor-mdast-util-to-hast-CWnLaQSO.js";import"./vendor-micromark-util-sanitize-uri-BbwQ7CLk.js";import"./vendor-trim-lines-D8znQY54.js";import"./vendor-micromark-extension-cjk-friendly-BzZDGrF5.js";import"./vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js";import"./vendor-get-east-asian-width-CPhS2cOv.js";import"./vendor-micromark-util-symbol-JJPacVTp.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js";import"./vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js";import"./vendor-hast-util-from-html-isomorphic-B0Kn01s9.js";import"./vendor-hast-util-from-dom-DeNf9aYW.js";import"./vendor-katex-DBqql0K7.js";import"./vendor-hast-util-to-text-0GXLnBvt.js";import"./vendor-hast-util-is-element-CuOmiqQi.js";import"./vendor-unist-util-find-after-CMaZmLxc.js";import"./vendor-micromark-extension-math-BRFoDziv.js";import"./vendor-mdast-util-math-wB-IJCL0.js";import"./vendor-remend-r8cP_t-e.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tailwind-merge-BKkUfl9q.js";import"./vendor-marked-DN3zOnEe.js";import"./vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js";import"./vendor-style-to-js-CI2G4dgu.js";import"./vendor-style-to-object-BAv4SQXc.js";import"./vendor-inline-style-parser-BlqBsVO4.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-estree-util-is-identifier-name-BgBfM8ME.js";import"./vendor-vfile-message-DqhD22jI.js";import"./vendor-unified-1CQKw2_w.js";import"./vendor-bail-FqpXQuLt.js";import"./vendor-extend-B94qxKr5.js";import"./vendor-is-plain-obj-C1gvLhAf.js";import"./vendor-trough-B_b8ryxu.js";import"./vendor-vfile-BCWrK60u.js";import"./vendor-html-url-attributes-D46m5wfe.js";import"./vendor-capacitor-core-B4EWRrHz.js";import"./computeVirtualFileMetrics-vVCRMHlo.js";import"./themeResolver-DXizngAV.js";import"./vendor-pierre-theming-D_TRfu0q.js";import"./vendor-base-ui-zhBy6TEG.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-dom-WyXykhNi.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-floating-ui-react-dom-Cy8dRGoy.js";import"./vendor-use-sync-external-store-CfLJGVyr.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-dnd-kit-core-Br1Cs7RV.js";import"./vendor-dnd-kit-utilities-DZ9KbT5S.js";import"./vendor-dnd-kit-accessibility-CYclfhtC.js";import"./vendor-dnd-kit-sortable-DpfLEOLv.js";import"./vendor-tanstack-react-virtual-CqfECoM0.js";import"./vendor-tanstack-virtual-core-BdFnkr_2.js";import"./vendor-framer-motion-C_wK4GIM.js";import"./vendor-motion-dom-HXPOMxb7.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-codemirror-commands-CjjsURR-.js";import"./vendor-codemirror-state-Cd8udR5z.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-Ciie9ey-.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-codemirror-language-8HZTPOnt.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-lezer-highlight-CZEcqU6G.js";import"./vendor-codemirror-streamparser-CmlTsbN2.js";import"./vendor-codemirror-lang-javascript-DmqaSK_j.js";import"./vendor-lezer-javascript-CWSwshuO.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-BGedy2gC.js";import"./vendor-codemirror-lang-json-DVAYKmoO.js";import"./vendor-lezer-json-Cn1mncjr.js";import"./vendor-codemirror-lang-css-BLpgXfL2.js";import"./vendor-lezer-css-B2Hx_Nps.js";import"./vendor-codemirror-lang-html-S3jxr3Mo.js";import"./vendor-lezer-html-Cr8K5DGw.js";import"./vendor-codemirror-lang-markdown-D1jveRI5.js";import"./vendor-lezer-markdown-TQKzBB8i.js";import"./vendor-codemirror-language-data-BJfFTbvV.js";import"./vendor-codemirror-lang-python-B-5UC9Ui.js";import"./vendor-lezer-python-BUoImtUb.js";import"./vendor-sonner-Dw26OnzC.js";import"./vendor-cmdk-BtSpU-Io.js";import"./vendor-radix-ui-react-dialog-OIW6VLWw.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D4RvEbuR.js";import"./vendor-radix-ui-react-context-BbFoxCHu.js";import"./vendor-radix-ui-react-id-aGag8i_5.js";import"./vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js";import"./vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js";import"./vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js";import"./vendor-radix-ui-react-primitive-CrN9dRDb.js";import"./vendor-radix-ui-react-slot-BjbalUfz.js";import"./vendor-radix-ui-react-use-callback-ref-CcC_buIU.js";import"./vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js";import"./vendor-radix-ui-react-focus-scope-D1noLHmd.js";import"./vendor-radix-ui-react-portal-BlUEzfrF.js";import"./vendor-radix-ui-react-presence-BGqFfiW4.js";import"./vendor-radix-ui-react-focus-guards-CSS2IbZC.js";import"./vendor-react-remove-scroll-Der_cv-1.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-Clwl9llp.js";import"./vendor-react-style-singleton-D_xJlTqU.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-BdLl6ZIw.js";import"./vendor-use-callback-ref-CXJF1lEr.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-legendapp-list-wfKYGEOv.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./space-apply-De-hlG-f.js";import"./isDiffPlainText-OMACajs1.js";import"./getFiletypeFromFileName-BgI9McTw.js";import"./vendor-diff-C3JhlQdm.js";import"./pierreDiffTint-Bda-Leur.js";import"./hastToHtml-BHV14OWE.js";import"./vendor-hast-util-to-html-Jw3IXh58.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./useInlineCommentController-BiX7K5jy.js";import"./appThemeRegistry-hfPZ6say.js";import"./textMateThemeFromAppTheme-B38k_gpV.js";import"./diffsHighlighter-BsxkaI3Q.js";const _r=i.memo(a=>{const e=ze.c(70),{scope:s,workingCount:o,stagedCount:x,turnCount:m,branchCount:v,commitCount:k,prCount:N,showCommitOption:y,showBranchOption:u,changeRequestTerm:j,onScopeChange:p}=a,{t:f}=Be(),[R,S]=i.useState(!1),w=s==="pr"?N:s==="staged"?x:s==="turn"?m:s==="branch"?v:s==="commit"?k:o;let C;e[0]!==j||e[1]!==s||e[2]!==f?(C=f(s==="pr"?rn("session.githubIntegration.tabs.pullRequests",j):s==="staged"?"diffView.scope.staged":s==="turn"?"diffView.scope.lastTurn":s==="branch"?"diffView.scope.branch":s==="commit"?"commitComparison.mode":"diffView.scope.changed"),e[0]=j,e[1]=s,e[2]=f,e[3]=C):C=e[3];const P=C;let g;e[4]!==f?(g=f("diffView.scope.selectorAria"),e[4]=f,e[5]=g):g=e[5];let K;e[6]!==w?(K=w!==null&&t.jsxs("span",{className:"diff-toolbar__scope-count",children:[": ",w]}),e[6]=w,e[7]=K):K=e[7];let V;e[8]!==P||e[9]!==K?(V=t.jsxs("span",{className:"whitespace-nowrap",children:[P,K]}),e[8]=P,e[9]=K,e[10]=V):V=e[10];let le;e[11]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx(U,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"}),e[11]=le):le=e[11];let ce;e[12]!==g||e[13]!==V?(ce=t.jsx(Ss,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex h-7 flex-shrink-0 items-center gap-1.5 rounded-md px-2 typography-ui-label font-semibold text-foreground outline-none hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-ring","aria-label":g,children:[V,le]})}),e[12]=g,e[13]=V,e[14]=ce):ce=e[14];let X;e[15]!==p?(X=te=>{(te==="working"||te==="staged"||te==="turn"||te==="branch"||te==="commit"||te==="pr")&&(p?.(te),S(!1))},e[15]=p,e[16]=X):X=e[16];let h;e[17]!==f?(h=f("diffView.scope.changed"),e[17]=f,e[18]=h):h=e[18];let q;e[19]!==h?(q=t.jsx("span",{children:h}),e[19]=h,e[20]=q):q=e[20];let $;e[21]!==o?($=t.jsx("span",{className:"typography-meta text-muted-foreground",children:o}),e[21]=o,e[22]=$):$=e[22];let he;e[23]!==$||e[24]!==q?(he=t.jsx(St,{value:"working",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[q,$]})}),e[23]=$,e[24]=q,e[25]=he):he=e[25];let A;e[26]!==f?(A=f("diffView.scope.staged"),e[26]=f,e[27]=A):A=e[27];let M;e[28]!==A?(M=t.jsx("span",{children:A}),e[28]=A,e[29]=M):M=e[29];let J;e[30]!==x?(J=t.jsx("span",{className:"typography-meta text-muted-foreground",children:x}),e[30]=x,e[31]=J):J=e[31];let D;e[32]!==M||e[33]!==J?(D=t.jsx(St,{value:"staged",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[M,J]})}),e[32]=M,e[33]=J,e[34]=D):D=e[34];let F;e[35]!==f?(F=f("diffView.scope.lastTurn"),e[35]=f,e[36]=F):F=e[36];let I;e[37]!==F?(I=t.jsx("span",{children:F}),e[37]=F,e[38]=I):I=e[38];const B=m??"…";let G;e[39]!==B?(G=t.jsx("span",{className:"typography-meta text-muted-foreground",children:B}),e[39]=B,e[40]=G):G=e[40];let re;e[41]!==I||e[42]!==G?(re=t.jsx(St,{value:"turn",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[I,G]})}),e[41]=I,e[42]=G,e[43]=re):re=e[43];let oe;e[44]!==v||e[45]!==u||e[46]!==f?(oe=u?t.jsx(St,{value:"branch",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:f("diffView.scope.branch")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:v??"…"})]})}):null,e[44]=v,e[45]=u,e[46]=f,e[47]=oe):oe=e[47];let ee;e[48]!==k||e[49]!==y||e[50]!==f?(ee=y&&t.jsx(St,{value:"commit",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:f("commitComparison.mode")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:k??"…"})]})}),e[48]=k,e[49]=y,e[50]=f,e[51]=ee):ee=e[51];let ge;e[52]!==j||e[53]!==N||e[54]!==y||e[55]!==f?(ge=y&&t.jsx(St,{value:"pr",children:t.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[t.jsx("span",{children:f(rn("session.githubIntegration.tabs.pullRequests",j))}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:N??"…"})]})}),e[52]=j,e[53]=N,e[54]=y,e[55]=f,e[56]=ge):ge=e[56];let ae;e[57]!==s||e[58]!==he||e[59]!==D||e[60]!==re||e[61]!==oe||e[62]!==ee||e[63]!==ge||e[64]!==X?(ae=t.jsx(Rs,{align:"start",className:"w-40",children:t.jsxs(Pi,{value:s,onValueChange:X,children:[he,D,re,oe,ee,ge]})}),e[57]=s,e[58]=he,e[59]=D,e[60]=re,e[61]=oe,e[62]=ee,e[63]=ge,e[64]=X,e[65]=ae):ae=e[65];let H;return e[66]!==R||e[67]!==ae||e[68]!==ce?(H=t.jsxs(Cs,{open:R,onOpenChange:S,children:[ce,ae]}),e[66]=R,e[67]=ae,e[68]=ce,e[69]=H):H=e[69],H}),Ir=i.memo(function(e){const s=ze.c(13),{index:o,staged:x,busyHunk:m,disabled:v,onAction:k}=e,{t:N}=Be();let y;s[0]!==x?(y=x?["unstage"]:["discard","stage"],s[0]=x,s[1]=y):y=s[1];const u=y;let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={top:"var(--oc-hunk-action-offset, 0.25rem)"},s[2]=j):j=s[2];let p;s[3]!==u||s[4]!==m||s[5]!==v||s[6]!==o||s[7]!==k||s[8]!==N?(p=t.jsx("div",{className:"pointer-events-auto flex items-center gap-0.5 rounded-full border border-[var(--interactive-border)]/45 bg-[var(--surface-background)]/95 px-1 py-0.5 shadow-sm backdrop-blur-md",children:u.map(R=>{const S=N(R==="stage"?"diffView.hunk.stageTitle":R==="unstage"?"diffView.hunk.unstageTitle":"diffView.hunk.discardTitle",{index:o+1}),w=m?.index===o&&m.action===R;return t.jsx(Ke,{variant:"ghost",size:"xs",className:Me("rounded-full bg-transparent text-muted-foreground hover:bg-transparent hover:text-foreground",R==="discard"&&"text-[var(--status-error)] hover:text-[var(--status-error)]",R==="stage"&&"text-[var(--status-success)] hover:text-[var(--status-success)]"),disabled:v||m!==null,title:S,"aria-label":S,onPointerDown:Or,onClick:C=>{C.stopPropagation(),k(o,R)},children:t.jsx(U,{name:w?"loader-4":R==="stage"?"add":"arrow-go-back",className:Me(R==="stage"?"size-4":"size-3.5",w&&"animate-spin")})},R)})}),s[3]=u,s[4]=m,s[5]=v,s[6]=o,s[7]=k,s[8]=N,s[9]=p):p=s[9];let f;return s[10]!==o||s[11]!==p?(f=t.jsx("div",{className:"pointer-events-none absolute inset-e-3 z-20",style:j,"data-hunk-actions":o,children:p}),s[10]=o,s[11]=p,s[12]=f):f=s[12],f});function Or(a){return a.stopPropagation()}const zr=3,Vs=a=>{const e=ze.c(14),{path:s}=a,{t:o}=Be(),x=wr();let m,v;if(e[0]!==s||e[1]!==x?.state?.draft?.comments||e[2]!==x?.state?.threads||e[3]!==o){v=Symbol.for("react.early_return_sentinel");e:{let k;e[6]!==s?(k=w=>w.path===s&&!w.resolved,e[6]=s,e[7]=k):k=e[7];const N=(x?.state?.threads??[]).filter(k);let y;e[8]!==s?(y=w=>w.path===s,e[8]=s,e[9]=y):y=e[9];const u=(x?.state?.draft?.comments??[]).filter(y),j=N.length+u.length;if(j===0){v=null;break e}const p=new Map;for(const{author:w}of u)p.set(w?.login??"",w);for(const{comments:w}of N)p.set(w[0]?.author?.login??"",w[0]?.author??null);const f=j===1?"review.fileMark.one":"review.fileMark.other";let R;e[10]!==j||e[11]!==o||e[12]!==f?(R=o(f,{count:j}),e[10]=j,e[11]=o,e[12]=f,e[13]=R):R=e[13];const S=R;m=t.jsx("span",{className:"flex shrink-0 items-center -space-x-1 rtl:space-x-reverse",role:"img","aria-label":S,title:S,children:[...p.entries()].slice(0,zr).map(Wr)})}e[0]=s,e[1]=x?.state?.draft?.comments,e[2]=x?.state?.threads,e[3]=o,e[4]=m,e[5]=v}else m=e[4],v=e[5];return v!==Symbol.for("react.early_return_sentinel")?v:m};function Wr(a){const[e,s]=a;return t.jsx(Lr,{person:s},e)}const xs=(a,e)=>{if(e.length===0)return null;let s=null,o=null;for(const m of e)m.top<=a?(!s||m.top>s.top)&&(s=m):(!o||m.top<o.top)&&(o=m);const x=s??o;return x?{path:x.path,topOffset:x.top-a}:null},qr=(a,e,s,o)=>Math.min(Math.max(0,o),Math.max(0,a+s-e)),Ls=(a,e)=>{const s=[],o=(x,m)=>{const v=Array.from(x.children.values()).sort((N,y)=>N.name.localeCompare(y.name));for(const N of v){const{node:y,label:u}=Cr(N),j=!e.has(y.path);s.push({kind:"directory",key:`dir:${y.path}`,depth:m,path:y.path,label:u,fileCount:y.files.length,expanded:j}),j&&o(y,m+1)}const k=[...x.directFiles].sort((N,y)=>Cn(N.path).localeCompare(Cn(y.path)));for(const N of k)s.push({kind:"file",key:`file:${N.path}`,depth:m,name:Cn(N.path),file:N})};return o(Rr(a),0),s},ys=a=>{if(!a)return null;const e=a.split(`
2
2
  `);let s=null;for(const o of e){const x=o.match(/^@@\s*-\d+(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s*@@/);if(x){const m=Number.parseInt(x[1]??"",10);s=Number.isFinite(m)&&m>=1?m:null;continue}if(s!==null){if(o.startsWith(" ")){s+=1;continue}if(o.startsWith("+"))return s;if(o.startsWith("-"))return Math.max(1,s)}}return null};function $r(){const a=new Map;return({directory:e,filePath:s,revision:o,staged:x,contextLines:m,peers:v,getGitDiffs:k})=>{const N=(p,f)=>{const R=a.get(p);return R!==void 0&&R.directory===e&&R.revision===f},y=a.get(s);if(y&&N(s,o))return y.read;const u=new Map([[s,o]]);for(const p of v)!u.has(p.filePath)&&!N(p.filePath,p.revision)&&u.set(p.filePath,p.revision);const j=k(e,{paths:[...u.keys()],staged:x,contextLines:m}).then(p=>new Map(p.map(f=>[f.path,f])));for(const[p,f]of u){const R=j.then(S=>S.get(p)??null,()=>(a.get(p)?.read===R&&a.delete(p),null));a.set(p,{directory:e,revision:f,read:R})}return a.get(s)?.read??Promise.resolve(null)}}const Gr=1100,Kr=15e3,Dn=500,bs=300,en=1e6,mt=3,Hr=a=>a<=6?a:a<=12?6:a<=25?4:2,Tn={status:"loading"},Ur=3,Jr=i.memo(()=>{const a=ze.c(4),{t:e}=Be();let s;a[0]!==e?(s=e("diffView.binary.unavailable"),a[0]=e,a[1]=s):s=a[1];let o;return a[2]!==s?(o=t.jsx("div",{className:"rounded-lg border border-edge bg-background px-3 py-2",children:t.jsx("div",{className:"typography-meta text-muted-foreground",children:s})}),a[2]=s,a[3]=o):o=a[3],o}),As=a=>{const{index:e,working_dir:s}=a;return e==="A"||s==="A"||e==="?"||s==="?"},tn=a=>{const e=a.index?.trim();return!!(e&&e!=="?")},nn=a=>!!a.working_dir?.trim()||a.index==="?",En=(a,e)=>sr(a,e),ws=(a,e)=>{const s=a.split(`
3
3
  `),o=e.split(`
4
4
  `),x=Math.min(s.length,o.length);for(let m=0;m<x;m+=1)if(s[m]!==o[m])return m+1;return o.length>s.length?s.length+1:s.length>o.length?Math.max(1,o.length):1},Rt=(a,e,s)=>Vi(e)?{original:"",modified:"",isBinary:!0,patch:e,contextMode:s}:{original:"",modified:"",patch:e,fileDiff:Li(a,e),contextMode:s},Mt=(a,e)=>e.isBinary||e.submodule?null:e.fileDiff?e.fileDiff:!e.original&&!e.modified?null:Es({name:a,contents:e.original},{name:a,contents:e.modified}),vs=new WeakMap;let js=0;const ks=a=>{if(!a)return"absent";let e=vs.get(a);return e===void 0&&(js+=1,e=js,vs.set(a,e)),String(e)},Ns=(a,e)=>e===a||a.endsWith("/")&&e.startsWith(a),Ln=(a,e,s)=>{const o=a??0,x=e??0;return!o&&!x?null:t.jsxs("span",{className:Me("typography-meta flex items-center gap-1 text-xs whitespace-nowrap","flex-shrink-0",s?.className),children:[o?t.jsxs("span",{style:{color:"var(--status-success)"},children:["+",o]}):null,x?t.jsxs("span",{style:{color:"var(--status-error)"},children:["-",x]}):null]})},Xr=i.memo(a=>{const e=ze.c(11),{changedFiles:s,selectedFile:o,onSelectFile:x}=a,{t:m}=Be();if(s.length===0)return null;let v;if(e[0]!==s||e[1]!==x||e[2]!==o||e[3]!==m){let N;e[5]!==x||e[6]!==o||e[7]!==m?(N=y=>{const u=an(y),j=o===y.path;return t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>x(y.path),className:Me("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start transition-colors",j?"bg-interactive-selection text-interactive-selection-foreground":"text-muted-foreground hover:bg-interactive-hover hover:text-foreground"),children:[t.jsx(ln,{filePath:y.path,className:"h-3.5 w-3.5 flex-shrink-0"}),t.jsx("span",{className:"typography-micro font-semibold w-4 text-center uppercase",style:{color:u.color},title:m(u.descriptionKey),"aria-label":m(u.descriptionKey),children:u.code}),t.jsx("span",{className:"oc-ui-start-align min-w-0 flex-1 truncate typography-meta",style:{direction:"rtl",unicodeBidi:"plaintext"},title:y.path,children:y.path}),Ln(y.insertions,y.deletions)]})},y.path)},e[5]=x,e[6]=o,e[7]=m,e[8]=N):N=e[8],v=s.map(N),e[0]=s,e[1]=x,e[2]=o,e[3]=m,e[4]=v}else v=e[4];let k;return e[9]!==v?(k=t.jsx(Vn,{outerClassName:"flex-1 min-h-0",className:"px-2 py-2",children:t.jsx("ul",{className:"flex flex-col gap-1",children:v})}),e[9]=v,e[10]=k):k=e[10],k}),Fn=160,Qr=.5,Yr=i.memo(a=>{const e=ze.c(21),{changedFiles:s,selectedFile:o,onSelectFile:x}=a,{t:m}=Be(),[v,k]=i.useState(so);let N;e[0]!==s||e[1]!==v?(N=Ls(s,v),e[0]=s,e[1]=v,e[2]=N):N=e[2];const y=N;let u,j;e[3]!==o?(u=()=>{o&&k(P=>{const g=Array.from(P).filter(V=>o.startsWith(`${V}/`));if(g.length===0)return P;const K=new Set(P);return g.forEach(V=>K.delete(V)),K})},j=[o],e[3]=o,e[4]=u,e[5]=j):(u=e[4],j=e[5]),i.useEffect(u,j);const p=i.useRef(null),f=Vr(p);let R;e[6]!==f?(R=(P,g)=>{f(P,g,()=>k(K=>{const V=new Set(K);return V.delete(P)||V.add(P),V}))},e[6]=f,e[7]=R):R=e[7];const S=R;let w;if(e[8]!==x||e[9]!==y||e[10]!==o||e[11]!==m||e[12]!==S){let P;e[14]!==x||e[15]!==o||e[16]!==m||e[17]!==S?(P=g=>{const K=or(g.depth);if(g.kind==="directory")return t.jsxs("li",{className:"relative","data-tree-disclosure-path":g.path,children:[t.jsx(fs,{depth:g.depth}),t.jsxs("button",{type:"button",onClick:()=>S(g.path,g.expanded),"aria-expanded":g.expanded,"aria-label":g.expanded?m("diffView.fileTree.collapseDirectoryAria",{path:g.path}):m("diffView.fileTree.expandDirectoryAria",{path:g.path}),className:"oc-file-tree-row flex w-full items-center gap-1 rounded-md py-1 text-start text-muted-foreground hover:bg-interactive-hover hover:text-foreground hover:[--oc-file-tree-row-fill:var(--interactive-hover)]",style:{paddingInlineStart:K},title:g.path,children:[t.jsx(ar,{expanded:g.expanded}),t.jsx("span",{className:"oc-file-tree-row-name typography-meta",children:g.label}),t.jsx(ms,{className:"pe-2"})]})]},g.key);const V=an(g.file),le=o===g.file.path;return t.jsxs("li",{className:"relative","data-tree-disclosure-path":g.file.path,children:[t.jsx(fs,{depth:g.depth}),t.jsxs("button",{type:"button",onClick:()=>x(g.file.path),"aria-current":le?"true":void 0,className:Me("oc-file-tree-row flex w-full items-center gap-1.5 rounded-md py-1 text-start",cr(le)),style:{paddingInlineStart:K},title:g.file.path,children:[t.jsx(ln,{filePath:g.file.path,className:"ms-0.5 size-3.5 flex-shrink-0"}),t.jsx("span",{className:"oc-file-tree-row-name typography-meta",children:g.name}),t.jsxs(ms,{className:"pe-2",children:[t.jsx(Vs,{path:g.file.path}),t.jsx(lr,{code:V.code,color:V.color,label:m(V.descriptionKey)})]})]})]},g.key)},e[14]=x,e[15]=o,e[16]=m,e[17]=S,e[18]=P):P=e[18],w=y.map(P),e[8]=x,e[9]=y,e[10]=o,e[11]=m,e[12]=S,e[13]=w}else w=e[13];let C;return e[19]!==w?(C=t.jsx(Vn,{outerClassName:"flex-1 min-h-0",className:"px-1.5 py-1.5",children:t.jsx("ul",{ref:p,className:"relative flex w-max min-w-full flex-col",children:w})}),e[19]=w,e[20]=C):C=e[20],C}),Zr=i.memo(a=>{const e=ze.c(20),{filePath:s,diff:o,renderSideBySide:x}=a,{t:m}=Be(),v=o.original.length>0,k=o.modified.length>0,N=x?"flex flex-row gap-6 items-start justify-center":"flex flex-col gap-4 items-center",y=x?"flex flex-col items-center gap-2 flex-1 min-w-0":"flex flex-col items-center gap-2";let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={contain:"layout"},e[0]=u):u=e[0];let j;e[1]!==o.original||e[2]!==s||e[3]!==v||e[4]!==y||e[5]!==x||e[6]!==m?(j=v&&t.jsxs("div",{className:y,children:[t.jsx("span",{className:"typography-meta text-muted-foreground font-medium",children:m("diffView.image.original")}),t.jsx(ps,{src:o.original,alt:m("diffView.image.originalAlt",{path:s}),variant:"large",className:"flex min-h-40 min-w-40 max-w-full items-center justify-center",imgClassName:x?"max-w-full max-h-[70vh] object-contain":"max-w-full object-contain",imgStyle:{imageRendering:"auto"}})]}),e[1]=o.original,e[2]=s,e[3]=v,e[4]=y,e[5]=x,e[6]=m,e[7]=j):j=e[7];let p;e[8]!==o.modified||e[9]!==s||e[10]!==k||e[11]!==v||e[12]!==y||e[13]!==x||e[14]!==m?(p=k&&t.jsxs("div",{className:y,children:[t.jsx("span",{className:"typography-meta text-muted-foreground font-medium",children:m(v?"diffView.image.modified":"diffView.image.new")}),t.jsx(ps,{src:o.modified,alt:m("diffView.image.modifiedAlt",{path:s}),variant:"large",className:"flex min-h-40 min-w-40 max-w-full items-center justify-center",imgClassName:x?"max-w-full max-h-[70vh] object-contain":"max-w-full object-contain",imgStyle:{imageRendering:"auto"}})]}),e[8]=o.modified,e[9]=s,e[10]=k,e[11]=v,e[12]=y,e[13]=x,e[14]=m,e[15]=p):p=e[15];let f;return e[16]!==N||e[17]!==j||e[18]!==p?(f=t.jsx("div",{className:"w-full overflow-auto p-4",style:u,children:t.jsxs("div",{className:N,children:[j,p]})}),e[16]=N,e[17]=j,e[18]=p,e[19]=f):f=e[19],f}),Ps=i.memo(a=>{const e=ze.c(27),{filePath:s,diff:o,commentOrigin:x,staged:m,renderSideBySide:v,wrapLines:k,hideWhitespace:N,hunkActions:y,onExpandContextRequest:u,pendingContextExpansion:j,contextLoading:p,viewerRef:f,onFindWordRequest:R}=a;let S;e[0]!==s?(S=rr(s)||"text",e[0]=s,e[1]=S):S=e[1];const w=S;if(o.submodule){let g;return e[2]!==o.submodule||e[3]!==m?(g=t.jsx(br,{state:o.submodule,staged:m}),e[2]=o.submodule,e[3]=m,e[4]=g):g=e[4],g}if(o.isBinary){let g;return e[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Jr,{}),e[5]=g):g=e[5],g}if(Oe(s)){let g;return e[6]!==o||e[7]!==s||e[8]!==v?(g=t.jsx(Zr,{filePath:s,diff:o,renderSideBySide:v}),e[6]=o,e[7]=s,e[8]=v,e[9]=g):g=e[9],g}let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C={contain:"layout"},e[10]=C):C=e[10];let P;return e[11]!==x||e[12]!==p||e[13]!==o.fileDiff||e[14]!==o.modified||e[15]!==o.original||e[16]!==s||e[17]!==N||e[18]!==y||e[19]!==w||e[20]!==u||e[21]!==R||e[22]!==j||e[23]!==v||e[24]!==f||e[25]!==k?(P=t.jsx("div",{className:"w-full",style:C,children:t.jsx(Dr,{ref:f,original:o.original,modified:o.modified,fileDiff:o.fileDiff,language:w,fileName:s,commentOrigin:x,renderSideBySide:v,wrapLines:k,hideWhitespace:N,layout:"inline",hunkActions:y,onExpandContextRequest:u,pendingContextExpansion:j,contextLoading:p,onFindWordRequest:R})}),e[11]=x,e[12]=p,e[13]=o.fileDiff,e[14]=o.modified,e[15]=o.original,e[16]=s,e[17]=N,e[18]=y,e[19]=w,e[20]=u,e[21]=R,e[22]=j,e[23]=v,e[24]=f,e[25]=k,e[26]=P):P=e[26],P}),Ms=a=>a.files.map(e=>{const s=a.diffStats?.staged?.[e.path],o=a.diffStats?.working?.[e.path];return{...e,insertions:(s?.insertions??0)+(o?.insertions??0),deletions:(s?.deletions??0)+(o?.deletions??0),isNew:As(e)}}).sort((e,s)=>e.path.localeCompare(s.path)),eo=i.memo(a=>{const e=ze.c(55),{directory:s,file:o,revision:x,renderSideBySide:m,wrapLines:v,hideWhitespace:k,findKeyPrefix:N,registerViewerRef:y,onFindWordRequest:u,findReveal:j}=a,p=j===void 0?null:j,{t:f}=Be(),{git:R}=on(),[S,w]=i.useState(Tn),[C,P]=i.useState(!1),g=N===void 0?null:`${N}${o.path}`;let K;e[0]!==g||e[1]!==p?.key?(K=()=>{g!==null&&p?.key===g&&P(!0)},e[0]=g,e[1]=p?.key,e[2]=K):K=e[2];let V;e[3]!==g||e[4]!==p?(V=[g,p],e[3]=g,e[4]=p,e[5]=V):V=e[5],i.useEffect(K,V);let le;e[6]!==g||e[7]!==y?(le=D=>{g!==null&&y?.(g,D)},e[6]=g,e[7]=y,e[8]=le):le=e[8];const ce=le;let X;e[9]!==g||e[10]!==u?(X=D=>{g!==null&&u?.(g,D)},e[9]=g,e[10]=u,e[11]=X):X=e[11];const h=X;let q;e[12]!==o?(q=tn(o)&&!nn(o),e[12]=o,e[13]=q):q=e[13];const $=q,he=`${o.index}:${o.working_dir}:${o.insertions}:${o.deletions}`;let A;e[14]!==s||e[15]!==o.path||e[16]!==R||e[17]!==$||e[18]!==f?(A=()=>{let D=!1;const F=je();return(!R.getGitFileDiff||!R.getGitDiff?Promise.reject(new Error(f("diffView.unavailable.missingTitle"))):Oe(o.path)?R.getGitFileDiff(s,{path:o.path,staged:$}).then(io):R.getGitDiff(s,{path:o.path,staged:$,contextLines:mt}).then(B=>({...Rt(o.path,B.diff,"patch"),submodule:B.submodule}))).then(B=>{D||F!==je()||w({status:"ready",data:B})},B=>{if(D||F!==je())return;const G=B instanceof sn?B.reason==="nested_repository"?f("diffView.unavailable.nestedRepositoryTitle"):B.reason==="untracked_directory"?f("diffView.unavailable.untrackedDirectoryTitle"):f("diffView.unavailable.missingTitle"):B instanceof Error?B.message:String(B);w({status:"error",message:G})}),()=>{D=!0}},e[14]=s,e[15]=o.path,e[16]=R,e[17]=$,e[18]=f,e[19]=A):A=e[19];let M;if(e[20]!==s||e[21]!==o.path||e[22]!==he||e[23]!==R||e[24]!==x||e[25]!==$||e[26]!==f?(M=[s,o.path,he,R,x,$,f],e[20]=s,e[21]=o.path,e[22]=he,e[23]=R,e[24]=x,e[25]=$,e[26]=f,e[27]=M):M=e[27],i.useEffect(A,M),S.status==="loading"){let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),e[28]=D):D=e[28];let F;e[29]!==f?(F=f("diffView.state.loadingDiff"),e[29]=f,e[30]=F):F=e[30];let I;return e[31]!==F?(I=t.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 py-4 typography-meta text-muted-foreground",children:[D,F]}),e[31]=F,e[32]=I):I=e[32],I}if(S.status==="error"){let D;return e[33]!==S.message?(D=t.jsx("div",{className:"px-4 py-4 text-center typography-meta text-muted-foreground",children:S.message}),e[33]=S.message,e[34]=D):D=e[34],D}if(!C&&o.insertions+o.deletions>Dn){const D=o.insertions+o.deletions;let F;e[35]!==f||e[36]!==D?(F=f("diffView.state.largeDiff",{count:D}),e[35]=f,e[36]=D,e[37]=F):F=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=()=>P(!0),e[38]=I):I=e[38];let B;e[39]!==f?(B=f("diffView.actions.renderAnyway"),e[39]=f,e[40]=B):B=e[40];let G;e[41]!==B?(G=t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:I,children:B}),e[41]=B,e[42]=G):G=e[42];let re;return e[43]!==F||e[44]!==G?(re=t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-4 typography-meta text-muted-foreground",children:[F,G]}),e[43]=F,e[44]=G,e[45]=re):re=e[45],re}let J;return e[46]!==o.path||e[47]!==h||e[48]!==k||e[49]!==m||e[50]!==S.data||e[51]!==ce||e[52]!==$||e[53]!==v?(J=t.jsx(Ps,{filePath:o.path,diff:S.data,staged:$,renderSideBySide:m,wrapLines:v,hideWhitespace:k,viewerRef:ce,onFindWordRequest:h}),e[46]=o.path,e[47]=h,e[48]=k,e[49]=m,e[50]=S.data,e[51]=ce,e[52]=$,e[53]=v,e[54]=J):J=e[54],J}),to=i.memo(a=>{const e=ze.c(71),{directory:s,revision:o,renderSideBySide:x,wrapLines:m,hideWhitespace:v,findKeyPrefix:k,registerViewerRef:N,onFindWordRequest:y,findReveal:u}=a,j=u===void 0?null:u,{t:p}=Be(),{git:f}=on(),R=ir(ro),S=Fs(oo);let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={kind:"loading"},e[0]=w):w=e[0];const[C,P]=i.useState(w),[g,K]=i.useState(0),[V,le]=i.useState(ao);let ce;e[1]!==s||e[2]!==f?(ce=()=>{let _=!1;const W=je();return f.getGitStatus(s,{fresh:!0}).then(Y=>{_||W!==je()||P({kind:"ready",files:Ms(Y)})},Y=>{_||W!==je()||P({kind:"error",message:Y instanceof Error?Y.message:String(Y)})}),()=>{_=!0}},e[1]=s,e[2]=f,e[3]=ce):ce=e[3];let X;e[4]!==s||e[5]!==f||e[6]!==g||e[7]!==o?(X=[s,f,o,g],e[4]=s,e[5]=f,e[6]=g,e[7]=o,e[8]=X):X=e[8],i.useEffect(ce,X);let h,q;e[9]!==k||e[10]!==j?(h=()=>{if(!j||k===void 0||!j.key.startsWith(k))return;const _=j.key.slice(k.length);le(W=>W.has(_)?W:new Set(W).add(_))},q=[k,j],e[9]=k,e[10]=j,e[11]=h,e[12]=q):(h=e[11],q=e[12]),i.useEffect(h,q);let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($=_=>{le(W=>{const Y=new Set(W);return Y.delete(_)||Y.add(_),Y})},e[13]=$):$=e[13];const he=$;let A;e[14]!==R||e[15]!==s||e[16]!==S||e[17]!==p?(A=async()=>{const _=await R(s);if(!_){Bt.error(p("diffView.nestedRepository.openFailed"));return}S({selectedProjectId:_.id,directoryOverride:_.path})},e[14]=R,e[15]=s,e[16]=S,e[17]=p,e[18]=A):A=e[18];const M=A;let J;e[19]!==p?(J=p("diffView.unavailable.nestedRepositoryTitle"),e[19]=p,e[20]=J):J=e[20];let D;e[21]!==J?(D=t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:J}),e[21]=J,e[22]=D):D=e[22];let F;e[23]!==p?(F=p("diffView.nestedRepository.description"),e[23]=p,e[24]=F):F=e[24];let I;e[25]!==F?(I=t.jsx("div",{className:"typography-meta text-muted-foreground",children:F}),e[25]=F,e[26]=I):I=e[26];let B;e[27]!==D||e[28]!==I?(B=t.jsxs("div",{className:"min-w-0 flex-1",children:[D,I]}),e[27]=D,e[28]=I,e[29]=B):B=e[29];let G;e[30]!==M?(G=()=>{M()},e[30]=M,e[31]=G):G=e[31];let re;e[32]!==p?(re=p("diffView.nestedRepository.openAsProject"),e[32]=p,e[33]=re):re=e[33];let oe;e[34]!==G||e[35]!==re?(oe=t.jsx(Ke,{variant:"outline",size:"sm",className:"shrink-0",onClick:G,children:re}),e[34]=G,e[35]=re,e[36]=oe):oe=e[36];let ee;e[37]!==B||e[38]!==oe?(ee=t.jsxs("div",{className:"flex items-center gap-3 px-3",children:[B,oe]}),e[37]=B,e[38]=oe,e[39]=ee):ee=e[39];let ge;e[40]!==C.kind||e[41]!==p?(ge=C.kind==="loading"?t.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 py-4 typography-meta text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),p("diffView.nestedRepository.loading")]}):null,e[40]=C.kind,e[41]=p,e[42]=ge):ge=e[42];let ae;e[43]!==C.kind||e[44]!==C.message||e[45]!==p?(ae=C.kind==="error"?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-4",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:p("diffView.nestedRepository.loadFailed")}),t.jsx("div",{className:"typography-meta text-muted-foreground max-w-[32rem] text-center",children:C.message}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:()=>K(lo),children:p("diffView.actions.retry")})]}):null,e[43]=C.kind,e[44]=C.message,e[45]=p,e[46]=ae):ae=e[46];let H;e[47]!==C.files||e[48]!==C.kind||e[49]!==p?(H=C.kind==="ready"&&C.files.length===0?t.jsx("div",{className:"px-3 typography-meta text-muted-foreground",children:p("diffView.nestedRepository.noChanges")}):null,e[47]=C.files,e[48]=C.kind,e[49]=p,e[50]=H):H=e[50];let te;e[51]!==s||e[52]!==V||e[53]!==k||e[54]!==j||e[55]!==v||e[56]!==y||e[57]!==N||e[58]!==x||e[59]!==o||e[60]!==C.files||e[61]!==C.kind||e[62]!==p||e[63]!==m?(te=C.kind==="ready"&&C.files.length>0?t.jsx("ul",{className:"flex flex-col",children:C.files.map(_=>{const W=V.has(_.path),Y=an(_);return t.jsxs("li",{children:[t.jsxs("button",{type:"button","aria-expanded":W,onClick:()=>he(_.path),className:"flex w-full items-center gap-2 px-3 py-1 text-start text-foreground/80 transition-colors hover:text-foreground",title:_.path,children:[t.jsx(U,{name:W?"arrow-down-s":"arrow-right-s",className:"size-4 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"typography-micro font-semibold w-4 shrink-0 text-center uppercase",style:{color:Y.color},title:p(Y.descriptionKey),"aria-label":p(Y.descriptionKey),children:Y.code}),t.jsx(ln,{filePath:_.path,className:"size-3.5 shrink-0"}),t.jsx("span",{className:"oc-ui-start-align min-w-0 flex-1 truncate typography-meta",style:{direction:"rtl",unicodeBidi:"plaintext"},children:_.path}),Ln(_.insertions,_.deletions)]}),W?t.jsx(eo,{directory:s,file:_,revision:o,renderSideBySide:x,wrapLines:m,hideWhitespace:v,findKeyPrefix:k,registerViewerRef:N,onFindWordRequest:y,findReveal:j?.key===`${k}${_.path}`?j:null}):null]},_.path)})}):null,e[51]=s,e[52]=V,e[53]=k,e[54]=j,e[55]=v,e[56]=y,e[57]=N,e[58]=x,e[59]=o,e[60]=C.files,e[61]=C.kind,e[62]=p,e[63]=m,e[64]=te):te=e[64];let ne;return e[65]!==ee||e[66]!==ge||e[67]!==ae||e[68]!==H||e[69]!==te?(ne=t.jsxs("div",{className:"flex flex-col gap-2 py-3",children:[ee,ge,ae,H,te]}),e[65]=ee,e[66]=ge,e[67]=ae,e[68]=H,e[69]=te,e[70]=ne):ne=e[70],ne}),no=i.memo(({visible:a=!0,directory:e,file:s,layout:o,wrapLines:x,hideWhitespace:m=!1,isSelected:v,isExpanded:k,isMounted:N,onSelect:y,onExpandedChange:u,registerSectionRef:j,showOpenInEditorAction:p=!1,isOpeningInEditor:f=!1,onOpenInEditor:R,staged:S=!1,loadFullFiles:w=!1,initialDiffData:C=null,comparisonDiff:P,commentOrigin:g,onRetryComparisonDiff:K,loadFullComparisonDiff:V,readOnlyActions:le=!1,hunkActionsEnabled:ce=!1,contentRevision:X=0,registerViewerRef:h,onFindWordRequest:q,onFullContextChange:$,findReveal:he=null})=>{const{t:A}=Be(),{git:M}=on(),J=Br({fileLabel:s.path,origin:P?g:void 0}),D=Fe(i.useCallback(T=>T.directories.get(e)?.diffCache.get(s.path)??null,[e,s.path])),F=Fe(T=>T.setDiff),I=Fe(T=>T.fetchStatus),B=pe(T=>T.setDiffFileLayout),[G,re]=i.useState(0),[oe,ee]=i.useState(null),[ge,ae]=i.useState(!1),[H,te]=i.useState(null),ne=H!==null&&H.source===P?H.result:P,_=!!e&&!C&&(!P||!!V),W=i.useMemo(()=>ne?ne.status==="error"?{kind:"error",message:ne.message}:null:oe,[ne,oe]),Y=ne?ne.status==="loading":ge,[we,it]=i.useState(null),pt=i.useRef(!1),[We,Ct]=i.useState(null),[ht,rt]=i.useState(!1),[Ft,He]=i.useState(null),[_t,gt]=i.useState(null),[qe,l]=i.useState(null),be=w||qe!==null;i.useEffect(()=>{if(!(!be||!$))return $(s.path,!0),()=>$(s.path,!1)},[s.path,be,$]),i.useEffect(()=>{he?.key===s.path&&rt(!0)},[s.path,he]),i.useEffect(()=>{if(!qe||!V||!P||P.status!=="ready"||H?.source===P)return;let T=!1;return V(s.path).then(se=>{if(!T){if(se.status==="error"){Bt.error(se.message),l(null);return}te({source:P,result:se})}}),()=>{T=!0}},[qe,s.path,H,V,P]);const ke=i.useRef(null),It=i.useRef(null),Ae=i.useMemo(()=>an(s),[s]),xt=o==="side-by-side",Ue=be?"full":"patch",ot=`${s.index}:${s.working_dir}:${s.insertions}:${s.deletions}`,De=ce&&!le&&!C&&!ne&&!Oe(s.path),Je=JSON.stringify([je(),e,s.path,S,ot,G,X]),ve=We?.scope===Je?We.patch:null,ye=We?.scope===Je?We.submodule:null,Te=i.useMemo(()=>ne?ne.status==="ready"?ne.data:null:C||(S?_t:Ft||(D?{original:D.original,modified:D.modified,isBinary:D.isBinary,submodule:D.submodule,contextMode:"full"}:null)),[ne,D,C,Ft,S,_t]),Xe=Te?.contextMode===Ue,Ot=i.useCallback(T=>{It.current=T,j(s.path,T)},[s.path,j]),zt=i.useCallback(T=>{h?.(s.path,T)},[s.path,h]),cn=i.useCallback(T=>{q?.(s.path,T)},[s.path,q]),at=i.useCallback(T=>{u(s.path,T)},[s.path,u]),yt=i.useCallback(()=>{y(s.path)},[s.path,y]),lt=i.useRef(S);i.useEffect(()=>{lt.current!==S&&(lt.current=S,S?gt(null):He(null),ee(null),ke.current=null)},[S]);const $e=`${X}:${ot}`,[Qe,un]=i.useState($e),bt=Qe===$e;i.useEffect(()=>{bt||(ee(null),ke.current=null)},[bt]),i.useEffect(()=>{if(!a||!k||!N||oe)return;if(!e||ne||C||Te&&Xe&&bt&&(!De||ve!==null)){ke.current=null,ae(!1);return}const T=`${e}::${s.path}::${S?"staged":"unstaged"}::${ot}::${Ue}::${G}::${X}`;if(ke.current===T)return;ke.current=T,ee(null),ae(!0);let se=!1;const Ee=je(),ct=be?en:mt,fe=!M.getGitFileDiff||!M.getGitDiff?Promise.reject(new Error(A("diffView.unavailable.missingTitle"))):Oe(s.path)?M.getGitFileDiff(e,{path:s.path,staged:S}):!be&&ve!==null?Promise.resolve({diff:ve,submodule:ye}):M.getGitDiff(e,{path:s.path,staged:S,contextLines:ct}),Se=De&&be&&ve===null&&M.getGitDiff?M.getGitDiff(e,{path:s.path,staged:S,contextLines:mt}).then(Q=>Q.diff):Promise.resolve(ve),wt=Promise.all([fe,Se]),qt=Kr;let Tt;const $t=new Promise((Q,et)=>{Tt=setTimeout(()=>et(new Error(`Timed out after ${qt}ms`)),qt)});return Promise.race([wt,$t]).then(([Q,et])=>{if(se||Ee!==je())return;const tt="diff"in Q&&!be?Q.diff:et;if(De&&be&&tt!==null&&/^@@\s/m.test(tt)&&"diff"in Q&&Q.diff!==tt&&!Fi(Q.diff,tt))throw Ct(null),new Error(A("diffView.hunk.unavailable"));if(De&&tt!==null&&Ct({scope:Je,patch:tt,submodule:Q.submodule}),"diff"in Q){const nt={...Rt(s.path,Q.diff,Ue),submodule:Q.submodule};S?gt(nt):He(nt)}else{const nt={original:Q.original??"",modified:Q.modified??"",isBinary:Q.isBinary,submodule:Q.submodule,contextMode:"full"};S?gt(nt):(F(e,s.path,nt,Ee),He(nt))}un($e),ae(!1)}).catch(Q=>{if(!(se||Ee!==je())){if(ae(!1),Q instanceof sn){ee({kind:"unavailable",reason:Q.reason}),Q.reason==="path_not_found"&&I(e,M,{force:!0,silent:!0});return}ee({kind:"error",message:Q instanceof Error?Q.message:String(Q)})}}).finally(()=>clearTimeout(Tt)),()=>{se=!0,clearTimeout(Tt),ke.current===T&&(ke.current=null)}},[ve,ye,X,$e,De,bt,Je,ne,Ue,Te,Xe,G,e,I,s.path,ot,M,C,k,N,be,oe,F,S,A,a]);const Wt=i.useCallback(()=>{at(!k),yt()},[at,yt,k]),Ne=i.useCallback(()=>{ee(null),Ct(null),He(null),gt(null),ke.current=null,re(T=>T+1)},[]),Dt=nr(),{confirm:Ye}=Dt,_e=i.useCallback(async(T,se)=>{if(!e||!De||Y||W||pt.current||we!==null)return;const Ee=ve?Di(ve,T):null;if(!Ee){Bt.error(A("diffView.hunk.unavailable"));return}if(S&&se!=="unstage"||!S&&se==="unstage"||se==="discard"&&!await Ye({title:A("diffView.hunk.discardDialogTitle"),message:A("diffView.hunk.discardDescription",{path:s.path}),action:A("diffView.hunk.discard"),destructive:!0})||pt.current)return;pt.current=!0;const ct=je();it({index:T,action:se});try{const fe=se==="stage"?M.stageGitHunk:se==="unstage"?M.unstageGitHunk:M.revertGitHunk;if(!fe){Bt.error(A("diffView.hunk.unsupported"));return}if(await fe(e,s.path,Ee),ct!==je())return;Ne(),Ds.requestGitRefresh({directory:e,paths:[s.path]}),await I(e,M)}catch(fe){if(ct!==je())return;Ne(),Bt.error(fe instanceof Error&&fe.message?fe.message:A("diffView.hunk.unavailable"))}finally{pt.current=!1,it(fe=>fe?.index===T&&fe.action===se?null:fe)}},[ve,Ye,De,Y,W,e,I,s.path,M,we,Ne,S,A]),xe=i.useMemo(()=>De&&ve!==null?Ti(ve):[],[ve,De]),Ge=i.useCallback(T=>t.jsx(Ir,{index:T,staged:S,busyHunk:we,disabled:Y||!!W,onAction:_e}),[W,_e,we,Y,S]),Ze=i.useMemo(()=>xe.length>0?{anchors:xe,render:Ge}:void 0,[xe,Ge]);return t.jsxs("div",{ref:Ot,className:"scroll-mt-9 border-b border-[var(--interactive-border)]/40 last:border-b-0",children:[t.jsxs("div",{className:"sticky top-0 z-30 border-b border-[var(--interactive-border)]/35 bg-[var(--surface-elevated)]/90 backdrop-blur-md supports-[backdrop-filter]:bg-[var(--surface-elevated)]/80",children:[t.jsxs("div",{role:"button",tabIndex:0,onClick:Wt,onKeyDown:T=>{T.target===T.currentTarget&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),Wt())},className:Me("cursor-pointer","group/header relative grid min-h-9 w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 overflow-hidden px-3 py-2","bg-transparent","text-muted-foreground hover:text-foreground",v?"bg-[var(--interactive-selection)]/35":null),children:[t.jsx("div",{className:"absolute inset-0 pointer-events-none group-hover/header:bg-[var(--interactive-hover)]/50"}),t.jsxs("div",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[t.jsx("span",{className:"flex size-5 items-center justify-center opacity-70 group-hover/header:opacity-100",children:k?t.jsx(U,{name:"arrow-down-s",className:"size-4"}):t.jsx(U,{name:"arrow-right-s",className:"size-4"})}),t.jsx("span",{className:"typography-micro font-semibold leading-none w-4 text-center uppercase",style:{color:Ae.color},title:A(Ae.descriptionKey),"aria-label":A(Ae.descriptionKey),children:Ae.code}),t.jsx("span",{className:"min-w-0 flex-1 overflow-hidden typography-ui-label",title:s.path,children:t.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(ln,{filePath:s.path,className:"h-3.5 w-3.5 flex-shrink-0 align-middle"}),(()=>{const T=s.path.lastIndexOf("/");if(T===-1)return t.jsx("span",{className:"oc-ui-start-align block min-w-0 truncate typography-ui-label text-foreground",style:{direction:"rtl",unicodeBidi:"plaintext"},children:s.path});const se=s.path.slice(0,T),Ee=s.path.slice(T+1);return t.jsxs("span",{dir:"ltr",className:"flex min-w-0 items-baseline overflow-hidden",children:[t.jsx("span",{className:"oc-ui-start-align min-w-0 truncate typography-ui-label text-muted-foreground",style:{direction:"rtl",unicodeBidi:"plaintext"},children:se}),t.jsxs("span",{className:"flex-shrink-0 typography-ui-label",children:[t.jsx("span",{className:"text-muted-foreground",children:"/"}),t.jsx("span",{className:"text-foreground",children:Ee})]})]})})()]})})]}),t.jsxs("div",{className:"relative flex shrink-0 items-center justify-self-end gap-2",children:[t.jsx(Vs,{path:s.path}),Ln(s.insertions,s.deletions),p&&R?t.jsx(Zt,{label:A("diffView.actions.openFileInEditorAtChange"),icon:f?"loader-4":"edit",iconClassName:f?"animate-spin":void 0,onClick:T=>{T.stopPropagation(),R(s.path,Te)},disabled:f}):null,t.jsx(Ei,{onClick:J.toggle,active:J.isOpen}),t.jsx(Ts,{mode:xt?"side-by-side":"unified",onModeChange:T=>{const se=T==="side-by-side"?"side-by-side":"inline";B(s.path,se)}})]})]}),J.editor]}),J.cards,k&&t.jsxs("div",{className:"relative bg-background overflow-clip",children:[!N&&!W?t.jsx("div",{className:"h-40 border border-edge-muted bg-background/40"}):null,W?.kind==="unavailable"&&W.reason==="nested_repository"?t.jsx(to,{directory:En(e,s.path),revision:X,renderSideBySide:xt,wrapLines:x,hideWhitespace:m,findKeyPrefix:s.path,registerViewerRef:h,onFindWordRequest:q,findReveal:he}):null,W?.kind==="unavailable"&&W.reason!=="nested_repository"?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:W.reason==="untracked_directory"?A("diffView.unavailable.untrackedDirectoryTitle"):A("diffView.unavailable.missingTitle")}),t.jsx("div",{className:"typography-meta text-muted-foreground max-w-[32rem] text-center",children:W.reason==="untracked_directory"?A("diffView.unavailable.untrackedDirectoryDescription"):A("diffView.unavailable.missingDescription")}),W.reason==="path_not_found"?t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:Ne,children:A("diffView.actions.retry")}):null]}):null,W?.kind==="error"?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:A("diffView.state.failedToLoadDiff")}),t.jsx("div",{className:"typography-meta text-muted-foreground max-w-[32rem] text-center",children:W.message}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:()=>ne?K?.():Ne(),children:A("diffView.actions.retry")})]}):null,N&&Y&&!Te&&!W?t.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),A("diffView.state.loadingDiff")]}):null,N&&Te&&!ht&&s.insertions+s.deletions>Dn?t.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:A("diffView.state.largeDiff",{count:s.insertions+s.deletions})}),t.jsx("div",{className:"typography-meta text-muted-foreground",children:A("diffView.state.largeDiffDescription")}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:()=>rt(!0),children:A("diffView.actions.renderAnyway")})]}):null,N&&Te&&(ht||s.insertions+s.deletions<=Dn)?t.jsx(t.Fragment,{children:t.jsx(Ps,{filePath:s.path,diff:Te,commentOrigin:P?g:void 0,staged:S,renderSideBySide:xt,wrapLines:x,hideWhitespace:m,hunkActions:Ze,onExpandContextRequest:_?l:void 0,pendingContextExpansion:qe,contextLoading:qe!==null&&Te.contextMode!=="full"&&!W,viewerRef:zt,onFindWordRequest:cn})}):null]}),Dt.dialog]})}),Zc=({visible:a=!0,hideStackedFileSidebar:e=!1,stackedDefaultCollapsedAll:s=!1,pinSelectedFileHeaderToTopOnNavigate:o=!1,showOpenInEditorAction:x=!1,diffScope:m="all",onDiffScopeChange:v,targetFilePath:k=null,flushContent:N=!1,directory:y=null})=>{const{t:u}=Be(),j=Mi(),p=i.useRef(null);Bi(p);const[f,R]=i.useState([]),S=i.useCallback(n=>{if(!n)return;const r=p.current;R(["walkthrough","tree","wrap","whitespace","layout"].filter(d=>r?.hasAttribute(_i[d])??!1))},[]),{git:w,files:C,sourceControl:P}=on(),g=Ii(),K=!!y,V=y??g,le=Fe(n=>n.runtimeKey),{gitDirectory:ce,repositoryOptions:X}=Oi(V??null,{enabled:a,recheckOnOpen:!0}),h=ce??V,q=zi(h,P),$=pe(n=>n.openContextSurface),he=pe(n=>n.openContextPanelTab),A=Wi(n=>n.requestTarget),{screenWidth:M,isMobile:J}=qi(),D=$i(h??null),F=Gi(h??null),I=Ki(h??null),B=Fe(n=>n.setActiveDirectory),G=Fe(n=>n.ensureStatus),re=Fe(n=>n.selectNestedRepo),oe=Fe(n=>n.fetchStatus),ee=Fe(n=>n.fetchBranches),ge=Fe(n=>n.clearDiffCache),ae=Fe(n=>n.setDiff),[H,te]=i.useState(null),[ne,_]=i.useState(!1),[W,Y]=i.useState(null),[we,it]=i.useState(()=>new Set),[pt,We]=i.useState(()=>new Set),[Ct,ht]=i.useState(0),[rt,Ft]=i.useState(()=>new Map),[He,_t]=i.useState(0),[gt,qe]=i.useState(!1),[l,be]=i.useState(m===null&&!Ce()?"branch":m??"working");i.useEffect(()=>{m!==null&&be(m)},[m]);const ke=pe(n=>n.pendingDiffFile),It=pe(n=>n.pendingDiffStaged),Ae=pe(n=>n.pendingDiffScope),xt=pe(n=>n.setPendingDiffFile),Ue=pe(n=>n.diffLayoutPreference),ot=pe(n=>n.diffFileLayout),De=pe(n=>n.setDiffLayoutForAllFiles),Je=pe(n=>n.diffWrapLines),ve=pe(n=>n.setDiffWrapLines),ye=pe(n=>n.diffHideWhitespace),Te=pe(n=>n.setDiffHideWhitespace),Xe=pe(n=>n.diffFileListMode),Ot=pe(n=>n.setDiffFileListMode),zt=pe(n=>n.openContextFileAtLine),cn=Fs(n=>n.currentSessionId),at=K?null:cn,yt=Je,lt=l==="staged"?!0:l==="working"?!1:null,$e=lt??ne,Qe=J||M<=768,un=!!at&&l!=="turn"&&l!=="commit"&&l!=="pr"&&!Qe&&!Ce(),bt=l!=="turn"&&!Qe&&!Ce(),Wt=!e&&!Qe&&M>=1024,Ne=i.useRef(null),Dt=i.useRef(null),Ye=i.useRef(new Map),_e=i.useRef(null),xe=i.useRef(null),Ge=i.useRef(!1),Ze=i.useRef(null),T=i.useRef(null),se=i.useRef(null),Ee=i.useRef(null),ct=i.useCallback(()=>{const n=Ne.current;if(!n)return null;const r=n.getBoundingClientRect().top,d=[];for(const[c,b]of Ye.current)b&&d.push({path:c,top:b.getBoundingClientRect().top});return xs(r,d)},[]),fe=i.useCallback(()=>{_e.current=null,Ge.current=!1,Y(null),xe.current!==null&&(window.cancelAnimationFrame(xe.current),xe.current=null)},[]),Se=i.useCallback(n=>{it(r=>{if(r.has(n))return r;const d=new Set(r);return d.add(n),d})},[]),{diffs:wt,count:qt,loaded:Tt,error:$t,retry:Q}=ur(at,V??void 0,{enabled:a,live:l==="turn"}),et=i.useMemo(()=>{const n=new Map;for(const r of wt)if(r.file){if(typeof r.patch=="string"){n.set(r.file,Rt(r.file,r.patch,"patch"));continue}n.set(r.file,{original:r.before??"",modified:r.after??"",contextMode:"full"})}return n},[wt]),tt=i.useMemo(()=>F?.files?F.files.filter(nn).length:0,[F]),nt=i.useMemo(()=>F?.files?F.files.filter(tn).length:0,[F]),me=F?.current??null,Et=hs(n=>h?n.diffRequests.get(h):void 0),ue=ji(h??null,me,q.contexts[0]??null,a&&l==="pr"&&!Ce(),Et),dn=ue.readContext,Ve=ue.selectedSource,fn=wi(ue.provider);i.useEffect(()=>{!h||!Et||!F||Ve!==Et||hs.getState().settleDiffRequest(h,Et)},[h,Et,Ve,F]);const st=ki(h??null,me,a&&l==="commit"&&!Ce()),ut=st.selectedCommit?.hash??null;i.useEffect(()=>{(l==="commit"||l==="pr")&&Ce()&&(be("working"),v?.("working"))},[l,v]);const mn=Fe(n=>h?n.directories.get(h)?.branches??null:null),Bs=Fe(n=>h?n.directories.get(h)?.isLoadingBranches??!1:!1),_s=i.useCallback(()=>{h&&ee(h,w)},[h,ee,w]),Is=dr(h??null,a&&D!==!1,Bs,!!mn,_s,Ur),Os=gs(n=>n.setOverride),zs=gs(n=>n.clearOverride),Ws=i.useMemo(()=>new Set(q.read?.repository.remotes.map(n=>n.name)??[]),[q.read]),{base:Le,source:qs,resolved:An,revision:pn}=vr(h??null,me,a&&!Ce()&&D!==!1,{branches:mn,remoteNames:Ws,primaryRemote:q.contexts[0]?.primaryRemote,readContext:q.contexts[0]??null}),Pn=a&&!Ce()&&D!==!1;Fr(Pn?h??null:null,Pn?me:null,q);const hn=!Ce()&&fr(me,Le);i.useEffect(()=>{m===null&&hn&&be("branch")},[m,hn]);const $s=F!==null,Mn=Ce()||D===!1||Is||mr(me,Le,$s,An&&q.status==="ready"),[Gs,Ks]=i.useState(0);i.useEffect(()=>{const n=yr(l,!Mn);n!==l&&(be(n),n==="working"&&m!==null&&v?.("working"))},[l,Mn,m,v]);const gn=i.useMemo(()=>l==="pr"?ue.diffUnavailable?null:Ve:l==="commit"&&ut?{kind:"commit",hash:ut}:l==="branch"&&Le&&me?{kind:"branch",baseRef:Le,headRef:me}:null,[l,Le,me,ut,Ve,ue.diffUnavailable]),Bn=Ve?ue.prs.find(n=>n.number===Ve.number)?.headSha:void 0,Hs=i.useMemo(()=>vi(gn,{provider:ue.provider,revision:Bn}),[gn,ue.provider,Bn]),{review:xn,provider:_n}=jr(ue,h,a&&l==="pr"&&!Ce()),ie=pr(h??null,gn,a&&!Ce(),l==="branch"?pn:"",ue.readContext,ue.provider),{fetchDiff:In,fetchFullFile:On}=ie,zn=l==="commit"?ie.files:null,Wn=l==="commit"?ie.error:null,vt=l==="branch"?ie.files:null,qn=l==="branch"?ie.error:null,$n=ie.files?l==="pr"?JSON.stringify([ie.key,ie.revision]):ie.key:null,Us=i.useMemo(()=>l==="branch"||l==="commit"||l==="pr"?Array.from(we).sort().join("\0"):"",[l,we]),Vt=i.useCallback(async(n,r=!1)=>{try{const d=await In(n,r?en:mt);return{status:"ready",data:Rt(n,d.diff,r?"full":"patch")}}catch(d){return{status:"error",message:d instanceof Error?d.message:u("diffView.state.failedToLoadDiff")}}},[In,u]),Gn=i.useCallback(async n=>{try{const{original:r,modified:d}=await On(n),c=Es({name:n,contents:r},{name:n,contents:d});return{status:"ready",data:{original:r,modified:d,fileDiff:c,contextMode:"full"}}}catch(r){return{status:"error",message:r instanceof Error?r.message:u("diffView.state.failedToLoadDiff")}}},[On,u]),Gt=i.useMemo(()=>l==="branch"||l==="commit"?n=>Vt(n,!0):l==="pr"?Gn:void 0,[l,Vt,Gn]),Js=i.useMemo(()=>l==="branch"?hr(vt,pn):void 0,[l,vt,pn]),Kt=gr($n,a?Us:"",$n?Vt:null,Tn,JSON.stringify([l==="pr"?ie.revision:0,Gs]),Js),Xs=vt?.length??null,O=i.useMemo(()=>{if(l==="commit"||l==="pr")return(ie.files??[]).map(c=>({path:c.path,index:"",working_dir:c.status,insertions:c.insertions,deletions:c.deletions,isNew:c.status==="A"}));if(l==="branch")return(vt??[]).map(c=>({path:c.path,index:"",working_dir:c.status,insertions:0,deletions:0,isNew:c.status==="A"})).sort((c,b)=>c.path.localeCompare(b.path));if(l==="turn")return wt.map(c=>({path:c.file??"",index:"",working_dir:xr(c.status),insertions:c.additions??0,deletions:c.deletions??0,isNew:c.status==="added"})).filter(c=>c.path).sort((c,b)=>c.path.localeCompare(b.path));if(!F?.files)return[];const n=F.diffStats,r=l==="staged"?tn:l==="working"?nn:()=>!0,d=c=>{const b=n?.staged?.[c],E=n?.working?.[c];return l==="staged"?{insertions:b?.insertions??0,deletions:b?.deletions??0}:l==="working"?{insertions:E?.insertions??0,deletions:E?.deletions??0}:{insertions:(b?.insertions??0)+(E?.insertions??0),deletions:(b?.deletions??0)+(E?.deletions??0)}};return F.files.filter(r).map(c=>{const b=d(c.path);return{...c,insertions:b.insertions,deletions:b.deletions,isNew:As(c)}}).sort((c,b)=>c.path.localeCompare(b.path))},[l,vt,ie.files,wt,F]),yn=i.useMemo(()=>O.map(n=>n.path).join("\0"),[O]);i.useEffect(()=>{const n=yn?yn.split("\0"):[],r=new Set(n),d=`${h??""}:${l}:${s?"collapsed":"default"}`,c=T.current!==d;T.current=d,it(b=>{if(c){const z=s?0:Hr(n.length);return new Set(n.slice(0,z))}let E=!1;const L=new Set;for(const z of b){if(!r.has(z)){E=!0;continue}L.add(z)}return E?L:b}),We(b=>{if(c)return new Set;let E=!1;const L=new Set;for(const z of b){if(!r.has(z)){E=!0;continue}L.add(z)}return E?L:b})},[l,yn,h,s]);const Kn=i.useCallback(()=>{if(Ze.current=null,!a)return;const n=Ne.current;if(!n)return;const r=n.getBoundingClientRect(),d=r.top-bs,c=r.bottom+bs,b={},E=[];for(const[L,z]of Ye.current){if(!z)continue;const de=z.getBoundingClientRect();E.push({path:L,top:de.top}),we.has(L)&&(de.bottom<d||de.top>c||(b[L]=!0))}se.current=xs(r.top,E),We(L=>{let z=!1;const de=new Set(L);for(const Z of Object.keys(b))de.has(Z)||(de.add(Z),z=!0);return z?de:L})},[we,a]),Ie=i.useCallback(()=>{a&&(typeof window>"u"||Ze.current===null&&(Ze.current=window.requestAnimationFrame(Kn)))},[Kn,a]),bn=i.useRef(Ie);bn.current=Ie,i.useEffect(()=>{const n=Ne.current;if(!(!a||!n))return Ie(),n.addEventListener("scroll",Ie,{passive:!0}),window.addEventListener("resize",Ie),()=>{n.removeEventListener("scroll",Ie),window.removeEventListener("resize",Ie),Ze.current!==null&&(window.cancelAnimationFrame(Ze.current),Ze.current=null)}},[O,we,Ie,a]);const dt=i.useCallback(n=>{const r=ot[n.path];if(r)return r;if(Ue==="inline")return"inline";if(Ue==="side-by-side")return"side-by-side";const d=M<Gr;return n.isNew||d?"inline":"side-by-side"},[ot,Ue,M]),wn=i.useMemo(()=>O.length===0?null:O.every(n=>dt(n)==="side-by-side")?"side-by-side":"inline",[O,dt]);i.useEffect(()=>{a&&h&&(B(h),G(h,w))},[h,B,G,w,a]);const Ht=JSON.stringify([le,h]),vn=i.useRef({scope:Ht,paths:new Set,dirty:!1,unscoped:!1}),Hn=i.useRef(a);i.useEffect(()=>{const n=a&&!Hn.current;if(Hn.current=a,vn.current.scope!==Ht&&(vn.current={scope:Ht,paths:new Set,dirty:!1,unscoped:!1}),!h)return;const r=(c,b)=>{c.length&&(Ee.current=ct()??se.current,ge(h,c),Ft(E=>{const L=new Map(E);for(const z of c)L.set(z,(L.get(z)??0)+1);return L})),b&&_t(E=>E+1),oe(h,w,{silent:!0})},d=vn.current;return a&&(n||d.dirty)&&(r([...d.paths],d.unscoped),d.paths.clear(),d.dirty=!1,d.unscoped=!1),Ds.onGitRefreshHint(c=>{if(us(c.directory)!==us(h))return;const b=c.paths??[],E=b.length===0;if(!a){d.dirty=!0,d.unscoped||=E;for(const L of b)d.paths.add(L);return}r(b,E)})},[ct,ge,h,oe,w,Ht,a]),i.useLayoutEffect(()=>{const n=Ee.current;if(!n)return;Ee.current=null;const r=Ne.current,d=Ye.current.get(n.path);if(!r||!d)return;const c=r.getBoundingClientRect().top,b=d.getBoundingClientRect().top-c;r.scrollTop=qr(r.scrollTop,n.topOffset,b,r.scrollHeight-r.clientHeight),se.current=n},[rt]),i.useEffect(()=>{!a||l!=="all"&&!Ae||ke&&(Ae&&be(Ae),te(ke),_(Ae==="staged"||!Ae&&It),xt(null),Ge.current=!0,_e.current=ke,Se(ke),ht(n=>n+1))},[l,Se,ke,Ae,It,xt,a]),i.useEffect(()=>{if(l==="all")return;const n=k?.trim();n&&(te(n),_(l==="staged"),Ge.current=!0,_e.current=n,Se(n),ht(r=>r+1))},[l,Se,k]),i.useEffect(()=>{if(!H)return;O.some(r=>r.path===H)||(te(null),_(!1))},[O,H]);const Qs=i.useCallback((n,r)=>{const d=Ye.current;r?d.set(n,r):d.delete(n),bn.current()},[]),Ys=i.useCallback((n,r)=>{fe(),it(d=>{const c=d.has(n);if(r===c)return d;const b=new Set(d);return r?b.add(n):b.delete(n),b}),r||We(d=>{if(!d.has(n))return d;const c=new Set(d);return c.delete(n),c}),bn.current()},[fe]),Zs=i.useCallback(()=>{fe(),it(n=>n.size>0?new Set:new Set(O.map(r=>r.path))),We(new Set),Ie()},[fe,O,Ie]),ei=i.useCallback(()=>qe(!1),[]),{submitting:jn,start:ti}=Hi(at,V,ei),jt=i.useCallback(n=>{const r=Ye.current.get(n),d=Ne.current;if(!r||!d)return!1;const c=r.getBoundingClientRect().top-d.getBoundingClientRect().top;return d.scrollTo({top:d.scrollTop+c,behavior:"auto"}),!0},[]),ft=i.useCallback(n=>lt!==null?lt:ne&&n===H,[H,ne,lt]);i.useEffect(()=>{const n=_e.current;if(!a||!n)return;let r=0;const d=20;let c=!1;const b=(L=!0)=>{c||(c=!0,_e.current=null,Ge.current=!1,L&&Y(null),xe.current!==null&&(window.cancelAnimationFrame(xe.current),xe.current=null))},E=()=>{if(c){xe.current=null;return}const L=_e.current;if(!L){b(),xe.current=null;return}if(!jt(L)){r+=1,r<d?xe.current=window.requestAnimationFrame(E):(b(),xe.current=null);return}if(o&&Ge.current){Y(L),b(!1);return}b()};return xe.current=window.requestAnimationFrame(E),()=>{c=!0,xe.current!==null&&(window.cancelAnimationFrame(xe.current),xe.current=null)}},[o,Ct,jt,a]);const ni=i.useCallback(n=>{},[]),Re=Xe==="tree"&&!Qe,si=pe(n=>n.diffFileTreeWidth),Ut=pe(n=>n.setDiffFileTreeWidth),Un=i.useRef(null),[ii,Jn]=i.useState(!1),Lt=Math.max(si,Fn),Jt=i.useCallback(n=>{const r=Math.max(Fn,(Un.current?.clientWidth??0)*Qr);return Math.min(r,Math.max(Fn,n))},[]),ri=i.useCallback(n=>{n.preventDefault();const r=n.clientX,d=Lt,c=ds(n.currentTarget)?-1:1;Jn(!0);const b=L=>{Ut(Jt(d+(L.clientX-r)*c))},E=()=>{Jn(!1),window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E)};window.addEventListener("pointermove",b),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E)},[Jt,Lt,Ut]),oi=i.useCallback(n=>{const r=n.shiftKey?40:10,d=ds(n.currentTarget)?-1:1,c=(n.key==="ArrowLeft"?-r:n.key==="ArrowRight"?r:0)*d;c!==0&&(n.preventDefault(),Ut(Jt(Lt+c)))},[Jt,Lt,Ut]),kn=i.useMemo(()=>Re?Ls(O,new Set).flatMap(n=>n.kind==="file"?[n.file]:[]):[],[O,Re]),At=Re?kn:O,kt=Re?kn.find(n=>n.path===H)??kn[0]??null:null,Xt=kt?.path??null;i.useEffect(()=>{Xt&&!we.has(Xt)&&Se(Xt)},[Se,we,Xt]);const Qt=i.useCallback(n=>{if(fe(),Re){te(n),_(!1),Se(n),Ne.current?.scrollTo({top:0});return}te(n),_(!1),Ge.current=!0,_e.current=n,Se(n),ht(r=>r+1),jt(n)},[fe,Se,Re,jt]);i.useEffect(()=>{const n=r=>{if(!a||!r.altKey||r.metaKey||r.ctrlKey||r.shiftKey||r.key!=="ArrowDown"&&r.key!=="ArrowUp")return;const d=r.target;if(d instanceof HTMLElement&&(d.isContentEditable||d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.closest('[role="dialog"]'))||(r.preventDefault(),At.length===0))return;const c=r.key==="ArrowDown"?1:-1,b=Re?kt?.path:H,E=b?At.findIndex(de=>de.path===b):-1,L=E===-1?c>0?0:At.length-1:E+c,z=At[L];z&&Qt(z.path)};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[H,Qt,Re,At,kt,a]);const[Nt,ai]=i.useState(()=>new Set),li=i.useCallback((n,r)=>{ai(d=>{if(d.has(n)===r)return d;const c=new Set(d);return r?c.add(n):c.delete(n),c})},[]),Xn=i.useCallback(async(n,r,d)=>{if(!h)return null;const c=En(h,n),b=await w.getGitStatus(c,{fresh:!0});return{nestedSources:Ms(b).map(E=>({filePath:`${n}${E.path}`,layout:r,revision:d,load:async()=>{if(Oe(E.path)||!w.getGitDiff)return null;const L=tn(E)&&!nn(E),z=await w.getGitDiff(c,{path:E.path,staged:L,contextLines:mt}),de={...Rt(E.path,z.diff,"patch"),submodule:z.submodule};return Pt(Mt(E.path,de),ye)}}))}},[ye,h,w]),[Qn]=i.useState($r),Yn=i.useRef([]),Zn=i.useCallback((n,r,d,c,b)=>{if(!w.getGitDiffs)return Promise.resolve(null);const E=Yn.current.filter(L=>!Oe(L.filePath)&&ft(L.filePath)===c&&Nt.has(L.filePath)===b).map(L=>({filePath:L.filePath,revision:L.revision??""}));return Qn({directory:n,filePath:r,revision:d,staged:c,contextLines:b?en:mt,peers:E,getGitDiffs:(L,z)=>w.getGitDiffs?.(L,z)??Promise.resolve([])})},[Nt,ft,w,Qn]),es=i.useCallback(async(n,r)=>{const d=n.path,c=Nt.has(d);if(l==="turn"){const Z=et.get(d);return Pt(Z?Mt(d,Z):null,ye)}if(l==="branch"||l==="commit"||l==="pr"){const Z=Kt.get(d);if(!c&&Z?.status==="ready")return Pt(Mt(d,Z.data),ye);if(!c&&Z?.status==="loading")return null;const Yt=c&&Gt?await Gt(d):await Vt(d);if(Yt.status!=="ready")throw new Error(Yt.status==="error"?Yt.message:"Diff not loaded");return Pt(Mt(d,Yt.data),ye)}if(!h||Oe(d)||!w.getGitDiff)return null;const b=w.getGitDiff,E=ft(d),L=c?en:mt;let z;try{const Z=await Zn(h,d,r,E,c);if(Z&&!Z.ok&&Z.reason)throw new sn(Z.error,Z.reason);z=Z?.ok?Z.diff:await b(h,{path:d,staged:E,contextLines:L})}catch(Z){if(!(Z instanceof sn))throw Z;return Z.reason==="nested_repository"?Xn(d,dt(n),r):null}const de={...Rt(d,z.diff,c?"full":"patch"),submodule:z.submodule};return Pt(Mt(d,de),ye)},[l,Kt,ye,h,Vt,Nt,ft,dt,w,et,Gt,Zn,Xn]),ts=i.useRef(es);ts.current=es;const Nn=l==="branch"||l==="commit"||l==="pr"?Kt:null,Sn=l==="turn"?et:null,ns=l==="all"||l==="working"||l==="staged",ss=i.useMemo(()=>O.map(n=>{const r=Nn?.get(n.path),d=Nn?`${r?.status??"absent"}:${ks(r)}`:Sn?ks(Sn.get(n.path)):ns?`${ft(n.path)?"staged":"unstaged"}:${He+(rt.get(n.path)??0)}`:"local",c=`${ye?"hide":"show"}|${Nt.has(n.path)?"full":"patch"}|${d}`;return{filePath:n.path,layout:dt(n),revision:c,load:()=>ts.current(n,c)}}),[O,ye,rt,Nt,Nn,Sn,ns,ft,dt,He]);Yn.current=ss;const Pe=Ar({sources:ss}),[Rn,ci]=i.useState(null),is=i.useRef(O);is.current=O;const ui=i.useCallback(n=>{const r=is.current.find(d=>Ns(d.path,n.filePath))?.path??n.filePath;ci(d=>({key:n.filePath,nonce:(d?.nonce??0)+1})),Re&&r!==H&&(te(r),_(l==="staged")),Se(r),jt(r)},[l,H,Se,Re,jt]),{registerViewer:di,openOnWord:fi,focusNonce:mi}=Pr({find:Pe,visible:a,rootRef:Dt,reveal:ui}),rs=i.useCallback(n=>{De(n==="side-by-side"?"side-by-side":"inline")},[De]),[pi,os]=i.useState(null),as=i.useCallback(async(n,r)=>{if(!V||!h||!n)return;os(n);const d=je();try{let c=null;if(r?.patch&&!r.isBinary&&!Oe(n)?c=ys(r.patch):r&&r.contextMode==="full"&&!r.isBinary&&!Oe(n)&&(c=ws(r.original,r.modified)),c===null&&w.getGitDiff)try{const de=await w.getGitDiff(h,{path:n,staged:$e,contextLines:3});c=ys(de.diff)}catch{c=null}let b=r;if((c===null||!b)&&w.getGitFileDiff){const de=await w.getGitFileDiff(h,{path:n,staged:$e}),Z={original:de.original??"",modified:de.modified??"",isBinary:de.isBinary,submodule:de.submodule};b=Z,$e||ae(h,n,Z,d)}const E=c??(b&&!b.isBinary&&!Oe(n)?ws(b.original,b.modified):1),L=En(h,n),z=await Tr(C,L,{directory:h});if(!z.ok){Er(L,z);return}zt(V,L,E,1)}finally{os(c=>c===n?null:c)}},[$e,h,C,w,zt,V,ae]),hi=i.useCallback((n,r)=>{as(n,r)},[as]),gi=i.useCallback(()=>Ks(n=>n+1),[]),xi=()=>{if(!h)return null;const n=(r,d=!1)=>{const c=d||we.has(r.path);return t.jsx(no,{visible:a&&c,directory:h,file:r,layout:dt(r),wrapLines:yt,hideWhitespace:ye,isSelected:!1,isExpanded:c,isMounted:d||pt.has(r.path)||r.path===W,onSelect:ni,onExpandedChange:Ys,registerSectionRef:Qs,registerViewerRef:di,onFindWordRequest:fi,onFullContextChange:li,findReveal:Rn&&Ns(r.path,Rn.key)?Rn:null,showOpenInEditorAction:x&&l!=="turn"&&!K&&!(l==="pr"&&Ve?.linked),isOpeningInEditor:pi===r.path,onOpenInEditor:hi,staged:ft(r.path),readOnlyActions:l==="branch"||l==="commit"||l==="pr",hunkActionsEnabled:l==="all"||l==="working"||l==="staged",contentRevision:He+(rt.get(r.path)??0),comparisonDiff:l==="branch"||l==="commit"||l==="pr"?Kt.get(r.path)??Tn:void 0,commentOrigin:Hs,onRetryComparisonDiff:gi,loadFullComparisonDiff:Gt,initialDiffData:l==="turn"?et.get(r.path)??null:null},`${je()}:${h}:${r.path}`)};return t.jsxs("div",{ref:Un,className:Me("flex min-w-0 flex-1 min-h-0 h-full",N?"gap-0":"gap-3 px-3 pb-3 pt-2"),children:[Re&&t.jsxs(t.Fragment,{children:[t.jsx("section",{className:"flex max-w-[50%] flex-shrink-0 flex-col",style:{width:`${Lt}px`},children:t.jsx(Yr,{changedFiles:O,selectedFile:kt?.path??null,onSelectFile:Qt})}),t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":u("diffView.fileTree.resize"),tabIndex:0,onPointerDown:ri,onKeyDown:oi,className:Me("relative w-px shrink-0 cursor-col-resize bg-[var(--interactive-border)]/40","before:absolute before:inset-y-0 before:-inset-s-1 before:-inset-e-1 before:content-['']","hover:bg-interactive-selection focus-visible:bg-interactive-selection focus-visible:outline-none",ii&&"bg-interactive-selection")})]}),Wt&&!Re&&t.jsxs("section",{className:"hidden lg:flex w-72 flex-col rounded-xl border border-edge bg-background/70 overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-edge-muted",children:[t.jsx("span",{className:"typography-ui-header font-semibold text-foreground",children:u("diffView.section.files")}),t.jsx("span",{className:"typography-meta text-muted-foreground",children:O.length})]}),t.jsx(Xr,{changedFiles:O,selectedFile:null,onSelectFile:Qt})]}),t.jsxs("div",{className:"relative flex-1 min-w-0 min-h-0 h-full",children:[Pe.isOpen&&t.jsx(Mr,{query:Pe.query,onQueryChange:Pe.setQuery,total:Pe.matches.length,currentIndex:Pe.currentIndex,isSearching:Pe.isSearching,failedCount:Pe.failedCount,onNext:Pe.next,onPrevious:Pe.previous,onClose:Pe.close,focusNonce:mi}),t.jsx(Vn,{ref:Ne,outerClassName:"min-h-0 h-full",className:"[overflow-anchor:none]",disableHorizontal:!0,observeMutations:!1,preventOverscroll:!0,"data-diff-virtual-root":!0,children:t.jsx("div",{className:"flex flex-col [overflow-anchor:none] pb-16","data-diff-virtual-content":!0,children:Re?kt&&n(kt,!0):O.map(r=>n(r))})})]})]})},yi=()=>{if(!h)return t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:u("diffView.state.selectSessionDirectory")});if(l!=="turn"&&I&&!F)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),u("diffView.state.loadingRepositoryStatus")]});if(l!=="turn"&&D===!1)return t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:u("diffView.state.notGitRepository")});if(l==="pr"){if(ue.diffUnavailable)return t.jsx(Ai,{provider:ue.provider});if(!Ve||ie.error)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[!ie.error&&!ue.error&&!ue.loading&&t.jsx(U,{name:"git-pull-request",className:"size-6 text-muted-foreground"}),t.jsx("p",{className:"typography-meta text-muted-foreground",children:ie.error??ue.error??(ue.loading?u(rn("session.githubPrPicker.loading.pullRequests",fn)):u(rn("pullRequestComparison.pickAbove",fn)))}),(ie.error||ue.error)&&t.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>{Ve?ie.refresh():ue.refresh()},children:u("diffView.actions.retry")})]});if(!ie.files)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 typography-meta text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),u("diffView.state.loadingDiff")]})}if(l==="commit"){if(Wn)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[t.jsx("p",{className:"typography-meta text-muted-foreground",children:Wn}),t.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>{ie.refresh()},children:u("diffView.actions.retry")})]});if(!ut&&!st.loading)return t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:st.error??u("commitComparison.noCommits")});if(!zn)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),u("diffView.state.loadingDiff")]})}if(l==="branch"){const n=F===null||q.status==="idle"||q.status==="loading";if(!An||!Le&&n)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),u("diffView.branch.resolvingBase")]});if(!Le)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center",children:[t.jsx(U,{name:"git-branch",className:"size-6 text-muted-foreground"}),t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:u("diffView.branch.noBaseTitle")}),t.jsx("div",{className:"max-w-sm typography-micro text-muted-foreground",children:u("gitView.pr.toast.baseBranchRequired")})]});if(qn)return t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:u("diffView.branch.loadError")}),t.jsx("div",{className:"max-w-sm typography-micro text-muted-foreground",children:qn}),t.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>{ie.refresh()},children:u("diffView.actions.retry")})]});if(vt===null)return t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),u("diffView.branch.loadingFiles")]})}return l==="turn"&&$t?t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-4 text-sm text-muted-foreground",children:[t.jsx("div",{className:"typography-ui-label font-semibold text-foreground",children:u("diffView.state.failedToLoadDiff")}),t.jsx("div",{className:"typography-meta max-w-[32rem] text-center",children:$t}),t.jsx("button",{type:"button",className:"typography-ui-label text-primary hover:underline",onClick:Q,children:u("diffView.actions.retry")})]}):l==="turn"&&!Tt&&at?t.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}),u("diffView.state.loadingChanges")]}):O.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:l==="turn"?u("diffView.state.noLastTurnChanges"):l==="pr"?u("walkthrough.blocked.emptyDiff.description"):l==="commit"?u("commitComparison.emptyDiff"):l==="branch"&&Le?u("diffView.branch.empty",{base:Sr(Le)}):u("diffView.state.cleanWorkingTree")}):xi()},ls=O.length>0&&bt&&(l!=="pr"||!!dn),cs=()=>{const n=h??"";A(n,l==="pr"&&Ve&&dn?{source:Ve,context:dn}:{source:l==="commit"&&ut?{kind:"commit",hash:ut}:l==="branch"&&Le&&me?{kind:"branch",baseRef:Le,headRef:me}:{kind:"working-tree",scope:l==="staged"||l==="working"?l:"all"}}),K&&g?he(g,{mode:"walkthrough",targetDirectory:V}):$(V??n,"walkthrough")},bi=n=>{switch(n){case"walkthrough":return ls?{label:u("walkthrough.action.open"),icon:t.jsx(U,{name:"route",className:"size-4"}),on:!1,select:cs}:null;case"tree":return Qe?null:{label:u("diffView.fileTree.showAsTree"),icon:t.jsx(U,{name:"node-tree",className:"size-4"}),on:Xe==="tree",select:()=>Ot(Xe==="tree"?"flat":"tree")};case"wrap":return{label:u("diffView.actions.wrapLines"),icon:t.jsx(U,{name:"text-wrap",className:"size-4"}),on:yt,select:()=>ve(!Je)};case"whitespace":return{label:u("diffView.actions.hideWhitespace"),icon:t.jsx(U,{name:"space",className:"size-4"}),on:ye,select:()=>Te(!ye)};case"layout":{const r=wn==="side-by-side";return{label:u("diffView.layout.sideBySide"),icon:t.jsx(U,{name:"layout-column",className:"size-4"}),on:r,select:()=>rs(r?"unified":"side-by-side")}}}};return t.jsx(kr.Provider,{value:xn,children:t.jsxs("div",{ref:Dt,"data-find-surface":"",className:"flex h-full flex-col overflow-hidden bg-background",children:[t.jsx(Ui,{children:t.jsxs("div",{ref:p,className:Me("flex min-w-0 items-center gap-2",j?"flex-1 py-1 pe-1":"px-3 py-2 bg-background"),children:[X?t.jsx(Ji,{repositories:X,selectedRepository:ce??null,onSelectRepository:n=>{V&&re(V,n)},repositoryRoot:V??void 0}):null,!J&&!K&&(l!=="all"?t.jsx(_r,{scope:l,workingCount:tt,stagedCount:nt,turnCount:qt,branchCount:Xs,commitCount:l==="commit"?zn?.length??null:null,prCount:l==="pr"?ie.files?.length??null:null,showCommitOption:!Ce(),showBranchOption:hn,changeRequestTerm:fn,onScopeChange:n=>{be(n),v?.(n)}}):t.jsx("div",{className:"flex items-center gap-1 rounded-md px-2 py-1 text-muted-foreground shrink-0",children:t.jsx("span",{className:"typography-ui-label font-semibold text-foreground",children:I&&!F?u("diffView.state.loadingChanges"):O.length===1?u("diffView.summary.changedFilesSingle",{count:O.length}):u("diffView.summary.changedFilesPlural",{count:O.length})})})),l==="branch"&&t.jsx(Ni,{branches:mn?.all??[],currentBranch:me,base:Le,automatic:qs!=="chosen",onSelect:n=>{h&&me&&Os(h,me,n)},onSelectAutomatic:()=>{h&&me&&zs(h,me)}},JSON.stringify([h,me])),l==="commit"&&t.jsx(Si,{commits:st.commits,selectedHash:ut,loading:st.loading,error:st.error,onSelect:st.select,onRefresh:()=>{st.refresh()}},JSON.stringify([h,me])),l==="pr"&&t.jsxs(t.Fragment,{children:[t.jsx(Ri,{comparison:ue},JSON.stringify([le,h,me])),Ve&&t.jsx(Ke,{variant:"ghost",size:"sm",disabled:ie.loading,"aria-label":u("session.githubIssuePicker.actions.refresh"),title:u("session.githubIssuePicker.actions.refresh"),onClick:()=>{ie.refresh()},children:t.jsx(U,{name:"refresh",className:"size-4"})})]}),O.length>0&&t.jsxs(Ke,{variant:"ghost",size:"sm",onClick:Zs,className:Me("diff-toolbar__expand-button h-7 flex-shrink-0 gap-1 px-1.5 text-muted-foreground hover:text-foreground","ms-auto"),title:we.size>0?u("diffView.actions.collapseAll"):u("diffView.actions.expandAll"),children:[t.jsx(U,{name:"expand-up-down",className:"size-4"}),t.jsx("span",{className:"diff-toolbar__expand-label typography-ui-label",children:we.size>0?u("diffView.actions.collapseAll"):u("diffView.actions.expandAll")})]}),xn&&_n?t.jsx(Ci,{review:xn,provider:_n,className:"diff-toolbar__review-button",labelClassName:"diff-toolbar__review-label"}):null,O.length>0&&un&&t.jsxs(Ke,{variant:"default",size:"sm",onClick:()=>qe(!0),disabled:jn,className:"diff-toolbar__review-button h-7 flex-shrink-0 gap-1.5 px-2","aria-label":u("diffView.actions.reviewAria"),children:[jn?t.jsx(U,{name:"loader-4",className:"size-4 animate-spin"}):t.jsx(U,{name:"search-eye",className:"size-4"}),t.jsx("span",{className:"diff-toolbar__review-label typography-ui-label",children:u("diffView.actions.review")})]}),ls&&t.jsxs(Ke,{variant:"outline",size:"sm",onClick:cs,className:Me("diff-toolbar__walkthrough-button h-7 flex-shrink-0 gap-1.5 px-2",Nr),"aria-label":u("walkthrough.action.open"),children:[t.jsx(U,{name:"route",className:"size-4"}),t.jsx("span",{className:"diff-toolbar__walkthrough-label typography-ui-label",children:u("walkthrough.action.open")})]}),O.length>0&&!Qe&&t.jsx("span",{className:"diff-toolbar__tree-toggle flex flex-shrink-0",children:t.jsx(Zt,{label:u("diffView.fileTree.showAsTree"),icon:"node-tree",pressed:Xe==="tree",onClick:()=>Ot(Xe==="tree"?"flat":"tree")})}),O.length>0&&t.jsx("span",{className:"diff-toolbar__wrap-toggle flex flex-shrink-0",children:t.jsx(Zt,{label:u("diffView.actions.wrapLines"),icon:"text-wrap",pressed:yt,onClick:()=>ve(!Je)})}),O.length>0&&t.jsx("span",{className:"diff-toolbar__whitespace-toggle flex flex-shrink-0",children:t.jsx(Zt,{label:u("diffView.actions.hideWhitespace"),icon:"space",pressed:ye,onClick:()=>Te(!ye)})}),wn&&t.jsx("span",{className:"diff-toolbar__layout-toggle flex flex-shrink-0",children:t.jsx(Ts,{mode:wn==="side-by-side"?"side-by-side":"unified",onModeChange:rs})}),O.length>0&&t.jsxs(Cs,{onOpenChange:S,children:[t.jsxs(Xi,{children:[t.jsx(Qi,{asChild:!0,children:t.jsx("span",{className:"diff-toolbar__more flex-shrink-0",children:t.jsx(Ss,{asChild:!0,children:t.jsx(Yi,{label:u("diffView.actions.moreActions"),icon:"more"})})})}),t.jsx(Zi,{side:"bottom",sideOffset:6,children:u("diffView.actions.moreActions")})]}),t.jsx(Rs,{align:"end",className:"min-w-56",children:f.map(n=>{const r=bi(n);return r?t.jsxs(er,{className:"flex items-center gap-2",onClick:r.select,children:[r.icon,t.jsx("span",{className:"min-w-0 truncate typography-ui-label text-foreground",children:r.label}),r.on?t.jsx(U,{name:"check",className:"ms-auto size-4 text-foreground"}):null]},n):null})})]})]})}),t.jsx(tr,{open:gt,onOpenChange:qe,projectDirectory:h??null,submitting:jn,onConfirm:ti}),yi()]})})};function so(){return new Set}function io(a){return{original:a.original??"",modified:a.modified??"",isBinary:a.isBinary,submodule:a.submodule,contextMode:"full"}}function ro(a){return a.addProject}function oo(a){return a.openNewSessionDraft}function ao(){return new Set}function lo(a){return a+1}export{Zc as DiffView,no as MultiFileDiffEntry};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdfjs-uwkGOIm9.js","assets/vendor-pdfjs-dist-CiCxEq5L.js"])))=>i.map(i=>d[i]);
2
- import{R as o,j as i,f as ge,r as Pt,a as Iu}from"./vendor-react--VO_rL_p.js";import{bX as jl,bY as Ou,bw as zu,j as bs,aZ as Nl,aX as Bu,bZ as $u,bU as Wu,b_ as _u,be as Hu,u as Fe,bp as Ue,aI as ft,b$ as Uu,bV as gr,t as Ba,c0 as $a,c1 as pi,c2 as Gu,c3 as Ku,c4 as Xu,aO as Rl,c5 as Xt,c6 as qu}from"./katex.min-BM3LOlr3.js";import{u as Le,y as Ss,B as he,Q as q,aE as Yu,aD as Ju,az as Zu,aA as Qu,aC as ed,I as $,cO as qt,iK as td,iL as Ni,iM as br,iN as nd,bN as Pi,bO as sd,iO as rd,eg as id,gr as od,iP as ad,iQ as Wn,eE as $t,n as Yt,g3 as wr,hU as ld,iR as cd,iS as ud,iT as dd,bE as fd,aM as md,aL as hd,aK as pd,hn as gd,hm as wd,aJ as gi,bC as vd,eq as xd,A as K,ak as Wa,iU as bd,aO as yd,eH as Sd,V as _a,cH as wi,T as Cd,g1 as gs,bc as kd,Y as Fd,iV as ws,eS as Ed,iW as vi,g2 as Ha,g4 as Ua,iX as Ga,iY as Ka,aR as jd,iZ as Nd,i_ as Rd,i$ as Pd,ex as Md,j0 as Td,aQ as Dd,j1 as Ld,eG as Xa,j2 as Vd,t as Pl,q as Ml,D as Tl,l as Dl,F as Ll,o as Vl,a2 as Al,a3 as Il,a4 as Ol,a5 as xs,a_ as ur,a$ as xi,b0 as qa,gj as zl,av as dr,ay as fr,ad as Bl,aZ as Ad,aa as Id,ab as Od,ac as zd,j3 as Bd,gf as $l,ge as Wl,b2 as vr,gg as $d,j4 as Wd,bf as _d,j5 as Hd,bg as Ud,j6 as Gd,j7 as Kd,j8 as Xd,gh as qd,be as Yd,bd as Jd}from"./useAppFontEffects-UKWR--vP.js";import{s as Zd,c as Ya,C as Qd}from"./flexokiTheme-BL4fG_5M.js";import{a as _l,E as Hl,i as Mi,S as yr,R as ef,l as tf}from"./vendor-codemirror-state-Cd8udR5z.js";import{E as pe,k as Sr,f as nf,m as sf,n as rf,g as of,V as Ti,D as Mt,W as af,G as lf}from"./vendor-codemirror-view-Ciie9ey-.js";import{v as cf,z as uf,A as df,B as ff,s as Ul}from"./vendor-codemirror-language-8HZTPOnt.js";import{az as mf,aA as hf,aB as pf,aC as gf,an as wf}from"./runtimeEndpointReset-IJE1o-nk.js";import{h as Gl,u as vf}from"./useMarkdownLocalAssets-DFwvtvsy.js";import{u as xf,c as bf,b as yf,F as Ja}from"./fileContentPoller-dM2aYiRt.js";import{V as Sf,J as Cf,F as kf}from"./JsonTreeView-D5DVoS6l.js";import{c as Ff}from"./codeHighlight-BYbxdxkk.js";import{getCodeTokenTheme as Ef,getThemeRenderName as jf,ensurePierreThemeRegistered as Za}from"./appThemeRegistry-Dk6CF03D.js";import{V as Nf,W as Rf}from"./useNextRenderData-CVFf78p9.js";import{V as Pf}from"./ReviewCards-D--SZYNA.js";import{M as Kl,D as Mf,a as mr,b as Tf,m as Df,g as Lf,c as Vf,u as Af}from"./contextFileOpenGuard-D_Eh6QOM.js";import{D as If}from"./vendor-react-drawio-C6TkEvnS.js";import{e as Of,h as zf}from"./vendor-codemirror-search-Bk6iB2TM.js";import{a as Bf,b as $f}from"./vendor-codemirror-autocomplete-BGedy2gC.js";import{p as Wf}from"./parseDiffFromFile-DEaa1di6.js";import{jsonLanguage as _f}from"./vendor-codemirror-lang-json-DVAYKmoO.js";import{l as Hf}from"./vendor-codemirror-lint-aq8IpR1c.js";import{s as Uf}from"./vendor-strip-json-comments-5dJlOkP1.js";import{_ as Gf}from"./vendor-vite-runtime-DD1OZmLC.js";import{u as Kf}from"./vendor-tanstack-react-virtual-CqfECoM0.js";import{o as Xf,s as qf}from"./vendor-zod-Csf1sqWl.js";import{u as Yf,n as Jf}from"./useInlineCommentController-DgJBL64V.js";import{u as Zf}from"./useWholeFileComment-3Adypnae.js";import{toDiffsLanguage as Qf,DIFFS_HIGHLIGHTER as em}from"./diffsHighlighter-BsxkaI3Q.js";import{c as tm}from"./scheduledTasksApi-Bt4F6fco.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-zustand-C9tWdk0j.js";import"./vendor-opencode-client-CqFY51gT.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./vendor-streamdown-BbSYZ3NF.js";import"./vendor-markdown-BTUqNk6W.js";import"./vendor-mdast-util-from-markdown-CZHjOE75.js";import"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import"./vendor-micromark-util-decode-string-fHsnqYdj.js";import"./vendor-decode-named-character-reference-C3-224fz.js";import"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import"./vendor-micromark-AWM-NZXP.js";import"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import"./vendor-micromark-util-chunked-DrRIdSP-.js";import"./vendor-micromark-factory-space-PzSHLgmq.js";import"./vendor-micromark-util-character-CW3Cu1MS.js";import"./vendor-micromark-core-commonmark-kzTLNXAm.js";import"./vendor-micromark-util-classify-character-tcLuZZwM.js";import"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import"./vendor-micromark-util-subtokenize-BF1Jf29a.js";import"./vendor-micromark-factory-destination-Sj0xfi0V.js";import"./vendor-micromark-factory-label-amyP0HdC.js";import"./vendor-micromark-factory-title-khnLkZK6.js";import"./vendor-micromark-factory-whitespace-eIB00uTl.js";import"./vendor-micromark-util-html-tag-name-DbKNfynz.js";import"./vendor-unist-util-stringify-position-Ch_qCilz.js";import"./vendor-mdast-util-to-string-C_aolqmU.js";import"./vendor-unist-util-visit-DhPeCsfG.js";import"./vendor-unist-util-visit-parents-DlviEg7Z.js";import"./vendor-unist-util-is-BPZGFiMU.js";import"./vendor-hast-util-raw-DvvLJg15.js";import"./vendor-ungap-structured-clone--gfxRhYI.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-parse5-DwmzEj2o.js";import"./vendor-entities-wUUgTZDW.js";import"./vendor-web-namespaces-bsVAaBS1.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-unist-util-position-60F3QETU.js";import"./vendor-hast-util-from-parse5-Ba3T6RJI.js";import"./vendor-devlop-0Dp3JUBc.js";import"./vendor-property-information-Boo8Xpef.js";import"./vendor-hastscript-BrPNioaz.js";import"./vendor-comma-separated-tokens-CRUGqg4f.js";import"./vendor-space-separated-tokens-D7QSIrTI.js";import"./vendor-hast-util-parse-selector-TXfch5wI.js";import"./vendor-vfile-location-LfEFwJ2h.js";import"./vendor-hast-util-to-parse5-BoysVIPW.js";import"./vendor-hast-util-sanitize-2aGO5ay8.js";import"./vendor-micromark-extension-gfm-CsfPlnlB.js";import"./vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js";import"./vendor-micromark-extension-gfm-footnote-OFl1FCH2.js";import"./vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js";import"./vendor-micromark-extension-gfm-table-dgw4LfUw.js";import"./vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js";import"./vendor-mdast-util-gfm-CroMDYLM.js";import"./vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-mdast-util-find-and-replace-DB9iC-bx.js";import"./vendor-escape-string-regexp-BaJN9MlJ.js";import"./vendor-mdast-util-gfm-footnote-C-csI7OF.js";import"./vendor-mdast-util-gfm-strikethrough-BcskTdio.js";import"./vendor-mdast-util-gfm-table-DhPwQIyj.js";import"./vendor-markdown-table-DvhhVmnL.js";import"./vendor-mdast-util-to-markdown-Cl3qaiyc.js";import"./vendor-longest-streak-CtXnX3Xp.js";import"./vendor-mdast-util-phrasing-4oVbNLC3.js";import"./vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js";import"./vendor-mdast-util-to-hast-CWnLaQSO.js";import"./vendor-micromark-util-sanitize-uri-BbwQ7CLk.js";import"./vendor-trim-lines-D8znQY54.js";import"./vendor-micromark-extension-cjk-friendly-BzZDGrF5.js";import"./vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js";import"./vendor-get-east-asian-width-CPhS2cOv.js";import"./vendor-micromark-util-symbol-JJPacVTp.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js";import"./vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js";import"./vendor-hast-util-from-html-isomorphic-B0Kn01s9.js";import"./vendor-hast-util-from-dom-DeNf9aYW.js";import"./vendor-katex-DBqql0K7.js";import"./vendor-hast-util-to-text-0GXLnBvt.js";import"./vendor-hast-util-is-element-CuOmiqQi.js";import"./vendor-unist-util-find-after-CMaZmLxc.js";import"./vendor-micromark-extension-math-BRFoDziv.js";import"./vendor-mdast-util-math-wB-IJCL0.js";import"./vendor-remend-r8cP_t-e.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tailwind-merge-BKkUfl9q.js";import"./vendor-marked-DN3zOnEe.js";import"./vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js";import"./vendor-style-to-js-CI2G4dgu.js";import"./vendor-style-to-object-BAv4SQXc.js";import"./vendor-inline-style-parser-BlqBsVO4.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-estree-util-is-identifier-name-BgBfM8ME.js";import"./vendor-vfile-message-DqhD22jI.js";import"./vendor-unified-1CQKw2_w.js";import"./vendor-bail-FqpXQuLt.js";import"./vendor-extend-B94qxKr5.js";import"./vendor-is-plain-obj-C1gvLhAf.js";import"./vendor-trough-B_b8ryxu.js";import"./vendor-vfile-BCWrK60u.js";import"./vendor-html-url-attributes-D46m5wfe.js";import"./vendor-capacitor-core-B4EWRrHz.js";import"./vendor-base-ui-zhBy6TEG.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-dom-WyXykhNi.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-floating-ui-react-dom-Cy8dRGoy.js";import"./vendor-use-sync-external-store-CfLJGVyr.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-dnd-kit-core-Br1Cs7RV.js";import"./vendor-dnd-kit-utilities-DZ9KbT5S.js";import"./vendor-dnd-kit-accessibility-CYclfhtC.js";import"./vendor-dnd-kit-sortable-DpfLEOLv.js";import"./vendor-tanstack-virtual-core-BdFnkr_2.js";import"./vendor-framer-motion-C_wK4GIM.js";import"./vendor-motion-dom-HXPOMxb7.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-codemirror-commands-CjjsURR-.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-lezer-highlight-CZEcqU6G.js";import"./vendor-codemirror-lang-javascript-DmqaSK_j.js";import"./vendor-lezer-javascript-CWSwshuO.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-codemirror-streamparser-CmlTsbN2.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-codemirror-lang-css-BLpgXfL2.js";import"./vendor-lezer-css-B2Hx_Nps.js";import"./vendor-codemirror-lang-html-S3jxr3Mo.js";import"./vendor-lezer-html-Cr8K5DGw.js";import"./vendor-codemirror-lang-markdown-D1jveRI5.js";import"./vendor-lezer-markdown-TQKzBB8i.js";import"./vendor-codemirror-language-data-CVww3XgZ.js";import"./vendor-codemirror-lang-python-B-5UC9Ui.js";import"./vendor-lezer-python-BUoImtUb.js";import"./vendor-sonner-Dw26OnzC.js";import"./vendor-cmdk-BtSpU-Io.js";import"./vendor-radix-ui-react-dialog-OIW6VLWw.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D4RvEbuR.js";import"./vendor-radix-ui-react-context-BbFoxCHu.js";import"./vendor-radix-ui-react-id-aGag8i_5.js";import"./vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js";import"./vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js";import"./vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js";import"./vendor-radix-ui-react-primitive-CrN9dRDb.js";import"./vendor-radix-ui-react-slot-BjbalUfz.js";import"./vendor-radix-ui-react-use-callback-ref-CcC_buIU.js";import"./vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js";import"./vendor-radix-ui-react-focus-scope-D1noLHmd.js";import"./vendor-radix-ui-react-portal-BlUEzfrF.js";import"./vendor-radix-ui-react-presence-BGqFfiW4.js";import"./vendor-radix-ui-react-focus-guards-CSS2IbZC.js";import"./vendor-react-remove-scroll-Der_cv-1.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-Clwl9llp.js";import"./vendor-react-style-singleton-D_xJlTqU.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-BdLl6ZIw.js";import"./vendor-use-callback-ref-CXJF1lEr.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-legendapp-list-wfKYGEOv.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-replit-codemirror-vim-BpSlt2iY.js";import"./vendor-replit-codemirror-vim-core-FHzKdNUS.js";import"./space-apply-BWMKP1l4.js";import"./computeVirtualFileMetrics-COD-bZRh.js";import"./themeResolver-DXizngAV.js";import"./vendor-pierre-theming-D_TRfu0q.js";import"./hastToHtml-BHV14OWE.js";import"./vendor-hast-util-to-html-Jw3IXh58.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./getFiletypeFromFileName-BgI9McTw.js";import"./isFilePlainText-CgNXAeJu.js";import"./textMateThemeFromAppTheme-BA68BaAw.js";import"./vendor-lezer-json-Cn1mncjr.js";import"./vendor-diff-C3JhlQdm.js";const nm=(s,e)=>{if(!e)return null;const r=Number.parseInt(s.trim(),10);return!Number.isFinite(r)||r<1?null:Math.min(r,e.state.doc.lines)},Qa=(s,e)=>{const r=s.state.doc.lineAt(e.main.head);return{lineNumber:r.number,character:e.main.head-r.from+1,selection:e}},el=(s,e,r)=>{const t=s.state.doc.line(e),a=Math.max(1,Math.min(r,t.length+1)),l=t.from+a-1;s.dispatch({selection:_l.cursor(l),effects:pe.scrollIntoView(l,{y:"center"})})};function sm({open:s,onOpenChange:e,viewRef:r,variant:t="overlay"}){const{t:a}=Le(),l=r.current,[d,f]=o.useState(""),h=o.useRef(null),v=o.useRef(!1),g=o.useRef(null),w=o.useRef(null),y=o.useMemo(()=>nm(d,l),[d,l]);o.useEffect(()=>{!s||!l||(v.current=!1,h.current=Qa(l,l.state.selection),f(""))},[s,l]),o.useEffect(()=>{s&&window.requestAnimationFrame(()=>{w.current?.focus(),w.current?.select()})},[s]),o.useEffect(()=>{if(!(!s||!l||!h.current)){if(y===null){const{selection:C}=h.current;l.dispatch({selection:C,effects:pe.scrollIntoView(C.main.from,{y:"center"})});return}el(l,y,h.current.character)}},[y,s,l]);const S=o.useCallback(()=>{if(!l||v.current||!h.current)return;const{selection:C}=h.current;l.dispatch({selection:C,effects:pe.scrollIntoView(C.main.from,{y:"center"})})},[l]),F=o.useRef(s);o.useEffect(()=>{F.current&&!s&&S(),F.current=s},[s,S]);const R=o.useCallback(C=>{C||S(),e(C)},[e,S]),k=o.useCallback(()=>{!l||y===null||!h.current||(v.current=!0,el(l,y,h.current.character),e(!1),l.focus())},[y,e,l]);o.useEffect(()=>{if(!s)return;const C=M=>{const p=g.current,N=M.target;!p||!(N instanceof Element)||p.contains(N)||N.closest("[data-go-to-line-toggle]")||R(!1)},V=M=>{M.key==="Escape"&&(M.preventDefault(),R(!1))};return document.addEventListener("pointerdown",C,!0),document.addEventListener("keydown",V,!0),()=>{document.removeEventListener("pointerdown",C,!0),document.removeEventListener("keydown",V,!0)}},[R,s,t]);const E=o.useMemo(()=>{if(!l)return a("goToLineDialog.helper.editorUnavailable");if(y===null){const C=h.current??Qa(l,l.state.selection);return a("goToLineDialog.helper.currentLineRange",{current:C.lineNumber,max:l.state.doc.lines})}return a("goToLineDialog.helper.goToLine",{line:y})},[y,a,l]);return t==="inline"?s?i.jsxs("div",{ref:g,"data-editor-overlay":!0,className:"ms-1 flex h-6 items-center gap-1",children:[i.jsx(Ss,{ref:w,type:"number",min:1,step:1,inputMode:"numeric",value:d,onChange:C=>f(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),k())},placeholder:a("goToLineDialog.field.linePlaceholderShort"),className:"h-6 w-20 rounded-md border-edge bg-transparent px-2 typography-meta"}),i.jsx(he,{variant:"outline",size:"xs",onClick:k,disabled:!l||y===null,className:"h-6 px-2",children:a("goToLineDialog.actions.go")})]}):null:i.jsx("div",{ref:g,"data-editor-overlay":!0,className:q("absolute inset-s-3 top-3 z-40 w-[min(32rem,calc(100%-1.5rem))] rounded-xl border border-[var(--interactive-border)] bg-[color:color-mix(in_srgb,var(--surface-elevated)_94%,transparent)] p-2.5 shadow-lg backdrop-blur-sm transition-all",s?"pointer-events-auto translate-y-0 opacity-100":"pointer-events-none -translate-y-1 opacity-0"),children:i.jsxs("div",{className:"min-w-0",children:[i.jsx(Ss,{ref:w,type:"number",min:1,step:1,inputMode:"numeric",value:d,onChange:C=>f(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),k())},placeholder:a("goToLineDialog.field.linePlaceholder"),className:"h-8 w-full rounded-md border-edge bg-surface-elevated/60 typography-ui-label"}),i.jsx("div",{className:"mt-2 rounded-md bg-primary/15 px-3 py-1.5 typography-ui-label text-foreground/95",children:E})]})})}function tl(s){const e=ge.c(22),{path:r,className:t,title:a,trailing:l}=s,d=a===void 0?r:a,f=o.useRef(null),h=o.useRef(null),[v,g]=o.useState(!0);let w;e[0]!==r?(w=r.split(/[\\/]/).filter(Boolean).pop()??r,e[0]=r,e[1]=w):w=e[1];const y=w;let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{const N=f.current,O=h.current;if(!N||!O)return;const I=()=>g(O.offsetWidth<=N.clientWidth);I();const L=new ResizeObserver(I);return L.observe(N),()=>L.disconnect()},e[2]=S):S=e[2];let F;e[3]!==r?(F=[r],e[3]=r,e[4]=F):F=e[4],o.useLayoutEffect(S,F);let R;e[5]!==t?(R=q("relative min-w-0 flex-1 overflow-hidden",t),e[5]=t,e[6]=R):R=e[6];const k=d??void 0,E=l?"pe-[18px]":void 0;let C;e[7]!==E?(C=q("invisible absolute whitespace-nowrap",E),e[7]=E,e[8]=C):C=e[8];let V;e[9]!==r||e[10]!==C?(V=i.jsx("span",{ref:h,"aria-hidden":!0,className:C,children:r}),e[9]=r,e[10]=C,e[11]=V):V=e[11];let M;e[12]!==v||e[13]!==y||e[14]!==r||e[15]!==l?(M=l?i.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"min-w-0 truncate",children:v?r:y}),l]}):i.jsx("span",{className:"block truncate",children:v?r:y}),e[12]=v,e[13]=y,e[14]=r,e[15]=l,e[16]=M):M=e[16];let p;return e[17]!==M||e[18]!==R||e[19]!==k||e[20]!==V?(p=i.jsxs("span",{ref:f,className:R,title:k,dir:"ltr",children:[V,M]}),e[17]=M,e[18]=R,e[19]=k,e[20]=V,e[21]=p):p=e[21],p}const rm=new Map(Object.entries({FunctionDeclaration:"function",FunctionDefinition:"function",FunctionItem:"function",FunctionDecl:"function",MethodDeclaration:"method",MethodDecl:"method",ClassDeclaration:"class",ClassDefinition:"class",InterfaceDeclaration:"class",StructItem:"class",TraitItem:"class",ImplItem:"class",TypeAliasDeclaration:"type",EnumDeclaration:"type",EnumItem:"type",TypeSpec:"type",ModItem:"module"})),im=new Map([["VariableDeclaration","function"],["PropertyDeclaration","method"]]),om=new Set(["ArrowFunction","FunctionExpression"]),am=new Set(["VariableDefinition","PropertyDefinition","TypeDefinition","VariableName","DefName","FieldName","BoundIdentifier","TypeIdentifier"]),Xl=/^(?:ATXHeading|SetextHeading)([1-6])$/,ql=(s,e)=>{for(let r=s.firstChild;r;r=r.nextSibling)if(e.has(r.name))return r;return null},Yl=s=>{if(Xl.test(s.name))return"heading";const e=rm.get(s.name);if(e)return e;const r=im.get(s.name);return r&&ql(s,om)?r:null},lm=(s,e)=>s.doc.lineAt(e.from).text.replace(/^\s{0,3}#{1,6}\s*/,"").replace(/\s+#+\s*$/,"").trim(),cm=(s,e=200)=>{const r=cf(s,s.doc.length,e);if(!r)return[];const t=[],a=[];return r.iterate({enter:l=>{const d=Yl(l.node);if(!d)return;let f,h;if(d==="heading")f=lm(s,l.node),h=l.from;else{const g=ql(l.node,am);if(!g)return;f=s.sliceDoc(g.from,g.to),h=g.from}if(!f)return;for(;a.length>0&&a[a.length-1]<=l.from;)a.pop();const v=d==="heading"?Number(Xl.exec(l.name)?.[1]??1)-1:a.length;t.push({name:f,kind:d,line:s.doc.lineAt(h).number,from:h,depth:v}),d!=="heading"&&a.push(l.to)}}),t},um={function:"braces",method:"braces",class:"box-3",type:"code-box",module:"folder-3",heading:"text"},dm="data-document-symbols-toggle";function nl({open:s,onOpenChange:e,viewRef:r}){const{t}=Le(),a=r.current,l=o.useRef(null),[d,f]=o.useState([]),[h,v]=o.useState("");o.useEffect(()=>{s&&(v(""),f(a?cm(a.state):[]))},[s,a]);const g=o.useCallback(()=>{e(!1),a?.focus()},[e,a]);o.useEffect(()=>{if(!s)return;const y=S=>{const F=S.target;!(F instanceof Element)||!l.current||l.current.contains(F)||F.closest(`[${dm}]`)||e(!1)};return document.addEventListener("pointerdown",y,!0),()=>document.removeEventListener("pointerdown",y,!0)},[e,s]);const w=o.useCallback(y=>{a&&a.dispatch({selection:_l.cursor(y.from),effects:pe.scrollIntoView(y.from,{y:"center"})}),g()},[g,a]);return s?i.jsx("div",{ref:l,"data-editor-overlay":!0,className:"absolute inset-s-3 top-3 z-40 w-[min(28rem,calc(100%-1.5rem))] overflow-hidden rounded-xl border border-[var(--interactive-border)] bg-[var(--surface-elevated)] shadow-lg",onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),g())},children:i.jsxs(Yu,{loop:!0,filter:(y,S)=>y.split("\0")[0].toLowerCase().includes(S.trim().toLowerCase())?1:0,className:"[&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-1 [&_[cmdk-item]]:typography-meta",children:[i.jsx(Ju,{autoFocus:!0,value:h,onValueChange:v,placeholder:t("filesView.symbols.placeholder"),"aria-label":t("filesView.symbols.placeholder")}),i.jsxs(Zu,{className:"max-h-[min(20rem,calc(100vh-16rem))]",children:[i.jsx(Qu,{className:"px-3 py-4 typography-meta text-muted-foreground",children:d.length===0?t("filesView.symbols.noneInFile"):t("filesView.symbols.noMatches")}),d.map(y=>i.jsxs(ed,{value:`${y.name}\0${y.from}`,onSelect:()=>w(y),className:"gap-2",children:[i.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",style:{paddingInlineStart:`${y.depth*12}px`},children:[i.jsx($,{name:um[y.kind],className:"size-3.5 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"min-w-0 truncate text-foreground",children:y.name})]}),i.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:y.line})]},`${y.from}:${y.name}`))]})]})}):null}const fm=s=>{const e=ge.c(10),{className:r,iconClassName:t}=s,{t:a}=Le(),l=jl();let d;e[0]!==a?(d=a("filesView.tree.actions.showGitignored"),e[0]=a,e[1]=d):d=e[1];let f;e[2]!==l?(f=()=>Ou(!l),e[2]=l,e[3]=f):f=e[3];let h;return e[4]!==r||e[5]!==t||e[6]!==l||e[7]!==d||e[8]!==f?(h=i.jsx(qt,{label:d,icon:"file-forbid",pressed:l,className:r,iconClassName:t,onClick:f}),e[4]=r,e[5]=t,e[6]=l,e[7]=d,e[8]=f,e[9]=h):h=e[9],h},mm=(s,e)=>{const r=e.trim().toLowerCase(),t=[];if(!r)return t;const a=s.toLowerCase(),l=[],d=[];if(a.length!==s.length){let v=0;for(const g of s){const w=v+g.length;for(let y=0;y<g.toLowerCase().length;y++)l.push(v),d.push(w);v=w}}let f=0,h=0;for(;;){const v=a.indexOf(r,f);if(v===-1)break;const g=l.length>0?l[v]:v,w=d.length>0?d[v+r.length-1]:v+r.length;g>=h&&(t.push({start:g,end:w}),h=w),f=v+r.length}return t},hm=(s,e)=>{if(!e.trim())return[];const r=s.ownerDocument,t=r.createTreeWalker(s,4),a=[];for(let l=t.nextNode();l;l=t.nextNode())if(!(!l.parentElement||l.parentElement.closest("svg, script, style")))for(const d of mm(l.nodeValue??"",e)){const f=r.createRange();f.setStart(l,d.start),f.setEnd(l,d.end),a.push(f)}return a},pm=(s,e)=>{const r=s.ownerDocument.defaultView;if(!(!r||!s.contains(e.startContainer)))for(let t=e.startContainer.parentElement;t;t=t.parentElement){const a=r.getComputedStyle(t),l=/(auto|scroll|hidden)/.test(a.overflowX),d=/(auto|scroll|hidden)/.test(a.overflowY);if(l||d){const f=e.getBoundingClientRect(),h=t.getBoundingClientRect(),v=h.top+t.clientTop,g=h.left+t.clientLeft,w=v+t.clientHeight,y=g+t.clientWidth,S=f.top<v?f.top-v:Math.max(0,f.bottom-w),F=f.left<g?f.left-g:Math.max(0,f.right-y);(l&&F||d&&S)&&t.scrollBy({left:l?F:0,top:d?S:0})}if(t===s)break}},gm=120,sl=({containerRef:s,open:e,onOpenChange:r,focusNonce:t,className:a})=>{const{t:l}=Le(),[d,f]=o.useState(""),[h,v]=o.useState(0),[g,w]=o.useState(0),y=o.useRef(null),[S,F]=o.useState([]),k=`oc-preview-search-${o.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,E=`${k}-current`,C=o.useRef(d);C.current=d;const V=o.useRef(null),M=o.useRef(null),p=o.useCallback((T,A=!1)=>{const B=s.current;if(!B){F([]),v(0),w(0);return}const X=hm(B,T);F(X);const ie=X.length;v(ie),w(ue=>!A||ie===0?0:Math.min(ue,ie-1))},[s]),N=o.useCallback((T,A=!1)=>{V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{V.current=null,p(T,A)},gm)},[p]);o.useEffect(()=>()=>{V.current&&clearTimeout(V.current)},[]);const O=o.useCallback(()=>{r(!1);const T=M.current;M.current=null,T?.isConnected&&T.focus()},[r]);o.useEffect(()=>{const T=s.current;if(!e||!T)return;const A=Gl(T);p(C.current,!0);const B=new MutationObserver(()=>{C.current.trim()&&(F([]),N(C.current,!0))});return B.observe(T,{childList:!0,subtree:!0,characterData:!0}),()=>{B.disconnect(),A(),V.current&&clearTimeout(V.current),V.current=null}},[s,e,p,N]),o.useEffect(()=>{if(!e)return;const T=s.current?.ownerDocument.activeElement;T instanceof HTMLElement&&!M.current&&(M.current=T),y.current?.focus()},[s,e]),o.useEffect(()=>{e&&t>0&&(y.current?.focus(),y.current?.select())},[e,t]),o.useEffect(()=>{const T=s.current,A=T?.ownerDocument.defaultView;if(!e||!T||!A||!("Highlight"in A)||!("highlights"in A.CSS))return;const B=A.CSS.highlights,X=T.ownerDocument.createElement("style");if(X.textContent=`::highlight(${k}) { background-color: color-mix(in srgb, var(--status-warning) 30%, transparent); color: var(--surface-foreground); }
2
+ import{R as o,j as i,f as ge,r as Pt,a as Iu}from"./vendor-react--VO_rL_p.js";import{bX as jl,bY as Ou,bw as zu,j as bs,aZ as Nl,aX as Bu,bZ as $u,bU as Wu,b_ as _u,be as Hu,u as Fe,bp as Ue,aI as ft,b$ as Uu,bV as gr,t as Ba,c0 as $a,c1 as pi,c2 as Gu,c3 as Ku,c4 as Xu,aO as Rl,c5 as Xt,c6 as qu}from"./katex.min-B7gF3rmE.js";import{u as Le,y as Ss,B as he,Q as q,aE as Yu,aD as Ju,az as Zu,aA as Qu,aC as ed,I as $,cO as qt,iK as td,iL as Ni,iM as br,iN as nd,bN as Pi,bO as sd,iO as rd,eg as id,gr as od,iP as ad,iQ as Wn,eE as $t,n as Yt,g3 as wr,hU as ld,iR as cd,iS as ud,iT as dd,bE as fd,aM as md,aL as hd,aK as pd,hn as gd,hm as wd,aJ as gi,bC as vd,eq as xd,A as K,ak as Wa,iU as bd,aO as yd,eH as Sd,V as _a,cH as wi,T as Cd,g1 as gs,bc as kd,Y as Fd,iV as ws,eS as Ed,iW as vi,g2 as Ha,g4 as Ua,iX as Ga,iY as Ka,aR as jd,iZ as Nd,i_ as Rd,i$ as Pd,ex as Md,j0 as Td,aQ as Dd,j1 as Ld,eG as Xa,j2 as Vd,t as Pl,q as Ml,D as Tl,l as Dl,F as Ll,o as Vl,a2 as Al,a3 as Il,a4 as Ol,a5 as xs,a_ as ur,a$ as xi,b0 as qa,gj as zl,av as dr,ay as fr,ad as Bl,aZ as Ad,aa as Id,ab as Od,ac as zd,j3 as Bd,gf as $l,ge as Wl,b2 as vr,gg as $d,j4 as Wd,bf as _d,j5 as Hd,bg as Ud,j6 as Gd,j7 as Kd,j8 as Xd,gh as qd,be as Yd,bd as Jd}from"./useAppFontEffects-6HvTeJY2.js";import{s as Zd,c as Ya,C as Qd}from"./flexokiTheme-DJhpTHWO.js";import{a as _l,E as Hl,i as Mi,S as yr,R as ef,l as tf}from"./vendor-codemirror-state-Cd8udR5z.js";import{E as pe,k as Sr,f as nf,m as sf,n as rf,g as of,V as Ti,D as Mt,W as af,G as lf}from"./vendor-codemirror-view-Ciie9ey-.js";import{v as cf,z as uf,A as df,B as ff,s as Ul}from"./vendor-codemirror-language-8HZTPOnt.js";import{az as mf,aA as hf,aB as pf,aC as gf,an as wf}from"./runtimeEndpointReset-DUwSilpj.js";import{h as Gl,u as vf}from"./useMarkdownLocalAssets-DM7b941V.js";import{u as xf,c as bf,b as yf,F as Ja}from"./fileContentPoller-B_D2WQHm.js";import{V as Sf,J as Cf,F as kf}from"./JsonTreeView-C7EScp5B.js";import{c as Ff}from"./codeHighlight-CXtTq4co.js";import{getCodeTokenTheme as Ef,getThemeRenderName as jf,ensurePierreThemeRegistered as Za}from"./appThemeRegistry-hfPZ6say.js";import{V as Nf,W as Rf}from"./useNextRenderData-CVFf78p9.js";import{V as Pf}from"./ReviewCards-B219SHVL.js";import{M as Kl,D as Mf,a as mr,b as Tf,m as Df,g as Lf,c as Vf,u as Af}from"./contextFileOpenGuard-BrUXbAMg.js";import{D as If}from"./vendor-react-drawio-C6TkEvnS.js";import{e as Of,h as zf}from"./vendor-codemirror-search-Bk6iB2TM.js";import{a as Bf,b as $f}from"./vendor-codemirror-autocomplete-BGedy2gC.js";import{p as Wf}from"./parseDiffFromFile-BuLpViZg.js";import{jsonLanguage as _f}from"./vendor-codemirror-lang-json-DVAYKmoO.js";import{l as Hf}from"./vendor-codemirror-lint-aq8IpR1c.js";import{s as Uf}from"./vendor-strip-json-comments-5dJlOkP1.js";import{_ as Gf}from"./vendor-vite-runtime-DD1OZmLC.js";import{u as Kf}from"./vendor-tanstack-react-virtual-CqfECoM0.js";import{o as Xf,s as qf}from"./vendor-zod-Csf1sqWl.js";import{u as Yf,n as Jf}from"./useInlineCommentController-BiX7K5jy.js";import{u as Zf}from"./useWholeFileComment-DrynMs0_.js";import{toDiffsLanguage as Qf,DIFFS_HIGHLIGHTER as em}from"./diffsHighlighter-BsxkaI3Q.js";import{c as tm}from"./scheduledTasksApi-jkEn2fUL.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-zustand-C9tWdk0j.js";import"./vendor-opencode-client-CqFY51gT.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./vendor-streamdown-BbSYZ3NF.js";import"./vendor-markdown-BTUqNk6W.js";import"./vendor-mdast-util-from-markdown-CZHjOE75.js";import"./vendor-micromark-util-decode-numeric-character-reference-CNs1qBpV.js";import"./vendor-micromark-util-decode-string-fHsnqYdj.js";import"./vendor-decode-named-character-reference-C3-224fz.js";import"./vendor-micromark-util-normalize-identifier-C9ANKk3v.js";import"./vendor-micromark-AWM-NZXP.js";import"./vendor-micromark-util-combine-extensions-d8XJZrgA.js";import"./vendor-micromark-util-chunked-DrRIdSP-.js";import"./vendor-micromark-factory-space-PzSHLgmq.js";import"./vendor-micromark-util-character-CW3Cu1MS.js";import"./vendor-micromark-core-commonmark-kzTLNXAm.js";import"./vendor-micromark-util-classify-character-tcLuZZwM.js";import"./vendor-micromark-util-resolve-all-PQCKh0dx.js";import"./vendor-micromark-util-subtokenize-BF1Jf29a.js";import"./vendor-micromark-factory-destination-Sj0xfi0V.js";import"./vendor-micromark-factory-label-amyP0HdC.js";import"./vendor-micromark-factory-title-khnLkZK6.js";import"./vendor-micromark-factory-whitespace-eIB00uTl.js";import"./vendor-micromark-util-html-tag-name-DbKNfynz.js";import"./vendor-unist-util-stringify-position-Ch_qCilz.js";import"./vendor-mdast-util-to-string-C_aolqmU.js";import"./vendor-unist-util-visit-DhPeCsfG.js";import"./vendor-unist-util-visit-parents-DlviEg7Z.js";import"./vendor-unist-util-is-BPZGFiMU.js";import"./vendor-hast-util-raw-DvvLJg15.js";import"./vendor-ungap-structured-clone--gfxRhYI.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-parse5-DwmzEj2o.js";import"./vendor-entities-wUUgTZDW.js";import"./vendor-web-namespaces-bsVAaBS1.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-unist-util-position-60F3QETU.js";import"./vendor-hast-util-from-parse5-Ba3T6RJI.js";import"./vendor-devlop-0Dp3JUBc.js";import"./vendor-property-information-Boo8Xpef.js";import"./vendor-hastscript-BrPNioaz.js";import"./vendor-comma-separated-tokens-CRUGqg4f.js";import"./vendor-space-separated-tokens-D7QSIrTI.js";import"./vendor-hast-util-parse-selector-TXfch5wI.js";import"./vendor-vfile-location-LfEFwJ2h.js";import"./vendor-hast-util-to-parse5-BoysVIPW.js";import"./vendor-hast-util-sanitize-2aGO5ay8.js";import"./vendor-micromark-extension-gfm-CsfPlnlB.js";import"./vendor-micromark-extension-gfm-autolink-literal-BYug7onl.js";import"./vendor-micromark-extension-gfm-footnote-OFl1FCH2.js";import"./vendor-micromark-extension-gfm-strikethrough-CyFiuwBf.js";import"./vendor-micromark-extension-gfm-table-dgw4LfUw.js";import"./vendor-micromark-extension-gfm-task-list-item-Dnadzr9U.js";import"./vendor-mdast-util-gfm-CroMDYLM.js";import"./vendor-mdast-util-gfm-autolink-literal-CTruMtvI.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-mdast-util-find-and-replace-DB9iC-bx.js";import"./vendor-escape-string-regexp-BaJN9MlJ.js";import"./vendor-mdast-util-gfm-footnote-C-csI7OF.js";import"./vendor-mdast-util-gfm-strikethrough-BcskTdio.js";import"./vendor-mdast-util-gfm-table-DhPwQIyj.js";import"./vendor-markdown-table-DvhhVmnL.js";import"./vendor-mdast-util-to-markdown-Cl3qaiyc.js";import"./vendor-longest-streak-CtXnX3Xp.js";import"./vendor-mdast-util-phrasing-4oVbNLC3.js";import"./vendor-mdast-util-gfm-task-list-item-DMU5mK_M.js";import"./vendor-mdast-util-to-hast-CWnLaQSO.js";import"./vendor-micromark-util-sanitize-uri-BbwQ7CLk.js";import"./vendor-trim-lines-D8znQY54.js";import"./vendor-micromark-extension-cjk-friendly-BzZDGrF5.js";import"./vendor-micromark-extension-cjk-friendly-util-D5lVNoxW.js";import"./vendor-get-east-asian-width-CPhS2cOv.js";import"./vendor-micromark-util-symbol-JJPacVTp.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-BZ3pe_qd.js";import"./vendor-micromark-extension-cjk-friendly-gfm-strikethrough-CqW-Ep4M.js";import"./vendor-mdast-util-to-markdown-cjk-friendly-gfm-strikethrough-BdPDQFO7.js";import"./vendor-hast-util-from-html-isomorphic-B0Kn01s9.js";import"./vendor-hast-util-from-dom-DeNf9aYW.js";import"./vendor-katex-DBqql0K7.js";import"./vendor-hast-util-to-text-0GXLnBvt.js";import"./vendor-hast-util-is-element-CuOmiqQi.js";import"./vendor-unist-util-find-after-CMaZmLxc.js";import"./vendor-micromark-extension-math-BRFoDziv.js";import"./vendor-mdast-util-math-wB-IJCL0.js";import"./vendor-remend-r8cP_t-e.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-tailwind-merge-BKkUfl9q.js";import"./vendor-marked-DN3zOnEe.js";import"./vendor-hast-util-to-jsx-runtime-Bq6JeJCx.js";import"./vendor-style-to-js-CI2G4dgu.js";import"./vendor-style-to-object-BAv4SQXc.js";import"./vendor-inline-style-parser-BlqBsVO4.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-estree-util-is-identifier-name-BgBfM8ME.js";import"./vendor-vfile-message-DqhD22jI.js";import"./vendor-unified-1CQKw2_w.js";import"./vendor-bail-FqpXQuLt.js";import"./vendor-extend-B94qxKr5.js";import"./vendor-is-plain-obj-C1gvLhAf.js";import"./vendor-trough-B_b8ryxu.js";import"./vendor-vfile-BCWrK60u.js";import"./vendor-html-url-attributes-D46m5wfe.js";import"./vendor-capacitor-core-B4EWRrHz.js";import"./vendor-base-ui-zhBy6TEG.js";import"./vendor-floating-ui-utils-BzXdqYpP.js";import"./vendor-floating-ui-dom-WyXykhNi.js";import"./vendor-floating-ui-core-CXmKXOXc.js";import"./vendor-floating-ui-react-dom-Cy8dRGoy.js";import"./vendor-use-sync-external-store-CfLJGVyr.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-dnd-kit-core-Br1Cs7RV.js";import"./vendor-dnd-kit-utilities-DZ9KbT5S.js";import"./vendor-dnd-kit-accessibility-CYclfhtC.js";import"./vendor-dnd-kit-sortable-DpfLEOLv.js";import"./vendor-tanstack-virtual-core-BdFnkr_2.js";import"./vendor-framer-motion-C_wK4GIM.js";import"./vendor-motion-dom-HXPOMxb7.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-codemirror-commands-CjjsURR-.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-lezer-highlight-CZEcqU6G.js";import"./vendor-codemirror-lang-javascript-DmqaSK_j.js";import"./vendor-lezer-javascript-CWSwshuO.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-codemirror-streamparser-CmlTsbN2.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-codemirror-lang-css-BLpgXfL2.js";import"./vendor-lezer-css-B2Hx_Nps.js";import"./vendor-codemirror-lang-html-S3jxr3Mo.js";import"./vendor-lezer-html-Cr8K5DGw.js";import"./vendor-codemirror-lang-markdown-D1jveRI5.js";import"./vendor-lezer-markdown-TQKzBB8i.js";import"./vendor-codemirror-language-data-BJfFTbvV.js";import"./vendor-codemirror-lang-python-B-5UC9Ui.js";import"./vendor-lezer-python-BUoImtUb.js";import"./vendor-sonner-Dw26OnzC.js";import"./vendor-cmdk-BtSpU-Io.js";import"./vendor-radix-ui-react-dialog-OIW6VLWw.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-D4RvEbuR.js";import"./vendor-radix-ui-react-context-BbFoxCHu.js";import"./vendor-radix-ui-react-id-aGag8i_5.js";import"./vendor-radix-ui-react-use-layout-effect-B1oLzD-j.js";import"./vendor-radix-ui-react-use-controllable-state-BjnNPGHq.js";import"./vendor-radix-ui-react-dismissable-layer-DpT6mMbO.js";import"./vendor-radix-ui-react-primitive-CrN9dRDb.js";import"./vendor-radix-ui-react-slot-BjbalUfz.js";import"./vendor-radix-ui-react-use-callback-ref-CcC_buIU.js";import"./vendor-radix-ui-react-use-escape-keydown-Cp1WWKTC.js";import"./vendor-radix-ui-react-focus-scope-D1noLHmd.js";import"./vendor-radix-ui-react-portal-BlUEzfrF.js";import"./vendor-radix-ui-react-presence-BGqFfiW4.js";import"./vendor-radix-ui-react-focus-guards-CSS2IbZC.js";import"./vendor-react-remove-scroll-Der_cv-1.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-Clwl9llp.js";import"./vendor-react-style-singleton-D_xJlTqU.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-BdLl6ZIw.js";import"./vendor-use-callback-ref-CXJF1lEr.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-legendapp-list-wfKYGEOv.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-replit-codemirror-vim-BpSlt2iY.js";import"./vendor-replit-codemirror-vim-core-FHzKdNUS.js";import"./space-apply-De-hlG-f.js";import"./computeVirtualFileMetrics-vVCRMHlo.js";import"./themeResolver-DXizngAV.js";import"./vendor-pierre-theming-D_TRfu0q.js";import"./hastToHtml-BHV14OWE.js";import"./vendor-hast-util-to-html-Jw3IXh58.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./getFiletypeFromFileName-BgI9McTw.js";import"./isFilePlainText-Z9Wi1AQY.js";import"./textMateThemeFromAppTheme-B38k_gpV.js";import"./vendor-lezer-json-Cn1mncjr.js";import"./vendor-diff-C3JhlQdm.js";const nm=(s,e)=>{if(!e)return null;const r=Number.parseInt(s.trim(),10);return!Number.isFinite(r)||r<1?null:Math.min(r,e.state.doc.lines)},Qa=(s,e)=>{const r=s.state.doc.lineAt(e.main.head);return{lineNumber:r.number,character:e.main.head-r.from+1,selection:e}},el=(s,e,r)=>{const t=s.state.doc.line(e),a=Math.max(1,Math.min(r,t.length+1)),l=t.from+a-1;s.dispatch({selection:_l.cursor(l),effects:pe.scrollIntoView(l,{y:"center"})})};function sm({open:s,onOpenChange:e,viewRef:r,variant:t="overlay"}){const{t:a}=Le(),l=r.current,[d,f]=o.useState(""),h=o.useRef(null),v=o.useRef(!1),g=o.useRef(null),w=o.useRef(null),y=o.useMemo(()=>nm(d,l),[d,l]);o.useEffect(()=>{!s||!l||(v.current=!1,h.current=Qa(l,l.state.selection),f(""))},[s,l]),o.useEffect(()=>{s&&window.requestAnimationFrame(()=>{w.current?.focus(),w.current?.select()})},[s]),o.useEffect(()=>{if(!(!s||!l||!h.current)){if(y===null){const{selection:C}=h.current;l.dispatch({selection:C,effects:pe.scrollIntoView(C.main.from,{y:"center"})});return}el(l,y,h.current.character)}},[y,s,l]);const S=o.useCallback(()=>{if(!l||v.current||!h.current)return;const{selection:C}=h.current;l.dispatch({selection:C,effects:pe.scrollIntoView(C.main.from,{y:"center"})})},[l]),F=o.useRef(s);o.useEffect(()=>{F.current&&!s&&S(),F.current=s},[s,S]);const R=o.useCallback(C=>{C||S(),e(C)},[e,S]),k=o.useCallback(()=>{!l||y===null||!h.current||(v.current=!0,el(l,y,h.current.character),e(!1),l.focus())},[y,e,l]);o.useEffect(()=>{if(!s)return;const C=M=>{const p=g.current,N=M.target;!p||!(N instanceof Element)||p.contains(N)||N.closest("[data-go-to-line-toggle]")||R(!1)},V=M=>{M.key==="Escape"&&(M.preventDefault(),R(!1))};return document.addEventListener("pointerdown",C,!0),document.addEventListener("keydown",V,!0),()=>{document.removeEventListener("pointerdown",C,!0),document.removeEventListener("keydown",V,!0)}},[R,s,t]);const E=o.useMemo(()=>{if(!l)return a("goToLineDialog.helper.editorUnavailable");if(y===null){const C=h.current??Qa(l,l.state.selection);return a("goToLineDialog.helper.currentLineRange",{current:C.lineNumber,max:l.state.doc.lines})}return a("goToLineDialog.helper.goToLine",{line:y})},[y,a,l]);return t==="inline"?s?i.jsxs("div",{ref:g,"data-editor-overlay":!0,className:"ms-1 flex h-6 items-center gap-1",children:[i.jsx(Ss,{ref:w,type:"number",min:1,step:1,inputMode:"numeric",value:d,onChange:C=>f(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),k())},placeholder:a("goToLineDialog.field.linePlaceholderShort"),className:"h-6 w-20 rounded-md border-edge bg-transparent px-2 typography-meta"}),i.jsx(he,{variant:"outline",size:"xs",onClick:k,disabled:!l||y===null,className:"h-6 px-2",children:a("goToLineDialog.actions.go")})]}):null:i.jsx("div",{ref:g,"data-editor-overlay":!0,className:q("absolute inset-s-3 top-3 z-40 w-[min(32rem,calc(100%-1.5rem))] rounded-xl border border-[var(--interactive-border)] bg-[color:color-mix(in_srgb,var(--surface-elevated)_94%,transparent)] p-2.5 shadow-lg backdrop-blur-sm transition-all",s?"pointer-events-auto translate-y-0 opacity-100":"pointer-events-none -translate-y-1 opacity-0"),children:i.jsxs("div",{className:"min-w-0",children:[i.jsx(Ss,{ref:w,type:"number",min:1,step:1,inputMode:"numeric",value:d,onChange:C=>f(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),k())},placeholder:a("goToLineDialog.field.linePlaceholder"),className:"h-8 w-full rounded-md border-edge bg-surface-elevated/60 typography-ui-label"}),i.jsx("div",{className:"mt-2 rounded-md bg-primary/15 px-3 py-1.5 typography-ui-label text-foreground/95",children:E})]})})}function tl(s){const e=ge.c(22),{path:r,className:t,title:a,trailing:l}=s,d=a===void 0?r:a,f=o.useRef(null),h=o.useRef(null),[v,g]=o.useState(!0);let w;e[0]!==r?(w=r.split(/[\\/]/).filter(Boolean).pop()??r,e[0]=r,e[1]=w):w=e[1];const y=w;let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{const N=f.current,O=h.current;if(!N||!O)return;const I=()=>g(O.offsetWidth<=N.clientWidth);I();const L=new ResizeObserver(I);return L.observe(N),()=>L.disconnect()},e[2]=S):S=e[2];let F;e[3]!==r?(F=[r],e[3]=r,e[4]=F):F=e[4],o.useLayoutEffect(S,F);let R;e[5]!==t?(R=q("relative min-w-0 flex-1 overflow-hidden",t),e[5]=t,e[6]=R):R=e[6];const k=d??void 0,E=l?"pe-[18px]":void 0;let C;e[7]!==E?(C=q("invisible absolute whitespace-nowrap",E),e[7]=E,e[8]=C):C=e[8];let V;e[9]!==r||e[10]!==C?(V=i.jsx("span",{ref:h,"aria-hidden":!0,className:C,children:r}),e[9]=r,e[10]=C,e[11]=V):V=e[11];let M;e[12]!==v||e[13]!==y||e[14]!==r||e[15]!==l?(M=l?i.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"min-w-0 truncate",children:v?r:y}),l]}):i.jsx("span",{className:"block truncate",children:v?r:y}),e[12]=v,e[13]=y,e[14]=r,e[15]=l,e[16]=M):M=e[16];let p;return e[17]!==M||e[18]!==R||e[19]!==k||e[20]!==V?(p=i.jsxs("span",{ref:f,className:R,title:k,dir:"ltr",children:[V,M]}),e[17]=M,e[18]=R,e[19]=k,e[20]=V,e[21]=p):p=e[21],p}const rm=new Map(Object.entries({FunctionDeclaration:"function",FunctionDefinition:"function",FunctionItem:"function",FunctionDecl:"function",MethodDeclaration:"method",MethodDecl:"method",ClassDeclaration:"class",ClassDefinition:"class",InterfaceDeclaration:"class",StructItem:"class",TraitItem:"class",ImplItem:"class",TypeAliasDeclaration:"type",EnumDeclaration:"type",EnumItem:"type",TypeSpec:"type",ModItem:"module"})),im=new Map([["VariableDeclaration","function"],["PropertyDeclaration","method"]]),om=new Set(["ArrowFunction","FunctionExpression"]),am=new Set(["VariableDefinition","PropertyDefinition","TypeDefinition","VariableName","DefName","FieldName","BoundIdentifier","TypeIdentifier"]),Xl=/^(?:ATXHeading|SetextHeading)([1-6])$/,ql=(s,e)=>{for(let r=s.firstChild;r;r=r.nextSibling)if(e.has(r.name))return r;return null},Yl=s=>{if(Xl.test(s.name))return"heading";const e=rm.get(s.name);if(e)return e;const r=im.get(s.name);return r&&ql(s,om)?r:null},lm=(s,e)=>s.doc.lineAt(e.from).text.replace(/^\s{0,3}#{1,6}\s*/,"").replace(/\s+#+\s*$/,"").trim(),cm=(s,e=200)=>{const r=cf(s,s.doc.length,e);if(!r)return[];const t=[],a=[];return r.iterate({enter:l=>{const d=Yl(l.node);if(!d)return;let f,h;if(d==="heading")f=lm(s,l.node),h=l.from;else{const g=ql(l.node,am);if(!g)return;f=s.sliceDoc(g.from,g.to),h=g.from}if(!f)return;for(;a.length>0&&a[a.length-1]<=l.from;)a.pop();const v=d==="heading"?Number(Xl.exec(l.name)?.[1]??1)-1:a.length;t.push({name:f,kind:d,line:s.doc.lineAt(h).number,from:h,depth:v}),d!=="heading"&&a.push(l.to)}}),t},um={function:"braces",method:"braces",class:"box-3",type:"code-box",module:"folder-3",heading:"text"},dm="data-document-symbols-toggle";function nl({open:s,onOpenChange:e,viewRef:r}){const{t}=Le(),a=r.current,l=o.useRef(null),[d,f]=o.useState([]),[h,v]=o.useState("");o.useEffect(()=>{s&&(v(""),f(a?cm(a.state):[]))},[s,a]);const g=o.useCallback(()=>{e(!1),a?.focus()},[e,a]);o.useEffect(()=>{if(!s)return;const y=S=>{const F=S.target;!(F instanceof Element)||!l.current||l.current.contains(F)||F.closest(`[${dm}]`)||e(!1)};return document.addEventListener("pointerdown",y,!0),()=>document.removeEventListener("pointerdown",y,!0)},[e,s]);const w=o.useCallback(y=>{a&&a.dispatch({selection:_l.cursor(y.from),effects:pe.scrollIntoView(y.from,{y:"center"})}),g()},[g,a]);return s?i.jsx("div",{ref:l,"data-editor-overlay":!0,className:"absolute inset-s-3 top-3 z-40 w-[min(28rem,calc(100%-1.5rem))] overflow-hidden rounded-xl border border-[var(--interactive-border)] bg-[var(--surface-elevated)] shadow-lg",onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),g())},children:i.jsxs(Yu,{loop:!0,filter:(y,S)=>y.split("\0")[0].toLowerCase().includes(S.trim().toLowerCase())?1:0,className:"[&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-1 [&_[cmdk-item]]:typography-meta",children:[i.jsx(Ju,{autoFocus:!0,value:h,onValueChange:v,placeholder:t("filesView.symbols.placeholder"),"aria-label":t("filesView.symbols.placeholder")}),i.jsxs(Zu,{className:"max-h-[min(20rem,calc(100vh-16rem))]",children:[i.jsx(Qu,{className:"px-3 py-4 typography-meta text-muted-foreground",children:d.length===0?t("filesView.symbols.noneInFile"):t("filesView.symbols.noMatches")}),d.map(y=>i.jsxs(ed,{value:`${y.name}\0${y.from}`,onSelect:()=>w(y),className:"gap-2",children:[i.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",style:{paddingInlineStart:`${y.depth*12}px`},children:[i.jsx($,{name:um[y.kind],className:"size-3.5 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"min-w-0 truncate text-foreground",children:y.name})]}),i.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:y.line})]},`${y.from}:${y.name}`))]})]})}):null}const fm=s=>{const e=ge.c(10),{className:r,iconClassName:t}=s,{t:a}=Le(),l=jl();let d;e[0]!==a?(d=a("filesView.tree.actions.showGitignored"),e[0]=a,e[1]=d):d=e[1];let f;e[2]!==l?(f=()=>Ou(!l),e[2]=l,e[3]=f):f=e[3];let h;return e[4]!==r||e[5]!==t||e[6]!==l||e[7]!==d||e[8]!==f?(h=i.jsx(qt,{label:d,icon:"file-forbid",pressed:l,className:r,iconClassName:t,onClick:f}),e[4]=r,e[5]=t,e[6]=l,e[7]=d,e[8]=f,e[9]=h):h=e[9],h},mm=(s,e)=>{const r=e.trim().toLowerCase(),t=[];if(!r)return t;const a=s.toLowerCase(),l=[],d=[];if(a.length!==s.length){let v=0;for(const g of s){const w=v+g.length;for(let y=0;y<g.toLowerCase().length;y++)l.push(v),d.push(w);v=w}}let f=0,h=0;for(;;){const v=a.indexOf(r,f);if(v===-1)break;const g=l.length>0?l[v]:v,w=d.length>0?d[v+r.length-1]:v+r.length;g>=h&&(t.push({start:g,end:w}),h=w),f=v+r.length}return t},hm=(s,e)=>{if(!e.trim())return[];const r=s.ownerDocument,t=r.createTreeWalker(s,4),a=[];for(let l=t.nextNode();l;l=t.nextNode())if(!(!l.parentElement||l.parentElement.closest("svg, script, style")))for(const d of mm(l.nodeValue??"",e)){const f=r.createRange();f.setStart(l,d.start),f.setEnd(l,d.end),a.push(f)}return a},pm=(s,e)=>{const r=s.ownerDocument.defaultView;if(!(!r||!s.contains(e.startContainer)))for(let t=e.startContainer.parentElement;t;t=t.parentElement){const a=r.getComputedStyle(t),l=/(auto|scroll|hidden)/.test(a.overflowX),d=/(auto|scroll|hidden)/.test(a.overflowY);if(l||d){const f=e.getBoundingClientRect(),h=t.getBoundingClientRect(),v=h.top+t.clientTop,g=h.left+t.clientLeft,w=v+t.clientHeight,y=g+t.clientWidth,S=f.top<v?f.top-v:Math.max(0,f.bottom-w),F=f.left<g?f.left-g:Math.max(0,f.right-y);(l&&F||d&&S)&&t.scrollBy({left:l?F:0,top:d?S:0})}if(t===s)break}},gm=120,sl=({containerRef:s,open:e,onOpenChange:r,focusNonce:t,className:a})=>{const{t:l}=Le(),[d,f]=o.useState(""),[h,v]=o.useState(0),[g,w]=o.useState(0),y=o.useRef(null),[S,F]=o.useState([]),k=`oc-preview-search-${o.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,E=`${k}-current`,C=o.useRef(d);C.current=d;const V=o.useRef(null),M=o.useRef(null),p=o.useCallback((T,A=!1)=>{const B=s.current;if(!B){F([]),v(0),w(0);return}const X=hm(B,T);F(X);const ie=X.length;v(ie),w(ue=>!A||ie===0?0:Math.min(ue,ie-1))},[s]),N=o.useCallback((T,A=!1)=>{V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{V.current=null,p(T,A)},gm)},[p]);o.useEffect(()=>()=>{V.current&&clearTimeout(V.current)},[]);const O=o.useCallback(()=>{r(!1);const T=M.current;M.current=null,T?.isConnected&&T.focus()},[r]);o.useEffect(()=>{const T=s.current;if(!e||!T)return;const A=Gl(T);p(C.current,!0);const B=new MutationObserver(()=>{C.current.trim()&&(F([]),N(C.current,!0))});return B.observe(T,{childList:!0,subtree:!0,characterData:!0}),()=>{B.disconnect(),A(),V.current&&clearTimeout(V.current),V.current=null}},[s,e,p,N]),o.useEffect(()=>{if(!e)return;const T=s.current?.ownerDocument.activeElement;T instanceof HTMLElement&&!M.current&&(M.current=T),y.current?.focus()},[s,e]),o.useEffect(()=>{e&&t>0&&(y.current?.focus(),y.current?.select())},[e,t]),o.useEffect(()=>{const T=s.current,A=T?.ownerDocument.defaultView;if(!e||!T||!A||!("Highlight"in A)||!("highlights"in A.CSS))return;const B=A.CSS.highlights,X=T.ownerDocument.createElement("style");if(X.textContent=`::highlight(${k}) { background-color: color-mix(in srgb, var(--status-warning) 30%, transparent); color: var(--surface-foreground); }
3
3
  ::highlight(${E}) { background-color: color-mix(in srgb, var(--status-warning) 60%, transparent); color: var(--surface-foreground); }`,T.ownerDocument.head.append(X),S.length>0){const ie=new A.Highlight;for(const oe of S)ie.add(oe);B.set(k,ie);const ue=new A.Highlight(S[Math.min(g,S.length-1)]);ue.priority=1,B.set(E,ue)}return()=>{B.delete(k),B.delete(E),X.remove()}},[s,E,k,g,e,S]),o.useEffect(()=>{const T=s.current,A=S[g];e&&T&&A&&pm(T,A)},[s,g,e,S]);const I=o.useCallback(()=>{w(T=>h===0?0:(T+1)%h)},[h]),L=o.useCallback(()=>{w(T=>h===0?0:(T-1+h)%h)},[h]),D=o.useCallback(T=>{T.key==="Enter"?(T.preventDefault(),T.shiftKey?L():I()):T.key==="Escape"&&(T.preventDefault(),O())},[O,I,L]);return e?i.jsxs("div",{className:q("absolute inset-e-3 top-3 z-10 flex items-center gap-1 rounded-lg border border-edge bg-[var(--surface-elevated)] px-1.5 py-1 shadow-lg",a),children:[i.jsx($,{name:"search",className:"ms-0.5 size-3.5 text-muted-foreground"}),i.jsx(Ss,{ref:y,value:d,onChange:T=>{f(T.target.value),N(T.target.value)},onKeyDown:D,placeholder:l("filesView.preview.find.placeholder"),"aria-label":l("filesView.preview.find.placeholder"),className:"h-7 w-40 rounded-md px-2 py-0 text-sm md:w-56"}),i.jsx("span",{className:"min-w-12 px-1 text-center typography-micro text-muted-foreground tabular-nums","aria-live":"polite","aria-label":h>0?l("filesView.preview.find.countAria",{current:g+1,total:h}):l("filesView.preview.find.noMatches"),children:d.trim()&&h===0?l("filesView.preview.find.noMatches"):h>0?`${g+1}/${h}`:""}),i.jsx(he,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:L,title:l("filesView.preview.find.previousAria"),"aria-label":l("filesView.preview.find.previousAria"),disabled:h===0,children:i.jsx($,{name:"arrow-up",className:"size-3.5"})}),i.jsx(he,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:I,title:l("filesView.preview.find.nextAria"),"aria-label":l("filesView.preview.find.nextAria"),disabled:h===0,children:i.jsx($,{name:"arrow-down",className:"size-3.5"})}),i.jsx(he,{type:"button",variant:"ghost",size:"sm",className:"size-6 p-0 text-muted-foreground",onClick:O,title:l("filesView.preview.find.closeAria"),"aria-label":l("filesView.preview.find.closeAria"),children:i.jsx($,{name:"close",className:"size-3.5"})})]}):null},wm=1,rl=({stat:s,showsFailure:e,sawMissing:r,hasUnsavedChanges:t,moving:a})=>s==="missing"?t||a?"none":"show-missing":s==="failed"?"none":e?r?"reload":"none":"check-changes",vm=(s,e)=>e.size!==s.size||e.mtimeMs!==void 0&&s.mtimeMs!==void 0&&Math.abs(e.mtimeMs-s.mtimeMs)>=wm,xm=({selectedPath:s,targetPath:e,targetShown:r,targetSettled:t,showsText:a,canEdit:l,textViewMode:d})=>s!==e?r?"wait":"select-target":t?a?d==="edit"?"jump":l?"show-editor":"end":"end":"wait";function il(){const s=ge.c(8),[e]=Pt.useState(bm),r=Pt.useRef(!1);let t;s[0]!==e?(t=h=>{if(h==null){e.cleanUp(),r.current=!1;return}r.current||(r.current=!0,e.setup(h,h.firstElementChild??void 0))},s[0]=e,s[1]=t):t=s[1];const a=t;let l,d;s[2]!==e?(l=()=>()=>{r.current=!1,e.cleanUp()},d=[e],s[2]=e,s[3]=l,s[4]=d):(l=s[3],d=s[4]),Pt.useLayoutEffect(l,d);let f;return s[5]!==a||s[6]!==e?(f={virtualizer:e,setScroller:a},s[5]=a,s[6]=e,s[7]=f):f=s[7],f}function bm(){return new Pf}const Jl=s=>s.querySelector("[data-oc-streamdown]")?.children??null,ym=(s,e)=>{const r=Jl(s);if(!r?.length)return;let t=0,a=r.length-1;for(;t<a;){const l=t+a>>1;r[l].getBoundingClientRect().bottom>e?a=l:t=l+1}return{index:t,offset:r[t].getBoundingClientRect().top-e}},zn=new Map,Sm=100;function hr(s){const[e,r]=Pt.useState(null),t=Pt.useRef(null),a=Pt.useRef(null),l=Pt.useRef(null),d=Pt.useCallback((f,h)=>{f&&h instanceof Sf&&(l.current={key:s,file:h,node:f});const v=t.current,g=a.current,w=()=>{t.current===v&&(v?.(),g?.())};h?queueMicrotask(w):w()},[s]);return Pt.useLayoutEffect(()=>{if(!e||!s)return;const f=zn.get(s)??{top:0,left:0};let h=!0;const v=()=>l.current?.key===s?l.current.file:null,g=N=>l.current?.key===s?l.current.node.shadowRoot?.querySelector(`[data-line][data-line-index="${N-1}"]`):null;let w=null,y=0,S=null,F=null;const R=N=>{N!==S&&(F?.(),S=N,F=N?Gl(N,{block:N}):null)},k=()=>{C.disconnect(),V.disconnect(),w!==null&&cancelAnimationFrame(w),w=null,R(null)},E=(N=!1)=>{if(!h)return;const O=v(),I=f.line&&O?.getLinePosition(f.line.number),L=f.line&&g(f.line.number);let D=f.top;f.line&&I&&(D=(O?.top??0)+I.top-f.line.offset),f.line&&L&&(D=e.scrollTop+L.getBoundingClientRect().top-e.getBoundingClientRect().top-f.line.offset);const T=f.block?Jl(e)?.[f.block.index]??null:null;R(T),f.block&&T&&(D=e.scrollTop+T.getBoundingClientRect().top-e.getBoundingClientRect().top-f.block.offset);const A=Math.abs(e.scrollTop-D)>=1;if(e.scrollTop=D,e.scrollLeft=f.left,(!f.line||L)&&(!f.block||T)&&Math.abs(e.scrollTop-D)<1&&Math.abs(e.scrollLeft-f.left)<1){if(N&&(y=A?0:y+1),T&&y<2){w??=requestAnimationFrame(()=>{w=null,E(!0)});return}h=!1,k()}},C=new ResizeObserver(()=>E()),V=new MutationObserver(()=>{if(h){for(const N of e.children)C.observe(N);E()}});C.observe(e);for(const N of e.children)C.observe(N);V.observe(e,{childList:!0,subtree:!0});const M=()=>{if(h)return;const N=v(),O=N?.getNumericScrollAnchor(e.scrollTop-(N.top??0)),I=O&&g(O.lineNumber),L=e.getBoundingClientRect().top,D=I?I.getBoundingClientRect().top-L:null;if(zn.delete(s),zn.set(s,{top:e.scrollTop,left:e.scrollLeft,line:O&&D!==null&&D>=0&&D<e.clientHeight?{number:O.lineNumber,offset:D}:void 0,block:N?void 0:ym(e,L)}),zn.size>Sm){const T=zn.keys().next().value;T!==void 0&&zn.delete(T)}},p=()=>{h=!1,k()};return t.current=E,a.current=M,E(),e.addEventListener("scroll",M,{passive:!0}),e.addEventListener("wheel",p,{passive:!0}),e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("pointerdown",p,{passive:!0}),e.addEventListener("keydown",p),()=>{t.current=null,a.current=null,l.current?.key===s&&(l.current=null),k(),e.removeEventListener("scroll",M),e.removeEventListener("wheel",p),e.removeEventListener("touchstart",p),e.removeEventListener("pointerdown",p),e.removeEventListener("keydown",p)}},[s,e]),{setScroller:r,restore:d}}function Cm(s){return!(!s.autoSaveEnabled||!s.isDirty||!s.canWrite||s.isSaving||s.fileLoading||s.isNonEditableBinary||s.wouldEmptyFile||!s.selectedFilePath||s.loadedFilePath!==s.selectedFilePath)}function km(s){return s.selectedFilePath?s.isDirty?!(s.fileLoading||s.loadedFilePath!==s.selectedFilePath||s.isNonEditableBinary||s.draftContent===""&&s.fileContent!==""&&s.loadedFilePath!==s.selectedFilePath):!0:!1}const Zl=2e5,Fm=s=>{let e=0,r=0;for(let t=0;t<s.length;t++)s.charCodeAt(t)===10&&(t>0&&s.charCodeAt(t-1)===13?e++:r++);return e>r?`\r
4
4
  `:`
5
5
  `},Ql=s=>s.replace(/\r\n/g,`