monaco-editor-core 0.58.0-dev-20261108 → 0.58.0-dev-20261111

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 (56) hide show
  1. package/esm/nls.messages.cs.js +1 -1
  2. package/esm/nls.messages.de.js +1 -1
  3. package/esm/nls.messages.es.js +1 -1
  4. package/esm/nls.messages.fr.js +1 -1
  5. package/esm/nls.messages.it.js +1 -1
  6. package/esm/nls.messages.ja.js +1 -1
  7. package/esm/nls.messages.ko.js +1 -1
  8. package/esm/nls.messages.pl.js +1 -1
  9. package/esm/nls.messages.pt-br.js +1 -1
  10. package/esm/nls.messages.ru.js +1 -1
  11. package/esm/nls.messages.tr.js +1 -1
  12. package/esm/nls.messages.zh-cn.js +1 -1
  13. package/esm/nls.messages.zh-tw.js +1 -1
  14. package/esm/vs/base/browser/mouseEvent.js.map +1 -1
  15. package/esm/vs/base/browser/ui/resizable/resizable.js +2 -2
  16. package/esm/vs/base/browser/ui/resizable/resizable.js.map +1 -1
  17. package/esm/vs/base/common/htmlContent.js +5 -1
  18. package/esm/vs/base/common/htmlContent.js.map +1 -1
  19. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.css +1 -0
  20. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +14 -3
  21. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  22. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.css +4 -0
  23. package/esm/vs/editor/browser/viewParts/minimap/minimap.css +3 -6
  24. package/esm/vs/editor/browser/viewParts/minimap/minimap.js +15 -4
  25. package/esm/vs/editor/browser/viewParts/minimap/minimap.js.map +1 -1
  26. package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +3 -1
  27. package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js.map +1 -1
  28. package/esm/vs/editor/common/config/editorOptions.js +5 -3
  29. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  30. package/esm/vs/editor/common/config/fontInfo.js +5 -0
  31. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  32. package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -1
  33. package/esm/vs/editor/common/viewLayout/lineHeights.js.map +1 -1
  34. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +1 -1
  35. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  36. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +19 -15
  37. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  38. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +7 -5
  39. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
  40. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -1
  41. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  42. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +3 -1
  43. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
  44. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +5 -2
  45. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
  46. package/esm/vs/platform/actionWidget/browser/actionList.js +3 -1
  47. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  48. package/esm/vs/platform/configuration/common/configuration.js +4 -2
  49. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  50. package/esm/vs/platform/configuration/common/configurationModels.js +25 -5
  51. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  52. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  53. package/esm/vs/platform/quickinput/browser/quickInputList.js +26 -7
  54. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  55. package/package.json +2 -2
  56. package/version.txt +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.58.0-dev-20261108(5359a3330383137dfdf8897ba1d93d943fec4027)
