monaco-editor-core 0.57.0 → 0.58.0-dev-20261104

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 (508) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +38 -6
  18. package/esm/vs/base/browser/browser.js +8 -0
  19. package/esm/vs/base/browser/browser.js.map +1 -1
  20. package/esm/vs/base/browser/contextmenu.js +8 -1
  21. package/esm/vs/base/browser/contextmenu.js.map +1 -1
  22. package/esm/vs/base/browser/dom.js +34 -5
  23. package/esm/vs/base/browser/dom.js.map +1 -1
  24. package/esm/vs/base/browser/dompurify/dompurify.js +2457 -2640
  25. package/esm/vs/base/browser/markdownRenderer.js +48 -21
  26. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  27. package/esm/vs/base/browser/pixelRatio.js +3 -2
  28. package/esm/vs/base/browser/pixelRatio.js.map +1 -1
  29. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +5 -2
  30. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
  31. package/esm/vs/base/browser/ui/actionbar/actionbar.js +7 -2
  32. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  33. package/esm/vs/base/browser/ui/animations/animations.js +68 -40
  34. package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
  35. package/esm/vs/base/browser/ui/button/button.js +7 -0
  36. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  37. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  38. package/esm/vs/base/browser/ui/contextview/contextview.css +15 -0
  39. package/esm/vs/base/browser/ui/contextview/contextview.js +266 -40
  40. package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
  41. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js +72 -0
  42. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js.map +1 -0
  43. package/esm/vs/base/browser/ui/dialog/dialog.css +5 -0
  44. package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
  45. package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
  46. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -0
  47. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
  48. package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
  49. package/esm/vs/base/browser/ui/list/listView.js +87 -15
  50. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  51. package/esm/vs/base/browser/ui/list/listWidget.js +37 -15
  52. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  53. package/esm/vs/base/browser/ui/menu/menu.js +189 -52
  54. package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
  55. package/esm/vs/base/browser/ui/radio/radio.css +11 -0
  56. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +2 -1
  57. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  58. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  59. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +14 -8
  60. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  61. package/esm/vs/base/browser/ui/splitview/splitview.js +11 -7
  62. package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
  63. package/esm/vs/base/browser/ui/toggle/switch.css +16 -7
  64. package/esm/vs/base/browser/ui/toggle/switch.js +9 -6
  65. package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -1
  66. package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -2
  67. package/esm/vs/base/browser/ui/toolbar/toolbar.js +85 -38
  68. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  69. package/esm/vs/base/browser/ui/tree/abstractTree.js +48 -9
  70. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  71. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +10 -1
  72. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  73. package/esm/vs/base/browser/ui/tree/objectTree.js +3 -0
  74. package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
  75. package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
  76. package/esm/vs/base/common/actions.js +8 -2
  77. package/esm/vs/base/common/actions.js.map +1 -1
  78. package/esm/vs/base/common/arrays.js +4 -4
  79. package/esm/vs/base/common/arrays.js.map +1 -1
  80. package/esm/vs/base/common/async.js +12 -8
  81. package/esm/vs/base/common/async.js.map +1 -1
  82. package/esm/vs/base/common/cancellation.js +25 -0
  83. package/esm/vs/base/common/cancellation.js.map +1 -1
  84. package/esm/vs/base/common/codicons.js +2 -0
  85. package/esm/vs/base/common/codicons.js.map +1 -1
  86. package/esm/vs/base/common/codiconsLibrary.js +2 -0
  87. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  88. package/esm/vs/base/common/color.js +1 -1
  89. package/esm/vs/base/common/color.js.map +1 -1
  90. package/esm/vs/base/common/diff/diff.js +60 -1
  91. package/esm/vs/base/common/diff/diff.js.map +1 -1
  92. package/esm/vs/base/common/event.js +1 -1
  93. package/esm/vs/base/common/event.js.map +1 -1
  94. package/esm/vs/base/common/glob.js +1 -0
  95. package/esm/vs/base/common/glob.js.map +1 -1
  96. package/esm/vs/base/common/htmlContent.js +74 -12
  97. package/esm/vs/base/common/htmlContent.js.map +1 -1
  98. package/esm/vs/base/common/json.js +19 -0
  99. package/esm/vs/base/common/json.js.map +1 -0
  100. package/esm/vs/base/common/network.js +16 -0
  101. package/esm/vs/base/common/network.js.map +1 -1
  102. package/esm/vs/base/common/resources.js +14 -2
  103. package/esm/vs/base/common/resources.js.map +1 -1
  104. package/esm/vs/base/common/strings.js +1 -1
  105. package/esm/vs/base/common/strings.js.map +1 -1
  106. package/esm/vs/base/common/uri.js +2 -2
  107. package/esm/vs/base/common/uri.js.map +1 -1
  108. package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
  109. package/esm/vs/editor/browser/config/fontMeasurements.js +19 -6
  110. package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
  111. package/esm/vs/editor/browser/controller/dragScrolling.js +3 -3
  112. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +11 -5
  113. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  114. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -38
  115. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  116. package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
  117. package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
  118. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +12 -10
  119. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  120. package/esm/vs/editor/browser/controller/mouseHandler.js +7 -7
  121. package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
  122. package/esm/vs/editor/browser/coreCommands.js +2 -2
  123. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  124. package/esm/vs/editor/browser/editorMarkdownSanitizer.js +19 -0
  125. package/esm/vs/editor/browser/editorMarkdownSanitizer.js.map +1 -0
  126. package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
  127. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  128. package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
  129. package/esm/vs/editor/browser/services/editorWorkerService.js +3 -2
  130. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  131. package/esm/vs/editor/browser/services/openerService.js +6 -2
  132. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  133. package/esm/vs/editor/browser/view/domLineBreaksComputer.js +34 -11
  134. package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
  135. package/esm/vs/editor/browser/view/viewController.js +7 -7
  136. package/esm/vs/editor/browser/view/viewController.js.map +1 -1
  137. package/esm/vs/editor/browser/view/viewLayer.js +1 -1
  138. package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
  139. package/esm/vs/editor/browser/view.js +5 -5
  140. package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
  141. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +11 -3
  142. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  143. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
  144. package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +12 -12
  145. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +9 -2
  146. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
  147. package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
  148. package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
  149. package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
  150. package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
  151. package/esm/vs/editor/browser/viewParts/minimap/minimap.js +6 -6
  152. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +9 -2
  153. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
  154. package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +5 -5
  155. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
  156. package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
  157. package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
  158. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
  159. package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
  160. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
  161. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
  162. package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +5 -5
  163. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
  164. package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
  165. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
  166. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +4 -4
  167. package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +2 -2
  168. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +22 -21
  169. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  170. package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  171. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +18 -18
  172. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  173. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
  174. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +10 -10
  175. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
  176. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
  177. package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -4
  178. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +21 -3
  179. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js.map +1 -1
  180. package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
  181. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +10 -10
  182. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
  183. package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -1
  184. package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
  185. package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  186. package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
  187. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +2 -2
  188. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -1
  189. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +21 -2
  190. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -1
  191. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
  192. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +11 -3
  193. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  194. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +1 -0
  195. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -1
  196. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js +64 -0
  197. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js.map +1 -0
  198. package/esm/vs/editor/common/config/editorConfigurationSchema.js +68 -58
  199. package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
  200. package/esm/vs/editor/common/config/editorOptions.js +560 -500
  201. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  202. package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
  203. package/esm/vs/editor/common/core/edits/textEdit.js +16 -0
  204. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  205. package/esm/vs/editor/common/cursor/cursor.js +20 -10
  206. package/esm/vs/editor/common/cursor/cursor.js.map +1 -1
  207. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +67 -14
  208. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
  209. package/esm/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
  210. package/esm/vs/editor/common/cursor/cursorTypeOperations.js.map +1 -1
  211. package/esm/vs/editor/common/cursorCommon.js +22 -21
  212. package/esm/vs/editor/common/cursorCommon.js.map +1 -1
  213. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +21 -8
  214. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js.map +1 -1
  215. package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
  216. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js +38 -26
  217. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js.map +1 -1
  218. package/esm/vs/editor/common/diff/rangeMapping.js +11 -1
  219. package/esm/vs/editor/common/diff/rangeMapping.js.map +1 -1
  220. package/esm/vs/editor/common/diff/verifyLinesDiff.js +28 -0
  221. package/esm/vs/editor/common/diff/verifyLinesDiff.js.map +1 -0
  222. package/esm/vs/editor/common/editorContextKeys.js +53 -53
  223. package/esm/vs/editor/common/languages/languageConfiguration.js +8 -0
  224. package/esm/vs/editor/common/languages/languageConfiguration.js.map +1 -1
  225. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  226. package/esm/vs/editor/common/languages.js +56 -56
  227. package/esm/vs/editor/common/model/editStack.js +1 -1
  228. package/esm/vs/editor/common/services/editorWebWorker.js +27 -6
  229. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  230. package/esm/vs/editor/common/services/editorWorker.js.map +1 -1
  231. package/esm/vs/editor/common/services/languageService.js +6 -4
  232. package/esm/vs/editor/common/services/languageService.js.map +1 -1
  233. package/esm/vs/editor/common/services/markerDecorationsService.js +21 -2
  234. package/esm/vs/editor/common/services/markerDecorationsService.js.map +1 -1
  235. package/esm/vs/editor/common/standalone/standaloneEnums.js +100 -97
  236. package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
  237. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  238. package/esm/vs/editor/common/textModelEditSource.js +9 -0
  239. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  240. package/esm/vs/editor/common/viewLayout/viewLayout.js +16 -16
  241. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  242. package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
  243. package/esm/vs/editor/common/viewModel/viewModelImpl.js +19 -19
  244. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  245. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  246. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -9
  247. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  248. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  249. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +23 -20
  250. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  251. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  252. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  253. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  254. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  255. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  256. package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +1 -1
  257. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  258. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  259. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +25 -10
  260. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  261. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  262. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  263. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +1 -1
  264. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +3 -3
  265. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  266. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +1 -1
  267. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  268. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +17 -17
  269. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
  270. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  271. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  272. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +39 -39
  273. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  274. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  275. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  276. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js +19 -0
  277. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js.map +1 -0
  278. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +26 -18
  279. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
  280. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  281. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js.map +1 -1
  282. package/esm/vs/editor/contrib/find/browser/findController.js +18 -18
  283. package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
  284. package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
  285. package/esm/vs/editor/contrib/find/browser/findWidget.js +40 -40
  286. package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
  287. package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
  288. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  289. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  290. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  291. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  292. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  293. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  294. package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +3 -3
  295. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
  296. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
  297. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js.map +1 -1
  298. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  299. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  300. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  301. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  302. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  303. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +9 -3
  304. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
  305. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +2 -2
  306. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -1
  307. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
  308. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  309. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  310. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  311. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -8
  312. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  313. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
  314. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  315. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  316. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +5 -5
  317. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +9 -9
  318. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +3 -3
  319. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js.map +1 -1
  320. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  321. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  322. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -7
  323. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  324. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -5
  325. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js.map +1 -1
  326. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
  327. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
  328. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +7 -7
  329. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  330. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  331. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
  332. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  333. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  334. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  335. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  336. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +5 -4
  337. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js.map +1 -1
  338. package/esm/vs/editor/contrib/links/browser/links.js +16 -15
  339. package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
  340. package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
  341. package/esm/vs/editor/contrib/message/browser/messageController.js +16 -12
  342. package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
  343. package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
  344. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +91 -55
  345. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js.map +1 -1
  346. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  347. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
  348. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js.map +1 -1
  349. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +6 -4
  350. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  351. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  352. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  353. package/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +1 -1
  354. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
  355. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
  356. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  357. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +3 -3
  358. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  359. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  360. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +6 -6
  361. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +23 -13
  362. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
  363. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +5 -5
  364. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
  365. package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
  366. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  367. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  368. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +10 -8
  369. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  370. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
  371. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
  372. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +6 -6
  373. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  374. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +15 -15
  375. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
  376. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
  377. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +27 -27
  378. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +8 -6
  379. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  380. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
  381. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
  382. package/esm/vs/editor/contrib/suggest/browser/wordDistance.js +1 -1
  383. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  384. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  385. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  386. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  387. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -27
  388. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
  389. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  390. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +1 -1
  391. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js.map +1 -1
  392. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +50 -14
  393. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
  394. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +6 -6
  395. package/esm/vs/editor/editor.api.d.ts +133 -98
  396. package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +1 -1
  397. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +5 -3
  398. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
  399. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +15 -1
  400. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  401. package/esm/vs/nls.js.map +1 -1
  402. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +72 -66
  403. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js.map +1 -1
  404. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  405. package/esm/vs/platform/actionWidget/browser/actionList.js +434 -136
  406. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  407. package/esm/vs/platform/actionWidget/browser/actionWidget.css +74 -4
  408. package/esm/vs/platform/actionWidget/browser/actionWidget.js +24 -26
  409. package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
  410. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js +16 -0
  411. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js.map +1 -0
  412. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -17
  413. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
  414. package/esm/vs/platform/actions/browser/toolbar.js +25 -12
  415. package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
  416. package/esm/vs/platform/actions/common/actions.js +4 -2
  417. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  418. package/esm/vs/platform/actions/common/menuService.js +15 -8
  419. package/esm/vs/platform/actions/common/menuService.js.map +1 -1
  420. package/esm/vs/platform/configuration/common/configuration.js +3 -1
  421. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  422. package/esm/vs/platform/configuration/common/configurationModels.js +16 -11
  423. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  424. package/esm/vs/platform/configuration/common/configurationRegistry.js +29 -27
  425. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  426. package/esm/vs/platform/configuration/common/configurations.js +13 -1
  427. package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
  428. package/esm/vs/platform/contextkey/browser/contextKeyService.js +2 -2
  429. package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
  430. package/esm/vs/platform/contextkey/common/contextkey.js +28 -14
  431. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  432. package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
  433. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  434. package/esm/vs/platform/contextview/browser/contextMenuHandler.js +17 -4
  435. package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
  436. package/esm/vs/platform/contextview/browser/contextMenuService.js +1 -1
  437. package/esm/vs/platform/contextview/browser/contextMenuService.js.map +1 -1
  438. package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
  439. package/esm/vs/platform/contextview/browser/contextViewService.js +7 -2
  440. package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
  441. package/esm/vs/platform/editor/common/editor.js +17 -0
  442. package/esm/vs/platform/editor/common/editor.js.map +1 -1
  443. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  444. package/esm/vs/platform/hover/browser/hoverService.js +6 -3
  445. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  446. package/esm/vs/platform/hover/browser/hoverWidget.js +38 -6
  447. package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
  448. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +32 -5
  449. package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
  450. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -1
  451. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  452. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  453. package/esm/vs/platform/keybinding/common/keybindingResolver.js +1 -1
  454. package/esm/vs/platform/keybinding/common/keybindingResolver.js.map +1 -1
  455. package/esm/vs/platform/list/browser/listService.js +27 -27
  456. package/esm/vs/platform/markers/common/markerService.js +11 -8
  457. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  458. package/esm/vs/platform/markers/common/markers.js +6 -6
  459. package/esm/vs/platform/markers/common/markers.js.map +1 -1
  460. package/esm/vs/platform/notification/common/notification.js.map +1 -1
  461. package/esm/vs/platform/notification/common/notificationMessage.js +37 -0
  462. package/esm/vs/platform/notification/common/notificationMessage.js.map +1 -0
  463. package/esm/vs/platform/opener/common/opener.js.map +1 -1
  464. package/esm/vs/platform/progress/common/progress.js.map +1 -1
  465. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  466. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  467. package/esm/vs/platform/quickinput/browser/media/quickInput.css +33 -2
  468. package/esm/vs/platform/quickinput/browser/quickAccess.js +7 -4
  469. package/esm/vs/platform/quickinput/browser/quickAccess.js.map +1 -1
  470. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  471. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  472. package/esm/vs/platform/quickinput/browser/quickInputController.js +65 -15
  473. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  474. package/esm/vs/platform/quickinput/browser/quickInputList.js +96 -90
  475. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  476. package/esm/vs/platform/quickinput/browser/quickInputService.js +5 -7
  477. package/esm/vs/platform/quickinput/browser/quickInputService.js.map +1 -1
  478. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  479. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  480. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  481. package/esm/vs/platform/quickinput/common/quickAccess.js.map +1 -1
  482. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  483. package/esm/vs/platform/storage/common/storage.js.map +1 -1
  484. package/esm/vs/platform/theme/common/colorRegistry.js +1 -0
  485. package/esm/vs/platform/theme/common/colorRegistry.js.map +1 -1
  486. package/esm/vs/platform/theme/common/colorUtils.js +11 -3
  487. package/esm/vs/platform/theme/common/colorUtils.js.map +1 -1
  488. package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
  489. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -9
  490. package/esm/vs/platform/theme/common/colors/chartsColors.js.map +1 -1
  491. package/esm/vs/platform/theme/common/colors/confettiColors.js +14 -0
  492. package/esm/vs/platform/theme/common/colors/confettiColors.js.map +1 -0
  493. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  494. package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
  495. package/esm/vs/platform/theme/common/colors/inputColors.js.map +1 -1
  496. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  497. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  498. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  499. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  500. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  501. package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  502. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  503. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  504. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  505. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  506. package/monaco.d.ts +133 -98
  507. package/package.json +3 -3
  508. package/version.txt +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/splitview/splitview.ts","vs/base/browser/ui/splitview/splitview.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,CAAC,EAAE,qBAAqB,EAAE,MAAM,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAA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AAC,SAAS,GAAG,EAAE,CAAC;QAEpB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QAEpB,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD","file":"splitview.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener, append, getWindow, scheduleAtNextAnimationFrame } from '../../dom.js';\nimport { DomEmitter } from '../../event.js';\nimport { ISashEvent as IBaseSashEvent, Orientation, Sash, SashState } from '../sash/sash.js';\nimport { SmoothScrollableElement } from '../scrollbar/scrollableElement.js';\nimport { pushToEnd, pushToStart, range } from '../../../common/arrays.js';\nimport { Color } from '../../../common/color.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { combinedDisposable, Disposable, dispose, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { clamp } from '../../../common/numbers.js';\nimport { Scrollable, ScrollbarVisibility, ScrollEvent } from '../../../common/scrollable.js';\nimport * as types from '../../../common/types.js';\nimport './splitview.css';\nexport { Orientation } from '../sash/sash.js';\n\nexport interface ISplitViewStyles {\n\treadonly separatorBorder: Color;\n}\n\nconst defaultStyles: ISplitViewStyles = {\n\tseparatorBorder: Color.transparent\n};\n\nexport const enum LayoutPriority {\n\tNormal,\n\tLow,\n\tHigh\n}\n\n/**\n * The interface to implement for views within a {@link SplitView}.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n */\nexport interface IView<TLayoutContext = undefined> {\n\n\t/**\n\t * The DOM element for this view.\n\t */\n\treadonly element: HTMLElement;\n\n\t/**\n\t * A minimum size for this view.\n\t *\n\t * @remarks If none, set it to `0`.\n\t */\n\treadonly minimumSize: number;\n\n\t/**\n\t * A maximum size for this view.\n\t *\n\t * @remarks If none, set it to `Number.POSITIVE_INFINITY`.\n\t */\n\treadonly maximumSize: number;\n\n\t/**\n\t * The priority of the view when the {@link SplitView.resize layout} algorithm\n\t * runs. Views with higher priority will be resized first.\n\t *\n\t * @remarks Only used when `proportionalLayout` is false.\n\t */\n\treadonly priority?: LayoutPriority;\n\n\t/**\n\t * If the {@link SplitView} supports {@link ISplitViewOptions.proportionalLayout proportional layout},\n\t * this property allows for finer control over the proportional layout algorithm, per view.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * Whether the view will snap whenever the user reaches its minimum size or\n\t * attempts to grow it beyond the minimum size.\n\t *\n\t * @defaultValue `false`\n\t */\n\treadonly snap?: boolean;\n\n\t/**\n\t * View instances are supposed to fire the {@link IView.onDidChange} event whenever\n\t * any of the constraint properties have changed:\n\t *\n\t * - {@link IView.minimumSize}\n\t * - {@link IView.maximumSize}\n\t * - {@link IView.priority}\n\t * - {@link IView.snap}\n\t *\n\t * The SplitView will relayout whenever that happens. The event can optionally emit\n\t * the view's preferred size for that relayout.\n\t */\n\treadonly onDidChange: Event<number | undefined>;\n\n\t/**\n\t * This will be called by the {@link SplitView} during layout. A view meant to\n\t * pass along the layout information down to its descendants.\n\t *\n\t * @param size The size of this view, in pixels.\n\t * @param offset The offset of this view, relative to the start of the {@link SplitView}.\n\t * @param context The optional {@link IView layout context} passed to {@link SplitView.layout}.\n\t */\n\tlayout(size: number, offset: number, context: TLayoutContext | undefined): void;\n\n\t/**\n\t * This will be called by the {@link SplitView} whenever this view is made\n\t * visible or hidden.\n\t *\n\t * @param visible Whether the view becomes visible.\n\t */\n\tsetVisible?(visible: boolean): void;\n}\n\n/**\n * A descriptor for a {@link SplitView} instance.\n */\nexport interface ISplitViewDescriptor<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * The layout size of the {@link SplitView}.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Descriptors for each {@link IView view}.\n\t */\n\treadonly views: {\n\n\t\t/**\n\t\t * Whether the {@link IView view} is visible.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly visible?: boolean;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly size: number;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly view: TView;\n\t}[];\n}\n\nexport interface ISplitViewOptions<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * Which axis the views align on.\n\t *\n\t * @defaultValue `Orientation.VERTICAL`\n\t */\n\treadonly orientation?: Orientation;\n\n\t/**\n\t * Styles overriding the {@link defaultStyles default ones}.\n\t */\n\treadonly styles?: ISplitViewStyles;\n\n\t/**\n\t * Make Alt-drag the default drag operation.\n\t */\n\treadonly inverseAltBehavior?: boolean;\n\n\t/**\n\t * Resize each view proportionally when resizing the SplitView.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * An initial description of this {@link SplitView} instance, allowing\n\t * to initialze all views within the ctor.\n\t */\n\treadonly descriptor?: ISplitViewDescriptor<TLayoutContext, TView>;\n\n\t/**\n\t * The scrollbar visibility setting for whenever the views within\n\t * the {@link SplitView} overflow.\n\t */\n\treadonly scrollbarVisibility?: ScrollbarVisibility;\n\n\t/**\n\t * Override the orthogonal size of sashes.\n\t */\n\treadonly getSashOrthogonalSize?: () => number;\n}\n\ninterface ISashEvent {\n\treadonly sash: Sash;\n\treadonly start: number;\n\treadonly current: number;\n\treadonly alt: boolean;\n}\n\ntype ViewItemSize = number | { cachedVisibleSize: number };\n\nabstract class ViewItem<TLayoutContext, TView extends IView<TLayoutContext>> {\n\n\tprivate _size: number;\n\tset size(size: number) {\n\t\tthis._size = size;\n\t}\n\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\tprivate _cachedVisibleSize: number | undefined = undefined;\n\n\tget visible(): boolean {\n\t\treturn typeof this._cachedVisibleSize === 'undefined';\n\t}\n\n\tsetVisible(visible: boolean, size?: number): void {\n\t\tif (visible === this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (visible) {\n\t\t\tthis.size = clamp(this._cachedVisibleSize!, this.viewMinimumSize, this.viewMaximumSize);\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t} else {\n\t\t\tthis._cachedVisibleSize = typeof size === 'number' ? size : this.size;\n\t\t\tthis.size = 0;\n\t\t}\n\n\t\tthis.container.classList.toggle('visible', visible);\n\n\t\ttry {\n\t\t\tthis.view.setVisible?.(visible);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to set visible view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tget minimumSize(): number { return this.visible ? this.view.minimumSize : 0; }\n\tget viewMinimumSize(): number { return this.view.minimumSize; }\n\n\tget maximumSize(): number { return this.visible ? this.view.maximumSize : 0; }\n\tget viewMaximumSize(): number { return this.view.maximumSize; }\n\n\tget priority(): LayoutPriority | undefined { return this.view.priority; }\n\tget proportionalLayout(): boolean { return this.view.proportionalLayout ?? true; }\n\tget snap(): boolean { return !!this.view.snap; }\n\n\tset enabled(enabled: boolean) {\n\t\tthis.container.style.pointerEvents = enabled ? '' : 'none';\n\t}\n\n\tconstructor(\n\t\tprotected container: HTMLElement,\n\t\treadonly view: TView,\n\t\tsize: ViewItemSize,\n\t\tprivate disposable: IDisposable\n\t) {\n\t\tif (typeof size === 'number') {\n\t\t\tthis._size = size;\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t\tcontainer.classList.add('visible');\n\t\t} else {\n\t\t\tthis._size = 0;\n\t\t\tthis._cachedVisibleSize = size.cachedVisibleSize;\n\t\t}\n\t}\n\n\tlayout(offset: number, layoutContext: TLayoutContext | undefined): void {\n\t\tthis.layoutContainer(offset);\n\n\t\ttry {\n\t\t\tthis.view.layout(this.size, offset, layoutContext);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to layout view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tabstract layoutContainer(offset: number): void;\n\n\tdispose(): void {\n\t\tthis.disposable.dispose();\n\t}\n}\n\nclass VerticalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.top = `${offset}px`;\n\t\tthis.container.style.height = `${this.size}px`;\n\t}\n}\n\nclass HorizontalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.left = `${offset}px`;\n\t\tthis.container.style.width = `${this.size}px`;\n\t}\n}\n\ninterface ISashItem {\n\tsash: Sash;\n\tdisposable: IDisposable;\n}\n\ninterface ISashDragSnapState {\n\treadonly index: number;\n\treadonly limitDelta: number;\n\treadonly size: number;\n}\n\ninterface ISashDragState {\n\tindex: number;\n\tstart: number;\n\tcurrent: number;\n\tsizes: number[];\n\tminDelta: number;\n\tmaxDelta: number;\n\talt: boolean;\n\tsnapBefore: ISashDragSnapState | undefined;\n\tsnapAfter: ISashDragSnapState | undefined;\n\tdisposable: IDisposable;\n}\n\nenum State {\n\tIdle,\n\tBusy\n}\n\n/**\n * When adding or removing views, uniformly distribute the entire split view space among\n * all views.\n */\nexport type DistributeSizing = { type: 'distribute' };\n\n/**\n * When adding a view, make space for it by reducing the size of another view,\n * indexed by the provided `index`.\n */\nexport type SplitSizing = { type: 'split'; index: number };\n\n/**\n * When adding a view, use DistributeSizing when all pre-existing views are\n * distributed evenly, otherwise use SplitSizing.\n */\nexport type AutoSizing = { type: 'auto'; index: number };\n\n/**\n * When adding or removing views, assume the view is invisible.\n */\nexport type InvisibleSizing = { type: 'invisible'; cachedVisibleSize: number };\n\n/**\n * When adding or removing views, the sizing provides fine grained\n * control over how other views get resized.\n */\nexport type Sizing = DistributeSizing | SplitSizing | AutoSizing | InvisibleSizing;\n\nexport namespace Sizing {\n\n\t/**\n\t * When adding or removing views, distribute the delta space among\n\t * all other views.\n\t */\n\texport const Distribute: DistributeSizing = { type: 'distribute' };\n\n\t/**\n\t * When adding or removing views, split the delta space with another\n\t * specific view, indexed by the provided `index`.\n\t */\n\texport function Split(index: number): SplitSizing { return { type: 'split', index }; }\n\n\t/**\n\t * When adding a view, use DistributeSizing when all pre-existing views are\n\t * distributed evenly, otherwise use SplitSizing.\n\t */\n\texport function Auto(index: number): AutoSizing { return { type: 'auto', index }; }\n\n\t/**\n\t * When adding or removing views, assume the view is invisible.\n\t */\n\texport function Invisible(cachedVisibleSize: number): InvisibleSizing { return { type: 'invisible', cachedVisibleSize }; }\n}\n\n/**\n * The {@link SplitView} is the UI component which implements a one dimensional\n * flex-like layout algorithm for a collection of {@link IView} instances, which\n * are essentially HTMLElement instances with the following size constraints:\n *\n * - {@link IView.minimumSize}\n * - {@link IView.maximumSize}\n * - {@link IView.priority}\n * - {@link IView.snap}\n *\n * In case the SplitView doesn't have enough size to fit all views, it will overflow\n * its content with a scrollbar.\n *\n * In between each pair of views there will be a {@link Sash} allowing the user\n * to resize the views, making sure the constraints are respected.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n *\n * Features:\n * - Flex-like layout algorithm\n * - Snap support\n * - Orthogonal sash support, for corner sashes\n * - View hide/show support\n * - View swap/move support\n * - Alt key modifier behavior, macOS style\n */\nexport class SplitView<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> extends Disposable {\n\n\t/**\n\t * This {@link SplitView}'s orientation.\n\t */\n\treadonly orientation: Orientation;\n\n\t/**\n\t * The DOM element representing this {@link SplitView}.\n\t */\n\treadonly el: HTMLElement;\n\n\tprivate sashContainer: HTMLElement;\n\tprivate viewContainer: HTMLElement;\n\tprivate scrollable: Scrollable;\n\tprivate scrollableElement: SmoothScrollableElement;\n\tprivate size = 0;\n\tprivate layoutContext: TLayoutContext | undefined;\n\tprivate _contentSize = 0;\n\tprivate proportions: (number | undefined)[] | undefined = undefined;\n\tprivate viewItems: ViewItem<TLayoutContext, TView>[] = [];\n\tsashItems: ISashItem[] = []; // used in tests\n\tprivate sashDragState: ISashDragState | undefined;\n\tprivate state: State = State.Idle;\n\tprivate inverseAltBehavior: boolean;\n\tprivate proportionalLayout: boolean;\n\tprivate readonly getSashOrthogonalSize: { (): number } | undefined;\n\n\tprivate _onDidSashChange = this._register(new Emitter<number>());\n\tprivate _onDidSashReset = this._register(new Emitter<number>());\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tprivate _orthogonalEndSash: Sash | undefined;\n\tprivate _startSnappingEnabled = true;\n\tprivate _endSnappingEnabled = true;\n\n\t/**\n\t * Fires whenever the user resizes a {@link Sash sash}.\n\t */\n\treadonly onDidSashChange = this._onDidSashChange.event;\n\n\t/**\n\t * Fires whenever the user double clicks a {@link Sash sash}.\n\t */\n\treadonly onDidSashReset = this._onDidSashReset.event;\n\n\t/**\n\t * Fires whenever the split view is scrolled.\n\t */\n\treadonly onDidScroll: Event<ScrollEvent>;\n\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\n\tget startSnappingEnabled(): boolean { return this._startSnappingEnabled; }\n\tget endSnappingEnabled(): boolean { return this._endSnappingEnabled; }\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the left- or top-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalStartSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalStartSash = sash;\n\t\t}\n\n\t\tthis._orthogonalStartSash = sash;\n\t}\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the right- or bottom-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalEndSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalEndSash = sash;\n\t\t}\n\n\t\tthis._orthogonalEndSash = sash;\n\t}\n\n\t/**\n\t * Enable/disable snapping at the beginning of this {@link SplitView}.\n\t */\n\tset startSnappingEnabled(startSnappingEnabled: boolean) {\n\t\tif (this._startSnappingEnabled === startSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startSnappingEnabled = startSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Enable/disable snapping at the end of this {@link SplitView}.\n\t */\n\tset endSnappingEnabled(endSnappingEnabled: boolean) {\n\t\tif (this._endSnappingEnabled === endSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._endSnappingEnabled = endSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Create a new {@link SplitView} instance.\n\t */\n\tconstructor(container: HTMLElement, options: ISplitViewOptions<TLayoutContext, TView> = {}) {\n\t\tsuper();\n\n\t\tthis.orientation = options.orientation ?? Orientation.VERTICAL;\n\t\tthis.inverseAltBehavior = options.inverseAltBehavior ?? false;\n\t\tthis.proportionalLayout = options.proportionalLayout ?? true;\n\t\tthis.getSashOrthogonalSize = options.getSashOrthogonalSize;\n\n\t\tthis.el = document.createElement('div');\n\t\tthis.el.classList.add('monaco-split-view2');\n\t\tthis.el.classList.add(this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal');\n\t\tcontainer.appendChild(this.el);\n\n\t\tthis.sashContainer = append(this.el, $('.sash-container'));\n\t\tthis.viewContainer = $('.split-view-container');\n\n\t\tthis.scrollable = this._register(new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration: 125,\n\t\t\tscheduleAtNextAnimationFrame: callback => scheduleAtNextAnimationFrame(getWindow(this.el), callback),\n\t\t}));\n\t\tthis.scrollableElement = this._register(new SmoothScrollableElement(this.viewContainer, {\n\t\t\tvertical: this.orientation === Orientation.VERTICAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden,\n\t\t\thorizontal: this.orientation === Orientation.HORIZONTAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden\n\t\t}, this.scrollable));\n\n\t\t// https://github.com/microsoft/vscode/issues/157737\n\t\tconst onDidScrollViewContainer = this._register(new DomEmitter(this.viewContainer, 'scroll')).event;\n\t\tthis._register(onDidScrollViewContainer(_ => {\n\t\t\tconst position = this.scrollableElement.getScrollPosition();\n\t\t\tconst scrollLeft = Math.abs(this.viewContainer.scrollLeft - position.scrollLeft) <= 1 ? undefined : this.viewContainer.scrollLeft;\n\t\t\tconst scrollTop = Math.abs(this.viewContainer.scrollTop - position.scrollTop) <= 1 ? undefined : this.viewContainer.scrollTop;\n\n\t\t\tif (scrollLeft !== undefined || scrollTop !== undefined) {\n\t\t\t\tthis.scrollableElement.setScrollPosition({ scrollLeft, scrollTop });\n\t\t\t}\n\t\t}));\n\n\t\tthis.onDidScroll = this.scrollableElement.onScroll;\n\t\tthis._register(this.onDidScroll(e => {\n\t\t\tif (e.scrollTopChanged) {\n\t\t\t\tthis.viewContainer.scrollTop = e.scrollTop;\n\t\t\t}\n\n\t\t\tif (e.scrollLeftChanged) {\n\t\t\t\tthis.viewContainer.scrollLeft = e.scrollLeft;\n\t\t\t}\n\t\t}));\n\n\t\tappend(this.el, this.scrollableElement.getDomNode());\n\n\t\tthis.style(options.styles || defaultStyles);\n\n\t\t// We have an existing set of view, add them now\n\t\tif (options.descriptor) {\n\t\t\tthis.size = options.descriptor.size;\n\t\t\toptions.descriptor.views.forEach((viewDescriptor, index) => {\n\t\t\t\tconst sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } satisfies InvisibleSizing;\n\n\t\t\t\tconst view = viewDescriptor.view;\n\t\t\t\tthis.doAddView(view, sizing, index, true);\n\t\t\t});\n\n\t\t\t// Initialize content size and proportions for first layout\n\t\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\t\tthis.saveProportions();\n\t\t}\n\t}\n\n\tstyle(styles: ISplitViewStyles): void {\n\t\tif (styles.separatorBorder.isTransparent()) {\n\t\t\tthis.el.classList.remove('separator-border');\n\t\t\tthis.el.style.removeProperty('--separator-border');\n\t\t} else {\n\t\t\tthis.el.classList.add('separator-border');\n\t\t\tthis.el.style.setProperty('--separator-border', styles.separatorBorder.toString());\n\t\t}\n\t}\n\n\t/**\n\t * Add a {@link IView view} to this {@link SplitView}.\n\t *\n\t * @param view The view to add.\n\t * @param size Either a fixed size, or a dynamic {@link Sizing} strategy.\n\t * @param index The index to insert the view on.\n\t * @param skipLayout Whether layout should be skipped.\n\t */\n\taddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tthis.doAddView(view, size, index, skipLayout);\n\t}\n\n\t/**\n\t * Layout the {@link SplitView}.\n\t *\n\t * @param size The entire size of the {@link SplitView}.\n\t * @param layoutContext An optional layout context to pass along to {@link IView views}.\n\t */\n\tlayout(size: number, layoutContext?: TLayoutContext): void {\n\t\tconst previousSize = Math.max(this.size, this._contentSize);\n\t\tthis.size = size;\n\t\tthis.layoutContext = layoutContext;\n\n\t\tif (!this.proportions) {\n\t\t\tconst indexes = range(this.viewItems.length);\n\t\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\t} else {\n\t\t\tlet total = 0;\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number') {\n\t\t\t\t\ttotal += proportion;\n\t\t\t\t} else {\n\t\t\t\t\tsize -= item.size;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number' && total > 0) {\n\t\t\t\t\titem.size = clamp(Math.round(proportion * size / total), item.minimumSize, item.maximumSize);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate saveProportions(): void {\n\t\tif (this.proportionalLayout && this._contentSize > 0) {\n\t\t\tthis.proportions = this.viewItems.map(v => v.proportionalLayout && v.visible ? v.size / this._contentSize : undefined);\n\t\t}\n\t}\n\n\tprivate onSashStart({ sash, start, alt }: ISashEvent): void {\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = false;\n\t\t}\n\n\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\n\t\t// This way, we can press Alt while we resize a sash, macOS style!\n\t\tconst disposable = combinedDisposable(\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keydown', e => resetSashDragState(this.sashDragState!.current, e.altKey)),\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keyup', () => resetSashDragState(this.sashDragState!.current, false))\n\t\t);\n\n\t\tconst resetSashDragState = (start: number, alt: boolean) => {\n\t\t\tconst sizes = this.viewItems.map(i => i.size);\n\t\t\tlet minDelta = Number.NEGATIVE_INFINITY;\n\t\t\tlet maxDelta = Number.POSITIVE_INFINITY;\n\n\t\t\tif (this.inverseAltBehavior) {\n\t\t\t\talt = !alt;\n\t\t\t}\n\n\t\t\tif (alt) {\n\t\t\t\t// When we're using the last sash with Alt, we're resizing\n\t\t\t\t// the view to the left/up, instead of right/down as usual\n\t\t\t\t// Thus, we must do the inverse of the usual\n\t\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\n\t\t\t\tif (isLastSash) {\n\t\t\t\t\tconst viewItem = this.viewItems[index];\n\t\t\t\t\tminDelta = (viewItem.minimumSize - viewItem.size) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.maximumSize - viewItem.size) / 2;\n\t\t\t\t} else {\n\t\t\t\t\tconst viewItem = this.viewItems[index + 1];\n\t\t\t\t\tminDelta = (viewItem.size - viewItem.maximumSize) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.size - viewItem.minimumSize) / 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet snapBefore: ISashDragSnapState | undefined;\n\t\t\tlet snapAfter: ISashDragSnapState | undefined;\n\n\t\t\tif (!alt) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\t\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0);\n\t\t\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown);\n\t\t\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tif (typeof snapBeforeIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapBeforeIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapBefore = {\n\t\t\t\t\t\tindex: snapBeforeIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (typeof snapAfterIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapAfterIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapAfter = {\n\t\t\t\t\t\tindex: snapAfterIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable };\n\t\t};\n\n\t\tresetSashDragState(start, alt);\n\t}\n\n\tprivate onSashChange({ current }: ISashEvent): void {\n\t\tconst { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState!;\n\t\tthis.sashDragState!.current = current;\n\n\t\tconst delta = current - start;\n\t\tconst newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter);\n\n\t\tif (alt) {\n\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\t\t\tconst newSizes = this.viewItems.map(i => i.size);\n\t\t\tconst viewItemIndex = isLastSash ? index : index + 1;\n\t\t\tconst viewItem = this.viewItems[viewItemIndex];\n\t\t\tconst newMinDelta = viewItem.size - viewItem.maximumSize;\n\t\t\tconst newMaxDelta = viewItem.size - viewItem.minimumSize;\n\t\t\tconst resizeIndex = isLastSash ? index - 1 : index + 1;\n\n\t\t\tthis.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta);\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate onSashEnd(index: number): void {\n\t\tthis._onDidSashChange.fire(index);\n\t\tthis.sashDragState!.disposable.dispose();\n\t\tthis.saveProportions();\n\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = true;\n\t\t}\n\t}\n\n\tprivate onViewChange(item: ViewItem<TLayoutContext, TView>, size: number | undefined): void {\n\t\tconst index = this.viewItems.indexOf(item);\n\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tsize = typeof size === 'number' ? size : item.size;\n\t\tsize = clamp(size, item.minimumSize, item.maximumSize);\n\n\t\tif (this.inverseAltBehavior && index > 0) {\n\t\t\t// In this case, we want the view to grow or shrink both sides equally\n\t\t\t// so we just resize the \"left\" side by half and let `resize` do the clamping magic\n\t\t\tthis.resize(index - 1, Math.floor((item.size - size) / 2));\n\t\t\tthis.distributeEmptySpace();\n\t\t\tthis.layoutViews();\n\t\t} else {\n\t\t\titem.size = size;\n\n\t\t\t// Absorb the change by layout priority, like `resizeView` does, so a neighbour with a size of its own is not squeezed (see #334167)\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t}\n\t}\n\n\t/**\n\t * Resize a {@link IView view} within the {@link SplitView}.\n\t *\n\t * @param index The {@link IView view} index.\n\t * @param size The {@link IView view} size.\n\t */\n\tresizeView(index: number, size: number): void {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tconst item = this.viewItems[index];\n\t\t\tsize = Math.round(size);\n\t\t\tsize = clamp(size, item.minimumSize, Math.min(item.maximumSize, this.size));\n\n\t\t\titem.size = size;\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\t/**\n\t * Distribute the entire {@link SplitView} size among all {@link IView views}.\n\t */\n\tdistributeViewSizes(): void {\n\t\tconst flexibleViewItems: ViewItem<TLayoutContext, TView>[] = [];\n\t\tlet flexibleSize = 0;\n\n\t\tfor (const item of this.viewItems) {\n\t\t\tif (item.maximumSize - item.minimumSize > 0) {\n\t\t\t\tflexibleViewItems.push(item);\n\t\t\t\tflexibleSize += item.size;\n\t\t\t}\n\t\t}\n\n\t\tconst size = Math.floor(flexibleSize / flexibleViewItems.length);\n\n\t\tfor (const item of flexibleViewItems) {\n\t\t\titem.size = clamp(size, item.minimumSize, item.maximumSize);\n\t\t}\n\n\t\tconst indexes = range(this.viewItems.length);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t}\n\n\t/**\n\t * Returns the size of a {@link IView view}.\n\t */\n\tgetViewSize(index: number): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn this.viewItems[index].size;\n\t}\n\n\tprivate doAddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\t// Add view\n\t\t\tconst container = $('.split-view-view');\n\n\t\t\tif (index === this.viewItems.length) {\n\t\t\t\tthis.viewContainer.appendChild(container);\n\t\t\t} else {\n\t\t\t\tthis.viewContainer.insertBefore(container, this.viewContainer.children.item(index));\n\t\t\t}\n\n\t\t\tconst onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size));\n\t\t\tconst containerDisposable = toDisposable(() => container.remove());\n\t\t\tconst disposable = combinedDisposable(onChangeDisposable, containerDisposable);\n\n\t\t\tlet viewSize: ViewItemSize;\n\n\t\t\tif (typeof size === 'number') {\n\t\t\t\tviewSize = size;\n\t\t\t} else {\n\t\t\t\tif (size.type === 'auto') {\n\t\t\t\t\tif (this.areViewsDistributed()) {\n\t\t\t\t\t\tsize = { type: 'distribute' };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsize = { type: 'split', index: size.index };\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (size.type === 'split') {\n\t\t\t\t\tviewSize = this.getViewSize(size.index) / 2;\n\t\t\t\t} else if (size.type === 'invisible') {\n\t\t\t\t\tviewSize = { cachedVisibleSize: size.cachedVisibleSize };\n\t\t\t\t} else {\n\t\t\t\t\tviewSize = view.minimumSize;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst item = this.orientation === Orientation.VERTICAL\n\t\t\t\t? new VerticalViewItem(container, view, viewSize, disposable)\n\t\t\t\t: new HorizontalViewItem(container, view, viewSize, disposable);\n\n\t\t\tthis.viewItems.splice(index, 0, item);\n\n\t\t\t// Add sash\n\t\t\tif (this.viewItems.length > 1) {\n\t\t\t\tconst opts = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash };\n\n\t\t\t\tconst sash = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? new Sash(this.sashContainer, { getHorizontalSashTop: s => this.getSashPosition(s), getHorizontalSashWidth: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.HORIZONTAL })\n\t\t\t\t\t: new Sash(this.sashContainer, { getVerticalSashLeft: s => this.getSashPosition(s), getVerticalSashHeight: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.VERTICAL });\n\n\t\t\t\tconst sashEventMapper = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey })\n\t\t\t\t\t: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey });\n\n\t\t\t\tconst onStart = Event.map(sash.onDidStart, sashEventMapper);\n\t\t\t\tconst onStartDisposable = onStart(this.onSashStart, this);\n\t\t\t\tconst onChange = Event.map(sash.onDidChange, sashEventMapper);\n\t\t\t\tconst onChangeDisposable = onChange(this.onSashChange, this);\n\t\t\t\tconst onEnd = Event.map(sash.onDidEnd, () => this.sashItems.findIndex(item => item.sash === sash));\n\t\t\t\tconst onEndDisposable = onEnd(this.onSashEnd, this);\n\n\t\t\t\tconst onDidResetDisposable = sash.onDidReset(() => {\n\t\t\t\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\t\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\t\tif (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._onDidSashReset.fire(index);\n\t\t\t\t});\n\n\t\t\t\tconst disposable = combinedDisposable(onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash);\n\t\t\t\tconst sashItem: ISashItem = { sash, disposable };\n\n\t\t\t\tthis.sashItems.splice(index - 1, 0, sashItem);\n\t\t\t}\n\n\t\t\tcontainer.appendChild(view.element);\n\n\t\t\tlet highPriorityIndexes: number[] | undefined;\n\n\t\t\tif (typeof size !== 'number' && size.type === 'split') {\n\t\t\t\thighPriorityIndexes = [size.index];\n\t\t\t}\n\n\t\t\tif (!skipLayout) {\n\t\t\t\tthis.relayout([index], highPriorityIndexes);\n\t\t\t}\n\n\n\t\t\tif (!skipLayout && typeof size !== 'number' && size.type === 'distribute') {\n\t\t\t\tthis.distributeViewSizes();\n\t\t\t}\n\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\tprivate relayout(lowPriorityIndexes?: number[], highPriorityIndexes?: number[]): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\tthis.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t\tthis.saveProportions();\n\t}\n\n\tprivate resize(\n\t\tindex: number,\n\t\tdelta: number,\n\t\tsizes = this.viewItems.map(i => i.size),\n\t\tlowPriorityIndexes?: number[],\n\t\thighPriorityIndexes?: number[],\n\t\toverloadMinDelta: number = Number.NEGATIVE_INFINITY,\n\t\toverloadMaxDelta: number = Number.POSITIVE_INFINITY,\n\t\tsnapBefore?: ISashDragSnapState,\n\t\tsnapAfter?: ISashDragSnapState\n\t): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst upIndexes = range(index, -1);\n\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\n\t\tif (highPriorityIndexes) {\n\t\t\tfor (const index of highPriorityIndexes) {\n\t\t\t\tpushToStart(upIndexes, index);\n\t\t\t\tpushToStart(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tif (lowPriorityIndexes) {\n\t\t\tfor (const index of lowPriorityIndexes) {\n\t\t\t\tpushToEnd(upIndexes, index);\n\t\t\t\tpushToEnd(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tconst upItems = upIndexes.map(i => this.viewItems[i]);\n\t\tconst upSizes = upIndexes.map(i => sizes[i]);\n\n\t\tconst downItems = downIndexes.map(i => this.viewItems[i]);\n\t\tconst downSizes = downIndexes.map(i => sizes[i]);\n\n\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0);\n\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0);\n\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta);\n\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta);\n\n\t\tlet snapped = false;\n\n\t\tif (snapBefore) {\n\t\t\tconst snapView = this.viewItems[snapBefore.index];\n\t\t\tconst visible = delta >= snapBefore.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapBefore.size);\n\t\t}\n\n\t\tif (!snapped && snapAfter) {\n\t\t\tconst snapView = this.viewItems[snapAfter.index];\n\t\t\tconst visible = delta < snapAfter.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapAfter.size);\n\t\t}\n\n\t\tif (snapped) {\n\t\t\treturn this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta);\n\t\t}\n\n\t\tdelta = clamp(delta, minDelta, maxDelta);\n\n\t\tfor (let i = 0, deltaUp = delta; i < upItems.length; i++) {\n\t\t\tconst item = upItems[i];\n\t\t\tconst size = clamp(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - upSizes[i];\n\n\t\t\tdeltaUp -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\tfor (let i = 0, deltaDown = delta; i < downItems.length; i++) {\n\t\t\tconst item = downItems[i];\n\t\t\tconst size = clamp(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - downSizes[i];\n\n\t\t\tdeltaDown += viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\tprivate distributeEmptySpace(lowPriorityIndex?: number): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\tlet emptyDelta = this.size - contentSize;\n\n\t\tconst indexes = range(this.viewItems.length - 1, -1);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tfor (const index of highPriorityIndexes) {\n\t\t\tpushToStart(indexes, index);\n\t\t}\n\n\t\tfor (const index of lowPriorityIndexes) {\n\t\t\tpushToEnd(indexes, index);\n\t\t}\n\n\t\tif (typeof lowPriorityIndex === 'number') {\n\t\t\tpushToEnd(indexes, lowPriorityIndex);\n\t\t}\n\n\t\tfor (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {\n\t\t\tconst item = this.viewItems[indexes[i]];\n\t\t\tconst size = clamp(item.size + emptyDelta, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - item.size;\n\n\t\t\temptyDelta -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\t}\n\n\tprivate layoutViews(): void {\n\t\t// Save new content size\n\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\t// Layout views\n\t\tlet offset = 0;\n\n\t\tfor (const viewItem of this.viewItems) {\n\t\t\tviewItem.layout(offset, this.layoutContext);\n\t\t\toffset += viewItem.size;\n\t\t}\n\n\t\t// Layout sashes\n\t\tthis.sashItems.forEach(item => item.sash.layout());\n\t\tthis.updateSashEnablement();\n\t\tthis.updateScrollableElement();\n\t}\n\n\tprivate updateScrollableElement(): void {\n\t\tif (this.orientation === Orientation.VERTICAL) {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\theight: this.size,\n\t\t\t\tscrollHeight: this._contentSize\n\t\t\t});\n\t\t} else {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\twidth: this.size,\n\t\t\t\tscrollWidth: this._contentSize\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate updateSashEnablement(): void {\n\t\tlet previous = false;\n\t\tconst collapsesDown = this.viewItems.map(i => previous = (i.size - i.minimumSize > 0) || previous);\n\n\t\tprevious = false;\n\t\tconst expandsDown = this.viewItems.map(i => previous = (i.maximumSize - i.size > 0) || previous);\n\n\t\tconst reverseViews = [...this.viewItems].reverse();\n\t\tprevious = false;\n\t\tconst collapsesUp = reverseViews.map(i => previous = (i.size - i.minimumSize > 0) || previous).reverse();\n\n\t\tprevious = false;\n\t\tconst expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse();\n\n\t\tlet position = 0;\n\t\tfor (let index = 0; index < this.sashItems.length; index++) {\n\t\t\tconst { sash } = this.sashItems[index];\n\t\t\tconst viewItem = this.viewItems[index];\n\t\t\tposition += viewItem.size;\n\n\t\t\tconst min = !(collapsesDown[index] && expandsUp[index + 1]);\n\t\t\tconst max = !(expandsDown[index] && collapsesUp[index + 1]);\n\n\t\t\tif (min && max) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tconst snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible;\n\t\t\t\tconst snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible;\n\n\t\t\t\tif (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t\t} else if (snappedAfter && collapsesDown[index] && (position < this._contentSize || this.endSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t\t} else {\n\t\t\t\t\tsash.state = SashState.Disabled;\n\t\t\t\t}\n\t\t\t} else if (min && !max) {\n\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t} else if (!min && max) {\n\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t} else {\n\t\t\t\tsash.state = SashState.Enabled;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getSashPosition(sash: Sash): number {\n\t\tlet position = 0;\n\n\t\tfor (let i = 0; i < this.sashItems.length; i++) {\n\t\t\tposition += this.viewItems[i].size;\n\n\t\t\tif (this.sashItems[i].sash === sash) {\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate findFirstSnapIndex(indexes: number[]): number | undefined {\n\t\t// visible views first\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (!viewItem.visible) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\t// then, hidden views\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!viewItem.visible && viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate areViewsDistributed() {\n\t\tlet min = undefined, max = undefined;\n\n\t\tfor (const view of this.viewItems) {\n\t\t\tmin = min === undefined ? view.size : Math.min(min, view.size);\n\t\t\tmax = max === undefined ? view.size : Math.max(max, view.size);\n\n\t\t\tif (max - min > 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\toverride dispose(): void {\n\t\tthis.sashDragState?.disposable.dispose();\n\n\t\tdispose(this.viewItems);\n\t\tthis.viewItems = [];\n\n\t\tthis.sashItems.forEach(i => i.disposable.dispose());\n\t\tthis.sashItems = [];\n\n\t\tsuper.dispose();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener, append, getWindow, scheduleAtNextAnimationFrame } from '../../dom.js';\nimport { DomEmitter } from '../../event.js';\nimport { ISashEvent as IBaseSashEvent, Orientation, Sash, SashState } from '../sash/sash.js';\nimport { SmoothScrollableElement } from '../scrollbar/scrollableElement.js';\nimport { pushToEnd, pushToStart, range } from '../../../common/arrays.js';\nimport { Color } from '../../../common/color.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { combinedDisposable, Disposable, dispose, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { clamp } from '../../../common/numbers.js';\nimport { Scrollable, ScrollbarVisibility, ScrollEvent } from '../../../common/scrollable.js';\nimport * as types from '../../../common/types.js';\nimport './splitview.css';\nexport { Orientation } from '../sash/sash.js';\n\nexport interface ISplitViewStyles {\n\treadonly separatorBorder: Color;\n}\n\nconst defaultStyles: ISplitViewStyles = {\n\tseparatorBorder: Color.transparent\n};\n\nexport const enum LayoutPriority {\n\tNormal,\n\tLow,\n\tHigh\n}\n\n/**\n * The interface to implement for views within a {@link SplitView}.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n */\nexport interface IView<TLayoutContext = undefined> {\n\n\t/**\n\t * The DOM element for this view.\n\t */\n\treadonly element: HTMLElement;\n\n\t/**\n\t * A minimum size for this view.\n\t *\n\t * @remarks If none, set it to `0`.\n\t */\n\treadonly minimumSize: number;\n\n\t/**\n\t * A maximum size for this view.\n\t *\n\t * @remarks If none, set it to `Number.POSITIVE_INFINITY`.\n\t */\n\treadonly maximumSize: number;\n\n\t/**\n\t * The priority of the view when the {@link SplitView.resize layout} algorithm\n\t * runs. Views with higher priority will be resized first.\n\t *\n\t * @remarks Only used when `proportionalLayout` is false.\n\t */\n\treadonly priority?: LayoutPriority;\n\n\t/**\n\t * If the {@link SplitView} supports {@link ISplitViewOptions.proportionalLayout proportional layout},\n\t * this property allows for finer control over the proportional layout algorithm, per view.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * Whether the view will snap whenever the user reaches its minimum size or\n\t * attempts to grow it beyond the minimum size.\n\t *\n\t * @defaultValue `false`\n\t */\n\treadonly snap?: boolean;\n\n\t/**\n\t * View instances are supposed to fire the {@link IView.onDidChange} event whenever\n\t * any of the constraint properties have changed:\n\t *\n\t * - {@link IView.minimumSize}\n\t * - {@link IView.maximumSize}\n\t * - {@link IView.priority}\n\t * - {@link IView.snap}\n\t *\n\t * The SplitView will relayout whenever that happens. The event can optionally emit\n\t * the view's preferred size for that relayout.\n\t */\n\treadonly onDidChange: Event<number | undefined>;\n\n\t/**\n\t * This will be called by the {@link SplitView} during layout. A view meant to\n\t * pass along the layout information down to its descendants.\n\t *\n\t * @param size The size of this view, in pixels.\n\t * @param offset The offset of this view, relative to the start of the {@link SplitView}.\n\t * @param context The optional {@link IView layout context} passed to {@link SplitView.layout}.\n\t */\n\tlayout(size: number, offset: number, context: TLayoutContext | undefined): void;\n\n\t/**\n\t * This will be called by the {@link SplitView} whenever this view is made\n\t * visible or hidden.\n\t *\n\t * @param visible Whether the view becomes visible.\n\t */\n\tsetVisible?(visible: boolean): void;\n}\n\n/**\n * A descriptor for a {@link SplitView} instance.\n */\nexport interface ISplitViewDescriptor<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * The layout size of the {@link SplitView}.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Descriptors for each {@link IView view}.\n\t */\n\treadonly views: {\n\n\t\t/**\n\t\t * Whether the {@link IView view} is visible.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly visible?: boolean;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly size: number;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly view: TView;\n\t}[];\n}\n\nexport interface ISplitViewOptions<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * Which axis the views align on.\n\t *\n\t * @defaultValue `Orientation.VERTICAL`\n\t */\n\treadonly orientation?: Orientation;\n\n\t/**\n\t * Styles overriding the {@link defaultStyles default ones}.\n\t */\n\treadonly styles?: ISplitViewStyles;\n\n\t/**\n\t * Make Alt-drag the default drag operation.\n\t */\n\treadonly inverseAltBehavior?: boolean;\n\n\t/**\n\t * Resize each view proportionally when resizing the SplitView.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * An initial description of this {@link SplitView} instance, allowing\n\t * to initialze all views within the ctor.\n\t */\n\treadonly descriptor?: ISplitViewDescriptor<TLayoutContext, TView>;\n\n\t/**\n\t * The scrollbar visibility setting for whenever the views within\n\t * the {@link SplitView} overflow.\n\t */\n\treadonly scrollbarVisibility?: ScrollbarVisibility;\n\n\t/**\n\t * Override the orthogonal size of sashes.\n\t */\n\treadonly getSashOrthogonalSize?: () => number;\n}\n\ninterface ISashEvent {\n\treadonly sash: Sash;\n\treadonly start: number;\n\treadonly current: number;\n\treadonly alt: boolean;\n}\n\ntype ViewItemSize = number | { cachedVisibleSize: number };\n\nabstract class ViewItem<TLayoutContext, TView extends IView<TLayoutContext>> {\n\n\tprivate _size: number;\n\tset size(size: number) {\n\t\tthis._size = size;\n\t}\n\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\tprivate _cachedVisibleSize: number | undefined = undefined;\n\n\tget visible(): boolean {\n\t\treturn typeof this._cachedVisibleSize === 'undefined';\n\t}\n\n\tsetVisible(visible: boolean, size?: number): void {\n\t\tif (visible === this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (visible) {\n\t\t\tthis.size = clamp(this._cachedVisibleSize!, this.viewMinimumSize, this.viewMaximumSize);\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t} else {\n\t\t\tthis._cachedVisibleSize = typeof size === 'number' ? size : this.size;\n\t\t\tthis.size = 0;\n\t\t}\n\n\t\tthis.container.classList.toggle('visible', visible);\n\n\t\ttry {\n\t\t\tthis.view.setVisible?.(visible);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to set visible view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tget minimumSize(): number { return this.visible ? this.view.minimumSize : 0; }\n\tget viewMinimumSize(): number { return this.view.minimumSize; }\n\n\tget maximumSize(): number { return this.visible ? this.view.maximumSize : 0; }\n\tget viewMaximumSize(): number { return this.view.maximumSize; }\n\n\tget priority(): LayoutPriority | undefined { return this.view.priority; }\n\tget proportionalLayout(): boolean { return this.view.proportionalLayout ?? true; }\n\tget snap(): boolean { return !!this.view.snap; }\n\n\tset enabled(enabled: boolean) {\n\t\tthis.container.style.pointerEvents = enabled ? '' : 'none';\n\t}\n\n\tconstructor(\n\t\tprotected container: HTMLElement,\n\t\treadonly view: TView,\n\t\tsize: ViewItemSize,\n\t\tprivate disposable: IDisposable\n\t) {\n\t\tif (typeof size === 'number') {\n\t\t\tthis._size = size;\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t\tcontainer.classList.add('visible');\n\t\t} else {\n\t\t\tthis._size = 0;\n\t\t\tthis._cachedVisibleSize = size.cachedVisibleSize;\n\t\t}\n\t}\n\n\tlayout(offset: number, layoutContext: TLayoutContext | undefined): void {\n\t\tthis.layoutContainer(offset);\n\n\t\ttry {\n\t\t\tthis.view.layout(this.size, offset, layoutContext);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to layout view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tabstract layoutContainer(offset: number): void;\n\n\tdispose(): void {\n\t\tthis.disposable.dispose();\n\t}\n}\n\nclass VerticalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.top = `${offset}px`;\n\t\tthis.container.style.height = `${this.size}px`;\n\t}\n}\n\nclass HorizontalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.left = `${offset}px`;\n\t\tthis.container.style.width = `${this.size}px`;\n\t}\n}\n\ninterface ISashItem {\n\tsash: Sash;\n\tdisposable: IDisposable;\n}\n\ninterface ISashDragSnapState {\n\treadonly index: number;\n\treadonly limitDelta: number;\n\treadonly size: number;\n}\n\ninterface ISashDragState {\n\tindex: number;\n\tstart: number;\n\tcurrent: number;\n\tsizes: number[];\n\tminDelta: number;\n\tmaxDelta: number;\n\talt: boolean;\n\tsnapBefore: ISashDragSnapState | undefined;\n\tsnapAfter: ISashDragSnapState | undefined;\n\tdisposable: IDisposable;\n}\n\nenum State {\n\tIdle,\n\tBusy\n}\n\n/**\n * When adding or removing views, uniformly distribute the entire split view space among\n * all views.\n */\nexport type DistributeSizing = { type: 'distribute' };\n\n/**\n * When adding a view, make space for it by reducing the size of another view,\n * indexed by the provided `index`.\n */\nexport type SplitSizing = { type: 'split'; index: number };\n\n/**\n * When adding a view, use DistributeSizing when all pre-existing views are\n * distributed evenly, otherwise use SplitSizing.\n */\nexport type AutoSizing = { type: 'auto'; index: number };\n\n/**\n * When adding or removing views, assume the view is invisible.\n */\nexport type InvisibleSizing = { type: 'invisible'; cachedVisibleSize: number };\n\n/**\n * When adding or removing views, the sizing provides fine grained\n * control over how other views get resized.\n */\nexport type Sizing = DistributeSizing | SplitSizing | AutoSizing | InvisibleSizing;\n\nexport namespace Sizing {\n\n\t/**\n\t * When adding or removing views, distribute the delta space among\n\t * all other views.\n\t */\n\texport const Distribute: DistributeSizing = { type: 'distribute' };\n\n\t/**\n\t * When adding or removing views, split the delta space with another\n\t * specific view, indexed by the provided `index`.\n\t */\n\texport function Split(index: number): SplitSizing { return { type: 'split', index }; }\n\n\t/**\n\t * When adding a view, use DistributeSizing when all pre-existing views are\n\t * distributed evenly, otherwise use SplitSizing.\n\t */\n\texport function Auto(index: number): AutoSizing { return { type: 'auto', index }; }\n\n\t/**\n\t * When adding or removing views, assume the view is invisible.\n\t */\n\texport function Invisible(cachedVisibleSize: number): InvisibleSizing { return { type: 'invisible', cachedVisibleSize }; }\n}\n\n/**\n * The {@link SplitView} is the UI component which implements a one dimensional\n * flex-like layout algorithm for a collection of {@link IView} instances, which\n * are essentially HTMLElement instances with the following size constraints:\n *\n * - {@link IView.minimumSize}\n * - {@link IView.maximumSize}\n * - {@link IView.priority}\n * - {@link IView.snap}\n *\n * In case the SplitView doesn't have enough size to fit all views, it will overflow\n * its content with a scrollbar.\n *\n * In between each pair of views there will be a {@link Sash} allowing the user\n * to resize the views, making sure the constraints are respected.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n *\n * Features:\n * - Flex-like layout algorithm\n * - Snap support\n * - Orthogonal sash support, for corner sashes\n * - View hide/show support\n * - View swap/move support\n * - Alt key modifier behavior, macOS style\n */\nexport class SplitView<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> extends Disposable {\n\n\t/**\n\t * This {@link SplitView}'s orientation.\n\t */\n\treadonly orientation: Orientation;\n\n\t/**\n\t * The DOM element representing this {@link SplitView}.\n\t */\n\treadonly el: HTMLElement;\n\n\tprivate sashContainer: HTMLElement;\n\tprivate viewContainer: HTMLElement;\n\tprivate scrollable: Scrollable;\n\tprivate scrollableElement: SmoothScrollableElement;\n\tprivate size = 0;\n\tprivate layoutContext: TLayoutContext | undefined;\n\tprivate _contentSize = 0;\n\tprivate proportions: (number | undefined)[] | undefined = undefined;\n\tprivate viewItems: ViewItem<TLayoutContext, TView>[] = [];\n\tsashItems: ISashItem[] = []; // used in tests\n\tprivate sashDragState: ISashDragState | undefined;\n\tprivate state: State = State.Idle;\n\tprivate inverseAltBehavior: boolean;\n\tprivate proportionalLayout: boolean;\n\tprivate readonly getSashOrthogonalSize: { (): number } | undefined;\n\n\tprivate _onDidSashChange = this._register(new Emitter<number>());\n\tprivate _onDidSashReset = this._register(new Emitter<number>());\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tprivate _orthogonalEndSash: Sash | undefined;\n\tprivate _startSnappingEnabled = true;\n\tprivate _endSnappingEnabled = true;\n\n\t/**\n\t * Fires whenever the user resizes a {@link Sash sash}.\n\t */\n\treadonly onDidSashChange = this._onDidSashChange.event;\n\n\t/**\n\t * Fires whenever the user double clicks a {@link Sash sash}.\n\t */\n\treadonly onDidSashReset = this._onDidSashReset.event;\n\n\t/**\n\t * Fires whenever the split view is scrolled.\n\t */\n\treadonly onDidScroll: Event<ScrollEvent>;\n\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\n\tget startSnappingEnabled(): boolean { return this._startSnappingEnabled; }\n\tget endSnappingEnabled(): boolean { return this._endSnappingEnabled; }\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the left- or top-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalStartSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalStartSash = sash;\n\t\t}\n\n\t\tthis._orthogonalStartSash = sash;\n\t}\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the right- or bottom-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalEndSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalEndSash = sash;\n\t\t}\n\n\t\tthis._orthogonalEndSash = sash;\n\t}\n\n\t/**\n\t * Enable/disable snapping at the beginning of this {@link SplitView}.\n\t */\n\tset startSnappingEnabled(startSnappingEnabled: boolean) {\n\t\tif (this._startSnappingEnabled === startSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startSnappingEnabled = startSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Enable/disable snapping at the end of this {@link SplitView}.\n\t */\n\tset endSnappingEnabled(endSnappingEnabled: boolean) {\n\t\tif (this._endSnappingEnabled === endSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._endSnappingEnabled = endSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Create a new {@link SplitView} instance.\n\t */\n\tconstructor(container: HTMLElement, options: ISplitViewOptions<TLayoutContext, TView> = {}) {\n\t\tsuper();\n\n\t\tthis.orientation = options.orientation ?? Orientation.VERTICAL;\n\t\tthis.inverseAltBehavior = options.inverseAltBehavior ?? false;\n\t\tthis.proportionalLayout = options.proportionalLayout ?? true;\n\t\tthis.getSashOrthogonalSize = options.getSashOrthogonalSize;\n\n\t\tthis.el = document.createElement('div');\n\t\tthis.el.classList.add('monaco-split-view2');\n\t\tthis.el.classList.add(this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal');\n\t\tcontainer.appendChild(this.el);\n\n\t\tthis.sashContainer = append(this.el, $('.sash-container'));\n\t\tthis.viewContainer = $('.split-view-container');\n\n\t\tthis.scrollable = this._register(new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration: 125,\n\t\t\tscheduleAtNextAnimationFrame: callback => scheduleAtNextAnimationFrame(getWindow(this.el), callback),\n\t\t}));\n\t\tthis.scrollableElement = this._register(new SmoothScrollableElement(this.viewContainer, {\n\t\t\tvertical: this.orientation === Orientation.VERTICAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden,\n\t\t\thorizontal: this.orientation === Orientation.HORIZONTAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden\n\t\t}, this.scrollable));\n\n\t\t// https://github.com/microsoft/vscode/issues/157737\n\t\tconst onDidScrollViewContainer = this._register(new DomEmitter(this.viewContainer, 'scroll')).event;\n\t\tthis._register(onDidScrollViewContainer(_ => {\n\t\t\tconst position = this.scrollableElement.getScrollPosition();\n\t\t\tconst scrollLeft = Math.abs(this.viewContainer.scrollLeft - position.scrollLeft) <= 1 ? undefined : this.viewContainer.scrollLeft;\n\t\t\tconst scrollTop = Math.abs(this.viewContainer.scrollTop - position.scrollTop) <= 1 ? undefined : this.viewContainer.scrollTop;\n\n\t\t\tif (scrollLeft !== undefined || scrollTop !== undefined) {\n\t\t\t\tthis.scrollableElement.setScrollPosition({ scrollLeft, scrollTop });\n\t\t\t}\n\t\t}));\n\n\t\tthis.onDidScroll = this.scrollableElement.onScroll;\n\t\tthis._register(this.onDidScroll(e => {\n\t\t\tif (e.scrollTopChanged) {\n\t\t\t\tthis.viewContainer.scrollTop = e.scrollTop;\n\t\t\t}\n\n\t\t\tif (e.scrollLeftChanged) {\n\t\t\t\tthis.viewContainer.scrollLeft = e.scrollLeft;\n\t\t\t}\n\t\t}));\n\n\t\tappend(this.el, this.scrollableElement.getDomNode());\n\n\t\tthis.style(options.styles || defaultStyles);\n\n\t\t// We have an existing set of view, add them now\n\t\tif (options.descriptor) {\n\t\t\tthis.size = options.descriptor.size;\n\t\t\toptions.descriptor.views.forEach((viewDescriptor, index) => {\n\t\t\t\tconst sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } satisfies InvisibleSizing;\n\n\t\t\t\tconst view = viewDescriptor.view;\n\t\t\t\tthis.doAddView(view, sizing, index, true);\n\t\t\t});\n\n\t\t\t// Initialize content size and proportions for first layout\n\t\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\t\tthis.saveProportions();\n\t\t}\n\t}\n\n\tstyle(styles: ISplitViewStyles): void {\n\t\tif (styles.separatorBorder.isTransparent()) {\n\t\t\tthis.el.classList.remove('separator-border');\n\t\t\tthis.el.style.removeProperty('--separator-border');\n\t\t} else {\n\t\t\tthis.el.classList.add('separator-border');\n\t\t\tthis.el.style.setProperty('--separator-border', styles.separatorBorder.toString());\n\t\t}\n\t}\n\n\t/**\n\t * Add a {@link IView view} to this {@link SplitView}.\n\t *\n\t * @param view The view to add.\n\t * @param size Either a fixed size, or a dynamic {@link Sizing} strategy.\n\t * @param index The index to insert the view on.\n\t * @param skipLayout Whether layout should be skipped.\n\t */\n\taddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tthis.doAddView(view, size, index, skipLayout);\n\t}\n\n\t/**\n\t * Layout the {@link SplitView}.\n\t *\n\t * @param size The entire size of the {@link SplitView}.\n\t * @param layoutContext An optional layout context to pass along to {@link IView views}.\n\t */\n\tlayout(size: number, layoutContext?: TLayoutContext): void {\n\t\tconst previousSize = Math.max(this.size, this._contentSize);\n\t\tthis.size = size;\n\t\tthis.layoutContext = layoutContext;\n\n\t\tif (!this.proportions) {\n\t\t\tconst indexes = range(this.viewItems.length);\n\t\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\t} else {\n\t\t\tlet total = 0;\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number') {\n\t\t\t\t\ttotal += proportion;\n\t\t\t\t} else {\n\t\t\t\t\tsize -= item.size;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number' && total > 0) {\n\t\t\t\t\titem.size = clamp(Math.round(proportion * size / total), item.minimumSize, item.maximumSize);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate saveProportions(): void {\n\t\tif (this.proportionalLayout && this._contentSize > 0) {\n\t\t\tthis.proportions = this.viewItems.map(v => v.proportionalLayout && v.visible ? v.size / this._contentSize : undefined);\n\t\t}\n\t}\n\n\tprivate onSashStart({ sash, start, alt }: ISashEvent): void {\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = false;\n\t\t}\n\n\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\n\t\t// This way, we can press Alt while we resize a sash, macOS style!\n\t\tconst disposable = combinedDisposable(\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keydown', e => resetSashDragState(this.sashDragState!.current, e.altKey)),\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keyup', () => resetSashDragState(this.sashDragState!.current, false))\n\t\t);\n\n\t\tconst resetSashDragState = (start: number, alt: boolean) => {\n\t\t\tconst sizes = this.viewItems.map(i => i.size);\n\t\t\tlet minDelta = Number.NEGATIVE_INFINITY;\n\t\t\tlet maxDelta = Number.POSITIVE_INFINITY;\n\n\t\t\tif (this.inverseAltBehavior) {\n\t\t\t\talt = !alt;\n\t\t\t}\n\n\t\t\tif (alt) {\n\t\t\t\t// When we're using the last sash with Alt, we're resizing\n\t\t\t\t// the view to the left/up, instead of right/down as usual\n\t\t\t\t// Thus, we must do the inverse of the usual\n\t\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\n\t\t\t\tif (isLastSash) {\n\t\t\t\t\tconst viewItem = this.viewItems[index];\n\t\t\t\t\tminDelta = (viewItem.minimumSize - viewItem.size) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.maximumSize - viewItem.size) / 2;\n\t\t\t\t} else {\n\t\t\t\t\tconst viewItem = this.viewItems[index + 1];\n\t\t\t\t\tminDelta = (viewItem.size - viewItem.maximumSize) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.size - viewItem.minimumSize) / 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet snapBefore: ISashDragSnapState | undefined;\n\t\t\tlet snapAfter: ISashDragSnapState | undefined;\n\n\t\t\tif (!alt) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\t\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0);\n\t\t\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown);\n\t\t\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tif (typeof snapBeforeIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapBeforeIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapBefore = {\n\t\t\t\t\t\tindex: snapBeforeIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (typeof snapAfterIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapAfterIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapAfter = {\n\t\t\t\t\t\tindex: snapAfterIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable };\n\t\t};\n\n\t\tresetSashDragState(start, alt);\n\t}\n\n\tprivate onSashChange({ current }: ISashEvent): void {\n\t\tconst { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState!;\n\t\tthis.sashDragState!.current = current;\n\n\t\tconst delta = current - start;\n\t\tconst newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter);\n\n\t\tif (alt) {\n\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\t\t\tconst newSizes = this.viewItems.map(i => i.size);\n\t\t\tconst viewItemIndex = isLastSash ? index : index + 1;\n\t\t\tconst viewItem = this.viewItems[viewItemIndex];\n\t\t\tconst newMinDelta = viewItem.size - viewItem.maximumSize;\n\t\t\tconst newMaxDelta = viewItem.size - viewItem.minimumSize;\n\t\t\tconst resizeIndex = isLastSash ? index - 1 : index + 1;\n\n\t\t\tthis.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta);\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate onSashEnd(index: number): void {\n\t\tthis._onDidSashChange.fire(index);\n\t\tthis.sashDragState!.disposable.dispose();\n\t\tthis.saveProportions();\n\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = true;\n\t\t}\n\t}\n\n\tprivate onViewChange(item: ViewItem<TLayoutContext, TView>, size: number | undefined): void {\n\t\tconst index = this.viewItems.indexOf(item);\n\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tsize = typeof size === 'number' ? size : item.size;\n\t\tsize = clamp(size, item.minimumSize, item.maximumSize);\n\n\t\tif (this.inverseAltBehavior && index > 0) {\n\t\t\t// In this case, we want the view to grow or shrink both sides equally\n\t\t\t// so we just resize the \"left\" side by half and let `resize` do the clamping magic\n\t\t\tthis.resize(index - 1, Math.floor((item.size - size) / 2));\n\t\t\tthis.distributeEmptySpace();\n\t\t\tthis.layoutViews();\n\t\t} else {\n\t\t\titem.size = size;\n\n\t\t\t// Absorb the change by layout priority, like `resizeView` does, so a neighbour with a size of its own is not squeezed (see #334167)\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t}\n\t}\n\n\t/**\n\t * Resize a {@link IView view} within the {@link SplitView}.\n\t *\n\t * @param index The {@link IView view} index.\n\t * @param size The {@link IView view} size.\n\t */\n\tresizeView(index: number, size: number): void {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tconst item = this.viewItems[index];\n\t\t\tsize = Math.round(size);\n\t\t\tsize = clamp(size, item.minimumSize, Math.min(item.maximumSize, this.size));\n\n\t\t\titem.size = size;\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\t/**\n\t * Distribute the entire {@link SplitView} size among all {@link IView views}.\n\t */\n\tdistributeViewSizes(): void {\n\t\tconst flexibleViewItems: ViewItem<TLayoutContext, TView>[] = [];\n\t\tlet flexibleSize = 0;\n\n\t\tfor (const item of this.viewItems) {\n\t\t\tif (item.maximumSize - item.minimumSize > 0) {\n\t\t\t\tflexibleViewItems.push(item);\n\t\t\t\tflexibleSize += item.size;\n\t\t\t}\n\t\t}\n\n\t\tconst size = Math.floor(flexibleSize / flexibleViewItems.length);\n\n\t\tfor (const item of flexibleViewItems) {\n\t\t\titem.size = clamp(size, item.minimumSize, item.maximumSize);\n\t\t}\n\n\t\tconst indexes = range(this.viewItems.length);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t}\n\n\t/**\n\t * Returns the size of a {@link IView view}.\n\t */\n\tgetViewSize(index: number): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn this.viewItems[index].size;\n\t}\n\n\tprivate doAddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\t// Add view\n\t\t\tconst container = $('.split-view-view');\n\n\t\t\tif (index === this.viewItems.length) {\n\t\t\t\tthis.viewContainer.appendChild(container);\n\t\t\t} else {\n\t\t\t\tthis.viewContainer.insertBefore(container, this.viewContainer.children.item(index));\n\t\t\t}\n\n\t\t\tconst onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size));\n\t\t\tconst containerDisposable = toDisposable(() => container.remove());\n\t\t\tconst disposable = combinedDisposable(onChangeDisposable, containerDisposable);\n\n\t\t\tlet viewSize: ViewItemSize;\n\n\t\t\tif (typeof size === 'number') {\n\t\t\t\tviewSize = size;\n\t\t\t} else {\n\t\t\t\tif (size.type === 'auto') {\n\t\t\t\t\tif (this.areViewsDistributed()) {\n\t\t\t\t\t\tsize = { type: 'distribute' };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsize = { type: 'split', index: size.index };\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (size.type === 'split') {\n\t\t\t\t\tviewSize = this.getViewSize(size.index) / 2;\n\t\t\t\t} else if (size.type === 'invisible') {\n\t\t\t\t\tviewSize = { cachedVisibleSize: size.cachedVisibleSize };\n\t\t\t\t} else {\n\t\t\t\t\tviewSize = view.minimumSize;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst item = this.orientation === Orientation.VERTICAL\n\t\t\t\t? new VerticalViewItem(container, view, viewSize, disposable)\n\t\t\t\t: new HorizontalViewItem(container, view, viewSize, disposable);\n\n\t\t\tthis.viewItems.splice(index, 0, item);\n\n\t\t\t// Add sash\n\t\t\tif (this.viewItems.length > 1) {\n\t\t\t\tconst opts = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash };\n\n\t\t\t\tconst sash = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? new Sash(this.sashContainer, { getHorizontalSashTop: s => this.getSashPosition(s), getHorizontalSashWidth: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.HORIZONTAL })\n\t\t\t\t\t: new Sash(this.sashContainer, { getVerticalSashLeft: s => this.getSashPosition(s), getVerticalSashHeight: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.VERTICAL });\n\n\t\t\t\tconst sashEventMapper = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey })\n\t\t\t\t\t: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey });\n\n\t\t\t\tconst onStart = Event.map(sash.onDidStart, sashEventMapper);\n\t\t\t\tconst onStartDisposable = onStart(this.onSashStart, this);\n\t\t\t\tconst onChange = Event.map(sash.onDidChange, sashEventMapper);\n\t\t\t\tconst onChangeDisposable = onChange(this.onSashChange, this);\n\t\t\t\tconst onEnd = Event.map(sash.onDidEnd, () => this.sashItems.findIndex(item => item.sash === sash));\n\t\t\t\tconst onEndDisposable = onEnd(this.onSashEnd, this);\n\n\t\t\t\tconst onDidResetDisposable = sash.onDidReset(() => {\n\t\t\t\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\t\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\t\tif (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._onDidSashReset.fire(index);\n\t\t\t\t});\n\n\t\t\t\tconst disposable = combinedDisposable(onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash);\n\t\t\t\tconst sashItem: ISashItem = { sash, disposable };\n\n\t\t\t\tthis.sashItems.splice(index - 1, 0, sashItem);\n\t\t\t}\n\n\t\t\tcontainer.appendChild(view.element);\n\n\t\t\tlet highPriorityIndexes: number[] | undefined;\n\n\t\t\tif (typeof size !== 'number' && size.type === 'split') {\n\t\t\t\thighPriorityIndexes = [size.index];\n\t\t\t}\n\n\t\t\tif (!skipLayout) {\n\t\t\t\tthis.relayout([index], highPriorityIndexes);\n\t\t\t}\n\n\n\t\t\tif (!skipLayout && typeof size !== 'number' && size.type === 'distribute') {\n\t\t\t\tthis.distributeViewSizes();\n\t\t\t}\n\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\tprivate relayout(lowPriorityIndexes?: number[], highPriorityIndexes?: number[]): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\tthis.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t\tthis.saveProportions();\n\t}\n\n\tprivate resize(\n\t\tindex: number,\n\t\tdelta: number,\n\t\tsizes = this.viewItems.map(i => i.size),\n\t\tlowPriorityIndexes?: number[],\n\t\thighPriorityIndexes?: number[],\n\t\toverloadMinDelta: number = Number.NEGATIVE_INFINITY,\n\t\toverloadMaxDelta: number = Number.POSITIVE_INFINITY,\n\t\tsnapBefore?: ISashDragSnapState,\n\t\tsnapAfter?: ISashDragSnapState\n\t): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst upIndexes = range(index, -1);\n\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\n\t\tif (highPriorityIndexes) {\n\t\t\tfor (const index of highPriorityIndexes) {\n\t\t\t\tpushToStart(upIndexes, index);\n\t\t\t\tpushToStart(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tif (lowPriorityIndexes) {\n\t\t\tfor (const index of lowPriorityIndexes) {\n\t\t\t\tpushToEnd(upIndexes, index);\n\t\t\t\tpushToEnd(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tconst upItems = upIndexes.map(i => this.viewItems[i]);\n\t\tconst upSizes = upIndexes.map(i => sizes[i]);\n\n\t\tconst downItems = downIndexes.map(i => this.viewItems[i]);\n\t\tconst downSizes = downIndexes.map(i => sizes[i]);\n\n\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0);\n\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0);\n\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta);\n\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta);\n\n\t\tlet snapped = false;\n\n\t\tif (snapBefore) {\n\t\t\tconst snapView = this.viewItems[snapBefore.index];\n\t\t\tconst visible = delta >= snapBefore.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapBefore.size);\n\t\t}\n\n\t\tif (!snapped && snapAfter) {\n\t\t\tconst snapView = this.viewItems[snapAfter.index];\n\t\t\tconst visible = delta < snapAfter.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapAfter.size);\n\t\t}\n\n\t\tif (snapped) {\n\t\t\treturn this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta);\n\t\t}\n\n\t\tdelta = clamp(delta, minDelta, maxDelta);\n\n\t\tfor (let i = 0, deltaUp = delta; i < upItems.length; i++) {\n\t\t\tconst item = upItems[i];\n\t\t\tconst size = clamp(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - upSizes[i];\n\n\t\t\tdeltaUp -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\tfor (let i = 0, deltaDown = delta; i < downItems.length; i++) {\n\t\t\tconst item = downItems[i];\n\t\t\tconst size = clamp(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - downSizes[i];\n\n\t\t\tdeltaDown += viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\tprivate distributeEmptySpace(lowPriorityIndex?: number): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\tlet emptyDelta = this.size - contentSize;\n\n\t\tconst indexes = range(this.viewItems.length - 1, -1);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tfor (const index of highPriorityIndexes) {\n\t\t\tpushToStart(indexes, index);\n\t\t}\n\n\t\tfor (const index of lowPriorityIndexes) {\n\t\t\tpushToEnd(indexes, index);\n\t\t}\n\n\t\tif (typeof lowPriorityIndex === 'number') {\n\t\t\tpushToEnd(indexes, lowPriorityIndex);\n\t\t}\n\n\t\tfor (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {\n\t\t\tconst item = this.viewItems[indexes[i]];\n\t\t\tconst size = clamp(item.size + emptyDelta, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - item.size;\n\n\t\t\temptyDelta -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\t}\n\n\tprivate layoutViews(): void {\n\t\t// Save new content size\n\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\t// Layout views\n\t\tlet offset = 0;\n\n\t\tfor (const viewItem of this.viewItems) {\n\t\t\tviewItem.layout(offset, this.layoutContext);\n\t\t\toffset += viewItem.size;\n\t\t}\n\n\t\t// Layout sashes\n\t\tthis.sashItems.forEach(item => item.sash.layout());\n\t\tthis.updateSashEnablement();\n\t\tthis.updateScrollableElement();\n\t}\n\n\tprivate updateScrollableElement(): void {\n\t\tif (this.orientation === Orientation.VERTICAL) {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\theight: this.size,\n\t\t\t\tscrollHeight: this._contentSize\n\t\t\t});\n\t\t} else {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\twidth: this.size,\n\t\t\t\tscrollWidth: this._contentSize\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate updateSashEnablement(): void {\n\t\tlet previous = false;\n\t\tconst collapsesDown = this.viewItems.map(i => previous = (i.size - i.minimumSize > 0) || previous);\n\n\t\tprevious = false;\n\t\tconst expandsDown = this.viewItems.map(i => previous = (i.maximumSize - i.size > 0) || previous);\n\n\t\tconst reverseViews = [...this.viewItems].reverse();\n\t\tprevious = false;\n\t\tconst collapsesUp = reverseViews.map(i => previous = (i.size - i.minimumSize > 0) || previous).reverse();\n\n\t\tprevious = false;\n\t\tconst expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse();\n\n\t\tlet position = 0;\n\t\tfor (let index = 0; index < this.sashItems.length; index++) {\n\t\t\tconst { sash } = this.sashItems[index];\n\t\t\tconst viewItem = this.viewItems[index];\n\t\t\tposition += viewItem.size;\n\n\t\t\tconst min = !(collapsesDown[index] && expandsUp[index + 1]);\n\t\t\tconst max = !(expandsDown[index] && collapsesUp[index + 1]);\n\n\t\t\tif (min && max) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tconst snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible;\n\t\t\t\tconst snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible;\n\n\t\t\t\tif (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t\t} else if (snappedAfter && collapsesDown[index] && (position < this._contentSize || this.endSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t\t} else {\n\t\t\t\t\tsash.state = SashState.Disabled;\n\t\t\t\t}\n\t\t\t} else if (min && !max) {\n\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t} else if (!min && max) {\n\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t} else {\n\t\t\t\tsash.state = SashState.Enabled;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getSashPosition(sash: Sash): number {\n\t\tlet position = 0;\n\n\t\tfor (let i = 0; i < this.sashItems.length; i++) {\n\t\t\tposition += this.viewItems[i].size;\n\n\t\t\tif (this.sashItems[i].sash === sash) {\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate findFirstSnapIndex(indexes: number[]): number | undefined {\n\t\t// visible views first\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (!viewItem.visible) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\t// then, hidden views\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!viewItem.visible && viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate areViewsDistributed() {\n\t\tlet min = undefined, max = undefined;\n\n\t\tfor (const view of this.viewItems) {\n\t\t\tmin = min === undefined ? view.size : Math.min(min, view.size);\n\t\t\tmax = max === undefined ? view.size : Math.max(max, view.size);\n\n\t\t\tif (max - min > 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\toverride dispose(): void {\n\t\tthis.sashDragState?.disposable.dispose();\n\n\t\tdispose(this.viewItems);\n\t\tthis.viewItems = [];\n\n\t\tthis.sashItems.forEach(i => i.disposable.dispose());\n\t\tthis.sashItems = [];\n\n\t\tsuper.dispose();\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/splitview/splitview.ts","vs/base/browser/ui/splitview/splitview.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,CAAC,EAAE,qBAAqB,EAAE,MAAM,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAA6C,IAAI,EAAa,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EA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I,CAAC,SAAS,GAAG,EAAE,CAAC;QAEpB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QAEpB,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD","file":"splitview.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener, append, getWindow, scheduleAtNextAnimationFrame } from '../../dom.js';\nimport { DomEmitter } from '../../event.js';\nimport { ISashEvent as IBaseSashEvent, Orientation, Sash, SashState } from '../sash/sash.js';\nimport { SmoothScrollableElement } from '../scrollbar/scrollableElement.js';\nimport { pushToEnd, pushToStart, range } from '../../../common/arrays.js';\nimport { Color } from '../../../common/color.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { combinedDisposable, Disposable, dispose, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { clamp } from '../../../common/numbers.js';\nimport { Scrollable, ScrollbarVisibility, ScrollEvent } from '../../../common/scrollable.js';\nimport * as types from '../../../common/types.js';\nimport './splitview.css';\nexport { Orientation } from '../sash/sash.js';\n\nexport interface ISplitViewStyles {\n\treadonly separatorBorder: Color;\n}\n\nconst defaultStyles: ISplitViewStyles = {\n\tseparatorBorder: Color.transparent\n};\n\nexport const enum LayoutPriority {\n\tNormal,\n\tLow,\n\tHigh\n}\n\n/**\n * The interface to implement for views within a {@link SplitView}.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n */\nexport interface IView<TLayoutContext = undefined> {\n\n\t/**\n\t * The DOM element for this view.\n\t */\n\treadonly element: HTMLElement;\n\n\t/**\n\t * A minimum size for this view.\n\t *\n\t * @remarks If none, set it to `0`.\n\t */\n\treadonly minimumSize: number;\n\n\t/**\n\t * A maximum size for this view.\n\t *\n\t * @remarks If none, set it to `Number.POSITIVE_INFINITY`.\n\t */\n\treadonly maximumSize: number;\n\n\t/**\n\t * The priority of the view when the {@link SplitView.resize layout} algorithm\n\t * runs. Views with higher priority will be resized first.\n\t *\n\t * @remarks Only used when `proportionalLayout` is false.\n\t */\n\treadonly priority?: LayoutPriority;\n\n\t/**\n\t * If the {@link SplitView} supports {@link ISplitViewOptions.proportionalLayout proportional layout},\n\t * this property allows for finer control over the proportional layout algorithm, per view.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * Whether this view's layout depends only on the most recent size and\n\t * context it received. When every view of a {@link SplitView} sets this,\n\t * an intermediate layout that is immediately superseded can be skipped.\n\t *\n\t * @remarks Views with nested layout state, such as nested split views,\n\t * must not set this.\n\t *\n\t * @defaultValue `false`\n\t */\n\treadonly pathIndependentLayout?: boolean;\n\n\t/**\n\t * Whether the view will snap whenever the user reaches its minimum size or\n\t * attempts to grow it beyond the minimum size.\n\t *\n\t * @defaultValue `false`\n\t */\n\treadonly snap?: boolean;\n\n\t/**\n\t * View instances are supposed to fire the {@link IView.onDidChange} event whenever\n\t * any of the constraint properties have changed:\n\t *\n\t * - {@link IView.minimumSize}\n\t * - {@link IView.maximumSize}\n\t * - {@link IView.priority}\n\t * - {@link IView.snap}\n\t *\n\t * The SplitView will relayout whenever that happens. The event can optionally emit\n\t * the view's preferred size for that relayout.\n\t */\n\treadonly onDidChange: Event<number | undefined>;\n\n\t/**\n\t * This will be called by the {@link SplitView} during layout. A view meant to\n\t * pass along the layout information down to its descendants.\n\t *\n\t * @param size The size of this view, in pixels.\n\t * @param offset The offset of this view, relative to the start of the {@link SplitView}.\n\t * @param context The optional {@link IView layout context} passed to {@link SplitView.layout}.\n\t */\n\tlayout(size: number, offset: number, context: TLayoutContext | undefined): void;\n\n\t/**\n\t * This will be called by the {@link SplitView} whenever this view is made\n\t * visible or hidden.\n\t *\n\t * @param visible Whether the view becomes visible.\n\t */\n\tsetVisible?(visible: boolean): void;\n}\n\n/**\n * A descriptor for a {@link SplitView} instance.\n */\nexport interface ISplitViewDescriptor<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * The layout size of the {@link SplitView}.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Descriptors for each {@link IView view}.\n\t */\n\treadonly views: {\n\n\t\t/**\n\t\t * Whether the {@link IView view} is visible.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly visible?: boolean;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly size: number;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly view: TView;\n\t}[];\n}\n\nexport interface ISplitViewOptions<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * Which axis the views align on.\n\t *\n\t * @defaultValue `Orientation.VERTICAL`\n\t */\n\treadonly orientation?: Orientation;\n\n\t/**\n\t * Styles overriding the {@link defaultStyles default ones}.\n\t */\n\treadonly styles?: ISplitViewStyles;\n\n\t/**\n\t * Make Alt-drag the default drag operation.\n\t */\n\treadonly inverseAltBehavior?: boolean;\n\n\t/**\n\t * Resize each view proportionally when resizing the SplitView.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * An initial description of this {@link SplitView} instance, allowing\n\t * to initialze all views within the ctor.\n\t */\n\treadonly descriptor?: ISplitViewDescriptor<TLayoutContext, TView>;\n\n\t/**\n\t * The scrollbar visibility setting for whenever the views within\n\t * the {@link SplitView} overflow.\n\t */\n\treadonly scrollbarVisibility?: ScrollbarVisibility;\n\n\t/**\n\t * Override the orthogonal size of sashes.\n\t */\n\treadonly getSashOrthogonalSize?: () => number;\n}\n\ninterface ISashEvent {\n\treadonly sash: Sash;\n\treadonly start: number;\n\treadonly current: number;\n\treadonly alt: boolean;\n}\n\ntype ViewItemSize = number | { cachedVisibleSize: number };\n\nabstract class ViewItem<TLayoutContext, TView extends IView<TLayoutContext>> {\n\n\tprivate _size: number;\n\tset size(size: number) {\n\t\tthis._size = size;\n\t}\n\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\tprivate _cachedVisibleSize: number | undefined = undefined;\n\n\tget visible(): boolean {\n\t\treturn typeof this._cachedVisibleSize === 'undefined';\n\t}\n\n\tsetVisible(visible: boolean, size?: number): void {\n\t\tif (visible === this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (visible) {\n\t\t\tthis.size = clamp(this._cachedVisibleSize!, this.viewMinimumSize, this.viewMaximumSize);\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t} else {\n\t\t\tthis._cachedVisibleSize = typeof size === 'number' ? size : this.size;\n\t\t\tthis.size = 0;\n\t\t}\n\n\t\tthis.container.classList.toggle('visible', visible);\n\n\t\ttry {\n\t\t\tthis.view.setVisible?.(visible);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to set visible view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tget minimumSize(): number { return this.visible ? this.view.minimumSize : 0; }\n\tget viewMinimumSize(): number { return this.view.minimumSize; }\n\n\tget maximumSize(): number { return this.visible ? this.view.maximumSize : 0; }\n\tget viewMaximumSize(): number { return this.view.maximumSize; }\n\n\tget priority(): LayoutPriority | undefined { return this.view.priority; }\n\tget proportionalLayout(): boolean { return this.view.proportionalLayout ?? true; }\n\tget snap(): boolean { return !!this.view.snap; }\n\n\tset enabled(enabled: boolean) {\n\t\tthis.container.style.pointerEvents = enabled ? '' : 'none';\n\t}\n\n\tconstructor(\n\t\tprotected container: HTMLElement,\n\t\treadonly view: TView,\n\t\tsize: ViewItemSize,\n\t\tprivate disposable: IDisposable\n\t) {\n\t\tif (typeof size === 'number') {\n\t\t\tthis._size = size;\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t\tcontainer.classList.add('visible');\n\t\t} else {\n\t\t\tthis._size = 0;\n\t\t\tthis._cachedVisibleSize = size.cachedVisibleSize;\n\t\t}\n\t}\n\n\tlayout(offset: number, layoutContext: TLayoutContext | undefined): void {\n\t\tthis.layoutContainer(offset);\n\n\t\ttry {\n\t\t\tthis.view.layout(this.size, offset, layoutContext);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to layout view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tabstract layoutContainer(offset: number): void;\n\n\tdispose(): void {\n\t\tthis.disposable.dispose();\n\t}\n}\n\nclass VerticalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.top = `${offset}px`;\n\t\tthis.container.style.height = `${this.size}px`;\n\t}\n}\n\nclass HorizontalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.left = `${offset}px`;\n\t\tthis.container.style.width = `${this.size}px`;\n\t}\n}\n\ninterface ISashItem {\n\tsash: Sash;\n\tdisposable: IDisposable;\n}\n\ninterface ISashDragSnapState {\n\treadonly index: number;\n\treadonly limitDelta: number;\n\treadonly size: number;\n}\n\ninterface ISashDragState {\n\tindex: number;\n\tstart: number;\n\tcurrent: number;\n\tsizes: number[];\n\tminDelta: number;\n\tmaxDelta: number;\n\talt: boolean;\n\tsnapBefore: ISashDragSnapState | undefined;\n\tsnapAfter: ISashDragSnapState | undefined;\n\tdisposable: IDisposable;\n}\n\nenum State {\n\tIdle,\n\tBusy\n}\n\n/**\n * When adding or removing views, uniformly distribute the entire split view space among\n * all views.\n */\nexport type DistributeSizing = { type: 'distribute' };\n\n/**\n * When adding a view, make space for it by reducing the size of another view,\n * indexed by the provided `index`.\n */\nexport type SplitSizing = { type: 'split'; index: number };\n\n/**\n * When adding a view, use DistributeSizing when all pre-existing views are\n * distributed evenly, otherwise use SplitSizing.\n */\nexport type AutoSizing = { type: 'auto'; index: number };\n\n/**\n * When adding or removing views, assume the view is invisible.\n */\nexport type InvisibleSizing = { type: 'invisible'; cachedVisibleSize: number };\n\n/**\n * When adding or removing views, the sizing provides fine grained\n * control over how other views get resized.\n */\nexport type Sizing = DistributeSizing | SplitSizing | AutoSizing | InvisibleSizing;\n\nexport namespace Sizing {\n\n\t/**\n\t * When adding or removing views, distribute the delta space among\n\t * all other views.\n\t */\n\texport const Distribute: DistributeSizing = { type: 'distribute' };\n\n\t/**\n\t * When adding or removing views, split the delta space with another\n\t * specific view, indexed by the provided `index`.\n\t */\n\texport function Split(index: number): SplitSizing { return { type: 'split', index }; }\n\n\t/**\n\t * When adding a view, use DistributeSizing when all pre-existing views are\n\t * distributed evenly, otherwise use SplitSizing.\n\t */\n\texport function Auto(index: number): AutoSizing { return { type: 'auto', index }; }\n\n\t/**\n\t * When adding or removing views, assume the view is invisible.\n\t */\n\texport function Invisible(cachedVisibleSize: number): InvisibleSizing { return { type: 'invisible', cachedVisibleSize }; }\n}\n\n/**\n * The {@link SplitView} is the UI component which implements a one dimensional\n * flex-like layout algorithm for a collection of {@link IView} instances, which\n * are essentially HTMLElement instances with the following size constraints:\n *\n * - {@link IView.minimumSize}\n * - {@link IView.maximumSize}\n * - {@link IView.priority}\n * - {@link IView.snap}\n *\n * In case the SplitView doesn't have enough size to fit all views, it will overflow\n * its content with a scrollbar.\n *\n * In between each pair of views there will be a {@link Sash} allowing the user\n * to resize the views, making sure the constraints are respected.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n *\n * Features:\n * - Flex-like layout algorithm\n * - Snap support\n * - Orthogonal sash support, for corner sashes\n * - View hide/show support\n * - View swap/move support\n * - Alt key modifier behavior, macOS style\n */\nexport class SplitView<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> extends Disposable {\n\n\t/**\n\t * This {@link SplitView}'s orientation.\n\t */\n\treadonly orientation: Orientation;\n\n\t/**\n\t * The DOM element representing this {@link SplitView}.\n\t */\n\treadonly el: HTMLElement;\n\n\tprivate sashContainer: HTMLElement;\n\tprivate viewContainer: HTMLElement;\n\tprivate scrollable: Scrollable;\n\tprivate scrollableElement: SmoothScrollableElement;\n\tprivate size = 0;\n\tprivate layoutContext: TLayoutContext | undefined;\n\tprivate _contentSize = 0;\n\tprivate proportions: (number | undefined)[] | undefined = undefined;\n\tprivate viewItems: ViewItem<TLayoutContext, TView>[] = [];\n\tsashItems: ISashItem[] = []; // used in tests\n\tprivate sashDragState: ISashDragState | undefined;\n\tprivate state: State = State.Idle;\n\tprivate inverseAltBehavior: boolean;\n\tprivate proportionalLayout: boolean;\n\tprivate readonly getSashOrthogonalSize: { (): number } | undefined;\n\n\tprivate _onDidSashChange = this._register(new Emitter<number>());\n\tprivate _onDidSashReset = this._register(new Emitter<number>());\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tprivate _orthogonalEndSash: Sash | undefined;\n\tprivate _startSnappingEnabled = true;\n\tprivate _endSnappingEnabled = true;\n\n\t/**\n\t * Fires whenever the user resizes a {@link Sash sash}.\n\t */\n\treadonly onDidSashChange = this._onDidSashChange.event;\n\n\t/**\n\t * Fires whenever the user double clicks a {@link Sash sash}.\n\t */\n\treadonly onDidSashReset = this._onDidSashReset.event;\n\n\t/**\n\t * Fires whenever the split view is scrolled.\n\t */\n\treadonly onDidScroll: Event<ScrollEvent>;\n\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\n\tget startSnappingEnabled(): boolean { return this._startSnappingEnabled; }\n\tget endSnappingEnabled(): boolean { return this._endSnappingEnabled; }\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the left- or top-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalStartSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalStartSash = sash;\n\t\t}\n\n\t\tthis._orthogonalStartSash = sash;\n\t}\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the right- or bottom-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalEndSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalEndSash = sash;\n\t\t}\n\n\t\tthis._orthogonalEndSash = sash;\n\t}\n\n\t/**\n\t * Enable/disable snapping at the beginning of this {@link SplitView}.\n\t */\n\tset startSnappingEnabled(startSnappingEnabled: boolean) {\n\t\tif (this._startSnappingEnabled === startSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startSnappingEnabled = startSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Enable/disable snapping at the end of this {@link SplitView}.\n\t */\n\tset endSnappingEnabled(endSnappingEnabled: boolean) {\n\t\tif (this._endSnappingEnabled === endSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._endSnappingEnabled = endSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Create a new {@link SplitView} instance.\n\t */\n\tconstructor(container: HTMLElement, options: ISplitViewOptions<TLayoutContext, TView> = {}) {\n\t\tsuper();\n\n\t\tthis.orientation = options.orientation ?? Orientation.VERTICAL;\n\t\tthis.inverseAltBehavior = options.inverseAltBehavior ?? false;\n\t\tthis.proportionalLayout = options.proportionalLayout ?? true;\n\t\tthis.getSashOrthogonalSize = options.getSashOrthogonalSize;\n\n\t\tthis.el = document.createElement('div');\n\t\tthis.el.classList.add('monaco-split-view2');\n\t\tthis.el.classList.add(this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal');\n\t\tcontainer.appendChild(this.el);\n\n\t\tthis.sashContainer = append(this.el, $('.sash-container'));\n\t\tthis.viewContainer = $('.split-view-container');\n\n\t\tthis.scrollable = this._register(new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration: 125,\n\t\t\tscheduleAtNextAnimationFrame: callback => scheduleAtNextAnimationFrame(getWindow(this.el), callback),\n\t\t}));\n\t\tthis.scrollableElement = this._register(new SmoothScrollableElement(this.viewContainer, {\n\t\t\tvertical: this.orientation === Orientation.VERTICAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden,\n\t\t\thorizontal: this.orientation === Orientation.HORIZONTAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden\n\t\t}, this.scrollable));\n\n\t\t// https://github.com/microsoft/vscode/issues/157737\n\t\tconst onDidScrollViewContainer = this._register(new DomEmitter(this.viewContainer, 'scroll')).event;\n\t\tthis._register(onDidScrollViewContainer(_ => {\n\t\t\tconst position = this.scrollableElement.getScrollPosition();\n\t\t\tconst scrollLeft = Math.abs(this.viewContainer.scrollLeft - position.scrollLeft) <= 1 ? undefined : this.viewContainer.scrollLeft;\n\t\t\tconst scrollTop = Math.abs(this.viewContainer.scrollTop - position.scrollTop) <= 1 ? undefined : this.viewContainer.scrollTop;\n\n\t\t\tif (scrollLeft !== undefined || scrollTop !== undefined) {\n\t\t\t\tthis.scrollableElement.setScrollPosition({ scrollLeft, scrollTop });\n\t\t\t}\n\t\t}));\n\n\t\tthis.onDidScroll = this.scrollableElement.onScroll;\n\t\tthis._register(this.onDidScroll(e => {\n\t\t\tif (e.scrollTopChanged) {\n\t\t\t\tthis.viewContainer.scrollTop = e.scrollTop;\n\t\t\t}\n\n\t\t\tif (e.scrollLeftChanged) {\n\t\t\t\tthis.viewContainer.scrollLeft = e.scrollLeft;\n\t\t\t}\n\t\t}));\n\n\t\tappend(this.el, this.scrollableElement.getDomNode());\n\n\t\tthis.style(options.styles || defaultStyles);\n\n\t\t// We have an existing set of view, add them now\n\t\tif (options.descriptor) {\n\t\t\tthis.size = options.descriptor.size;\n\t\t\toptions.descriptor.views.forEach((viewDescriptor, index) => {\n\t\t\t\tconst sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } satisfies InvisibleSizing;\n\n\t\t\t\tconst view = viewDescriptor.view;\n\t\t\t\tthis.doAddView(view, sizing, index, true);\n\t\t\t});\n\n\t\t\t// Initialize content size and proportions for first layout\n\t\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\t\tthis.saveProportions();\n\t\t}\n\t}\n\n\tstyle(styles: ISplitViewStyles): void {\n\t\tif (styles.separatorBorder.isTransparent()) {\n\t\t\tthis.el.classList.remove('separator-border');\n\t\t\tthis.el.style.removeProperty('--separator-border');\n\t\t} else {\n\t\t\tthis.el.classList.add('separator-border');\n\t\t\tthis.el.style.setProperty('--separator-border', styles.separatorBorder.toString());\n\t\t}\n\t}\n\n\t/**\n\t * Add a {@link IView view} to this {@link SplitView}.\n\t *\n\t * @param view The view to add.\n\t * @param size Either a fixed size, or a dynamic {@link Sizing} strategy.\n\t * @param index The index to insert the view on.\n\t * @param skipLayout Whether layout should be skipped.\n\t */\n\taddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tthis.doAddView(view, size, index, skipLayout);\n\t}\n\n\t/**\n\t * Layout the {@link SplitView}.\n\t *\n\t * @param size The entire size of the {@link SplitView}.\n\t * @param layoutContext An optional layout context to pass along to {@link IView views}.\n\t */\n\tlayout(size: number, layoutContext?: TLayoutContext): void {\n\t\tconst previousSize = Math.max(this.size, this._contentSize);\n\t\tthis.size = size;\n\t\tthis.layoutContext = layoutContext;\n\n\t\tif (!this.proportions) {\n\t\t\tconst indexes = range(this.viewItems.length);\n\t\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\t} else {\n\t\t\tlet total = 0;\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number') {\n\t\t\t\t\ttotal += proportion;\n\t\t\t\t} else {\n\t\t\t\t\tsize -= item.size;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number' && total > 0) {\n\t\t\t\t\titem.size = clamp(Math.round(proportion * size / total), item.minimumSize, item.maximumSize);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate saveProportions(): void {\n\t\tif (this.proportionalLayout && this._contentSize > 0) {\n\t\t\tthis.proportions = this.viewItems.map(v => v.proportionalLayout && v.visible ? v.size / this._contentSize : undefined);\n\t\t}\n\t}\n\n\tprivate onSashStart({ sash, start, alt }: ISashEvent): void {\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = false;\n\t\t}\n\n\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\n\t\t// This way, we can press Alt while we resize a sash, macOS style!\n\t\tconst disposable = combinedDisposable(\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keydown', e => resetSashDragState(this.sashDragState!.current, e.altKey)),\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keyup', () => resetSashDragState(this.sashDragState!.current, false))\n\t\t);\n\n\t\tconst resetSashDragState = (start: number, alt: boolean) => {\n\t\t\tconst sizes = this.viewItems.map(i => i.size);\n\t\t\tlet minDelta = Number.NEGATIVE_INFINITY;\n\t\t\tlet maxDelta = Number.POSITIVE_INFINITY;\n\n\t\t\tif (this.inverseAltBehavior) {\n\t\t\t\talt = !alt;\n\t\t\t}\n\n\t\t\tif (alt) {\n\t\t\t\t// When we're using the last sash with Alt, we're resizing\n\t\t\t\t// the view to the left/up, instead of right/down as usual\n\t\t\t\t// Thus, we must do the inverse of the usual\n\t\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\n\t\t\t\tif (isLastSash) {\n\t\t\t\t\tconst viewItem = this.viewItems[index];\n\t\t\t\t\tminDelta = (viewItem.minimumSize - viewItem.size) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.maximumSize - viewItem.size) / 2;\n\t\t\t\t} else {\n\t\t\t\t\tconst viewItem = this.viewItems[index + 1];\n\t\t\t\t\tminDelta = (viewItem.size - viewItem.maximumSize) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.size - viewItem.minimumSize) / 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet snapBefore: ISashDragSnapState | undefined;\n\t\t\tlet snapAfter: ISashDragSnapState | undefined;\n\n\t\t\tif (!alt) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\t\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0);\n\t\t\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown);\n\t\t\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tif (typeof snapBeforeIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapBeforeIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapBefore = {\n\t\t\t\t\t\tindex: snapBeforeIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (typeof snapAfterIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapAfterIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapAfter = {\n\t\t\t\t\t\tindex: snapAfterIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable };\n\t\t};\n\n\t\tresetSashDragState(start, alt);\n\t}\n\n\tprivate onSashChange({ current }: ISashEvent): void {\n\t\tconst { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState!;\n\t\tthis.sashDragState!.current = current;\n\n\t\tconst delta = current - start;\n\t\tconst newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter);\n\n\t\tif (alt) {\n\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\t\t\tconst newSizes = this.viewItems.map(i => i.size);\n\t\t\tconst viewItemIndex = isLastSash ? index : index + 1;\n\t\t\tconst viewItem = this.viewItems[viewItemIndex];\n\t\t\tconst newMinDelta = viewItem.size - viewItem.maximumSize;\n\t\t\tconst newMaxDelta = viewItem.size - viewItem.minimumSize;\n\t\t\tconst resizeIndex = isLastSash ? index - 1 : index + 1;\n\n\t\t\tthis.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta);\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate onSashEnd(index: number): void {\n\t\tthis._onDidSashChange.fire(index);\n\t\tthis.sashDragState!.disposable.dispose();\n\t\tthis.saveProportions();\n\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = true;\n\t\t}\n\t}\n\n\tprivate onViewChange(item: ViewItem<TLayoutContext, TView>, size: number | undefined): void {\n\t\tconst index = this.viewItems.indexOf(item);\n\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tsize = typeof size === 'number' ? size : item.size;\n\t\tsize = clamp(size, item.minimumSize, item.maximumSize);\n\n\t\tif (this.inverseAltBehavior && index > 0) {\n\t\t\t// In this case, we want the view to grow or shrink both sides equally\n\t\t\t// so we just resize the \"left\" side by half and let `resize` do the clamping magic\n\t\t\tthis.resize(index - 1, Math.floor((item.size - size) / 2));\n\t\t\tthis.distributeEmptySpace();\n\t\t\tthis.layoutViews();\n\t\t} else {\n\t\t\titem.size = size;\n\n\t\t\t// Absorb the change by layout priority, like `resizeView` does, so a neighbour with a size of its own is not squeezed (see #334167)\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t}\n\t}\n\n\t/**\n\t * Resize a {@link IView view} within the {@link SplitView}.\n\t *\n\t * @param index The {@link IView view} index.\n\t * @param size The {@link IView view} size.\n\t */\n\tresizeView(index: number, size: number): void {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tconst item = this.viewItems[index];\n\t\t\tsize = Math.round(size);\n\t\t\tsize = clamp(size, item.minimumSize, Math.min(item.maximumSize, this.size));\n\n\t\t\titem.size = size;\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\t/**\n\t * Distribute the entire {@link SplitView} size among all {@link IView views}.\n\t */\n\tdistributeViewSizes(): void {\n\t\tconst flexibleViewItems: ViewItem<TLayoutContext, TView>[] = [];\n\t\tlet flexibleSize = 0;\n\n\t\tfor (const item of this.viewItems) {\n\t\t\tif (item.maximumSize - item.minimumSize > 0) {\n\t\t\t\tflexibleViewItems.push(item);\n\t\t\t\tflexibleSize += item.size;\n\t\t\t}\n\t\t}\n\n\t\tconst size = Math.floor(flexibleSize / flexibleViewItems.length);\n\n\t\tfor (const item of flexibleViewItems) {\n\t\t\titem.size = clamp(size, item.minimumSize, item.maximumSize);\n\t\t}\n\n\t\tconst indexes = range(this.viewItems.length);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t}\n\n\t/**\n\t * Returns the size of a {@link IView view}.\n\t */\n\tgetViewSize(index: number): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn this.viewItems[index].size;\n\t}\n\n\tprivate doAddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\t// Add view\n\t\t\tconst container = $('.split-view-view');\n\n\t\t\tif (index === this.viewItems.length) {\n\t\t\t\tthis.viewContainer.appendChild(container);\n\t\t\t} else {\n\t\t\t\tthis.viewContainer.insertBefore(container, this.viewContainer.children.item(index));\n\t\t\t}\n\n\t\t\tconst onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size));\n\t\t\tconst containerDisposable = toDisposable(() => container.remove());\n\t\t\tconst disposable = combinedDisposable(onChangeDisposable, containerDisposable);\n\n\t\t\tlet viewSize: ViewItemSize;\n\n\t\t\tif (typeof size === 'number') {\n\t\t\t\tviewSize = size;\n\t\t\t} else {\n\t\t\t\tif (size.type === 'auto') {\n\t\t\t\t\tif (this.areViewsDistributed()) {\n\t\t\t\t\t\tsize = { type: 'distribute' };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsize = { type: 'split', index: size.index };\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (size.type === 'split') {\n\t\t\t\t\tviewSize = this.getViewSize(size.index) / 2;\n\t\t\t\t} else if (size.type === 'invisible') {\n\t\t\t\t\tviewSize = { cachedVisibleSize: size.cachedVisibleSize };\n\t\t\t\t} else {\n\t\t\t\t\tviewSize = view.minimumSize;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst item = this.orientation === Orientation.VERTICAL\n\t\t\t\t? new VerticalViewItem(container, view, viewSize, disposable)\n\t\t\t\t: new HorizontalViewItem(container, view, viewSize, disposable);\n\n\t\t\tthis.viewItems.splice(index, 0, item);\n\n\t\t\t// Add sash\n\t\t\tif (this.viewItems.length > 1) {\n\t\t\t\tconst opts = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash };\n\n\t\t\t\tconst sash = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? new Sash(this.sashContainer, { getHorizontalSashTop: s => this.getSashPosition(s), getHorizontalSashWidth: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.HORIZONTAL })\n\t\t\t\t\t: new Sash(this.sashContainer, { getVerticalSashLeft: s => this.getSashPosition(s), getVerticalSashHeight: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.VERTICAL });\n\n\t\t\t\tconst sashEventMapper = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey })\n\t\t\t\t\t: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey });\n\n\t\t\t\tconst onStart = Event.map(sash.onDidStart, sashEventMapper);\n\t\t\t\tconst onStartDisposable = onStart(this.onSashStart, this);\n\t\t\t\tconst onChange = Event.map(sash.onDidChange, sashEventMapper);\n\t\t\t\tconst onChangeDisposable = onChange(this.onSashChange, this);\n\t\t\t\tconst onEnd = Event.map(sash.onDidEnd, () => this.sashItems.findIndex(item => item.sash === sash));\n\t\t\t\tconst onEndDisposable = onEnd(this.onSashEnd, this);\n\n\t\t\t\tconst onDidResetDisposable = sash.onDidReset(() => {\n\t\t\t\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\t\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\t\tif (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._onDidSashReset.fire(index);\n\t\t\t\t});\n\n\t\t\t\tconst disposable = combinedDisposable(onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash);\n\t\t\t\tconst sashItem: ISashItem = { sash, disposable };\n\n\t\t\t\tthis.sashItems.splice(index - 1, 0, sashItem);\n\t\t\t}\n\n\t\t\tcontainer.appendChild(view.element);\n\n\t\t\tlet highPriorityIndexes: number[] | undefined;\n\n\t\t\tif (typeof size !== 'number' && size.type === 'split') {\n\t\t\t\thighPriorityIndexes = [size.index];\n\t\t\t}\n\n\t\t\tif (!skipLayout) {\n\t\t\t\tconst distribute = typeof size !== 'number' && size.type === 'distribute';\n\t\t\t\tthis.relayout([index], highPriorityIndexes, distribute);\n\t\t\t\tif (distribute) {\n\t\t\t\t\tthis.distributeViewSizes();\n\t\t\t\t}\n\t\t\t}\n\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\tprivate relayout(lowPriorityIndexes?: number[], highPriorityIndexes?: number[], skipLayout = false): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\tthis.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\tthis.distributeEmptySpace();\n\t\t// The caller lays the views out again, unless a view depends on this intermediate layout.\n\t\tif (!skipLayout || !this.viewItems.every(item => item.view.pathIndependentLayout)) {\n\t\t\tthis.layoutViews();\n\t\t\tthis.saveProportions();\n\t\t}\n\t}\n\n\tprivate resize(\n\t\tindex: number,\n\t\tdelta: number,\n\t\tsizes = this.viewItems.map(i => i.size),\n\t\tlowPriorityIndexes?: number[],\n\t\thighPriorityIndexes?: number[],\n\t\toverloadMinDelta: number = Number.NEGATIVE_INFINITY,\n\t\toverloadMaxDelta: number = Number.POSITIVE_INFINITY,\n\t\tsnapBefore?: ISashDragSnapState,\n\t\tsnapAfter?: ISashDragSnapState\n\t): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst upIndexes = range(index, -1);\n\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\n\t\tif (highPriorityIndexes) {\n\t\t\tfor (const index of highPriorityIndexes) {\n\t\t\t\tpushToStart(upIndexes, index);\n\t\t\t\tpushToStart(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tif (lowPriorityIndexes) {\n\t\t\tfor (const index of lowPriorityIndexes) {\n\t\t\t\tpushToEnd(upIndexes, index);\n\t\t\t\tpushToEnd(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tconst upItems = upIndexes.map(i => this.viewItems[i]);\n\t\tconst upSizes = upIndexes.map(i => sizes[i]);\n\n\t\tconst downItems = downIndexes.map(i => this.viewItems[i]);\n\t\tconst downSizes = downIndexes.map(i => sizes[i]);\n\n\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0);\n\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0);\n\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta);\n\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta);\n\n\t\tlet snapped = false;\n\n\t\tif (snapBefore) {\n\t\t\tconst snapView = this.viewItems[snapBefore.index];\n\t\t\tconst visible = delta >= snapBefore.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapBefore.size);\n\t\t}\n\n\t\tif (!snapped && snapAfter) {\n\t\t\tconst snapView = this.viewItems[snapAfter.index];\n\t\t\tconst visible = delta < snapAfter.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapAfter.size);\n\t\t}\n\n\t\tif (snapped) {\n\t\t\treturn this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta);\n\t\t}\n\n\t\tdelta = clamp(delta, minDelta, maxDelta);\n\n\t\tfor (let i = 0, deltaUp = delta; i < upItems.length; i++) {\n\t\t\tconst item = upItems[i];\n\t\t\tconst size = clamp(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - upSizes[i];\n\n\t\t\tdeltaUp -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\tfor (let i = 0, deltaDown = delta; i < downItems.length; i++) {\n\t\t\tconst item = downItems[i];\n\t\t\tconst size = clamp(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - downSizes[i];\n\n\t\t\tdeltaDown += viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\tprivate distributeEmptySpace(lowPriorityIndex?: number): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\tlet emptyDelta = this.size - contentSize;\n\n\t\tconst indexes = range(this.viewItems.length - 1, -1);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tfor (const index of highPriorityIndexes) {\n\t\t\tpushToStart(indexes, index);\n\t\t}\n\n\t\tfor (const index of lowPriorityIndexes) {\n\t\t\tpushToEnd(indexes, index);\n\t\t}\n\n\t\tif (typeof lowPriorityIndex === 'number') {\n\t\t\tpushToEnd(indexes, lowPriorityIndex);\n\t\t}\n\n\t\tfor (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {\n\t\t\tconst item = this.viewItems[indexes[i]];\n\t\t\tconst size = clamp(item.size + emptyDelta, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - item.size;\n\n\t\t\temptyDelta -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\t}\n\n\tprivate layoutViews(): void {\n\t\t// Save new content size\n\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\t// Layout views\n\t\tlet offset = 0;\n\n\t\tfor (const viewItem of this.viewItems) {\n\t\t\tviewItem.layout(offset, this.layoutContext);\n\t\t\toffset += viewItem.size;\n\t\t}\n\n\t\t// Layout sashes\n\t\tthis.sashItems.forEach(item => item.sash.layout());\n\t\tthis.updateSashEnablement();\n\t\tthis.updateScrollableElement();\n\t}\n\n\tprivate updateScrollableElement(): void {\n\t\tif (this.orientation === Orientation.VERTICAL) {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\theight: this.size,\n\t\t\t\tscrollHeight: this._contentSize\n\t\t\t});\n\t\t} else {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\twidth: this.size,\n\t\t\t\tscrollWidth: this._contentSize\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate updateSashEnablement(): void {\n\t\tlet previous = false;\n\t\tconst collapsesDown = this.viewItems.map(i => previous = (i.size - i.minimumSize > 0) || previous);\n\n\t\tprevious = false;\n\t\tconst expandsDown = this.viewItems.map(i => previous = (i.maximumSize - i.size > 0) || previous);\n\n\t\tconst reverseViews = [...this.viewItems].reverse();\n\t\tprevious = false;\n\t\tconst collapsesUp = reverseViews.map(i => previous = (i.size - i.minimumSize > 0) || previous).reverse();\n\n\t\tprevious = false;\n\t\tconst expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse();\n\n\t\tlet position = 0;\n\t\tfor (let index = 0; index < this.sashItems.length; index++) {\n\t\t\tconst { sash } = this.sashItems[index];\n\t\t\tconst viewItem = this.viewItems[index];\n\t\t\tposition += viewItem.size;\n\n\t\t\tconst min = !(collapsesDown[index] && expandsUp[index + 1]);\n\t\t\tconst max = !(expandsDown[index] && collapsesUp[index + 1]);\n\n\t\t\tif (min && max) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tconst snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible;\n\t\t\t\tconst snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible;\n\n\t\t\t\tif (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t\t} else if (snappedAfter && collapsesDown[index] && (position < this._contentSize || this.endSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t\t} else {\n\t\t\t\t\tsash.state = SashState.Disabled;\n\t\t\t\t}\n\t\t\t} else if (min && !max) {\n\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t} else if (!min && max) {\n\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t} else {\n\t\t\t\tsash.state = SashState.Enabled;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getSashPosition(sash: Sash): number {\n\t\tlet position = 0;\n\n\t\tfor (let i = 0; i < this.sashItems.length; i++) {\n\t\t\tposition += this.viewItems[i].size;\n\n\t\t\tif (this.sashItems[i].sash === sash) {\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate findFirstSnapIndex(indexes: number[]): number | undefined {\n\t\t// visible views first\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (!viewItem.visible) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\t// then, hidden views\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!viewItem.visible && viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate areViewsDistributed() {\n\t\tlet min = undefined, max = undefined;\n\n\t\tfor (const view of this.viewItems) {\n\t\t\tmin = min === undefined ? view.size : Math.min(min, view.size);\n\t\t\tmax = max === undefined ? view.size : Math.max(max, view.size);\n\n\t\t\tif (max - min > 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\toverride dispose(): void {\n\t\tthis.sashDragState?.disposable.dispose();\n\n\t\tdispose(this.viewItems);\n\t\tthis.viewItems = [];\n\n\t\tthis.sashItems.forEach(i => i.disposable.dispose());\n\t\tthis.sashItems = [];\n\n\t\tsuper.dispose();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener, append, getWindow, scheduleAtNextAnimationFrame } from '../../dom.js';\nimport { DomEmitter } from '../../event.js';\nimport { ISashEvent as IBaseSashEvent, Orientation, Sash, SashState } from '../sash/sash.js';\nimport { SmoothScrollableElement } from '../scrollbar/scrollableElement.js';\nimport { pushToEnd, pushToStart, range } from '../../../common/arrays.js';\nimport { Color } from '../../../common/color.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { combinedDisposable, Disposable, dispose, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { clamp } from '../../../common/numbers.js';\nimport { Scrollable, ScrollbarVisibility, ScrollEvent } from '../../../common/scrollable.js';\nimport * as types from '../../../common/types.js';\nimport './splitview.css';\nexport { Orientation } from '../sash/sash.js';\n\nexport interface ISplitViewStyles {\n\treadonly separatorBorder: Color;\n}\n\nconst defaultStyles: ISplitViewStyles = {\n\tseparatorBorder: Color.transparent\n};\n\nexport const enum LayoutPriority {\n\tNormal,\n\tLow,\n\tHigh\n}\n\n/**\n * The interface to implement for views within a {@link SplitView}.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n */\nexport interface IView<TLayoutContext = undefined> {\n\n\t/**\n\t * The DOM element for this view.\n\t */\n\treadonly element: HTMLElement;\n\n\t/**\n\t * A minimum size for this view.\n\t *\n\t * @remarks If none, set it to `0`.\n\t */\n\treadonly minimumSize: number;\n\n\t/**\n\t * A maximum size for this view.\n\t *\n\t * @remarks If none, set it to `Number.POSITIVE_INFINITY`.\n\t */\n\treadonly maximumSize: number;\n\n\t/**\n\t * The priority of the view when the {@link SplitView.resize layout} algorithm\n\t * runs. Views with higher priority will be resized first.\n\t *\n\t * @remarks Only used when `proportionalLayout` is false.\n\t */\n\treadonly priority?: LayoutPriority;\n\n\t/**\n\t * If the {@link SplitView} supports {@link ISplitViewOptions.proportionalLayout proportional layout},\n\t * this property allows for finer control over the proportional layout algorithm, per view.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * Whether this view's layout depends only on the most recent size and\n\t * context it received. When every view of a {@link SplitView} sets this,\n\t * an intermediate layout that is immediately superseded can be skipped.\n\t *\n\t * @remarks Views with nested layout state, such as nested split views,\n\t * must not set this.\n\t *\n\t * @defaultValue `false`\n\t */\n\treadonly pathIndependentLayout?: boolean;\n\n\t/**\n\t * Whether the view will snap whenever the user reaches its minimum size or\n\t * attempts to grow it beyond the minimum size.\n\t *\n\t * @defaultValue `false`\n\t */\n\treadonly snap?: boolean;\n\n\t/**\n\t * View instances are supposed to fire the {@link IView.onDidChange} event whenever\n\t * any of the constraint properties have changed:\n\t *\n\t * - {@link IView.minimumSize}\n\t * - {@link IView.maximumSize}\n\t * - {@link IView.priority}\n\t * - {@link IView.snap}\n\t *\n\t * The SplitView will relayout whenever that happens. The event can optionally emit\n\t * the view's preferred size for that relayout.\n\t */\n\treadonly onDidChange: Event<number | undefined>;\n\n\t/**\n\t * This will be called by the {@link SplitView} during layout. A view meant to\n\t * pass along the layout information down to its descendants.\n\t *\n\t * @param size The size of this view, in pixels.\n\t * @param offset The offset of this view, relative to the start of the {@link SplitView}.\n\t * @param context The optional {@link IView layout context} passed to {@link SplitView.layout}.\n\t */\n\tlayout(size: number, offset: number, context: TLayoutContext | undefined): void;\n\n\t/**\n\t * This will be called by the {@link SplitView} whenever this view is made\n\t * visible or hidden.\n\t *\n\t * @param visible Whether the view becomes visible.\n\t */\n\tsetVisible?(visible: boolean): void;\n}\n\n/**\n * A descriptor for a {@link SplitView} instance.\n */\nexport interface ISplitViewDescriptor<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * The layout size of the {@link SplitView}.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Descriptors for each {@link IView view}.\n\t */\n\treadonly views: {\n\n\t\t/**\n\t\t * Whether the {@link IView view} is visible.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly visible?: boolean;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly size: number;\n\n\t\t/**\n\t\t * The size of the {@link IView view}.\n\t\t *\n\t\t * @defaultValue `true`\n\t\t */\n\t\treadonly view: TView;\n\t}[];\n}\n\nexport interface ISplitViewOptions<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {\n\n\t/**\n\t * Which axis the views align on.\n\t *\n\t * @defaultValue `Orientation.VERTICAL`\n\t */\n\treadonly orientation?: Orientation;\n\n\t/**\n\t * Styles overriding the {@link defaultStyles default ones}.\n\t */\n\treadonly styles?: ISplitViewStyles;\n\n\t/**\n\t * Make Alt-drag the default drag operation.\n\t */\n\treadonly inverseAltBehavior?: boolean;\n\n\t/**\n\t * Resize each view proportionally when resizing the SplitView.\n\t *\n\t * @defaultValue `true`\n\t */\n\treadonly proportionalLayout?: boolean;\n\n\t/**\n\t * An initial description of this {@link SplitView} instance, allowing\n\t * to initialze all views within the ctor.\n\t */\n\treadonly descriptor?: ISplitViewDescriptor<TLayoutContext, TView>;\n\n\t/**\n\t * The scrollbar visibility setting for whenever the views within\n\t * the {@link SplitView} overflow.\n\t */\n\treadonly scrollbarVisibility?: ScrollbarVisibility;\n\n\t/**\n\t * Override the orthogonal size of sashes.\n\t */\n\treadonly getSashOrthogonalSize?: () => number;\n}\n\ninterface ISashEvent {\n\treadonly sash: Sash;\n\treadonly start: number;\n\treadonly current: number;\n\treadonly alt: boolean;\n}\n\ntype ViewItemSize = number | { cachedVisibleSize: number };\n\nabstract class ViewItem<TLayoutContext, TView extends IView<TLayoutContext>> {\n\n\tprivate _size: number;\n\tset size(size: number) {\n\t\tthis._size = size;\n\t}\n\n\tget size(): number {\n\t\treturn this._size;\n\t}\n\n\tprivate _cachedVisibleSize: number | undefined = undefined;\n\n\tget visible(): boolean {\n\t\treturn typeof this._cachedVisibleSize === 'undefined';\n\t}\n\n\tsetVisible(visible: boolean, size?: number): void {\n\t\tif (visible === this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (visible) {\n\t\t\tthis.size = clamp(this._cachedVisibleSize!, this.viewMinimumSize, this.viewMaximumSize);\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t} else {\n\t\t\tthis._cachedVisibleSize = typeof size === 'number' ? size : this.size;\n\t\t\tthis.size = 0;\n\t\t}\n\n\t\tthis.container.classList.toggle('visible', visible);\n\n\t\ttry {\n\t\t\tthis.view.setVisible?.(visible);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to set visible view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tget minimumSize(): number { return this.visible ? this.view.minimumSize : 0; }\n\tget viewMinimumSize(): number { return this.view.minimumSize; }\n\n\tget maximumSize(): number { return this.visible ? this.view.maximumSize : 0; }\n\tget viewMaximumSize(): number { return this.view.maximumSize; }\n\n\tget priority(): LayoutPriority | undefined { return this.view.priority; }\n\tget proportionalLayout(): boolean { return this.view.proportionalLayout ?? true; }\n\tget snap(): boolean { return !!this.view.snap; }\n\n\tset enabled(enabled: boolean) {\n\t\tthis.container.style.pointerEvents = enabled ? '' : 'none';\n\t}\n\n\tconstructor(\n\t\tprotected container: HTMLElement,\n\t\treadonly view: TView,\n\t\tsize: ViewItemSize,\n\t\tprivate disposable: IDisposable\n\t) {\n\t\tif (typeof size === 'number') {\n\t\t\tthis._size = size;\n\t\t\tthis._cachedVisibleSize = undefined;\n\t\t\tcontainer.classList.add('visible');\n\t\t} else {\n\t\t\tthis._size = 0;\n\t\t\tthis._cachedVisibleSize = size.cachedVisibleSize;\n\t\t}\n\t}\n\n\tlayout(offset: number, layoutContext: TLayoutContext | undefined): void {\n\t\tthis.layoutContainer(offset);\n\n\t\ttry {\n\t\t\tthis.view.layout(this.size, offset, layoutContext);\n\t\t} catch (e) {\n\t\t\tconsole.error('Splitview: Failed to layout view');\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tabstract layoutContainer(offset: number): void;\n\n\tdispose(): void {\n\t\tthis.disposable.dispose();\n\t}\n}\n\nclass VerticalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.top = `${offset}px`;\n\t\tthis.container.style.height = `${this.size}px`;\n\t}\n}\n\nclass HorizontalViewItem<TLayoutContext, TView extends IView<TLayoutContext>> extends ViewItem<TLayoutContext, TView> {\n\n\tlayoutContainer(offset: number): void {\n\t\tthis.container.style.left = `${offset}px`;\n\t\tthis.container.style.width = `${this.size}px`;\n\t}\n}\n\ninterface ISashItem {\n\tsash: Sash;\n\tdisposable: IDisposable;\n}\n\ninterface ISashDragSnapState {\n\treadonly index: number;\n\treadonly limitDelta: number;\n\treadonly size: number;\n}\n\ninterface ISashDragState {\n\tindex: number;\n\tstart: number;\n\tcurrent: number;\n\tsizes: number[];\n\tminDelta: number;\n\tmaxDelta: number;\n\talt: boolean;\n\tsnapBefore: ISashDragSnapState | undefined;\n\tsnapAfter: ISashDragSnapState | undefined;\n\tdisposable: IDisposable;\n}\n\nenum State {\n\tIdle,\n\tBusy\n}\n\n/**\n * When adding or removing views, uniformly distribute the entire split view space among\n * all views.\n */\nexport type DistributeSizing = { type: 'distribute' };\n\n/**\n * When adding a view, make space for it by reducing the size of another view,\n * indexed by the provided `index`.\n */\nexport type SplitSizing = { type: 'split'; index: number };\n\n/**\n * When adding a view, use DistributeSizing when all pre-existing views are\n * distributed evenly, otherwise use SplitSizing.\n */\nexport type AutoSizing = { type: 'auto'; index: number };\n\n/**\n * When adding or removing views, assume the view is invisible.\n */\nexport type InvisibleSizing = { type: 'invisible'; cachedVisibleSize: number };\n\n/**\n * When adding or removing views, the sizing provides fine grained\n * control over how other views get resized.\n */\nexport type Sizing = DistributeSizing | SplitSizing | AutoSizing | InvisibleSizing;\n\nexport namespace Sizing {\n\n\t/**\n\t * When adding or removing views, distribute the delta space among\n\t * all other views.\n\t */\n\texport const Distribute: DistributeSizing = { type: 'distribute' };\n\n\t/**\n\t * When adding or removing views, split the delta space with another\n\t * specific view, indexed by the provided `index`.\n\t */\n\texport function Split(index: number): SplitSizing { return { type: 'split', index }; }\n\n\t/**\n\t * When adding a view, use DistributeSizing when all pre-existing views are\n\t * distributed evenly, otherwise use SplitSizing.\n\t */\n\texport function Auto(index: number): AutoSizing { return { type: 'auto', index }; }\n\n\t/**\n\t * When adding or removing views, assume the view is invisible.\n\t */\n\texport function Invisible(cachedVisibleSize: number): InvisibleSizing { return { type: 'invisible', cachedVisibleSize }; }\n}\n\n/**\n * The {@link SplitView} is the UI component which implements a one dimensional\n * flex-like layout algorithm for a collection of {@link IView} instances, which\n * are essentially HTMLElement instances with the following size constraints:\n *\n * - {@link IView.minimumSize}\n * - {@link IView.maximumSize}\n * - {@link IView.priority}\n * - {@link IView.snap}\n *\n * In case the SplitView doesn't have enough size to fit all views, it will overflow\n * its content with a scrollbar.\n *\n * In between each pair of views there will be a {@link Sash} allowing the user\n * to resize the views, making sure the constraints are respected.\n *\n * An optional {@link TLayoutContext layout context type} may be used in order to\n * pass along layout contextual data from the {@link SplitView.layout} method down\n * to each view's {@link IView.layout} calls.\n *\n * Features:\n * - Flex-like layout algorithm\n * - Snap support\n * - Orthogonal sash support, for corner sashes\n * - View hide/show support\n * - View swap/move support\n * - Alt key modifier behavior, macOS style\n */\nexport class SplitView<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> extends Disposable {\n\n\t/**\n\t * This {@link SplitView}'s orientation.\n\t */\n\treadonly orientation: Orientation;\n\n\t/**\n\t * The DOM element representing this {@link SplitView}.\n\t */\n\treadonly el: HTMLElement;\n\n\tprivate sashContainer: HTMLElement;\n\tprivate viewContainer: HTMLElement;\n\tprivate scrollable: Scrollable;\n\tprivate scrollableElement: SmoothScrollableElement;\n\tprivate size = 0;\n\tprivate layoutContext: TLayoutContext | undefined;\n\tprivate _contentSize = 0;\n\tprivate proportions: (number | undefined)[] | undefined = undefined;\n\tprivate viewItems: ViewItem<TLayoutContext, TView>[] = [];\n\tsashItems: ISashItem[] = []; // used in tests\n\tprivate sashDragState: ISashDragState | undefined;\n\tprivate state: State = State.Idle;\n\tprivate inverseAltBehavior: boolean;\n\tprivate proportionalLayout: boolean;\n\tprivate readonly getSashOrthogonalSize: { (): number } | undefined;\n\n\tprivate _onDidSashChange = this._register(new Emitter<number>());\n\tprivate _onDidSashReset = this._register(new Emitter<number>());\n\tprivate _orthogonalStartSash: Sash | undefined;\n\tprivate _orthogonalEndSash: Sash | undefined;\n\tprivate _startSnappingEnabled = true;\n\tprivate _endSnappingEnabled = true;\n\n\t/**\n\t * Fires whenever the user resizes a {@link Sash sash}.\n\t */\n\treadonly onDidSashChange = this._onDidSashChange.event;\n\n\t/**\n\t * Fires whenever the user double clicks a {@link Sash sash}.\n\t */\n\treadonly onDidSashReset = this._onDidSashReset.event;\n\n\t/**\n\t * Fires whenever the split view is scrolled.\n\t */\n\treadonly onDidScroll: Event<ScrollEvent>;\n\n\tget orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }\n\tget orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }\n\tget startSnappingEnabled(): boolean { return this._startSnappingEnabled; }\n\tget endSnappingEnabled(): boolean { return this._endSnappingEnabled; }\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the left- or top-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalStartSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalStartSash = sash;\n\t\t}\n\n\t\tthis._orthogonalStartSash = sash;\n\t}\n\n\t/**\n\t * A reference to a sash, perpendicular to all sashes in this {@link SplitView},\n\t * located at the right- or bottom-most side of the SplitView.\n\t * Corner sashes will be created automatically at the intersections.\n\t */\n\tset orthogonalEndSash(sash: Sash | undefined) {\n\t\tfor (const sashItem of this.sashItems) {\n\t\t\tsashItem.sash.orthogonalEndSash = sash;\n\t\t}\n\n\t\tthis._orthogonalEndSash = sash;\n\t}\n\n\t/**\n\t * Enable/disable snapping at the beginning of this {@link SplitView}.\n\t */\n\tset startSnappingEnabled(startSnappingEnabled: boolean) {\n\t\tif (this._startSnappingEnabled === startSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._startSnappingEnabled = startSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Enable/disable snapping at the end of this {@link SplitView}.\n\t */\n\tset endSnappingEnabled(endSnappingEnabled: boolean) {\n\t\tif (this._endSnappingEnabled === endSnappingEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._endSnappingEnabled = endSnappingEnabled;\n\t\tthis.updateSashEnablement();\n\t}\n\n\t/**\n\t * Create a new {@link SplitView} instance.\n\t */\n\tconstructor(container: HTMLElement, options: ISplitViewOptions<TLayoutContext, TView> = {}) {\n\t\tsuper();\n\n\t\tthis.orientation = options.orientation ?? Orientation.VERTICAL;\n\t\tthis.inverseAltBehavior = options.inverseAltBehavior ?? false;\n\t\tthis.proportionalLayout = options.proportionalLayout ?? true;\n\t\tthis.getSashOrthogonalSize = options.getSashOrthogonalSize;\n\n\t\tthis.el = document.createElement('div');\n\t\tthis.el.classList.add('monaco-split-view2');\n\t\tthis.el.classList.add(this.orientation === Orientation.VERTICAL ? 'vertical' : 'horizontal');\n\t\tcontainer.appendChild(this.el);\n\n\t\tthis.sashContainer = append(this.el, $('.sash-container'));\n\t\tthis.viewContainer = $('.split-view-container');\n\n\t\tthis.scrollable = this._register(new Scrollable({\n\t\t\tforceIntegerValues: true,\n\t\t\tsmoothScrollDuration: 125,\n\t\t\tscheduleAtNextAnimationFrame: callback => scheduleAtNextAnimationFrame(getWindow(this.el), callback),\n\t\t}));\n\t\tthis.scrollableElement = this._register(new SmoothScrollableElement(this.viewContainer, {\n\t\t\tvertical: this.orientation === Orientation.VERTICAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden,\n\t\t\thorizontal: this.orientation === Orientation.HORIZONTAL ? (options.scrollbarVisibility ?? ScrollbarVisibility.Auto) : ScrollbarVisibility.Hidden\n\t\t}, this.scrollable));\n\n\t\t// https://github.com/microsoft/vscode/issues/157737\n\t\tconst onDidScrollViewContainer = this._register(new DomEmitter(this.viewContainer, 'scroll')).event;\n\t\tthis._register(onDidScrollViewContainer(_ => {\n\t\t\tconst position = this.scrollableElement.getScrollPosition();\n\t\t\tconst scrollLeft = Math.abs(this.viewContainer.scrollLeft - position.scrollLeft) <= 1 ? undefined : this.viewContainer.scrollLeft;\n\t\t\tconst scrollTop = Math.abs(this.viewContainer.scrollTop - position.scrollTop) <= 1 ? undefined : this.viewContainer.scrollTop;\n\n\t\t\tif (scrollLeft !== undefined || scrollTop !== undefined) {\n\t\t\t\tthis.scrollableElement.setScrollPosition({ scrollLeft, scrollTop });\n\t\t\t}\n\t\t}));\n\n\t\tthis.onDidScroll = this.scrollableElement.onScroll;\n\t\tthis._register(this.onDidScroll(e => {\n\t\t\tif (e.scrollTopChanged) {\n\t\t\t\tthis.viewContainer.scrollTop = e.scrollTop;\n\t\t\t}\n\n\t\t\tif (e.scrollLeftChanged) {\n\t\t\t\tthis.viewContainer.scrollLeft = e.scrollLeft;\n\t\t\t}\n\t\t}));\n\n\t\tappend(this.el, this.scrollableElement.getDomNode());\n\n\t\tthis.style(options.styles || defaultStyles);\n\n\t\t// We have an existing set of view, add them now\n\t\tif (options.descriptor) {\n\t\t\tthis.size = options.descriptor.size;\n\t\t\toptions.descriptor.views.forEach((viewDescriptor, index) => {\n\t\t\t\tconst sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } satisfies InvisibleSizing;\n\n\t\t\t\tconst view = viewDescriptor.view;\n\t\t\t\tthis.doAddView(view, sizing, index, true);\n\t\t\t});\n\n\t\t\t// Initialize content size and proportions for first layout\n\t\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\t\tthis.saveProportions();\n\t\t}\n\t}\n\n\tstyle(styles: ISplitViewStyles): void {\n\t\tif (styles.separatorBorder.isTransparent()) {\n\t\t\tthis.el.classList.remove('separator-border');\n\t\t\tthis.el.style.removeProperty('--separator-border');\n\t\t} else {\n\t\t\tthis.el.classList.add('separator-border');\n\t\t\tthis.el.style.setProperty('--separator-border', styles.separatorBorder.toString());\n\t\t}\n\t}\n\n\t/**\n\t * Add a {@link IView view} to this {@link SplitView}.\n\t *\n\t * @param view The view to add.\n\t * @param size Either a fixed size, or a dynamic {@link Sizing} strategy.\n\t * @param index The index to insert the view on.\n\t * @param skipLayout Whether layout should be skipped.\n\t */\n\taddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tthis.doAddView(view, size, index, skipLayout);\n\t}\n\n\t/**\n\t * Layout the {@link SplitView}.\n\t *\n\t * @param size The entire size of the {@link SplitView}.\n\t * @param layoutContext An optional layout context to pass along to {@link IView views}.\n\t */\n\tlayout(size: number, layoutContext?: TLayoutContext): void {\n\t\tconst previousSize = Math.max(this.size, this._contentSize);\n\t\tthis.size = size;\n\t\tthis.layoutContext = layoutContext;\n\n\t\tif (!this.proportions) {\n\t\t\tconst indexes = range(this.viewItems.length);\n\t\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\t} else {\n\t\t\tlet total = 0;\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number') {\n\t\t\t\t\ttotal += proportion;\n\t\t\t\t} else {\n\t\t\t\t\tsize -= item.size;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < this.viewItems.length; i++) {\n\t\t\t\tconst item = this.viewItems[i];\n\t\t\t\tconst proportion = this.proportions[i];\n\n\t\t\t\tif (typeof proportion === 'number' && total > 0) {\n\t\t\t\t\titem.size = clamp(Math.round(proportion * size / total), item.minimumSize, item.maximumSize);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate saveProportions(): void {\n\t\tif (this.proportionalLayout && this._contentSize > 0) {\n\t\t\tthis.proportions = this.viewItems.map(v => v.proportionalLayout && v.visible ? v.size / this._contentSize : undefined);\n\t\t}\n\t}\n\n\tprivate onSashStart({ sash, start, alt }: ISashEvent): void {\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = false;\n\t\t}\n\n\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\n\t\t// This way, we can press Alt while we resize a sash, macOS style!\n\t\tconst disposable = combinedDisposable(\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keydown', e => resetSashDragState(this.sashDragState!.current, e.altKey)),\n\t\t\taddDisposableListener(this.el.ownerDocument.body, 'keyup', () => resetSashDragState(this.sashDragState!.current, false))\n\t\t);\n\n\t\tconst resetSashDragState = (start: number, alt: boolean) => {\n\t\t\tconst sizes = this.viewItems.map(i => i.size);\n\t\t\tlet minDelta = Number.NEGATIVE_INFINITY;\n\t\t\tlet maxDelta = Number.POSITIVE_INFINITY;\n\n\t\t\tif (this.inverseAltBehavior) {\n\t\t\t\talt = !alt;\n\t\t\t}\n\n\t\t\tif (alt) {\n\t\t\t\t// When we're using the last sash with Alt, we're resizing\n\t\t\t\t// the view to the left/up, instead of right/down as usual\n\t\t\t\t// Thus, we must do the inverse of the usual\n\t\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\n\t\t\t\tif (isLastSash) {\n\t\t\t\t\tconst viewItem = this.viewItems[index];\n\t\t\t\t\tminDelta = (viewItem.minimumSize - viewItem.size) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.maximumSize - viewItem.size) / 2;\n\t\t\t\t} else {\n\t\t\t\t\tconst viewItem = this.viewItems[index + 1];\n\t\t\t\t\tminDelta = (viewItem.size - viewItem.maximumSize) / 2;\n\t\t\t\t\tmaxDelta = (viewItem.size - viewItem.minimumSize) / 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet snapBefore: ISashDragSnapState | undefined;\n\t\t\tlet snapAfter: ISashDragSnapState | undefined;\n\n\t\t\tif (!alt) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0);\n\t\t\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\t\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0);\n\t\t\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown);\n\t\t\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tif (typeof snapBeforeIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapBeforeIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapBefore = {\n\t\t\t\t\t\tindex: snapBeforeIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tif (typeof snapAfterIndex === 'number') {\n\t\t\t\t\tconst viewItem = this.viewItems[snapAfterIndex];\n\t\t\t\t\tconst halfSize = Math.floor(viewItem.viewMinimumSize / 2);\n\n\t\t\t\t\tsnapAfter = {\n\t\t\t\t\t\tindex: snapAfterIndex,\n\t\t\t\t\t\tlimitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize,\n\t\t\t\t\t\tsize: viewItem.size\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable };\n\t\t};\n\n\t\tresetSashDragState(start, alt);\n\t}\n\n\tprivate onSashChange({ current }: ISashEvent): void {\n\t\tconst { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState!;\n\t\tthis.sashDragState!.current = current;\n\n\t\tconst delta = current - start;\n\t\tconst newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter);\n\n\t\tif (alt) {\n\t\t\tconst isLastSash = index === this.sashItems.length - 1;\n\t\t\tconst newSizes = this.viewItems.map(i => i.size);\n\t\t\tconst viewItemIndex = isLastSash ? index : index + 1;\n\t\t\tconst viewItem = this.viewItems[viewItemIndex];\n\t\t\tconst newMinDelta = viewItem.size - viewItem.maximumSize;\n\t\t\tconst newMaxDelta = viewItem.size - viewItem.minimumSize;\n\t\t\tconst resizeIndex = isLastSash ? index - 1 : index + 1;\n\n\t\t\tthis.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta);\n\t\t}\n\n\t\tthis.distributeEmptySpace();\n\t\tthis.layoutViews();\n\t}\n\n\tprivate onSashEnd(index: number): void {\n\t\tthis._onDidSashChange.fire(index);\n\t\tthis.sashDragState!.disposable.dispose();\n\t\tthis.saveProportions();\n\n\t\tfor (const item of this.viewItems) {\n\t\t\titem.enabled = true;\n\t\t}\n\t}\n\n\tprivate onViewChange(item: ViewItem<TLayoutContext, TView>, size: number | undefined): void {\n\t\tconst index = this.viewItems.indexOf(item);\n\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tsize = typeof size === 'number' ? size : item.size;\n\t\tsize = clamp(size, item.minimumSize, item.maximumSize);\n\n\t\tif (this.inverseAltBehavior && index > 0) {\n\t\t\t// In this case, we want the view to grow or shrink both sides equally\n\t\t\t// so we just resize the \"left\" side by half and let `resize` do the clamping magic\n\t\t\tthis.resize(index - 1, Math.floor((item.size - size) / 2));\n\t\t\tthis.distributeEmptySpace();\n\t\t\tthis.layoutViews();\n\t\t} else {\n\t\t\titem.size = size;\n\n\t\t\t// Absorb the change by layout priority, like `resizeView` does, so a neighbour with a size of its own is not squeezed (see #334167)\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t}\n\t}\n\n\t/**\n\t * Resize a {@link IView view} within the {@link SplitView}.\n\t *\n\t * @param index The {@link IView view} index.\n\t * @param size The {@link IView view} size.\n\t */\n\tresizeView(index: number, size: number): void {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\tconst indexes = range(this.viewItems.length).filter(i => i !== index);\n\t\t\tconst lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low), index];\n\t\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\t\tconst item = this.viewItems[index];\n\t\t\tsize = Math.round(size);\n\t\t\tsize = clamp(size, item.minimumSize, Math.min(item.maximumSize, this.size));\n\n\t\t\titem.size = size;\n\t\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\t/**\n\t * Distribute the entire {@link SplitView} size among all {@link IView views}.\n\t */\n\tdistributeViewSizes(): void {\n\t\tconst flexibleViewItems: ViewItem<TLayoutContext, TView>[] = [];\n\t\tlet flexibleSize = 0;\n\n\t\tfor (const item of this.viewItems) {\n\t\t\tif (item.maximumSize - item.minimumSize > 0) {\n\t\t\t\tflexibleViewItems.push(item);\n\t\t\t\tflexibleSize += item.size;\n\t\t\t}\n\t\t}\n\n\t\tconst size = Math.floor(flexibleSize / flexibleViewItems.length);\n\n\t\tfor (const item of flexibleViewItems) {\n\t\t\titem.size = clamp(size, item.minimumSize, item.maximumSize);\n\t\t}\n\n\t\tconst indexes = range(this.viewItems.length);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tthis.relayout(lowPriorityIndexes, highPriorityIndexes);\n\t}\n\n\t/**\n\t * Returns the size of a {@link IView view}.\n\t */\n\tgetViewSize(index: number): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn this.viewItems[index].size;\n\t}\n\n\tprivate doAddView(view: TView, size: number | Sizing, index = this.viewItems.length, skipLayout?: boolean): void {\n\t\tif (this.state !== State.Idle) {\n\t\t\tthrow new Error('Cant modify splitview');\n\t\t}\n\n\t\tthis.state = State.Busy;\n\n\t\ttry {\n\t\t\t// Add view\n\t\t\tconst container = $('.split-view-view');\n\n\t\t\tif (index === this.viewItems.length) {\n\t\t\t\tthis.viewContainer.appendChild(container);\n\t\t\t} else {\n\t\t\t\tthis.viewContainer.insertBefore(container, this.viewContainer.children.item(index));\n\t\t\t}\n\n\t\t\tconst onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size));\n\t\t\tconst containerDisposable = toDisposable(() => container.remove());\n\t\t\tconst disposable = combinedDisposable(onChangeDisposable, containerDisposable);\n\n\t\t\tlet viewSize: ViewItemSize;\n\n\t\t\tif (typeof size === 'number') {\n\t\t\t\tviewSize = size;\n\t\t\t} else {\n\t\t\t\tif (size.type === 'auto') {\n\t\t\t\t\tif (this.areViewsDistributed()) {\n\t\t\t\t\t\tsize = { type: 'distribute' };\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsize = { type: 'split', index: size.index };\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (size.type === 'split') {\n\t\t\t\t\tviewSize = this.getViewSize(size.index) / 2;\n\t\t\t\t} else if (size.type === 'invisible') {\n\t\t\t\t\tviewSize = { cachedVisibleSize: size.cachedVisibleSize };\n\t\t\t\t} else {\n\t\t\t\t\tviewSize = view.minimumSize;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst item = this.orientation === Orientation.VERTICAL\n\t\t\t\t? new VerticalViewItem(container, view, viewSize, disposable)\n\t\t\t\t: new HorizontalViewItem(container, view, viewSize, disposable);\n\n\t\t\tthis.viewItems.splice(index, 0, item);\n\n\t\t\t// Add sash\n\t\t\tif (this.viewItems.length > 1) {\n\t\t\t\tconst opts = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash };\n\n\t\t\t\tconst sash = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? new Sash(this.sashContainer, { getHorizontalSashTop: s => this.getSashPosition(s), getHorizontalSashWidth: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.HORIZONTAL })\n\t\t\t\t\t: new Sash(this.sashContainer, { getVerticalSashLeft: s => this.getSashPosition(s), getVerticalSashHeight: this.getSashOrthogonalSize }, { ...opts, orientation: Orientation.VERTICAL });\n\n\t\t\t\tconst sashEventMapper = this.orientation === Orientation.VERTICAL\n\t\t\t\t\t? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey })\n\t\t\t\t\t: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey });\n\n\t\t\t\tconst onStart = Event.map(sash.onDidStart, sashEventMapper);\n\t\t\t\tconst onStartDisposable = onStart(this.onSashStart, this);\n\t\t\t\tconst onChange = Event.map(sash.onDidChange, sashEventMapper);\n\t\t\t\tconst onChangeDisposable = onChange(this.onSashChange, this);\n\t\t\t\tconst onEnd = Event.map(sash.onDidEnd, () => this.sashItems.findIndex(item => item.sash === sash));\n\t\t\t\tconst onEndDisposable = onEnd(this.onSashEnd, this);\n\n\t\t\t\tconst onDidResetDisposable = sash.onDidReset(() => {\n\t\t\t\t\tconst index = this.sashItems.findIndex(item => item.sash === sash);\n\t\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\t\tif (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._onDidSashReset.fire(index);\n\t\t\t\t});\n\n\t\t\t\tconst disposable = combinedDisposable(onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash);\n\t\t\t\tconst sashItem: ISashItem = { sash, disposable };\n\n\t\t\t\tthis.sashItems.splice(index - 1, 0, sashItem);\n\t\t\t}\n\n\t\t\tcontainer.appendChild(view.element);\n\n\t\t\tlet highPriorityIndexes: number[] | undefined;\n\n\t\t\tif (typeof size !== 'number' && size.type === 'split') {\n\t\t\t\thighPriorityIndexes = [size.index];\n\t\t\t}\n\n\t\t\tif (!skipLayout) {\n\t\t\t\tconst distribute = typeof size !== 'number' && size.type === 'distribute';\n\t\t\t\tthis.relayout([index], highPriorityIndexes, distribute);\n\t\t\t\tif (distribute) {\n\t\t\t\t\tthis.distributeViewSizes();\n\t\t\t\t}\n\t\t\t}\n\n\t\t} finally {\n\t\t\tthis.state = State.Idle;\n\t\t}\n\t}\n\n\tprivate relayout(lowPriorityIndexes?: number[], highPriorityIndexes?: number[], skipLayout = false): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\tthis.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndexes, highPriorityIndexes);\n\t\tthis.distributeEmptySpace();\n\t\t// The caller lays the views out again, unless a view depends on this intermediate layout.\n\t\tif (!skipLayout || !this.viewItems.every(item => item.view.pathIndependentLayout)) {\n\t\t\tthis.layoutViews();\n\t\t\tthis.saveProportions();\n\t\t}\n\t}\n\n\tprivate resize(\n\t\tindex: number,\n\t\tdelta: number,\n\t\tsizes = this.viewItems.map(i => i.size),\n\t\tlowPriorityIndexes?: number[],\n\t\thighPriorityIndexes?: number[],\n\t\toverloadMinDelta: number = Number.NEGATIVE_INFINITY,\n\t\toverloadMaxDelta: number = Number.POSITIVE_INFINITY,\n\t\tsnapBefore?: ISashDragSnapState,\n\t\tsnapAfter?: ISashDragSnapState\n\t): number {\n\t\tif (index < 0 || index >= this.viewItems.length) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tconst upIndexes = range(index, -1);\n\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\n\t\tif (highPriorityIndexes) {\n\t\t\tfor (const index of highPriorityIndexes) {\n\t\t\t\tpushToStart(upIndexes, index);\n\t\t\t\tpushToStart(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tif (lowPriorityIndexes) {\n\t\t\tfor (const index of lowPriorityIndexes) {\n\t\t\t\tpushToEnd(upIndexes, index);\n\t\t\t\tpushToEnd(downIndexes, index);\n\t\t\t}\n\t\t}\n\n\t\tconst upItems = upIndexes.map(i => this.viewItems[i]);\n\t\tconst upSizes = upIndexes.map(i => sizes[i]);\n\n\t\tconst downItems = downIndexes.map(i => this.viewItems[i]);\n\t\tconst downSizes = downIndexes.map(i => sizes[i]);\n\n\t\tconst minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0);\n\t\tconst maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0);\n\t\tconst maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0);\n\t\tconst minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0);\n\t\tconst minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta);\n\t\tconst maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta);\n\n\t\tlet snapped = false;\n\n\t\tif (snapBefore) {\n\t\t\tconst snapView = this.viewItems[snapBefore.index];\n\t\t\tconst visible = delta >= snapBefore.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapBefore.size);\n\t\t}\n\n\t\tif (!snapped && snapAfter) {\n\t\t\tconst snapView = this.viewItems[snapAfter.index];\n\t\t\tconst visible = delta < snapAfter.limitDelta;\n\t\t\tsnapped = visible !== snapView.visible;\n\t\t\tsnapView.setVisible(visible, snapAfter.size);\n\t\t}\n\n\t\tif (snapped) {\n\t\t\treturn this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta);\n\t\t}\n\n\t\tdelta = clamp(delta, minDelta, maxDelta);\n\n\t\tfor (let i = 0, deltaUp = delta; i < upItems.length; i++) {\n\t\t\tconst item = upItems[i];\n\t\t\tconst size = clamp(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - upSizes[i];\n\n\t\t\tdeltaUp -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\tfor (let i = 0, deltaDown = delta; i < downItems.length; i++) {\n\t\t\tconst item = downItems[i];\n\t\t\tconst size = clamp(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - downSizes[i];\n\n\t\t\tdeltaDown += viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\n\t\treturn delta;\n\t}\n\n\tprivate distributeEmptySpace(lowPriorityIndex?: number): void {\n\t\tconst contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\t\tlet emptyDelta = this.size - contentSize;\n\n\t\tconst indexes = range(this.viewItems.length - 1, -1);\n\t\tconst lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.Low);\n\t\tconst highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === LayoutPriority.High);\n\n\t\tfor (const index of highPriorityIndexes) {\n\t\t\tpushToStart(indexes, index);\n\t\t}\n\n\t\tfor (const index of lowPriorityIndexes) {\n\t\t\tpushToEnd(indexes, index);\n\t\t}\n\n\t\tif (typeof lowPriorityIndex === 'number') {\n\t\t\tpushToEnd(indexes, lowPriorityIndex);\n\t\t}\n\n\t\tfor (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) {\n\t\t\tconst item = this.viewItems[indexes[i]];\n\t\t\tconst size = clamp(item.size + emptyDelta, item.minimumSize, item.maximumSize);\n\t\t\tconst viewDelta = size - item.size;\n\n\t\t\temptyDelta -= viewDelta;\n\t\t\titem.size = size;\n\t\t}\n\t}\n\n\tprivate layoutViews(): void {\n\t\t// Save new content size\n\t\tthis._contentSize = this.viewItems.reduce((r, i) => r + i.size, 0);\n\n\t\t// Layout views\n\t\tlet offset = 0;\n\n\t\tfor (const viewItem of this.viewItems) {\n\t\t\tviewItem.layout(offset, this.layoutContext);\n\t\t\toffset += viewItem.size;\n\t\t}\n\n\t\t// Layout sashes\n\t\tthis.sashItems.forEach(item => item.sash.layout());\n\t\tthis.updateSashEnablement();\n\t\tthis.updateScrollableElement();\n\t}\n\n\tprivate updateScrollableElement(): void {\n\t\tif (this.orientation === Orientation.VERTICAL) {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\theight: this.size,\n\t\t\t\tscrollHeight: this._contentSize\n\t\t\t});\n\t\t} else {\n\t\t\tthis.scrollableElement.setScrollDimensions({\n\t\t\t\twidth: this.size,\n\t\t\t\tscrollWidth: this._contentSize\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate updateSashEnablement(): void {\n\t\tlet previous = false;\n\t\tconst collapsesDown = this.viewItems.map(i => previous = (i.size - i.minimumSize > 0) || previous);\n\n\t\tprevious = false;\n\t\tconst expandsDown = this.viewItems.map(i => previous = (i.maximumSize - i.size > 0) || previous);\n\n\t\tconst reverseViews = [...this.viewItems].reverse();\n\t\tprevious = false;\n\t\tconst collapsesUp = reverseViews.map(i => previous = (i.size - i.minimumSize > 0) || previous).reverse();\n\n\t\tprevious = false;\n\t\tconst expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse();\n\n\t\tlet position = 0;\n\t\tfor (let index = 0; index < this.sashItems.length; index++) {\n\t\t\tconst { sash } = this.sashItems[index];\n\t\t\tconst viewItem = this.viewItems[index];\n\t\t\tposition += viewItem.size;\n\n\t\t\tconst min = !(collapsesDown[index] && expandsUp[index + 1]);\n\t\t\tconst max = !(expandsDown[index] && collapsesUp[index + 1]);\n\n\t\t\tif (min && max) {\n\t\t\t\tconst upIndexes = range(index, -1);\n\t\t\t\tconst downIndexes = range(index + 1, this.viewItems.length);\n\t\t\t\tconst snapBeforeIndex = this.findFirstSnapIndex(upIndexes);\n\t\t\t\tconst snapAfterIndex = this.findFirstSnapIndex(downIndexes);\n\n\t\t\t\tconst snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible;\n\t\t\t\tconst snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible;\n\n\t\t\t\tif (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t\t} else if (snappedAfter && collapsesDown[index] && (position < this._contentSize || this.endSnappingEnabled)) {\n\t\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t\t} else {\n\t\t\t\t\tsash.state = SashState.Disabled;\n\t\t\t\t}\n\t\t\t} else if (min && !max) {\n\t\t\t\tsash.state = SashState.AtMinimum;\n\t\t\t} else if (!min && max) {\n\t\t\t\tsash.state = SashState.AtMaximum;\n\t\t\t} else {\n\t\t\t\tsash.state = SashState.Enabled;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getSashPosition(sash: Sash): number {\n\t\tlet position = 0;\n\n\t\tfor (let i = 0; i < this.sashItems.length; i++) {\n\t\t\tposition += this.viewItems[i].size;\n\n\t\t\tif (this.sashItems[i].sash === sash) {\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate findFirstSnapIndex(indexes: number[]): number | undefined {\n\t\t// visible views first\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (!viewItem.visible) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\t// then, hidden views\n\t\tfor (const index of indexes) {\n\t\t\tconst viewItem = this.viewItems[index];\n\n\t\t\tif (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!viewItem.visible && viewItem.snap) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate areViewsDistributed() {\n\t\tlet min = undefined, max = undefined;\n\n\t\tfor (const view of this.viewItems) {\n\t\t\tmin = min === undefined ? view.size : Math.min(min, view.size);\n\t\t\tmax = max === undefined ? view.size : Math.max(max, view.size);\n\n\t\t\tif (max - min > 2) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\toverride dispose(): void {\n\t\tthis.sashDragState?.disposable.dispose();\n\n\t\tdispose(this.viewItems);\n\t\tthis.viewItems = [];\n\n\t\tthis.sashItems.forEach(i => i.disposable.dispose());\n\t\tthis.sashItems = [];\n\n\t\tsuper.dispose();\n\t}\n}\n"]}