diff --git a/.gitattributes b/.gitattributes index 95c709bf9f17112de54d80b61a14b804f48f2311..67b86fb8eae0d7511fde7f0ed28b64eaab1f1cb6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1953,3 +1953,4 @@ platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-c platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/dev/vs/editor/editor.main.js.map filter=lfs diff=lfs merge=lfs -text platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/dev/vs/language/typescript/tsWorker.js filter=lfs diff=lfs merge=lfs -text platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/min-maps/vs/editor/editor.main.js.map filter=lfs diff=lfs merge=lfs -text diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/menuColors.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/menuColors.js new file mode 100644 index 0000000000000000000000000000000000000000..b91abbdb571b9ac24e34a02455cc1eff71c77613 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/menuColors.js @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as nls from '../../../../nls.js'; +// Import the effects we need +import { registerColor } from '../colorUtils.js'; +// Import the colors we need +import { contrastBorder, activeContrastBorder } from './baseColors.js'; +import { selectForeground, selectBackground } from './inputColors.js'; +import { listActiveSelectionBackground, listActiveSelectionForeground } from './listColors.js'; +export const menuBorder = registerColor('menu.border', { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('menuBorder', "Border color of menus.")); +export const menuForeground = registerColor('menu.foreground', selectForeground, nls.localize('menuForeground', "Foreground color of menu items.")); +export const menuBackground = registerColor('menu.background', selectBackground, nls.localize('menuBackground', "Background color of menu items.")); +export const menuSelectionForeground = registerColor('menu.selectionForeground', listActiveSelectionForeground, nls.localize('menuSelectionForeground', "Foreground color of the selected menu item in menus.")); +export const menuSelectionBackground = registerColor('menu.selectionBackground', listActiveSelectionBackground, nls.localize('menuSelectionBackground', "Background color of the selected menu item in menus.")); +export const menuSelectionBorder = registerColor('menu.selectionBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('menuSelectionBorder', "Border color of the selected menu item in menus.")); +export const menuSeparatorBackground = registerColor('menu.separatorBackground', { dark: '#606060', light: '#D4D4D4', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('menuSeparatorBackground', "Color of a separator menu item in menus.")); diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/minimapColors.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/minimapColors.js new file mode 100644 index 0000000000000000000000000000000000000000..d4447edfd2e13150386dbc9950caf37a86f51965 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/minimapColors.js @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as nls from '../../../../nls.js'; +// Import the effects we need +import { Color, RGBA } from '../../../../base/common/color.js'; +import { registerColor, transparent } from '../colorUtils.js'; +// Import the colors we need +import { editorInfoForeground, editorWarningForeground, editorWarningBorder, editorInfoBorder } from './editorColors.js'; +import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from './miscColors.js'; +export const minimapFindMatch = registerColor('minimap.findMatchHighlight', { light: '#d18616', dark: '#d18616', hcDark: '#AB5A00', hcLight: '#0F4A85' }, nls.localize('minimapFindMatchHighlight', 'Minimap marker color for find matches.'), true); +export const minimapSelectionOccurrenceHighlight = registerColor('minimap.selectionOccurrenceHighlight', { light: '#c9c9c9', dark: '#676767', hcDark: '#ffffff', hcLight: '#0F4A85' }, nls.localize('minimapSelectionOccurrenceHighlight', 'Minimap marker color for repeating editor selections.'), true); +export const minimapSelection = registerColor('minimap.selectionHighlight', { light: '#ADD6FF', dark: '#264F78', hcDark: '#ffffff', hcLight: '#0F4A85' }, nls.localize('minimapSelectionHighlight', 'Minimap marker color for the editor selection.'), true); +export const minimapInfo = registerColor('minimap.infoHighlight', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoBorder, hcLight: editorInfoBorder }, nls.localize('minimapInfo', 'Minimap marker color for infos.')); +export const minimapWarning = registerColor('minimap.warningHighlight', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningBorder, hcLight: editorWarningBorder }, nls.localize('overviewRuleWarning', 'Minimap marker color for warnings.')); +export const minimapError = registerColor('minimap.errorHighlight', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '#B5200D' }, nls.localize('minimapError', 'Minimap marker color for errors.')); +export const minimapBackground = registerColor('minimap.background', null, nls.localize('minimapBackground', "Minimap background color.")); +export const minimapForegroundOpacity = registerColor('minimap.foregroundOpacity', Color.fromHex('#000f'), nls.localize('minimapForegroundOpacity', 'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')); +export const minimapSliderBackground = registerColor('minimapSlider.background', transparent(scrollbarSliderBackground, 0.5), nls.localize('minimapSliderBackground', "Minimap slider background color.")); +export const minimapSliderHoverBackground = registerColor('minimapSlider.hoverBackground', transparent(scrollbarSliderHoverBackground, 0.5), nls.localize('minimapSliderHoverBackground', "Minimap slider background color when hovering.")); +export const minimapSliderActiveBackground = registerColor('minimapSlider.activeBackground', transparent(scrollbarSliderActiveBackground, 0.5), nls.localize('minimapSliderActiveBackground', "Minimap slider background color when clicked on.")); diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/miscColors.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/miscColors.js new file mode 100644 index 0000000000000000000000000000000000000000..b9bc3e0c7a98c053900756c4f0c38f987fe35f81 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/miscColors.js @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as nls from '../../../../nls.js'; +// Import the effects we need +import { Color } from '../../../../base/common/color.js'; +import { registerColor, transparent } from '../colorUtils.js'; +// Import the colors we need +import { contrastBorder, focusBorder } from './baseColors.js'; +// ----- sash +export const sashHoverBorder = registerColor('sash.hoverBorder', focusBorder, nls.localize('sashActiveBorder', "Border color of active sashes.")); +// ----- badge +export const badgeBackground = registerColor('badge.background', { dark: '#4D4D4D', light: '#C4C4C4', hcDark: Color.black, hcLight: '#0F4A85' }, nls.localize('badgeBackground', "Badge background color. Badges are small information labels, e.g. for search results count.")); +export const badgeForeground = registerColor('badge.foreground', { dark: Color.white, light: '#333', hcDark: Color.white, hcLight: Color.white }, nls.localize('badgeForeground', "Badge foreground color. Badges are small information labels, e.g. for search results count.")); +// ----- scrollbar +export const scrollbarShadow = registerColor('scrollbar.shadow', { dark: '#000000', light: '#DDDDDD', hcDark: null, hcLight: null }, nls.localize('scrollbarShadow', "Scrollbar shadow to indicate that the view is scrolled.")); +export const scrollbarSliderBackground = registerColor('scrollbarSlider.background', { dark: Color.fromHex('#797979').transparent(0.4), light: Color.fromHex('#646464').transparent(0.4), hcDark: transparent(contrastBorder, 0.6), hcLight: transparent(contrastBorder, 0.4) }, nls.localize('scrollbarSliderBackground', "Scrollbar slider background color.")); +export const scrollbarSliderHoverBackground = registerColor('scrollbarSlider.hoverBackground', { dark: Color.fromHex('#646464').transparent(0.7), light: Color.fromHex('#646464').transparent(0.7), hcDark: transparent(contrastBorder, 0.8), hcLight: transparent(contrastBorder, 0.8) }, nls.localize('scrollbarSliderHoverBackground', "Scrollbar slider background color when hovering.")); +export const scrollbarSliderActiveBackground = registerColor('scrollbarSlider.activeBackground', { dark: Color.fromHex('#BFBFBF').transparent(0.4), light: Color.fromHex('#000000').transparent(0.6), hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('scrollbarSliderActiveBackground', "Scrollbar slider background color when clicked on.")); +// ----- progress bar +export const progressBarBackground = registerColor('progressBar.background', { dark: Color.fromHex('#0E70C0'), light: Color.fromHex('#0E70C0'), hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('progressBarBackground', "Background color of the progress bar that can show for long running operations.")); diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/quickpickColors.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/quickpickColors.js new file mode 100644 index 0000000000000000000000000000000000000000..68004f7973ce9536312353103334c2a838e862f5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/quickpickColors.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as nls from '../../../../nls.js'; +// Import the effects we need +import { Color, RGBA } from '../../../../base/common/color.js'; +import { registerColor, oneOf } from '../colorUtils.js'; +// Import the colors we need +import { editorWidgetBackground, editorWidgetForeground } from './editorColors.js'; +import { listActiveSelectionBackground, listActiveSelectionForeground, listActiveSelectionIconForeground } from './listColors.js'; +export const quickInputBackground = registerColor('quickInput.background', editorWidgetBackground, nls.localize('pickerBackground', "Quick picker background color. The quick picker widget is the container for pickers like the command palette.")); +export const quickInputForeground = registerColor('quickInput.foreground', editorWidgetForeground, nls.localize('pickerForeground', "Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")); +export const quickInputTitleBackground = registerColor('quickInputTitle.background', { dark: new Color(new RGBA(255, 255, 255, 0.105)), light: new Color(new RGBA(0, 0, 0, 0.06)), hcDark: '#000000', hcLight: Color.white }, nls.localize('pickerTitleBackground', "Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")); +export const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hcDark: Color.white, hcLight: '#0F4A85' }, nls.localize('pickerGroupForeground', "Quick picker color for grouping labels.")); +export const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hcDark: Color.white, hcLight: '#0F4A85' }, nls.localize('pickerGroupBorder', "Quick picker color for grouping borders.")); +export const _deprecatedQuickInputListFocusBackground = registerColor('quickInput.list.focusBackground', null, '', undefined, nls.localize('quickInput.list.focusBackground deprecation', "Please use quickInputList.focusBackground instead")); +export const quickInputListFocusForeground = registerColor('quickInputList.focusForeground', listActiveSelectionForeground, nls.localize('quickInput.listFocusForeground', "Quick picker foreground color for the focused item.")); +export const quickInputListFocusIconForeground = registerColor('quickInputList.focusIconForeground', listActiveSelectionIconForeground, nls.localize('quickInput.listFocusIconForeground', "Quick picker icon foreground color for the focused item.")); +export const quickInputListFocusBackground = registerColor('quickInputList.focusBackground', { dark: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), light: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), hcDark: null, hcLight: null }, nls.localize('quickInput.listFocusBackground', "Quick picker background color for the focused item.")); diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/searchColors.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/searchColors.js new file mode 100644 index 0000000000000000000000000000000000000000..4266afffc3a1e81377c2f48a443899293d03d51d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/theme/common/colors/searchColors.js @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as nls from '../../../../nls.js'; +// Import the effects we need +import { registerColor, transparent } from '../colorUtils.js'; +// Import the colors we need +import { foreground } from './baseColors.js'; +import { editorFindMatchHighlight, editorFindMatchHighlightBorder } from './editorColors.js'; +export const searchResultsInfoForeground = registerColor('search.resultsInfoForeground', { light: foreground, dark: transparent(foreground, 0.65), hcDark: foreground, hcLight: foreground }, nls.localize('search.resultsInfoForeground', "Color of the text in the search viewlet's completion message.")); +// ----- search editor (Distinct from normal editor find match to allow for better differentiation) +export const searchEditorFindMatch = registerColor('searchEditor.findMatchBackground', { light: transparent(editorFindMatchHighlight, 0.66), dark: transparent(editorFindMatchHighlight, 0.66), hcDark: editorFindMatchHighlight, hcLight: editorFindMatchHighlight }, nls.localize('searchEditor.queryMatch', "Color of the Search Editor query matches.")); +export const searchEditorFindMatchBorder = registerColor('searchEditor.findMatchBorder', { light: transparent(editorFindMatchHighlightBorder, 0.66), dark: transparent(editorFindMatchHighlightBorder, 0.66), hcDark: editorFindMatchHighlightBorder, hcLight: editorFindMatchHighlightBorder }, nls.localize('searchEditor.editorFindMatchBorder', "Border color of the Search Editor query matches.")); diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js new file mode 100644 index 0000000000000000000000000000000000000000..0307489705d7eaa72bf04abf5c00c0b5e5d1b6a9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { createDecorator } from '../../instantiation/common/instantiation.js'; +export const IUndoRedoService = createDecorator('undoRedoService'); +export class ResourceEditStackSnapshot { + constructor(resource, elements) { + this.resource = resource; + this.elements = elements; + } +} +export class UndoRedoGroup { + static { this._ID = 0; } + constructor() { + this.id = UndoRedoGroup._ID++; + this.order = 1; + } + nextOrder() { + if (this.id === 0) { + return 0; + } + return this.order++; + } + static { this.None = new UndoRedoGroup(); } +} +export class UndoRedoSource { + static { this._ID = 0; } + constructor() { + this.id = UndoRedoSource._ID++; + this.order = 1; + } + nextOrder() { + if (this.id === 0) { + return 0; + } + return this.order++; + } + static { this.None = new UndoRedoSource(); } +} diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedoService.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedoService.js new file mode 100644 index 0000000000000000000000000000000000000000..b0dd5e910b27f10c1f3cda7cd08d46935e0f9c53 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedoService.js @@ -0,0 +1,1093 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +import { onUnexpectedError } from '../../../base/common/errors.js'; +import { Disposable, isDisposable } from '../../../base/common/lifecycle.js'; +import { Schemas } from '../../../base/common/network.js'; +import Severity from '../../../base/common/severity.js'; +import * as nls from '../../../nls.js'; +import { IDialogService } from '../../dialogs/common/dialogs.js'; +import { registerSingleton } from '../../instantiation/common/extensions.js'; +import { INotificationService } from '../../notification/common/notification.js'; +import { IUndoRedoService, ResourceEditStackSnapshot, UndoRedoGroup, UndoRedoSource } from './undoRedo.js'; +const DEBUG = false; +function getResourceLabel(resource) { + return resource.scheme === Schemas.file ? resource.fsPath : resource.path; +} +let stackElementCounter = 0; +class ResourceStackElement { + constructor(actual, resourceLabel, strResource, groupId, groupOrder, sourceId, sourceOrder) { + this.id = (++stackElementCounter); + this.type = 0 /* UndoRedoElementType.Resource */; + this.actual = actual; + this.label = actual.label; + this.confirmBeforeUndo = actual.confirmBeforeUndo || false; + this.resourceLabel = resourceLabel; + this.strResource = strResource; + this.resourceLabels = [this.resourceLabel]; + this.strResources = [this.strResource]; + this.groupId = groupId; + this.groupOrder = groupOrder; + this.sourceId = sourceId; + this.sourceOrder = sourceOrder; + this.isValid = true; + } + setValid(isValid) { + this.isValid = isValid; + } + toString() { + return `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? ' VALID' : 'INVALID'}] ${this.actual.constructor.name} - ${this.actual}`; + } +} +class ResourceReasonPair { + constructor(resourceLabel, reason) { + this.resourceLabel = resourceLabel; + this.reason = reason; + } +} +class RemovedResources { + constructor() { + this.elements = new Map(); + } + createMessage() { + const externalRemoval = []; + const noParallelUniverses = []; + for (const [, element] of this.elements) { + const dest = (element.reason === 0 /* RemovedResourceReason.ExternalRemoval */ + ? externalRemoval + : noParallelUniverses); + dest.push(element.resourceLabel); + } + const messages = []; + if (externalRemoval.length > 0) { + messages.push(nls.localize({ key: 'externalRemoval', comment: ['{0} is a list of filenames'] }, "The following files have been closed and modified on disk: {0}.", externalRemoval.join(', '))); + } + if (noParallelUniverses.length > 0) { + messages.push(nls.localize({ key: 'noParallelUniverses', comment: ['{0} is a list of filenames'] }, "The following files have been modified in an incompatible way: {0}.", noParallelUniverses.join(', '))); + } + return messages.join('\n'); + } + get size() { + return this.elements.size; + } + has(strResource) { + return this.elements.has(strResource); + } + set(strResource, value) { + this.elements.set(strResource, value); + } + delete(strResource) { + return this.elements.delete(strResource); + } +} +class WorkspaceStackElement { + constructor(actual, resourceLabels, strResources, groupId, groupOrder, sourceId, sourceOrder) { + this.id = (++stackElementCounter); + this.type = 1 /* UndoRedoElementType.Workspace */; + this.actual = actual; + this.label = actual.label; + this.confirmBeforeUndo = actual.confirmBeforeUndo || false; + this.resourceLabels = resourceLabels; + this.strResources = strResources; + this.groupId = groupId; + this.groupOrder = groupOrder; + this.sourceId = sourceId; + this.sourceOrder = sourceOrder; + this.removedResources = null; + this.invalidatedResources = null; + } + canSplit() { + return (typeof this.actual.split === 'function'); + } + removeResource(resourceLabel, strResource, reason) { + if (!this.removedResources) { + this.removedResources = new RemovedResources(); + } + if (!this.removedResources.has(strResource)) { + this.removedResources.set(strResource, new ResourceReasonPair(resourceLabel, reason)); + } + } + setValid(resourceLabel, strResource, isValid) { + if (isValid) { + if (this.invalidatedResources) { + this.invalidatedResources.delete(strResource); + if (this.invalidatedResources.size === 0) { + this.invalidatedResources = null; + } + } + } + else { + if (!this.invalidatedResources) { + this.invalidatedResources = new RemovedResources(); + } + if (!this.invalidatedResources.has(strResource)) { + this.invalidatedResources.set(strResource, new ResourceReasonPair(resourceLabel, 0 /* RemovedResourceReason.ExternalRemoval */)); + } + } + } + toString() { + return `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? 'INVALID' : ' VALID'}] ${this.actual.constructor.name} - ${this.actual}`; + } +} +class ResourceEditStack { + constructor(resourceLabel, strResource) { + this.resourceLabel = resourceLabel; + this.strResource = strResource; + this._past = []; + this._future = []; + this.locked = false; + this.versionId = 1; + } + dispose() { + for (const element of this._past) { + if (element.type === 1 /* UndoRedoElementType.Workspace */) { + element.removeResource(this.resourceLabel, this.strResource, 0 /* RemovedResourceReason.ExternalRemoval */); + } + } + for (const element of this._future) { + if (element.type === 1 /* UndoRedoElementType.Workspace */) { + element.removeResource(this.resourceLabel, this.strResource, 0 /* RemovedResourceReason.ExternalRemoval */); + } + } + this.versionId++; + } + toString() { + const result = []; + result.push(`* ${this.strResource}:`); + for (let i = 0; i < this._past.length; i++) { + result.push(` * [UNDO] ${this._past[i]}`); + } + for (let i = this._future.length - 1; i >= 0; i--) { + result.push(` * [REDO] ${this._future[i]}`); + } + return result.join('\n'); + } + flushAllElements() { + this._past = []; + this._future = []; + this.versionId++; + } + _setElementValidFlag(element, isValid) { + if (element.type === 1 /* UndoRedoElementType.Workspace */) { + element.setValid(this.resourceLabel, this.strResource, isValid); + } + else { + element.setValid(isValid); + } + } + setElementsValidFlag(isValid, filter) { + for (const element of this._past) { + if (filter(element.actual)) { + this._setElementValidFlag(element, isValid); + } + } + for (const element of this._future) { + if (filter(element.actual)) { + this._setElementValidFlag(element, isValid); + } + } + } + pushElement(element) { + // remove the future + for (const futureElement of this._future) { + if (futureElement.type === 1 /* UndoRedoElementType.Workspace */) { + futureElement.removeResource(this.resourceLabel, this.strResource, 1 /* RemovedResourceReason.NoParallelUniverses */); + } + } + this._future = []; + this._past.push(element); + this.versionId++; + } + createSnapshot(resource) { + const elements = []; + for (let i = 0, len = this._past.length; i < len; i++) { + elements.push(this._past[i].id); + } + for (let i = this._future.length - 1; i >= 0; i--) { + elements.push(this._future[i].id); + } + return new ResourceEditStackSnapshot(resource, elements); + } + restoreSnapshot(snapshot) { + const snapshotLength = snapshot.elements.length; + let isOK = true; + let snapshotIndex = 0; + let removePastAfter = -1; + for (let i = 0, len = this._past.length; i < len; i++, snapshotIndex++) { + const element = this._past[i]; + if (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) { + isOK = false; + removePastAfter = 0; + } + if (!isOK && element.type === 1 /* UndoRedoElementType.Workspace */) { + element.removeResource(this.resourceLabel, this.strResource, 0 /* RemovedResourceReason.ExternalRemoval */); + } + } + let removeFutureBefore = -1; + for (let i = this._future.length - 1; i >= 0; i--, snapshotIndex++) { + const element = this._future[i]; + if (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) { + isOK = false; + removeFutureBefore = i; + } + if (!isOK && element.type === 1 /* UndoRedoElementType.Workspace */) { + element.removeResource(this.resourceLabel, this.strResource, 0 /* RemovedResourceReason.ExternalRemoval */); + } + } + if (removePastAfter !== -1) { + this._past = this._past.slice(0, removePastAfter); + } + if (removeFutureBefore !== -1) { + this._future = this._future.slice(removeFutureBefore + 1); + } + this.versionId++; + } + getElements() { + const past = []; + const future = []; + for (const element of this._past) { + past.push(element.actual); + } + for (const element of this._future) { + future.push(element.actual); + } + return { past, future }; + } + getClosestPastElement() { + if (this._past.length === 0) { + return null; + } + return this._past[this._past.length - 1]; + } + getSecondClosestPastElement() { + if (this._past.length < 2) { + return null; + } + return this._past[this._past.length - 2]; + } + getClosestFutureElement() { + if (this._future.length === 0) { + return null; + } + return this._future[this._future.length - 1]; + } + hasPastElements() { + return (this._past.length > 0); + } + hasFutureElements() { + return (this._future.length > 0); + } + splitPastWorkspaceElement(toRemove, individualMap) { + for (let j = this._past.length - 1; j >= 0; j--) { + if (this._past[j] === toRemove) { + if (individualMap.has(this.strResource)) { + // gets replaced + this._past[j] = individualMap.get(this.strResource); + } + else { + // gets deleted + this._past.splice(j, 1); + } + break; + } + } + this.versionId++; + } + splitFutureWorkspaceElement(toRemove, individualMap) { + for (let j = this._future.length - 1; j >= 0; j--) { + if (this._future[j] === toRemove) { + if (individualMap.has(this.strResource)) { + // gets replaced + this._future[j] = individualMap.get(this.strResource); + } + else { + // gets deleted + this._future.splice(j, 1); + } + break; + } + } + this.versionId++; + } + moveBackward(element) { + this._past.pop(); + this._future.push(element); + this.versionId++; + } + moveForward(element) { + this._future.pop(); + this._past.push(element); + this.versionId++; + } +} +class EditStackSnapshot { + constructor(editStacks) { + this.editStacks = editStacks; + this._versionIds = []; + for (let i = 0, len = this.editStacks.length; i < len; i++) { + this._versionIds[i] = this.editStacks[i].versionId; + } + } + isValid() { + for (let i = 0, len = this.editStacks.length; i < len; i++) { + if (this._versionIds[i] !== this.editStacks[i].versionId) { + return false; + } + } + return true; + } +} +const missingEditStack = new ResourceEditStack('', ''); +missingEditStack.locked = true; +let UndoRedoService = class UndoRedoService { + constructor(_dialogService, _notificationService) { + this._dialogService = _dialogService; + this._notificationService = _notificationService; + this._editStacks = new Map(); + this._uriComparisonKeyComputers = []; + } + getUriComparisonKey(resource) { + for (const uriComparisonKeyComputer of this._uriComparisonKeyComputers) { + if (uriComparisonKeyComputer[0] === resource.scheme) { + return uriComparisonKeyComputer[1].getComparisonKey(resource); + } + } + return resource.toString(); + } + _print(label) { + console.log(`------------------------------------`); + console.log(`AFTER ${label}: `); + const str = []; + for (const element of this._editStacks) { + str.push(element[1].toString()); + } + console.log(str.join('\n')); + } + pushElement(element, group = UndoRedoGroup.None, source = UndoRedoSource.None) { + if (element.type === 0 /* UndoRedoElementType.Resource */) { + const resourceLabel = getResourceLabel(element.resource); + const strResource = this.getUriComparisonKey(element.resource); + this._pushElement(new ResourceStackElement(element, resourceLabel, strResource, group.id, group.nextOrder(), source.id, source.nextOrder())); + } + else { + const seen = new Set(); + const resourceLabels = []; + const strResources = []; + for (const resource of element.resources) { + const resourceLabel = getResourceLabel(resource); + const strResource = this.getUriComparisonKey(resource); + if (seen.has(strResource)) { + continue; + } + seen.add(strResource); + resourceLabels.push(resourceLabel); + strResources.push(strResource); + } + if (resourceLabels.length === 1) { + this._pushElement(new ResourceStackElement(element, resourceLabels[0], strResources[0], group.id, group.nextOrder(), source.id, source.nextOrder())); + } + else { + this._pushElement(new WorkspaceStackElement(element, resourceLabels, strResources, group.id, group.nextOrder(), source.id, source.nextOrder())); + } + } + if (DEBUG) { + this._print('pushElement'); + } + } + _pushElement(element) { + for (let i = 0, len = element.strResources.length; i < len; i++) { + const resourceLabel = element.resourceLabels[i]; + const strResource = element.strResources[i]; + let editStack; + if (this._editStacks.has(strResource)) { + editStack = this._editStacks.get(strResource); + } + else { + editStack = new ResourceEditStack(resourceLabel, strResource); + this._editStacks.set(strResource, editStack); + } + editStack.pushElement(element); + } + } + getLastElement(resource) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + if (editStack.hasFutureElements()) { + return null; + } + const closestPastElement = editStack.getClosestPastElement(); + return closestPastElement ? closestPastElement.actual : null; + } + return null; + } + _splitPastWorkspaceElement(toRemove, ignoreResources) { + const individualArr = toRemove.actual.split(); + const individualMap = new Map(); + for (const _element of individualArr) { + const resourceLabel = getResourceLabel(_element.resource); + const strResource = this.getUriComparisonKey(_element.resource); + const element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0); + individualMap.set(element.strResource, element); + } + for (const strResource of toRemove.strResources) { + if (ignoreResources && ignoreResources.has(strResource)) { + continue; + } + const editStack = this._editStacks.get(strResource); + editStack.splitPastWorkspaceElement(toRemove, individualMap); + } + } + _splitFutureWorkspaceElement(toRemove, ignoreResources) { + const individualArr = toRemove.actual.split(); + const individualMap = new Map(); + for (const _element of individualArr) { + const resourceLabel = getResourceLabel(_element.resource); + const strResource = this.getUriComparisonKey(_element.resource); + const element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0); + individualMap.set(element.strResource, element); + } + for (const strResource of toRemove.strResources) { + if (ignoreResources && ignoreResources.has(strResource)) { + continue; + } + const editStack = this._editStacks.get(strResource); + editStack.splitFutureWorkspaceElement(toRemove, individualMap); + } + } + removeElements(resource) { + const strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + editStack.dispose(); + this._editStacks.delete(strResource); + } + if (DEBUG) { + this._print('removeElements'); + } + } + setElementsValidFlag(resource, isValid, filter) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + editStack.setElementsValidFlag(isValid, filter); + } + if (DEBUG) { + this._print('setElementsValidFlag'); + } + } + createSnapshot(resource) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.createSnapshot(resource); + } + return new ResourceEditStackSnapshot(resource, []); + } + restoreSnapshot(snapshot) { + const strResource = this.getUriComparisonKey(snapshot.resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + editStack.restoreSnapshot(snapshot); + if (!editStack.hasPastElements() && !editStack.hasFutureElements()) { + // the edit stack is now empty, just remove it entirely + editStack.dispose(); + this._editStacks.delete(strResource); + } + } + if (DEBUG) { + this._print('restoreSnapshot'); + } + } + getElements(resource) { + const strResource = this.getUriComparisonKey(resource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.getElements(); + } + return { past: [], future: [] }; + } + _findClosestUndoElementWithSource(sourceId) { + if (!sourceId) { + return [null, null]; + } + // find an element with the sourceId and with the highest sourceOrder ready to be undone + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestPastElement(); + if (!candidate) { + continue; + } + if (candidate.sourceId === sourceId) { + if (!matchedElement || candidate.sourceOrder > matchedElement.sourceOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + canUndo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id); + return matchedStrResource ? true : false; + } + const strResource = this.getUriComparisonKey(resourceOrSource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.hasPastElements(); + } + return false; + } + _onError(err, element) { + onUnexpectedError(err); + // An error occurred while undoing or redoing => drop the undo/redo stack for all affected resources + for (const strResource of element.strResources) { + this.removeElements(strResource); + } + this._notificationService.error(err); + } + _acquireLocks(editStackSnapshot) { + // first, check if all locks can be acquired + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.locked) { + throw new Error('Cannot acquire edit stack lock'); + } + } + // can acquire all locks + for (const editStack of editStackSnapshot.editStacks) { + editStack.locked = true; + } + return () => { + // release all locks + for (const editStack of editStackSnapshot.editStacks) { + editStack.locked = false; + } + }; + } + _safeInvokeWithLocks(element, invoke, editStackSnapshot, cleanup, continuation) { + const releaseLocks = this._acquireLocks(editStackSnapshot); + let result; + try { + result = invoke(); + } + catch (err) { + releaseLocks(); + cleanup.dispose(); + return this._onError(err, element); + } + if (result) { + // result is Promise + return result.then(() => { + releaseLocks(); + cleanup.dispose(); + return continuation(); + }, (err) => { + releaseLocks(); + cleanup.dispose(); + return this._onError(err, element); + }); + } + else { + // result is void + releaseLocks(); + cleanup.dispose(); + return continuation(); + } + } + async _invokeWorkspacePrepare(element) { + if (typeof element.actual.prepareUndoRedo === 'undefined') { + return Disposable.None; + } + const result = element.actual.prepareUndoRedo(); + if (typeof result === 'undefined') { + return Disposable.None; + } + return result; + } + _invokeResourcePrepare(element, callback) { + if (element.actual.type !== 1 /* UndoRedoElementType.Workspace */ || typeof element.actual.prepareUndoRedo === 'undefined') { + // no preparation needed + return callback(Disposable.None); + } + const r = element.actual.prepareUndoRedo(); + if (!r) { + // nothing to clean up + return callback(Disposable.None); + } + if (isDisposable(r)) { + return callback(r); + } + return r.then((disposable) => { + return callback(disposable); + }); + } + _getAffectedEditStacks(element) { + const affectedEditStacks = []; + for (const strResource of element.strResources) { + affectedEditStacks.push(this._editStacks.get(strResource) || missingEditStack); + } + return new EditStackSnapshot(affectedEditStacks); + } + _tryToSplitAndUndo(strResource, element, ignoreResources, message) { + if (element.canSplit()) { + this._splitPastWorkspaceElement(element, ignoreResources); + this._notificationService.warn(message); + return new WorkspaceVerificationError(this._undo(strResource, 0, true)); + } + else { + // Cannot safely split this workspace element => flush all undo/redo stacks + for (const strResource of element.strResources) { + this.removeElements(strResource); + } + this._notificationService.warn(message); + return new WorkspaceVerificationError(); + } + } + _checkWorkspaceUndo(strResource, element, editStackSnapshot, checkInvalidatedResources) { + if (element.removedResources) { + return this._tryToSplitAndUndo(strResource, element, element.removedResources, nls.localize({ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not undo '{0}' across all files. {1}", element.label, element.removedResources.createMessage())); + } + if (checkInvalidatedResources && element.invalidatedResources) { + return this._tryToSplitAndUndo(strResource, element, element.invalidatedResources, nls.localize({ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not undo '{0}' across all files. {1}", element.label, element.invalidatedResources.createMessage())); + } + // this must be the last past element in all the impacted resources! + const cannotUndoDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.getClosestPastElement() !== element) { + cannotUndoDueToResources.push(editStack.resourceLabel); + } + } + if (cannotUndoDueToResources.length > 0) { + return this._tryToSplitAndUndo(strResource, element, null, nls.localize({ key: 'cannotWorkspaceUndoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not undo '{0}' across all files because changes were made to {1}", element.label, cannotUndoDueToResources.join(', '))); + } + const cannotLockDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.locked) { + cannotLockDueToResources.push(editStack.resourceLabel); + } + } + if (cannotLockDueToResources.length > 0) { + return this._tryToSplitAndUndo(strResource, element, null, nls.localize({ key: 'cannotWorkspaceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}", element.label, cannotLockDueToResources.join(', '))); + } + // check if new stack elements were added in the meantime... + if (!editStackSnapshot.isValid()) { + return this._tryToSplitAndUndo(strResource, element, null, nls.localize({ key: 'cannotWorkspaceUndoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime", element.label)); + } + return null; + } + _workspaceUndo(strResource, element, undoConfirmed) { + const affectedEditStacks = this._getAffectedEditStacks(element); + const verificationError = this._checkWorkspaceUndo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/ false); + if (verificationError) { + return verificationError.returnValue; + } + return this._confirmAndExecuteWorkspaceUndo(strResource, element, affectedEditStacks, undoConfirmed); + } + _isPartOfUndoGroup(element) { + if (!element.groupId) { + return false; + } + // check that there is at least another element with the same groupId ready to be undone + for (const [, editStack] of this._editStacks) { + const pastElement = editStack.getClosestPastElement(); + if (!pastElement) { + continue; + } + if (pastElement === element) { + const secondPastElement = editStack.getSecondClosestPastElement(); + if (secondPastElement && secondPastElement.groupId === element.groupId) { + // there is another element with the same group id in the same stack! + return true; + } + } + if (pastElement.groupId === element.groupId) { + // there is another element with the same group id in another stack! + return true; + } + } + return false; + } + async _confirmAndExecuteWorkspaceUndo(strResource, element, editStackSnapshot, undoConfirmed) { + if (element.canSplit() && !this._isPartOfUndoGroup(element)) { + // this element can be split + let UndoChoice; + (function (UndoChoice) { + UndoChoice[UndoChoice["All"] = 0] = "All"; + UndoChoice[UndoChoice["This"] = 1] = "This"; + UndoChoice[UndoChoice["Cancel"] = 2] = "Cancel"; + })(UndoChoice || (UndoChoice = {})); + const { result } = await this._dialogService.prompt({ + type: Severity.Info, + message: nls.localize('confirmWorkspace', "Would you like to undo '{0}' across all files?", element.label), + buttons: [ + { + label: nls.localize({ key: 'ok', comment: ['{0} denotes a number that is > 1, && denotes a mnemonic'] }, "&&Undo in {0} Files", editStackSnapshot.editStacks.length), + run: () => UndoChoice.All + }, + { + label: nls.localize({ key: 'nok', comment: ['&& denotes a mnemonic'] }, "Undo this &&File"), + run: () => UndoChoice.This + } + ], + cancelButton: { + run: () => UndoChoice.Cancel + } + }); + if (result === UndoChoice.Cancel) { + // choice: cancel + return; + } + if (result === UndoChoice.This) { + // choice: undo this file + this._splitPastWorkspaceElement(element, null); + return this._undo(strResource, 0, true); + } + // choice: undo in all files + // At this point, it is possible that the element has been made invalid in the meantime (due to the confirmation await) + const verificationError1 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*invalidated resources will be checked after the prepare call*/ false); + if (verificationError1) { + return verificationError1.returnValue; + } + undoConfirmed = true; + } + // prepare + let cleanup; + try { + cleanup = await this._invokeWorkspacePrepare(element); + } + catch (err) { + return this._onError(err, element); + } + // At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await) + const verificationError2 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/ true); + if (verificationError2) { + cleanup.dispose(); + return verificationError2.returnValue; + } + for (const editStack of editStackSnapshot.editStacks) { + editStack.moveBackward(element); + } + return this._safeInvokeWithLocks(element, () => element.actual.undo(), editStackSnapshot, cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed)); + } + _resourceUndo(editStack, element, undoConfirmed) { + if (!element.isValid) { + // invalid element => immediately flush edit stack! + editStack.flushAllElements(); + return; + } + if (editStack.locked) { + const message = nls.localize({ key: 'cannotResourceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] }, "Could not undo '{0}' because there is already an undo or redo operation running.", element.label); + this._notificationService.warn(message); + return; + } + return this._invokeResourcePrepare(element, (cleanup) => { + editStack.moveBackward(element); + return this._safeInvokeWithLocks(element, () => element.actual.undo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed)); + }); + } + _findClosestUndoElementInGroup(groupId) { + if (!groupId) { + return [null, null]; + } + // find another element with the same groupId and with the highest groupOrder ready to be undone + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestPastElement(); + if (!candidate) { + continue; + } + if (candidate.groupId === groupId) { + if (!matchedElement || candidate.groupOrder > matchedElement.groupOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + _continueUndoInGroup(groupId, undoConfirmed) { + if (!groupId) { + return; + } + const [, matchedStrResource] = this._findClosestUndoElementInGroup(groupId); + if (matchedStrResource) { + return this._undo(matchedStrResource, 0, undoConfirmed); + } + } + undo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id); + return matchedStrResource ? this._undo(matchedStrResource, resourceOrSource.id, false) : undefined; + } + if (typeof resourceOrSource === 'string') { + return this._undo(resourceOrSource, 0, false); + } + return this._undo(this.getUriComparisonKey(resourceOrSource), 0, false); + } + _undo(strResource, sourceId = 0, undoConfirmed) { + if (!this._editStacks.has(strResource)) { + return; + } + const editStack = this._editStacks.get(strResource); + const element = editStack.getClosestPastElement(); + if (!element) { + return; + } + if (element.groupId) { + // this element is a part of a group, we need to make sure undoing in a group is in order + const [matchedElement, matchedStrResource] = this._findClosestUndoElementInGroup(element.groupId); + if (element !== matchedElement && matchedStrResource) { + // there is an element in the same group that should be undone before this one + return this._undo(matchedStrResource, sourceId, undoConfirmed); + } + } + const shouldPromptForConfirmation = (element.sourceId !== sourceId || element.confirmBeforeUndo); + if (shouldPromptForConfirmation && !undoConfirmed) { + // Hit a different source or the element asks for prompt before undo, prompt for confirmation + return this._confirmAndContinueUndo(strResource, sourceId, element); + } + try { + if (element.type === 1 /* UndoRedoElementType.Workspace */) { + return this._workspaceUndo(strResource, element, undoConfirmed); + } + else { + return this._resourceUndo(editStack, element, undoConfirmed); + } + } + finally { + if (DEBUG) { + this._print('undo'); + } + } + } + async _confirmAndContinueUndo(strResource, sourceId, element) { + const result = await this._dialogService.confirm({ + message: nls.localize('confirmDifferentSource', "Would you like to undo '{0}'?", element.label), + primaryButton: nls.localize({ key: 'confirmDifferentSource.yes', comment: ['&& denotes a mnemonic'] }, "&&Yes"), + cancelButton: nls.localize('confirmDifferentSource.no', "No") + }); + if (!result.confirmed) { + return; + } + return this._undo(strResource, sourceId, true); + } + _findClosestRedoElementWithSource(sourceId) { + if (!sourceId) { + return [null, null]; + } + // find an element with sourceId and with the lowest sourceOrder ready to be redone + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestFutureElement(); + if (!candidate) { + continue; + } + if (candidate.sourceId === sourceId) { + if (!matchedElement || candidate.sourceOrder < matchedElement.sourceOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + canRedo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id); + return matchedStrResource ? true : false; + } + const strResource = this.getUriComparisonKey(resourceOrSource); + if (this._editStacks.has(strResource)) { + const editStack = this._editStacks.get(strResource); + return editStack.hasFutureElements(); + } + return false; + } + _tryToSplitAndRedo(strResource, element, ignoreResources, message) { + if (element.canSplit()) { + this._splitFutureWorkspaceElement(element, ignoreResources); + this._notificationService.warn(message); + return new WorkspaceVerificationError(this._redo(strResource)); + } + else { + // Cannot safely split this workspace element => flush all undo/redo stacks + for (const strResource of element.strResources) { + this.removeElements(strResource); + } + this._notificationService.warn(message); + return new WorkspaceVerificationError(); + } + } + _checkWorkspaceRedo(strResource, element, editStackSnapshot, checkInvalidatedResources) { + if (element.removedResources) { + return this._tryToSplitAndRedo(strResource, element, element.removedResources, nls.localize({ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not redo '{0}' across all files. {1}", element.label, element.removedResources.createMessage())); + } + if (checkInvalidatedResources && element.invalidatedResources) { + return this._tryToSplitAndRedo(strResource, element, element.invalidatedResources, nls.localize({ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not redo '{0}' across all files. {1}", element.label, element.invalidatedResources.createMessage())); + } + // this must be the last future element in all the impacted resources! + const cannotRedoDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.getClosestFutureElement() !== element) { + cannotRedoDueToResources.push(editStack.resourceLabel); + } + } + if (cannotRedoDueToResources.length > 0) { + return this._tryToSplitAndRedo(strResource, element, null, nls.localize({ key: 'cannotWorkspaceRedoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not redo '{0}' across all files because changes were made to {1}", element.label, cannotRedoDueToResources.join(', '))); + } + const cannotLockDueToResources = []; + for (const editStack of editStackSnapshot.editStacks) { + if (editStack.locked) { + cannotLockDueToResources.push(editStack.resourceLabel); + } + } + if (cannotLockDueToResources.length > 0) { + return this._tryToSplitAndRedo(strResource, element, null, nls.localize({ key: 'cannotWorkspaceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}", element.label, cannotLockDueToResources.join(', '))); + } + // check if new stack elements were added in the meantime... + if (!editStackSnapshot.isValid()) { + return this._tryToSplitAndRedo(strResource, element, null, nls.localize({ key: 'cannotWorkspaceRedoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime", element.label)); + } + return null; + } + _workspaceRedo(strResource, element) { + const affectedEditStacks = this._getAffectedEditStacks(element); + const verificationError = this._checkWorkspaceRedo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/ false); + if (verificationError) { + return verificationError.returnValue; + } + return this._executeWorkspaceRedo(strResource, element, affectedEditStacks); + } + async _executeWorkspaceRedo(strResource, element, editStackSnapshot) { + // prepare + let cleanup; + try { + cleanup = await this._invokeWorkspacePrepare(element); + } + catch (err) { + return this._onError(err, element); + } + // At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await) + const verificationError = this._checkWorkspaceRedo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/ true); + if (verificationError) { + cleanup.dispose(); + return verificationError.returnValue; + } + for (const editStack of editStackSnapshot.editStacks) { + editStack.moveForward(element); + } + return this._safeInvokeWithLocks(element, () => element.actual.redo(), editStackSnapshot, cleanup, () => this._continueRedoInGroup(element.groupId)); + } + _resourceRedo(editStack, element) { + if (!element.isValid) { + // invalid element => immediately flush edit stack! + editStack.flushAllElements(); + return; + } + if (editStack.locked) { + const message = nls.localize({ key: 'cannotResourceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] }, "Could not redo '{0}' because there is already an undo or redo operation running.", element.label); + this._notificationService.warn(message); + return; + } + return this._invokeResourcePrepare(element, (cleanup) => { + editStack.moveForward(element); + return this._safeInvokeWithLocks(element, () => element.actual.redo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueRedoInGroup(element.groupId)); + }); + } + _findClosestRedoElementInGroup(groupId) { + if (!groupId) { + return [null, null]; + } + // find another element with the same groupId and with the lowest groupOrder ready to be redone + let matchedElement = null; + let matchedStrResource = null; + for (const [strResource, editStack] of this._editStacks) { + const candidate = editStack.getClosestFutureElement(); + if (!candidate) { + continue; + } + if (candidate.groupId === groupId) { + if (!matchedElement || candidate.groupOrder < matchedElement.groupOrder) { + matchedElement = candidate; + matchedStrResource = strResource; + } + } + } + return [matchedElement, matchedStrResource]; + } + _continueRedoInGroup(groupId) { + if (!groupId) { + return; + } + const [, matchedStrResource] = this._findClosestRedoElementInGroup(groupId); + if (matchedStrResource) { + return this._redo(matchedStrResource); + } + } + redo(resourceOrSource) { + if (resourceOrSource instanceof UndoRedoSource) { + const [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id); + return matchedStrResource ? this._redo(matchedStrResource) : undefined; + } + if (typeof resourceOrSource === 'string') { + return this._redo(resourceOrSource); + } + return this._redo(this.getUriComparisonKey(resourceOrSource)); + } + _redo(strResource) { + if (!this._editStacks.has(strResource)) { + return; + } + const editStack = this._editStacks.get(strResource); + const element = editStack.getClosestFutureElement(); + if (!element) { + return; + } + if (element.groupId) { + // this element is a part of a group, we need to make sure redoing in a group is in order + const [matchedElement, matchedStrResource] = this._findClosestRedoElementInGroup(element.groupId); + if (element !== matchedElement && matchedStrResource) { + // there is an element in the same group that should be redone before this one + return this._redo(matchedStrResource); + } + } + try { + if (element.type === 1 /* UndoRedoElementType.Workspace */) { + return this._workspaceRedo(strResource, element); + } + else { + return this._resourceRedo(editStack, element); + } + } + finally { + if (DEBUG) { + this._print('redo'); + } + } + } +}; +UndoRedoService = __decorate([ + __param(0, IDialogService), + __param(1, INotificationService) +], UndoRedoService); +export { UndoRedoService }; +class WorkspaceVerificationError { + constructor(returnValue) { + this.returnValue = returnValue; + } +} +registerSingleton(IUndoRedoService, UndoRedoService, 1 /* InstantiationType.Delayed */); diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js new file mode 100644 index 0000000000000000000000000000000000000000..ff9670aa5735e067733c370109ec03b6fbfa3469 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js @@ -0,0 +1,132 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { localize } from '../../../nls.js'; +import { basename } from '../../../base/common/path.js'; +import { TernarySearchTree } from '../../../base/common/ternarySearchTree.js'; +import { URI } from '../../../base/common/uri.js'; +import { createDecorator } from '../../instantiation/common/instantiation.js'; +export const IWorkspaceContextService = createDecorator('contextService'); +export function isSingleFolderWorkspaceIdentifier(obj) { + const singleFolderIdentifier = obj; + return typeof singleFolderIdentifier?.id === 'string' && URI.isUri(singleFolderIdentifier.uri); +} +export function isEmptyWorkspaceIdentifier(obj) { + const emptyWorkspaceIdentifier = obj; + return typeof emptyWorkspaceIdentifier?.id === 'string' + && !isSingleFolderWorkspaceIdentifier(obj) + && !isWorkspaceIdentifier(obj); +} +export const EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE = { id: 'ext-dev' }; +export const UNKNOWN_EMPTY_WINDOW_WORKSPACE = { id: 'empty-window' }; +export function toWorkspaceIdentifier(arg0, isExtensionDevelopment) { + // Empty workspace + if (typeof arg0 === 'string' || typeof arg0 === 'undefined') { + // With a backupPath, the basename is the empty workspace identifier + if (typeof arg0 === 'string') { + return { + id: basename(arg0) + }; + } + // Extension development empty windows have backups disabled + // so we return a constant workspace identifier for extension + // authors to allow to restore their workspace state even then. + if (isExtensionDevelopment) { + return EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE; + } + return UNKNOWN_EMPTY_WINDOW_WORKSPACE; + } + // Multi root + const workspace = arg0; + if (workspace.configuration) { + return { + id: workspace.id, + configPath: workspace.configuration + }; + } + // Single folder + if (workspace.folders.length === 1) { + return { + id: workspace.id, + uri: workspace.folders[0].uri + }; + } + // Empty window + return { + id: workspace.id + }; +} +export function isWorkspaceIdentifier(obj) { + const workspaceIdentifier = obj; + return typeof workspaceIdentifier?.id === 'string' && URI.isUri(workspaceIdentifier.configPath); +} +export class Workspace { + constructor(_id, folders, _transient, _configuration, _ignorePathCasing) { + this._id = _id; + this._transient = _transient; + this._configuration = _configuration; + this._ignorePathCasing = _ignorePathCasing; + this._foldersMap = TernarySearchTree.forUris(this._ignorePathCasing, () => true); + this.folders = folders; + } + get folders() { + return this._folders; + } + set folders(folders) { + this._folders = folders; + this.updateFoldersMap(); + } + get id() { + return this._id; + } + get transient() { + return this._transient; + } + get configuration() { + return this._configuration; + } + set configuration(configuration) { + this._configuration = configuration; + } + getFolder(resource) { + if (!resource) { + return null; + } + return this._foldersMap.findSubstr(resource) || null; + } + updateFoldersMap() { + this._foldersMap = TernarySearchTree.forUris(this._ignorePathCasing, () => true); + for (const folder of this.folders) { + this._foldersMap.set(folder.uri, folder); + } + } + toJSON() { + return { id: this.id, folders: this.folders, transient: this.transient, configuration: this.configuration }; + } +} +export class WorkspaceFolder { + constructor(data, + /** + * Provides access to the original metadata for this workspace + * folder. This can be different from the metadata provided in + * this class: + * - raw paths can be relative + * - raw paths are not normalized + */ + raw) { + this.raw = raw; + this.uri = data.uri; + this.index = data.index; + this.name = data.name; + } + toJSON() { + return { uri: this.uri, name: this.name, index: this.index }; + } +} +export const WORKSPACE_EXTENSION = 'code-workspace'; +export const WORKSPACE_FILTER = [{ name: localize('codeWorkspace', "Code Workspace"), extensions: [WORKSPACE_EXTENSION] }]; +export const STANDALONE_EDITOR_WORKSPACE_ID = '4064f6ec-cb38-4ad0-af64-ee6467e63c82'; +export function isStandaloneEditorWorkspace(workspace) { + return workspace.id === STANDALONE_EDITOR_WORKSPACE_ID; +} diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js new file mode 100644 index 0000000000000000000000000000000000000000..02cf58b30be01b081748aeeb99468e6187b8f46f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { createDecorator } from '../../instantiation/common/instantiation.js'; +export const IWorkspaceTrustManagementService = createDecorator('workspaceTrustManagementService'); diff --git a/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/min-maps/vs/base/worker/workerMain.js.map b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/min-maps/vs/base/worker/workerMain.js.map new file mode 100644 index 0000000000000000000000000000000000000000..dc67940651131278988b583acde5e545fcf60cce --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/monaco-editor/min-maps/vs/base/worker/workerMain.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["out-editor/vs/base/worker/fake","out-editor/vs/base/worker/vs/loader.js","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/worker/workerMain.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/arrays.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/arraysFind.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/cache.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/color.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/diff/diffChange.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/errors.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/assert.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/functional.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/iterator.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/keyCodes.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/lazy.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/lifecycle.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/linkedList.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/map.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/stopwatch.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/event.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/cancellation.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/strings.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/hash.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/diff/diff.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/symbols.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/types.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/codiconsUtil.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/codiconsLibrary.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/codicons.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/objects.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/uint.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/characterClassifier.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/offsetRange.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/position.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/range.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/lineRange.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/selection.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/textLength.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/positionToOffset.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/textEdit.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/wordCharacterClassifier.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/wordHelper.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/linesDiffComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/rangeMapping.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/legacyLinesDiffComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/linesDiffComputers.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/defaultDocumentColorsComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/linkComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/supports/inplaceReplaceSupport.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/prefixSumComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/mirrorTextModel.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/textModelSearch.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/editorWorkerHost.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/findSectionHeaders.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/unicodeTextModelHighlighter.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/standalone/standaloneEnums.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/tokenizationRegistry.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/nls.messages.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/nls.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/platform.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/async.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/process.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/path.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/uri.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/network.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/worker/simpleWorker.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/editorBaseApi.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/textModelSync/textModelSync.impl.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/editorSimpleWorker.ts"],"sourcesContent":["}).call(this);","/*---------------------------------------------------------------------------------------------\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'use strict';\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/*---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n * Please make sure to make edits in the .ts file at https://github.com/microsoft/vscode-loader/\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *--------------------------------------------------------------------------------------------*/\nconst _amdLoaderGlobal = this;\nconst _commonjsGlobal = typeof global === 'object' ? global : {};\nvar AMDLoader;\n(function (AMDLoader) {\n\tAMDLoader.global = _amdLoaderGlobal;\n\tclass Environment {\n\t\tget isWindows() {\n\t\t\tthis._detect();\n\t\t\treturn this._isWindows;\n\t\t}\n\t\tget isNode() {\n\t\t\tthis._detect();\n\t\t\treturn this._isNode;\n\t\t}\n\t\tget isElectronRenderer() {\n\t\t\tthis._detect();\n\t\t\treturn this._isElectronRenderer;\n\t\t}\n\t\tget isWebWorker() {\n\t\t\tthis._detect();\n\t\t\treturn this._isWebWorker;\n\t\t}\n\t\tget isElectronNodeIntegrationWebWorker() {\n\t\t\tthis._detect();\n\t\t\treturn this._isElectronNodeIntegrationWebWorker;\n\t\t}\n\t\tconstructor() {\n\t\t\tthis._detected = false;\n\t\t\tthis._isWindows = false;\n\t\t\tthis._isNode = false;\n\t\t\tthis._isElectronRenderer = false;\n\t\t\tthis._isWebWorker = false;\n\t\t\tthis._isElectronNodeIntegrationWebWorker = false;\n\t\t}\n\t\t_detect() {\n\t\t\tif (this._detected) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._detected = true;\n\t\t\tthis._isWindows = Environment._isWindows();\n\t\t\tthis._isNode = (typeof module !== 'undefined' && !!module.exports);\n\t\t\tthis._isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');\n\t\t\tthis._isWebWorker = (typeof AMDLoader.global.importScripts === 'function');\n\t\t\tthis._isElectronNodeIntegrationWebWorker = this._isWebWorker && (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'worker');\n\t\t}\n\t\tstatic _isWindows() {\n\t\t\tif (typeof navigator !== 'undefined') {\n\t\t\t\tif (navigator.userAgent && navigator.userAgent.indexOf('Windows') >= 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof process !== 'undefined') {\n\t\t\t\treturn (process.platform === 'win32');\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\tAMDLoader.Environment = Environment;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n\tclass LoaderEvent {\n\t\tconstructor(type, detail, timestamp) {\n\t\t\tthis.type = type;\n\t\t\tthis.detail = detail;\n\t\t\tthis.timestamp = timestamp;\n\t\t}\n\t}\n\tAMDLoader.LoaderEvent = LoaderEvent;\n\tclass LoaderEventRecorder {\n\t\tconstructor(loaderAvailableTimestamp) {\n\t\t\tthis._events = [new LoaderEvent(1 /* LoaderEventType.LoaderAvailable */, '', loaderAvailableTimestamp)];\n\t\t}\n\t\trecord(type, detail) {\n\t\t\tthis._events.push(new LoaderEvent(type, detail, AMDLoader.Utilities.getHighPerformanceTimestamp()));\n\t\t}\n\t\tgetEvents() {\n\t\t\treturn this._events;\n\t\t}\n\t}\n\tAMDLoader.LoaderEventRecorder = LoaderEventRecorder;\n\tclass NullLoaderEventRecorder {\n\t\trecord(type, detail) {\n\t\t\t// Nothing to do\n\t\t}\n\t\tgetEvents() {\n\t\t\treturn [];\n\t\t}\n\t}\n\tNullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder();\n\tAMDLoader.NullLoaderEventRecorder = NullLoaderEventRecorder;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n\tclass Utilities {\n\t\t/**\n\t\t * This method does not take care of / vs \\\n\t\t */\n\t\tstatic fileUriToFilePath(isWindows, uri) {\n\t\t\turi = decodeURI(uri).replace(/%23/g, '#');\n\t\t\tif (isWindows) {\n\t\t\t\tif (/^file:\\/\\/\\//.test(uri)) {\n\t\t\t\t\t// This is a URI without a hostname => return only the path segment\n\t\t\t\t\treturn uri.substr(8);\n\t\t\t\t}\n\t\t\t\tif (/^file:\\/\\//.test(uri)) {\n\t\t\t\t\treturn uri.substr(5);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (/^file:\\/\\//.test(uri)) {\n\t\t\t\t\treturn uri.substr(7);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not sure...\n\t\t\treturn uri;\n\t\t}\n\t\tstatic startsWith(haystack, needle) {\n\t\t\treturn haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;\n\t\t}\n\t\tstatic endsWith(haystack, needle) {\n\t\t\treturn haystack.length >= needle.length && haystack.substr(haystack.length - needle.length) === needle;\n\t\t}\n\t\t// only check for \"?\" before \"#\" to ensure that there is a real Query-String\n\t\tstatic containsQueryString(url) {\n\t\t\treturn /^[^\\#]*\\?/gi.test(url);\n\t\t}\n\t\t/**\n\t\t * Does `url` start with http:// or https:// or file:// or / ?\n\t\t */\n\t\tstatic isAbsolutePath(url) {\n\t\t\treturn /^((http:\\/\\/)|(https:\\/\\/)|(file:\\/\\/)|(\\/))/.test(url);\n\t\t}\n\t\tstatic forEachProperty(obj, callback) {\n\t\t\tif (obj) {\n\t\t\t\tlet key;\n\t\t\t\tfor (key in obj) {\n\t\t\t\t\tif (obj.hasOwnProperty(key)) {\n\t\t\t\t\t\tcallback(key, obj[key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tstatic isEmpty(obj) {\n\t\t\tlet isEmpty = true;\n\t\t\tUtilities.forEachProperty(obj, () => {\n\t\t\t\tisEmpty = false;\n\t\t\t});\n\t\t\treturn isEmpty;\n\t\t}\n\t\tstatic recursiveClone(obj) {\n\t\t\tif (!obj || typeof obj !== 'object' || obj instanceof RegExp) {\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\tif (!Array.isArray(obj) && Object.getPrototypeOf(obj) !== Object.prototype) {\n\t\t\t\t// only clone \"simple\" objects\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\tlet result = Array.isArray(obj) ? [] : {};\n\t\t\tUtilities.forEachProperty(obj, (key, value) => {\n\t\t\t\tif (value && typeof value === 'object') {\n\t\t\t\t\tresult[key] = Utilities.recursiveClone(value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresult[key] = value;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn result;\n\t\t}\n\t\tstatic generateAnonymousModule() {\n\t\t\treturn '===anonymous' + (Utilities.NEXT_ANONYMOUS_ID++) + '===';\n\t\t}\n\t\tstatic isAnonymousModule(id) {\n\t\t\treturn Utilities.startsWith(id, '===anonymous');\n\t\t}\n\t\tstatic getHighPerformanceTimestamp() {\n\t\t\tif (!this.PERFORMANCE_NOW_PROBED) {\n\t\t\t\tthis.PERFORMANCE_NOW_PROBED = true;\n\t\t\t\tthis.HAS_PERFORMANCE_NOW = (AMDLoader.global.performance && typeof AMDLoader.global.performance.now === 'function');\n\t\t\t}\n\t\t\treturn (this.HAS_PERFORMANCE_NOW ? AMDLoader.global.performance.now() : Date.now());\n\t\t}\n\t}\n\tUtilities.NEXT_ANONYMOUS_ID = 1;\n\tUtilities.PERFORMANCE_NOW_PROBED = false;\n\tUtilities.HAS_PERFORMANCE_NOW = false;\n\tAMDLoader.Utilities = Utilities;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n\tfunction ensureError(err) {\n\t\tif (err instanceof Error) {\n\t\t\treturn err;\n\t\t}\n\t\tconst result = new Error(err.message || String(err) || 'Unknown Error');\n\t\tif (err.stack) {\n\t\t\tresult.stack = err.stack;\n\t\t}\n\t\treturn result;\n\t}\n\tAMDLoader.ensureError = ensureError;\n\t;\n\tclass ConfigurationOptionsUtil {\n\t\t/**\n\t\t * Ensure configuration options make sense\n\t\t */\n\t\tstatic validateConfigurationOptions(options) {\n\t\t\tfunction defaultOnError(err) {\n\t\t\t\tif (err.phase === 'loading') {\n\t\t\t\t\tconsole.error('Loading \"' + err.moduleId + '\" failed');\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t\tconsole.error('Here are the modules that depend on it:');\n\t\t\t\t\tconsole.error(err.neededBy);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (err.phase === 'factory') {\n\t\t\t\t\tconsole.error('The factory function of \"' + err.moduleId + '\" has thrown an exception');\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t\tconsole.error('Here are the modules that depend on it:');\n\t\t\t\t\tconsole.error(err.neededBy);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\toptions = options || {};\n\t\t\tif (typeof options.baseUrl !== 'string') {\n\t\t\t\toptions.baseUrl = '';\n\t\t\t}\n\t\t\tif (typeof options.isBuild !== 'boolean') {\n\t\t\t\toptions.isBuild = false;\n\t\t\t}\n\t\t\tif (typeof options.paths !== 'object') {\n\t\t\t\toptions.paths = {};\n\t\t\t}\n\t\t\tif (typeof options.config !== 'object') {\n\t\t\t\toptions.config = {};\n\t\t\t}\n\t\t\tif (typeof options.catchError === 'undefined') {\n\t\t\t\toptions.catchError = false;\n\t\t\t}\n\t\t\tif (typeof options.recordStats === 'undefined') {\n\t\t\t\toptions.recordStats = false;\n\t\t\t}\n\t\t\tif (typeof options.urlArgs !== 'string') {\n\t\t\t\toptions.urlArgs = '';\n\t\t\t}\n\t\t\tif (typeof options.onError !== 'function') {\n\t\t\t\toptions.onError = defaultOnError;\n\t\t\t}\n\t\t\tif (!Array.isArray(options.ignoreDuplicateModules)) {\n\t\t\t\toptions.ignoreDuplicateModules = [];\n\t\t\t}\n\t\t\tif (options.baseUrl.length > 0) {\n\t\t\t\tif (!AMDLoader.Utilities.endsWith(options.baseUrl, '/')) {\n\t\t\t\t\toptions.baseUrl += '/';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof options.cspNonce !== 'string') {\n\t\t\t\toptions.cspNonce = '';\n\t\t\t}\n\t\t\tif (typeof options.preferScriptTags === 'undefined') {\n\t\t\t\toptions.preferScriptTags = false;\n\t\t\t}\n\t\t\tif (options.nodeCachedData && typeof options.nodeCachedData === 'object') {\n\t\t\t\tif (typeof options.nodeCachedData.seed !== 'string') {\n\t\t\t\t\toptions.nodeCachedData.seed = 'seed';\n\t\t\t\t}\n\t\t\t\tif (typeof options.nodeCachedData.writeDelay !== 'number' || options.nodeCachedData.writeDelay < 0) {\n\t\t\t\t\toptions.nodeCachedData.writeDelay = 1000 * 7;\n\t\t\t\t}\n\t\t\t\tif (!options.nodeCachedData.path || typeof options.nodeCachedData.path !== 'string') {\n\t\t\t\t\tconst err = ensureError(new Error('INVALID cached data configuration, \\'path\\' MUST be set'));\n\t\t\t\t\terr.phase = 'configuration';\n\t\t\t\t\toptions.onError(err);\n\t\t\t\t\toptions.nodeCachedData = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn options;\n\t\t}\n\t\tstatic mergeConfigurationOptions(overwrite = null, base = null) {\n\t\t\tlet result = AMDLoader.Utilities.recursiveClone(base || {});\n\t\t\t// Merge known properties and overwrite the unknown ones\n\t\t\tAMDLoader.Utilities.forEachProperty(overwrite, (key, value) => {\n\t\t\t\tif (key === 'ignoreDuplicateModules' && typeof result.ignoreDuplicateModules !== 'undefined') {\n\t\t\t\t\tresult.ignoreDuplicateModules = result.ignoreDuplicateModules.concat(value);\n\t\t\t\t}\n\t\t\t\telse if (key === 'paths' && typeof result.paths !== 'undefined') {\n\t\t\t\t\tAMDLoader.Utilities.forEachProperty(value, (key2, value2) => result.paths[key2] = value2);\n\t\t\t\t}\n\t\t\t\telse if (key === 'config' && typeof result.config !== 'undefined') {\n\t\t\t\t\tAMDLoader.Utilities.forEachProperty(value, (key2, value2) => result.config[key2] = value2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresult[key] = AMDLoader.Utilities.recursiveClone(value);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ConfigurationOptionsUtil.validateConfigurationOptions(result);\n\t\t}\n\t}\n\tAMDLoader.ConfigurationOptionsUtil = ConfigurationOptionsUtil;\n\tclass Configuration {\n\t\tconstructor(env, options) {\n\t\t\tthis._env = env;\n\t\t\tthis.options = ConfigurationOptionsUtil.mergeConfigurationOptions(options);\n\t\t\tthis._createIgnoreDuplicateModulesMap();\n\t\t\tthis._createSortedPathsRules();\n\t\t\tif (this.options.baseUrl === '') {\n\t\t\t\tif (this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename && this._env.isNode) {\n\t\t\t\t\tlet nodeMain = this.options.nodeRequire.main.filename;\n\t\t\t\t\tlet dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\\\'));\n\t\t\t\t\tthis.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_createIgnoreDuplicateModulesMap() {\n\t\t\t// Build a map out of the ignoreDuplicateModules array\n\t\t\tthis.ignoreDuplicateModulesMap = {};\n\t\t\tfor (let i = 0; i < this.options.ignoreDuplicateModules.length; i++) {\n\t\t\t\tthis.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[i]] = true;\n\t\t\t}\n\t\t}\n\t\t_createSortedPathsRules() {\n\t\t\t// Create an array our of the paths rules, sorted descending by length to\n\t\t\t// result in a more specific -> less specific order\n\t\t\tthis.sortedPathsRules = [];\n\t\t\tAMDLoader.Utilities.forEachProperty(this.options.paths, (from, to) => {\n\t\t\t\tif (!Array.isArray(to)) {\n\t\t\t\t\tthis.sortedPathsRules.push({\n\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\tto: [to]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.sortedPathsRules.push({\n\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\tto: to\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.sortedPathsRules.sort((a, b) => {\n\t\t\t\treturn b.from.length - a.from.length;\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t * Clone current configuration and overwrite options selectively.\n\t\t * @param options The selective options to overwrite with.\n\t\t * @result A new configuration\n\t\t */\n\t\tcloneAndMerge(options) {\n\t\t\treturn new Configuration(this._env, ConfigurationOptionsUtil.mergeConfigurationOptions(options, this.options));\n\t\t}\n\t\t/**\n\t\t * Get current options bag. Useful for passing it forward to plugins.\n\t\t */\n\t\tgetOptionsLiteral() {\n\t\t\treturn this.options;\n\t\t}\n\t\t_applyPaths(moduleId) {\n\t\t\tlet pathRule;\n\t\t\tfor (let i = 0, len = this.sortedPathsRules.length; i < len; i++) {\n\t\t\t\tpathRule = this.sortedPathsRules[i];\n\t\t\t\tif (AMDLoader.Utilities.startsWith(moduleId, pathRule.from)) {\n\t\t\t\t\tlet result = [];\n\t\t\t\t\tfor (let j = 0, lenJ = pathRule.to.length; j < lenJ; j++) {\n\t\t\t\t\t\tresult.push(pathRule.to[j] + moduleId.substr(pathRule.from.length));\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [moduleId];\n\t\t}\n\t\t_addUrlArgsToUrl(url) {\n\t\t\tif (AMDLoader.Utilities.containsQueryString(url)) {\n\t\t\t\treturn url + '&' + this.options.urlArgs;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn url + '?' + this.options.urlArgs;\n\t\t\t}\n\t\t}\n\t\t_addUrlArgsIfNecessaryToUrl(url) {\n\t\t\tif (this.options.urlArgs) {\n\t\t\t\treturn this._addUrlArgsToUrl(url);\n\t\t\t}\n\t\t\treturn url;\n\t\t}\n\t\t_addUrlArgsIfNecessaryToUrls(urls) {\n\t\t\tif (this.options.urlArgs) {\n\t\t\t\tfor (let i = 0, len = urls.length; i < len; i++) {\n\t\t\t\t\turls[i] = this._addUrlArgsToUrl(urls[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn urls;\n\t\t}\n\t\t/**\n\t\t * Transform a module id to a location. Appends .js to module ids\n\t\t */\n\t\tmoduleIdToPaths(moduleId) {\n\t\t\tif (this._env.isNode) {\n\t\t\t\tconst isNodeModule = (this.options.amdModulesPattern instanceof RegExp\n\t\t\t\t\t&& !this.options.amdModulesPattern.test(moduleId));\n\t\t\t\tif (isNodeModule) {\n\t\t\t\t\t// This is a node module...\n\t\t\t\t\tif (this.isBuild()) {\n\t\t\t\t\t\t// ...and we are at build time, drop it\n\t\t\t\t\t\treturn ['empty:'];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// ...and at runtime we create a `shortcut`-path\n\t\t\t\t\t\treturn ['node|' + moduleId];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet result = moduleId;\n\t\t\tlet results;\n\t\t\tif (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.isAbsolutePath(result)) {\n\t\t\t\tresults = this._applyPaths(result);\n\t\t\t\tfor (let i = 0, len = results.length; i < len; i++) {\n\t\t\t\t\tif (this.isBuild() && results[i] === 'empty:') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!AMDLoader.Utilities.isAbsolutePath(results[i])) {\n\t\t\t\t\t\tresults[i] = this.options.baseUrl + results[i];\n\t\t\t\t\t}\n\t\t\t\t\tif (!AMDLoader.Utilities.endsWith(results[i], '.js') && !AMDLoader.Utilities.containsQueryString(results[i])) {\n\t\t\t\t\t\tresults[i] = results[i] + '.js';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.containsQueryString(result)) {\n\t\t\t\t\tresult = result + '.js';\n\t\t\t\t}\n\t\t\t\tresults = [result];\n\t\t\t}\n\t\t\treturn this._addUrlArgsIfNecessaryToUrls(results);\n\t\t}\n\t\t/**\n\t\t * Transform a module id or url to a location.\n\t\t */\n\t\trequireToUrl(url) {\n\t\t\tlet result = url;\n\t\t\tif (!AMDLoader.Utilities.isAbsolutePath(result)) {\n\t\t\t\tresult = this._applyPaths(result)[0];\n\t\t\t\tif (!AMDLoader.Utilities.isAbsolutePath(result)) {\n\t\t\t\t\tresult = this.options.baseUrl + result;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._addUrlArgsIfNecessaryToUrl(result);\n\t\t}\n\t\t/**\n\t\t * Flag to indicate if current execution is as part of a build.\n\t\t */\n\t\tisBuild() {\n\t\t\treturn this.options.isBuild;\n\t\t}\n\t\tshouldInvokeFactory(strModuleId) {\n\t\t\tif (!this.options.isBuild) {\n\t\t\t\t// outside of a build, all factories should be invoked\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// during a build, only explicitly marked or anonymous modules get their factories invoked\n\t\t\tif (AMDLoader.Utilities.isAnonymousModule(strModuleId)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (this.options.buildForceInvokeFactory && this.options.buildForceInvokeFactory[strModuleId]) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * Test if module `moduleId` is expected to be defined multiple times\n\t\t */\n\t\tisDuplicateMessageIgnoredFor(moduleId) {\n\t\t\treturn this.ignoreDuplicateModulesMap.hasOwnProperty(moduleId);\n\t\t}\n\t\t/**\n\t\t * Get the configuration settings for the provided module id\n\t\t */\n\t\tgetConfigForModule(moduleId) {\n\t\t\tif (this.options.config) {\n\t\t\t\treturn this.options.config[moduleId];\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Should errors be caught when executing module factories?\n\t\t */\n\t\tshouldCatchError() {\n\t\t\treturn this.options.catchError;\n\t\t}\n\t\t/**\n\t\t * Should statistics be recorded?\n\t\t */\n\t\tshouldRecordStats() {\n\t\t\treturn this.options.recordStats;\n\t\t}\n\t\t/**\n\t\t * Forward an error to the error handler.\n\t\t */\n\t\tonError(err) {\n\t\t\tthis.options.onError(err);\n\t\t}\n\t}\n\tAMDLoader.Configuration = Configuration;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n\t/**\n\t * Load `scriptSrc` only once (avoid multiple ` + ) + ); +} +function escapeScript(script) { + return script.replace(/ + * + * @name UNSAFE_useScrollRestoration + * @category Hooks + * @mode framework + * @mode data + * @param options Options + * @param options.getKey A function that returns a key to use for scroll restoration. + * This is useful for custom scroll restoration logic, such as using only the pathname + * so that subsequent navigations to prior paths will restore the scroll. Defaults + * to `location.key`. + * @param options.storageKey The key to use for storing scroll positions in + * `sessionStorage`. Defaults to `"react-router-scroll-positions"`. + * @returns {void} + */ +declare function useScrollRestoration({ getKey, storageKey, }?: { + getKey?: GetScrollRestorationKeyFunction; + storageKey?: string; +}): void; +/** + * Set up a callback to be fired on [Window's `beforeunload` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + * + * @public + * @category Hooks + * @param callback The callback to be called when the [`beforeunload` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) + * is fired. + * @param options Options + * @param options.capture If `true`, the event will be captured during the capture + * phase. Defaults to `false`. + * @returns {void} + */ +declare function useBeforeUnload(callback: (event: BeforeUnloadEvent) => any, options?: { + capture?: boolean; +}): void; +/** + * Wrapper around {@link useBlocker} to show a [`window.confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm) + * prompt to users instead of building a custom UI with {@link useBlocker}. + * + * The `unstable_` flag will not be removed because this technique has a lot of + * rough edges and behaves very differently (and incorrectly sometimes) across + * browsers if users click addition back/forward navigations while the + * confirmation is open. Use at your own risk. + * + * @example + * function ImportantForm() { + * let [value, setValue] = React.useState(""); + * + * // Block navigating elsewhere when data has been entered into the input + * unstable_usePrompt({ + * message: "Are you sure?", + * when: ({ currentLocation, nextLocation }) => + * value !== "" && + * currentLocation.pathname !== nextLocation.pathname, + * }); + * + * return ( + *
+ * + * + *
+ * ); + * } + * + * @name unstable_usePrompt + * @public + * @category Hooks + * @mode framework + * @mode data + * @param options Options + * @param options.message The message to show in the confirmation dialog. + * @param options.when A boolean or a function that returns a boolean indicating + * whether to block the navigation. If a function is provided, it will receive an + * object with `currentLocation` and `nextLocation` properties. + * @returns {void} + */ +declare function usePrompt({ when, message, }: { + when: boolean | BlockerFunction; + message: string; +}): void; +/** + * This hook returns `true` when there is an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) + * to the specified location. This can be used to apply finer-grained styles to + * elements to further customize the view transition. This requires that view + * transitions have been enabled for the given navigation via {@link LinkProps.viewTransition} + * (or the `Form`, `submit`, or `navigate` call) + * + * @public + * @category Hooks + * @mode framework + * @mode data + * @param to The {@link To} location to check for an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API). + * @param options Options + * @param options.relative The relative routing type to use when resolving the + * `to` location, defaults to `"route"`. See {@link RelativeRoutingType} for more details. + * @returns `true` if there is an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) + * to the specified {@link Location}, otherwise `false`. + */ +declare function useViewTransitionState(to: To, { relative }?: { + relative?: RelativeRoutingType; +}): boolean; + +interface StaticRouterProps { + basename?: string; + children?: React.ReactNode; + location: Partial | string; +} +/** + * A `` that may not navigate to any other location. This is useful + * on the server where there is no stateful UI. + * + * @public + * @category Declarative Routers + * @mode declarative + * @param props Props + * @param props.basename The base URL for the static router (default: `/`) + * @param props.children The child elements to render inside the static router + * @param props.location The location to render the static router at (default: `/`) + * @returns A React element that renders the static router + */ +declare function StaticRouter({ basename, children, location: locationProp, }: StaticRouterProps): React.JSX.Element; +interface StaticRouterProviderProps { + context: StaticHandlerContext; + router: Router$1; + hydrate?: boolean; + nonce?: string; +} +/** + * A Data Router that may not navigate to any other location. This is useful + * on the server where there is no stateful UI. + * + * @example + * export async function handleRequest(request: Request) { + * let { query, dataRoutes } = createStaticHandler(routes); + * let context = await query(request)); + * + * if (context instanceof Response) { + * return context; + * } + * + * let router = createStaticRouter(dataRoutes, context); + * return new Response( + * ReactDOMServer.renderToString(), + * { headers: { "Content-Type": "text/html" } } + * ); + * } + * + * @public + * @category Data Routers + * @mode data + * @param props Props + * @param props.context The {@link StaticHandlerContext} returned from `staticHandler.query()` + * @param props.router The static data router from {@link createStaticRouter} + * @param props.hydrate Whether to hydrate the router on the client (default `true`) + * @param props.nonce The [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce) + * to use for the hydration `` + ) + ); +} +function escapeScript(script) { + return script.replace(/ + * + * @name UNSAFE_useScrollRestoration + * @category Hooks + * @mode framework + * @mode data + * @param options Options + * @param options.getKey A function that returns a key to use for scroll restoration. + * This is useful for custom scroll restoration logic, such as using only the pathname + * so that subsequent navigations to prior paths will restore the scroll. Defaults + * to `location.key`. + * @param options.storageKey The key to use for storing scroll positions in + * `sessionStorage`. Defaults to `"react-router-scroll-positions"`. + * @returns {void} + */ +declare function useScrollRestoration({ getKey, storageKey, }?: { + getKey?: GetScrollRestorationKeyFunction; + storageKey?: string; +}): void; +/** + * Set up a callback to be fired on [Window's `beforeunload` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). + * + * @public + * @category Hooks + * @param callback The callback to be called when the [`beforeunload` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) + * is fired. + * @param options Options + * @param options.capture If `true`, the event will be captured during the capture + * phase. Defaults to `false`. + * @returns {void} + */ +declare function useBeforeUnload(callback: (event: BeforeUnloadEvent) => any, options?: { + capture?: boolean; +}): void; +/** + * Wrapper around {@link useBlocker} to show a [`window.confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm) + * prompt to users instead of building a custom UI with {@link useBlocker}. + * + * The `unstable_` flag will not be removed because this technique has a lot of + * rough edges and behaves very differently (and incorrectly sometimes) across + * browsers if users click addition back/forward navigations while the + * confirmation is open. Use at your own risk. + * + * @example + * function ImportantForm() { + * let [value, setValue] = React.useState(""); + * + * // Block navigating elsewhere when data has been entered into the input + * unstable_usePrompt({ + * message: "Are you sure?", + * when: ({ currentLocation, nextLocation }) => + * value !== "" && + * currentLocation.pathname !== nextLocation.pathname, + * }); + * + * return ( + *
+ * + * + *
+ * ); + * } + * + * @name unstable_usePrompt + * @public + * @category Hooks + * @mode framework + * @mode data + * @param options Options + * @param options.message The message to show in the confirmation dialog. + * @param options.when A boolean or a function that returns a boolean indicating + * whether to block the navigation. If a function is provided, it will receive an + * object with `currentLocation` and `nextLocation` properties. + * @returns {void} + */ +declare function usePrompt({ when, message, }: { + when: boolean | BlockerFunction; + message: string; +}): void; +/** + * This hook returns `true` when there is an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) + * to the specified location. This can be used to apply finer-grained styles to + * elements to further customize the view transition. This requires that view + * transitions have been enabled for the given navigation via {@link LinkProps.viewTransition} + * (or the `Form`, `submit`, or `navigate` call) + * + * @public + * @category Hooks + * @mode framework + * @mode data + * @param to The {@link To} location to check for an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API). + * @param options Options + * @param options.relative The relative routing type to use when resolving the + * `to` location, defaults to `"route"`. See {@link RelativeRoutingType} for more details. + * @returns `true` if there is an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) + * to the specified {@link Location}, otherwise `false`. + */ +declare function useViewTransitionState(to: To, { relative }?: { + relative?: RelativeRoutingType; +}): boolean; + +interface StaticRouterProps { + basename?: string; + children?: React.ReactNode; + location: Partial | string; +} +/** + * A `` that may not navigate to any other location. This is useful + * on the server where there is no stateful UI. + * + * @public + * @category Declarative Routers + * @mode declarative + * @param props Props + * @param props.basename The base URL for the static router (default: `/`) + * @param props.children The child elements to render inside the static router + * @param props.location The location to render the static router at (default: `/`) + * @returns A React element that renders the static router + */ +declare function StaticRouter({ basename, children, location: locationProp, }: StaticRouterProps): React.JSX.Element; +interface StaticRouterProviderProps { + context: StaticHandlerContext; + router: Router$1; + hydrate?: boolean; + nonce?: string; +} +/** + * A Data Router that may not navigate to any other location. This is useful + * on the server where there is no stateful UI. + * + * @example + * export async function handleRequest(request: Request) { + * let { query, dataRoutes } = createStaticHandler(routes); + * let context = await query(request)); + * + * if (context instanceof Response) { + * return context; + * } + * + * let router = createStaticRouter(dataRoutes, context); + * return new Response( + * ReactDOMServer.renderToString(), + * { headers: { "Content-Type": "text/html" } } + * ); + * } + * + * @public + * @category Data Routers + * @mode data + * @param props Props + * @param props.context The {@link StaticHandlerContext} returned from `staticHandler.query()` + * @param props.router The static data router from {@link createStaticRouter} + * @param props.hydrate Whether to hydrate the router on the client (default `true`) + * @param props.nonce The [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce) + * to use for the hydration `` + ) + ); +} +function escapeScript(script) { + return script.replace(/