3
+ * Version: 0.58.0-dev-20261111(c835521959b07961e12aef761f058db2a3d49e9c)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work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B,CAAC;gBACF,CAAC;qBAAM,CAAC;oBACP,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;gBAC9B,CAAC;YACF,CAAC;YAED,kDAAkD;YAClD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;gBAC5D,IAAI,eAAe,EAAE,CAAC;oBACrB,iFAAiF;oBACjF,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,GAAG,CAAC,GAAG,GAAG,gBAAgB,CAAC,CAAC;gBACvD,CAAC;qBAAM,CAAC;oBACP,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC;gBAClC,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAEM,cAAc;QACpB,IAAI,CAAC,YAAY,EAAE,cAAc,EAAE,CAAC;IACrC,CAAC;IAEM,eAAe;QACrB,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,CAAC;IACtC,CAAC;CACD","file":"mouseEvent.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 * as browser from './browser.js';\nimport { IframeUtils } from './iframe.js';\nimport * as platform from '../common/platform.js';\n\nexport interface IMouseEvent {\n\treadonly browserEvent: MouseEvent;\n\treadonly leftButton: boolean;\n\treadonly middleButton: boolean;\n\treadonly rightButton: boolean;\n\treadonly buttons: number;\n\treadonly target: HTMLElement;\n\treadonly detail: number;\n\treadonly posx: number;\n\treadonly posy: number;\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\treadonly timestamp: number;\n\treadonly defaultPrevented: boolean;\n\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport class StandardMouseEvent implements IMouseEvent {\n\n\tpublic readonly browserEvent: MouseEvent;\n\n\tpublic readonly leftButton: boolean;\n\tpublic readonly middleButton: boolean;\n\tpublic readonly rightButton: boolean;\n\tpublic readonly buttons: number;\n\tpublic readonly target: HTMLElement;\n\tpublic detail: number;\n\tpublic readonly posx: number;\n\tpublic readonly posy: number;\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly timestamp: number;\n\tpublic readonly defaultPrevented: boolean;\n\n\tconstructor(targetWindow: Window, e: MouseEvent) {\n\t\tthis.timestamp = Date.now();\n\t\tthis.browserEvent = e;\n\t\tthis.leftButton = e.button === 0;\n\t\tthis.middleButton = e.button === 1;\n\t\tthis.rightButton = e.button === 2;\n\t\tthis.buttons = e.buttons;\n\t\tthis.defaultPrevented = e.defaultPrevented;\n\n\t\tthis.target = <HTMLElement>e.target;\n\n\t\tthis.detail = e.detail || 1;\n\t\tif (e.type === 'dblclick') {\n\t\t\tthis.detail = 2;\n\t\t}\n\t\tthis.ctrlKey = e.ctrlKey;\n\t\tthis.shiftKey = e.shiftKey;\n\t\tthis.altKey = e.altKey;\n\t\tthis.metaKey = e.metaKey;\n\n\t\tthis.posx = e.pageX;\n\t\tthis.posy = e.pageY;\n\n\t\t// Find the position of the iframe this code is executing in relative to the iframe where the event was captured.\n\t\tconst iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(targetWindow, e.view);\n\t\tthis.posx -= iframeOffsets.left;\n\t\tthis.posy -= iframeOffsets.top;\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent.stopPropagation();\n\t}\n}\n\nexport interface IMouseWheelEvent extends MouseEvent {\n\treadonly wheelDelta: number;\n\treadonly wheelDeltaX: number;\n\treadonly wheelDeltaY: number;\n\n\treadonly deltaX: number;\n\treadonly deltaY: number;\n\treadonly deltaZ: number;\n\treadonly deltaMode: number;\n}\n\ninterface IWebKitMouseWheelEvent {\n\twheelDeltaY: number;\n\twheelDeltaX: number;\n}\n\ninterface IGeckoMouseWheelEvent {\n\tHORIZONTAL_AXIS: number;\n\tVERTICAL_AXIS: number;\n\taxis: number;\n\tdetail: number;\n}\n\nexport class StandardWheelEvent {\n\n\tpublic readonly browserEvent: IMouseWheelEvent | null;\n\tpublic readonly deltaY: number;\n\tpublic readonly deltaX: number;\n\tpublic readonly target: Node;\n\n\tconstructor(e: IMouseWheelEvent | null, deltaX: number = 0, deltaY: number = 0) {\n\n\t\tthis.browserEvent = e || null;\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis.target = e ? (e.target || (<any>e).targetNode || e.srcElement) : null;\n\n\t\tthis.deltaY = deltaY;\n\t\tthis.deltaX = deltaX;\n\n\t\tlet shouldFactorDPR: boolean = false;\n\t\tif (browser.isChrome) {\n\t\t\t// Chrome version >= 123 contains the fix to factor devicePixelRatio into the wheel event.\n\t\t\t// See https://chromium.googlesource.com/chromium/src.git/+/be51b448441ff0c9d1f17e0f25c4bf1ab3f11f61\n\t\t\tconst chromeVersionMatch = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n\t\t\tconst chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1]) : 123;\n\t\t\tshouldFactorDPR = chromeMajorVersion <= 122;\n\t\t}\n\n\t\tif (e) {\n\t\t\t// Old (deprecated) wheel events\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e1 = <IWebKitMouseWheelEvent><any>e;\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e2 = <IGeckoMouseWheelEvent><any>e;\n\t\t\tconst devicePixelRatio = e.view?.devicePixelRatio || 1;\n\n\t\t\t// vertical delta scroll\n\t\t\tif (typeof e1.wheelDeltaY !== 'undefined') {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) {\n\t\t\t\tthis.deltaY = -e2.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = -e.deltaY / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// horizontal delta scroll\n\t\t\tif (typeof e1.wheelDeltaX !== 'undefined') {\n\t\t\t\tif (browser.isSafari && platform.isWindows) {\n\t\t\t\t\tthis.deltaX = - (e1.wheelDeltaX / 120);\n\t\t\t\t} else if (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) {\n\t\t\t\tthis.deltaX = -e.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = -e.deltaX / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Assume a vertical scroll if nothing else worked\n\t\t\tif (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e.wheelDelta / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e.wheelDelta / 120;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent?.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent?.stopPropagation();\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 * as browser from './browser.js';\nimport { IframeUtils } from './iframe.js';\nimport * as platform from '../common/platform.js';\n\nexport interface IMouseEvent {\n\treadonly browserEvent: MouseEvent;\n\treadonly leftButton: boolean;\n\treadonly middleButton: boolean;\n\treadonly rightButton: boolean;\n\treadonly buttons: number;\n\treadonly target: HTMLElement;\n\treadonly detail: number;\n\treadonly posx: number;\n\treadonly posy: number;\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\treadonly timestamp: number;\n\treadonly defaultPrevented: boolean;\n\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport class StandardMouseEvent implements IMouseEvent {\n\n\tpublic readonly browserEvent: MouseEvent;\n\n\tpublic readonly leftButton: boolean;\n\tpublic readonly middleButton: boolean;\n\tpublic readonly rightButton: boolean;\n\tpublic readonly buttons: number;\n\tpublic readonly target: HTMLElement;\n\tpublic detail: number;\n\tpublic readonly posx: number;\n\tpublic readonly posy: number;\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly timestamp: number;\n\tpublic readonly defaultPrevented: boolean;\n\n\tconstructor(targetWindow: Window, e: MouseEvent) {\n\t\tthis.timestamp = Date.now();\n\t\tthis.browserEvent = e;\n\t\tthis.leftButton = e.button === 0;\n\t\tthis.middleButton = e.button === 1;\n\t\tthis.rightButton = e.button === 2;\n\t\tthis.buttons = e.buttons;\n\t\tthis.defaultPrevented = e.defaultPrevented;\n\n\t\tthis.target = <HTMLElement>e.target;\n\n\t\tthis.detail = e.detail || 1;\n\t\tif (e.type === 'dblclick') {\n\t\t\tthis.detail = 2;\n\t\t}\n\t\tthis.ctrlKey = e.ctrlKey;\n\t\tthis.shiftKey = e.shiftKey;\n\t\tthis.altKey = e.altKey;\n\t\tthis.metaKey = e.metaKey;\n\n\t\tthis.posx = e.pageX;\n\t\tthis.posy = e.pageY;\n\n\t\t// Find the position of the iframe this code is executing in relative to the iframe where the event was captured.\n\t\tconst iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(targetWindow, e.view);\n\t\tthis.posx -= iframeOffsets.left;\n\t\tthis.posy -= iframeOffsets.top;\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent.stopPropagation();\n\t}\n}\n\nexport interface IMouseWheelEvent extends MouseEvent {\n\treadonly wheelDelta: number;\n\treadonly wheelDeltaX: number;\n\treadonly wheelDeltaY: number;\n\n\treadonly deltaX: number;\n\treadonly deltaY: number;\n\treadonly deltaZ: number;\n\treadonly deltaMode: number;\n}\n\ninterface IWebKitMouseWheelEvent {\n\twheelDeltaY: number;\n\twheelDeltaX: number;\n}\n\ninterface IGeckoMouseWheelEvent {\n\tHORIZONTAL_AXIS: number;\n\tVERTICAL_AXIS: number;\n\taxis: number;\n\tdetail: number;\n}\n\nexport class StandardWheelEvent {\n\n\tpublic readonly browserEvent: IMouseWheelEvent | null;\n\tpublic readonly deltaY: number;\n\tpublic readonly deltaX: number;\n\tpublic readonly target: Node;\n\n\tconstructor(e: IMouseWheelEvent | null, deltaX: number = 0, deltaY: number = 0) {\n\n\t\tthis.browserEvent = e || null;\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis.target = e ? (e.target || (<any>e).targetNode || e.srcElement) : null;\n\n\t\tthis.deltaY = deltaY;\n\t\tthis.deltaX = deltaX;\n\n\t\tlet shouldFactorDPR: boolean = false;\n\t\tif (browser.isChrome) {\n\t\t\t// Chrome version >= 123 contains the fix to factor devicePixelRatio into the wheel event.\n\t\t\t// See https://chromium.googlesource.com/chromium/src.git/+/be51b448441ff0c9d1f17e0f25c4bf1ab3f11f61\n\t\t\tconst chromeVersionMatch = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n\t\t\tconst chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1]) : 123;\n\t\t\tshouldFactorDPR = chromeMajorVersion <= 122;\n\t\t}\n\n\t\tif (e) {\n\t\t\t// Old (deprecated) wheel events\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e1 = <IWebKitMouseWheelEvent><any>e;\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e2 = <IGeckoMouseWheelEvent><any>e;\n\t\t\tconst devicePixelRatio = e.view?.devicePixelRatio || 1;\n\n\t\t\t// vertical delta scroll\n\t\t\tif (typeof e1.wheelDeltaY !== 'undefined') {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) {\n\t\t\t\tthis.deltaY = -e2.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = -e.deltaY / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// horizontal delta scroll\n\t\t\tif (typeof e1.wheelDeltaX !== 'undefined') {\n\t\t\t\tif (browser.isSafari && platform.isWindows) {\n\t\t\t\t\tthis.deltaX = - (e1.wheelDeltaX / 120);\n\t\t\t\t} else if (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) {\n\t\t\t\tthis.deltaX = -e.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = -e.deltaX / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Assume a vertical scroll if nothing else worked\n\t\t\tif (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e.wheelDelta / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e.wheelDelta / 120;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent?.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent?.stopPropagation();\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/mouseEvent.ts","vs/base/browser/mouseEvent.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,u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AI,CAAC,CAAC,UAAU,EAAE,CAAC;gBAC5D,IAAI,eAAe,EAAE,CAAC;oBACrB,iFAAiF;oBACjF,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,GAAG,CAAC,GAAG,GAAG,gBAAgB,CAAC,CAAC;gBACvD,CAAC;qBAAM,CAAC;oBACP,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC;gBAClC,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAEM,cAAc;QACpB,IAAI,CAAC,YAAY,EAAE,cAAc,EAAE,CAAC;IACrC,CAAC;IAEM,eAAe;QACrB,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,CAAC;IACtC,CAAC;CACD","file":"mouseEvent.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 * as browser from './browser.js';\nimport { IframeUtils } from './iframe.js';\nimport * as platform from '../common/platform.js';\n\nexport interface IMouseEvent {\n\treadonly browserEvent: MouseEvent;\n\treadonly leftButton: boolean;\n\treadonly middleButton: boolean;\n\treadonly rightButton: boolean;\n\treadonly buttons: number;\n\treadonly target: HTMLElement;\n\treadonly detail: number;\n\treadonly posx: number;\n\treadonly posy: number;\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\treadonly timestamp: number;\n\treadonly defaultPrevented: boolean;\n\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport class StandardMouseEvent implements IMouseEvent {\n\n\tpublic readonly browserEvent: MouseEvent;\n\n\tpublic readonly leftButton: boolean;\n\tpublic readonly middleButton: boolean;\n\tpublic readonly rightButton: boolean;\n\tpublic readonly buttons: number;\n\tpublic readonly target: HTMLElement;\n\tpublic detail: number;\n\tpublic readonly posx: number;\n\tpublic readonly posy: number;\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly timestamp: number;\n\tpublic readonly defaultPrevented: boolean;\n\n\tconstructor(targetWindow: Window, e: MouseEvent) {\n\t\tthis.timestamp = Date.now();\n\t\tthis.browserEvent = e;\n\t\tthis.leftButton = e.button === 0;\n\t\tthis.middleButton = e.button === 1;\n\t\tthis.rightButton = e.button === 2;\n\t\tthis.buttons = e.buttons;\n\t\tthis.defaultPrevented = e.defaultPrevented;\n\n\t\tthis.target = <HTMLElement>e.target;\n\n\t\tthis.detail = e.detail || 1;\n\t\tif (e.type === 'dblclick') {\n\t\t\tthis.detail = 2;\n\t\t}\n\t\tthis.ctrlKey = e.ctrlKey;\n\t\tthis.shiftKey = e.shiftKey;\n\t\tthis.altKey = e.altKey;\n\t\tthis.metaKey = e.metaKey;\n\n\t\tthis.posx = e.pageX;\n\t\tthis.posy = e.pageY;\n\n\t\t// Find the position of the iframe this code is executing in relative to the iframe where the event was captured.\n\t\tconst iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(targetWindow, e.view);\n\t\tthis.posx -= iframeOffsets.left;\n\t\tthis.posy -= iframeOffsets.top;\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent.stopPropagation();\n\t}\n}\n\nexport interface IMouseWheelEvent extends MouseEvent {\n\treadonly wheelDelta: number;\n\treadonly wheelDeltaX: number;\n\treadonly wheelDeltaY: number;\n\n\treadonly deltaX: number;\n\treadonly deltaY: number;\n\treadonly deltaZ: number;\n\treadonly deltaMode: number;\n}\n\ninterface IWebKitMouseWheelEvent {\n\twheelDeltaY: number;\n\twheelDeltaX: number;\n}\n\ninterface IGeckoMouseWheelEvent {\n\tHORIZONTAL_AXIS: number;\n\tVERTICAL_AXIS: number;\n\taxis: number;\n\tdetail: number;\n}\n\nexport class StandardWheelEvent {\n\n\tpublic readonly browserEvent: IMouseWheelEvent | null;\n\tpublic readonly deltaY: number;\n\tpublic readonly deltaX: number;\n\tpublic readonly target: Node;\n\n\tconstructor(e: IMouseWheelEvent | null, deltaX: number = 0, deltaY: number = 0) {\n\n\t\tthis.browserEvent = e || null;\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis.target = e ? (e.target || (<any>e).targetNode || e.srcElement) : null;\n\n\t\tthis.deltaY = deltaY;\n\t\tthis.deltaX = deltaX;\n\n\t\tlet shouldFactorDPR: boolean = false;\n\t\tif (browser.isChrome) {\n\t\t\t// Chrome version >= 123 contains the fix to factor devicePixelRatio into the wheel event.\n\t\t\t// See https://chromium.googlesource.com/chromium/src.git/+/be51b448441ff0c9d1f17e0f25c4bf1ab3f11f61\n\t\t\tconst chromeVersionMatch = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n\t\t\tconst chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1]) : 123;\n\t\t\tshouldFactorDPR = chromeMajorVersion <= 122;\n\t\t}\n\n\t\tif (e) {\n\t\t\t// Old (deprecated) wheel events\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e1 = <IWebKitMouseWheelEvent><any>e;\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e2 = <IGeckoMouseWheelEvent><any>e;\n\t\t\tconst devicePixelRatio = e.view?.devicePixelRatio || 1;\n\n\t\t\t// vertical delta scroll\n\t\t\tif (typeof e1.wheelDeltaY !== 'undefined') {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) {\n\t\t\t\tthis.deltaY = -e2.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = -e.deltaY / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// horizontal delta scroll\n\t\t\tif (typeof e1.wheelDeltaX !== 'undefined') {\n\t\t\t\tif (browser.isSafari && platform.isWindows) {\n\t\t\t\t\tthis.deltaX = -(e1.wheelDeltaX / 120);\n\t\t\t\t} else if (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) {\n\t\t\t\tthis.deltaX = -e.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = -e.deltaX / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Assume a vertical scroll if nothing else worked\n\t\t\tif (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e.wheelDelta / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e.wheelDelta / 120;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent?.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent?.stopPropagation();\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 * as browser from './browser.js';\nimport { IframeUtils } from './iframe.js';\nimport * as platform from '../common/platform.js';\n\nexport interface IMouseEvent {\n\treadonly browserEvent: MouseEvent;\n\treadonly leftButton: boolean;\n\treadonly middleButton: boolean;\n\treadonly rightButton: boolean;\n\treadonly buttons: number;\n\treadonly target: HTMLElement;\n\treadonly detail: number;\n\treadonly posx: number;\n\treadonly posy: number;\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\treadonly timestamp: number;\n\treadonly defaultPrevented: boolean;\n\n\tpreventDefault(): void;\n\tstopPropagation(): void;\n}\n\nexport class StandardMouseEvent implements IMouseEvent {\n\n\tpublic readonly browserEvent: MouseEvent;\n\n\tpublic readonly leftButton: boolean;\n\tpublic readonly middleButton: boolean;\n\tpublic readonly rightButton: boolean;\n\tpublic readonly buttons: number;\n\tpublic readonly target: HTMLElement;\n\tpublic detail: number;\n\tpublic readonly posx: number;\n\tpublic readonly posy: number;\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly timestamp: number;\n\tpublic readonly defaultPrevented: boolean;\n\n\tconstructor(targetWindow: Window, e: MouseEvent) {\n\t\tthis.timestamp = Date.now();\n\t\tthis.browserEvent = e;\n\t\tthis.leftButton = e.button === 0;\n\t\tthis.middleButton = e.button === 1;\n\t\tthis.rightButton = e.button === 2;\n\t\tthis.buttons = e.buttons;\n\t\tthis.defaultPrevented = e.defaultPrevented;\n\n\t\tthis.target = <HTMLElement>e.target;\n\n\t\tthis.detail = e.detail || 1;\n\t\tif (e.type === 'dblclick') {\n\t\t\tthis.detail = 2;\n\t\t}\n\t\tthis.ctrlKey = e.ctrlKey;\n\t\tthis.shiftKey = e.shiftKey;\n\t\tthis.altKey = e.altKey;\n\t\tthis.metaKey = e.metaKey;\n\n\t\tthis.posx = e.pageX;\n\t\tthis.posy = e.pageY;\n\n\t\t// Find the position of the iframe this code is executing in relative to the iframe where the event was captured.\n\t\tconst iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(targetWindow, e.view);\n\t\tthis.posx -= iframeOffsets.left;\n\t\tthis.posy -= iframeOffsets.top;\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent.stopPropagation();\n\t}\n}\n\nexport interface IMouseWheelEvent extends MouseEvent {\n\treadonly wheelDelta: number;\n\treadonly wheelDeltaX: number;\n\treadonly wheelDeltaY: number;\n\n\treadonly deltaX: number;\n\treadonly deltaY: number;\n\treadonly deltaZ: number;\n\treadonly deltaMode: number;\n}\n\ninterface IWebKitMouseWheelEvent {\n\twheelDeltaY: number;\n\twheelDeltaX: number;\n}\n\ninterface IGeckoMouseWheelEvent {\n\tHORIZONTAL_AXIS: number;\n\tVERTICAL_AXIS: number;\n\taxis: number;\n\tdetail: number;\n}\n\nexport class StandardWheelEvent {\n\n\tpublic readonly browserEvent: IMouseWheelEvent | null;\n\tpublic readonly deltaY: number;\n\tpublic readonly deltaX: number;\n\tpublic readonly target: Node;\n\n\tconstructor(e: IMouseWheelEvent | null, deltaX: number = 0, deltaY: number = 0) {\n\n\t\tthis.browserEvent = e || null;\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis.target = e ? (e.target || (<any>e).targetNode || e.srcElement) : null;\n\n\t\tthis.deltaY = deltaY;\n\t\tthis.deltaX = deltaX;\n\n\t\tlet shouldFactorDPR: boolean = false;\n\t\tif (browser.isChrome) {\n\t\t\t// Chrome version >= 123 contains the fix to factor devicePixelRatio into the wheel event.\n\t\t\t// See https://chromium.googlesource.com/chromium/src.git/+/be51b448441ff0c9d1f17e0f25c4bf1ab3f11f61\n\t\t\tconst chromeVersionMatch = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n\t\t\tconst chromeMajorVersion = chromeVersionMatch ? parseInt(chromeVersionMatch[1]) : 123;\n\t\t\tshouldFactorDPR = chromeMajorVersion <= 122;\n\t\t}\n\n\t\tif (e) {\n\t\t\t// Old (deprecated) wheel events\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e1 = <IWebKitMouseWheelEvent><any>e;\n\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\tconst e2 = <IGeckoMouseWheelEvent><any>e;\n\t\t\tconst devicePixelRatio = e.view?.devicePixelRatio || 1;\n\n\t\t\t// vertical delta scroll\n\t\t\tif (typeof e1.wheelDeltaY !== 'undefined') {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e1.wheelDeltaY / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) {\n\t\t\t\tthis.deltaY = -e2.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaY = -e.deltaY;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = -e.deltaY / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// horizontal delta scroll\n\t\t\tif (typeof e1.wheelDeltaX !== 'undefined') {\n\t\t\t\tif (browser.isSafari && platform.isWindows) {\n\t\t\t\t\tthis.deltaX = -(e1.wheelDeltaX / 120);\n\t\t\t\t} else if (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = e1.wheelDeltaX / 120;\n\t\t\t\t}\n\t\t\t} else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) {\n\t\t\t\tthis.deltaX = -e.detail / 3;\n\t\t\t} else if (e.type === 'wheel') {\n\t\t\t\t// Modern wheel event\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\t\t\t\tconst ev = <WheelEvent><unknown>e;\n\n\t\t\t\tif (ev.deltaMode === ev.DOM_DELTA_LINE) {\n\t\t\t\t\t// the deltas are expressed in lines\n\t\t\t\t\tif (browser.isFirefox && !platform.isMacintosh) {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX / 3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.deltaX = -e.deltaX;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaX = -e.deltaX / 40;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Assume a vertical scroll if nothing else worked\n\t\t\tif (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) {\n\t\t\t\tif (shouldFactorDPR) {\n\t\t\t\t\t// Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n\t\t\t\t\tthis.deltaY = e.wheelDelta / (120 * devicePixelRatio);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deltaY = e.wheelDelta / 120;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic preventDefault(): void {\n\t\tthis.browserEvent?.preventDefault();\n\t}\n\n\tpublic stopPropagation(): void {\n\t\tthis.browserEvent?.stopPropagation();\n\t}\n}\n"]}
@@ -75,13 +75,13 @@ export class ResizableHTMLElement {
75
75
  this._sashListener.add(Event.any(this._eastSash.onDidReset, this._westSash.onDidReset)(e => {
76
76
  if (this._preferredSize) {
77
77
  this.layout(this._size.height, this._preferredSize.width);
78
- this._onDidResize.fire({ dimension: this._size, done: true });
78
+ this._onDidResize.fire({ dimension: this._size, done: true, reset: 'width' });
79
79
  }
80
80
  }));
81
81
  this._sashListener.add(Event.any(this._northSash.onDidReset, this._southSash.onDidReset)(e => {
82
82
  if (this._preferredSize) {
83
83
  this.layout(this._preferredSize.height, this._size.width);
84
- this._onDidResize.fire({ dimension: this._size, done: true });
84
+ this._onDidResize.fire({ dimension: this._size, done: true, reset: 'height' });
85
85
  }
86
86
  }));
87
87
  }
@@ -1 +1 @@
1
- {"version":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,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAI,aAAa,CAAC,KAA4B;QAC7C,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;CACD","file":"resizable.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 { Dimension } from '../../dom.js';\nimport { Orientation, OrthogonalEdge, Sash, SashState } from '../sash/sash.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { DisposableStore } from '../../../common/lifecycle.js';\n\n\nexport interface IResizeEvent {\n\tdimension: Dimension;\n\tdone: boolean;\n\tnorth?: boolean;\n\teast?: boolean;\n\tsouth?: boolean;\n\twest?: boolean;\n}\n\nexport class ResizableHTMLElement {\n\n\treadonly domNode: HTMLElement;\n\n\tprivate readonly _onDidWillResize = new Emitter<void>();\n\tget onDidWillResize() { return this._onDidWillResize.event; }\n\n\tprivate readonly _onDidResize = new Emitter<IResizeEvent>();\n\tget onDidResize() { return this._onDidResize.event; }\n\n\tprivate readonly _northSash: Sash;\n\tprivate readonly _eastSash: Sash;\n\tprivate readonly _southSash: Sash;\n\tprivate readonly _westSash: Sash;\n\tprivate readonly _sashListener = new DisposableStore();\n\n\tprivate _size = new Dimension(0, 0);\n\tprivate _minSize = new Dimension(0, 0);\n\tprivate _maxSize = new Dimension(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\n\tprivate _preferredSize?: Dimension;\n\n\tconstructor() {\n\t\tthis.domNode = document.createElement('div');\n\t\tthis._eastSash = new Sash(this.domNode, { getVerticalSashLeft: () => this._size.width }, { orientation: Orientation.VERTICAL });\n\t\tthis._westSash = new Sash(this.domNode, { getVerticalSashLeft: () => 0 }, { orientation: Orientation.VERTICAL });\n\t\tthis._northSash = new Sash(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.North });\n\t\tthis._southSash = new Sash(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.South });\n\n\t\tthis._northSash.orthogonalStartSash = this._westSash;\n\t\tthis._northSash.orthogonalEndSash = this._eastSash;\n\t\tthis._southSash.orthogonalStartSash = this._westSash;\n\t\tthis._southSash.orthogonalEndSash = this._eastSash;\n\n\t\tlet currentSize: Dimension | undefined;\n\t\tlet deltaY = 0;\n\t\tlet deltaX = 0;\n\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => {\n\t\t\tif (currentSize === undefined) {\n\t\t\t\tthis._onDidWillResize.fire();\n\t\t\t\tcurrentSize = this._size;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => {\n\t\t\tif (currentSize !== undefined) {\n\t\t\t\tcurrentSize = undefined;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(this._eastSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = e.currentX - e.startX;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, east: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._westSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = -(e.currentX - e.startX);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, west: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._northSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = -(e.currentY - e.startY);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, north: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._southSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = e.currentY - e.startY;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, south: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(Event.any(this._eastSash.onDidReset, this._westSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._size.height, this._preferredSize.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidReset, this._southSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._preferredSize.height, this._size.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._northSash.dispose();\n\t\tthis._southSash.dispose();\n\t\tthis._eastSash.dispose();\n\t\tthis._westSash.dispose();\n\t\tthis._sashListener.dispose();\n\t\tthis._onDidResize.dispose();\n\t\tthis._onDidWillResize.dispose();\n\t\tthis.domNode.remove();\n\t}\n\n\tenableSashes(north: boolean, east: boolean, south: boolean, west: boolean): void {\n\t\tthis._northSash.state = north ? SashState.Enabled : SashState.Disabled;\n\t\tthis._eastSash.state = east ? SashState.Enabled : SashState.Disabled;\n\t\tthis._southSash.state = south ? SashState.Enabled : SashState.Disabled;\n\t\tthis._westSash.state = west ? SashState.Enabled : SashState.Disabled;\n\t}\n\n\tlayout(height: number = this.size.height, width: number = this.size.width): void {\n\n\t\tconst { height: minHeight, width: minWidth } = this._minSize;\n\t\tconst { height: maxHeight, width: maxWidth } = this._maxSize;\n\n\t\theight = Math.max(minHeight, Math.min(maxHeight, height));\n\t\twidth = Math.max(minWidth, Math.min(maxWidth, width));\n\n\t\tconst newSize = new Dimension(width, height);\n\t\tif (!Dimension.equals(newSize, this._size)) {\n\t\t\tthis.domNode.style.height = height + 'px';\n\t\t\tthis.domNode.style.width = width + 'px';\n\t\t\tthis._size = newSize;\n\t\t\tthis._northSash.layout();\n\t\t\tthis._eastSash.layout();\n\t\t\tthis._southSash.layout();\n\t\t\tthis._westSash.layout();\n\t\t}\n\t}\n\n\tclearSashHoverState(): void {\n\t\tthis._eastSash.clearSashHoverState();\n\t\tthis._westSash.clearSashHoverState();\n\t\tthis._northSash.clearSashHoverState();\n\t\tthis._southSash.clearSashHoverState();\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\tset maxSize(value: Dimension) {\n\t\tthis._maxSize = value;\n\t}\n\n\tget maxSize() {\n\t\treturn this._maxSize;\n\t}\n\n\tset minSize(value: Dimension) {\n\t\tthis._minSize = value;\n\t}\n\n\tget minSize() {\n\t\treturn this._minSize;\n\t}\n\n\tset preferredSize(value: Dimension | undefined) {\n\t\tthis._preferredSize = value;\n\t}\n\n\tget preferredSize() {\n\t\treturn this._preferredSize;\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 { Dimension } from '../../dom.js';\nimport { Orientation, OrthogonalEdge, Sash, SashState } from '../sash/sash.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { DisposableStore } from '../../../common/lifecycle.js';\n\n\nexport interface IResizeEvent {\n\tdimension: Dimension;\n\tdone: boolean;\n\tnorth?: boolean;\n\teast?: boolean;\n\tsouth?: boolean;\n\twest?: boolean;\n}\n\nexport class ResizableHTMLElement {\n\n\treadonly domNode: HTMLElement;\n\n\tprivate readonly _onDidWillResize = new Emitter<void>();\n\tget onDidWillResize() { return this._onDidWillResize.event; }\n\n\tprivate readonly _onDidResize = new Emitter<IResizeEvent>();\n\tget onDidResize() { return this._onDidResize.event; }\n\n\tprivate readonly _northSash: Sash;\n\tprivate readonly _eastSash: Sash;\n\tprivate readonly _southSash: Sash;\n\tprivate readonly _westSash: Sash;\n\tprivate readonly _sashListener = new DisposableStore();\n\n\tprivate _size = new Dimension(0, 0);\n\tprivate _minSize = new Dimension(0, 0);\n\tprivate _maxSize = new Dimension(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\n\tprivate _preferredSize?: Dimension;\n\n\tconstructor() {\n\t\tthis.domNode = document.createElement('div');\n\t\tthis._eastSash = new Sash(this.domNode, { getVerticalSashLeft: () => this._size.width }, { orientation: Orientation.VERTICAL });\n\t\tthis._westSash = new Sash(this.domNode, { getVerticalSashLeft: () => 0 }, { orientation: Orientation.VERTICAL });\n\t\tthis._northSash = new Sash(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.North });\n\t\tthis._southSash = new Sash(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.South });\n\n\t\tthis._northSash.orthogonalStartSash = this._westSash;\n\t\tthis._northSash.orthogonalEndSash = this._eastSash;\n\t\tthis._southSash.orthogonalStartSash = this._westSash;\n\t\tthis._southSash.orthogonalEndSash = this._eastSash;\n\n\t\tlet currentSize: Dimension | undefined;\n\t\tlet deltaY = 0;\n\t\tlet deltaX = 0;\n\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => {\n\t\t\tif (currentSize === undefined) {\n\t\t\t\tthis._onDidWillResize.fire();\n\t\t\t\tcurrentSize = this._size;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => {\n\t\t\tif (currentSize !== undefined) {\n\t\t\t\tcurrentSize = undefined;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(this._eastSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = e.currentX - e.startX;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, east: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._westSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = -(e.currentX - e.startX);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, west: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._northSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = -(e.currentY - e.startY);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, north: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._southSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = e.currentY - e.startY;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, south: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(Event.any(this._eastSash.onDidReset, this._westSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._size.height, this._preferredSize.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidReset, this._southSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._preferredSize.height, this._size.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._northSash.dispose();\n\t\tthis._southSash.dispose();\n\t\tthis._eastSash.dispose();\n\t\tthis._westSash.dispose();\n\t\tthis._sashListener.dispose();\n\t\tthis._onDidResize.dispose();\n\t\tthis._onDidWillResize.dispose();\n\t\tthis.domNode.remove();\n\t}\n\n\tenableSashes(north: boolean, east: boolean, south: boolean, west: boolean): void {\n\t\tthis._northSash.state = north ? SashState.Enabled : SashState.Disabled;\n\t\tthis._eastSash.state = east ? SashState.Enabled : SashState.Disabled;\n\t\tthis._southSash.state = south ? SashState.Enabled : SashState.Disabled;\n\t\tthis._westSash.state = west ? SashState.Enabled : SashState.Disabled;\n\t}\n\n\tlayout(height: number = this.size.height, width: number = this.size.width): void {\n\n\t\tconst { height: minHeight, width: minWidth } = this._minSize;\n\t\tconst { height: maxHeight, width: maxWidth } = this._maxSize;\n\n\t\theight = Math.max(minHeight, Math.min(maxHeight, height));\n\t\twidth = Math.max(minWidth, Math.min(maxWidth, width));\n\n\t\tconst newSize = new Dimension(width, height);\n\t\tif (!Dimension.equals(newSize, this._size)) {\n\t\t\tthis.domNode.style.height = height + 'px';\n\t\t\tthis.domNode.style.width = width + 'px';\n\t\t\tthis._size = newSize;\n\t\t\tthis._northSash.layout();\n\t\t\tthis._eastSash.layout();\n\t\t\tthis._southSash.layout();\n\t\t\tthis._westSash.layout();\n\t\t}\n\t}\n\n\tclearSashHoverState(): void {\n\t\tthis._eastSash.clearSashHoverState();\n\t\tthis._westSash.clearSashHoverState();\n\t\tthis._northSash.clearSashHoverState();\n\t\tthis._southSash.clearSashHoverState();\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\tset maxSize(value: Dimension) {\n\t\tthis._maxSize = value;\n\t}\n\n\tget maxSize() {\n\t\treturn this._maxSize;\n\t}\n\n\tset minSize(value: Dimension) {\n\t\tthis._minSize = value;\n\t}\n\n\tget minSize() {\n\t\treturn this._minSize;\n\t}\n\n\tset preferredSize(value: Dimension | undefined) {\n\t\tthis._preferredSize = value;\n\t}\n\n\tget preferredSize() {\n\t\treturn this._preferredSize;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/resizable/resizable.ts","vs/base/browser/ui/resizable/resizable.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAe,cAAc,EAAE,IAAI,EAAa,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAa/D,MAAM,OAAO,oBAAoB;IAKhC,IAAI,eAAe,KAAK,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IAG7D,IAAI,WAAW,KAAK,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAarD;QAjBiB,qBAAgB,GAAG,IAAI,OAAO,EAAQ,CAAC;QAGvC,iBAAY,GAAG,IAAI,OAAO,EAAgB,CAAC;QAO3C,kBAAa,GAAG,IAAI,eAAe,EAAE,CAAC;QAE/C,UAAK,GAAG,IAAI,SAAS,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AAE,CAAC;QACzB,CAAC;IACF,CAAC;IAED,mBAAmB;QAClB,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;QACrC,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;QACrC,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC;QACtC,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,IAAI;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,CAAC,KAAgB;QAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAI,OAAO,CAAC,KAAgB;QAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAI,aAAa,CAAC,KAA4B;QAC7C,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;CACD","file":"resizable.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 { Dimension } from '../../dom.js';\nimport { Orientation, OrthogonalEdge, Sash, SashState } from '../sash/sash.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { DisposableStore } from '../../../common/lifecycle.js';\n\n\nexport interface IResizeEvent {\n\tdimension: Dimension;\n\tdone: boolean;\n\treset?: 'width' | 'height';\n\tnorth?: boolean;\n\teast?: boolean;\n\tsouth?: boolean;\n\twest?: boolean;\n}\n\nexport class ResizableHTMLElement {\n\n\treadonly domNode: HTMLElement;\n\n\tprivate readonly _onDidWillResize = new Emitter<void>();\n\tget onDidWillResize() { return this._onDidWillResize.event; }\n\n\tprivate readonly _onDidResize = new Emitter<IResizeEvent>();\n\tget onDidResize() { return this._onDidResize.event; }\n\n\tprivate readonly _northSash: Sash;\n\tprivate readonly _eastSash: Sash;\n\tprivate readonly _southSash: Sash;\n\tprivate readonly _westSash: Sash;\n\tprivate readonly _sashListener = new DisposableStore();\n\n\tprivate _size = new Dimension(0, 0);\n\tprivate _minSize = new Dimension(0, 0);\n\tprivate _maxSize = new Dimension(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\n\tprivate _preferredSize?: Dimension;\n\n\tconstructor() {\n\t\tthis.domNode = document.createElement('div');\n\t\tthis._eastSash = new Sash(this.domNode, { getVerticalSashLeft: () => this._size.width }, { orientation: Orientation.VERTICAL });\n\t\tthis._westSash = new Sash(this.domNode, { getVerticalSashLeft: () => 0 }, { orientation: Orientation.VERTICAL });\n\t\tthis._northSash = new Sash(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.North });\n\t\tthis._southSash = new Sash(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.South });\n\n\t\tthis._northSash.orthogonalStartSash = this._westSash;\n\t\tthis._northSash.orthogonalEndSash = this._eastSash;\n\t\tthis._southSash.orthogonalStartSash = this._westSash;\n\t\tthis._southSash.orthogonalEndSash = this._eastSash;\n\n\t\tlet currentSize: Dimension | undefined;\n\t\tlet deltaY = 0;\n\t\tlet deltaX = 0;\n\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => {\n\t\t\tif (currentSize === undefined) {\n\t\t\t\tthis._onDidWillResize.fire();\n\t\t\t\tcurrentSize = this._size;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => {\n\t\t\tif (currentSize !== undefined) {\n\t\t\t\tcurrentSize = undefined;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(this._eastSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = e.currentX - e.startX;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, east: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._westSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = -(e.currentX - e.startX);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, west: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._northSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = -(e.currentY - e.startY);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, north: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._southSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = e.currentY - e.startY;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, south: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(Event.any(this._eastSash.onDidReset, this._westSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._size.height, this._preferredSize.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true, reset: 'width' });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidReset, this._southSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._preferredSize.height, this._size.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true, reset: 'height' });\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._northSash.dispose();\n\t\tthis._southSash.dispose();\n\t\tthis._eastSash.dispose();\n\t\tthis._westSash.dispose();\n\t\tthis._sashListener.dispose();\n\t\tthis._onDidResize.dispose();\n\t\tthis._onDidWillResize.dispose();\n\t\tthis.domNode.remove();\n\t}\n\n\tenableSashes(north: boolean, east: boolean, south: boolean, west: boolean): void {\n\t\tthis._northSash.state = north ? SashState.Enabled : SashState.Disabled;\n\t\tthis._eastSash.state = east ? SashState.Enabled : SashState.Disabled;\n\t\tthis._southSash.state = south ? SashState.Enabled : SashState.Disabled;\n\t\tthis._westSash.state = west ? SashState.Enabled : SashState.Disabled;\n\t}\n\n\tlayout(height: number = this.size.height, width: number = this.size.width): void {\n\n\t\tconst { height: minHeight, width: minWidth } = this._minSize;\n\t\tconst { height: maxHeight, width: maxWidth } = this._maxSize;\n\n\t\theight = Math.max(minHeight, Math.min(maxHeight, height));\n\t\twidth = Math.max(minWidth, Math.min(maxWidth, width));\n\n\t\tconst newSize = new Dimension(width, height);\n\t\tif (!Dimension.equals(newSize, this._size)) {\n\t\t\tthis.domNode.style.height = height + 'px';\n\t\t\tthis.domNode.style.width = width + 'px';\n\t\t\tthis._size = newSize;\n\t\t\tthis._northSash.layout();\n\t\t\tthis._eastSash.layout();\n\t\t\tthis._southSash.layout();\n\t\t\tthis._westSash.layout();\n\t\t}\n\t}\n\n\tclearSashHoverState(): void {\n\t\tthis._eastSash.clearSashHoverState();\n\t\tthis._westSash.clearSashHoverState();\n\t\tthis._northSash.clearSashHoverState();\n\t\tthis._southSash.clearSashHoverState();\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\tset maxSize(value: Dimension) {\n\t\tthis._maxSize = value;\n\t}\n\n\tget maxSize() {\n\t\treturn this._maxSize;\n\t}\n\n\tset minSize(value: Dimension) {\n\t\tthis._minSize = value;\n\t}\n\n\tget minSize() {\n\t\treturn this._minSize;\n\t}\n\n\tset preferredSize(value: Dimension | undefined) {\n\t\tthis._preferredSize = value;\n\t}\n\n\tget preferredSize() {\n\t\treturn this._preferredSize;\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 { Dimension } from '../../dom.js';\nimport { Orientation, OrthogonalEdge, Sash, SashState } from '../sash/sash.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { DisposableStore } from '../../../common/lifecycle.js';\n\n\nexport interface IResizeEvent {\n\tdimension: Dimension;\n\tdone: boolean;\n\treset?: 'width' | 'height';\n\tnorth?: boolean;\n\teast?: boolean;\n\tsouth?: boolean;\n\twest?: boolean;\n}\n\nexport class ResizableHTMLElement {\n\n\treadonly domNode: HTMLElement;\n\n\tprivate readonly _onDidWillResize = new Emitter<void>();\n\tget onDidWillResize() { return this._onDidWillResize.event; }\n\n\tprivate readonly _onDidResize = new Emitter<IResizeEvent>();\n\tget onDidResize() { return this._onDidResize.event; }\n\n\tprivate readonly _northSash: Sash;\n\tprivate readonly _eastSash: Sash;\n\tprivate readonly _southSash: Sash;\n\tprivate readonly _westSash: Sash;\n\tprivate readonly _sashListener = new DisposableStore();\n\n\tprivate _size = new Dimension(0, 0);\n\tprivate _minSize = new Dimension(0, 0);\n\tprivate _maxSize = new Dimension(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\n\tprivate _preferredSize?: Dimension;\n\n\tconstructor() {\n\t\tthis.domNode = document.createElement('div');\n\t\tthis._eastSash = new Sash(this.domNode, { getVerticalSashLeft: () => this._size.width }, { orientation: Orientation.VERTICAL });\n\t\tthis._westSash = new Sash(this.domNode, { getVerticalSashLeft: () => 0 }, { orientation: Orientation.VERTICAL });\n\t\tthis._northSash = new Sash(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.North });\n\t\tthis._southSash = new Sash(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: Orientation.HORIZONTAL, orthogonalEdge: OrthogonalEdge.South });\n\n\t\tthis._northSash.orthogonalStartSash = this._westSash;\n\t\tthis._northSash.orthogonalEndSash = this._eastSash;\n\t\tthis._southSash.orthogonalStartSash = this._westSash;\n\t\tthis._southSash.orthogonalEndSash = this._eastSash;\n\n\t\tlet currentSize: Dimension | undefined;\n\t\tlet deltaY = 0;\n\t\tlet deltaX = 0;\n\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => {\n\t\t\tif (currentSize === undefined) {\n\t\t\t\tthis._onDidWillResize.fire();\n\t\t\t\tcurrentSize = this._size;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => {\n\t\t\tif (currentSize !== undefined) {\n\t\t\t\tcurrentSize = undefined;\n\t\t\t\tdeltaY = 0;\n\t\t\t\tdeltaX = 0;\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(this._eastSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = e.currentX - e.startX;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, east: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._westSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaX = -(e.currentX - e.startX);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, west: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._northSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = -(e.currentY - e.startY);\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, north: true });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(this._southSash.onDidChange(e => {\n\t\t\tif (currentSize) {\n\t\t\t\tdeltaY = e.currentY - e.startY;\n\t\t\t\tthis.layout(currentSize.height + deltaY, currentSize.width + deltaX);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: false, south: true });\n\t\t\t}\n\t\t}));\n\n\t\tthis._sashListener.add(Event.any(this._eastSash.onDidReset, this._westSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._size.height, this._preferredSize.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true, reset: 'width' });\n\t\t\t}\n\t\t}));\n\t\tthis._sashListener.add(Event.any(this._northSash.onDidReset, this._southSash.onDidReset)(e => {\n\t\t\tif (this._preferredSize) {\n\t\t\t\tthis.layout(this._preferredSize.height, this._size.width);\n\t\t\t\tthis._onDidResize.fire({ dimension: this._size, done: true, reset: 'height' });\n\t\t\t}\n\t\t}));\n\t}\n\n\tdispose(): void {\n\t\tthis._northSash.dispose();\n\t\tthis._southSash.dispose();\n\t\tthis._eastSash.dispose();\n\t\tthis._westSash.dispose();\n\t\tthis._sashListener.dispose();\n\t\tthis._onDidResize.dispose();\n\t\tthis._onDidWillResize.dispose();\n\t\tthis.domNode.remove();\n\t}\n\n\tenableSashes(north: boolean, east: boolean, south: boolean, west: boolean): void {\n\t\tthis._northSash.state = north ? SashState.Enabled : SashState.Disabled;\n\t\tthis._eastSash.state = east ? SashState.Enabled : SashState.Disabled;\n\t\tthis._southSash.state = south ? SashState.Enabled : SashState.Disabled;\n\t\tthis._westSash.state = west ? SashState.Enabled : SashState.Disabled;\n\t}\n\n\tlayout(height: number = this.size.height, width: number = this.size.width): void {\n\n\t\tconst { height: minHeight, width: minWidth } = this._minSize;\n\t\tconst { height: maxHeight, width: maxWidth } = this._maxSize;\n\n\t\theight = Math.max(minHeight, Math.min(maxHeight, height));\n\t\twidth = Math.max(minWidth, Math.min(maxWidth, width));\n\n\t\tconst newSize = new Dimension(width, height);\n\t\tif (!Dimension.equals(newSize, this._size)) {\n\t\t\tthis.domNode.style.height = height + 'px';\n\t\t\tthis.domNode.style.width = width + 'px';\n\t\t\tthis._size = newSize;\n\t\t\tthis._northSash.layout();\n\t\t\tthis._eastSash.layout();\n\t\t\tthis._southSash.layout();\n\t\t\tthis._westSash.layout();\n\t\t}\n\t}\n\n\tclearSashHoverState(): void {\n\t\tthis._eastSash.clearSashHoverState();\n\t\tthis._westSash.clearSashHoverState();\n\t\tthis._northSash.clearSashHoverState();\n\t\tthis._southSash.clearSashHoverState();\n\t}\n\n\tget size() {\n\t\treturn this._size;\n\t}\n\n\tset maxSize(value: Dimension) {\n\t\tthis._maxSize = value;\n\t}\n\n\tget maxSize() {\n\t\treturn this._maxSize;\n\t}\n\n\tset minSize(value: Dimension) {\n\t\tthis._minSize = value;\n\t}\n\n\tget minSize() {\n\t\treturn this._minSize;\n\t}\n\n\tset preferredSize(value: Dimension | undefined) {\n\t\tthis._preferredSize = value;\n\t}\n\n\tget preferredSize() {\n\t\treturn this._preferredSize;\n\t}\n}\n"]}
@@ -157,10 +157,14 @@ export function escapeMarkdownLinkText(text) {
157
157
  .replace(/[!-/:-@[-`{-~]/g, '\\$&'); // CodeQL [SM02383] All ASCII punctuation, including the backslash, is escaped
158
158
  }
159
159
  /**
160
+ * Wraps code in a fenced code block. A line that starts with at least as many
161
+ * backticks as the fence, after up to three spaces of indentation, would close
162
+ * it, so the fence is made longer than any such run.
163
+ *
160
164
  * @see https://github.com/microsoft/vscode/issues/193746
161
165
  */
162
166
  export function appendEscapedMarkdownCodeBlockFence(code, langId) {
163
- const longestFenceLength = code.match(/^`+/gm)?.reduce((a, b) => (a.length > b.length ? a : b)).length ??
167
+ const longestFenceLength = code.match(/^ {0,3}`+/gm)?.reduce((longest, fence) => Math.max(longest, fence.trimStart().length), 0) ??
164
168
  0;
165
169
  const desiredFenceLength = longestFenceLength >= 3 ? longestFenceLength + 1 : 3;
166
170
  // the markdown result
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/htmlContent.ts","vs/base/common/htmlContent.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAsB9C,MAAM,OAAO,cAAc;IAU1B,YACC,QAAgB,EAAE,EAClB,qBAAyK,KAAK;QAE9K,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACpC,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QAED,IAAI,OAAO,kBAAkB,KAAK,SAAS,EAAE,CAAC;YAC7C,IAAI,CAAC,SAAS,GAAG,kBAAkB,CAAC;YACpC,IAAI,CAAC,iBAAi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AAC;IAC9C,CAAC;SAAM,CAAC;QACP,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvD,CAAC;AACF,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,GAAG,WAAsB;IAC5E,OAAO,GAAG,CAAC,IAAI,CAAC;QACf,MAAM,EAAE,OAAO,CAAC,OAAO;QACvB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;KACvF,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAEjE,uFAAuF;AACvF,MAAM,UAAU,oBAAoB,CAAC,MAAc;IAClD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC;WAC1E,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC","file":"htmlContent.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 { illegalArgument } from './errors.js';\nimport { escapeIcons } from './iconLabels.js';\nimport { matchesSomeScheme, Schemas } from './network.js';\nimport { dirname, isEqual, resolvePath } from './resources.js';\nimport { URI, UriComponents } from './uri.js';\n\nexport interface MarkdownStringTrustedOptions {\n\treadonly enabledCommands: readonly string[];\n}\n\nexport interface IMarkdownString {\n\treadonly value: string;\n\treadonly isTrusted?: boolean | MarkdownStringTrustedOptions;\n\treadonly supportThemeIcons?: boolean;\n\treadonly supportHtml?: boolean;\n\t/** @internal */\n\treadonly supportAlertSyntax?: boolean;\n\treadonly baseUri?: UriComponents;\n\turis?: { [href: string]: UriComponents };\n}\n\nexport const enum MarkdownStringTextNewlineStyle {\n\tParagraph = 0,\n\tBreak = 1,\n}\n\nexport class MarkdownString implements IMarkdownString {\n\n\tpublic value: string;\n\tpublic isTrusted?: boolean | MarkdownStringTrustedOptions;\n\tpublic supportThemeIcons?: boolean;\n\tpublic supportHtml?: boolean;\n\tpublic supportAlertSyntax?: boolean;\n\tpublic baseUri?: URI;\n\tpublic uris?: { [href: string]: UriComponents } | undefined;\n\n\tconstructor(\n\t\tvalue: string = '',\n\t\tisTrustedOrOptions: boolean | { isTrusted?: boolean | MarkdownStringTrustedOptions; supportThemeIcons?: boolean; supportHtml?: boolean; supportAlertSyntax?: boolean } = false,\n\t) {\n\t\tthis.value = value;\n\t\tif (typeof this.value !== 'string') {\n\t\t\tthrow illegalArgument('value');\n\t\t}\n\n\t\tif (typeof isTrustedOrOptions === 'boolean') {\n\t\t\tthis.isTrusted = isTrustedOrOptions;\n\t\t\tthis.supportThemeIcons = false;\n\t\t\tthis.supportHtml = false;\n\t\t\tthis.supportAlertSyntax = false;\n\t\t}\n\t\telse {\n\t\t\tthis.isTrusted = isTrustedOrOptions.isTrusted ?? undefined;\n\t\t\tthis.supportThemeIcons = isTrustedOrOptions.supportThemeIcons ?? false;\n\t\t\tthis.supportHtml = isTrustedOrOptions.supportHtml ?? false;\n\t\t\tthis.supportAlertSyntax = isTrustedOrOptions.supportAlertSyntax ?? false;\n\t\t}\n\t}\n\n\tappendText(value: string, newlineStyle: MarkdownStringTextNewlineStyle = MarkdownStringTextNewlineStyle.Paragraph): MarkdownString {\n\t\tthis.value += escapeMarkdownSyntaxTokens(this.supportThemeIcons ? escapeIcons(value) : value) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/([ \\t]+)/g, (_match, g1) => '&nbsp;'.repeat(g1.length)) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\>/gm, '\\\\>') // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\n/g, newlineStyle === MarkdownStringTextNewlineStyle.Break ? '\\\\\\n' : '\\n\\n'); // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\n\t\treturn this;\n\t}\n\n\tappendMarkdown(value: string): MarkdownString {\n\t\tthis.value += value;\n\t\treturn this;\n\t}\n\n\tappendCodeblock(langId: string, code: string): MarkdownString {\n\t\tthis.value += `\\n${appendEscapedMarkdownCodeBlockFence(code, langId)}\\n`;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Appends a link.\n\t *\n\t * @param target The link target, used literally: it cannot end the link or add Markdown.\n\t * It is not validated, so check the scheme of untrusted targets before using them in trusted Markdown.\n\t * @param label The link text as Markdown. Use {@link escapeMarkdownLinkLabel} for plain text.\n\t * @param title The link title, used literally.\n\t */\n\tappendLink(target: URI | string, label: string, title?: string): MarkdownString {\n\t\tthis.value += '[';\n\t\tthis.value += this._escape(label, ']');\n\t\tthis.value += '](';\n\t\tthis.value += escapeMarkdownLinkDestination(String(target));\n\t\tif (title) {\n\t\t\tthis.value += ` \"${escapeMarkdownLinkTitle(title)}\"`;\n\t\t}\n\t\tthis.value += ')';\n\t\treturn this;\n\t}\n\n\tprivate _escape(value: string, ch: string): string {\n\t\t// A delimiter is already escaped only if it follows an odd number of backslashes:\n\t\t// in `\\\\]` the first backslash escapes the second one, which leaves `]` unescaped.\n\t\t// A trailing odd run of backslashes is completed as well, so that it cannot escape\n\t\t// the delimiter that is appended after the value.\n\t\tlet result = '';\n\t\tlet backslashes = 0;\n\t\tfor (const c of value) {\n\t\t\tif (c === ch && backslashes % 2 === 0) {\n\t\t\t\tresult += '\\\\';\n\t\t\t}\n\t\t\tbackslashes = c === '\\\\' ? backslashes + 1 : 0;\n\t\t\tresult += c;\n\t\t}\n\t\treturn backslashes % 2 === 1 ? result + '\\\\' : result;\n\t}\n}\n\n/**\n * Escapes a string for use as a Markdown link destination: whitespace and control characters,\n * which would end the destination, are percent-encoded and Markdown syntax is backslash-escaped.\n */\nfunction escapeMarkdownLinkDestination(target: string): string {\n\treturn target\n\t\t.replace(/[\\s\\x00-\\x1f\\x7f]/g, ch => encodeURIComponent(ch))\n\t\t.replace(/[\\\\()<>]/g, '\\\\$&');\n}\n\n/**\n * Escapes a string for use as a double-quoted Markdown link title. Line breaks are replaced,\n * because an empty line would end the paragraph and with it the link. Characters that the\n * Markdown parser interprets in titles are written as character references, not backslash\n * escapes: marked reads `\\\\\"` as an escaped quote, so a title ending in a backslash would\n * otherwise extend into the following text.\n */\nfunction escapeMarkdownLinkTitle(title: string): string {\n\treturn title\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/\\0/g, '\\uFFFD') // HTML cannot represent NUL\n\t\t.replace(/[&\\\\\"()\\t]/g, ch => `&#${ch.charCodeAt(0)};`);\n}\n\nexport function isEmptyMarkdownString(oneOrMany: IMarkdownString | IMarkdownString[] | null | undefined): boolean {\n\tif (isMarkdownString(oneOrMany)) {\n\t\treturn !oneOrMany.value;\n\t} else if (Array.isArray(oneOrMany)) {\n\t\treturn oneOrMany.every(isEmptyMarkdownString);\n\t} else {\n\t\treturn true;\n\t}\n}\n\nexport function isMarkdownString(thing: unknown): thing is IMarkdownString {\n\tif (thing instanceof MarkdownString) {\n\t\treturn true;\n\t} else if (thing && typeof thing === 'object') {\n\t\treturn typeof (<IMarkdownString>thing).value === 'string'\n\t\t\t&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || typeof (<IMarkdownString>thing).isTrusted === 'object' || (<IMarkdownString>thing).isTrusted === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportThemeIcons === 'boolean' || (<IMarkdownString>thing).supportThemeIcons === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportAlertSyntax === 'boolean' || (<IMarkdownString>thing).supportAlertSyntax === undefined);\n\t}\n\treturn false;\n}\n\nexport function markdownStringEqual(a: IMarkdownString, b: IMarkdownString): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t} else if (!a || !b) {\n\t\treturn false;\n\t} else {\n\t\treturn a.value === b.value\n\t\t\t&& a.isTrusted === b.isTrusted\n\t\t\t&& a.supportThemeIcons === b.supportThemeIcons\n\t\t\t&& a.supportHtml === b.supportHtml\n\t\t\t&& a.supportAlertSyntax === b.supportAlertSyntax\n\t\t\t&& (a.baseUri === b.baseUri || !!a.baseUri && !!b.baseUri && isEqual(URI.from(a.baseUri), URI.from(b.baseUri)));\n\t}\n}\n\nexport function escapeMarkdownSyntaxTokens(text: string): string {\n\t// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n\treturn text\n\t\t.replace(/[\\\\`*_{}[\\]()#+!~]/g, '\\\\$&') // CodeQL [SM02383] Backslash is escaped in the character class\n\t\t.replace(/^([ \\t]*)-/gm, '$1\\\\-'); // CodeQL [SM02383] Backslash is escaped in the character class\n}\n\n/**\n * Escapes plain text for use as the text of a Markdown link, for example the label of\n * {@link MarkdownString.appendLink}, so that it renders literally. Unlike\n * {@link escapeMarkdownLinkLabel}, this also prevents autolinks, emphasis, code spans and\n * character references: every ASCII punctuation character is backslash-escaped. Line breaks\n * are replaced with spaces, because an empty line would end the paragraph and with it the link.\n */\nexport function escapeMarkdownLinkText(text: string): string {\n\treturn text\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/[!-/:-@[-`{-~]/g, '\\\\$&'); // CodeQL [SM02383] All ASCII punctuation, including the backslash, is escaped\n}\n\n/**\n * @see https://github.com/microsoft/vscode/issues/193746\n */\nexport function appendEscapedMarkdownCodeBlockFence(code: string, langId: string) {\n\tconst longestFenceLength =\n\t\tcode.match(/^`+/gm)?.reduce((a, b) => (a.length > b.length ? a : b)).length ??\n\t\t0;\n\tconst desiredFenceLength =\n\t\tlongestFenceLength >= 3 ? longestFenceLength + 1 : 3;\n\n\t// the markdown result\n\treturn [\n\t\t`${'`'.repeat(desiredFenceLength)}${langId}`,\n\t\tcode,\n\t\t`${'`'.repeat(desiredFenceLength)}`,\n\t].join('\\n');\n}\n\nexport function escapeDoubleQuotes(input: string) {\n\treturn input.replace(/\"/g, '&quot;');\n}\n\nexport function removeMarkdownEscapes(text: string): string {\n\tif (!text) {\n\t\treturn text;\n\t}\n\treturn text.replace(/\\\\([\\\\`*_{}[\\]()#+\\-.!~])/g, '$1');\n}\n\nexport function parseHrefAndDimensions(href: string): { href: string; dimensions: string[] } {\n\tconst dimensions: string[] = [];\n\tconst splitted = href.split('|').map(s => s.trim());\n\thref = splitted[0];\n\tconst parameters = splitted[1];\n\tif (parameters) {\n\t\tconst heightFromParams = /height=(\\d+)/.exec(parameters);\n\t\tconst widthFromParams = /width=(\\d+)/.exec(parameters);\n\t\tconst height = heightFromParams ? heightFromParams[1] : '';\n\t\tconst width = widthFromParams ? widthFromParams[1] : '';\n\t\tconst widthIsFinite = isFinite(parseInt(width));\n\t\tconst heightIsFinite = isFinite(parseInt(height));\n\t\tif (widthIsFinite) {\n\t\t\tdimensions.push(`width=\"${width}\"`);\n\t\t}\n\t\tif (heightIsFinite) {\n\t\t\tdimensions.push(`height=\"${height}\"`);\n\t\t}\n\t}\n\treturn { href, dimensions };\n}\n\n/**\n * Resolves a Markdown link or media destination against the Markdown's base URI, as the Markdown\n * renderer does. Destinations with a scheme are returned unchanged.\n */\nexport function resolveWithBaseUri(baseUri: URI, href: string): string {\n\tconst hasScheme = /^\\w[\\w\\d+.-]*:/.test(href);\n\tif (hasScheme) {\n\t\treturn href;\n\t}\n\n\tif (baseUri.path.endsWith('/')) {\n\t\treturn resolvePath(baseUri, href).toString();\n\t} else {\n\t\treturn resolvePath(dirname(baseUri), href).toString();\n\t}\n}\n\nexport function createCommandUri(commandId: string, ...commandArgs: unknown[]): URI {\n\treturn URI.from({\n\t\tscheme: Schemas.command,\n\t\tpath: commandId,\n\t\tquery: commandArgs.length ? encodeURIComponent(JSON.stringify(commandArgs)) : undefined,\n\t});\n}\n\n/**\n * VS Code addresses some content with placeholder `http` URLs whose authority is wrapped in\n * underscores, such as `http://_vscodecontentref_/0`. Underscores are illegal in hostnames, so\n * no real site collides with this shape.\n */\nconst placeholderAuthority = /^https?:\\/\\/_[^/?#]*_(?:[/?#]|$)/i;\n\n/** Whether a target still resolves once content is copied into another application. */\nexport function isPortableLinkTarget(target: string): boolean {\n\tconst trimmed = target.trim();\n\treturn matchesSomeScheme(trimmed, Schemas.http, Schemas.https, Schemas.mailto)\n\t\t&& !placeholderAuthority.test(trimmed);\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 { illegalArgument } from './errors.js';\nimport { escapeIcons } from './iconLabels.js';\nimport { matchesSomeScheme, Schemas } from './network.js';\nimport { dirname, isEqual, resolvePath } from './resources.js';\nimport { URI, UriComponents } from './uri.js';\n\nexport interface MarkdownStringTrustedOptions {\n\treadonly enabledCommands: readonly string[];\n}\n\nexport interface IMarkdownString {\n\treadonly value: string;\n\treadonly isTrusted?: boolean | MarkdownStringTrustedOptions;\n\treadonly supportThemeIcons?: boolean;\n\treadonly supportHtml?: boolean;\n\t/** @internal */\n\treadonly supportAlertSyntax?: boolean;\n\treadonly baseUri?: UriComponents;\n\turis?: { [href: string]: UriComponents };\n}\n\nexport const enum MarkdownStringTextNewlineStyle {\n\tParagraph = 0,\n\tBreak = 1,\n}\n\nexport class MarkdownString implements IMarkdownString {\n\n\tpublic value: string;\n\tpublic isTrusted?: boolean | MarkdownStringTrustedOptions;\n\tpublic supportThemeIcons?: boolean;\n\tpublic supportHtml?: boolean;\n\tpublic supportAlertSyntax?: boolean;\n\tpublic baseUri?: URI;\n\tpublic uris?: { [href: string]: UriComponents } | undefined;\n\n\tconstructor(\n\t\tvalue: string = '',\n\t\tisTrustedOrOptions: boolean | { isTrusted?: boolean | MarkdownStringTrustedOptions; supportThemeIcons?: boolean; supportHtml?: boolean; supportAlertSyntax?: boolean } = false,\n\t) {\n\t\tthis.value = value;\n\t\tif (typeof this.value !== 'string') {\n\t\t\tthrow illegalArgument('value');\n\t\t}\n\n\t\tif (typeof isTrustedOrOptions === 'boolean') {\n\t\t\tthis.isTrusted = isTrustedOrOptions;\n\t\t\tthis.supportThemeIcons = false;\n\t\t\tthis.supportHtml = false;\n\t\t\tthis.supportAlertSyntax = false;\n\t\t}\n\t\telse {\n\t\t\tthis.isTrusted = isTrustedOrOptions.isTrusted ?? undefined;\n\t\t\tthis.supportThemeIcons = isTrustedOrOptions.supportThemeIcons ?? false;\n\t\t\tthis.supportHtml = isTrustedOrOptions.supportHtml ?? false;\n\t\t\tthis.supportAlertSyntax = isTrustedOrOptions.supportAlertSyntax ?? false;\n\t\t}\n\t}\n\n\tappendText(value: string, newlineStyle: MarkdownStringTextNewlineStyle = MarkdownStringTextNewlineStyle.Paragraph): MarkdownString {\n\t\tthis.value += escapeMarkdownSyntaxTokens(this.supportThemeIcons ? escapeIcons(value) : value) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/([ \\t]+)/g, (_match, g1) => '&nbsp;'.repeat(g1.length)) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\>/gm, '\\\\>') // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\n/g, newlineStyle === MarkdownStringTextNewlineStyle.Break ? '\\\\\\n' : '\\n\\n'); // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\n\t\treturn this;\n\t}\n\n\tappendMarkdown(value: string): MarkdownString {\n\t\tthis.value += value;\n\t\treturn this;\n\t}\n\n\tappendCodeblock(langId: string, code: string): MarkdownString {\n\t\tthis.value += `\\n${appendEscapedMarkdownCodeBlockFence(code, langId)}\\n`;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Appends a link.\n\t *\n\t * @param target The link target, used literally: it cannot end the link or add Markdown.\n\t * It is not validated, so check the scheme of untrusted targets before using them in trusted Markdown.\n\t * @param label The link text as Markdown. Use {@link escapeMarkdownLinkLabel} for plain text.\n\t * @param title The link title, used literally.\n\t */\n\tappendLink(target: URI | string, label: string, title?: string): MarkdownString {\n\t\tthis.value += '[';\n\t\tthis.value += this._escape(label, ']');\n\t\tthis.value += '](';\n\t\tthis.value += escapeMarkdownLinkDestination(String(target));\n\t\tif (title) {\n\t\t\tthis.value += ` \"${escapeMarkdownLinkTitle(title)}\"`;\n\t\t}\n\t\tthis.value += ')';\n\t\treturn this;\n\t}\n\n\tprivate _escape(value: string, ch: string): string {\n\t\t// A delimiter is already escaped only if it follows an odd number of backslashes:\n\t\t// in `\\\\]` the first backslash escapes the second one, which leaves `]` unescaped.\n\t\t// A trailing odd run of backslashes is completed as well, so that it cannot escape\n\t\t// the delimiter that is appended after the value.\n\t\tlet result = '';\n\t\tlet backslashes = 0;\n\t\tfor (const c of value) {\n\t\t\tif (c === ch && backslashes % 2 === 0) {\n\t\t\t\tresult += '\\\\';\n\t\t\t}\n\t\t\tbackslashes = c === '\\\\' ? backslashes + 1 : 0;\n\t\t\tresult += c;\n\t\t}\n\t\treturn backslashes % 2 === 1 ? result + '\\\\' : result;\n\t}\n}\n\n/**\n * Escapes a string for use as a Markdown link destination: whitespace and control characters,\n * which would end the destination, are percent-encoded and Markdown syntax is backslash-escaped.\n */\nfunction escapeMarkdownLinkDestination(target: string): string {\n\treturn target\n\t\t.replace(/[\\s\\x00-\\x1f\\x7f]/g, ch => encodeURIComponent(ch))\n\t\t.replace(/[\\\\()<>]/g, '\\\\$&');\n}\n\n/**\n * Escapes a string for use as a double-quoted Markdown link title. Line breaks are replaced,\n * because an empty line would end the paragraph and with it the link. Characters that the\n * Markdown parser interprets in titles are written as character references, not backslash\n * escapes: marked reads `\\\\\"` as an escaped quote, so a title ending in a backslash would\n * otherwise extend into the following text.\n */\nfunction escapeMarkdownLinkTitle(title: string): string {\n\treturn title\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/\\0/g, '\\uFFFD') // HTML cannot represent NUL\n\t\t.replace(/[&\\\\\"()\\t]/g, ch => `&#${ch.charCodeAt(0)};`);\n}\n\nexport function isEmptyMarkdownString(oneOrMany: IMarkdownString | IMarkdownString[] | null | undefined): boolean {\n\tif (isMarkdownString(oneOrMany)) {\n\t\treturn !oneOrMany.value;\n\t} else if (Array.isArray(oneOrMany)) {\n\t\treturn oneOrMany.every(isEmptyMarkdownString);\n\t} else {\n\t\treturn true;\n\t}\n}\n\nexport function isMarkdownString(thing: unknown): thing is IMarkdownString {\n\tif (thing instanceof MarkdownString) {\n\t\treturn true;\n\t} else if (thing && typeof thing === 'object') {\n\t\treturn typeof (<IMarkdownString>thing).value === 'string'\n\t\t\t&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || typeof (<IMarkdownString>thing).isTrusted === 'object' || (<IMarkdownString>thing).isTrusted === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportThemeIcons === 'boolean' || (<IMarkdownString>thing).supportThemeIcons === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportAlertSyntax === 'boolean' || (<IMarkdownString>thing).supportAlertSyntax === undefined);\n\t}\n\treturn false;\n}\n\nexport function markdownStringEqual(a: IMarkdownString, b: IMarkdownString): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t} else if (!a || !b) {\n\t\treturn false;\n\t} else {\n\t\treturn a.value === b.value\n\t\t\t&& a.isTrusted === b.isTrusted\n\t\t\t&& a.supportThemeIcons === b.supportThemeIcons\n\t\t\t&& a.supportHtml === b.supportHtml\n\t\t\t&& a.supportAlertSyntax === b.supportAlertSyntax\n\t\t\t&& (a.baseUri === b.baseUri || !!a.baseUri && !!b.baseUri && isEqual(URI.from(a.baseUri), URI.from(b.baseUri)));\n\t}\n}\n\nexport function escapeMarkdownSyntaxTokens(text: string): string {\n\t// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n\treturn text\n\t\t.replace(/[\\\\`*_{}[\\]()#+!~]/g, '\\\\$&') // CodeQL [SM02383] Backslash is escaped in the character class\n\t\t.replace(/^([ \\t]*)-/gm, '$1\\\\-'); // CodeQL [SM02383] Backslash is escaped in the character class\n}\n\n/**\n * Escapes plain text for use as the text of a Markdown link, for example the label of\n * {@link MarkdownString.appendLink}, so that it renders literally. Unlike\n * {@link escapeMarkdownLinkLabel}, this also prevents autolinks, emphasis, code spans and\n * character references: every ASCII punctuation character is backslash-escaped. Line breaks\n * are replaced with spaces, because an empty line would end the paragraph and with it the link.\n */\nexport function escapeMarkdownLinkText(text: string): string {\n\treturn text\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/[!-/:-@[-`{-~]/g, '\\\\$&'); // CodeQL [SM02383] All ASCII punctuation, including the backslash, is escaped\n}\n\n/**\n * @see https://github.com/microsoft/vscode/issues/193746\n */\nexport function appendEscapedMarkdownCodeBlockFence(code: string, langId: string) {\n\tconst longestFenceLength =\n\t\tcode.match(/^`+/gm)?.reduce((a, b) => (a.length > b.length ? a : b)).length ??\n\t\t0;\n\tconst desiredFenceLength =\n\t\tlongestFenceLength >= 3 ? longestFenceLength + 1 : 3;\n\n\t// the markdown result\n\treturn [\n\t\t`${'`'.repeat(desiredFenceLength)}${langId}`,\n\t\tcode,\n\t\t`${'`'.repeat(desiredFenceLength)}`,\n\t].join('\\n');\n}\n\nexport function escapeDoubleQuotes(input: string) {\n\treturn input.replace(/\"/g, '&quot;');\n}\n\nexport function removeMarkdownEscapes(text: string): string {\n\tif (!text) {\n\t\treturn text;\n\t}\n\treturn text.replace(/\\\\([\\\\`*_{}[\\]()#+\\-.!~])/g, '$1');\n}\n\nexport function parseHrefAndDimensions(href: string): { href: string; dimensions: string[] } {\n\tconst dimensions: string[] = [];\n\tconst splitted = href.split('|').map(s => s.trim());\n\thref = splitted[0];\n\tconst parameters = splitted[1];\n\tif (parameters) {\n\t\tconst heightFromParams = /height=(\\d+)/.exec(parameters);\n\t\tconst widthFromParams = /width=(\\d+)/.exec(parameters);\n\t\tconst height = heightFromParams ? heightFromParams[1] : '';\n\t\tconst width = widthFromParams ? widthFromParams[1] : '';\n\t\tconst widthIsFinite = isFinite(parseInt(width));\n\t\tconst heightIsFinite = isFinite(parseInt(height));\n\t\tif (widthIsFinite) {\n\t\t\tdimensions.push(`width=\"${width}\"`);\n\t\t}\n\t\tif (heightIsFinite) {\n\t\t\tdimensions.push(`height=\"${height}\"`);\n\t\t}\n\t}\n\treturn { href, dimensions };\n}\n\n/**\n * Resolves a Markdown link or media destination against the Markdown's base URI, as the Markdown\n * renderer does. Destinations with a scheme are returned unchanged.\n */\nexport function resolveWithBaseUri(baseUri: URI, href: string): string {\n\tconst hasScheme = /^\\w[\\w\\d+.-]*:/.test(href);\n\tif (hasScheme) {\n\t\treturn href;\n\t}\n\n\tif (baseUri.path.endsWith('/')) {\n\t\treturn resolvePath(baseUri, href).toString();\n\t} else {\n\t\treturn resolvePath(dirname(baseUri), href).toString();\n\t}\n}\n\nexport function createCommandUri(commandId: string, ...commandArgs: unknown[]): URI {\n\treturn URI.from({\n\t\tscheme: Schemas.command,\n\t\tpath: commandId,\n\t\tquery: commandArgs.length ? encodeURIComponent(JSON.stringify(commandArgs)) : undefined,\n\t});\n}\n\n/**\n * VS Code addresses some content with placeholder `http` URLs whose authority is wrapped in\n * underscores, such as `http://_vscodecontentref_/0`. Underscores are illegal in hostnames, so\n * no real site collides with this shape.\n */\nconst placeholderAuthority = /^https?:\\/\\/_[^/?#]*_(?:[/?#]|$)/i;\n\n/** Whether a target still resolves once content is copied into another application. */\nexport function isPortableLinkTarget(target: string): boolean {\n\tconst trimmed = target.trim();\n\treturn matchesSomeScheme(trimmed, Schemas.http, Schemas.https, Schemas.mailto)\n\t\t&& !placeholderAuthority.test(trimmed);\n}\n"]}
1
+ {"version":3,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AAG,mCAAmC,CAAC;AAEjE,uFAAuF;AACvF,MAAM,UAAU,oBAAoB,CAAC,MAAc;IAClD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC;WAC1E,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC","file":"htmlContent.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 { illegalArgument } from './errors.js';\nimport { escapeIcons } from './iconLabels.js';\nimport { matchesSomeScheme, Schemas } from './network.js';\nimport { dirname, isEqual, resolvePath } from './resources.js';\nimport { URI, UriComponents } from './uri.js';\n\nexport interface MarkdownStringTrustedOptions {\n\treadonly enabledCommands: readonly string[];\n}\n\nexport interface IMarkdownString {\n\treadonly value: string;\n\treadonly isTrusted?: boolean | MarkdownStringTrustedOptions;\n\treadonly supportThemeIcons?: boolean;\n\treadonly supportHtml?: boolean;\n\t/** @internal */\n\treadonly supportAlertSyntax?: boolean;\n\treadonly baseUri?: UriComponents;\n\turis?: { [href: string]: UriComponents };\n}\n\nexport const enum MarkdownStringTextNewlineStyle {\n\tParagraph = 0,\n\tBreak = 1,\n}\n\nexport class MarkdownString implements IMarkdownString {\n\n\tpublic value: string;\n\tpublic isTrusted?: boolean | MarkdownStringTrustedOptions;\n\tpublic supportThemeIcons?: boolean;\n\tpublic supportHtml?: boolean;\n\tpublic supportAlertSyntax?: boolean;\n\tpublic baseUri?: URI;\n\tpublic uris?: { [href: string]: UriComponents } | undefined;\n\n\tconstructor(\n\t\tvalue: string = '',\n\t\tisTrustedOrOptions: boolean | { isTrusted?: boolean | MarkdownStringTrustedOptions; supportThemeIcons?: boolean; supportHtml?: boolean; supportAlertSyntax?: boolean } = false,\n\t) {\n\t\tthis.value = value;\n\t\tif (typeof this.value !== 'string') {\n\t\t\tthrow illegalArgument('value');\n\t\t}\n\n\t\tif (typeof isTrustedOrOptions === 'boolean') {\n\t\t\tthis.isTrusted = isTrustedOrOptions;\n\t\t\tthis.supportThemeIcons = false;\n\t\t\tthis.supportHtml = false;\n\t\t\tthis.supportAlertSyntax = false;\n\t\t}\n\t\telse {\n\t\t\tthis.isTrusted = isTrustedOrOptions.isTrusted ?? undefined;\n\t\t\tthis.supportThemeIcons = isTrustedOrOptions.supportThemeIcons ?? false;\n\t\t\tthis.supportHtml = isTrustedOrOptions.supportHtml ?? false;\n\t\t\tthis.supportAlertSyntax = isTrustedOrOptions.supportAlertSyntax ?? false;\n\t\t}\n\t}\n\n\tappendText(value: string, newlineStyle: MarkdownStringTextNewlineStyle = MarkdownStringTextNewlineStyle.Paragraph): MarkdownString {\n\t\tthis.value += escapeMarkdownSyntaxTokens(this.supportThemeIcons ? escapeIcons(value) : value) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/([ \\t]+)/g, (_match, g1) => '&nbsp;'.repeat(g1.length)) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\>/gm, '\\\\>') // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\n/g, newlineStyle === MarkdownStringTextNewlineStyle.Break ? '\\\\\\n' : '\\n\\n'); // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\n\t\treturn this;\n\t}\n\n\tappendMarkdown(value: string): MarkdownString {\n\t\tthis.value += value;\n\t\treturn this;\n\t}\n\n\tappendCodeblock(langId: string, code: string): MarkdownString {\n\t\tthis.value += `\\n${appendEscapedMarkdownCodeBlockFence(code, langId)}\\n`;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Appends a link.\n\t *\n\t * @param target The link target, used literally: it cannot end the link or add Markdown.\n\t * It is not validated, so check the scheme of untrusted targets before using them in trusted Markdown.\n\t * @param label The link text as Markdown. Use {@link escapeMarkdownLinkLabel} for plain text.\n\t * @param title The link title, used literally.\n\t */\n\tappendLink(target: URI | string, label: string, title?: string): MarkdownString {\n\t\tthis.value += '[';\n\t\tthis.value += this._escape(label, ']');\n\t\tthis.value += '](';\n\t\tthis.value += escapeMarkdownLinkDestination(String(target));\n\t\tif (title) {\n\t\t\tthis.value += ` \"${escapeMarkdownLinkTitle(title)}\"`;\n\t\t}\n\t\tthis.value += ')';\n\t\treturn this;\n\t}\n\n\tprivate _escape(value: string, ch: string): string {\n\t\t// A delimiter is already escaped only if it follows an odd number of backslashes:\n\t\t// in `\\\\]` the first backslash escapes the second one, which leaves `]` unescaped.\n\t\t// A trailing odd run of backslashes is completed as well, so that it cannot escape\n\t\t// the delimiter that is appended after the value.\n\t\tlet result = '';\n\t\tlet backslashes = 0;\n\t\tfor (const c of value) {\n\t\t\tif (c === ch && backslashes % 2 === 0) {\n\t\t\t\tresult += '\\\\';\n\t\t\t}\n\t\t\tbackslashes = c === '\\\\' ? backslashes + 1 : 0;\n\t\t\tresult += c;\n\t\t}\n\t\treturn backslashes % 2 === 1 ? result + '\\\\' : result;\n\t}\n}\n\n/**\n * Escapes a string for use as a Markdown link destination: whitespace and control characters,\n * which would end the destination, are percent-encoded and Markdown syntax is backslash-escaped.\n */\nfunction escapeMarkdownLinkDestination(target: string): string {\n\treturn target\n\t\t.replace(/[\\s\\x00-\\x1f\\x7f]/g, ch => encodeURIComponent(ch))\n\t\t.replace(/[\\\\()<>]/g, '\\\\$&');\n}\n\n/**\n * Escapes a string for use as a double-quoted Markdown link title. Line breaks are replaced,\n * because an empty line would end the paragraph and with it the link. Characters that the\n * Markdown parser interprets in titles are written as character references, not backslash\n * escapes: marked reads `\\\\\"` as an escaped quote, so a title ending in a backslash would\n * otherwise extend into the following text.\n */\nfunction escapeMarkdownLinkTitle(title: string): string {\n\treturn title\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/\\0/g, '\\uFFFD') // HTML cannot represent NUL\n\t\t.replace(/[&\\\\\"()\\t]/g, ch => `&#${ch.charCodeAt(0)};`);\n}\n\nexport function isEmptyMarkdownString(oneOrMany: IMarkdownString | IMarkdownString[] | null | undefined): boolean {\n\tif (isMarkdownString(oneOrMany)) {\n\t\treturn !oneOrMany.value;\n\t} else if (Array.isArray(oneOrMany)) {\n\t\treturn oneOrMany.every(isEmptyMarkdownString);\n\t} else {\n\t\treturn true;\n\t}\n}\n\nexport function isMarkdownString(thing: unknown): thing is IMarkdownString {\n\tif (thing instanceof MarkdownString) {\n\t\treturn true;\n\t} else if (thing && typeof thing === 'object') {\n\t\treturn typeof (<IMarkdownString>thing).value === 'string'\n\t\t\t&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || typeof (<IMarkdownString>thing).isTrusted === 'object' || (<IMarkdownString>thing).isTrusted === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportThemeIcons === 'boolean' || (<IMarkdownString>thing).supportThemeIcons === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportAlertSyntax === 'boolean' || (<IMarkdownString>thing).supportAlertSyntax === undefined);\n\t}\n\treturn false;\n}\n\nexport function markdownStringEqual(a: IMarkdownString, b: IMarkdownString): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t} else if (!a || !b) {\n\t\treturn false;\n\t} else {\n\t\treturn a.value === b.value\n\t\t\t&& a.isTrusted === b.isTrusted\n\t\t\t&& a.supportThemeIcons === b.supportThemeIcons\n\t\t\t&& a.supportHtml === b.supportHtml\n\t\t\t&& a.supportAlertSyntax === b.supportAlertSyntax\n\t\t\t&& (a.baseUri === b.baseUri || !!a.baseUri && !!b.baseUri && isEqual(URI.from(a.baseUri), URI.from(b.baseUri)));\n\t}\n}\n\nexport function escapeMarkdownSyntaxTokens(text: string): string {\n\t// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n\treturn text\n\t\t.replace(/[\\\\`*_{}[\\]()#+!~]/g, '\\\\$&') // CodeQL [SM02383] Backslash is escaped in the character class\n\t\t.replace(/^([ \\t]*)-/gm, '$1\\\\-'); // CodeQL [SM02383] Backslash is escaped in the character class\n}\n\n/**\n * Escapes plain text for use as the text of a Markdown link, for example the label of\n * {@link MarkdownString.appendLink}, so that it renders literally. Unlike\n * {@link escapeMarkdownLinkLabel}, this also prevents autolinks, emphasis, code spans and\n * character references: every ASCII punctuation character is backslash-escaped. Line breaks\n * are replaced with spaces, because an empty line would end the paragraph and with it the link.\n */\nexport function escapeMarkdownLinkText(text: string): string {\n\treturn text\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/[!-/:-@[-`{-~]/g, '\\\\$&'); // CodeQL [SM02383] All ASCII punctuation, including the backslash, is escaped\n}\n\n/**\n * Wraps code in a fenced code block. A line that starts with at least as many\n * backticks as the fence, after up to three spaces of indentation, would close\n * it, so the fence is made longer than any such run.\n *\n * @see https://github.com/microsoft/vscode/issues/193746\n */\nexport function appendEscapedMarkdownCodeBlockFence(code: string, langId: string) {\n\tconst longestFenceLength =\n\t\tcode.match(/^ {0,3}`+/gm)?.reduce((longest, fence) => Math.max(longest, fence.trimStart().length), 0) ??\n\t\t0;\n\tconst desiredFenceLength =\n\t\tlongestFenceLength >= 3 ? longestFenceLength + 1 : 3;\n\n\t// the markdown result\n\treturn [\n\t\t`${'`'.repeat(desiredFenceLength)}${langId}`,\n\t\tcode,\n\t\t`${'`'.repeat(desiredFenceLength)}`,\n\t].join('\\n');\n}\n\nexport function escapeDoubleQuotes(input: string) {\n\treturn input.replace(/\"/g, '&quot;');\n}\n\nexport function removeMarkdownEscapes(text: string): string {\n\tif (!text) {\n\t\treturn text;\n\t}\n\treturn text.replace(/\\\\([\\\\`*_{}[\\]()#+\\-.!~])/g, '$1');\n}\n\nexport function parseHrefAndDimensions(href: string): { href: string; dimensions: string[] } {\n\tconst dimensions: string[] = [];\n\tconst splitted = href.split('|').map(s => s.trim());\n\thref = splitted[0];\n\tconst parameters = splitted[1];\n\tif (parameters) {\n\t\tconst heightFromParams = /height=(\\d+)/.exec(parameters);\n\t\tconst widthFromParams = /width=(\\d+)/.exec(parameters);\n\t\tconst height = heightFromParams ? heightFromParams[1] : '';\n\t\tconst width = widthFromParams ? widthFromParams[1] : '';\n\t\tconst widthIsFinite = isFinite(parseInt(width));\n\t\tconst heightIsFinite = isFinite(parseInt(height));\n\t\tif (widthIsFinite) {\n\t\t\tdimensions.push(`width=\"${width}\"`);\n\t\t}\n\t\tif (heightIsFinite) {\n\t\t\tdimensions.push(`height=\"${height}\"`);\n\t\t}\n\t}\n\treturn { href, dimensions };\n}\n\n/**\n * Resolves a Markdown link or media destination against the Markdown's base URI, as the Markdown\n * renderer does. Destinations with a scheme are returned unchanged.\n */\nexport function resolveWithBaseUri(baseUri: URI, href: string): string {\n\tconst hasScheme = /^\\w[\\w\\d+.-]*:/.test(href);\n\tif (hasScheme) {\n\t\treturn href;\n\t}\n\n\tif (baseUri.path.endsWith('/')) {\n\t\treturn resolvePath(baseUri, href).toString();\n\t} else {\n\t\treturn resolvePath(dirname(baseUri), href).toString();\n\t}\n}\n\nexport function createCommandUri(commandId: string, ...commandArgs: unknown[]): URI {\n\treturn URI.from({\n\t\tscheme: Schemas.command,\n\t\tpath: commandId,\n\t\tquery: commandArgs.length ? encodeURIComponent(JSON.stringify(commandArgs)) : undefined,\n\t});\n}\n\n/**\n * VS Code addresses some content with placeholder `http` URLs whose authority is wrapped in\n * underscores, such as `http://_vscodecontentref_/0`. Underscores are illegal in hostnames, so\n * no real site collides with this shape.\n */\nconst placeholderAuthority = /^https?:\\/\\/_[^/?#]*_(?:[/?#]|$)/i;\n\n/** Whether a target still resolves once content is copied into another application. */\nexport function isPortableLinkTarget(target: string): boolean {\n\tconst trimmed = target.trim();\n\treturn matchesSomeScheme(trimmed, Schemas.http, Schemas.https, Schemas.mailto)\n\t\t&& !placeholderAuthority.test(trimmed);\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 { illegalArgument } from './errors.js';\nimport { escapeIcons } from './iconLabels.js';\nimport { matchesSomeScheme, Schemas } from './network.js';\nimport { dirname, isEqual, resolvePath } from './resources.js';\nimport { URI, UriComponents } from './uri.js';\n\nexport interface MarkdownStringTrustedOptions {\n\treadonly enabledCommands: readonly string[];\n}\n\nexport interface IMarkdownString {\n\treadonly value: string;\n\treadonly isTrusted?: boolean | MarkdownStringTrustedOptions;\n\treadonly supportThemeIcons?: boolean;\n\treadonly supportHtml?: boolean;\n\t/** @internal */\n\treadonly supportAlertSyntax?: boolean;\n\treadonly baseUri?: UriComponents;\n\turis?: { [href: string]: UriComponents };\n}\n\nexport const enum MarkdownStringTextNewlineStyle {\n\tParagraph = 0,\n\tBreak = 1,\n}\n\nexport class MarkdownString implements IMarkdownString {\n\n\tpublic value: string;\n\tpublic isTrusted?: boolean | MarkdownStringTrustedOptions;\n\tpublic supportThemeIcons?: boolean;\n\tpublic supportHtml?: boolean;\n\tpublic supportAlertSyntax?: boolean;\n\tpublic baseUri?: URI;\n\tpublic uris?: { [href: string]: UriComponents } | undefined;\n\n\tconstructor(\n\t\tvalue: string = '',\n\t\tisTrustedOrOptions: boolean | { isTrusted?: boolean | MarkdownStringTrustedOptions; supportThemeIcons?: boolean; supportHtml?: boolean; supportAlertSyntax?: boolean } = false,\n\t) {\n\t\tthis.value = value;\n\t\tif (typeof this.value !== 'string') {\n\t\t\tthrow illegalArgument('value');\n\t\t}\n\n\t\tif (typeof isTrustedOrOptions === 'boolean') {\n\t\t\tthis.isTrusted = isTrustedOrOptions;\n\t\t\tthis.supportThemeIcons = false;\n\t\t\tthis.supportHtml = false;\n\t\t\tthis.supportAlertSyntax = false;\n\t\t}\n\t\telse {\n\t\t\tthis.isTrusted = isTrustedOrOptions.isTrusted ?? undefined;\n\t\t\tthis.supportThemeIcons = isTrustedOrOptions.supportThemeIcons ?? false;\n\t\t\tthis.supportHtml = isTrustedOrOptions.supportHtml ?? false;\n\t\t\tthis.supportAlertSyntax = isTrustedOrOptions.supportAlertSyntax ?? false;\n\t\t}\n\t}\n\n\tappendText(value: string, newlineStyle: MarkdownStringTextNewlineStyle = MarkdownStringTextNewlineStyle.Paragraph): MarkdownString {\n\t\tthis.value += escapeMarkdownSyntaxTokens(this.supportThemeIcons ? escapeIcons(value) : value) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/([ \\t]+)/g, (_match, g1) => '&nbsp;'.repeat(g1.length)) // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\>/gm, '\\\\>') // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\t\t\t.replace(/\\n/g, newlineStyle === MarkdownStringTextNewlineStyle.Break ? '\\\\\\n' : '\\n\\n'); // CodeQL [SM02383] The Markdown is fully sanitized after being rendered.\n\n\t\treturn this;\n\t}\n\n\tappendMarkdown(value: string): MarkdownString {\n\t\tthis.value += value;\n\t\treturn this;\n\t}\n\n\tappendCodeblock(langId: string, code: string): MarkdownString {\n\t\tthis.value += `\\n${appendEscapedMarkdownCodeBlockFence(code, langId)}\\n`;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Appends a link.\n\t *\n\t * @param target The link target, used literally: it cannot end the link or add Markdown.\n\t * It is not validated, so check the scheme of untrusted targets before using them in trusted Markdown.\n\t * @param label The link text as Markdown. Use {@link escapeMarkdownLinkLabel} for plain text.\n\t * @param title The link title, used literally.\n\t */\n\tappendLink(target: URI | string, label: string, title?: string): MarkdownString {\n\t\tthis.value += '[';\n\t\tthis.value += this._escape(label, ']');\n\t\tthis.value += '](';\n\t\tthis.value += escapeMarkdownLinkDestination(String(target));\n\t\tif (title) {\n\t\t\tthis.value += ` \"${escapeMarkdownLinkTitle(title)}\"`;\n\t\t}\n\t\tthis.value += ')';\n\t\treturn this;\n\t}\n\n\tprivate _escape(value: string, ch: string): string {\n\t\t// A delimiter is already escaped only if it follows an odd number of backslashes:\n\t\t// in `\\\\]` the first backslash escapes the second one, which leaves `]` unescaped.\n\t\t// A trailing odd run of backslashes is completed as well, so that it cannot escape\n\t\t// the delimiter that is appended after the value.\n\t\tlet result = '';\n\t\tlet backslashes = 0;\n\t\tfor (const c of value) {\n\t\t\tif (c === ch && backslashes % 2 === 0) {\n\t\t\t\tresult += '\\\\';\n\t\t\t}\n\t\t\tbackslashes = c === '\\\\' ? backslashes + 1 : 0;\n\t\t\tresult += c;\n\t\t}\n\t\treturn backslashes % 2 === 1 ? result + '\\\\' : result;\n\t}\n}\n\n/**\n * Escapes a string for use as a Markdown link destination: whitespace and control characters,\n * which would end the destination, are percent-encoded and Markdown syntax is backslash-escaped.\n */\nfunction escapeMarkdownLinkDestination(target: string): string {\n\treturn target\n\t\t.replace(/[\\s\\x00-\\x1f\\x7f]/g, ch => encodeURIComponent(ch))\n\t\t.replace(/[\\\\()<>]/g, '\\\\$&');\n}\n\n/**\n * Escapes a string for use as a double-quoted Markdown link title. Line breaks are replaced,\n * because an empty line would end the paragraph and with it the link. Characters that the\n * Markdown parser interprets in titles are written as character references, not backslash\n * escapes: marked reads `\\\\\"` as an escaped quote, so a title ending in a backslash would\n * otherwise extend into the following text.\n */\nfunction escapeMarkdownLinkTitle(title: string): string {\n\treturn title\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/\\0/g, '\\uFFFD') // HTML cannot represent NUL\n\t\t.replace(/[&\\\\\"()\\t]/g, ch => `&#${ch.charCodeAt(0)};`);\n}\n\nexport function isEmptyMarkdownString(oneOrMany: IMarkdownString | IMarkdownString[] | null | undefined): boolean {\n\tif (isMarkdownString(oneOrMany)) {\n\t\treturn !oneOrMany.value;\n\t} else if (Array.isArray(oneOrMany)) {\n\t\treturn oneOrMany.every(isEmptyMarkdownString);\n\t} else {\n\t\treturn true;\n\t}\n}\n\nexport function isMarkdownString(thing: unknown): thing is IMarkdownString {\n\tif (thing instanceof MarkdownString) {\n\t\treturn true;\n\t} else if (thing && typeof thing === 'object') {\n\t\treturn typeof (<IMarkdownString>thing).value === 'string'\n\t\t\t&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || typeof (<IMarkdownString>thing).isTrusted === 'object' || (<IMarkdownString>thing).isTrusted === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportThemeIcons === 'boolean' || (<IMarkdownString>thing).supportThemeIcons === undefined)\n\t\t\t&& (typeof (<IMarkdownString>thing).supportAlertSyntax === 'boolean' || (<IMarkdownString>thing).supportAlertSyntax === undefined);\n\t}\n\treturn false;\n}\n\nexport function markdownStringEqual(a: IMarkdownString, b: IMarkdownString): boolean {\n\tif (a === b) {\n\t\treturn true;\n\t} else if (!a || !b) {\n\t\treturn false;\n\t} else {\n\t\treturn a.value === b.value\n\t\t\t&& a.isTrusted === b.isTrusted\n\t\t\t&& a.supportThemeIcons === b.supportThemeIcons\n\t\t\t&& a.supportHtml === b.supportHtml\n\t\t\t&& a.supportAlertSyntax === b.supportAlertSyntax\n\t\t\t&& (a.baseUri === b.baseUri || !!a.baseUri && !!b.baseUri && isEqual(URI.from(a.baseUri), URI.from(b.baseUri)));\n\t}\n}\n\nexport function escapeMarkdownSyntaxTokens(text: string): string {\n\t// escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n\treturn text\n\t\t.replace(/[\\\\`*_{}[\\]()#+!~]/g, '\\\\$&') // CodeQL [SM02383] Backslash is escaped in the character class\n\t\t.replace(/^([ \\t]*)-/gm, '$1\\\\-'); // CodeQL [SM02383] Backslash is escaped in the character class\n}\n\n/**\n * Escapes plain text for use as the text of a Markdown link, for example the label of\n * {@link MarkdownString.appendLink}, so that it renders literally. Unlike\n * {@link escapeMarkdownLinkLabel}, this also prevents autolinks, emphasis, code spans and\n * character references: every ASCII punctuation character is backslash-escaped. Line breaks\n * are replaced with spaces, because an empty line would end the paragraph and with it the link.\n */\nexport function escapeMarkdownLinkText(text: string): string {\n\treturn text\n\t\t.replace(/\\r\\n|[\\r\\n]/g, ' ')\n\t\t.replace(/[!-/:-@[-`{-~]/g, '\\\\$&'); // CodeQL [SM02383] All ASCII punctuation, including the backslash, is escaped\n}\n\n/**\n * Wraps code in a fenced code block. A line that starts with at least as many\n * backticks as the fence, after up to three spaces of indentation, would close\n * it, so the fence is made longer than any such run.\n *\n * @see https://github.com/microsoft/vscode/issues/193746\n */\nexport function appendEscapedMarkdownCodeBlockFence(code: string, langId: string) {\n\tconst longestFenceLength =\n\t\tcode.match(/^ {0,3}`+/gm)?.reduce((longest, fence) => Math.max(longest, fence.trimStart().length), 0) ??\n\t\t0;\n\tconst desiredFenceLength =\n\t\tlongestFenceLength >= 3 ? longestFenceLength + 1 : 3;\n\n\t// the markdown result\n\treturn [\n\t\t`${'`'.repeat(desiredFenceLength)}${langId}`,\n\t\tcode,\n\t\t`${'`'.repeat(desiredFenceLength)}`,\n\t].join('\\n');\n}\n\nexport function escapeDoubleQuotes(input: string) {\n\treturn input.replace(/\"/g, '&quot;');\n}\n\nexport function removeMarkdownEscapes(text: string): string {\n\tif (!text) {\n\t\treturn text;\n\t}\n\treturn text.replace(/\\\\([\\\\`*_{}[\\]()#+\\-.!~])/g, '$1');\n}\n\nexport function parseHrefAndDimensions(href: string): { href: string; dimensions: string[] } {\n\tconst dimensions: string[] = [];\n\tconst splitted = href.split('|').map(s => s.trim());\n\thref = splitted[0];\n\tconst parameters = splitted[1];\n\tif (parameters) {\n\t\tconst heightFromParams = /height=(\\d+)/.exec(parameters);\n\t\tconst widthFromParams = /width=(\\d+)/.exec(parameters);\n\t\tconst height = heightFromParams ? heightFromParams[1] : '';\n\t\tconst width = widthFromParams ? widthFromParams[1] : '';\n\t\tconst widthIsFinite = isFinite(parseInt(width));\n\t\tconst heightIsFinite = isFinite(parseInt(height));\n\t\tif (widthIsFinite) {\n\t\t\tdimensions.push(`width=\"${width}\"`);\n\t\t}\n\t\tif (heightIsFinite) {\n\t\t\tdimensions.push(`height=\"${height}\"`);\n\t\t}\n\t}\n\treturn { href, dimensions };\n}\n\n/**\n * Resolves a Markdown link or media destination against the Markdown's base URI, as the Markdown\n * renderer does. Destinations with a scheme are returned unchanged.\n */\nexport function resolveWithBaseUri(baseUri: URI, href: string): string {\n\tconst hasScheme = /^\\w[\\w\\d+.-]*:/.test(href);\n\tif (hasScheme) {\n\t\treturn href;\n\t}\n\n\tif (baseUri.path.endsWith('/')) {\n\t\treturn resolvePath(baseUri, href).toString();\n\t} else {\n\t\treturn resolvePath(dirname(baseUri), href).toString();\n\t}\n}\n\nexport function createCommandUri(commandId: string, ...commandArgs: unknown[]): URI {\n\treturn URI.from({\n\t\tscheme: Schemas.command,\n\t\tpath: commandId,\n\t\tquery: commandArgs.length ? encodeURIComponent(JSON.stringify(commandArgs)) : undefined,\n\t});\n}\n\n/**\n * VS Code addresses some content with placeholder `http` URLs whose authority is wrapped in\n * underscores, such as `http://_vscodecontentref_/0`. Underscores are illegal in hostnames, so\n * no real site collides with this shape.\n */\nconst placeholderAuthority = /^https?:\\/\\/_[^/?#]*_(?:[/?#]|$)/i;\n\n/** Whether a target still resolves once content is copied into another application. */\nexport function isPortableLinkTarget(target: string): boolean {\n\tconst trimmed = target.trim();\n\treturn matchesSomeScheme(trimmed, Schemas.http, Schemas.https, Schemas.mailto)\n\t\t&& !placeholderAuthority.test(trimmed);\n}\n"]}
@@ -11,6 +11,7 @@
11
11
  scrollbar-width: none;
12
12
  z-index: -10;
13
13
  white-space: pre-wrap;
14
+ caret-animation: manual;
14
15
  }
15
16
 
16
17
  .monaco-editor .ime-text-area {
@@ -13,7 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  };
14
14
  import './nativeEditContext.css';
15
15
  import { isFirefox } from '../../../../../base/browser/browser.js';
16
- import { addDisposableListener, getActiveElement, getWindow, getWindowId } from '../../../../../base/browser/dom.js';
16
+ import { addDisposableListener, getActiveElement, getShadowRoot, getWindow, getWindowId } from '../../../../../base/browser/dom.js';
17
17
  import { FastDomNode } from '../../../../../base/browser/fastDomNode.js';
18
18
  import { StandardKeyboardEvent } from '../../../../../base/browser/keyboardEvent.js';
19
19
  import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
@@ -197,11 +197,22 @@ let NativeEditContext = class NativeEditContext extends AbstractEditContext {
197
197
  this._context.viewModel.onCompositionEnd();
198
198
  }));
199
199
  let reenableTracking = false;
200
+ this._register(addDisposableListener(this._imeTextArea.domNode, 'blur', e => {
201
+ // Focus moved to another element while IME is disabled (a null relatedTarget means the window lost focus)
202
+ if (reenableTracking && e.relatedTarget && e.relatedTarget !== this.domNode.domNode) {
203
+ reenableTracking = false;
204
+ this._focusTracker.resume();
205
+ }
206
+ }));
200
207
  this._register(IME.onDidChange(() => {
201
208
  if (IME.enabled && reenableTracking) {
202
- this._focusTracker.resume();
203
- this.domNode.focus();
204
209
  reenableTracking = false;
210
+ this._focusTracker.resume();
211
+ const shadowRoot = getShadowRoot(this._imeTextArea.domNode);
212
+ const activeElement = shadowRoot ? shadowRoot.activeElement : this._imeTextArea.domNode.ownerDocument.activeElement;
213
+ if (activeElement === this._imeTextArea.domNode) {
214
+ this.domNode.focus();
215
+ }
205
216
  }
206
217
  if (!IME.enabled && this.isFocused()) {
207
218
  this._focusTracker.pause();